From e4a5aaa314b53a69dbf13a164a5bf9edffe0a646 Mon Sep 17 00:00:00 2001 From: julienbrg Date: Tue, 3 Dec 2024 11:15:08 +0100 Subject: [PATCH] add arbitrum --- README.md | 18 +- deploy/deploy-gov.ts | 4 +- deployments/arbitrumSepolia/.chainId | 1 + .../arbitrumSepolia/CrosschainGov.json | 2520 ++++++++++++++++ .../arbitrumSepolia/CrosschainNFT.json | 2098 +++++++++++++ .../ProofHandler.json | 16 - .../77ec5f062950e8c4875fd27ffb65d267.json | 186 ++ .../96a9008abeaccbd30a9b75989ce7f0fd.json | 0 .../c27a34cff02617821c386fb97b476bc1.json | 147 + deployments/baseSepolia/.chainId | 1 + deployments/baseSepolia/CrosschainGov.json | 2520 ++++++++++++++++ deployments/baseSepolia/CrosschainNFT.json | 2098 +++++++++++++ deployments/baseSepolia/ProofHandler.json | 149 + .../77ec5f062950e8c4875fd27ffb65d267.json | 186 ++ .../96a9008abeaccbd30a9b75989ce7f0fd.json | 186 ++ .../c27a34cff02617821c386fb97b476bc1.json | 147 + deployments/op-sepolia/CrosschainGov.json | 2584 ----------------- deployments/op-sepolia/CrosschainNFT.json | 2050 ------------- .../{op-sepolia => opSepolia}/.chainId | 0 deployments/opSepolia/CrosschainGov.json | 2520 ++++++++++++++++ deployments/opSepolia/CrosschainNFT.json | 2098 +++++++++++++ deployments/opSepolia/ProofHandler.json | 149 + .../77ec5f062950e8c4875fd27ffb65d267.json | 186 ++ .../96a9008abeaccbd30a9b75989ce7f0fd.json | 186 ++ .../c27a34cff02617821c386fb97b476bc1.json | 147 + deployments/sepolia/CrosschainGov.json | 83 +- deployments/sepolia/CrosschainNFT.json | 383 ++- deployments/sepolia/ProofHandler.json | 16 - .../77ec5f062950e8c4875fd27ffb65d267.json | 186 ++ .../c27a34cff02617821c386fb97b476bc1.json | 147 + hardhat.config.ts | 35 +- package.json | 9 +- 32 files changed, 16247 insertions(+), 4809 deletions(-) create mode 100644 deployments/arbitrumSepolia/.chainId create mode 100644 deployments/arbitrumSepolia/CrosschainGov.json create mode 100644 deployments/arbitrumSepolia/CrosschainNFT.json rename deployments/{op-sepolia => arbitrumSepolia}/ProofHandler.json (94%) create mode 100644 deployments/arbitrumSepolia/solcInputs/77ec5f062950e8c4875fd27ffb65d267.json rename deployments/{op-sepolia => arbitrumSepolia}/solcInputs/96a9008abeaccbd30a9b75989ce7f0fd.json (100%) create mode 100644 deployments/arbitrumSepolia/solcInputs/c27a34cff02617821c386fb97b476bc1.json create mode 100644 deployments/baseSepolia/.chainId create mode 100644 deployments/baseSepolia/CrosschainGov.json create mode 100644 deployments/baseSepolia/CrosschainNFT.json create mode 100644 deployments/baseSepolia/ProofHandler.json create mode 100644 deployments/baseSepolia/solcInputs/77ec5f062950e8c4875fd27ffb65d267.json create mode 100644 deployments/baseSepolia/solcInputs/96a9008abeaccbd30a9b75989ce7f0fd.json create mode 100644 deployments/baseSepolia/solcInputs/c27a34cff02617821c386fb97b476bc1.json delete mode 100644 deployments/op-sepolia/CrosschainGov.json delete mode 100644 deployments/op-sepolia/CrosschainNFT.json rename deployments/{op-sepolia => opSepolia}/.chainId (100%) create mode 100644 deployments/opSepolia/CrosschainGov.json create mode 100644 deployments/opSepolia/CrosschainNFT.json create mode 100644 deployments/opSepolia/ProofHandler.json create mode 100644 deployments/opSepolia/solcInputs/77ec5f062950e8c4875fd27ffb65d267.json create mode 100644 deployments/opSepolia/solcInputs/96a9008abeaccbd30a9b75989ce7f0fd.json create mode 100644 deployments/opSepolia/solcInputs/c27a34cff02617821c386fb97b476bc1.json create mode 100644 deployments/sepolia/solcInputs/77ec5f062950e8c4875fd27ffb65d267.json create mode 100644 deployments/sepolia/solcInputs/c27a34cff02617821c386fb97b476bc1.json diff --git a/README.md b/README.md index 9a35ecf..7565633 100644 --- a/README.md +++ b/README.md @@ -62,7 +62,9 @@ Then, you can go ahead and deploy: ```bash pnpm crosschain:sepolia -pnpm crosschain:op-sepolia +pnpm crosschain:opSepolia +pnpm crosschain:baseSepolia +pnpm crosschain:arbitrum-sepolia ``` Your DAO will be deployed on every networks at the same address. @@ -72,24 +74,24 @@ Then you can follow these steps to verify that proofs can be generated on home c ```bash npx hardhat run scripts/propose.ts --network sepolia npx hardhat run scripts/verify-proof.ts --network sepolia -npx hardhat run scripts/claim-membership.ts --network op-sepolia +npx hardhat run scripts/claim-membership.ts --network opSepolia npx hardhat run scripts/gov-burn.ts --network sepolia npx hardhat run scripts/verify-gov-burn-proof.ts --network sepolia -npx hardhat run scripts/claim-gov-burn.ts --network op-sepolia +npx hardhat run scripts/claim-gov-burn.ts --network opSepolia npx hardhat run scripts/verify-metadata-proof.ts --network sepolia -npx hardhat run scripts/claim-metadata-update.ts --network op-sepolia +npx hardhat run scripts/claim-metadata-update.ts --network opSepolia npx hardhat run scripts/verify-manifesto-proof.ts --network sepolia -npx hardhat run scripts/claim-manifesto-update.ts --network op-sepolia +npx hardhat run scripts/claim-manifesto-update.ts --network opSepolia npx hardhat run scripts/gov-voting-delay.ts --network sepolia npx hardhat run scripts/verify-voting-delay-proof.ts --network sepolia -npx hardhat run scripts/claim-voting-delay.ts --network op-sepolia +npx hardhat run scripts/claim-voting-delay.ts --network opSepolia npx hardhat run scripts/verify-delegation-proof.ts --network sepolia -npx hardhat run scripts/claim-delegation.ts --network op-sepolia +npx hardhat run scripts/claim-delegation.ts --network opSepolia ``` ## Security @@ -117,7 +119,7 @@ The following functions are `onlyOwner`, and since the NFT contract ownership is | Optimism Mainnet | 10 | [Documentation](https://docs.optimism.io/chain/networks#op-mainnet) | | Base Mainnet | 8453 | [Documentation](https://docs.base.org/docs/network-information#base-mainnet) | | Sepolia Testnet | 11155111 | [Documentation](https://ethereum.org/nb/developers/docs/networks/#sepolia) | -| OP Sepolia Testnet | 11155420 | [Documentation](https://docs.optimism.io/chain/networks#op-sepolia) | +| OP Sepolia Testnet | 11155420 | [Documentation](https://docs.optimism.io/chain/networks#opSepolia) | | Base Sepolia Testnet | 84532 | [Documentation](https://docs.base.org/docs/network-information/#base-testnet-sepolia) | ## Core Dependencies diff --git a/deploy/deploy-gov.ts b/deploy/deploy-gov.ts index 6473a16..03160e0 100644 --- a/deploy/deploy-gov.ts +++ b/deploy/deploy-gov.ts @@ -218,7 +218,7 @@ export default async ({ getNamedAccounts, deployments }: any) => { break - case "op-sepolia": + case "opSepolia": try { console.log( "NFT contract deployed:", @@ -274,7 +274,7 @@ export default async ({ getNamedAccounts, deployments }: any) => { break - case "base-sepolia": + case "baseSepolia": try { console.log( "NFT contract deployed:", diff --git a/deployments/arbitrumSepolia/.chainId b/deployments/arbitrumSepolia/.chainId new file mode 100644 index 0000000..71ba4d6 --- /dev/null +++ b/deployments/arbitrumSepolia/.chainId @@ -0,0 +1 @@ +421614 \ No newline at end of file diff --git a/deployments/arbitrumSepolia/CrosschainGov.json b/deployments/arbitrumSepolia/CrosschainGov.json new file mode 100644 index 0000000..94e470b --- /dev/null +++ b/deployments/arbitrumSepolia/CrosschainGov.json @@ -0,0 +1,2520 @@ +{ + "address": "0x3F92DdC0c99d9B873C424f4066F252adb72192D9", + "abi": [ + { + "inputs": [ + { + "internalType": "uint256", + "name": "_home", + "type": "uint256" + }, + { + "internalType": "contract IVotes", + "name": "_token", + "type": "address" + }, + { + "internalType": "string", + "name": "_manifestoCid", + "type": "string" + }, + { + "internalType": "string", + "name": "_name", + "type": "string" + }, + { + "internalType": "uint48", + "name": "_votingDelay", + "type": "uint48" + }, + { + "internalType": "uint32", + "name": "_votingPeriod", + "type": "uint32" + }, + { + "internalType": "uint256", + "name": "_proposalThreshold", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_quorum", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [], + "name": "CheckpointUnorderedInsertion", + "type": "error" + }, + { + "inputs": [], + "name": "FailedCall", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "voter", + "type": "address" + } + ], + "name": "GovernorAlreadyCastVote", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "proposalId", + "type": "uint256" + } + ], + "name": "GovernorAlreadyQueuedProposal", + "type": "error" + }, + { + "inputs": [], + "name": "GovernorDisabledDeposit", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "proposer", + "type": "address" + }, + { + "internalType": "uint256", + "name": "votes", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "threshold", + "type": "uint256" + } + ], + "name": "GovernorInsufficientProposerVotes", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "targets", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "calldatas", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "values", + "type": "uint256" + } + ], + "name": "GovernorInvalidProposalLength", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "quorumNumerator", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "quorumDenominator", + "type": "uint256" + } + ], + "name": "GovernorInvalidQuorumFraction", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "voter", + "type": "address" + } + ], + "name": "GovernorInvalidSignature", + "type": "error" + }, + { + "inputs": [], + "name": "GovernorInvalidVoteParams", + "type": "error" + }, + { + "inputs": [], + "name": "GovernorInvalidVoteType", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "votingPeriod", + "type": "uint256" + } + ], + "name": "GovernorInvalidVotingPeriod", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "proposalId", + "type": "uint256" + } + ], + "name": "GovernorNonexistentProposal", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "proposalId", + "type": "uint256" + } + ], + "name": "GovernorNotQueuedProposal", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "GovernorOnlyExecutor", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "GovernorOnlyProposer", + "type": "error" + }, + { + "inputs": [], + "name": "GovernorQueueNotImplemented", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "proposer", + "type": "address" + } + ], + "name": "GovernorRestrictedProposer", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "proposalId", + "type": "uint256" + }, + { + "internalType": "enum IGovernor.ProposalState", + "name": "current", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "expectedStates", + "type": "bytes32" + } + ], + "name": "GovernorUnexpectedProposalState", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "currentNonce", + "type": "uint256" + } + ], + "name": "InvalidAccountNonce", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidShortString", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint8", + "name": "bits", + "type": "uint8" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "SafeCastOverflowedUintDowncast", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "str", + "type": "string" + } + ], + "name": "StringTooLong", + "type": "error" + }, + { + "anonymous": false, + "inputs": [], + "name": "EIP712DomainChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "enum Gov.OperationType", + "name": "operationType", + "type": "uint8" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "oldValue", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newValue", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + } + ], + "name": "GovernanceParameterUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "string", + "name": "oldManifesto", + "type": "string" + }, + { + "indexed": false, + "internalType": "string", + "name": "newManifesto", + "type": "string" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + } + ], + "name": "ManifestoUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "proposalId", + "type": "uint256" + } + ], + "name": "ProposalCanceled", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "proposalId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "address", + "name": "proposer", + "type": "address" + }, + { + "indexed": false, + "internalType": "address[]", + "name": "targets", + "type": "address[]" + }, + { + "indexed": false, + "internalType": "uint256[]", + "name": "values", + "type": "uint256[]" + }, + { + "indexed": false, + "internalType": "string[]", + "name": "signatures", + "type": "string[]" + }, + { + "indexed": false, + "internalType": "bytes[]", + "name": "calldatas", + "type": "bytes[]" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "voteStart", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "voteEnd", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "string", + "name": "description", + "type": "string" + } + ], + "name": "ProposalCreated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "proposalId", + "type": "uint256" + } + ], + "name": "ProposalExecuted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "proposalId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "etaSeconds", + "type": "uint256" + } + ], + "name": "ProposalQueued", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "oldProposalThreshold", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newProposalThreshold", + "type": "uint256" + } + ], + "name": "ProposalThresholdSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "oldQuorumNumerator", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newQuorumNumerator", + "type": "uint256" + } + ], + "name": "QuorumNumeratorUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "voter", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "proposalId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint8", + "name": "support", + "type": "uint8" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "weight", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "string", + "name": "reason", + "type": "string" + } + ], + "name": "VoteCast", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "voter", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "proposalId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint8", + "name": "support", + "type": "uint8" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "weight", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "string", + "name": "reason", + "type": "string" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "params", + "type": "bytes" + } + ], + "name": "VoteCastWithParams", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "oldVotingDelay", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newVotingDelay", + "type": "uint256" + } + ], + "name": "VotingDelaySet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "oldVotingPeriod", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newVotingPeriod", + "type": "uint256" + } + ], + "name": "VotingPeriodSet", + "type": "event" + }, + { + "inputs": [], + "name": "BALLOT_TYPEHASH", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "CLOCK_MODE", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "COUNTING_MODE", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [], + "name": "EXTENDED_BALLOT_TYPEHASH", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "targets", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "values", + "type": "uint256[]" + }, + { + "internalType": "bytes[]", + "name": "calldatas", + "type": "bytes[]" + }, + { + "internalType": "bytes32", + "name": "descriptionHash", + "type": "bytes32" + } + ], + "name": "cancel", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "proposalId", + "type": "uint256" + }, + { + "internalType": "uint8", + "name": "support", + "type": "uint8" + } + ], + "name": "castVote", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "proposalId", + "type": "uint256" + }, + { + "internalType": "uint8", + "name": "support", + "type": "uint8" + }, + { + "internalType": "address", + "name": "voter", + "type": "address" + }, + { + "internalType": "bytes", + "name": "signature", + "type": "bytes" + } + ], + "name": "castVoteBySig", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "proposalId", + "type": "uint256" + }, + { + "internalType": "uint8", + "name": "support", + "type": "uint8" + }, + { + "internalType": "string", + "name": "reason", + "type": "string" + } + ], + "name": "castVoteWithReason", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "proposalId", + "type": "uint256" + }, + { + "internalType": "uint8", + "name": "support", + "type": "uint8" + }, + { + "internalType": "string", + "name": "reason", + "type": "string" + }, + { + "internalType": "bytes", + "name": "params", + "type": "bytes" + } + ], + "name": "castVoteWithReasonAndParams", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "proposalId", + "type": "uint256" + }, + { + "internalType": "uint8", + "name": "support", + "type": "uint8" + }, + { + "internalType": "address", + "name": "voter", + "type": "address" + }, + { + "internalType": "string", + "name": "reason", + "type": "string" + }, + { + "internalType": "bytes", + "name": "params", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "signature", + "type": "bytes" + } + ], + "name": "castVoteWithReasonAndParamsBySig", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "proof", + "type": "bytes" + } + ], + "name": "claimParameterUpdate", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "clock", + "outputs": [ + { + "internalType": "uint48", + "name": "", + "type": "uint48" + } + ], + "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": [ + { + "internalType": "address[]", + "name": "targets", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "values", + "type": "uint256[]" + }, + { + "internalType": "bytes[]", + "name": "calldatas", + "type": "bytes[]" + }, + { + "internalType": "bytes32", + "name": "descriptionHash", + "type": "bytes32" + } + ], + "name": "execute", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint8", + "name": "operationType", + "type": "uint8" + }, + { + "internalType": "bytes", + "name": "value", + "type": "bytes" + } + ], + "name": "generateParameterProof", + "outputs": [ + { + "internalType": "bytes", + "name": "proof", + "type": "bytes" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "timepoint", + "type": "uint256" + } + ], + "name": "getVotes", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "timepoint", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "params", + "type": "bytes" + } + ], + "name": "getVotesWithParams", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "proposalId", + "type": "uint256" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "hasVoted", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "targets", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "values", + "type": "uint256[]" + }, + { + "internalType": "bytes[]", + "name": "calldatas", + "type": "bytes[]" + }, + { + "internalType": "bytes32", + "name": "descriptionHash", + "type": "bytes32" + } + ], + "name": "hashProposal", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [], + "name": "home", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "manifesto", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "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": "", + "type": "address" + }, + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "uint256[]", + "name": "", + "type": "uint256[]" + }, + { + "internalType": "uint256[]", + "name": "", + "type": "uint256[]" + }, + { + "internalType": "bytes", + "name": "", + "type": "bytes" + } + ], + "name": "onERC1155BatchReceived", + "outputs": [ + { + "internalType": "bytes4", + "name": "", + "type": "bytes4" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "", + "type": "bytes" + } + ], + "name": "onERC1155Received", + "outputs": [ + { + "internalType": "bytes4", + "name": "", + "type": "bytes4" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "", + "type": "bytes" + } + ], + "name": "onERC721Received", + "outputs": [ + { + "internalType": "bytes4", + "name": "", + "type": "bytes4" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "proposalId", + "type": "uint256" + } + ], + "name": "proposalDeadline", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "proposalId", + "type": "uint256" + } + ], + "name": "proposalEta", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "proposalNeedsQueuing", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "proposalId", + "type": "uint256" + } + ], + "name": "proposalProposer", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "proposalId", + "type": "uint256" + } + ], + "name": "proposalSnapshot", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "proposalThreshold", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "proposalId", + "type": "uint256" + } + ], + "name": "proposalVotes", + "outputs": [ + { + "internalType": "uint256", + "name": "againstVotes", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "forVotes", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "abstainVotes", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "targets", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "values", + "type": "uint256[]" + }, + { + "internalType": "bytes[]", + "name": "calldatas", + "type": "bytes[]" + }, + { + "internalType": "string", + "name": "description", + "type": "string" + } + ], + "name": "propose", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "targets", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "values", + "type": "uint256[]" + }, + { + "internalType": "bytes[]", + "name": "calldatas", + "type": "bytes[]" + }, + { + "internalType": "bytes32", + "name": "descriptionHash", + "type": "bytes32" + } + ], + "name": "queue", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "blockNumber", + "type": "uint256" + } + ], + "name": "quorum", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "quorumDenominator", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "timepoint", + "type": "uint256" + } + ], + "name": "quorumNumerator", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "quorumNumerator", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "target", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "relay", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "newManifesto", + "type": "string" + } + ], + "name": "setManifesto", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "newProposalThreshold", + "type": "uint256" + } + ], + "name": "setProposalThreshold", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint48", + "name": "newVotingDelay", + "type": "uint48" + } + ], + "name": "setVotingDelay", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "newVotingPeriod", + "type": "uint32" + } + ], + "name": "setVotingPeriod", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "proposalId", + "type": "uint256" + } + ], + "name": "state", + "outputs": [ + { + "internalType": "enum IGovernor.ProposalState", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "interfaceId", + "type": "bytes4" + } + ], + "name": "supportsInterface", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "token", + "outputs": [ + { + "internalType": "contract IERC5805", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "newQuorumNumerator", + "type": "uint256" + } + ], + "name": "updateQuorumNumerator", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "version", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "votingDelay", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "votingPeriod", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "stateMutability": "payable", + "type": "receive" + } + ], + "args": [ + 11155111, + "0x8583CEbA0d2C5cAe1a1BCff975Faa97063D14953", + "https://bafkreifnnreoxxgkhty7v2w3qwiie6cfxpv3vcco2xldekfvbiem3nm6dm.ipfs.w3s.link/", + "Test DAO", + 0, + 200, + 1, + 5 + ], + "numDeployments": 1, + "solcInputHash": "77ec5f062950e8c4875fd27ffb65d267", + "metadata": "{\"compiler\":{\"version\":\"0.8.20+commit.a1b79de6\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_home\",\"type\":\"uint256\"},{\"internalType\":\"contract IVotes\",\"name\":\"_token\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"_manifestoCid\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"_name\",\"type\":\"string\"},{\"internalType\":\"uint48\",\"name\":\"_votingDelay\",\"type\":\"uint48\"},{\"internalType\":\"uint32\",\"name\":\"_votingPeriod\",\"type\":\"uint32\"},{\"internalType\":\"uint256\",\"name\":\"_proposalThreshold\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_quorum\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"CheckpointUnorderedInsertion\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"FailedCall\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"voter\",\"type\":\"address\"}],\"name\":\"GovernorAlreadyCastVote\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"proposalId\",\"type\":\"uint256\"}],\"name\":\"GovernorAlreadyQueuedProposal\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"GovernorDisabledDeposit\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"proposer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"votes\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"threshold\",\"type\":\"uint256\"}],\"name\":\"GovernorInsufficientProposerVotes\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"targets\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"calldatas\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"values\",\"type\":\"uint256\"}],\"name\":\"GovernorInvalidProposalLength\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"quorumNumerator\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"quorumDenominator\",\"type\":\"uint256\"}],\"name\":\"GovernorInvalidQuorumFraction\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"voter\",\"type\":\"address\"}],\"name\":\"GovernorInvalidSignature\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"GovernorInvalidVoteParams\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"GovernorInvalidVoteType\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"votingPeriod\",\"type\":\"uint256\"}],\"name\":\"GovernorInvalidVotingPeriod\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"proposalId\",\"type\":\"uint256\"}],\"name\":\"GovernorNonexistentProposal\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"proposalId\",\"type\":\"uint256\"}],\"name\":\"GovernorNotQueuedProposal\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"GovernorOnlyExecutor\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"GovernorOnlyProposer\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"GovernorQueueNotImplemented\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"proposer\",\"type\":\"address\"}],\"name\":\"GovernorRestrictedProposer\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"proposalId\",\"type\":\"uint256\"},{\"internalType\":\"enum IGovernor.ProposalState\",\"name\":\"current\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"expectedStates\",\"type\":\"bytes32\"}],\"name\":\"GovernorUnexpectedProposalState\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"currentNonce\",\"type\":\"uint256\"}],\"name\":\"InvalidAccountNonce\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidShortString\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint8\",\"name\":\"bits\",\"type\":\"uint8\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"SafeCastOverflowedUintDowncast\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"str\",\"type\":\"string\"}],\"name\":\"StringTooLong\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[],\"name\":\"EIP712DomainChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"enum Gov.OperationType\",\"name\":\"operationType\",\"type\":\"uint8\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"oldValue\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newValue\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"}],\"name\":\"GovernanceParameterUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"string\",\"name\":\"oldManifesto\",\"type\":\"string\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"newManifesto\",\"type\":\"string\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"}],\"name\":\"ManifestoUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"proposalId\",\"type\":\"uint256\"}],\"name\":\"ProposalCanceled\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"proposalId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"proposer\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address[]\",\"name\":\"targets\",\"type\":\"address[]\"},{\"indexed\":false,\"internalType\":\"uint256[]\",\"name\":\"values\",\"type\":\"uint256[]\"},{\"indexed\":false,\"internalType\":\"string[]\",\"name\":\"signatures\",\"type\":\"string[]\"},{\"indexed\":false,\"internalType\":\"bytes[]\",\"name\":\"calldatas\",\"type\":\"bytes[]\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"voteStart\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"voteEnd\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"description\",\"type\":\"string\"}],\"name\":\"ProposalCreated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"proposalId\",\"type\":\"uint256\"}],\"name\":\"ProposalExecuted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"proposalId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"etaSeconds\",\"type\":\"uint256\"}],\"name\":\"ProposalQueued\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"oldProposalThreshold\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newProposalThreshold\",\"type\":\"uint256\"}],\"name\":\"ProposalThresholdSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"oldQuorumNumerator\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newQuorumNumerator\",\"type\":\"uint256\"}],\"name\":\"QuorumNumeratorUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"voter\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"proposalId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"support\",\"type\":\"uint8\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"weight\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"reason\",\"type\":\"string\"}],\"name\":\"VoteCast\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"voter\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"proposalId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"support\",\"type\":\"uint8\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"weight\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"reason\",\"type\":\"string\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"params\",\"type\":\"bytes\"}],\"name\":\"VoteCastWithParams\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"oldVotingDelay\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newVotingDelay\",\"type\":\"uint256\"}],\"name\":\"VotingDelaySet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"oldVotingPeriod\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newVotingPeriod\",\"type\":\"uint256\"}],\"name\":\"VotingPeriodSet\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"BALLOT_TYPEHASH\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"CLOCK_MODE\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"COUNTING_MODE\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"EXTENDED_BALLOT_TYPEHASH\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"targets\",\"type\":\"address[]\"},{\"internalType\":\"uint256[]\",\"name\":\"values\",\"type\":\"uint256[]\"},{\"internalType\":\"bytes[]\",\"name\":\"calldatas\",\"type\":\"bytes[]\"},{\"internalType\":\"bytes32\",\"name\":\"descriptionHash\",\"type\":\"bytes32\"}],\"name\":\"cancel\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"proposalId\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"support\",\"type\":\"uint8\"}],\"name\":\"castVote\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"proposalId\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"support\",\"type\":\"uint8\"},{\"internalType\":\"address\",\"name\":\"voter\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"signature\",\"type\":\"bytes\"}],\"name\":\"castVoteBySig\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"proposalId\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"support\",\"type\":\"uint8\"},{\"internalType\":\"string\",\"name\":\"reason\",\"type\":\"string\"}],\"name\":\"castVoteWithReason\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"proposalId\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"support\",\"type\":\"uint8\"},{\"internalType\":\"string\",\"name\":\"reason\",\"type\":\"string\"},{\"internalType\":\"bytes\",\"name\":\"params\",\"type\":\"bytes\"}],\"name\":\"castVoteWithReasonAndParams\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"proposalId\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"support\",\"type\":\"uint8\"},{\"internalType\":\"address\",\"name\":\"voter\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"reason\",\"type\":\"string\"},{\"internalType\":\"bytes\",\"name\":\"params\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"signature\",\"type\":\"bytes\"}],\"name\":\"castVoteWithReasonAndParamsBySig\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"proof\",\"type\":\"bytes\"}],\"name\":\"claimParameterUpdate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"clock\",\"outputs\":[{\"internalType\":\"uint48\",\"name\":\"\",\"type\":\"uint48\"}],\"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\":[{\"internalType\":\"address[]\",\"name\":\"targets\",\"type\":\"address[]\"},{\"internalType\":\"uint256[]\",\"name\":\"values\",\"type\":\"uint256[]\"},{\"internalType\":\"bytes[]\",\"name\":\"calldatas\",\"type\":\"bytes[]\"},{\"internalType\":\"bytes32\",\"name\":\"descriptionHash\",\"type\":\"bytes32\"}],\"name\":\"execute\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint8\",\"name\":\"operationType\",\"type\":\"uint8\"},{\"internalType\":\"bytes\",\"name\":\"value\",\"type\":\"bytes\"}],\"name\":\"generateParameterProof\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"proof\",\"type\":\"bytes\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"timepoint\",\"type\":\"uint256\"}],\"name\":\"getVotes\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"timepoint\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"params\",\"type\":\"bytes\"}],\"name\":\"getVotesWithParams\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"proposalId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"hasVoted\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"targets\",\"type\":\"address[]\"},{\"internalType\":\"uint256[]\",\"name\":\"values\",\"type\":\"uint256[]\"},{\"internalType\":\"bytes[]\",\"name\":\"calldatas\",\"type\":\"bytes[]\"},{\"internalType\":\"bytes32\",\"name\":\"descriptionHash\",\"type\":\"bytes32\"}],\"name\":\"hashProposal\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"home\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"manifesto\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"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\":\"\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"uint256[]\",\"name\":\"\",\"type\":\"uint256[]\"},{\"internalType\":\"uint256[]\",\"name\":\"\",\"type\":\"uint256[]\"},{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"name\":\"onERC1155BatchReceived\",\"outputs\":[{\"internalType\":\"bytes4\",\"name\":\"\",\"type\":\"bytes4\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"name\":\"onERC1155Received\",\"outputs\":[{\"internalType\":\"bytes4\",\"name\":\"\",\"type\":\"bytes4\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"name\":\"onERC721Received\",\"outputs\":[{\"internalType\":\"bytes4\",\"name\":\"\",\"type\":\"bytes4\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"proposalId\",\"type\":\"uint256\"}],\"name\":\"proposalDeadline\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"proposalId\",\"type\":\"uint256\"}],\"name\":\"proposalEta\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"proposalNeedsQueuing\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"proposalId\",\"type\":\"uint256\"}],\"name\":\"proposalProposer\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"proposalId\",\"type\":\"uint256\"}],\"name\":\"proposalSnapshot\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"proposalThreshold\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"proposalId\",\"type\":\"uint256\"}],\"name\":\"proposalVotes\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"againstVotes\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"forVotes\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"abstainVotes\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"targets\",\"type\":\"address[]\"},{\"internalType\":\"uint256[]\",\"name\":\"values\",\"type\":\"uint256[]\"},{\"internalType\":\"bytes[]\",\"name\":\"calldatas\",\"type\":\"bytes[]\"},{\"internalType\":\"string\",\"name\":\"description\",\"type\":\"string\"}],\"name\":\"propose\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"targets\",\"type\":\"address[]\"},{\"internalType\":\"uint256[]\",\"name\":\"values\",\"type\":\"uint256[]\"},{\"internalType\":\"bytes[]\",\"name\":\"calldatas\",\"type\":\"bytes[]\"},{\"internalType\":\"bytes32\",\"name\":\"descriptionHash\",\"type\":\"bytes32\"}],\"name\":\"queue\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"blockNumber\",\"type\":\"uint256\"}],\"name\":\"quorum\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"quorumDenominator\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"timepoint\",\"type\":\"uint256\"}],\"name\":\"quorumNumerator\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"quorumNumerator\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"target\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"relay\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"newManifesto\",\"type\":\"string\"}],\"name\":\"setManifesto\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"newProposalThreshold\",\"type\":\"uint256\"}],\"name\":\"setProposalThreshold\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint48\",\"name\":\"newVotingDelay\",\"type\":\"uint48\"}],\"name\":\"setVotingDelay\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"newVotingPeriod\",\"type\":\"uint32\"}],\"name\":\"setVotingPeriod\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"proposalId\",\"type\":\"uint256\"}],\"name\":\"state\",\"outputs\":[{\"internalType\":\"enum IGovernor.ProposalState\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"interfaceId\",\"type\":\"bytes4\"}],\"name\":\"supportsInterface\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"token\",\"outputs\":[{\"internalType\":\"contract IERC5805\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"newQuorumNumerator\",\"type\":\"uint256\"}],\"name\":\"updateQuorumNumerator\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"version\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"votingDelay\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"votingPeriod\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"author\":\"Web3 Hackers Collective\",\"custom:security-contact\":\"julien@strat.cc\",\"details\":\"Extends OpenZeppelin's Governor contract with cross-chain parameter updates\",\"errors\":{\"CheckpointUnorderedInsertion()\":[{\"details\":\"A value was attempted to be inserted on a past checkpoint.\"}],\"FailedCall()\":[{\"details\":\"A call to an address target failed. The target may have reverted.\"}],\"GovernorAlreadyCastVote(address)\":[{\"details\":\"The vote was already cast.\"}],\"GovernorAlreadyQueuedProposal(uint256)\":[{\"details\":\"The proposal has already been queued.\"}],\"GovernorDisabledDeposit()\":[{\"details\":\"Token deposits are disabled in this contract.\"}],\"GovernorInsufficientProposerVotes(address,uint256,uint256)\":[{\"details\":\"The `proposer` does not have the required votes to create a proposal.\"}],\"GovernorInvalidProposalLength(uint256,uint256,uint256)\":[{\"details\":\"Empty proposal or a mismatch between the parameters length for a proposal call.\"}],\"GovernorInvalidQuorumFraction(uint256,uint256)\":[{\"details\":\"The quorum set is not a valid fraction.\"}],\"GovernorInvalidSignature(address)\":[{\"details\":\"The provided signature is not valid for the expected `voter`. If the `voter` is a contract, the signature is not valid using {IERC1271-isValidSignature}.\"}],\"GovernorInvalidVoteParams()\":[{\"details\":\"The provided params buffer is not supported by the counting module.\"}],\"GovernorInvalidVoteType()\":[{\"details\":\"The vote type used is not valid for the corresponding counting module.\"}],\"GovernorInvalidVotingPeriod(uint256)\":[{\"details\":\"The voting period set is not a valid period.\"}],\"GovernorNonexistentProposal(uint256)\":[{\"details\":\"The `proposalId` doesn't exist.\"}],\"GovernorNotQueuedProposal(uint256)\":[{\"details\":\"The proposal hasn't been queued yet.\"}],\"GovernorOnlyExecutor(address)\":[{\"details\":\"The `account` is not the governance executor.\"}],\"GovernorOnlyProposer(address)\":[{\"details\":\"The `account` is not a proposer.\"}],\"GovernorQueueNotImplemented()\":[{\"details\":\"Queue operation is not implemented for this governor. Execute should be called directly.\"}],\"GovernorRestrictedProposer(address)\":[{\"details\":\"The `proposer` is not allowed to create a proposal.\"}],\"GovernorUnexpectedProposalState(uint256,uint8,bytes32)\":[{\"details\":\"The current state of a proposal is not the required for performing an operation. The `expectedStates` is a bitmap with the bits enabled for each ProposalState enum position counting from right to left. NOTE: If `expectedState` is `bytes32(0)`, the proposal is expected to not be in any state (i.e. not exist). This is the case when a proposal that is expected to be unset is already initiated (the proposal is duplicated). See {Governor-_encodeStateBitmap}.\"}],\"InvalidAccountNonce(address,uint256)\":[{\"details\":\"The nonce used for an `account` is not the expected current nonce.\"}],\"SafeCastOverflowedUintDowncast(uint8,uint256)\":[{\"details\":\"Value doesn't fit in an uint of `bits` size.\"}]},\"events\":{\"EIP712DomainChanged()\":{\"details\":\"MAY be emitted to signal that the domain could have changed.\"},\"GovernanceParameterUpdated(uint8,uint256,uint256,uint256)\":{\"params\":{\"newValue\":\"New value\",\"nonce\":\"Update sequence number\",\"oldValue\":\"Previous value\",\"operationType\":\"Type of parameter updated\"}},\"ManifestoUpdated(string,string,uint256)\":{\"params\":{\"newManifesto\":\"New manifesto CID\",\"nonce\":\"Update sequence number\",\"oldManifesto\":\"Previous manifesto CID\"}},\"ProposalCanceled(uint256)\":{\"details\":\"Emitted when a proposal is canceled.\"},\"ProposalCreated(uint256,address,address[],uint256[],string[],bytes[],uint256,uint256,string)\":{\"details\":\"Emitted when a proposal is created.\"},\"ProposalExecuted(uint256)\":{\"details\":\"Emitted when a proposal is executed.\"},\"ProposalQueued(uint256,uint256)\":{\"details\":\"Emitted when a proposal is queued.\"},\"VoteCast(address,uint256,uint8,uint256,string)\":{\"details\":\"Emitted when a vote is cast without params. Note: `support` values should be seen as buckets. Their interpretation depends on the voting module used.\"},\"VoteCastWithParams(address,uint256,uint8,uint256,string,bytes)\":{\"details\":\"Emitted when a vote is cast with params. Note: `support` values should be seen as buckets. Their interpretation depends on the voting module used. `params` are additional encoded parameters. Their interpretation also depends on the voting module used.\"}},\"kind\":\"dev\",\"methods\":{\"CLOCK_MODE()\":{\"details\":\"Machine-readable description of the clock as specified in ERC-6372.\"},\"COUNTING_MODE()\":{\"details\":\"See {IGovernor-COUNTING_MODE}.\"},\"cancel(address[],uint256[],bytes[],bytes32)\":{\"details\":\"See {IGovernor-cancel}.\"},\"castVote(uint256,uint8)\":{\"details\":\"See {IGovernor-castVote}.\"},\"castVoteBySig(uint256,uint8,address,bytes)\":{\"details\":\"See {IGovernor-castVoteBySig}.\"},\"castVoteWithReason(uint256,uint8,string)\":{\"details\":\"See {IGovernor-castVoteWithReason}.\"},\"castVoteWithReasonAndParams(uint256,uint8,string,bytes)\":{\"details\":\"See {IGovernor-castVoteWithReasonAndParams}.\"},\"castVoteWithReasonAndParamsBySig(uint256,uint8,address,string,bytes,bytes)\":{\"details\":\"See {IGovernor-castVoteWithReasonAndParamsBySig}.\"},\"claimParameterUpdate(bytes)\":{\"params\":{\"proof\":\"Proof generated by home chain\"}},\"clock()\":{\"details\":\"Clock (as specified in ERC-6372) is set to match the token's clock. Fallback to block numbers if the token does not implement ERC-6372.\"},\"constructor\":{\"details\":\"Sets up initial governance parameters and manifesto\",\"params\":{\"_home\":\"Chain ID where this contract is considered home\",\"_manifestoCid\":\"Initial manifesto CID\",\"_name\":\"Name of the governance contract\",\"_proposalThreshold\":\"Minimum votes needed to create a proposal\",\"_quorum\":\"Minimum participation percentage required\",\"_token\":\"The voting token contract address\",\"_votingDelay\":\"Time before voting begins\",\"_votingPeriod\":\"Duration of voting period\"}},\"eip712Domain()\":{\"details\":\"See {IERC-5267}.\"},\"execute(address[],uint256[],bytes[],bytes32)\":{\"details\":\"See {IGovernor-execute}.\"},\"generateParameterProof(uint8,bytes)\":{\"params\":{\"operationType\":\"Type of parameter being updated\",\"value\":\"Encoded parameter value\"},\"returns\":{\"proof\":\"Encoded proof data\"}},\"getVotes(address,uint256)\":{\"details\":\"See {IGovernor-getVotes}.\"},\"getVotesWithParams(address,uint256,bytes)\":{\"details\":\"See {IGovernor-getVotesWithParams}.\"},\"hasVoted(uint256,address)\":{\"details\":\"See {IGovernor-hasVoted}.\"},\"hashProposal(address[],uint256[],bytes[],bytes32)\":{\"details\":\"See {IGovernor-hashProposal}. The proposal id is produced by hashing the ABI encoded `targets` array, the `values` array, the `calldatas` array and the descriptionHash (bytes32 which itself is the keccak256 hash of the description string). This proposal id can be produced from the proposal data which is part of the {ProposalCreated} event. It can even be computed in advance, before the proposal is submitted. Note that the chainId and the governor address are not part of the proposal id computation. Consequently, the same proposal (with same operation and same description) will have the same id if submitted on multiple governors across multiple networks. This also means that in order to execute the same operation twice (on the same governor) the proposer will have to change the description in order to avoid proposal id conflicts.\"},\"name()\":{\"details\":\"See {IGovernor-name}.\"},\"nonces(address)\":{\"details\":\"Returns the next unused nonce for an address.\"},\"onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)\":{\"details\":\"See {IERC1155Receiver-onERC1155BatchReceived}. Receiving tokens is disabled if the governance executor is other than the governor itself (eg. when using with a timelock).\"},\"onERC1155Received(address,address,uint256,uint256,bytes)\":{\"details\":\"See {IERC1155Receiver-onERC1155Received}. Receiving tokens is disabled if the governance executor is other than the governor itself (eg. when using with a timelock).\"},\"onERC721Received(address,address,uint256,bytes)\":{\"details\":\"See {IERC721Receiver-onERC721Received}. Receiving tokens is disabled if the governance executor is other than the governor itself (eg. when using with a timelock).\"},\"proposalDeadline(uint256)\":{\"details\":\"See {IGovernor-proposalDeadline}.\"},\"proposalEta(uint256)\":{\"details\":\"See {IGovernor-proposalEta}.\"},\"proposalNeedsQueuing(uint256)\":{\"details\":\"See {IGovernor-proposalNeedsQueuing}.\"},\"proposalProposer(uint256)\":{\"details\":\"See {IGovernor-proposalProposer}.\"},\"proposalSnapshot(uint256)\":{\"details\":\"See {IGovernor-proposalSnapshot}.\"},\"proposalVotes(uint256)\":{\"details\":\"Accessor to the internal vote counts.\"},\"propose(address[],uint256[],bytes[],string)\":{\"details\":\"See {IGovernor-propose}. This function has opt-in frontrunning protection, described in {_isValidDescriptionForProposer}.\"},\"queue(address[],uint256[],bytes[],bytes32)\":{\"details\":\"See {IGovernor-queue}.\"},\"quorumDenominator()\":{\"details\":\"Returns the quorum denominator. Defaults to 100, but may be overridden.\"},\"quorumNumerator()\":{\"details\":\"Returns the current quorum numerator. See {quorumDenominator}.\"},\"quorumNumerator(uint256)\":{\"details\":\"Returns the quorum numerator at a specific timepoint. See {quorumDenominator}.\"},\"relay(address,uint256,bytes)\":{\"details\":\"Relays a transaction or function call to an arbitrary target. In cases where the governance executor is some contract other than the governor itself, like when using a timelock, this function can be invoked in a governance proposal to recover tokens or Ether that was sent to the governor contract by mistake. Note that if the executor is simply the governor itself, use of `relay` is redundant.\"},\"setManifesto(string)\":{\"params\":{\"newManifesto\":\"New manifesto CID\"}},\"setProposalThreshold(uint256)\":{\"params\":{\"newProposalThreshold\":\"New proposal threshold value\"}},\"setVotingDelay(uint48)\":{\"params\":{\"newVotingDelay\":\"New voting delay value\"}},\"setVotingPeriod(uint32)\":{\"params\":{\"newVotingPeriod\":\"New voting period value\"}},\"state(uint256)\":{\"details\":\"See {IGovernor-state}.\"},\"supportsInterface(bytes4)\":{\"details\":\"See {IERC165-supportsInterface}.\"},\"token()\":{\"details\":\"The token that voting power is sourced from.\"},\"updateQuorumNumerator(uint256)\":{\"params\":{\"newQuorumNumerator\":\"New quorum numerator value\"}},\"version()\":{\"details\":\"See {IGovernor-version}.\"}},\"title\":\"Cross-chain Governance Contract\",\"version\":1},\"userdoc\":{\"events\":{\"GovernanceParameterUpdated(uint8,uint256,uint256,uint256)\":{\"notice\":\"Emitted when a governance parameter is updated\"},\"ManifestoUpdated(string,string,uint256)\":{\"notice\":\"Emitted when the manifesto is updated\"}},\"kind\":\"user\",\"methods\":{\"claimParameterUpdate(bytes)\":{\"notice\":\"Claims a parameter update on a foreign chain\"},\"constructor\":{\"notice\":\"Initializes the governance contract\"},\"generateParameterProof(uint8,bytes)\":{\"notice\":\"Generates proof for parameter updates\"},\"home()\":{\"notice\":\"Chain ID where this contract was originally deployed\"},\"manifesto()\":{\"notice\":\"IPFS CID of the DAO's manifesto\"},\"setManifesto(string)\":{\"notice\":\"Updates the DAO's manifesto on the home chain\"},\"setProposalThreshold(uint256)\":{\"notice\":\"Updates the proposal threshold parameter on the home chain\"},\"setVotingDelay(uint48)\":{\"notice\":\"Updates the voting delay parameter on the home chain\"},\"setVotingPeriod(uint32)\":{\"notice\":\"Updates the voting period parameter on the home chain\"},\"updateQuorumNumerator(uint256)\":{\"notice\":\"Updates the quorum numerator on the home chain\"}},\"notice\":\"Implementation of a DAO with cross-chain synchronization capabilities\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/variants/crosschain/Gov.sol\":\"Gov\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/governance/Governor.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (governance/Governor.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {IERC721Receiver} from \\\"../token/ERC721/IERC721Receiver.sol\\\";\\nimport {IERC1155Receiver} from \\\"../token/ERC1155/IERC1155Receiver.sol\\\";\\nimport {EIP712} from \\\"../utils/cryptography/EIP712.sol\\\";\\nimport {SignatureChecker} from \\\"../utils/cryptography/SignatureChecker.sol\\\";\\nimport {IERC165, ERC165} from \\\"../utils/introspection/ERC165.sol\\\";\\nimport {SafeCast} from \\\"../utils/math/SafeCast.sol\\\";\\nimport {DoubleEndedQueue} from \\\"../utils/structs/DoubleEndedQueue.sol\\\";\\nimport {Address} from \\\"../utils/Address.sol\\\";\\nimport {Context} from \\\"../utils/Context.sol\\\";\\nimport {Nonces} from \\\"../utils/Nonces.sol\\\";\\nimport {IGovernor, IERC6372} from \\\"./IGovernor.sol\\\";\\n\\n/**\\n * @dev Core of the governance system, designed to be extended through various modules.\\n *\\n * This contract is abstract and requires several functions to be implemented in various modules:\\n *\\n * - A counting module must implement {quorum}, {_quorumReached}, {_voteSucceeded} and {_countVote}\\n * - A voting module must implement {_getVotes}\\n * - Additionally, {votingPeriod} must also be implemented\\n */\\nabstract contract Governor is Context, ERC165, EIP712, Nonces, IGovernor, IERC721Receiver, IERC1155Receiver {\\n using DoubleEndedQueue for DoubleEndedQueue.Bytes32Deque;\\n\\n bytes32 public constant BALLOT_TYPEHASH =\\n keccak256(\\\"Ballot(uint256 proposalId,uint8 support,address voter,uint256 nonce)\\\");\\n bytes32 public constant EXTENDED_BALLOT_TYPEHASH =\\n keccak256(\\n \\\"ExtendedBallot(uint256 proposalId,uint8 support,address voter,uint256 nonce,string reason,bytes params)\\\"\\n );\\n\\n struct ProposalCore {\\n address proposer;\\n uint48 voteStart;\\n uint32 voteDuration;\\n bool executed;\\n bool canceled;\\n uint48 etaSeconds;\\n }\\n\\n bytes32 private constant ALL_PROPOSAL_STATES_BITMAP = bytes32((2 ** (uint8(type(ProposalState).max) + 1)) - 1);\\n string private _name;\\n\\n mapping(uint256 proposalId => ProposalCore) private _proposals;\\n\\n // This queue keeps track of the governor operating on itself. Calls to functions protected by the {onlyGovernance}\\n // modifier needs to be whitelisted in this queue. Whitelisting is set in {execute}, consumed by the\\n // {onlyGovernance} modifier and eventually reset after {_executeOperations} completes. This ensures that the\\n // execution of {onlyGovernance} protected calls can only be achieved through successful proposals.\\n DoubleEndedQueue.Bytes32Deque private _governanceCall;\\n\\n /**\\n * @dev Restricts a function so it can only be executed through governance proposals. For example, governance\\n * parameter setters in {GovernorSettings} are protected using this modifier.\\n *\\n * The governance executing address may be different from the Governor's own address, for example it could be a\\n * timelock. This can be customized by modules by overriding {_executor}. The executor is only able to invoke these\\n * functions during the execution of the governor's {execute} function, and not under any other circumstances. Thus,\\n * for example, additional timelock proposers are not able to change governance parameters without going through the\\n * governance protocol (since v4.6).\\n */\\n modifier onlyGovernance() {\\n _checkGovernance();\\n _;\\n }\\n\\n /**\\n * @dev Sets the value for {name} and {version}\\n */\\n constructor(string memory name_) EIP712(name_, version()) {\\n _name = name_;\\n }\\n\\n /**\\n * @dev Function to receive ETH that will be handled by the governor (disabled if executor is a third party contract)\\n */\\n receive() external payable virtual {\\n if (_executor() != address(this)) {\\n revert GovernorDisabledDeposit();\\n }\\n }\\n\\n /**\\n * @dev See {IERC165-supportsInterface}.\\n */\\n function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165, ERC165) returns (bool) {\\n return\\n interfaceId == type(IGovernor).interfaceId ||\\n interfaceId == type(IERC1155Receiver).interfaceId ||\\n super.supportsInterface(interfaceId);\\n }\\n\\n /**\\n * @dev See {IGovernor-name}.\\n */\\n function name() public view virtual returns (string memory) {\\n return _name;\\n }\\n\\n /**\\n * @dev See {IGovernor-version}.\\n */\\n function version() public view virtual returns (string memory) {\\n return \\\"1\\\";\\n }\\n\\n /**\\n * @dev See {IGovernor-hashProposal}.\\n *\\n * The proposal id is produced by hashing the ABI encoded `targets` array, the `values` array, the `calldatas` array\\n * and the descriptionHash (bytes32 which itself is the keccak256 hash of the description string). This proposal id\\n * can be produced from the proposal data which is part of the {ProposalCreated} event. It can even be computed in\\n * advance, before the proposal is submitted.\\n *\\n * Note that the chainId and the governor address are not part of the proposal id computation. Consequently, the\\n * same proposal (with same operation and same description) will have the same id if submitted on multiple governors\\n * across multiple networks. This also means that in order to execute the same operation twice (on the same\\n * governor) the proposer will have to change the description in order to avoid proposal id conflicts.\\n */\\n function hashProposal(\\n address[] memory targets,\\n uint256[] memory values,\\n bytes[] memory calldatas,\\n bytes32 descriptionHash\\n ) public pure virtual returns (uint256) {\\n return uint256(keccak256(abi.encode(targets, values, calldatas, descriptionHash)));\\n }\\n\\n /**\\n * @dev See {IGovernor-state}.\\n */\\n function state(uint256 proposalId) public view virtual returns (ProposalState) {\\n // We read the struct fields into the stack at once so Solidity emits a single SLOAD\\n ProposalCore storage proposal = _proposals[proposalId];\\n bool proposalExecuted = proposal.executed;\\n bool proposalCanceled = proposal.canceled;\\n\\n if (proposalExecuted) {\\n return ProposalState.Executed;\\n }\\n\\n if (proposalCanceled) {\\n return ProposalState.Canceled;\\n }\\n\\n uint256 snapshot = proposalSnapshot(proposalId);\\n\\n if (snapshot == 0) {\\n revert GovernorNonexistentProposal(proposalId);\\n }\\n\\n uint256 currentTimepoint = clock();\\n\\n if (snapshot >= currentTimepoint) {\\n return ProposalState.Pending;\\n }\\n\\n uint256 deadline = proposalDeadline(proposalId);\\n\\n if (deadline >= currentTimepoint) {\\n return ProposalState.Active;\\n } else if (!_quorumReached(proposalId) || !_voteSucceeded(proposalId)) {\\n return ProposalState.Defeated;\\n } else if (proposalEta(proposalId) == 0) {\\n return ProposalState.Succeeded;\\n } else {\\n return ProposalState.Queued;\\n }\\n }\\n\\n /**\\n * @dev See {IGovernor-proposalThreshold}.\\n */\\n function proposalThreshold() public view virtual returns (uint256) {\\n return 0;\\n }\\n\\n /**\\n * @dev See {IGovernor-proposalSnapshot}.\\n */\\n function proposalSnapshot(uint256 proposalId) public view virtual returns (uint256) {\\n return _proposals[proposalId].voteStart;\\n }\\n\\n /**\\n * @dev See {IGovernor-proposalDeadline}.\\n */\\n function proposalDeadline(uint256 proposalId) public view virtual returns (uint256) {\\n return _proposals[proposalId].voteStart + _proposals[proposalId].voteDuration;\\n }\\n\\n /**\\n * @dev See {IGovernor-proposalProposer}.\\n */\\n function proposalProposer(uint256 proposalId) public view virtual returns (address) {\\n return _proposals[proposalId].proposer;\\n }\\n\\n /**\\n * @dev See {IGovernor-proposalEta}.\\n */\\n function proposalEta(uint256 proposalId) public view virtual returns (uint256) {\\n return _proposals[proposalId].etaSeconds;\\n }\\n\\n /**\\n * @dev See {IGovernor-proposalNeedsQueuing}.\\n */\\n function proposalNeedsQueuing(uint256) public view virtual returns (bool) {\\n return false;\\n }\\n\\n /**\\n * @dev Reverts if the `msg.sender` is not the executor. In case the executor is not this contract\\n * itself, the function reverts if `msg.data` is not whitelisted as a result of an {execute}\\n * operation. See {onlyGovernance}.\\n */\\n function _checkGovernance() internal virtual {\\n if (_executor() != _msgSender()) {\\n revert GovernorOnlyExecutor(_msgSender());\\n }\\n if (_executor() != address(this)) {\\n bytes32 msgDataHash = keccak256(_msgData());\\n // loop until popping the expected operation - throw if deque is empty (operation not authorized)\\n while (_governanceCall.popFront() != msgDataHash) {}\\n }\\n }\\n\\n /**\\n * @dev Amount of votes already cast passes the threshold limit.\\n */\\n function _quorumReached(uint256 proposalId) internal view virtual returns (bool);\\n\\n /**\\n * @dev Is the proposal successful or not.\\n */\\n function _voteSucceeded(uint256 proposalId) internal view virtual returns (bool);\\n\\n /**\\n * @dev Get the voting weight of `account` at a specific `timepoint`, for a vote as described by `params`.\\n */\\n function _getVotes(address account, uint256 timepoint, bytes memory params) internal view virtual returns (uint256);\\n\\n /**\\n * @dev Register a vote for `proposalId` by `account` with a given `support`, voting `weight` and voting `params`.\\n *\\n * Note: Support is generic and can represent various things depending on the voting system used.\\n */\\n function _countVote(\\n uint256 proposalId,\\n address account,\\n uint8 support,\\n uint256 totalWeight,\\n bytes memory params\\n ) internal virtual returns (uint256);\\n\\n /**\\n * @dev Default additional encoded parameters used by castVote methods that don't include them\\n *\\n * Note: Should be overridden by specific implementations to use an appropriate value, the\\n * meaning of the additional params, in the context of that implementation\\n */\\n function _defaultParams() internal view virtual returns (bytes memory) {\\n return \\\"\\\";\\n }\\n\\n /**\\n * @dev See {IGovernor-propose}. This function has opt-in frontrunning protection, described in {_isValidDescriptionForProposer}.\\n */\\n function propose(\\n address[] memory targets,\\n uint256[] memory values,\\n bytes[] memory calldatas,\\n string memory description\\n ) public virtual returns (uint256) {\\n address proposer = _msgSender();\\n\\n // check description restriction\\n if (!_isValidDescriptionForProposer(proposer, description)) {\\n revert GovernorRestrictedProposer(proposer);\\n }\\n\\n // check proposal threshold\\n uint256 votesThreshold = proposalThreshold();\\n if (votesThreshold > 0) {\\n uint256 proposerVotes = getVotes(proposer, clock() - 1);\\n if (proposerVotes < votesThreshold) {\\n revert GovernorInsufficientProposerVotes(proposer, proposerVotes, votesThreshold);\\n }\\n }\\n\\n return _propose(targets, values, calldatas, description, proposer);\\n }\\n\\n /**\\n * @dev Internal propose mechanism. Can be overridden to add more logic on proposal creation.\\n *\\n * Emits a {IGovernor-ProposalCreated} event.\\n */\\n function _propose(\\n address[] memory targets,\\n uint256[] memory values,\\n bytes[] memory calldatas,\\n string memory description,\\n address proposer\\n ) internal virtual returns (uint256 proposalId) {\\n proposalId = hashProposal(targets, values, calldatas, keccak256(bytes(description)));\\n\\n if (targets.length != values.length || targets.length != calldatas.length || targets.length == 0) {\\n revert GovernorInvalidProposalLength(targets.length, calldatas.length, values.length);\\n }\\n if (_proposals[proposalId].voteStart != 0) {\\n revert GovernorUnexpectedProposalState(proposalId, state(proposalId), bytes32(0));\\n }\\n\\n uint256 snapshot = clock() + votingDelay();\\n uint256 duration = votingPeriod();\\n\\n ProposalCore storage proposal = _proposals[proposalId];\\n proposal.proposer = proposer;\\n proposal.voteStart = SafeCast.toUint48(snapshot);\\n proposal.voteDuration = SafeCast.toUint32(duration);\\n\\n emit ProposalCreated(\\n proposalId,\\n proposer,\\n targets,\\n values,\\n new string[](targets.length),\\n calldatas,\\n snapshot,\\n snapshot + duration,\\n description\\n );\\n\\n // Using a named return variable to avoid stack too deep errors\\n }\\n\\n /**\\n * @dev See {IGovernor-queue}.\\n */\\n function queue(\\n address[] memory targets,\\n uint256[] memory values,\\n bytes[] memory calldatas,\\n bytes32 descriptionHash\\n ) public virtual returns (uint256) {\\n uint256 proposalId = hashProposal(targets, values, calldatas, descriptionHash);\\n\\n _validateStateBitmap(proposalId, _encodeStateBitmap(ProposalState.Succeeded));\\n\\n uint48 etaSeconds = _queueOperations(proposalId, targets, values, calldatas, descriptionHash);\\n\\n if (etaSeconds != 0) {\\n _proposals[proposalId].etaSeconds = etaSeconds;\\n emit ProposalQueued(proposalId, etaSeconds);\\n } else {\\n revert GovernorQueueNotImplemented();\\n }\\n\\n return proposalId;\\n }\\n\\n /**\\n * @dev Internal queuing mechanism. Can be overridden (without a super call) to modify the way queuing is\\n * performed (for example adding a vault/timelock).\\n *\\n * This is empty by default, and must be overridden to implement queuing.\\n *\\n * This function returns a timestamp that describes the expected ETA for execution. If the returned value is 0\\n * (which is the default value), the core will consider queueing did not succeed, and the public {queue} function\\n * will revert.\\n *\\n * NOTE: Calling this function directly will NOT check the current state of the proposal, or emit the\\n * `ProposalQueued` event. Queuing a proposal should be done using {queue}.\\n */\\n function _queueOperations(\\n uint256 /*proposalId*/,\\n address[] memory /*targets*/,\\n uint256[] memory /*values*/,\\n bytes[] memory /*calldatas*/,\\n bytes32 /*descriptionHash*/\\n ) internal virtual returns (uint48) {\\n return 0;\\n }\\n\\n /**\\n * @dev See {IGovernor-execute}.\\n */\\n function execute(\\n address[] memory targets,\\n uint256[] memory values,\\n bytes[] memory calldatas,\\n bytes32 descriptionHash\\n ) public payable virtual returns (uint256) {\\n uint256 proposalId = hashProposal(targets, values, calldatas, descriptionHash);\\n\\n _validateStateBitmap(\\n proposalId,\\n _encodeStateBitmap(ProposalState.Succeeded) | _encodeStateBitmap(ProposalState.Queued)\\n );\\n\\n // mark as executed before calls to avoid reentrancy\\n _proposals[proposalId].executed = true;\\n\\n // before execute: register governance call in queue.\\n if (_executor() != address(this)) {\\n for (uint256 i = 0; i < targets.length; ++i) {\\n if (targets[i] == address(this)) {\\n _governanceCall.pushBack(keccak256(calldatas[i]));\\n }\\n }\\n }\\n\\n _executeOperations(proposalId, targets, values, calldatas, descriptionHash);\\n\\n // after execute: cleanup governance call queue.\\n if (_executor() != address(this) && !_governanceCall.empty()) {\\n _governanceCall.clear();\\n }\\n\\n emit ProposalExecuted(proposalId);\\n\\n return proposalId;\\n }\\n\\n /**\\n * @dev Internal execution mechanism. Can be overridden (without a super call) to modify the way execution is\\n * performed (for example adding a vault/timelock).\\n *\\n * NOTE: Calling this function directly will NOT check the current state of the proposal, set the executed flag to\\n * true or emit the `ProposalExecuted` event. Executing a proposal should be done using {execute} or {_execute}.\\n */\\n function _executeOperations(\\n uint256 /* proposalId */,\\n address[] memory targets,\\n uint256[] memory values,\\n bytes[] memory calldatas,\\n bytes32 /*descriptionHash*/\\n ) internal virtual {\\n for (uint256 i = 0; i < targets.length; ++i) {\\n (bool success, bytes memory returndata) = targets[i].call{value: values[i]}(calldatas[i]);\\n Address.verifyCallResult(success, returndata);\\n }\\n }\\n\\n /**\\n * @dev See {IGovernor-cancel}.\\n */\\n function cancel(\\n address[] memory targets,\\n uint256[] memory values,\\n bytes[] memory calldatas,\\n bytes32 descriptionHash\\n ) public virtual returns (uint256) {\\n // The proposalId will be recomputed in the `_cancel` call further down. However we need the value before we\\n // do the internal call, because we need to check the proposal state BEFORE the internal `_cancel` call\\n // changes it. The `hashProposal` duplication has a cost that is limited, and that we accept.\\n uint256 proposalId = hashProposal(targets, values, calldatas, descriptionHash);\\n\\n // public cancel restrictions (on top of existing _cancel restrictions).\\n _validateStateBitmap(proposalId, _encodeStateBitmap(ProposalState.Pending));\\n if (_msgSender() != proposalProposer(proposalId)) {\\n revert GovernorOnlyProposer(_msgSender());\\n }\\n\\n return _cancel(targets, values, calldatas, descriptionHash);\\n }\\n\\n /**\\n * @dev Internal cancel mechanism with minimal restrictions. A proposal can be cancelled in any state other than\\n * Canceled, Expired, or Executed. Once cancelled a proposal can't be re-submitted.\\n *\\n * Emits a {IGovernor-ProposalCanceled} event.\\n */\\n function _cancel(\\n address[] memory targets,\\n uint256[] memory values,\\n bytes[] memory calldatas,\\n bytes32 descriptionHash\\n ) internal virtual returns (uint256) {\\n uint256 proposalId = hashProposal(targets, values, calldatas, descriptionHash);\\n\\n _validateStateBitmap(\\n proposalId,\\n ALL_PROPOSAL_STATES_BITMAP ^\\n _encodeStateBitmap(ProposalState.Canceled) ^\\n _encodeStateBitmap(ProposalState.Expired) ^\\n _encodeStateBitmap(ProposalState.Executed)\\n );\\n\\n _proposals[proposalId].canceled = true;\\n emit ProposalCanceled(proposalId);\\n\\n return proposalId;\\n }\\n\\n /**\\n * @dev See {IGovernor-getVotes}.\\n */\\n function getVotes(address account, uint256 timepoint) public view virtual returns (uint256) {\\n return _getVotes(account, timepoint, _defaultParams());\\n }\\n\\n /**\\n * @dev See {IGovernor-getVotesWithParams}.\\n */\\n function getVotesWithParams(\\n address account,\\n uint256 timepoint,\\n bytes memory params\\n ) public view virtual returns (uint256) {\\n return _getVotes(account, timepoint, params);\\n }\\n\\n /**\\n * @dev See {IGovernor-castVote}.\\n */\\n function castVote(uint256 proposalId, uint8 support) public virtual returns (uint256) {\\n address voter = _msgSender();\\n return _castVote(proposalId, voter, support, \\\"\\\");\\n }\\n\\n /**\\n * @dev See {IGovernor-castVoteWithReason}.\\n */\\n function castVoteWithReason(\\n uint256 proposalId,\\n uint8 support,\\n string calldata reason\\n ) public virtual returns (uint256) {\\n address voter = _msgSender();\\n return _castVote(proposalId, voter, support, reason);\\n }\\n\\n /**\\n * @dev See {IGovernor-castVoteWithReasonAndParams}.\\n */\\n function castVoteWithReasonAndParams(\\n uint256 proposalId,\\n uint8 support,\\n string calldata reason,\\n bytes memory params\\n ) public virtual returns (uint256) {\\n address voter = _msgSender();\\n return _castVote(proposalId, voter, support, reason, params);\\n }\\n\\n /**\\n * @dev See {IGovernor-castVoteBySig}.\\n */\\n function castVoteBySig(\\n uint256 proposalId,\\n uint8 support,\\n address voter,\\n bytes memory signature\\n ) public virtual returns (uint256) {\\n bool valid = SignatureChecker.isValidSignatureNow(\\n voter,\\n _hashTypedDataV4(keccak256(abi.encode(BALLOT_TYPEHASH, proposalId, support, voter, _useNonce(voter)))),\\n signature\\n );\\n\\n if (!valid) {\\n revert GovernorInvalidSignature(voter);\\n }\\n\\n return _castVote(proposalId, voter, support, \\\"\\\");\\n }\\n\\n /**\\n * @dev See {IGovernor-castVoteWithReasonAndParamsBySig}.\\n */\\n function castVoteWithReasonAndParamsBySig(\\n uint256 proposalId,\\n uint8 support,\\n address voter,\\n string calldata reason,\\n bytes memory params,\\n bytes memory signature\\n ) public virtual returns (uint256) {\\n bool valid = SignatureChecker.isValidSignatureNow(\\n voter,\\n _hashTypedDataV4(\\n keccak256(\\n abi.encode(\\n EXTENDED_BALLOT_TYPEHASH,\\n proposalId,\\n support,\\n voter,\\n _useNonce(voter),\\n keccak256(bytes(reason)),\\n keccak256(params)\\n )\\n )\\n ),\\n signature\\n );\\n\\n if (!valid) {\\n revert GovernorInvalidSignature(voter);\\n }\\n\\n return _castVote(proposalId, voter, support, reason, params);\\n }\\n\\n /**\\n * @dev Internal vote casting mechanism: Check that the vote is pending, that it has not been cast yet, retrieve\\n * voting weight using {IGovernor-getVotes} and call the {_countVote} internal function. Uses the _defaultParams().\\n *\\n * Emits a {IGovernor-VoteCast} event.\\n */\\n function _castVote(\\n uint256 proposalId,\\n address account,\\n uint8 support,\\n string memory reason\\n ) internal virtual returns (uint256) {\\n return _castVote(proposalId, account, support, reason, _defaultParams());\\n }\\n\\n /**\\n * @dev Internal vote casting mechanism: Check that the vote is pending, that it has not been cast yet, retrieve\\n * voting weight using {IGovernor-getVotes} and call the {_countVote} internal function.\\n *\\n * Emits a {IGovernor-VoteCast} event.\\n */\\n function _castVote(\\n uint256 proposalId,\\n address account,\\n uint8 support,\\n string memory reason,\\n bytes memory params\\n ) internal virtual returns (uint256) {\\n _validateStateBitmap(proposalId, _encodeStateBitmap(ProposalState.Active));\\n\\n uint256 totalWeight = _getVotes(account, proposalSnapshot(proposalId), params);\\n uint256 votedWeight = _countVote(proposalId, account, support, totalWeight, params);\\n\\n if (params.length == 0) {\\n emit VoteCast(account, proposalId, support, votedWeight, reason);\\n } else {\\n emit VoteCastWithParams(account, proposalId, support, votedWeight, reason, params);\\n }\\n\\n return votedWeight;\\n }\\n\\n /**\\n * @dev Relays a transaction or function call to an arbitrary target. In cases where the governance executor\\n * is some contract other than the governor itself, like when using a timelock, this function can be invoked\\n * in a governance proposal to recover tokens or Ether that was sent to the governor contract by mistake.\\n * Note that if the executor is simply the governor itself, use of `relay` is redundant.\\n */\\n function relay(address target, uint256 value, bytes calldata data) external payable virtual onlyGovernance {\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n Address.verifyCallResult(success, returndata);\\n }\\n\\n /**\\n * @dev Address through which the governor executes action. Will be overloaded by module that execute actions\\n * through another contract such as a timelock.\\n */\\n function _executor() internal view virtual returns (address) {\\n return address(this);\\n }\\n\\n /**\\n * @dev See {IERC721Receiver-onERC721Received}.\\n * Receiving tokens is disabled if the governance executor is other than the governor itself (eg. when using with a timelock).\\n */\\n function onERC721Received(address, address, uint256, bytes memory) public virtual returns (bytes4) {\\n if (_executor() != address(this)) {\\n revert GovernorDisabledDeposit();\\n }\\n return this.onERC721Received.selector;\\n }\\n\\n /**\\n * @dev See {IERC1155Receiver-onERC1155Received}.\\n * Receiving tokens is disabled if the governance executor is other than the governor itself (eg. when using with a timelock).\\n */\\n function onERC1155Received(address, address, uint256, uint256, bytes memory) public virtual returns (bytes4) {\\n if (_executor() != address(this)) {\\n revert GovernorDisabledDeposit();\\n }\\n return this.onERC1155Received.selector;\\n }\\n\\n /**\\n * @dev See {IERC1155Receiver-onERC1155BatchReceived}.\\n * Receiving tokens is disabled if the governance executor is other than the governor itself (eg. when using with a timelock).\\n */\\n function onERC1155BatchReceived(\\n address,\\n address,\\n uint256[] memory,\\n uint256[] memory,\\n bytes memory\\n ) public virtual returns (bytes4) {\\n if (_executor() != address(this)) {\\n revert GovernorDisabledDeposit();\\n }\\n return this.onERC1155BatchReceived.selector;\\n }\\n\\n /**\\n * @dev Encodes a `ProposalState` into a `bytes32` representation where each bit enabled corresponds to\\n * the underlying position in the `ProposalState` enum. For example:\\n *\\n * 0x000...10000\\n * ^^^^^^------ ...\\n * ^----- Succeeded\\n * ^---- Defeated\\n * ^--- Canceled\\n * ^-- Active\\n * ^- Pending\\n */\\n function _encodeStateBitmap(ProposalState proposalState) internal pure returns (bytes32) {\\n return bytes32(1 << uint8(proposalState));\\n }\\n\\n /**\\n * @dev Check that the current state of a proposal matches the requirements described by the `allowedStates` bitmap.\\n * This bitmap should be built using `_encodeStateBitmap`.\\n *\\n * If requirements are not met, reverts with a {GovernorUnexpectedProposalState} error.\\n */\\n function _validateStateBitmap(uint256 proposalId, bytes32 allowedStates) private view returns (ProposalState) {\\n ProposalState currentState = state(proposalId);\\n if (_encodeStateBitmap(currentState) & allowedStates == bytes32(0)) {\\n revert GovernorUnexpectedProposalState(proposalId, currentState, allowedStates);\\n }\\n return currentState;\\n }\\n\\n /*\\n * @dev Check if the proposer is authorized to submit a proposal with the given description.\\n *\\n * If the proposal description ends with `#proposer=0x???`, where `0x???` is an address written as a hex string\\n * (case insensitive), then the submission of this proposal will only be authorized to said address.\\n *\\n * This is used for frontrunning protection. By adding this pattern at the end of their proposal, one can ensure\\n * that no other address can submit the same proposal. An attacker would have to either remove or change that part,\\n * which would result in a different proposal id.\\n *\\n * If the description does not match this pattern, it is unrestricted and anyone can submit it. This includes:\\n * - If the `0x???` part is not a valid hex string.\\n * - If the `0x???` part is a valid hex string, but does not contain exactly 40 hex digits.\\n * - If it ends with the expected suffix followed by newlines or other whitespace.\\n * - If it ends with some other similar suffix, e.g. `#other=abc`.\\n * - If it does not end with any such suffix.\\n */\\n function _isValidDescriptionForProposer(\\n address proposer,\\n string memory description\\n ) internal view virtual returns (bool) {\\n uint256 len = bytes(description).length;\\n\\n // Length is too short to contain a valid proposer suffix\\n if (len < 52) {\\n return true;\\n }\\n\\n // Extract what would be the `#proposer=0x` marker beginning the suffix\\n bytes12 marker;\\n assembly (\\\"memory-safe\\\") {\\n // - Start of the string contents in memory = description + 32\\n // - First character of the marker = len - 52\\n // - Length of \\\"#proposer=0x0000000000000000000000000000000000000000\\\" = 52\\n // - We read the memory word starting at the first character of the marker:\\n // - (description + 32) + (len - 52) = description + (len - 20)\\n // - Note: Solidity will ignore anything past the first 12 bytes\\n marker := mload(add(description, sub(len, 20)))\\n }\\n\\n // If the marker is not found, there is no proposer suffix to check\\n if (marker != bytes12(\\\"#proposer=0x\\\")) {\\n return true;\\n }\\n\\n // Parse the 40 characters following the marker as uint160\\n uint160 recovered = 0;\\n for (uint256 i = len - 40; i < len; ++i) {\\n (bool isHex, uint8 value) = _tryHexToUint(bytes(description)[i]);\\n // If any of the characters is not a hex digit, ignore the suffix entirely\\n if (!isHex) {\\n return true;\\n }\\n recovered = (recovered << 4) | value;\\n }\\n\\n return recovered == uint160(proposer);\\n }\\n\\n /**\\n * @dev Try to parse a character from a string as a hex value. Returns `(true, value)` if the char is in\\n * `[0-9a-fA-F]` and `(false, 0)` otherwise. Value is guaranteed to be in the range `0 <= value < 16`\\n */\\n function _tryHexToUint(bytes1 char) private pure returns (bool isHex, uint8 value) {\\n uint8 c = uint8(char);\\n unchecked {\\n // Case 0-9\\n if (47 < c && c < 58) {\\n return (true, c - 48);\\n }\\n // Case A-F\\n else if (64 < c && c < 71) {\\n return (true, c - 55);\\n }\\n // Case a-f\\n else if (96 < c && c < 103) {\\n return (true, c - 87);\\n }\\n // Else: not a hex char\\n else {\\n return (false, 0);\\n }\\n }\\n }\\n\\n /**\\n * @inheritdoc IERC6372\\n */\\n function clock() public view virtual returns (uint48);\\n\\n /**\\n * @inheritdoc IERC6372\\n */\\n // solhint-disable-next-line func-name-mixedcase\\n function CLOCK_MODE() public view virtual returns (string memory);\\n\\n /**\\n * @inheritdoc IGovernor\\n */\\n function votingDelay() public view virtual returns (uint256);\\n\\n /**\\n * @inheritdoc IGovernor\\n */\\n function votingPeriod() public view virtual returns (uint256);\\n\\n /**\\n * @inheritdoc IGovernor\\n */\\n function quorum(uint256 timepoint) public view virtual returns (uint256);\\n}\\n\",\"keccak256\":\"0xe0f387e99c7dfcb1d3e7d2f36e408ab59a851a5e0502d21889568466a2a491bc\",\"license\":\"MIT\"},\"@openzeppelin/contracts/governance/IGovernor.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (governance/IGovernor.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {IERC165} from \\\"../interfaces/IERC165.sol\\\";\\nimport {IERC6372} from \\\"../interfaces/IERC6372.sol\\\";\\n\\n/**\\n * @dev Interface of the {Governor} core.\\n *\\n * NOTE: Event parameters lack the `indexed` keyword for compatibility with GovernorBravo events.\\n * Making event parameters `indexed` affects how events are decoded, potentially breaking existing indexers.\\n */\\ninterface IGovernor is IERC165, IERC6372 {\\n enum ProposalState {\\n Pending,\\n Active,\\n Canceled,\\n Defeated,\\n Succeeded,\\n Queued,\\n Expired,\\n Executed\\n }\\n\\n /**\\n * @dev Empty proposal or a mismatch between the parameters length for a proposal call.\\n */\\n error GovernorInvalidProposalLength(uint256 targets, uint256 calldatas, uint256 values);\\n\\n /**\\n * @dev The vote was already cast.\\n */\\n error GovernorAlreadyCastVote(address voter);\\n\\n /**\\n * @dev Token deposits are disabled in this contract.\\n */\\n error GovernorDisabledDeposit();\\n\\n /**\\n * @dev The `account` is not a proposer.\\n */\\n error GovernorOnlyProposer(address account);\\n\\n /**\\n * @dev The `account` is not the governance executor.\\n */\\n error GovernorOnlyExecutor(address account);\\n\\n /**\\n * @dev The `proposalId` doesn't exist.\\n */\\n error GovernorNonexistentProposal(uint256 proposalId);\\n\\n /**\\n * @dev The current state of a proposal is not the required for performing an operation.\\n * The `expectedStates` is a bitmap with the bits enabled for each ProposalState enum position\\n * counting from right to left.\\n *\\n * NOTE: If `expectedState` is `bytes32(0)`, the proposal is expected to not be in any state (i.e. not exist).\\n * This is the case when a proposal that is expected to be unset is already initiated (the proposal is duplicated).\\n *\\n * See {Governor-_encodeStateBitmap}.\\n */\\n error GovernorUnexpectedProposalState(uint256 proposalId, ProposalState current, bytes32 expectedStates);\\n\\n /**\\n * @dev The voting period set is not a valid period.\\n */\\n error GovernorInvalidVotingPeriod(uint256 votingPeriod);\\n\\n /**\\n * @dev The `proposer` does not have the required votes to create a proposal.\\n */\\n error GovernorInsufficientProposerVotes(address proposer, uint256 votes, uint256 threshold);\\n\\n /**\\n * @dev The `proposer` is not allowed to create a proposal.\\n */\\n error GovernorRestrictedProposer(address proposer);\\n\\n /**\\n * @dev The vote type used is not valid for the corresponding counting module.\\n */\\n error GovernorInvalidVoteType();\\n\\n /**\\n * @dev The provided params buffer is not supported by the counting module.\\n */\\n error GovernorInvalidVoteParams();\\n\\n /**\\n * @dev Queue operation is not implemented for this governor. Execute should be called directly.\\n */\\n error GovernorQueueNotImplemented();\\n\\n /**\\n * @dev The proposal hasn't been queued yet.\\n */\\n error GovernorNotQueuedProposal(uint256 proposalId);\\n\\n /**\\n * @dev The proposal has already been queued.\\n */\\n error GovernorAlreadyQueuedProposal(uint256 proposalId);\\n\\n /**\\n * @dev The provided signature is not valid for the expected `voter`.\\n * If the `voter` is a contract, the signature is not valid using {IERC1271-isValidSignature}.\\n */\\n error GovernorInvalidSignature(address voter);\\n\\n /**\\n * @dev Emitted when a proposal is created.\\n */\\n event ProposalCreated(\\n uint256 proposalId,\\n address proposer,\\n address[] targets,\\n uint256[] values,\\n string[] signatures,\\n bytes[] calldatas,\\n uint256 voteStart,\\n uint256 voteEnd,\\n string description\\n );\\n\\n /**\\n * @dev Emitted when a proposal is queued.\\n */\\n event ProposalQueued(uint256 proposalId, uint256 etaSeconds);\\n\\n /**\\n * @dev Emitted when a proposal is executed.\\n */\\n event ProposalExecuted(uint256 proposalId);\\n\\n /**\\n * @dev Emitted when a proposal is canceled.\\n */\\n event ProposalCanceled(uint256 proposalId);\\n\\n /**\\n * @dev Emitted when a vote is cast without params.\\n *\\n * Note: `support` values should be seen as buckets. Their interpretation depends on the voting module used.\\n */\\n event VoteCast(address indexed voter, uint256 proposalId, uint8 support, uint256 weight, string reason);\\n\\n /**\\n * @dev Emitted when a vote is cast with params.\\n *\\n * Note: `support` values should be seen as buckets. Their interpretation depends on the voting module used.\\n * `params` are additional encoded parameters. Their interpretation also depends on the voting module used.\\n */\\n event VoteCastWithParams(\\n address indexed voter,\\n uint256 proposalId,\\n uint8 support,\\n uint256 weight,\\n string reason,\\n bytes params\\n );\\n\\n /**\\n * @notice module:core\\n * @dev Name of the governor instance (used in building the EIP-712 domain separator).\\n */\\n function name() external view returns (string memory);\\n\\n /**\\n * @notice module:core\\n * @dev Version of the governor instance (used in building the EIP-712 domain separator). Default: \\\"1\\\"\\n */\\n function version() external view returns (string memory);\\n\\n /**\\n * @notice module:voting\\n * @dev A description of the possible `support` values for {castVote} and the way these votes are counted, meant to\\n * be consumed by UIs to show correct vote options and interpret the results. The string is a URL-encoded sequence of\\n * key-value pairs that each describe one aspect, for example `support=bravo&quorum=for,abstain`.\\n *\\n * There are 2 standard keys: `support` and `quorum`.\\n *\\n * - `support=bravo` refers to the vote options 0 = Against, 1 = For, 2 = Abstain, as in `GovernorBravo`.\\n * - `quorum=bravo` means that only For votes are counted towards quorum.\\n * - `quorum=for,abstain` means that both For and Abstain votes are counted towards quorum.\\n *\\n * If a counting module makes use of encoded `params`, it should include this under a `params` key with a unique\\n * name that describes the behavior. For example:\\n *\\n * - `params=fractional` might refer to a scheme where votes are divided fractionally between for/against/abstain.\\n * - `params=erc721` might refer to a scheme where specific NFTs are delegated to vote.\\n *\\n * NOTE: The string can be decoded by the standard\\n * https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams[`URLSearchParams`]\\n * JavaScript class.\\n */\\n // solhint-disable-next-line func-name-mixedcase\\n function COUNTING_MODE() external view returns (string memory);\\n\\n /**\\n * @notice module:core\\n * @dev Hashing function used to (re)build the proposal id from the proposal details..\\n */\\n function hashProposal(\\n address[] memory targets,\\n uint256[] memory values,\\n bytes[] memory calldatas,\\n bytes32 descriptionHash\\n ) external pure returns (uint256);\\n\\n /**\\n * @notice module:core\\n * @dev Current state of a proposal, following Compound's convention\\n */\\n function state(uint256 proposalId) external view returns (ProposalState);\\n\\n /**\\n * @notice module:core\\n * @dev The number of votes required in order for a voter to become a proposer.\\n */\\n function proposalThreshold() external view returns (uint256);\\n\\n /**\\n * @notice module:core\\n * @dev Timepoint used to retrieve user's votes and quorum. If using block number (as per Compound's Comp), the\\n * snapshot is performed at the end of this block. Hence, voting for this proposal starts at the beginning of the\\n * following block.\\n */\\n function proposalSnapshot(uint256 proposalId) external view returns (uint256);\\n\\n /**\\n * @notice module:core\\n * @dev Timepoint at which votes close. If using block number, votes close at the end of this block, so it is\\n * possible to cast a vote during this block.\\n */\\n function proposalDeadline(uint256 proposalId) external view returns (uint256);\\n\\n /**\\n * @notice module:core\\n * @dev The account that created a proposal.\\n */\\n function proposalProposer(uint256 proposalId) external view returns (address);\\n\\n /**\\n * @notice module:core\\n * @dev The time when a queued proposal becomes executable (\\\"ETA\\\"). Unlike {proposalSnapshot} and\\n * {proposalDeadline}, this doesn't use the governor clock, and instead relies on the executor's clock which may be\\n * different. In most cases this will be a timestamp.\\n */\\n function proposalEta(uint256 proposalId) external view returns (uint256);\\n\\n /**\\n * @notice module:core\\n * @dev Whether a proposal needs to be queued before execution.\\n */\\n function proposalNeedsQueuing(uint256 proposalId) external view returns (bool);\\n\\n /**\\n * @notice module:user-config\\n * @dev Delay, between the proposal is created and the vote starts. The unit this duration is expressed in depends\\n * on the clock (see ERC-6372) this contract uses.\\n *\\n * This can be increased to leave time for users to buy voting power, or delegate it, before the voting of a\\n * proposal starts.\\n *\\n * NOTE: While this interface returns a uint256, timepoints are stored as uint48 following the ERC-6372 clock type.\\n * Consequently this value must fit in a uint48 (when added to the current clock). See {IERC6372-clock}.\\n */\\n function votingDelay() external view returns (uint256);\\n\\n /**\\n * @notice module:user-config\\n * @dev Delay between the vote start and vote end. The unit this duration is expressed in depends on the clock\\n * (see ERC-6372) this contract uses.\\n *\\n * NOTE: The {votingDelay} can delay the start of the vote. This must be considered when setting the voting\\n * duration compared to the voting delay.\\n *\\n * NOTE: This value is stored when the proposal is submitted so that possible changes to the value do not affect\\n * proposals that have already been submitted. The type used to save it is a uint32. Consequently, while this\\n * interface returns a uint256, the value it returns should fit in a uint32.\\n */\\n function votingPeriod() external view returns (uint256);\\n\\n /**\\n * @notice module:user-config\\n * @dev Minimum number of cast voted required for a proposal to be successful.\\n *\\n * NOTE: The `timepoint` parameter corresponds to the snapshot used for counting vote. This allows to scale the\\n * quorum depending on values such as the totalSupply of a token at this timepoint (see {ERC20Votes}).\\n */\\n function quorum(uint256 timepoint) external view returns (uint256);\\n\\n /**\\n * @notice module:reputation\\n * @dev Voting power of an `account` at a specific `timepoint`.\\n *\\n * Note: this can be implemented in a number of ways, for example by reading the delegated balance from one (or\\n * multiple), {ERC20Votes} tokens.\\n */\\n function getVotes(address account, uint256 timepoint) external view returns (uint256);\\n\\n /**\\n * @notice module:reputation\\n * @dev Voting power of an `account` at a specific `timepoint` given additional encoded parameters.\\n */\\n function getVotesWithParams(\\n address account,\\n uint256 timepoint,\\n bytes memory params\\n ) external view returns (uint256);\\n\\n /**\\n * @notice module:voting\\n * @dev Returns whether `account` has cast a vote on `proposalId`.\\n */\\n function hasVoted(uint256 proposalId, address account) external view returns (bool);\\n\\n /**\\n * @dev Create a new proposal. Vote start after a delay specified by {IGovernor-votingDelay} and lasts for a\\n * duration specified by {IGovernor-votingPeriod}.\\n *\\n * Emits a {ProposalCreated} event.\\n *\\n * NOTE: The state of the Governor and `targets` may change between the proposal creation and its execution.\\n * This may be the result of third party actions on the targeted contracts, or other governor proposals.\\n * For example, the balance of this contract could be updated or its access control permissions may be modified,\\n * possibly compromising the proposal's ability to execute successfully (e.g. the governor doesn't have enough\\n * value to cover a proposal with multiple transfers).\\n */\\n function propose(\\n address[] memory targets,\\n uint256[] memory values,\\n bytes[] memory calldatas,\\n string memory description\\n ) external returns (uint256 proposalId);\\n\\n /**\\n * @dev Queue a proposal. Some governors require this step to be performed before execution can happen. If queuing\\n * is not necessary, this function may revert.\\n * Queuing a proposal requires the quorum to be reached, the vote to be successful, and the deadline to be reached.\\n *\\n * Emits a {ProposalQueued} event.\\n */\\n function queue(\\n address[] memory targets,\\n uint256[] memory values,\\n bytes[] memory calldatas,\\n bytes32 descriptionHash\\n ) external returns (uint256 proposalId);\\n\\n /**\\n * @dev Execute a successful proposal. This requires the quorum to be reached, the vote to be successful, and the\\n * deadline to be reached. Depending on the governor it might also be required that the proposal was queued and\\n * that some delay passed.\\n *\\n * Emits a {ProposalExecuted} event.\\n *\\n * NOTE: Some modules can modify the requirements for execution, for example by adding an additional timelock.\\n */\\n function execute(\\n address[] memory targets,\\n uint256[] memory values,\\n bytes[] memory calldatas,\\n bytes32 descriptionHash\\n ) external payable returns (uint256 proposalId);\\n\\n /**\\n * @dev Cancel a proposal. A proposal is cancellable by the proposer, but only while it is Pending state, i.e.\\n * before the vote starts.\\n *\\n * Emits a {ProposalCanceled} event.\\n */\\n function cancel(\\n address[] memory targets,\\n uint256[] memory values,\\n bytes[] memory calldatas,\\n bytes32 descriptionHash\\n ) external returns (uint256 proposalId);\\n\\n /**\\n * @dev Cast a vote\\n *\\n * Emits a {VoteCast} event.\\n */\\n function castVote(uint256 proposalId, uint8 support) external returns (uint256 balance);\\n\\n /**\\n * @dev Cast a vote with a reason\\n *\\n * Emits a {VoteCast} event.\\n */\\n function castVoteWithReason(\\n uint256 proposalId,\\n uint8 support,\\n string calldata reason\\n ) external returns (uint256 balance);\\n\\n /**\\n * @dev Cast a vote with a reason and additional encoded parameters\\n *\\n * Emits a {VoteCast} or {VoteCastWithParams} event depending on the length of params.\\n */\\n function castVoteWithReasonAndParams(\\n uint256 proposalId,\\n uint8 support,\\n string calldata reason,\\n bytes memory params\\n ) external returns (uint256 balance);\\n\\n /**\\n * @dev Cast a vote using the voter's signature, including ERC-1271 signature support.\\n *\\n * Emits a {VoteCast} event.\\n */\\n function castVoteBySig(\\n uint256 proposalId,\\n uint8 support,\\n address voter,\\n bytes memory signature\\n ) external returns (uint256 balance);\\n\\n /**\\n * @dev Cast a vote with a reason and additional encoded parameters using the voter's signature,\\n * including ERC-1271 signature support.\\n *\\n * Emits a {VoteCast} or {VoteCastWithParams} event depending on the length of params.\\n */\\n function castVoteWithReasonAndParamsBySig(\\n uint256 proposalId,\\n uint8 support,\\n address voter,\\n string calldata reason,\\n bytes memory params,\\n bytes memory signature\\n ) external returns (uint256 balance);\\n}\\n\",\"keccak256\":\"0x9406604436e6925413ab70149fec16f3b28cc9e492b2baaa09c0acefd315b2a7\",\"license\":\"MIT\"},\"@openzeppelin/contracts/governance/extensions/GovernorCountingSimple.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (governance/extensions/GovernorCountingSimple.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {Governor} from \\\"../Governor.sol\\\";\\n\\n/**\\n * @dev Extension of {Governor} for simple, 3 options, vote counting.\\n */\\nabstract contract GovernorCountingSimple is Governor {\\n /**\\n * @dev Supported vote types. Matches Governor Bravo ordering.\\n */\\n enum VoteType {\\n Against,\\n For,\\n Abstain\\n }\\n\\n struct ProposalVote {\\n uint256 againstVotes;\\n uint256 forVotes;\\n uint256 abstainVotes;\\n mapping(address voter => bool) hasVoted;\\n }\\n\\n mapping(uint256 proposalId => ProposalVote) private _proposalVotes;\\n\\n /**\\n * @dev See {IGovernor-COUNTING_MODE}.\\n */\\n // solhint-disable-next-line func-name-mixedcase\\n function COUNTING_MODE() public pure virtual override returns (string memory) {\\n return \\\"support=bravo&quorum=for,abstain\\\";\\n }\\n\\n /**\\n * @dev See {IGovernor-hasVoted}.\\n */\\n function hasVoted(uint256 proposalId, address account) public view virtual override returns (bool) {\\n return _proposalVotes[proposalId].hasVoted[account];\\n }\\n\\n /**\\n * @dev Accessor to the internal vote counts.\\n */\\n function proposalVotes(\\n uint256 proposalId\\n ) public view virtual returns (uint256 againstVotes, uint256 forVotes, uint256 abstainVotes) {\\n ProposalVote storage proposalVote = _proposalVotes[proposalId];\\n return (proposalVote.againstVotes, proposalVote.forVotes, proposalVote.abstainVotes);\\n }\\n\\n /**\\n * @dev See {Governor-_quorumReached}.\\n */\\n function _quorumReached(uint256 proposalId) internal view virtual override returns (bool) {\\n ProposalVote storage proposalVote = _proposalVotes[proposalId];\\n\\n return quorum(proposalSnapshot(proposalId)) <= proposalVote.forVotes + proposalVote.abstainVotes;\\n }\\n\\n /**\\n * @dev See {Governor-_voteSucceeded}. In this module, the forVotes must be strictly over the againstVotes.\\n */\\n function _voteSucceeded(uint256 proposalId) internal view virtual override returns (bool) {\\n ProposalVote storage proposalVote = _proposalVotes[proposalId];\\n\\n return proposalVote.forVotes > proposalVote.againstVotes;\\n }\\n\\n /**\\n * @dev See {Governor-_countVote}. In this module, the support follows the `VoteType` enum (from Governor Bravo).\\n */\\n function _countVote(\\n uint256 proposalId,\\n address account,\\n uint8 support,\\n uint256 totalWeight,\\n bytes memory // params\\n ) internal virtual override returns (uint256) {\\n ProposalVote storage proposalVote = _proposalVotes[proposalId];\\n\\n if (proposalVote.hasVoted[account]) {\\n revert GovernorAlreadyCastVote(account);\\n }\\n proposalVote.hasVoted[account] = true;\\n\\n if (support == uint8(VoteType.Against)) {\\n proposalVote.againstVotes += totalWeight;\\n } else if (support == uint8(VoteType.For)) {\\n proposalVote.forVotes += totalWeight;\\n } else if (support == uint8(VoteType.Abstain)) {\\n proposalVote.abstainVotes += totalWeight;\\n } else {\\n revert GovernorInvalidVoteType();\\n }\\n\\n return totalWeight;\\n }\\n}\\n\",\"keccak256\":\"0xdc21c15a8582ca58529bf4b63209718a86fd944cbb206a492687333fe8cce0ff\",\"license\":\"MIT\"},\"@openzeppelin/contracts/governance/extensions/GovernorSettings.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (governance/extensions/GovernorSettings.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {Governor} from \\\"../Governor.sol\\\";\\n\\n/**\\n * @dev Extension of {Governor} for settings updatable through governance.\\n */\\nabstract contract GovernorSettings is Governor {\\n // amount of token\\n uint256 private _proposalThreshold;\\n // timepoint: limited to uint48 in core (same as clock() type)\\n uint48 private _votingDelay;\\n // duration: limited to uint32 in core\\n uint32 private _votingPeriod;\\n\\n event VotingDelaySet(uint256 oldVotingDelay, uint256 newVotingDelay);\\n event VotingPeriodSet(uint256 oldVotingPeriod, uint256 newVotingPeriod);\\n event ProposalThresholdSet(uint256 oldProposalThreshold, uint256 newProposalThreshold);\\n\\n /**\\n * @dev Initialize the governance parameters.\\n */\\n constructor(uint48 initialVotingDelay, uint32 initialVotingPeriod, uint256 initialProposalThreshold) {\\n _setVotingDelay(initialVotingDelay);\\n _setVotingPeriod(initialVotingPeriod);\\n _setProposalThreshold(initialProposalThreshold);\\n }\\n\\n /**\\n * @dev See {IGovernor-votingDelay}.\\n */\\n function votingDelay() public view virtual override returns (uint256) {\\n return _votingDelay;\\n }\\n\\n /**\\n * @dev See {IGovernor-votingPeriod}.\\n */\\n function votingPeriod() public view virtual override returns (uint256) {\\n return _votingPeriod;\\n }\\n\\n /**\\n * @dev See {Governor-proposalThreshold}.\\n */\\n function proposalThreshold() public view virtual override returns (uint256) {\\n return _proposalThreshold;\\n }\\n\\n /**\\n * @dev Update the voting delay. This operation can only be performed through a governance proposal.\\n *\\n * Emits a {VotingDelaySet} event.\\n */\\n function setVotingDelay(uint48 newVotingDelay) public virtual onlyGovernance {\\n _setVotingDelay(newVotingDelay);\\n }\\n\\n /**\\n * @dev Update the voting period. This operation can only be performed through a governance proposal.\\n *\\n * Emits a {VotingPeriodSet} event.\\n */\\n function setVotingPeriod(uint32 newVotingPeriod) public virtual onlyGovernance {\\n _setVotingPeriod(newVotingPeriod);\\n }\\n\\n /**\\n * @dev Update the proposal threshold. This operation can only be performed through a governance proposal.\\n *\\n * Emits a {ProposalThresholdSet} event.\\n */\\n function setProposalThreshold(uint256 newProposalThreshold) public virtual onlyGovernance {\\n _setProposalThreshold(newProposalThreshold);\\n }\\n\\n /**\\n * @dev Internal setter for the voting delay.\\n *\\n * Emits a {VotingDelaySet} event.\\n */\\n function _setVotingDelay(uint48 newVotingDelay) internal virtual {\\n emit VotingDelaySet(_votingDelay, newVotingDelay);\\n _votingDelay = newVotingDelay;\\n }\\n\\n /**\\n * @dev Internal setter for the voting period.\\n *\\n * Emits a {VotingPeriodSet} event.\\n */\\n function _setVotingPeriod(uint32 newVotingPeriod) internal virtual {\\n if (newVotingPeriod == 0) {\\n revert GovernorInvalidVotingPeriod(0);\\n }\\n emit VotingPeriodSet(_votingPeriod, newVotingPeriod);\\n _votingPeriod = newVotingPeriod;\\n }\\n\\n /**\\n * @dev Internal setter for the proposal threshold.\\n *\\n * Emits a {ProposalThresholdSet} event.\\n */\\n function _setProposalThreshold(uint256 newProposalThreshold) internal virtual {\\n emit ProposalThresholdSet(_proposalThreshold, newProposalThreshold);\\n _proposalThreshold = newProposalThreshold;\\n }\\n}\\n\",\"keccak256\":\"0x1e0810708b8f5de8d3db73240ccee2d36a305cb904aa5acd4588834ebce6acce\",\"license\":\"MIT\"},\"@openzeppelin/contracts/governance/extensions/GovernorVotes.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (governance/extensions/GovernorVotes.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {Governor} from \\\"../Governor.sol\\\";\\nimport {IVotes} from \\\"../utils/IVotes.sol\\\";\\nimport {IERC5805} from \\\"../../interfaces/IERC5805.sol\\\";\\nimport {SafeCast} from \\\"../../utils/math/SafeCast.sol\\\";\\nimport {Time} from \\\"../../utils/types/Time.sol\\\";\\n\\n/**\\n * @dev Extension of {Governor} for voting weight extraction from an {ERC20Votes} token, or since v4.5 an {ERC721Votes}\\n * token.\\n */\\nabstract contract GovernorVotes is Governor {\\n IERC5805 private immutable _token;\\n\\n constructor(IVotes tokenAddress) {\\n _token = IERC5805(address(tokenAddress));\\n }\\n\\n /**\\n * @dev The token that voting power is sourced from.\\n */\\n function token() public view virtual returns (IERC5805) {\\n return _token;\\n }\\n\\n /**\\n * @dev Clock (as specified in ERC-6372) is set to match the token's clock. Fallback to block numbers if the token\\n * does not implement ERC-6372.\\n */\\n function clock() public view virtual override returns (uint48) {\\n try token().clock() returns (uint48 timepoint) {\\n return timepoint;\\n } catch {\\n return Time.blockNumber();\\n }\\n }\\n\\n /**\\n * @dev Machine-readable description of the clock as specified in ERC-6372.\\n */\\n // solhint-disable-next-line func-name-mixedcase\\n function CLOCK_MODE() public view virtual override returns (string memory) {\\n try token().CLOCK_MODE() returns (string memory clockmode) {\\n return clockmode;\\n } catch {\\n return \\\"mode=blocknumber&from=default\\\";\\n }\\n }\\n\\n /**\\n * Read the voting weight from the token's built in snapshot mechanism (see {Governor-_getVotes}).\\n */\\n function _getVotes(\\n address account,\\n uint256 timepoint,\\n bytes memory /*params*/\\n ) internal view virtual override returns (uint256) {\\n return token().getPastVotes(account, timepoint);\\n }\\n}\\n\",\"keccak256\":\"0x6fc0e9e0c3ed137dc2281a120cdc01b92010a26e6fd5fc4e6af08fc0f28bdb9e\",\"license\":\"MIT\"},\"@openzeppelin/contracts/governance/extensions/GovernorVotesQuorumFraction.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (governance/extensions/GovernorVotesQuorumFraction.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {GovernorVotes} from \\\"./GovernorVotes.sol\\\";\\nimport {SafeCast} from \\\"../../utils/math/SafeCast.sol\\\";\\nimport {Checkpoints} from \\\"../../utils/structs/Checkpoints.sol\\\";\\n\\n/**\\n * @dev Extension of {Governor} for voting weight extraction from an {ERC20Votes} token and a quorum expressed as a\\n * fraction of the total supply.\\n */\\nabstract contract GovernorVotesQuorumFraction is GovernorVotes {\\n using Checkpoints for Checkpoints.Trace208;\\n\\n Checkpoints.Trace208 private _quorumNumeratorHistory;\\n\\n event QuorumNumeratorUpdated(uint256 oldQuorumNumerator, uint256 newQuorumNumerator);\\n\\n /**\\n * @dev The quorum set is not a valid fraction.\\n */\\n error GovernorInvalidQuorumFraction(uint256 quorumNumerator, uint256 quorumDenominator);\\n\\n /**\\n * @dev Initialize quorum as a fraction of the token's total supply.\\n *\\n * The fraction is specified as `numerator / denominator`. By default the denominator is 100, so quorum is\\n * specified as a percent: a numerator of 10 corresponds to quorum being 10% of total supply. The denominator can be\\n * customized by overriding {quorumDenominator}.\\n */\\n constructor(uint256 quorumNumeratorValue) {\\n _updateQuorumNumerator(quorumNumeratorValue);\\n }\\n\\n /**\\n * @dev Returns the current quorum numerator. See {quorumDenominator}.\\n */\\n function quorumNumerator() public view virtual returns (uint256) {\\n return _quorumNumeratorHistory.latest();\\n }\\n\\n /**\\n * @dev Returns the quorum numerator at a specific timepoint. See {quorumDenominator}.\\n */\\n function quorumNumerator(uint256 timepoint) public view virtual returns (uint256) {\\n uint256 length = _quorumNumeratorHistory._checkpoints.length;\\n\\n // Optimistic search, check the latest checkpoint\\n Checkpoints.Checkpoint208 storage latest = _quorumNumeratorHistory._checkpoints[length - 1];\\n uint48 latestKey = latest._key;\\n uint208 latestValue = latest._value;\\n if (latestKey <= timepoint) {\\n return latestValue;\\n }\\n\\n // Otherwise, do the binary search\\n return _quorumNumeratorHistory.upperLookupRecent(SafeCast.toUint48(timepoint));\\n }\\n\\n /**\\n * @dev Returns the quorum denominator. Defaults to 100, but may be overridden.\\n */\\n function quorumDenominator() public view virtual returns (uint256) {\\n return 100;\\n }\\n\\n /**\\n * @dev Returns the quorum for a timepoint, in terms of number of votes: `supply * numerator / denominator`.\\n */\\n function quorum(uint256 timepoint) public view virtual override returns (uint256) {\\n return (token().getPastTotalSupply(timepoint) * quorumNumerator(timepoint)) / quorumDenominator();\\n }\\n\\n /**\\n * @dev Changes the quorum numerator.\\n *\\n * Emits a {QuorumNumeratorUpdated} event.\\n *\\n * Requirements:\\n *\\n * - Must be called through a governance proposal.\\n * - New numerator must be smaller or equal to the denominator.\\n */\\n function updateQuorumNumerator(uint256 newQuorumNumerator) external virtual onlyGovernance {\\n _updateQuorumNumerator(newQuorumNumerator);\\n }\\n\\n /**\\n * @dev Changes the quorum numerator.\\n *\\n * Emits a {QuorumNumeratorUpdated} event.\\n *\\n * Requirements:\\n *\\n * - New numerator must be smaller or equal to the denominator.\\n */\\n function _updateQuorumNumerator(uint256 newQuorumNumerator) internal virtual {\\n uint256 denominator = quorumDenominator();\\n if (newQuorumNumerator > denominator) {\\n revert GovernorInvalidQuorumFraction(newQuorumNumerator, denominator);\\n }\\n\\n uint256 oldQuorumNumerator = quorumNumerator();\\n _quorumNumeratorHistory.push(clock(), SafeCast.toUint208(newQuorumNumerator));\\n\\n emit QuorumNumeratorUpdated(oldQuorumNumerator, newQuorumNumerator);\\n }\\n}\\n\",\"keccak256\":\"0x5b5cdb361ed018c0162942d673c17e187c1a52ded2ce4f41e8a3f3f5d1656e00\",\"license\":\"MIT\"},\"@openzeppelin/contracts/governance/utils/IVotes.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (governance/utils/IVotes.sol)\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Common interface for {ERC20Votes}, {ERC721Votes}, and other {Votes}-enabled contracts.\\n */\\ninterface IVotes {\\n /**\\n * @dev The signature used has expired.\\n */\\n error VotesExpiredSignature(uint256 expiry);\\n\\n /**\\n * @dev Emitted when an account changes their delegate.\\n */\\n event DelegateChanged(address indexed delegator, address indexed fromDelegate, address indexed toDelegate);\\n\\n /**\\n * @dev Emitted when a token transfer or delegate change results in changes to a delegate's number of voting units.\\n */\\n event DelegateVotesChanged(address indexed delegate, uint256 previousVotes, uint256 newVotes);\\n\\n /**\\n * @dev Returns the current amount of votes that `account` has.\\n */\\n function getVotes(address account) external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of votes that `account` had at a specific moment in the past. If the `clock()` is\\n * configured to use block numbers, this will return the value at the end of the corresponding block.\\n */\\n function getPastVotes(address account, uint256 timepoint) external view returns (uint256);\\n\\n /**\\n * @dev Returns the total supply of votes available at a specific moment in the past. If the `clock()` is\\n * configured to use block numbers, this will return the value at the end of the corresponding block.\\n *\\n * NOTE: This value is the sum of all available votes, which is not necessarily the sum of all delegated votes.\\n * Votes that have not been delegated are still part of total supply, even though they would not participate in a\\n * vote.\\n */\\n function getPastTotalSupply(uint256 timepoint) external view returns (uint256);\\n\\n /**\\n * @dev Returns the delegate that `account` has chosen.\\n */\\n function delegates(address account) external view returns (address);\\n\\n /**\\n * @dev Delegates votes from the sender to `delegatee`.\\n */\\n function delegate(address delegatee) external;\\n\\n /**\\n * @dev Delegates votes from signer to `delegatee`.\\n */\\n function delegateBySig(address delegatee, uint256 nonce, uint256 expiry, uint8 v, bytes32 r, bytes32 s) external;\\n}\\n\",\"keccak256\":\"0x5e2b397ae88fd5c68e4f6762eb9f65f65c36702eb57796495f471d024ce70947\",\"license\":\"MIT\"},\"@openzeppelin/contracts/interfaces/IERC1271.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (interfaces/IERC1271.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Interface of the ERC-1271 standard signature validation method for\\n * contracts as defined in https://eips.ethereum.org/EIPS/eip-1271[ERC-1271].\\n */\\ninterface IERC1271 {\\n /**\\n * @dev Should return whether the signature provided is valid for the provided data\\n * @param hash Hash of the data to be signed\\n * @param signature Signature byte array associated with _data\\n */\\n function isValidSignature(bytes32 hash, bytes memory signature) external view returns (bytes4 magicValue);\\n}\\n\",\"keccak256\":\"0x4aaaf1c0737dd16e81f0d2b9833c549747a5ede6873bf1444bc72aa572d03e98\",\"license\":\"MIT\"},\"@openzeppelin/contracts/interfaces/IERC165.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC165.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {IERC165} from \\\"../utils/introspection/IERC165.sol\\\";\\n\",\"keccak256\":\"0xde7e9fd9aee8d4f40772f96bb3b58836cbc6dfc0227014a061947f8821ea9724\",\"license\":\"MIT\"},\"@openzeppelin/contracts/interfaces/IERC5267.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC5267.sol)\\n\\npragma solidity ^0.8.20;\\n\\ninterface IERC5267 {\\n /**\\n * @dev MAY be emitted to signal that the domain could have changed.\\n */\\n event EIP712DomainChanged();\\n\\n /**\\n * @dev returns the fields and values that describe the domain separator used by this contract for EIP-712\\n * signature.\\n */\\n function eip712Domain()\\n external\\n view\\n returns (\\n bytes1 fields,\\n string memory name,\\n string memory version,\\n uint256 chainId,\\n address verifyingContract,\\n bytes32 salt,\\n uint256[] memory extensions\\n );\\n}\\n\",\"keccak256\":\"0x92aa1df62dc3d33f1656d63bede0923e0df0b706ad4137c8b10b0a8fe549fd92\",\"license\":\"MIT\"},\"@openzeppelin/contracts/interfaces/IERC5805.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC5805.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {IVotes} from \\\"../governance/utils/IVotes.sol\\\";\\nimport {IERC6372} from \\\"./IERC6372.sol\\\";\\n\\ninterface IERC5805 is IERC6372, IVotes {}\\n\",\"keccak256\":\"0x4b9b89f91adbb7d3574f85394754cfb08c5b4eafca8a7061e2094a019ab8f818\",\"license\":\"MIT\"},\"@openzeppelin/contracts/interfaces/IERC6372.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC6372.sol)\\n\\npragma solidity ^0.8.20;\\n\\ninterface IERC6372 {\\n /**\\n * @dev Clock used for flagging checkpoints. Can be overridden to implement timestamp based checkpoints (and voting).\\n */\\n function clock() external view returns (uint48);\\n\\n /**\\n * @dev Description of the clock\\n */\\n // solhint-disable-next-line func-name-mixedcase\\n function CLOCK_MODE() external view returns (string memory);\\n}\\n\",\"keccak256\":\"0xeb2857b7dafb7e0d8526dbfe794e6c047df2851c9e6ee91dc4a55f3c34af5d33\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC1155/IERC1155Receiver.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC1155/IERC1155Receiver.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {IERC165} from \\\"../../utils/introspection/IERC165.sol\\\";\\n\\n/**\\n * @dev Interface that must be implemented by smart contracts in order to receive\\n * ERC-1155 token transfers.\\n */\\ninterface IERC1155Receiver is IERC165 {\\n /**\\n * @dev Handles the receipt of a single ERC-1155 token type. This function is\\n * called at the end of a `safeTransferFrom` after the balance has been updated.\\n *\\n * NOTE: To accept the transfer, this must return\\n * `bytes4(keccak256(\\\"onERC1155Received(address,address,uint256,uint256,bytes)\\\"))`\\n * (i.e. 0xf23a6e61, or its own function selector).\\n *\\n * @param operator The address which initiated the transfer (i.e. msg.sender)\\n * @param from The address which previously owned the token\\n * @param id The ID of the token being transferred\\n * @param value The amount of tokens being transferred\\n * @param data Additional data with no specified format\\n * @return `bytes4(keccak256(\\\"onERC1155Received(address,address,uint256,uint256,bytes)\\\"))` if transfer is allowed\\n */\\n function onERC1155Received(\\n address operator,\\n address from,\\n uint256 id,\\n uint256 value,\\n bytes calldata data\\n ) external returns (bytes4);\\n\\n /**\\n * @dev Handles the receipt of a multiple ERC-1155 token types. This function\\n * is called at the end of a `safeBatchTransferFrom` after the balances have\\n * been updated.\\n *\\n * NOTE: To accept the transfer(s), this must return\\n * `bytes4(keccak256(\\\"onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)\\\"))`\\n * (i.e. 0xbc197c81, or its own function selector).\\n *\\n * @param operator The address which initiated the batch transfer (i.e. msg.sender)\\n * @param from The address which previously owned the token\\n * @param ids An array containing ids of each token being transferred (order and length must match values array)\\n * @param values An array containing amounts of each token being transferred (order and length must match ids array)\\n * @param data Additional data with no specified format\\n * @return `bytes4(keccak256(\\\"onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)\\\"))` if transfer is allowed\\n */\\n function onERC1155BatchReceived(\\n address operator,\\n address from,\\n uint256[] calldata ids,\\n uint256[] calldata values,\\n bytes calldata data\\n ) external returns (bytes4);\\n}\\n\",\"keccak256\":\"0x61a23d601c2ab69dd726ac55058604cbda98e1d728ba31a51c379a3f9eeea715\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC721/IERC721Receiver.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @title ERC-721 token receiver interface\\n * @dev Interface for any contract that wants to support safeTransfers\\n * from ERC-721 asset contracts.\\n */\\ninterface IERC721Receiver {\\n /**\\n * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom}\\n * by `operator` from `from`, this function is called.\\n *\\n * It must return its Solidity selector to confirm the token transfer.\\n * If any other value is returned or the interface is not implemented by the recipient, the transfer will be\\n * reverted.\\n *\\n * The selector can be obtained in Solidity with `IERC721Receiver.onERC721Received.selector`.\\n */\\n function onERC721Received(\\n address operator,\\n address from,\\n uint256 tokenId,\\n bytes calldata data\\n ) external returns (bytes4);\\n}\\n\",\"keccak256\":\"0xb5afb8e8eebc4d1c6404df2f5e1e6d2c3d24fd01e5dfc855314951ecfaae462d\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {Errors} from \\\"./Errors.sol\\\";\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev There's no code at `target` (it is not a contract).\\n */\\n error AddressEmptyCode(address target);\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.8.20/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n if (address(this).balance < amount) {\\n revert Errors.InsufficientBalance(address(this).balance, amount);\\n }\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n if (!success) {\\n revert Errors.FailedCall();\\n }\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason or custom error, it is bubbled\\n * up by this function (like regular Solidity function calls). However, if\\n * the call reverted with no returned reason, this function reverts with a\\n * {Errors.FailedCall} error.\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n */\\n function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {\\n if (address(this).balance < value) {\\n revert Errors.InsufficientBalance(address(this).balance, value);\\n }\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResultFromTarget(target, success, returndata);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResultFromTarget(target, success, returndata);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResultFromTarget(target, success, returndata);\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call to smart-contract was successful, and reverts if the target\\n * was not a contract or bubbling up the revert reason (falling back to {Errors.FailedCall}) in case\\n * of an unsuccessful call.\\n */\\n function verifyCallResultFromTarget(\\n address target,\\n bool success,\\n bytes memory returndata\\n ) internal view returns (bytes memory) {\\n if (!success) {\\n _revert(returndata);\\n } else {\\n // only check if target is a contract if the call was successful and the return data is empty\\n // otherwise we already know that it was a contract\\n if (returndata.length == 0 && target.code.length == 0) {\\n revert AddressEmptyCode(target);\\n }\\n return returndata;\\n }\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call was successful, and reverts if it wasn't, either by bubbling the\\n * revert reason or with a default {Errors.FailedCall} error.\\n */\\n function verifyCallResult(bool success, bytes memory returndata) internal pure returns (bytes memory) {\\n if (!success) {\\n _revert(returndata);\\n } else {\\n return returndata;\\n }\\n }\\n\\n /**\\n * @dev Reverts with returndata if present. Otherwise reverts with {Errors.FailedCall}.\\n */\\n function _revert(bytes memory returndata) private pure {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n assembly (\\\"memory-safe\\\") {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert Errors.FailedCall();\\n }\\n }\\n}\\n\",\"keccak256\":\"0x9d8da059267bac779a2dbbb9a26c2acf00ca83085e105d62d5d4ef96054a47f5\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)\\n\\npragma solidity ^0.8.20;\\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\":\"0x493033a8d1b176a037b2cc6a04dad01a5c157722049bbecf632ca876224dd4b2\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Errors.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/Errors.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Collection of common custom errors used in multiple contracts\\n *\\n * IMPORTANT: Backwards compatibility is not guaranteed in future versions of the library.\\n * It is recommended to avoid relying on the error API for critical functionality.\\n *\\n * _Available since v5.1._\\n */\\nlibrary Errors {\\n /**\\n * @dev The ETH balance of the account is not enough to perform the operation.\\n */\\n error InsufficientBalance(uint256 balance, uint256 needed);\\n\\n /**\\n * @dev A call to an address target failed. The target may have reverted.\\n */\\n error FailedCall();\\n\\n /**\\n * @dev The deployment failed.\\n */\\n error FailedDeployment();\\n\\n /**\\n * @dev A necessary precompile is missing.\\n */\\n error MissingPrecompile(address);\\n}\\n\",\"keccak256\":\"0x6afa713bfd42cf0f7656efa91201007ac465e42049d7de1d50753a373648c123\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Nonces.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/Nonces.sol)\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Provides tracking nonces for addresses. Nonces will only increment.\\n */\\nabstract contract Nonces {\\n /**\\n * @dev The nonce used for an `account` is not the expected current nonce.\\n */\\n error InvalidAccountNonce(address account, uint256 currentNonce);\\n\\n mapping(address account => uint256) private _nonces;\\n\\n /**\\n * @dev Returns the next unused nonce for an address.\\n */\\n function nonces(address owner) public view virtual returns (uint256) {\\n return _nonces[owner];\\n }\\n\\n /**\\n * @dev Consumes a nonce.\\n *\\n * Returns the current value and increments nonce.\\n */\\n function _useNonce(address owner) internal virtual returns (uint256) {\\n // For each account, the nonce has an initial value of 0, can only be incremented by one, and cannot be\\n // decremented or reset. This guarantees that the nonce never overflows.\\n unchecked {\\n // It is important to do x++ and not ++x here.\\n return _nonces[owner]++;\\n }\\n }\\n\\n /**\\n * @dev Same as {_useNonce} but checking that `nonce` is the next valid for `owner`.\\n */\\n function _useCheckedNonce(address owner, uint256 nonce) internal virtual {\\n uint256 current = _useNonce(owner);\\n if (nonce != current) {\\n revert InvalidAccountNonce(owner, current);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x0082767004fca261c332e9ad100868327a863a88ef724e844857128845ab350f\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Panic.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/Panic.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Helper library for emitting standardized panic codes.\\n *\\n * ```solidity\\n * contract Example {\\n * using Panic for uint256;\\n *\\n * // Use any of the declared internal constants\\n * function foo() { Panic.GENERIC.panic(); }\\n *\\n * // Alternatively\\n * function foo() { Panic.panic(Panic.GENERIC); }\\n * }\\n * ```\\n *\\n * Follows the list from https://github.com/ethereum/solidity/blob/v0.8.24/libsolutil/ErrorCodes.h[libsolutil].\\n *\\n * _Available since v5.1._\\n */\\n// slither-disable-next-line unused-state\\nlibrary Panic {\\n /// @dev generic / unspecified error\\n uint256 internal constant GENERIC = 0x00;\\n /// @dev used by the assert() builtin\\n uint256 internal constant ASSERT = 0x01;\\n /// @dev arithmetic underflow or overflow\\n uint256 internal constant UNDER_OVERFLOW = 0x11;\\n /// @dev division or modulo by zero\\n uint256 internal constant DIVISION_BY_ZERO = 0x12;\\n /// @dev enum conversion error\\n uint256 internal constant ENUM_CONVERSION_ERROR = 0x21;\\n /// @dev invalid encoding in storage\\n uint256 internal constant STORAGE_ENCODING_ERROR = 0x22;\\n /// @dev empty array pop\\n uint256 internal constant EMPTY_ARRAY_POP = 0x31;\\n /// @dev array out of bounds access\\n uint256 internal constant ARRAY_OUT_OF_BOUNDS = 0x32;\\n /// @dev resource error (too large allocation or too large array)\\n uint256 internal constant RESOURCE_ERROR = 0x41;\\n /// @dev calling invalid internal function\\n uint256 internal constant INVALID_INTERNAL_FUNCTION = 0x51;\\n\\n /// @dev Reverts with a panic code. Recommended to use with\\n /// the internal constants with predefined codes.\\n function panic(uint256 code) internal pure {\\n assembly (\\\"memory-safe\\\") {\\n mstore(0x00, 0x4e487b71)\\n mstore(0x20, code)\\n revert(0x1c, 0x24)\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf7fe324703a64fc51702311dc51562d5cb1497734f074e4f483bfb6717572d7a\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/ShortStrings.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/ShortStrings.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {StorageSlot} from \\\"./StorageSlot.sol\\\";\\n\\n// | string | 0xAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA |\\n// | length | 0x BB |\\ntype ShortString is bytes32;\\n\\n/**\\n * @dev This library provides functions to convert short memory strings\\n * into a `ShortString` type that can be used as an immutable variable.\\n *\\n * Strings of arbitrary length can be optimized using this library if\\n * they are short enough (up to 31 bytes) by packing them with their\\n * length (1 byte) in a single EVM word (32 bytes). Additionally, a\\n * fallback mechanism can be used for every other case.\\n *\\n * Usage example:\\n *\\n * ```solidity\\n * contract Named {\\n * using ShortStrings for *;\\n *\\n * ShortString private immutable _name;\\n * string private _nameFallback;\\n *\\n * constructor(string memory contractName) {\\n * _name = contractName.toShortStringWithFallback(_nameFallback);\\n * }\\n *\\n * function name() external view returns (string memory) {\\n * return _name.toStringWithFallback(_nameFallback);\\n * }\\n * }\\n * ```\\n */\\nlibrary ShortStrings {\\n // Used as an identifier for strings longer than 31 bytes.\\n bytes32 private constant FALLBACK_SENTINEL = 0x00000000000000000000000000000000000000000000000000000000000000FF;\\n\\n error StringTooLong(string str);\\n error InvalidShortString();\\n\\n /**\\n * @dev Encode a string of at most 31 chars into a `ShortString`.\\n *\\n * This will trigger a `StringTooLong` error is the input string is too long.\\n */\\n function toShortString(string memory str) internal pure returns (ShortString) {\\n bytes memory bstr = bytes(str);\\n if (bstr.length > 31) {\\n revert StringTooLong(str);\\n }\\n return ShortString.wrap(bytes32(uint256(bytes32(bstr)) | bstr.length));\\n }\\n\\n /**\\n * @dev Decode a `ShortString` back to a \\\"normal\\\" string.\\n */\\n function toString(ShortString sstr) internal pure returns (string memory) {\\n uint256 len = byteLength(sstr);\\n // using `new string(len)` would work locally but is not memory safe.\\n string memory str = new string(32);\\n assembly (\\\"memory-safe\\\") {\\n mstore(str, len)\\n mstore(add(str, 0x20), sstr)\\n }\\n return str;\\n }\\n\\n /**\\n * @dev Return the length of a `ShortString`.\\n */\\n function byteLength(ShortString sstr) internal pure returns (uint256) {\\n uint256 result = uint256(ShortString.unwrap(sstr)) & 0xFF;\\n if (result > 31) {\\n revert InvalidShortString();\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Encode a string into a `ShortString`, or write it to storage if it is too long.\\n */\\n function toShortStringWithFallback(string memory value, string storage store) internal returns (ShortString) {\\n if (bytes(value).length < 32) {\\n return toShortString(value);\\n } else {\\n StorageSlot.getStringSlot(store).value = value;\\n return ShortString.wrap(FALLBACK_SENTINEL);\\n }\\n }\\n\\n /**\\n * @dev Decode a string that was encoded to `ShortString` or written to storage using {setWithFallback}.\\n */\\n function toStringWithFallback(ShortString value, string storage store) internal pure returns (string memory) {\\n if (ShortString.unwrap(value) != FALLBACK_SENTINEL) {\\n return toString(value);\\n } else {\\n return store;\\n }\\n }\\n\\n /**\\n * @dev Return the length of a string that was encoded to `ShortString` or written to storage using\\n * {setWithFallback}.\\n *\\n * WARNING: This will return the \\\"byte length\\\" of the string. This may not reflect the actual length in terms of\\n * actual characters as the UTF-8 encoding of a single character can span over multiple bytes.\\n */\\n function byteLengthWithFallback(ShortString value, string storage store) internal view returns (uint256) {\\n if (ShortString.unwrap(value) != FALLBACK_SENTINEL) {\\n return byteLength(value);\\n } else {\\n return bytes(store).length;\\n }\\n }\\n}\\n\",\"keccak256\":\"0x7d94fa0af099a2172eb01f9c8a8a443cbe7e0e43654841563e4e09968efdb549\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/StorageSlot.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/StorageSlot.sol)\\n// This file was procedurally generated from scripts/generate/templates/StorageSlot.js.\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Library for reading and writing primitive types to specific storage slots.\\n *\\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\\n * This library helps with reading and writing to such slots without the need for inline assembly.\\n *\\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\\n *\\n * Example usage to set ERC-1967 implementation slot:\\n * ```solidity\\n * contract ERC1967 {\\n * // Define the slot. Alternatively, use the SlotDerivation library to derive the slot.\\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n *\\n * function _getImplementation() internal view returns (address) {\\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n * }\\n *\\n * function _setImplementation(address newImplementation) internal {\\n * require(newImplementation.code.length > 0);\\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n * }\\n * }\\n * ```\\n *\\n * TIP: Consider using this library along with {SlotDerivation}.\\n */\\nlibrary StorageSlot {\\n struct AddressSlot {\\n address value;\\n }\\n\\n struct BooleanSlot {\\n bool value;\\n }\\n\\n struct Bytes32Slot {\\n bytes32 value;\\n }\\n\\n struct Uint256Slot {\\n uint256 value;\\n }\\n\\n struct Int256Slot {\\n int256 value;\\n }\\n\\n struct StringSlot {\\n string value;\\n }\\n\\n struct BytesSlot {\\n bytes value;\\n }\\n\\n /**\\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\\n */\\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\\n assembly (\\\"memory-safe\\\") {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns a `BooleanSlot` with member `value` located at `slot`.\\n */\\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\\n assembly (\\\"memory-safe\\\") {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns a `Bytes32Slot` with member `value` located at `slot`.\\n */\\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\\n assembly (\\\"memory-safe\\\") {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns a `Uint256Slot` with member `value` located at `slot`.\\n */\\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\\n assembly (\\\"memory-safe\\\") {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns a `Int256Slot` with member `value` located at `slot`.\\n */\\n function getInt256Slot(bytes32 slot) internal pure returns (Int256Slot storage r) {\\n assembly (\\\"memory-safe\\\") {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns a `StringSlot` with member `value` located at `slot`.\\n */\\n function getStringSlot(bytes32 slot) internal pure returns (StringSlot storage r) {\\n assembly (\\\"memory-safe\\\") {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `StringSlot` representation of the string storage pointer `store`.\\n */\\n function getStringSlot(string storage store) internal pure returns (StringSlot storage r) {\\n assembly (\\\"memory-safe\\\") {\\n r.slot := store.slot\\n }\\n }\\n\\n /**\\n * @dev Returns a `BytesSlot` with member `value` located at `slot`.\\n */\\n function getBytesSlot(bytes32 slot) internal pure returns (BytesSlot storage r) {\\n assembly (\\\"memory-safe\\\") {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `BytesSlot` representation of the bytes storage pointer `store`.\\n */\\n function getBytesSlot(bytes storage store) internal pure returns (BytesSlot storage r) {\\n assembly (\\\"memory-safe\\\") {\\n r.slot := store.slot\\n }\\n }\\n}\\n\",\"keccak256\":\"0xcf74f855663ce2ae00ed8352666b7935f6cddea2932fdf2c3ecd30a9b1cd0e97\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Strings.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/Strings.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {Math} from \\\"./math/Math.sol\\\";\\nimport {SignedMath} from \\\"./math/SignedMath.sol\\\";\\n\\n/**\\n * @dev String operations.\\n */\\nlibrary Strings {\\n bytes16 private constant HEX_DIGITS = \\\"0123456789abcdef\\\";\\n uint8 private constant ADDRESS_LENGTH = 20;\\n\\n /**\\n * @dev The `value` string doesn't fit in the specified `length`.\\n */\\n error StringsInsufficientHexLength(uint256 value, uint256 length);\\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 assembly (\\\"memory-safe\\\") {\\n ptr := add(buffer, add(32, length))\\n }\\n while (true) {\\n ptr--;\\n assembly (\\\"memory-safe\\\") {\\n mstore8(ptr, byte(mod(value, 10), HEX_DIGITS))\\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 toStringSigned(int256 value) internal pure returns (string memory) {\\n return string.concat(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 uint256 localValue = value;\\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] = HEX_DIGITS[localValue & 0xf];\\n localValue >>= 4;\\n }\\n if (localValue != 0) {\\n revert StringsInsufficientHexLength(value, length);\\n }\\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\\n * 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 Converts an `address` with fixed length of 20 bytes to its checksummed ASCII `string` hexadecimal\\n * representation, according to EIP-55.\\n */\\n function toChecksumHexString(address addr) internal pure returns (string memory) {\\n bytes memory buffer = bytes(toHexString(addr));\\n\\n // hash the hex part of buffer (skip length + 2 bytes, length 40)\\n uint256 hashValue;\\n assembly (\\\"memory-safe\\\") {\\n hashValue := shr(96, keccak256(add(buffer, 0x22), 40))\\n }\\n\\n for (uint256 i = 41; i > 1; --i) {\\n // possible values for buffer[i] are 48 (0) to 57 (9) and 97 (a) to 102 (f)\\n if (hashValue & 0xf > 7 && uint8(buffer[i]) > 96) {\\n // case shift by xoring with 0x20\\n buffer[i] ^= 0x20;\\n }\\n hashValue >>= 4;\\n }\\n return string(buffer);\\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 bytes(a).length == bytes(b).length && keccak256(bytes(a)) == keccak256(bytes(b));\\n }\\n}\\n\",\"keccak256\":\"0x725209b582291bb83058e3078624b53d15a133f7401c30295e7f3704181d2aed\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/cryptography/ECDSA.sol)\\n\\npragma solidity ^0.8.20;\\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 }\\n\\n /**\\n * @dev The signature derives the `address(0)`.\\n */\\n error ECDSAInvalidSignature();\\n\\n /**\\n * @dev The signature has an invalid length.\\n */\\n error ECDSAInvalidSignatureLength(uint256 length);\\n\\n /**\\n * @dev The signature has an S value that is in the upper half order.\\n */\\n error ECDSAInvalidSignatureS(bytes32 s);\\n\\n /**\\n * @dev Returns the address that signed a hashed message (`hash`) with `signature` or an error. This will not\\n * return address(0) without also returning an error description. Errors are documented using an enum (error type)\\n * and a bytes32 providing additional information about the error.\\n *\\n * If no error is returned, then the address can be used for verification purposes.\\n *\\n * The `ecrecover` EVM precompile 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 {MessageHashUtils-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 function tryRecover(\\n bytes32 hash,\\n bytes memory signature\\n ) internal pure returns (address recovered, RecoverError err, bytes32 errArg) {\\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 assembly (\\\"memory-safe\\\") {\\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, bytes32(signature.length));\\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 precompile 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 {MessageHashUtils-toEthSignedMessageHash} on it.\\n */\\n function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {\\n (address recovered, RecoverError error, bytes32 errorArg) = tryRecover(hash, signature);\\n _throwError(error, errorArg);\\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[ERC-2098 short signatures]\\n */\\n function tryRecover(\\n bytes32 hash,\\n bytes32 r,\\n bytes32 vs\\n ) internal pure returns (address recovered, RecoverError err, bytes32 errArg) {\\n unchecked {\\n bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff);\\n // We do not check for an overflow here since the shift operation results in 0 or 1.\\n uint8 v = uint8((uint256(vs) >> 255) + 27);\\n return tryRecover(hash, v, r, s);\\n }\\n }\\n\\n /**\\n * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately.\\n */\\n function recover(bytes32 hash, bytes32 r, bytes32 vs) internal pure returns (address) {\\n (address recovered, RecoverError error, bytes32 errorArg) = tryRecover(hash, r, vs);\\n _throwError(error, errorArg);\\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 function tryRecover(\\n bytes32 hash,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) internal pure returns (address recovered, RecoverError err, bytes32 errArg) {\\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, s);\\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, bytes32(0));\\n }\\n\\n return (signer, RecoverError.NoError, bytes32(0));\\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, bytes32 errorArg) = tryRecover(hash, v, r, s);\\n _throwError(error, errorArg);\\n return recovered;\\n }\\n\\n /**\\n * @dev Optionally reverts with the corresponding custom error according to the `error` argument provided.\\n */\\n function _throwError(RecoverError error, bytes32 errorArg) private pure {\\n if (error == RecoverError.NoError) {\\n return; // no error: do nothing\\n } else if (error == RecoverError.InvalidSignature) {\\n revert ECDSAInvalidSignature();\\n } else if (error == RecoverError.InvalidSignatureLength) {\\n revert ECDSAInvalidSignatureLength(uint256(errorArg));\\n } else if (error == RecoverError.InvalidSignatureS) {\\n revert ECDSAInvalidSignatureS(errorArg);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x69f54c02b7d81d505910ec198c11ed4c6a728418a868b906b4a0cf29946fda84\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/cryptography/EIP712.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/cryptography/EIP712.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {MessageHashUtils} from \\\"./MessageHashUtils.sol\\\";\\nimport {ShortStrings, ShortString} from \\\"../ShortStrings.sol\\\";\\nimport {IERC5267} from \\\"../../interfaces/IERC5267.sol\\\";\\n\\n/**\\n * @dev https://eips.ethereum.org/EIPS/eip-712[EIP-712] is a standard for hashing and signing of typed structured data.\\n *\\n * The encoding scheme specified in the EIP requires a domain separator and a hash of the typed structured data, whose\\n * encoding is very generic and therefore its implementation in Solidity is not feasible, thus this contract\\n * does not implement the encoding itself. Protocols need to implement the type-specific encoding they need in order to\\n * produce the hash of their typed data using a combination of `abi.encode` and `keccak256`.\\n *\\n * This contract implements the EIP-712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding\\n * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA\\n * ({_hashTypedDataV4}).\\n *\\n * The implementation of the domain separator was designed to be as efficient as possible while still properly updating\\n * the chain id to protect against replay attacks on an eventual fork of the chain.\\n *\\n * NOTE: This contract implements the version of the encoding known as \\\"v4\\\", as implemented by the JSON RPC method\\n * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask].\\n *\\n * NOTE: In the upgradeable version of this contract, the cached values will correspond to the address, and the domain\\n * separator of the implementation contract. This will cause the {_domainSeparatorV4} function to always rebuild the\\n * separator from the immutable values, which is cheaper than accessing a cached version in cold storage.\\n *\\n * @custom:oz-upgrades-unsafe-allow state-variable-immutable\\n */\\nabstract contract EIP712 is IERC5267 {\\n using ShortStrings for *;\\n\\n bytes32 private constant TYPE_HASH =\\n keccak256(\\\"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)\\\");\\n\\n // Cache the domain separator as an immutable value, but also store the chain id that it corresponds to, in order to\\n // invalidate the cached domain separator if the chain id changes.\\n bytes32 private immutable _cachedDomainSeparator;\\n uint256 private immutable _cachedChainId;\\n address private immutable _cachedThis;\\n\\n bytes32 private immutable _hashedName;\\n bytes32 private immutable _hashedVersion;\\n\\n ShortString private immutable _name;\\n ShortString private immutable _version;\\n string private _nameFallback;\\n string private _versionFallback;\\n\\n /**\\n * @dev Initializes the domain separator and parameter caches.\\n *\\n * The meaning of `name` and `version` is specified in\\n * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP-712]:\\n *\\n * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol.\\n * - `version`: the current major version of the signing domain.\\n *\\n * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart\\n * contract upgrade].\\n */\\n constructor(string memory name, string memory version) {\\n _name = name.toShortStringWithFallback(_nameFallback);\\n _version = version.toShortStringWithFallback(_versionFallback);\\n _hashedName = keccak256(bytes(name));\\n _hashedVersion = keccak256(bytes(version));\\n\\n _cachedChainId = block.chainid;\\n _cachedDomainSeparator = _buildDomainSeparator();\\n _cachedThis = address(this);\\n }\\n\\n /**\\n * @dev Returns the domain separator for the current chain.\\n */\\n function _domainSeparatorV4() internal view returns (bytes32) {\\n if (address(this) == _cachedThis && block.chainid == _cachedChainId) {\\n return _cachedDomainSeparator;\\n } else {\\n return _buildDomainSeparator();\\n }\\n }\\n\\n function _buildDomainSeparator() private view returns (bytes32) {\\n return keccak256(abi.encode(TYPE_HASH, _hashedName, _hashedVersion, block.chainid, address(this)));\\n }\\n\\n /**\\n * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this\\n * function returns the hash of the fully encoded EIP712 message for this domain.\\n *\\n * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example:\\n *\\n * ```solidity\\n * bytes32 digest = _hashTypedDataV4(keccak256(abi.encode(\\n * keccak256(\\\"Mail(address to,string contents)\\\"),\\n * mailTo,\\n * keccak256(bytes(mailContents))\\n * )));\\n * address signer = ECDSA.recover(digest, signature);\\n * ```\\n */\\n function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) {\\n return MessageHashUtils.toTypedDataHash(_domainSeparatorV4(), structHash);\\n }\\n\\n /**\\n * @dev See {IERC-5267}.\\n */\\n function eip712Domain()\\n public\\n view\\n virtual\\n returns (\\n bytes1 fields,\\n string memory name,\\n string memory version,\\n uint256 chainId,\\n address verifyingContract,\\n bytes32 salt,\\n uint256[] memory extensions\\n )\\n {\\n return (\\n hex\\\"0f\\\", // 01111\\n _EIP712Name(),\\n _EIP712Version(),\\n block.chainid,\\n address(this),\\n bytes32(0),\\n new uint256[](0)\\n );\\n }\\n\\n /**\\n * @dev The name parameter for the EIP712 domain.\\n *\\n * NOTE: By default this function reads _name which is an immutable value.\\n * It only reads from storage if necessary (in case the value is too large to fit in a ShortString).\\n */\\n // solhint-disable-next-line func-name-mixedcase\\n function _EIP712Name() internal view returns (string memory) {\\n return _name.toStringWithFallback(_nameFallback);\\n }\\n\\n /**\\n * @dev The version parameter for the EIP712 domain.\\n *\\n * NOTE: By default this function reads _version which is an immutable value.\\n * It only reads from storage if necessary (in case the value is too large to fit in a ShortString).\\n */\\n // solhint-disable-next-line func-name-mixedcase\\n function _EIP712Version() internal view returns (string memory) {\\n return _version.toStringWithFallback(_versionFallback);\\n }\\n}\\n\",\"keccak256\":\"0x10eb97d047f8d84fe263a02bb4a656ac6674f6679d74532cc37546289e073a9d\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/cryptography/MessageHashUtils.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/cryptography/MessageHashUtils.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {Strings} from \\\"../Strings.sol\\\";\\n\\n/**\\n * @dev Signature message hash utilities for producing digests to be consumed by {ECDSA} recovery or signing.\\n *\\n * The library provides methods for generating a hash of a message that conforms to the\\n * https://eips.ethereum.org/EIPS/eip-191[ERC-191] and https://eips.ethereum.org/EIPS/eip-712[EIP 712]\\n * specifications.\\n */\\nlibrary MessageHashUtils {\\n /**\\n * @dev Returns the keccak256 digest of an ERC-191 signed data with version\\n * `0x45` (`personal_sign` messages).\\n *\\n * The digest is calculated by prefixing a bytes32 `messageHash` with\\n * `\\\"\\\\x19Ethereum Signed Message:\\\\n32\\\"` and hashing the result. It corresponds with the\\n * hash signed when using the https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] JSON-RPC method.\\n *\\n * NOTE: The `messageHash` parameter is intended to be the result of hashing a raw message with\\n * keccak256, although any bytes32 value can be safely used because the final digest will\\n * be re-hashed.\\n *\\n * See {ECDSA-recover}.\\n */\\n function toEthSignedMessageHash(bytes32 messageHash) internal pure returns (bytes32 digest) {\\n assembly (\\\"memory-safe\\\") {\\n mstore(0x00, \\\"\\\\x19Ethereum Signed Message:\\\\n32\\\") // 32 is the bytes-length of messageHash\\n mstore(0x1c, messageHash) // 0x1c (28) is the length of the prefix\\n digest := keccak256(0x00, 0x3c) // 0x3c is the length of the prefix (0x1c) + messageHash (0x20)\\n }\\n }\\n\\n /**\\n * @dev Returns the keccak256 digest of an ERC-191 signed data with version\\n * `0x45` (`personal_sign` messages).\\n *\\n * The digest is calculated by prefixing an arbitrary `message` with\\n * `\\\"\\\\x19Ethereum Signed Message:\\\\n\\\" + len(message)` and hashing the result. It corresponds with the\\n * hash signed when using the https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] JSON-RPC method.\\n *\\n * See {ECDSA-recover}.\\n */\\n function toEthSignedMessageHash(bytes memory message) internal pure returns (bytes32) {\\n return\\n keccak256(bytes.concat(\\\"\\\\x19Ethereum Signed Message:\\\\n\\\", bytes(Strings.toString(message.length)), message));\\n }\\n\\n /**\\n * @dev Returns the keccak256 digest of an ERC-191 signed data with version\\n * `0x00` (data with intended validator).\\n *\\n * The digest is calculated by prefixing an arbitrary `data` with `\\\"\\\\x19\\\\x00\\\"` and the intended\\n * `validator` address. Then hashing the result.\\n *\\n * See {ECDSA-recover}.\\n */\\n function toDataWithIntendedValidatorHash(address validator, bytes memory data) internal pure returns (bytes32) {\\n return keccak256(abi.encodePacked(hex\\\"19_00\\\", validator, data));\\n }\\n\\n /**\\n * @dev Returns the keccak256 digest of an EIP-712 typed data (ERC-191 version `0x01`).\\n *\\n * The digest is calculated from a `domainSeparator` and a `structHash`, by prefixing them with\\n * `\\\\x19\\\\x01` and hashing the result. It corresponds to the hash signed by the\\n * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`] JSON-RPC method as part of EIP-712.\\n *\\n * See {ECDSA-recover}.\\n */\\n function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32 digest) {\\n assembly (\\\"memory-safe\\\") {\\n let ptr := mload(0x40)\\n mstore(ptr, hex\\\"19_01\\\")\\n mstore(add(ptr, 0x02), domainSeparator)\\n mstore(add(ptr, 0x22), structHash)\\n digest := keccak256(ptr, 0x42)\\n }\\n }\\n}\\n\",\"keccak256\":\"0x4515543bc4c78561f6bea83ecfdfc3dead55bd59858287d682045b11de1ae575\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/cryptography/SignatureChecker.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/cryptography/SignatureChecker.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {ECDSA} from \\\"./ECDSA.sol\\\";\\nimport {IERC1271} from \\\"../../interfaces/IERC1271.sol\\\";\\n\\n/**\\n * @dev Signature verification helper that can be used instead of `ECDSA.recover` to seamlessly support both ECDSA\\n * signatures from externally owned accounts (EOAs) as well as ERC-1271 signatures from smart contract wallets like\\n * Argent and Safe Wallet (previously Gnosis Safe).\\n */\\nlibrary SignatureChecker {\\n /**\\n * @dev Checks if a signature is valid for a given signer and data hash. If the signer is a smart contract, the\\n * signature is validated against that smart contract using ERC-1271, otherwise it's validated using `ECDSA.recover`.\\n *\\n * NOTE: Unlike ECDSA signatures, contract signatures are revocable, and the outcome of this function can thus\\n * change through time. It could return true at block N and false at block N+1 (or the opposite).\\n */\\n function isValidSignatureNow(address signer, bytes32 hash, bytes memory signature) internal view returns (bool) {\\n if (signer.code.length == 0) {\\n (address recovered, ECDSA.RecoverError err, ) = ECDSA.tryRecover(hash, signature);\\n return err == ECDSA.RecoverError.NoError && recovered == signer;\\n } else {\\n return isValidERC1271SignatureNow(signer, hash, signature);\\n }\\n }\\n\\n /**\\n * @dev Checks if a signature is valid for a given signer and data hash. The signature is validated\\n * against the signer smart contract using ERC-1271.\\n *\\n * NOTE: Unlike ECDSA signatures, contract signatures are revocable, and the outcome of this function can thus\\n * change through time. It could return true at block N and false at block N+1 (or the opposite).\\n */\\n function isValidERC1271SignatureNow(\\n address signer,\\n bytes32 hash,\\n bytes memory signature\\n ) internal view returns (bool) {\\n (bool success, bytes memory result) = signer.staticcall(\\n abi.encodeCall(IERC1271.isValidSignature, (hash, signature))\\n );\\n return (success &&\\n result.length >= 32 &&\\n abi.decode(result, (bytes32)) == bytes32(IERC1271.isValidSignature.selector));\\n }\\n}\\n\",\"keccak256\":\"0xbdc3bb48ccedb818cd75a6d74a16df55a822e9f6d3cc54c59f576f10aab67b5f\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/introspection/ERC165.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/introspection/ERC165.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {IERC165} from \\\"./IERC165.sol\\\";\\n\\n/**\\n * @dev Implementation of the {IERC165} interface.\\n *\\n * Contracts that want to implement ERC-165 should inherit from this contract and override {supportsInterface} to check\\n * for the additional interface id that will be supported. For example:\\n *\\n * ```solidity\\n * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\\n * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);\\n * }\\n * ```\\n */\\nabstract contract ERC165 is IERC165 {\\n /**\\n * @dev See {IERC165-supportsInterface}.\\n */\\n function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) {\\n return interfaceId == type(IERC165).interfaceId;\\n }\\n}\\n\",\"keccak256\":\"0xddce8e17e3d3f9ed818b4f4c4478a8262aab8b11ed322f1bf5ed705bb4bd97fa\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/introspection/IERC165.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/introspection/IERC165.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Interface of the ERC-165 standard, as defined in the\\n * https://eips.ethereum.org/EIPS/eip-165[ERC].\\n *\\n * Implementers can declare support of contract interfaces, which can then be\\n * queried by others ({ERC165Checker}).\\n *\\n * For an implementation, see {ERC165}.\\n */\\ninterface IERC165 {\\n /**\\n * @dev Returns true if this contract implements the interface defined by\\n * `interfaceId`. See the corresponding\\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[ERC section]\\n * to learn more about how these ids are created.\\n *\\n * This function call must use less than 30 000 gas.\\n */\\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x79796192ec90263f21b464d5bc90b777a525971d3de8232be80d9c4f9fb353b8\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/math/Math.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/math/Math.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {Panic} from \\\"../Panic.sol\\\";\\nimport {SafeCast} from \\\"./SafeCast.sol\\\";\\n\\n/**\\n * @dev Standard math utilities missing in the Solidity language.\\n */\\nlibrary Math {\\n enum Rounding {\\n Floor, // Toward negative infinity\\n Ceil, // Toward positive infinity\\n Trunc, // Toward zero\\n Expand // Away from zero\\n }\\n\\n /**\\n * @dev Returns the addition of two unsigned integers, with an success flag (no overflow).\\n */\\n function tryAdd(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\\n unchecked {\\n uint256 c = a + b;\\n if (c < a) return (false, 0);\\n return (true, c);\\n }\\n }\\n\\n /**\\n * @dev Returns the subtraction of two unsigned integers, with an success flag (no overflow).\\n */\\n function trySub(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\\n unchecked {\\n if (b > a) return (false, 0);\\n return (true, a - b);\\n }\\n }\\n\\n /**\\n * @dev Returns the multiplication of two unsigned integers, with an success flag (no overflow).\\n */\\n function tryMul(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\\n unchecked {\\n // Gas optimization: this is cheaper than requiring 'a' not being zero, but the\\n // benefit is lost if 'b' is also tested.\\n // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522\\n if (a == 0) return (true, 0);\\n uint256 c = a * b;\\n if (c / a != b) return (false, 0);\\n return (true, c);\\n }\\n }\\n\\n /**\\n * @dev Returns the division of two unsigned integers, with a success flag (no division by zero).\\n */\\n function tryDiv(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\\n unchecked {\\n if (b == 0) return (false, 0);\\n return (true, a / b);\\n }\\n }\\n\\n /**\\n * @dev Returns the remainder of dividing two unsigned integers, with a success flag (no division by zero).\\n */\\n function tryMod(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\\n unchecked {\\n if (b == 0) return (false, 0);\\n return (true, a % b);\\n }\\n }\\n\\n /**\\n * @dev Branchless ternary evaluation for `a ? b : c`. Gas costs are constant.\\n *\\n * IMPORTANT: This function may reduce bytecode size and consume less gas when used standalone.\\n * However, the compiler may optimize Solidity ternary operations (i.e. `a ? b : c`) to only compute\\n * one branch when needed, making this function more expensive.\\n */\\n function ternary(bool condition, uint256 a, uint256 b) internal pure returns (uint256) {\\n unchecked {\\n // branchless ternary works because:\\n // b ^ (a ^ b) == a\\n // b ^ 0 == b\\n return b ^ ((a ^ b) * SafeCast.toUint(condition));\\n }\\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 ternary(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 ternary(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 towards infinity instead\\n * of rounding towards zero.\\n */\\n function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {\\n if (b == 0) {\\n // Guarantee the same behavior as in a regular Solidity division.\\n Panic.panic(Panic.DIVISION_BY_ZERO);\\n }\\n\\n // The following calculation ensures accurate ceiling division without overflow.\\n // Since a is non-zero, (a - 1) / b will not overflow.\\n // The largest possible result occurs when (a - 1) / b is type(uint256).max,\\n // but the largest value we can obtain is type(uint256).max - 1, which happens\\n // when a = type(uint256).max and b = 1.\\n unchecked {\\n return SafeCast.toUint(a > 0) * ((a - 1) / b + 1);\\n }\\n }\\n\\n /**\\n * @dev Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or\\n * denominator == 0.\\n *\\n * Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv) with further edits by\\n * 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\\u00b2\\u2075\\u2076 and mod 2\\u00b2\\u2075\\u2076 - 1, then use\\n // the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256\\n // variables such that product = prod1 * 2\\u00b2\\u2075\\u2076 + prod0.\\n uint256 prod0 = x * y; // 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 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\\u00b2\\u2075\\u2076. Also prevents denominator == 0.\\n if (denominator <= prod1) {\\n Panic.panic(ternary(denominator == 0, Panic.DIVISION_BY_ZERO, Panic.UNDER_OVERFLOW));\\n }\\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.\\n // Always >= 1. See https://cs.stackexchange.com/q/138556/92363.\\n\\n uint256 twos = denominator & (0 - denominator);\\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\\u00b2\\u2075\\u2076 / 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\\u00b2\\u2075\\u2076. Now that denominator is an odd number, it has an inverse modulo 2\\u00b2\\u2075\\u2076 such\\n // that denominator * inv \\u2261 1 mod 2\\u00b2\\u2075\\u2076. Compute the inverse by starting with a seed that is correct for\\n // four bits. That is, denominator * inv \\u2261 1 mod 2\\u2074.\\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\\n // works in modular arithmetic, doubling the correct bits in each step.\\n inverse *= 2 - denominator * inverse; // inverse mod 2\\u2078\\n inverse *= 2 - denominator * inverse; // inverse mod 2\\u00b9\\u2076\\n inverse *= 2 - denominator * inverse; // inverse mod 2\\u00b3\\u00b2\\n inverse *= 2 - denominator * inverse; // inverse mod 2\\u2076\\u2074\\n inverse *= 2 - denominator * inverse; // inverse mod 2\\u00b9\\u00b2\\u2078\\n inverse *= 2 - denominator * inverse; // inverse mod 2\\u00b2\\u2075\\u2076\\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\\u00b2\\u2075\\u2076. Since the preconditions guarantee that the outcome is\\n // less than 2\\u00b2\\u2075\\u2076, 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 * @dev 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 return mulDiv(x, y, denominator) + SafeCast.toUint(unsignedRoundsUp(rounding) && mulmod(x, y, denominator) > 0);\\n }\\n\\n /**\\n * @dev Calculate the modular multiplicative inverse of a number in Z/nZ.\\n *\\n * If n is a prime, then Z/nZ is a field. In that case all elements are inversible, except 0.\\n * If n is not a prime, then Z/nZ is not a field, and some elements might not be inversible.\\n *\\n * If the input value is not inversible, 0 is returned.\\n *\\n * NOTE: If you know for sure that n is (big) a prime, it may be cheaper to use Fermat's little theorem and get the\\n * inverse using `Math.modExp(a, n - 2, n)`. See {invModPrime}.\\n */\\n function invMod(uint256 a, uint256 n) internal pure returns (uint256) {\\n unchecked {\\n if (n == 0) return 0;\\n\\n // The inverse modulo is calculated using the Extended Euclidean Algorithm (iterative version)\\n // Used to compute integers x and y such that: ax + ny = gcd(a, n).\\n // When the gcd is 1, then the inverse of a modulo n exists and it's x.\\n // ax + ny = 1\\n // ax = 1 + (-y)n\\n // ax \\u2261 1 (mod n) # x is the inverse of a modulo n\\n\\n // If the remainder is 0 the gcd is n right away.\\n uint256 remainder = a % n;\\n uint256 gcd = n;\\n\\n // Therefore the initial coefficients are:\\n // ax + ny = gcd(a, n) = n\\n // 0a + 1n = n\\n int256 x = 0;\\n int256 y = 1;\\n\\n while (remainder != 0) {\\n uint256 quotient = gcd / remainder;\\n\\n (gcd, remainder) = (\\n // The old remainder is the next gcd to try.\\n remainder,\\n // Compute the next remainder.\\n // Can't overflow given that (a % gcd) * (gcd // (a % gcd)) <= gcd\\n // where gcd is at most n (capped to type(uint256).max)\\n gcd - remainder * quotient\\n );\\n\\n (x, y) = (\\n // Increment the coefficient of a.\\n y,\\n // Decrement the coefficient of n.\\n // Can overflow, but the result is casted to uint256 so that the\\n // next value of y is \\\"wrapped around\\\" to a value between 0 and n - 1.\\n x - y * int256(quotient)\\n );\\n }\\n\\n if (gcd != 1) return 0; // No inverse exists.\\n return ternary(x < 0, n - uint256(-x), uint256(x)); // Wrap the result if it's negative.\\n }\\n }\\n\\n /**\\n * @dev Variant of {invMod}. More efficient, but only works if `p` is known to be a prime greater than `2`.\\n *\\n * From https://en.wikipedia.org/wiki/Fermat%27s_little_theorem[Fermat's little theorem], we know that if p is\\n * prime, then `a**(p-1) \\u2261 1 mod p`. As a consequence, we have `a * a**(p-2) \\u2261 1 mod p`, which means that\\n * `a**(p-2)` is the modular multiplicative inverse of a in Fp.\\n *\\n * NOTE: this function does NOT check that `p` is a prime greater than `2`.\\n */\\n function invModPrime(uint256 a, uint256 p) internal view returns (uint256) {\\n unchecked {\\n return Math.modExp(a, p - 2, p);\\n }\\n }\\n\\n /**\\n * @dev Returns the modular exponentiation of the specified base, exponent and modulus (b ** e % m)\\n *\\n * Requirements:\\n * - modulus can't be zero\\n * - underlying staticcall to precompile must succeed\\n *\\n * IMPORTANT: The result is only valid if the underlying call succeeds. When using this function, make\\n * sure the chain you're using it on supports the precompiled contract for modular exponentiation\\n * at address 0x05 as specified in https://eips.ethereum.org/EIPS/eip-198[EIP-198]. Otherwise,\\n * the underlying function will succeed given the lack of a revert, but the result may be incorrectly\\n * interpreted as 0.\\n */\\n function modExp(uint256 b, uint256 e, uint256 m) internal view returns (uint256) {\\n (bool success, uint256 result) = tryModExp(b, e, m);\\n if (!success) {\\n Panic.panic(Panic.DIVISION_BY_ZERO);\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Returns the modular exponentiation of the specified base, exponent and modulus (b ** e % m).\\n * It includes a success flag indicating if the operation succeeded. Operation will be marked as failed if trying\\n * to operate modulo 0 or if the underlying precompile reverted.\\n *\\n * IMPORTANT: The result is only valid if the success flag is true. When using this function, make sure the chain\\n * you're using it on supports the precompiled contract for modular exponentiation at address 0x05 as specified in\\n * https://eips.ethereum.org/EIPS/eip-198[EIP-198]. Otherwise, the underlying function will succeed given the lack\\n * of a revert, but the result may be incorrectly interpreted as 0.\\n */\\n function tryModExp(uint256 b, uint256 e, uint256 m) internal view returns (bool success, uint256 result) {\\n if (m == 0) return (false, 0);\\n assembly (\\\"memory-safe\\\") {\\n let ptr := mload(0x40)\\n // | Offset | Content | Content (Hex) |\\n // |-----------|------------|--------------------------------------------------------------------|\\n // | 0x00:0x1f | size of b | 0x0000000000000000000000000000000000000000000000000000000000000020 |\\n // | 0x20:0x3f | size of e | 0x0000000000000000000000000000000000000000000000000000000000000020 |\\n // | 0x40:0x5f | size of m | 0x0000000000000000000000000000000000000000000000000000000000000020 |\\n // | 0x60:0x7f | value of b | 0x<.............................................................b> |\\n // | 0x80:0x9f | value of e | 0x<.............................................................e> |\\n // | 0xa0:0xbf | value of m | 0x<.............................................................m> |\\n mstore(ptr, 0x20)\\n mstore(add(ptr, 0x20), 0x20)\\n mstore(add(ptr, 0x40), 0x20)\\n mstore(add(ptr, 0x60), b)\\n mstore(add(ptr, 0x80), e)\\n mstore(add(ptr, 0xa0), m)\\n\\n // Given the result < m, it's guaranteed to fit in 32 bytes,\\n // so we can use the memory scratch space located at offset 0.\\n success := staticcall(gas(), 0x05, ptr, 0xc0, 0x00, 0x20)\\n result := mload(0x00)\\n }\\n }\\n\\n /**\\n * @dev Variant of {modExp} that supports inputs of arbitrary length.\\n */\\n function modExp(bytes memory b, bytes memory e, bytes memory m) internal view returns (bytes memory) {\\n (bool success, bytes memory result) = tryModExp(b, e, m);\\n if (!success) {\\n Panic.panic(Panic.DIVISION_BY_ZERO);\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Variant of {tryModExp} that supports inputs of arbitrary length.\\n */\\n function tryModExp(\\n bytes memory b,\\n bytes memory e,\\n bytes memory m\\n ) internal view returns (bool success, bytes memory result) {\\n if (_zeroBytes(m)) return (false, new bytes(0));\\n\\n uint256 mLen = m.length;\\n\\n // Encode call args in result and move the free memory pointer\\n result = abi.encodePacked(b.length, e.length, mLen, b, e, m);\\n\\n assembly (\\\"memory-safe\\\") {\\n let dataPtr := add(result, 0x20)\\n // Write result on top of args to avoid allocating extra memory.\\n success := staticcall(gas(), 0x05, dataPtr, mload(result), dataPtr, mLen)\\n // Overwrite the length.\\n // result.length > returndatasize() is guaranteed because returndatasize() == m.length\\n mstore(result, mLen)\\n // Set the memory pointer after the returned data.\\n mstore(0x40, add(dataPtr, mLen))\\n }\\n }\\n\\n /**\\n * @dev Returns whether the provided byte array is zero.\\n */\\n function _zeroBytes(bytes memory byteArray) private pure returns (bool) {\\n for (uint256 i = 0; i < byteArray.length; ++i) {\\n if (byteArray[i] != 0) {\\n return false;\\n }\\n }\\n return true;\\n }\\n\\n /**\\n * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded\\n * towards zero.\\n *\\n * This method is based on Newton's method for computing square roots; the algorithm is restricted to only\\n * using integer operations.\\n */\\n function sqrt(uint256 a) internal pure returns (uint256) {\\n unchecked {\\n // Take care of easy edge cases when a == 0 or a == 1\\n if (a <= 1) {\\n return a;\\n }\\n\\n // In this function, we use Newton's method to get a root of `f(x) := x\\u00b2 - a`. It involves building a\\n // sequence x_n that converges toward sqrt(a). For each iteration x_n, we also define the error between\\n // the current value as `\\u03b5_n = | x_n - sqrt(a) |`.\\n //\\n // For our first estimation, we consider `e` the smallest power of 2 which is bigger than the square root\\n // of the target. (i.e. `2**(e-1) \\u2264 sqrt(a) < 2**e`). We know that `e \\u2264 128` because `(2\\u00b9\\u00b2\\u2078)\\u00b2 = 2\\u00b2\\u2075\\u2076` is\\n // bigger than any uint256.\\n //\\n // By noticing that\\n // `2**(e-1) \\u2264 sqrt(a) < 2**e \\u2192 (2**(e-1))\\u00b2 \\u2264 a < (2**e)\\u00b2 \\u2192 2**(2*e-2) \\u2264 a < 2**(2*e)`\\n // we can deduce that `e - 1` is `log2(a) / 2`. We can thus compute `x_n = 2**(e-1)` using a method similar\\n // to the msb function.\\n uint256 aa = a;\\n uint256 xn = 1;\\n\\n if (aa >= (1 << 128)) {\\n aa >>= 128;\\n xn <<= 64;\\n }\\n if (aa >= (1 << 64)) {\\n aa >>= 64;\\n xn <<= 32;\\n }\\n if (aa >= (1 << 32)) {\\n aa >>= 32;\\n xn <<= 16;\\n }\\n if (aa >= (1 << 16)) {\\n aa >>= 16;\\n xn <<= 8;\\n }\\n if (aa >= (1 << 8)) {\\n aa >>= 8;\\n xn <<= 4;\\n }\\n if (aa >= (1 << 4)) {\\n aa >>= 4;\\n xn <<= 2;\\n }\\n if (aa >= (1 << 2)) {\\n xn <<= 1;\\n }\\n\\n // We now have x_n such that `x_n = 2**(e-1) \\u2264 sqrt(a) < 2**e = 2 * x_n`. This implies \\u03b5_n \\u2264 2**(e-1).\\n //\\n // We can refine our estimation by noticing that the middle of that interval minimizes the error.\\n // If we move x_n to equal 2**(e-1) + 2**(e-2), then we reduce the error to \\u03b5_n \\u2264 2**(e-2).\\n // This is going to be our x_0 (and \\u03b5_0)\\n xn = (3 * xn) >> 1; // \\u03b5_0 := | x_0 - sqrt(a) | \\u2264 2**(e-2)\\n\\n // From here, Newton's method give us:\\n // x_{n+1} = (x_n + a / x_n) / 2\\n //\\n // One should note that:\\n // x_{n+1}\\u00b2 - a = ((x_n + a / x_n) / 2)\\u00b2 - a\\n // = ((x_n\\u00b2 + a) / (2 * x_n))\\u00b2 - a\\n // = (x_n\\u2074 + 2 * a * x_n\\u00b2 + a\\u00b2) / (4 * x_n\\u00b2) - a\\n // = (x_n\\u2074 + 2 * a * x_n\\u00b2 + a\\u00b2 - 4 * a * x_n\\u00b2) / (4 * x_n\\u00b2)\\n // = (x_n\\u2074 - 2 * a * x_n\\u00b2 + a\\u00b2) / (4 * x_n\\u00b2)\\n // = (x_n\\u00b2 - a)\\u00b2 / (2 * x_n)\\u00b2\\n // = ((x_n\\u00b2 - a) / (2 * x_n))\\u00b2\\n // \\u2265 0\\n // Which proves that for all n \\u2265 1, sqrt(a) \\u2264 x_n\\n //\\n // This gives us the proof of quadratic convergence of the sequence:\\n // \\u03b5_{n+1} = | x_{n+1} - sqrt(a) |\\n // = | (x_n + a / x_n) / 2 - sqrt(a) |\\n // = | (x_n\\u00b2 + a - 2*x_n*sqrt(a)) / (2 * x_n) |\\n // = | (x_n - sqrt(a))\\u00b2 / (2 * x_n) |\\n // = | \\u03b5_n\\u00b2 / (2 * x_n) |\\n // = \\u03b5_n\\u00b2 / | (2 * x_n) |\\n //\\n // For the first iteration, we have a special case where x_0 is known:\\n // \\u03b5_1 = \\u03b5_0\\u00b2 / | (2 * x_0) |\\n // \\u2264 (2**(e-2))\\u00b2 / (2 * (2**(e-1) + 2**(e-2)))\\n // \\u2264 2**(2*e-4) / (3 * 2**(e-1))\\n // \\u2264 2**(e-3) / 3\\n // \\u2264 2**(e-3-log2(3))\\n // \\u2264 2**(e-4.5)\\n //\\n // For the following iterations, we use the fact that, 2**(e-1) \\u2264 sqrt(a) \\u2264 x_n:\\n // \\u03b5_{n+1} = \\u03b5_n\\u00b2 / | (2 * x_n) |\\n // \\u2264 (2**(e-k))\\u00b2 / (2 * 2**(e-1))\\n // \\u2264 2**(2*e-2*k) / 2**e\\n // \\u2264 2**(e-2*k)\\n xn = (xn + a / xn) >> 1; // \\u03b5_1 := | x_1 - sqrt(a) | \\u2264 2**(e-4.5) -- special case, see above\\n xn = (xn + a / xn) >> 1; // \\u03b5_2 := | x_2 - sqrt(a) | \\u2264 2**(e-9) -- general case with k = 4.5\\n xn = (xn + a / xn) >> 1; // \\u03b5_3 := | x_3 - sqrt(a) | \\u2264 2**(e-18) -- general case with k = 9\\n xn = (xn + a / xn) >> 1; // \\u03b5_4 := | x_4 - sqrt(a) | \\u2264 2**(e-36) -- general case with k = 18\\n xn = (xn + a / xn) >> 1; // \\u03b5_5 := | x_5 - sqrt(a) | \\u2264 2**(e-72) -- general case with k = 36\\n xn = (xn + a / xn) >> 1; // \\u03b5_6 := | x_6 - sqrt(a) | \\u2264 2**(e-144) -- general case with k = 72\\n\\n // Because e \\u2264 128 (as discussed during the first estimation phase), we know have reached a precision\\n // \\u03b5_6 \\u2264 2**(e-144) < 1. Given we're operating on integers, then we can ensure that xn is now either\\n // sqrt(a) or sqrt(a) + 1.\\n return xn - SafeCast.toUint(xn > a / xn);\\n }\\n }\\n\\n /**\\n * @dev 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 + SafeCast.toUint(unsignedRoundsUp(rounding) && result * result < a);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 2 of a positive value rounded towards zero.\\n * Returns 0 if given 0.\\n */\\n function log2(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n uint256 exp;\\n unchecked {\\n exp = 128 * SafeCast.toUint(value > (1 << 128) - 1);\\n value >>= exp;\\n result += exp;\\n\\n exp = 64 * SafeCast.toUint(value > (1 << 64) - 1);\\n value >>= exp;\\n result += exp;\\n\\n exp = 32 * SafeCast.toUint(value > (1 << 32) - 1);\\n value >>= exp;\\n result += exp;\\n\\n exp = 16 * SafeCast.toUint(value > (1 << 16) - 1);\\n value >>= exp;\\n result += exp;\\n\\n exp = 8 * SafeCast.toUint(value > (1 << 8) - 1);\\n value >>= exp;\\n result += exp;\\n\\n exp = 4 * SafeCast.toUint(value > (1 << 4) - 1);\\n value >>= exp;\\n result += exp;\\n\\n exp = 2 * SafeCast.toUint(value > (1 << 2) - 1);\\n value >>= exp;\\n result += exp;\\n\\n result += SafeCast.toUint(value > 1);\\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 + SafeCast.toUint(unsignedRoundsUp(rounding) && 1 << result < value);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 10 of a positive value rounded towards zero.\\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 + SafeCast.toUint(unsignedRoundsUp(rounding) && 10 ** result < value);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 256 of a positive value rounded towards zero.\\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 uint256 isGt;\\n unchecked {\\n isGt = SafeCast.toUint(value > (1 << 128) - 1);\\n value >>= isGt * 128;\\n result += isGt * 16;\\n\\n isGt = SafeCast.toUint(value > (1 << 64) - 1);\\n value >>= isGt * 64;\\n result += isGt * 8;\\n\\n isGt = SafeCast.toUint(value > (1 << 32) - 1);\\n value >>= isGt * 32;\\n result += isGt * 4;\\n\\n isGt = SafeCast.toUint(value > (1 << 16) - 1);\\n value >>= isGt * 16;\\n result += isGt * 2;\\n\\n result += SafeCast.toUint(value > (1 << 8) - 1);\\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 + SafeCast.toUint(unsignedRoundsUp(rounding) && 1 << (result << 3) < value);\\n }\\n }\\n\\n /**\\n * @dev Returns whether a provided rounding mode is considered rounding up for unsigned integers.\\n */\\n function unsignedRoundsUp(Rounding rounding) internal pure returns (bool) {\\n return uint8(rounding) % 2 == 1;\\n }\\n}\\n\",\"keccak256\":\"0xa00be322d7db5786750ce0ac7e2f5b633ac30a5ed5fa1ced1e74acfc19acecea\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/math/SafeCast.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/math/SafeCast.sol)\\n// This file was procedurally generated from scripts/generate/templates/SafeCast.js.\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Wrappers over Solidity's uintXX/intXX/bool casting operators with added overflow\\n * checks.\\n *\\n * Downcasting from uint256/int256 in Solidity does not revert on overflow. This can\\n * easily result in undesired exploitation or bugs, since developers usually\\n * assume that overflows raise errors. `SafeCast` restores this intuition by\\n * reverting the transaction when such an operation overflows.\\n *\\n * Using this library instead of the unchecked operations eliminates an entire\\n * class of bugs, so it's recommended to use it always.\\n */\\nlibrary SafeCast {\\n /**\\n * @dev Value doesn't fit in an uint of `bits` size.\\n */\\n error SafeCastOverflowedUintDowncast(uint8 bits, uint256 value);\\n\\n /**\\n * @dev An int value doesn't fit in an uint of `bits` size.\\n */\\n error SafeCastOverflowedIntToUint(int256 value);\\n\\n /**\\n * @dev Value doesn't fit in an int of `bits` size.\\n */\\n error SafeCastOverflowedIntDowncast(uint8 bits, int256 value);\\n\\n /**\\n * @dev An uint value doesn't fit in an int of `bits` size.\\n */\\n error SafeCastOverflowedUintToInt(uint256 value);\\n\\n /**\\n * @dev Returns the downcasted uint248 from uint256, reverting on\\n * overflow (when the input is greater than largest uint248).\\n *\\n * Counterpart to Solidity's `uint248` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 248 bits\\n */\\n function toUint248(uint256 value) internal pure returns (uint248) {\\n if (value > type(uint248).max) {\\n revert SafeCastOverflowedUintDowncast(248, value);\\n }\\n return uint248(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint240 from uint256, reverting on\\n * overflow (when the input is greater than largest uint240).\\n *\\n * Counterpart to Solidity's `uint240` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 240 bits\\n */\\n function toUint240(uint256 value) internal pure returns (uint240) {\\n if (value > type(uint240).max) {\\n revert SafeCastOverflowedUintDowncast(240, value);\\n }\\n return uint240(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint232 from uint256, reverting on\\n * overflow (when the input is greater than largest uint232).\\n *\\n * Counterpart to Solidity's `uint232` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 232 bits\\n */\\n function toUint232(uint256 value) internal pure returns (uint232) {\\n if (value > type(uint232).max) {\\n revert SafeCastOverflowedUintDowncast(232, value);\\n }\\n return uint232(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint224 from uint256, reverting on\\n * overflow (when the input is greater than largest uint224).\\n *\\n * Counterpart to Solidity's `uint224` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 224 bits\\n */\\n function toUint224(uint256 value) internal pure returns (uint224) {\\n if (value > type(uint224).max) {\\n revert SafeCastOverflowedUintDowncast(224, value);\\n }\\n return uint224(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint216 from uint256, reverting on\\n * overflow (when the input is greater than largest uint216).\\n *\\n * Counterpart to Solidity's `uint216` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 216 bits\\n */\\n function toUint216(uint256 value) internal pure returns (uint216) {\\n if (value > type(uint216).max) {\\n revert SafeCastOverflowedUintDowncast(216, value);\\n }\\n return uint216(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint208 from uint256, reverting on\\n * overflow (when the input is greater than largest uint208).\\n *\\n * Counterpart to Solidity's `uint208` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 208 bits\\n */\\n function toUint208(uint256 value) internal pure returns (uint208) {\\n if (value > type(uint208).max) {\\n revert SafeCastOverflowedUintDowncast(208, value);\\n }\\n return uint208(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint200 from uint256, reverting on\\n * overflow (when the input is greater than largest uint200).\\n *\\n * Counterpart to Solidity's `uint200` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 200 bits\\n */\\n function toUint200(uint256 value) internal pure returns (uint200) {\\n if (value > type(uint200).max) {\\n revert SafeCastOverflowedUintDowncast(200, value);\\n }\\n return uint200(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint192 from uint256, reverting on\\n * overflow (when the input is greater than largest uint192).\\n *\\n * Counterpart to Solidity's `uint192` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 192 bits\\n */\\n function toUint192(uint256 value) internal pure returns (uint192) {\\n if (value > type(uint192).max) {\\n revert SafeCastOverflowedUintDowncast(192, value);\\n }\\n return uint192(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint184 from uint256, reverting on\\n * overflow (when the input is greater than largest uint184).\\n *\\n * Counterpart to Solidity's `uint184` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 184 bits\\n */\\n function toUint184(uint256 value) internal pure returns (uint184) {\\n if (value > type(uint184).max) {\\n revert SafeCastOverflowedUintDowncast(184, value);\\n }\\n return uint184(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint176 from uint256, reverting on\\n * overflow (when the input is greater than largest uint176).\\n *\\n * Counterpart to Solidity's `uint176` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 176 bits\\n */\\n function toUint176(uint256 value) internal pure returns (uint176) {\\n if (value > type(uint176).max) {\\n revert SafeCastOverflowedUintDowncast(176, value);\\n }\\n return uint176(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint168 from uint256, reverting on\\n * overflow (when the input is greater than largest uint168).\\n *\\n * Counterpart to Solidity's `uint168` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 168 bits\\n */\\n function toUint168(uint256 value) internal pure returns (uint168) {\\n if (value > type(uint168).max) {\\n revert SafeCastOverflowedUintDowncast(168, value);\\n }\\n return uint168(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint160 from uint256, reverting on\\n * overflow (when the input is greater than largest uint160).\\n *\\n * Counterpart to Solidity's `uint160` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 160 bits\\n */\\n function toUint160(uint256 value) internal pure returns (uint160) {\\n if (value > type(uint160).max) {\\n revert SafeCastOverflowedUintDowncast(160, value);\\n }\\n return uint160(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint152 from uint256, reverting on\\n * overflow (when the input is greater than largest uint152).\\n *\\n * Counterpart to Solidity's `uint152` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 152 bits\\n */\\n function toUint152(uint256 value) internal pure returns (uint152) {\\n if (value > type(uint152).max) {\\n revert SafeCastOverflowedUintDowncast(152, value);\\n }\\n return uint152(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint144 from uint256, reverting on\\n * overflow (when the input is greater than largest uint144).\\n *\\n * Counterpart to Solidity's `uint144` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 144 bits\\n */\\n function toUint144(uint256 value) internal pure returns (uint144) {\\n if (value > type(uint144).max) {\\n revert SafeCastOverflowedUintDowncast(144, value);\\n }\\n return uint144(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint136 from uint256, reverting on\\n * overflow (when the input is greater than largest uint136).\\n *\\n * Counterpart to Solidity's `uint136` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 136 bits\\n */\\n function toUint136(uint256 value) internal pure returns (uint136) {\\n if (value > type(uint136).max) {\\n revert SafeCastOverflowedUintDowncast(136, value);\\n }\\n return uint136(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint128 from uint256, reverting on\\n * overflow (when the input is greater than largest uint128).\\n *\\n * Counterpart to Solidity's `uint128` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 128 bits\\n */\\n function toUint128(uint256 value) internal pure returns (uint128) {\\n if (value > type(uint128).max) {\\n revert SafeCastOverflowedUintDowncast(128, value);\\n }\\n return uint128(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint120 from uint256, reverting on\\n * overflow (when the input is greater than largest uint120).\\n *\\n * Counterpart to Solidity's `uint120` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 120 bits\\n */\\n function toUint120(uint256 value) internal pure returns (uint120) {\\n if (value > type(uint120).max) {\\n revert SafeCastOverflowedUintDowncast(120, value);\\n }\\n return uint120(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint112 from uint256, reverting on\\n * overflow (when the input is greater than largest uint112).\\n *\\n * Counterpart to Solidity's `uint112` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 112 bits\\n */\\n function toUint112(uint256 value) internal pure returns (uint112) {\\n if (value > type(uint112).max) {\\n revert SafeCastOverflowedUintDowncast(112, value);\\n }\\n return uint112(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint104 from uint256, reverting on\\n * overflow (when the input is greater than largest uint104).\\n *\\n * Counterpart to Solidity's `uint104` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 104 bits\\n */\\n function toUint104(uint256 value) internal pure returns (uint104) {\\n if (value > type(uint104).max) {\\n revert SafeCastOverflowedUintDowncast(104, value);\\n }\\n return uint104(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint96 from uint256, reverting on\\n * overflow (when the input is greater than largest uint96).\\n *\\n * Counterpart to Solidity's `uint96` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 96 bits\\n */\\n function toUint96(uint256 value) internal pure returns (uint96) {\\n if (value > type(uint96).max) {\\n revert SafeCastOverflowedUintDowncast(96, value);\\n }\\n return uint96(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint88 from uint256, reverting on\\n * overflow (when the input is greater than largest uint88).\\n *\\n * Counterpart to Solidity's `uint88` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 88 bits\\n */\\n function toUint88(uint256 value) internal pure returns (uint88) {\\n if (value > type(uint88).max) {\\n revert SafeCastOverflowedUintDowncast(88, value);\\n }\\n return uint88(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint80 from uint256, reverting on\\n * overflow (when the input is greater than largest uint80).\\n *\\n * Counterpart to Solidity's `uint80` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 80 bits\\n */\\n function toUint80(uint256 value) internal pure returns (uint80) {\\n if (value > type(uint80).max) {\\n revert SafeCastOverflowedUintDowncast(80, value);\\n }\\n return uint80(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint72 from uint256, reverting on\\n * overflow (when the input is greater than largest uint72).\\n *\\n * Counterpart to Solidity's `uint72` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 72 bits\\n */\\n function toUint72(uint256 value) internal pure returns (uint72) {\\n if (value > type(uint72).max) {\\n revert SafeCastOverflowedUintDowncast(72, value);\\n }\\n return uint72(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint64 from uint256, reverting on\\n * overflow (when the input is greater than largest uint64).\\n *\\n * Counterpart to Solidity's `uint64` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 64 bits\\n */\\n function toUint64(uint256 value) internal pure returns (uint64) {\\n if (value > type(uint64).max) {\\n revert SafeCastOverflowedUintDowncast(64, value);\\n }\\n return uint64(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint56 from uint256, reverting on\\n * overflow (when the input is greater than largest uint56).\\n *\\n * Counterpart to Solidity's `uint56` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 56 bits\\n */\\n function toUint56(uint256 value) internal pure returns (uint56) {\\n if (value > type(uint56).max) {\\n revert SafeCastOverflowedUintDowncast(56, value);\\n }\\n return uint56(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint48 from uint256, reverting on\\n * overflow (when the input is greater than largest uint48).\\n *\\n * Counterpart to Solidity's `uint48` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 48 bits\\n */\\n function toUint48(uint256 value) internal pure returns (uint48) {\\n if (value > type(uint48).max) {\\n revert SafeCastOverflowedUintDowncast(48, value);\\n }\\n return uint48(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint40 from uint256, reverting on\\n * overflow (when the input is greater than largest uint40).\\n *\\n * Counterpart to Solidity's `uint40` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 40 bits\\n */\\n function toUint40(uint256 value) internal pure returns (uint40) {\\n if (value > type(uint40).max) {\\n revert SafeCastOverflowedUintDowncast(40, value);\\n }\\n return uint40(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint32 from uint256, reverting on\\n * overflow (when the input is greater than largest uint32).\\n *\\n * Counterpart to Solidity's `uint32` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 32 bits\\n */\\n function toUint32(uint256 value) internal pure returns (uint32) {\\n if (value > type(uint32).max) {\\n revert SafeCastOverflowedUintDowncast(32, value);\\n }\\n return uint32(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint24 from uint256, reverting on\\n * overflow (when the input is greater than largest uint24).\\n *\\n * Counterpart to Solidity's `uint24` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 24 bits\\n */\\n function toUint24(uint256 value) internal pure returns (uint24) {\\n if (value > type(uint24).max) {\\n revert SafeCastOverflowedUintDowncast(24, value);\\n }\\n return uint24(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint16 from uint256, reverting on\\n * overflow (when the input is greater than largest uint16).\\n *\\n * Counterpart to Solidity's `uint16` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 16 bits\\n */\\n function toUint16(uint256 value) internal pure returns (uint16) {\\n if (value > type(uint16).max) {\\n revert SafeCastOverflowedUintDowncast(16, value);\\n }\\n return uint16(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint8 from uint256, reverting on\\n * overflow (when the input is greater than largest uint8).\\n *\\n * Counterpart to Solidity's `uint8` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 8 bits\\n */\\n function toUint8(uint256 value) internal pure returns (uint8) {\\n if (value > type(uint8).max) {\\n revert SafeCastOverflowedUintDowncast(8, value);\\n }\\n return uint8(value);\\n }\\n\\n /**\\n * @dev Converts a signed int256 into an unsigned uint256.\\n *\\n * Requirements:\\n *\\n * - input must be greater than or equal to 0.\\n */\\n function toUint256(int256 value) internal pure returns (uint256) {\\n if (value < 0) {\\n revert SafeCastOverflowedIntToUint(value);\\n }\\n return uint256(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted int248 from int256, reverting on\\n * overflow (when the input is less than smallest int248 or\\n * greater than largest int248).\\n *\\n * Counterpart to Solidity's `int248` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 248 bits\\n */\\n function toInt248(int256 value) internal pure returns (int248 downcasted) {\\n downcasted = int248(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(248, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int240 from int256, reverting on\\n * overflow (when the input is less than smallest int240 or\\n * greater than largest int240).\\n *\\n * Counterpart to Solidity's `int240` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 240 bits\\n */\\n function toInt240(int256 value) internal pure returns (int240 downcasted) {\\n downcasted = int240(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(240, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int232 from int256, reverting on\\n * overflow (when the input is less than smallest int232 or\\n * greater than largest int232).\\n *\\n * Counterpart to Solidity's `int232` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 232 bits\\n */\\n function toInt232(int256 value) internal pure returns (int232 downcasted) {\\n downcasted = int232(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(232, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int224 from int256, reverting on\\n * overflow (when the input is less than smallest int224 or\\n * greater than largest int224).\\n *\\n * Counterpart to Solidity's `int224` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 224 bits\\n */\\n function toInt224(int256 value) internal pure returns (int224 downcasted) {\\n downcasted = int224(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(224, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int216 from int256, reverting on\\n * overflow (when the input is less than smallest int216 or\\n * greater than largest int216).\\n *\\n * Counterpart to Solidity's `int216` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 216 bits\\n */\\n function toInt216(int256 value) internal pure returns (int216 downcasted) {\\n downcasted = int216(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(216, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int208 from int256, reverting on\\n * overflow (when the input is less than smallest int208 or\\n * greater than largest int208).\\n *\\n * Counterpart to Solidity's `int208` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 208 bits\\n */\\n function toInt208(int256 value) internal pure returns (int208 downcasted) {\\n downcasted = int208(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(208, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int200 from int256, reverting on\\n * overflow (when the input is less than smallest int200 or\\n * greater than largest int200).\\n *\\n * Counterpart to Solidity's `int200` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 200 bits\\n */\\n function toInt200(int256 value) internal pure returns (int200 downcasted) {\\n downcasted = int200(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(200, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int192 from int256, reverting on\\n * overflow (when the input is less than smallest int192 or\\n * greater than largest int192).\\n *\\n * Counterpart to Solidity's `int192` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 192 bits\\n */\\n function toInt192(int256 value) internal pure returns (int192 downcasted) {\\n downcasted = int192(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(192, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int184 from int256, reverting on\\n * overflow (when the input is less than smallest int184 or\\n * greater than largest int184).\\n *\\n * Counterpart to Solidity's `int184` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 184 bits\\n */\\n function toInt184(int256 value) internal pure returns (int184 downcasted) {\\n downcasted = int184(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(184, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int176 from int256, reverting on\\n * overflow (when the input is less than smallest int176 or\\n * greater than largest int176).\\n *\\n * Counterpart to Solidity's `int176` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 176 bits\\n */\\n function toInt176(int256 value) internal pure returns (int176 downcasted) {\\n downcasted = int176(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(176, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int168 from int256, reverting on\\n * overflow (when the input is less than smallest int168 or\\n * greater than largest int168).\\n *\\n * Counterpart to Solidity's `int168` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 168 bits\\n */\\n function toInt168(int256 value) internal pure returns (int168 downcasted) {\\n downcasted = int168(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(168, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int160 from int256, reverting on\\n * overflow (when the input is less than smallest int160 or\\n * greater than largest int160).\\n *\\n * Counterpart to Solidity's `int160` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 160 bits\\n */\\n function toInt160(int256 value) internal pure returns (int160 downcasted) {\\n downcasted = int160(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(160, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int152 from int256, reverting on\\n * overflow (when the input is less than smallest int152 or\\n * greater than largest int152).\\n *\\n * Counterpart to Solidity's `int152` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 152 bits\\n */\\n function toInt152(int256 value) internal pure returns (int152 downcasted) {\\n downcasted = int152(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(152, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int144 from int256, reverting on\\n * overflow (when the input is less than smallest int144 or\\n * greater than largest int144).\\n *\\n * Counterpart to Solidity's `int144` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 144 bits\\n */\\n function toInt144(int256 value) internal pure returns (int144 downcasted) {\\n downcasted = int144(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(144, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int136 from int256, reverting on\\n * overflow (when the input is less than smallest int136 or\\n * greater than largest int136).\\n *\\n * Counterpart to Solidity's `int136` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 136 bits\\n */\\n function toInt136(int256 value) internal pure returns (int136 downcasted) {\\n downcasted = int136(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(136, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int128 from int256, reverting on\\n * overflow (when the input is less than smallest int128 or\\n * greater than largest int128).\\n *\\n * Counterpart to Solidity's `int128` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 128 bits\\n */\\n function toInt128(int256 value) internal pure returns (int128 downcasted) {\\n downcasted = int128(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(128, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int120 from int256, reverting on\\n * overflow (when the input is less than smallest int120 or\\n * greater than largest int120).\\n *\\n * Counterpart to Solidity's `int120` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 120 bits\\n */\\n function toInt120(int256 value) internal pure returns (int120 downcasted) {\\n downcasted = int120(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(120, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int112 from int256, reverting on\\n * overflow (when the input is less than smallest int112 or\\n * greater than largest int112).\\n *\\n * Counterpart to Solidity's `int112` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 112 bits\\n */\\n function toInt112(int256 value) internal pure returns (int112 downcasted) {\\n downcasted = int112(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(112, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int104 from int256, reverting on\\n * overflow (when the input is less than smallest int104 or\\n * greater than largest int104).\\n *\\n * Counterpart to Solidity's `int104` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 104 bits\\n */\\n function toInt104(int256 value) internal pure returns (int104 downcasted) {\\n downcasted = int104(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(104, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int96 from int256, reverting on\\n * overflow (when the input is less than smallest int96 or\\n * greater than largest int96).\\n *\\n * Counterpart to Solidity's `int96` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 96 bits\\n */\\n function toInt96(int256 value) internal pure returns (int96 downcasted) {\\n downcasted = int96(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(96, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int88 from int256, reverting on\\n * overflow (when the input is less than smallest int88 or\\n * greater than largest int88).\\n *\\n * Counterpart to Solidity's `int88` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 88 bits\\n */\\n function toInt88(int256 value) internal pure returns (int88 downcasted) {\\n downcasted = int88(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(88, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int80 from int256, reverting on\\n * overflow (when the input is less than smallest int80 or\\n * greater than largest int80).\\n *\\n * Counterpart to Solidity's `int80` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 80 bits\\n */\\n function toInt80(int256 value) internal pure returns (int80 downcasted) {\\n downcasted = int80(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(80, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int72 from int256, reverting on\\n * overflow (when the input is less than smallest int72 or\\n * greater than largest int72).\\n *\\n * Counterpart to Solidity's `int72` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 72 bits\\n */\\n function toInt72(int256 value) internal pure returns (int72 downcasted) {\\n downcasted = int72(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(72, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int64 from int256, reverting on\\n * overflow (when the input is less than smallest int64 or\\n * greater than largest int64).\\n *\\n * Counterpart to Solidity's `int64` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 64 bits\\n */\\n function toInt64(int256 value) internal pure returns (int64 downcasted) {\\n downcasted = int64(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(64, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int56 from int256, reverting on\\n * overflow (when the input is less than smallest int56 or\\n * greater than largest int56).\\n *\\n * Counterpart to Solidity's `int56` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 56 bits\\n */\\n function toInt56(int256 value) internal pure returns (int56 downcasted) {\\n downcasted = int56(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(56, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int48 from int256, reverting on\\n * overflow (when the input is less than smallest int48 or\\n * greater than largest int48).\\n *\\n * Counterpart to Solidity's `int48` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 48 bits\\n */\\n function toInt48(int256 value) internal pure returns (int48 downcasted) {\\n downcasted = int48(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(48, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int40 from int256, reverting on\\n * overflow (when the input is less than smallest int40 or\\n * greater than largest int40).\\n *\\n * Counterpart to Solidity's `int40` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 40 bits\\n */\\n function toInt40(int256 value) internal pure returns (int40 downcasted) {\\n downcasted = int40(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(40, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int32 from int256, reverting on\\n * overflow (when the input is less than smallest int32 or\\n * greater than largest int32).\\n *\\n * Counterpart to Solidity's `int32` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 32 bits\\n */\\n function toInt32(int256 value) internal pure returns (int32 downcasted) {\\n downcasted = int32(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(32, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int24 from int256, reverting on\\n * overflow (when the input is less than smallest int24 or\\n * greater than largest int24).\\n *\\n * Counterpart to Solidity's `int24` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 24 bits\\n */\\n function toInt24(int256 value) internal pure returns (int24 downcasted) {\\n downcasted = int24(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(24, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int16 from int256, reverting on\\n * overflow (when the input is less than smallest int16 or\\n * greater than largest int16).\\n *\\n * Counterpart to Solidity's `int16` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 16 bits\\n */\\n function toInt16(int256 value) internal pure returns (int16 downcasted) {\\n downcasted = int16(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(16, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int8 from int256, reverting on\\n * overflow (when the input is less than smallest int8 or\\n * greater than largest int8).\\n *\\n * Counterpart to Solidity's `int8` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 8 bits\\n */\\n function toInt8(int256 value) internal pure returns (int8 downcasted) {\\n downcasted = int8(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(8, value);\\n }\\n }\\n\\n /**\\n * @dev Converts an unsigned uint256 into a signed int256.\\n *\\n * Requirements:\\n *\\n * - input must be less than or equal to maxInt256.\\n */\\n function toInt256(uint256 value) internal pure returns (int256) {\\n // Note: Unsafe cast below is okay because `type(int256).max` is guaranteed to be positive\\n if (value > uint256(type(int256).max)) {\\n revert SafeCastOverflowedUintToInt(value);\\n }\\n return int256(value);\\n }\\n\\n /**\\n * @dev Cast a boolean (false or true) to a uint256 (0 or 1) with no jump.\\n */\\n function toUint(bool b) internal pure returns (uint256 u) {\\n assembly (\\\"memory-safe\\\") {\\n u := iszero(iszero(b))\\n }\\n }\\n}\\n\",\"keccak256\":\"0x195533c86d0ef72bcc06456a4f66a9b941f38eb403739b00f21fd7c1abd1ae54\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/math/SignedMath.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/math/SignedMath.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {SafeCast} from \\\"./SafeCast.sol\\\";\\n\\n/**\\n * @dev Standard signed math utilities missing in the Solidity language.\\n */\\nlibrary SignedMath {\\n /**\\n * @dev Branchless ternary evaluation for `a ? b : c`. Gas costs are constant.\\n *\\n * IMPORTANT: This function may reduce bytecode size and consume less gas when used standalone.\\n * However, the compiler may optimize Solidity ternary operations (i.e. `a ? b : c`) to only compute\\n * one branch when needed, making this function more expensive.\\n */\\n function ternary(bool condition, int256 a, int256 b) internal pure returns (int256) {\\n unchecked {\\n // branchless ternary works because:\\n // b ^ (a ^ b) == a\\n // b ^ 0 == b\\n return b ^ ((a ^ b) * int256(SafeCast.toUint(condition)));\\n }\\n }\\n\\n /**\\n * @dev Returns the largest of two signed numbers.\\n */\\n function max(int256 a, int256 b) internal pure returns (int256) {\\n return ternary(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 ternary(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 // Formula from the \\\"Bit Twiddling Hacks\\\" by Sean Eron Anderson.\\n // Since `n` is a signed integer, the generated bytecode will use the SAR opcode to perform the right shift,\\n // taking advantage of the most significant (or \\\"sign\\\" bit) in two's complement representation.\\n // This opcode adds new most significant bits set to the value of the previous most significant bit. As a result,\\n // the mask will either be `bytes32(0)` (if n is positive) or `~bytes32(0)` (if n is negative).\\n int256 mask = n >> 255;\\n\\n // A `bytes32(0)` mask leaves the input unchanged, while a `~bytes32(0)` mask complements it.\\n return uint256((n + mask) ^ mask);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xb1970fac7b64e6c09611e6691791e848d5e3fe410fa5899e7df2e0afd77a99e3\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/structs/Checkpoints.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/structs/Checkpoints.sol)\\n// This file was procedurally generated from scripts/generate/templates/Checkpoints.js.\\n\\npragma solidity ^0.8.20;\\n\\nimport {Math} from \\\"../math/Math.sol\\\";\\n\\n/**\\n * @dev This library defines the `Trace*` struct, for checkpointing values as they change at different points in\\n * time, and later looking up past values by block number. See {Votes} as an example.\\n *\\n * To create a history of checkpoints define a variable type `Checkpoints.Trace*` in your contract, and store a new\\n * checkpoint for the current transaction block using the {push} function.\\n */\\nlibrary Checkpoints {\\n /**\\n * @dev A value was attempted to be inserted on a past checkpoint.\\n */\\n error CheckpointUnorderedInsertion();\\n\\n struct Trace224 {\\n Checkpoint224[] _checkpoints;\\n }\\n\\n struct Checkpoint224 {\\n uint32 _key;\\n uint224 _value;\\n }\\n\\n /**\\n * @dev Pushes a (`key`, `value`) pair into a Trace224 so that it is stored as the checkpoint.\\n *\\n * Returns previous value and new value.\\n *\\n * IMPORTANT: Never accept `key` as a user input, since an arbitrary `type(uint32).max` key set will disable the\\n * library.\\n */\\n function push(\\n Trace224 storage self,\\n uint32 key,\\n uint224 value\\n ) internal returns (uint224 oldValue, uint224 newValue) {\\n return _insert(self._checkpoints, key, value);\\n }\\n\\n /**\\n * @dev Returns the value in the first (oldest) checkpoint with key greater or equal than the search key, or zero if\\n * there is none.\\n */\\n function lowerLookup(Trace224 storage self, uint32 key) internal view returns (uint224) {\\n uint256 len = self._checkpoints.length;\\n uint256 pos = _lowerBinaryLookup(self._checkpoints, key, 0, len);\\n return pos == len ? 0 : _unsafeAccess(self._checkpoints, pos)._value;\\n }\\n\\n /**\\n * @dev Returns the value in the last (most recent) checkpoint with key lower or equal than the search key, or zero\\n * if there is none.\\n */\\n function upperLookup(Trace224 storage self, uint32 key) internal view returns (uint224) {\\n uint256 len = self._checkpoints.length;\\n uint256 pos = _upperBinaryLookup(self._checkpoints, key, 0, len);\\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\\n }\\n\\n /**\\n * @dev Returns the value in the last (most recent) checkpoint with key lower or equal than the search key, or zero\\n * if there is none.\\n *\\n * NOTE: This is a variant of {upperLookup} that is optimised to find \\\"recent\\\" checkpoint (checkpoints with high\\n * keys).\\n */\\n function upperLookupRecent(Trace224 storage self, uint32 key) internal view returns (uint224) {\\n uint256 len = self._checkpoints.length;\\n\\n uint256 low = 0;\\n uint256 high = len;\\n\\n if (len > 5) {\\n uint256 mid = len - Math.sqrt(len);\\n if (key < _unsafeAccess(self._checkpoints, mid)._key) {\\n high = mid;\\n } else {\\n low = mid + 1;\\n }\\n }\\n\\n uint256 pos = _upperBinaryLookup(self._checkpoints, key, low, high);\\n\\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\\n }\\n\\n /**\\n * @dev Returns the value in the most recent checkpoint, or zero if there are no checkpoints.\\n */\\n function latest(Trace224 storage self) internal view returns (uint224) {\\n uint256 pos = self._checkpoints.length;\\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\\n }\\n\\n /**\\n * @dev Returns whether there is a checkpoint in the structure (i.e. it is not empty), and if so the key and value\\n * in the most recent checkpoint.\\n */\\n function latestCheckpoint(Trace224 storage self) internal view returns (bool exists, uint32 _key, uint224 _value) {\\n uint256 pos = self._checkpoints.length;\\n if (pos == 0) {\\n return (false, 0, 0);\\n } else {\\n Checkpoint224 storage ckpt = _unsafeAccess(self._checkpoints, pos - 1);\\n return (true, ckpt._key, ckpt._value);\\n }\\n }\\n\\n /**\\n * @dev Returns the number of checkpoint.\\n */\\n function length(Trace224 storage self) internal view returns (uint256) {\\n return self._checkpoints.length;\\n }\\n\\n /**\\n * @dev Returns checkpoint at given position.\\n */\\n function at(Trace224 storage self, uint32 pos) internal view returns (Checkpoint224 memory) {\\n return self._checkpoints[pos];\\n }\\n\\n /**\\n * @dev Pushes a (`key`, `value`) pair into an ordered list of checkpoints, either by inserting a new checkpoint,\\n * or by updating the last one.\\n */\\n function _insert(\\n Checkpoint224[] storage self,\\n uint32 key,\\n uint224 value\\n ) private returns (uint224 oldValue, uint224 newValue) {\\n uint256 pos = self.length;\\n\\n if (pos > 0) {\\n Checkpoint224 storage last = _unsafeAccess(self, pos - 1);\\n uint32 lastKey = last._key;\\n uint224 lastValue = last._value;\\n\\n // Checkpoint keys must be non-decreasing.\\n if (lastKey > key) {\\n revert CheckpointUnorderedInsertion();\\n }\\n\\n // Update or push new checkpoint\\n if (lastKey == key) {\\n last._value = value;\\n } else {\\n self.push(Checkpoint224({_key: key, _value: value}));\\n }\\n return (lastValue, value);\\n } else {\\n self.push(Checkpoint224({_key: key, _value: value}));\\n return (0, value);\\n }\\n }\\n\\n /**\\n * @dev Return the index of the first (oldest) checkpoint with key strictly bigger than the search key, or `high`\\n * if there is none. `low` and `high` define a section where to do the search, with inclusive `low` and exclusive\\n * `high`.\\n *\\n * WARNING: `high` should not be greater than the array's length.\\n */\\n function _upperBinaryLookup(\\n Checkpoint224[] storage self,\\n uint32 key,\\n uint256 low,\\n uint256 high\\n ) private view returns (uint256) {\\n while (low < high) {\\n uint256 mid = Math.average(low, high);\\n if (_unsafeAccess(self, mid)._key > key) {\\n high = mid;\\n } else {\\n low = mid + 1;\\n }\\n }\\n return high;\\n }\\n\\n /**\\n * @dev Return the index of the first (oldest) checkpoint with key greater or equal than the search key, or `high`\\n * if there is none. `low` and `high` define a section where to do the search, with inclusive `low` and exclusive\\n * `high`.\\n *\\n * WARNING: `high` should not be greater than the array's length.\\n */\\n function _lowerBinaryLookup(\\n Checkpoint224[] storage self,\\n uint32 key,\\n uint256 low,\\n uint256 high\\n ) private view returns (uint256) {\\n while (low < high) {\\n uint256 mid = Math.average(low, high);\\n if (_unsafeAccess(self, mid)._key < key) {\\n low = mid + 1;\\n } else {\\n high = mid;\\n }\\n }\\n return high;\\n }\\n\\n /**\\n * @dev Access an element of the array without performing bounds check. The position is assumed to be within bounds.\\n */\\n function _unsafeAccess(\\n Checkpoint224[] storage self,\\n uint256 pos\\n ) private pure returns (Checkpoint224 storage result) {\\n assembly {\\n mstore(0, self.slot)\\n result.slot := add(keccak256(0, 0x20), pos)\\n }\\n }\\n\\n struct Trace208 {\\n Checkpoint208[] _checkpoints;\\n }\\n\\n struct Checkpoint208 {\\n uint48 _key;\\n uint208 _value;\\n }\\n\\n /**\\n * @dev Pushes a (`key`, `value`) pair into a Trace208 so that it is stored as the checkpoint.\\n *\\n * Returns previous value and new value.\\n *\\n * IMPORTANT: Never accept `key` as a user input, since an arbitrary `type(uint48).max` key set will disable the\\n * library.\\n */\\n function push(\\n Trace208 storage self,\\n uint48 key,\\n uint208 value\\n ) internal returns (uint208 oldValue, uint208 newValue) {\\n return _insert(self._checkpoints, key, value);\\n }\\n\\n /**\\n * @dev Returns the value in the first (oldest) checkpoint with key greater or equal than the search key, or zero if\\n * there is none.\\n */\\n function lowerLookup(Trace208 storage self, uint48 key) internal view returns (uint208) {\\n uint256 len = self._checkpoints.length;\\n uint256 pos = _lowerBinaryLookup(self._checkpoints, key, 0, len);\\n return pos == len ? 0 : _unsafeAccess(self._checkpoints, pos)._value;\\n }\\n\\n /**\\n * @dev Returns the value in the last (most recent) checkpoint with key lower or equal than the search key, or zero\\n * if there is none.\\n */\\n function upperLookup(Trace208 storage self, uint48 key) internal view returns (uint208) {\\n uint256 len = self._checkpoints.length;\\n uint256 pos = _upperBinaryLookup(self._checkpoints, key, 0, len);\\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\\n }\\n\\n /**\\n * @dev Returns the value in the last (most recent) checkpoint with key lower or equal than the search key, or zero\\n * if there is none.\\n *\\n * NOTE: This is a variant of {upperLookup} that is optimised to find \\\"recent\\\" checkpoint (checkpoints with high\\n * keys).\\n */\\n function upperLookupRecent(Trace208 storage self, uint48 key) internal view returns (uint208) {\\n uint256 len = self._checkpoints.length;\\n\\n uint256 low = 0;\\n uint256 high = len;\\n\\n if (len > 5) {\\n uint256 mid = len - Math.sqrt(len);\\n if (key < _unsafeAccess(self._checkpoints, mid)._key) {\\n high = mid;\\n } else {\\n low = mid + 1;\\n }\\n }\\n\\n uint256 pos = _upperBinaryLookup(self._checkpoints, key, low, high);\\n\\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\\n }\\n\\n /**\\n * @dev Returns the value in the most recent checkpoint, or zero if there are no checkpoints.\\n */\\n function latest(Trace208 storage self) internal view returns (uint208) {\\n uint256 pos = self._checkpoints.length;\\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\\n }\\n\\n /**\\n * @dev Returns whether there is a checkpoint in the structure (i.e. it is not empty), and if so the key and value\\n * in the most recent checkpoint.\\n */\\n function latestCheckpoint(Trace208 storage self) internal view returns (bool exists, uint48 _key, uint208 _value) {\\n uint256 pos = self._checkpoints.length;\\n if (pos == 0) {\\n return (false, 0, 0);\\n } else {\\n Checkpoint208 storage ckpt = _unsafeAccess(self._checkpoints, pos - 1);\\n return (true, ckpt._key, ckpt._value);\\n }\\n }\\n\\n /**\\n * @dev Returns the number of checkpoint.\\n */\\n function length(Trace208 storage self) internal view returns (uint256) {\\n return self._checkpoints.length;\\n }\\n\\n /**\\n * @dev Returns checkpoint at given position.\\n */\\n function at(Trace208 storage self, uint32 pos) internal view returns (Checkpoint208 memory) {\\n return self._checkpoints[pos];\\n }\\n\\n /**\\n * @dev Pushes a (`key`, `value`) pair into an ordered list of checkpoints, either by inserting a new checkpoint,\\n * or by updating the last one.\\n */\\n function _insert(\\n Checkpoint208[] storage self,\\n uint48 key,\\n uint208 value\\n ) private returns (uint208 oldValue, uint208 newValue) {\\n uint256 pos = self.length;\\n\\n if (pos > 0) {\\n Checkpoint208 storage last = _unsafeAccess(self, pos - 1);\\n uint48 lastKey = last._key;\\n uint208 lastValue = last._value;\\n\\n // Checkpoint keys must be non-decreasing.\\n if (lastKey > key) {\\n revert CheckpointUnorderedInsertion();\\n }\\n\\n // Update or push new checkpoint\\n if (lastKey == key) {\\n last._value = value;\\n } else {\\n self.push(Checkpoint208({_key: key, _value: value}));\\n }\\n return (lastValue, value);\\n } else {\\n self.push(Checkpoint208({_key: key, _value: value}));\\n return (0, value);\\n }\\n }\\n\\n /**\\n * @dev Return the index of the first (oldest) checkpoint with key strictly bigger than the search key, or `high`\\n * if there is none. `low` and `high` define a section where to do the search, with inclusive `low` and exclusive\\n * `high`.\\n *\\n * WARNING: `high` should not be greater than the array's length.\\n */\\n function _upperBinaryLookup(\\n Checkpoint208[] storage self,\\n uint48 key,\\n uint256 low,\\n uint256 high\\n ) private view returns (uint256) {\\n while (low < high) {\\n uint256 mid = Math.average(low, high);\\n if (_unsafeAccess(self, mid)._key > key) {\\n high = mid;\\n } else {\\n low = mid + 1;\\n }\\n }\\n return high;\\n }\\n\\n /**\\n * @dev Return the index of the first (oldest) checkpoint with key greater or equal than the search key, or `high`\\n * if there is none. `low` and `high` define a section where to do the search, with inclusive `low` and exclusive\\n * `high`.\\n *\\n * WARNING: `high` should not be greater than the array's length.\\n */\\n function _lowerBinaryLookup(\\n Checkpoint208[] storage self,\\n uint48 key,\\n uint256 low,\\n uint256 high\\n ) private view returns (uint256) {\\n while (low < high) {\\n uint256 mid = Math.average(low, high);\\n if (_unsafeAccess(self, mid)._key < key) {\\n low = mid + 1;\\n } else {\\n high = mid;\\n }\\n }\\n return high;\\n }\\n\\n /**\\n * @dev Access an element of the array without performing bounds check. The position is assumed to be within bounds.\\n */\\n function _unsafeAccess(\\n Checkpoint208[] storage self,\\n uint256 pos\\n ) private pure returns (Checkpoint208 storage result) {\\n assembly {\\n mstore(0, self.slot)\\n result.slot := add(keccak256(0, 0x20), pos)\\n }\\n }\\n\\n struct Trace160 {\\n Checkpoint160[] _checkpoints;\\n }\\n\\n struct Checkpoint160 {\\n uint96 _key;\\n uint160 _value;\\n }\\n\\n /**\\n * @dev Pushes a (`key`, `value`) pair into a Trace160 so that it is stored as the checkpoint.\\n *\\n * Returns previous value and new value.\\n *\\n * IMPORTANT: Never accept `key` as a user input, since an arbitrary `type(uint96).max` key set will disable the\\n * library.\\n */\\n function push(\\n Trace160 storage self,\\n uint96 key,\\n uint160 value\\n ) internal returns (uint160 oldValue, uint160 newValue) {\\n return _insert(self._checkpoints, key, value);\\n }\\n\\n /**\\n * @dev Returns the value in the first (oldest) checkpoint with key greater or equal than the search key, or zero if\\n * there is none.\\n */\\n function lowerLookup(Trace160 storage self, uint96 key) internal view returns (uint160) {\\n uint256 len = self._checkpoints.length;\\n uint256 pos = _lowerBinaryLookup(self._checkpoints, key, 0, len);\\n return pos == len ? 0 : _unsafeAccess(self._checkpoints, pos)._value;\\n }\\n\\n /**\\n * @dev Returns the value in the last (most recent) checkpoint with key lower or equal than the search key, or zero\\n * if there is none.\\n */\\n function upperLookup(Trace160 storage self, uint96 key) internal view returns (uint160) {\\n uint256 len = self._checkpoints.length;\\n uint256 pos = _upperBinaryLookup(self._checkpoints, key, 0, len);\\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\\n }\\n\\n /**\\n * @dev Returns the value in the last (most recent) checkpoint with key lower or equal than the search key, or zero\\n * if there is none.\\n *\\n * NOTE: This is a variant of {upperLookup} that is optimised to find \\\"recent\\\" checkpoint (checkpoints with high\\n * keys).\\n */\\n function upperLookupRecent(Trace160 storage self, uint96 key) internal view returns (uint160) {\\n uint256 len = self._checkpoints.length;\\n\\n uint256 low = 0;\\n uint256 high = len;\\n\\n if (len > 5) {\\n uint256 mid = len - Math.sqrt(len);\\n if (key < _unsafeAccess(self._checkpoints, mid)._key) {\\n high = mid;\\n } else {\\n low = mid + 1;\\n }\\n }\\n\\n uint256 pos = _upperBinaryLookup(self._checkpoints, key, low, high);\\n\\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\\n }\\n\\n /**\\n * @dev Returns the value in the most recent checkpoint, or zero if there are no checkpoints.\\n */\\n function latest(Trace160 storage self) internal view returns (uint160) {\\n uint256 pos = self._checkpoints.length;\\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\\n }\\n\\n /**\\n * @dev Returns whether there is a checkpoint in the structure (i.e. it is not empty), and if so the key and value\\n * in the most recent checkpoint.\\n */\\n function latestCheckpoint(Trace160 storage self) internal view returns (bool exists, uint96 _key, uint160 _value) {\\n uint256 pos = self._checkpoints.length;\\n if (pos == 0) {\\n return (false, 0, 0);\\n } else {\\n Checkpoint160 storage ckpt = _unsafeAccess(self._checkpoints, pos - 1);\\n return (true, ckpt._key, ckpt._value);\\n }\\n }\\n\\n /**\\n * @dev Returns the number of checkpoint.\\n */\\n function length(Trace160 storage self) internal view returns (uint256) {\\n return self._checkpoints.length;\\n }\\n\\n /**\\n * @dev Returns checkpoint at given position.\\n */\\n function at(Trace160 storage self, uint32 pos) internal view returns (Checkpoint160 memory) {\\n return self._checkpoints[pos];\\n }\\n\\n /**\\n * @dev Pushes a (`key`, `value`) pair into an ordered list of checkpoints, either by inserting a new checkpoint,\\n * or by updating the last one.\\n */\\n function _insert(\\n Checkpoint160[] storage self,\\n uint96 key,\\n uint160 value\\n ) private returns (uint160 oldValue, uint160 newValue) {\\n uint256 pos = self.length;\\n\\n if (pos > 0) {\\n Checkpoint160 storage last = _unsafeAccess(self, pos - 1);\\n uint96 lastKey = last._key;\\n uint160 lastValue = last._value;\\n\\n // Checkpoint keys must be non-decreasing.\\n if (lastKey > key) {\\n revert CheckpointUnorderedInsertion();\\n }\\n\\n // Update or push new checkpoint\\n if (lastKey == key) {\\n last._value = value;\\n } else {\\n self.push(Checkpoint160({_key: key, _value: value}));\\n }\\n return (lastValue, value);\\n } else {\\n self.push(Checkpoint160({_key: key, _value: value}));\\n return (0, value);\\n }\\n }\\n\\n /**\\n * @dev Return the index of the first (oldest) checkpoint with key strictly bigger than the search key, or `high`\\n * if there is none. `low` and `high` define a section where to do the search, with inclusive `low` and exclusive\\n * `high`.\\n *\\n * WARNING: `high` should not be greater than the array's length.\\n */\\n function _upperBinaryLookup(\\n Checkpoint160[] storage self,\\n uint96 key,\\n uint256 low,\\n uint256 high\\n ) private view returns (uint256) {\\n while (low < high) {\\n uint256 mid = Math.average(low, high);\\n if (_unsafeAccess(self, mid)._key > key) {\\n high = mid;\\n } else {\\n low = mid + 1;\\n }\\n }\\n return high;\\n }\\n\\n /**\\n * @dev Return the index of the first (oldest) checkpoint with key greater or equal than the search key, or `high`\\n * if there is none. `low` and `high` define a section where to do the search, with inclusive `low` and exclusive\\n * `high`.\\n *\\n * WARNING: `high` should not be greater than the array's length.\\n */\\n function _lowerBinaryLookup(\\n Checkpoint160[] storage self,\\n uint96 key,\\n uint256 low,\\n uint256 high\\n ) private view returns (uint256) {\\n while (low < high) {\\n uint256 mid = Math.average(low, high);\\n if (_unsafeAccess(self, mid)._key < key) {\\n low = mid + 1;\\n } else {\\n high = mid;\\n }\\n }\\n return high;\\n }\\n\\n /**\\n * @dev Access an element of the array without performing bounds check. The position is assumed to be within bounds.\\n */\\n function _unsafeAccess(\\n Checkpoint160[] storage self,\\n uint256 pos\\n ) private pure returns (Checkpoint160 storage result) {\\n assembly {\\n mstore(0, self.slot)\\n result.slot := add(keccak256(0, 0x20), pos)\\n }\\n }\\n}\\n\",\"keccak256\":\"0x66364cd3247ea71cdb58f080f5d5ed6732433a8001413139661841535494692f\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/structs/DoubleEndedQueue.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/structs/DoubleEndedQueue.sol)\\npragma solidity ^0.8.20;\\n\\nimport {Panic} from \\\"../Panic.sol\\\";\\n\\n/**\\n * @dev A sequence of items with the ability to efficiently push and pop items (i.e. insert and remove) on both ends of\\n * the sequence (called front and back). Among other access patterns, it can be used to implement efficient LIFO and\\n * FIFO queues. Storage use is optimized, and all operations are O(1) constant time. This includes {clear}, given that\\n * the existing queue contents are left in storage.\\n *\\n * The struct is called `Bytes32Deque`. Other types can be cast to and from `bytes32`. This data structure can only be\\n * used in storage, and not in memory.\\n * ```solidity\\n * DoubleEndedQueue.Bytes32Deque queue;\\n * ```\\n */\\nlibrary DoubleEndedQueue {\\n /**\\n * @dev Indices are 128 bits so begin and end are packed in a single storage slot for efficient access.\\n *\\n * Struct members have an underscore prefix indicating that they are \\\"private\\\" and should not be read or written to\\n * directly. Use the functions provided below instead. Modifying the struct manually may violate assumptions and\\n * lead to unexpected behavior.\\n *\\n * The first item is at data[begin] and the last item is at data[end - 1]. This range can wrap around.\\n */\\n struct Bytes32Deque {\\n uint128 _begin;\\n uint128 _end;\\n mapping(uint128 index => bytes32) _data;\\n }\\n\\n /**\\n * @dev Inserts an item at the end of the queue.\\n *\\n * Reverts with {Panic-RESOURCE_ERROR} if the queue is full.\\n */\\n function pushBack(Bytes32Deque storage deque, bytes32 value) internal {\\n unchecked {\\n uint128 backIndex = deque._end;\\n if (backIndex + 1 == deque._begin) Panic.panic(Panic.RESOURCE_ERROR);\\n deque._data[backIndex] = value;\\n deque._end = backIndex + 1;\\n }\\n }\\n\\n /**\\n * @dev Removes the item at the end of the queue and returns it.\\n *\\n * Reverts with {Panic-EMPTY_ARRAY_POP} if the queue is empty.\\n */\\n function popBack(Bytes32Deque storage deque) internal returns (bytes32 value) {\\n unchecked {\\n uint128 backIndex = deque._end;\\n if (backIndex == deque._begin) Panic.panic(Panic.EMPTY_ARRAY_POP);\\n --backIndex;\\n value = deque._data[backIndex];\\n delete deque._data[backIndex];\\n deque._end = backIndex;\\n }\\n }\\n\\n /**\\n * @dev Inserts an item at the beginning of the queue.\\n *\\n * Reverts with {Panic-RESOURCE_ERROR} if the queue is full.\\n */\\n function pushFront(Bytes32Deque storage deque, bytes32 value) internal {\\n unchecked {\\n uint128 frontIndex = deque._begin - 1;\\n if (frontIndex == deque._end) Panic.panic(Panic.RESOURCE_ERROR);\\n deque._data[frontIndex] = value;\\n deque._begin = frontIndex;\\n }\\n }\\n\\n /**\\n * @dev Removes the item at the beginning of the queue and returns it.\\n *\\n * Reverts with {Panic-EMPTY_ARRAY_POP} if the queue is empty.\\n */\\n function popFront(Bytes32Deque storage deque) internal returns (bytes32 value) {\\n unchecked {\\n uint128 frontIndex = deque._begin;\\n if (frontIndex == deque._end) Panic.panic(Panic.EMPTY_ARRAY_POP);\\n value = deque._data[frontIndex];\\n delete deque._data[frontIndex];\\n deque._begin = frontIndex + 1;\\n }\\n }\\n\\n /**\\n * @dev Returns the item at the beginning of the queue.\\n *\\n * Reverts with {Panic-ARRAY_OUT_OF_BOUNDS} if the queue is empty.\\n */\\n function front(Bytes32Deque storage deque) internal view returns (bytes32 value) {\\n if (empty(deque)) Panic.panic(Panic.ARRAY_OUT_OF_BOUNDS);\\n return deque._data[deque._begin];\\n }\\n\\n /**\\n * @dev Returns the item at the end of the queue.\\n *\\n * Reverts with {Panic-ARRAY_OUT_OF_BOUNDS} if the queue is empty.\\n */\\n function back(Bytes32Deque storage deque) internal view returns (bytes32 value) {\\n if (empty(deque)) Panic.panic(Panic.ARRAY_OUT_OF_BOUNDS);\\n unchecked {\\n return deque._data[deque._end - 1];\\n }\\n }\\n\\n /**\\n * @dev Return the item at a position in the queue given by `index`, with the first item at 0 and last item at\\n * `length(deque) - 1`.\\n *\\n * Reverts with {Panic-ARRAY_OUT_OF_BOUNDS} if the index is out of bounds.\\n */\\n function at(Bytes32Deque storage deque, uint256 index) internal view returns (bytes32 value) {\\n if (index >= length(deque)) Panic.panic(Panic.ARRAY_OUT_OF_BOUNDS);\\n // By construction, length is a uint128, so the check above ensures that index can be safely downcast to uint128\\n unchecked {\\n return deque._data[deque._begin + uint128(index)];\\n }\\n }\\n\\n /**\\n * @dev Resets the queue back to being empty.\\n *\\n * NOTE: The current items are left behind in storage. This does not affect the functioning of the queue, but misses\\n * out on potential gas refunds.\\n */\\n function clear(Bytes32Deque storage deque) internal {\\n deque._begin = 0;\\n deque._end = 0;\\n }\\n\\n /**\\n * @dev Returns the number of items in the queue.\\n */\\n function length(Bytes32Deque storage deque) internal view returns (uint256) {\\n unchecked {\\n return uint256(deque._end - deque._begin);\\n }\\n }\\n\\n /**\\n * @dev Returns true if the queue is empty.\\n */\\n function empty(Bytes32Deque storage deque) internal view returns (bool) {\\n return deque._end == deque._begin;\\n }\\n}\\n\",\"keccak256\":\"0x1e1d74658d7f4eab3d4f8fb0c6c5953bc5f629d9425e978d557dabff7b58b217\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/types/Time.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/types/Time.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {Math} from \\\"../math/Math.sol\\\";\\nimport {SafeCast} from \\\"../math/SafeCast.sol\\\";\\n\\n/**\\n * @dev This library provides helpers for manipulating time-related objects.\\n *\\n * It uses the following types:\\n * - `uint48` for timepoints\\n * - `uint32` for durations\\n *\\n * While the library doesn't provide specific types for timepoints and duration, it does provide:\\n * - a `Delay` type to represent duration that can be programmed to change value automatically at a given point\\n * - additional helper functions\\n */\\nlibrary Time {\\n using Time for *;\\n\\n /**\\n * @dev Get the block timestamp as a Timepoint.\\n */\\n function timestamp() internal view returns (uint48) {\\n return SafeCast.toUint48(block.timestamp);\\n }\\n\\n /**\\n * @dev Get the block number as a Timepoint.\\n */\\n function blockNumber() internal view returns (uint48) {\\n return SafeCast.toUint48(block.number);\\n }\\n\\n // ==================================================== Delay =====================================================\\n /**\\n * @dev A `Delay` is a uint32 duration that can be programmed to change value automatically at a given point in the\\n * future. The \\\"effect\\\" timepoint describes when the transitions happens from the \\\"old\\\" value to the \\\"new\\\" value.\\n * This allows updating the delay applied to some operation while keeping some guarantees.\\n *\\n * In particular, the {update} function guarantees that if the delay is reduced, the old delay still applies for\\n * some time. For example if the delay is currently 7 days to do an upgrade, the admin should not be able to set\\n * the delay to 0 and upgrade immediately. If the admin wants to reduce the delay, the old delay (7 days) should\\n * still apply for some time.\\n *\\n *\\n * The `Delay` type is 112 bits long, and packs the following:\\n *\\n * ```\\n * | [uint48]: effect date (timepoint)\\n * | | [uint32]: value before (duration)\\n * \\u2193 \\u2193 \\u2193 [uint32]: value after (duration)\\n * 0xAAAAAAAAAAAABBBBBBBBCCCCCCCC\\n * ```\\n *\\n * NOTE: The {get} and {withUpdate} functions operate using timestamps. Block number based delays are not currently\\n * supported.\\n */\\n type Delay is uint112;\\n\\n /**\\n * @dev Wrap a duration into a Delay to add the one-step \\\"update in the future\\\" feature\\n */\\n function toDelay(uint32 duration) internal pure returns (Delay) {\\n return Delay.wrap(duration);\\n }\\n\\n /**\\n * @dev Get the value at a given timepoint plus the pending value and effect timepoint if there is a scheduled\\n * change after this timepoint. If the effect timepoint is 0, then the pending value should not be considered.\\n */\\n function _getFullAt(\\n Delay self,\\n uint48 timepoint\\n ) private pure returns (uint32 valueBefore, uint32 valueAfter, uint48 effect) {\\n (valueBefore, valueAfter, effect) = self.unpack();\\n return effect <= timepoint ? (valueAfter, 0, 0) : (valueBefore, valueAfter, effect);\\n }\\n\\n /**\\n * @dev Get the current value plus the pending value and effect timepoint if there is a scheduled change. If the\\n * effect timepoint is 0, then the pending value should not be considered.\\n */\\n function getFull(Delay self) internal view returns (uint32 valueBefore, uint32 valueAfter, uint48 effect) {\\n return _getFullAt(self, timestamp());\\n }\\n\\n /**\\n * @dev Get the current value.\\n */\\n function get(Delay self) internal view returns (uint32) {\\n (uint32 delay, , ) = self.getFull();\\n return delay;\\n }\\n\\n /**\\n * @dev Update a Delay object so that it takes a new duration after a timepoint that is automatically computed to\\n * enforce the old delay at the moment of the update. Returns the updated Delay object and the timestamp when the\\n * new delay becomes effective.\\n */\\n function withUpdate(\\n Delay self,\\n uint32 newValue,\\n uint32 minSetback\\n ) internal view returns (Delay updatedDelay, uint48 effect) {\\n uint32 value = self.get();\\n uint32 setback = uint32(Math.max(minSetback, value > newValue ? value - newValue : 0));\\n effect = timestamp() + setback;\\n return (pack(value, newValue, effect), effect);\\n }\\n\\n /**\\n * @dev Split a delay into its components: valueBefore, valueAfter and effect (transition timepoint).\\n */\\n function unpack(Delay self) internal pure returns (uint32 valueBefore, uint32 valueAfter, uint48 effect) {\\n uint112 raw = Delay.unwrap(self);\\n\\n valueAfter = uint32(raw);\\n valueBefore = uint32(raw >> 32);\\n effect = uint48(raw >> 64);\\n\\n return (valueBefore, valueAfter, effect);\\n }\\n\\n /**\\n * @dev pack the components into a Delay object.\\n */\\n function pack(uint32 valueBefore, uint32 valueAfter, uint48 effect) internal pure returns (Delay) {\\n return Delay.wrap((uint112(effect) << 64) | (uint112(valueBefore) << 32) | uint112(valueAfter));\\n }\\n}\\n\",\"keccak256\":\"0x36776530f012618bc7526ceb28e77b85e582cb12d9b9466a71d4bd6bf952e4cc\",\"license\":\"MIT\"},\"contracts/variants/crosschain/Gov.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity ^0.8.20;\\n\\nimport \\\"@openzeppelin/contracts/governance/Governor.sol\\\";\\nimport \\\"@openzeppelin/contracts/governance/extensions/GovernorSettings.sol\\\";\\nimport \\\"@openzeppelin/contracts/governance/extensions/GovernorCountingSimple.sol\\\";\\nimport \\\"@openzeppelin/contracts/governance/extensions/GovernorVotes.sol\\\";\\nimport \\\"@openzeppelin/contracts/governance/extensions/GovernorVotesQuorumFraction.sol\\\";\\nimport \\\"./ProofHandler.sol\\\";\\n\\n/**\\n * @title Cross-chain Governance Contract\\n * @author Web3 Hackers Collective\\n * @notice Implementation of a DAO with cross-chain synchronization capabilities\\n * @dev Extends OpenZeppelin's Governor contract with cross-chain parameter updates\\n * @custom:security-contact julien@strat.cc\\n */\\ncontract Gov is\\n Governor,\\n GovernorSettings,\\n GovernorCountingSimple,\\n GovernorVotes,\\n GovernorVotesQuorumFraction\\n{\\n /// @notice Chain ID where this contract was originally deployed\\n uint256 public immutable home;\\n\\n /// @notice IPFS CID of the DAO's manifesto\\n string public manifesto;\\n\\n /// @notice Storage for proof handling\\n ProofHandler.ProofStorage private _proofStorage;\\n\\n /// @notice Types of operations that can be synchronized across chains\\n enum OperationType {\\n SET_MANIFESTO,\\n UPDATE_VOTING_DELAY,\\n UPDATE_VOTING_PERIOD,\\n UPDATE_PROPOSAL_THRESHOLD,\\n UPDATE_QUORUM\\n }\\n\\n /// @notice Emitted when the manifesto is updated\\n /// @param oldManifesto Previous manifesto CID\\n /// @param newManifesto New manifesto CID\\n /// @param nonce Update sequence number\\n event ManifestoUpdated(string oldManifesto, string newManifesto, uint256 nonce);\\n\\n /// @notice Emitted when a governance parameter is updated\\n /// @param operationType Type of parameter updated\\n /// @param oldValue Previous value\\n /// @param newValue New value\\n /// @param nonce Update sequence number\\n event GovernanceParameterUpdated(\\n OperationType indexed operationType,\\n uint256 oldValue,\\n uint256 newValue,\\n uint256 nonce\\n );\\n\\n /// @notice Restricts functions to be called only on the home chain\\n modifier onlyHomeChain() {\\n require(block.chainid == home, \\\"Operation only allowed on home chain\\\");\\n _;\\n }\\n\\n /**\\n * @notice Initializes the governance contract\\n * @dev Sets up initial governance parameters and manifesto\\n * @param _home Chain ID where this contract is considered home\\n * @param _token The voting token contract address\\n * @param _manifestoCid Initial manifesto CID\\n * @param _name Name of the governance contract\\n * @param _votingDelay Time before voting begins\\n * @param _votingPeriod Duration of voting period\\n * @param _proposalThreshold Minimum votes needed to create a proposal\\n * @param _quorum Minimum participation percentage required\\n */\\n constructor(\\n uint256 _home,\\n IVotes _token,\\n string memory _manifestoCid,\\n string memory _name,\\n uint48 _votingDelay,\\n uint32 _votingPeriod,\\n uint256 _proposalThreshold,\\n uint256 _quorum\\n )\\n Governor(_name)\\n GovernorSettings(_votingDelay, _votingPeriod, _proposalThreshold)\\n GovernorVotes(_token)\\n GovernorVotesQuorumFraction(_quorum)\\n {\\n home = _home;\\n manifesto = _manifestoCid;\\n }\\n\\n /**\\n * @notice Updates the DAO's manifesto on the home chain\\n * @param newManifesto New manifesto CID\\n */\\n function setManifesto(string memory newManifesto) public onlyGovernance onlyHomeChain {\\n uint256 nonce = ProofHandler.incrementNonce(\\n _proofStorage,\\n uint8(OperationType.SET_MANIFESTO)\\n );\\n string memory oldManifesto = manifesto;\\n manifesto = newManifesto;\\n emit ManifestoUpdated(oldManifesto, newManifesto, nonce);\\n }\\n\\n /**\\n * @notice Updates the voting delay parameter on the home chain\\n * @param newVotingDelay New voting delay value\\n */\\n function setVotingDelay(\\n uint48 newVotingDelay\\n ) public virtual override onlyGovernance onlyHomeChain {\\n uint256 nonce = ProofHandler.incrementNonce(\\n _proofStorage,\\n uint8(OperationType.UPDATE_VOTING_DELAY)\\n );\\n uint256 oldValue = votingDelay();\\n _setVotingDelay(newVotingDelay);\\n emit GovernanceParameterUpdated(\\n OperationType.UPDATE_VOTING_DELAY,\\n oldValue,\\n newVotingDelay,\\n nonce\\n );\\n }\\n\\n /**\\n * @notice Updates the voting period parameter on the home chain\\n * @param newVotingPeriod New voting period value\\n */\\n function setVotingPeriod(\\n uint32 newVotingPeriod\\n ) public virtual override onlyGovernance onlyHomeChain {\\n uint256 nonce = ProofHandler.incrementNonce(\\n _proofStorage,\\n uint8(OperationType.UPDATE_VOTING_PERIOD)\\n );\\n uint256 oldValue = votingPeriod();\\n _setVotingPeriod(newVotingPeriod);\\n emit GovernanceParameterUpdated(\\n OperationType.UPDATE_VOTING_PERIOD,\\n oldValue,\\n newVotingPeriod,\\n nonce\\n );\\n }\\n\\n /**\\n * @notice Updates the proposal threshold parameter on the home chain\\n * @param newProposalThreshold New proposal threshold value\\n */\\n function setProposalThreshold(\\n uint256 newProposalThreshold\\n ) public virtual override onlyGovernance onlyHomeChain {\\n uint256 nonce = ProofHandler.incrementNonce(\\n _proofStorage,\\n uint8(OperationType.UPDATE_PROPOSAL_THRESHOLD)\\n );\\n uint256 oldValue = proposalThreshold();\\n _setProposalThreshold(newProposalThreshold);\\n emit GovernanceParameterUpdated(\\n OperationType.UPDATE_PROPOSAL_THRESHOLD,\\n oldValue,\\n newProposalThreshold,\\n nonce\\n );\\n }\\n\\n /**\\n * @notice Updates the quorum numerator on the home chain\\n * @param newQuorumNumerator New quorum numerator value\\n */\\n function updateQuorumNumerator(\\n uint256 newQuorumNumerator\\n ) public virtual override onlyGovernance onlyHomeChain {\\n uint256 nonce = ProofHandler.incrementNonce(\\n _proofStorage,\\n uint8(OperationType.UPDATE_QUORUM)\\n );\\n uint256 oldValue = quorumNumerator();\\n _updateQuorumNumerator(newQuorumNumerator);\\n emit GovernanceParameterUpdated(\\n OperationType.UPDATE_QUORUM,\\n oldValue,\\n newQuorumNumerator,\\n nonce\\n );\\n }\\n\\n /**\\n * @notice Generates proof for parameter updates\\n * @param operationType Type of parameter being updated\\n * @param value Encoded parameter value\\n * @return proof Encoded proof data\\n */\\n function generateParameterProof(\\n uint8 operationType,\\n bytes memory value\\n ) external view returns (bytes memory proof) {\\n require(block.chainid == home, \\\"Proofs only generated on home chain\\\");\\n uint256 nextNonce = ProofHandler.getNextNonce(_proofStorage, operationType);\\n return ProofHandler.generateProof(address(this), operationType, value, nextNonce);\\n }\\n\\n /**\\n * @notice Claims a parameter update on a foreign chain\\n * @param proof Proof generated by home chain\\n */\\n function claimParameterUpdate(bytes memory proof) external {\\n (uint8 operationType, bytes memory value, uint256 nonce) = ProofHandler.verifyAndClaimProof(\\n proof,\\n address(this),\\n _proofStorage\\n );\\n\\n if (operationType == uint8(OperationType.SET_MANIFESTO)) {\\n string memory newManifesto = abi.decode(value, (string));\\n string memory oldManifesto = manifesto;\\n manifesto = newManifesto;\\n emit ManifestoUpdated(oldManifesto, newManifesto, nonce);\\n } else if (operationType == uint8(OperationType.UPDATE_VOTING_DELAY)) {\\n uint48 newValue = uint48(bytes6(value));\\n uint256 oldValue = votingDelay();\\n _setVotingDelay(newValue);\\n emit GovernanceParameterUpdated(\\n OperationType.UPDATE_VOTING_DELAY,\\n oldValue,\\n newValue,\\n nonce\\n );\\n } else if (operationType == uint8(OperationType.UPDATE_VOTING_PERIOD)) {\\n uint32 newValue = uint32(bytes4(value));\\n uint256 oldValue = votingPeriod();\\n _setVotingPeriod(newValue);\\n emit GovernanceParameterUpdated(\\n OperationType.UPDATE_VOTING_PERIOD,\\n oldValue,\\n newValue,\\n nonce\\n );\\n } else if (operationType == uint8(OperationType.UPDATE_PROPOSAL_THRESHOLD)) {\\n uint256 newValue = abi.decode(value, (uint256));\\n uint256 oldValue = proposalThreshold();\\n _setProposalThreshold(newValue);\\n emit GovernanceParameterUpdated(\\n OperationType.UPDATE_PROPOSAL_THRESHOLD,\\n oldValue,\\n newValue,\\n nonce\\n );\\n } else if (operationType == uint8(OperationType.UPDATE_QUORUM)) {\\n uint256 newValue = abi.decode(value, (uint256));\\n uint256 oldValue = quorumNumerator();\\n _updateQuorumNumerator(newValue);\\n emit GovernanceParameterUpdated(OperationType.UPDATE_QUORUM, oldValue, newValue, nonce);\\n }\\n }\\n\\n // Required overrides\\n\\n function votingDelay() public view override(Governor, GovernorSettings) returns (uint256) {\\n return super.votingDelay();\\n }\\n\\n function votingPeriod() public view override(Governor, GovernorSettings) returns (uint256) {\\n return super.votingPeriod();\\n }\\n\\n function quorum(\\n uint256 blockNumber\\n ) public view override(Governor, GovernorVotesQuorumFraction) returns (uint256) {\\n return super.quorum(blockNumber);\\n }\\n\\n function proposalThreshold()\\n public\\n view\\n override(Governor, GovernorSettings)\\n returns (uint256)\\n {\\n return super.proposalThreshold();\\n }\\n}\\n\",\"keccak256\":\"0x9c3d392f452d79e03804790803c0f295a48390537eba2be45250a71219800bcc\",\"license\":\"GPL-3.0\"},\"contracts/variants/crosschain/ProofHandler.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity ^0.8.20;\\n\\n/**\\n * @title Proof Handler Library\\n * @author Web3 Hackers Collective\\n * @notice Library for standardized cross-chain proof generation and verification\\n * @dev Handles proof generation, verification, and tracking for cross-chain operations\\n * @custom:security-contact julien@strat.cc\\n */\\nlibrary ProofHandler {\\n /// @notice Tracks which proofs have been applied on each chain\\n struct ProofStorage {\\n mapping(bytes32 => bool) updateAppliedOnChain;\\n mapping(uint8 => uint256) currentNonce;\\n }\\n\\n /// @dev Emitted when a proof is claimed\\n event ProofClaimed(uint8 indexed operationType, bytes params, uint256 nonce);\\n\\n /**\\n * @notice Generates a proof for cross-chain operations\\n * @param contractAddress Address of contract generating the proof\\n * @param operationType Type of operation being performed\\n * @param params Operation parameters\\n * @param nonce Current nonce for this operation type\\n * @return proof Encoded proof data\\n */\\n function generateProof(\\n address contractAddress,\\n uint8 operationType,\\n bytes memory params,\\n uint256 nonce\\n ) public pure returns (bytes memory proof) {\\n bytes32 message = keccak256(\\n abi.encodePacked(contractAddress, operationType, params, nonce)\\n );\\n bytes32 digest = keccak256(abi.encodePacked(\\\"\\\\x19Ethereum Signed Message:\\\\n32\\\", message));\\n\\n return abi.encode(operationType, params, nonce, digest);\\n }\\n\\n /**\\n * @notice Verifies and claims a proof\\n * @param proof Proof to verify and claim\\n * @param contractAddress Address of contract claiming the proof\\n * @param storage_ Proof storage struct\\n * @return operationType The type of operation being performed\\n * @return params The operation parameters\\n * @return nonce The operation sequence number\\n */\\n function verifyAndClaimProof(\\n bytes memory proof,\\n address contractAddress,\\n ProofStorage storage storage_\\n ) public returns (uint8 operationType, bytes memory params, uint256 nonce) {\\n bytes32 digest;\\n (operationType, params, nonce, digest) = abi.decode(\\n proof,\\n (uint8, bytes, uint256, bytes32)\\n );\\n\\n bytes32 proofHash = keccak256(proof);\\n require(!storage_.updateAppliedOnChain[proofHash], \\\"Proof already claimed\\\");\\n require(nonce == storage_.currentNonce[operationType] + 1, \\\"Invalid nonce\\\");\\n\\n bytes32 message = keccak256(\\n abi.encodePacked(contractAddress, operationType, params, nonce)\\n );\\n bytes32 expectedDigest = keccak256(\\n abi.encodePacked(\\\"\\\\x19Ethereum Signed Message:\\\\n32\\\", message)\\n );\\n require(digest == expectedDigest, \\\"Invalid proof\\\");\\n\\n storage_.updateAppliedOnChain[proofHash] = true;\\n storage_.currentNonce[operationType] = nonce;\\n\\n emit ProofClaimed(operationType, params, nonce);\\n\\n return (operationType, params, nonce);\\n }\\n\\n /**\\n * @notice Gets the next nonce for an operation type\\n * @param storage_ Proof storage struct\\n * @param operationType Type of operation\\n * @return nonce Next nonce value\\n */\\n function getNextNonce(\\n ProofStorage storage storage_,\\n uint8 operationType\\n ) public view returns (uint256 nonce) {\\n return storage_.currentNonce[operationType] + 1;\\n }\\n\\n /**\\n * @notice Increments the nonce for an operation type\\n * @param storage_ Proof storage struct\\n * @param operationType Type of operation\\n * @return nonce New nonce value\\n */\\n function incrementNonce(\\n ProofStorage storage storage_,\\n uint8 operationType\\n ) public returns (uint256 nonce) {\\n storage_.currentNonce[operationType]++;\\n return storage_.currentNonce[operationType];\\n }\\n}\\n\",\"keccak256\":\"0x3719e47c508f29977d48842c5c1d27cce7cb289cbb592526f170f98135ff41a7\",\"license\":\"GPL-3.0\"}},\"version\":1}", + "bytecode": "0x6101a06040523480156200001257600080fd5b5060405162005684380380620056848339810160408190526200003591620007d4565b808785858589806200005b6040805180820190915260018152603160f81b602082015290565b6200006882600062000181565b610120526200007981600162000181565b61014052815160208084019190912060e052815190820120610100524660a0526200010760e05161010051604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f60208201529081019290925260608201524660808201523060a082015260009060c00160405160208183030381529060405280519060200120905090565b60805250503060c05260036200011e828262000930565b506200012c905083620001ba565b620001378262000220565b6200014281620002c7565b5050506001600160a01b0316610160526200015d8162000308565b50610180889052600b62000172878262000930565b50505050505050505062000a96565b6000602083511015620001a1576200019983620003a8565b9050620001b4565b81620001ae848262000930565b5060ff90505b92915050565b6008546040805165ffffffffffff928316815291831660208301527fc565b045403dc03c2eea82b81a0465edad9e2e7fc4d97e11421c209da93d7a93910160405180910390a16008805465ffffffffffff191665ffffffffffff92909216919091179055565b8063ffffffff16600003620002505760405163f1cfbf0560e01b8152600060048201526024015b60405180910390fd5b6008546040805163ffffffff66010000000000009093048316815291831660208301527f7e3f7f0708a84de9203036abaa450dccc85ad5ff52f78c170f3edb55cf5e8828910160405180910390a16008805463ffffffff90921666010000000000000263ffffffff60301b19909216919091179055565b60075460408051918252602082018390527fccb45da8d5717e6c4544694297c4ba5cf151d455c9bb0ed4fc7a38411bc05461910160405180910390a1600755565b606480821115620003375760405163243e544560e01b8152600481018390526024810182905260440162000247565b600062000343620003eb565b9050620003686200035362000407565b6200035e8562000489565b600a9190620004c3565b505060408051828152602081018590527f0553476bf02ef2726e8ce5ced78d63e26e602e4a2257b1f559418e24b4633997910160405180910390a1505050565b600080829050601f81511115620003d6578260405163305a27a960e01b8152600401620002479190620009fc565b8051620003e38262000a31565b179392505050565b6000620003f9600a620004e0565b6001600160d01b0316905090565b6000620004146101605190565b6001600160a01b03166391ddadf46040518163ffffffff1660e01b8152600401602060405180830381865afa92505050801562000470575060408051601f3d908101601f191682019092526200046d9181019062000a56565b60015b62000484576200047f62000530565b905090565b919050565b60006001600160d01b03821115620004bf576040516306dfcc6560e41b815260d060048201526024810183905260440162000247565b5090565b600080620004d38585856200053d565b915091505b935093915050565b8054600090801562000526576200050c83620004fe60018462000a74565b600091825260209091200190565b54660100000000000090046001600160d01b031662000529565b60005b9392505050565b60006200047f43620006a6565b825460009081908015620006475760006200055f87620004fe60018562000a74565b805490915065ffffffffffff80821691660100000000000090046001600160d01b0316908816821115620005a657604051632520601d60e01b815260040160405180910390fd5b8765ffffffffffff168265ffffffffffff1603620005e457825465ffffffffffff1666010000000000006001600160d01b0389160217835562000638565b6040805180820190915265ffffffffffff808a1682526001600160d01b03808a1660208085019182528d54600181018f5560008f815291909120945191519092166601000000000000029216919091179101555b9450859350620004d892505050565b50506040805180820190915265ffffffffffff80851682526001600160d01b0380851660208085019182528854600181018a5560008a8152918220955192519093166601000000000000029190931617920191909155905081620004d8565b600065ffffffffffff821115620004bf576040516306dfcc6560e41b8152603060048201526024810183905260440162000247565b634e487b7160e01b600052604160045260246000fd5b60005b838110156200070e578181015183820152602001620006f4565b50506000910152565b600082601f8301126200072957600080fd5b81516001600160401b0380821115620007465762000746620006db565b604051601f8301601f19908116603f01168101908282118183101715620007715762000771620006db565b816040528381528660208588010111156200078b57600080fd5b6200079e846020830160208901620006f1565b9695505050505050565b805165ffffffffffff811681146200048457600080fd5b805163ffffffff811681146200048457600080fd5b600080600080600080600080610100898b031215620007f257600080fd5b885160208a01519098506001600160a01b03811681146200081257600080fd5b60408a01519097506001600160401b03808211156200083057600080fd5b6200083e8c838d0162000717565b975060608b01519150808211156200085557600080fd5b50620008648b828c0162000717565b9550506200087560808a01620007a8565b93506200088560a08a01620007bf565b60c08a015160e0909a0151989b979a5095989497939692505050565b600181811c90821680620008b657607f821691505b602082108103620008d757634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200092b57600081815260208120601f850160051c81016020861015620009065750805b601f850160051c820191505b81811015620009275782815560010162000912565b5050505b505050565b81516001600160401b038111156200094c576200094c620006db565b62000964816200095d8454620008a1565b84620008dd565b602080601f8311600181146200099c5760008415620009835750858301515b600019600386901b1c1916600185901b17855562000927565b600085815260208120601f198616915b82811015620009cd57888601518255948401946001909101908401620009ac565b5085821015620009ec5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b602081526000825180602084015262000a1d816040850160208701620006f1565b601f01601f19169190910160400192915050565b80516020808301519190811015620008d75760001960209190910360031b1b16919050565b60006020828403121562000a6957600080fd5b6200052982620007a8565b81810381811115620001b457634e487b7160e01b600052601160045260246000fd5b60805160a05160c05160e0516101005161012051610140516101605161018051614b3762000b4d600039600081816107e201528181610b1501528181610d06015281816114e901528181611d1a01528181611f30015261206f015260008181610a90015281816111b60152818161180d01528181612b200152612d1101526000612aeb01526000612abe01526000612f3a01526000612f1201526000612e6d01526000612e9701526000612ec10152614b376000f3fe6080604052600436106102e85760003560e01c80637ecebe0011610190578063c01f9e37116100dc578063e2f3dce011610095578063ece40cc11161006f578063ece40cc114610a15578063f23a6e6114610a35578063f8ce560a14610a61578063fc0c546a14610a8157600080fd5b8063e2f3dce0146109c0578063e540d01d146109d5578063eb9019d4146109f557600080fd5b8063c01f9e37146108d3578063c28bc2fa146108f3578063c59057e414610906578063cc31491c14610926578063dd4e2ba514610946578063deaaa7cc1461098c57600080fd5b80639fa92f9d11610149578063ab58fb8e11610123578063ab58fb8e1461083a578063b47a321814610872578063b58131b014610892578063bc197c81146108a757600080fd5b80639fa92f9d146107d0578063a7713a7014610804578063a9a952941461081957600080fd5b80637ecebe00146106f257806384b0196e146107285780638ff262e31461075057806391ddadf41461077057806397c3d3341461079c5780639a802a6d146107b057600080fd5b80633e4f49e61161024f578063567813881161020857806360c4247f116101e257806360c4247f1461067257806379051887146106925780637b3c71d3146106b25780637d5e81e2146106d257600080fd5b806356781388146106125780635b8d0e0d146106325780635f398a141461065257600080fd5b80633e4f49e6146104e75780634385963214610514578063452115d61461055e5780634bf5d7e91461057e578063544ffc9c1461059357806354fd4d50146105e857600080fd5b8063160cbed7116102a1578063160cbed71461042b5780631985ba761461044b5780632656227d1461046b5780632d63f6931461047e5780632fe3e2611461049e5780633932abb1146104d257600080fd5b806301ffc9a7146102f657806302a251a31461032b57806306f3f9e61461035757806306fdde0314610377578063143489d014610399578063150b7a02146103e757600080fd5b366102f157005b005b600080fd5b34801561030257600080fd5b506103166103113660046137ad565b610ab4565b60405190151581526020015b60405180910390f35b34801561033757600080fd5b50600854600160301b900463ffffffff165b604051908152602001610322565b34801561036357600080fd5b506102ef6103723660046137d7565b610b0b565b34801561038357600080fd5b5061038c610c2a565b6040516103229190613840565b3480156103a557600080fd5b506103cf6103b43660046137d7565b6000908152600460205260409020546001600160a01b031690565b6040516001600160a01b039091168152602001610322565b3480156103f357600080fd5b5061041261040236600461392d565b630a85bd0160e11b949350505050565b6040516001600160e01b03199091168152602001610322565b34801561043757600080fd5b50610349610446366004613afe565b610cbc565b34801561045757600080fd5b506102ef610466366004613b8d565b610cfc565b610349610479366004613afe565b610ea2565b34801561048a57600080fd5b506103496104993660046137d7565b610fd5565b3480156104aa57600080fd5b506103497f3e83946653575f9a39005e1545185629e92736b7528ab20ca3816f315424a81181565b3480156104de57600080fd5b50610349610ff6565b3480156104f357600080fd5b506105076105023660046137d7565b611009565b6040516103229190613bf9565b34801561052057600080fd5b5061031661052f366004613c07565b60008281526009602090815260408083206001600160a01b038516845260030190915290205460ff1692915050565b34801561056a57600080fd5b50610349610579366004613afe565b611143565b34801561058a57600080fd5b5061038c6111b2565b34801561059f57600080fd5b506105cd6105ae3660046137d7565b6000908152600960205260409020805460018201546002909201549092565b60408051938452602084019290925290820152606001610322565b3480156105f457600080fd5b506040805180820190915260018152603160f81b602082015261038c565b34801561061e57600080fd5b5061034961062d366004613c42565b611274565b34801561063e57600080fd5b5061034961064d366004613cba565b61129d565b34801561065e57600080fd5b5061034961066d366004613d74565b6113fc565b34801561067e57600080fd5b5061034961068d3660046137d7565b611451565b34801561069e57600080fd5b506102ef6106ad366004613e0d565b6114df565b3480156106be57600080fd5b506103496106cd366004613e2a565b6115f0565b3480156106de57600080fd5b506103496106ed366004613e85565b611638565b3480156106fe57600080fd5b5061034961070d366004613f25565b6001600160a01b031660009081526002602052604090205490565b34801561073457600080fd5b5061073d6116f1565b6040516103229796959493929190613f7b565b34801561075c57600080fd5b5061034961076b366004613feb565b611737565b34801561077c57600080fd5b50610785611809565b60405165ffffffffffff9091168152602001610322565b3480156107a857600080fd5b506064610349565b3480156107bc57600080fd5b506103496107cb36600461403c565b611891565b3480156107dc57600080fd5b506103497f000000000000000000000000000000000000000000000000000000000000000081565b34801561081057600080fd5b506103496118a8565b34801561082557600080fd5b506103166108343660046137d7565b50600090565b34801561084657600080fd5b506103496108553660046137d7565b60009081526004602052604090206001015465ffffffffffff1690565b34801561087e57600080fd5b506102ef61088d366004613b8d565b6118c2565b34801561089e57600080fd5b50610349611c0e565b3480156108b357600080fd5b506104126108c2366004614092565b63bc197c8160e01b95945050505050565b3480156108df57600080fd5b506103496108ee3660046137d7565b611c19565b6102ef610901366004614121565b611c5c565b34801561091257600080fd5b50610349610921366004613afe565b611cdc565b34801561093257600080fd5b5061038c610941366004614162565b611d16565b34801561095257600080fd5b506040805180820190915260208082527f737570706f72743d627261766f2671756f72756d3d666f722c6162737461696e9082015261038c565b34801561099857600080fd5b506103497ff2aad550cf55f045cb27e9c559f9889fdfb6e6cdaa032301d6ea397784ae51d781565b3480156109cc57600080fd5b5061038c611e98565b3480156109e157600080fd5b506102ef6109f03660046141b1565b611f26565b348015610a0157600080fd5b50610349610a103660046141d7565b612044565b348015610a2157600080fd5b506102ef610a303660046137d7565b612065565b348015610a4157600080fd5b50610412610a50366004614201565b63f23a6e6160e01b95945050505050565b348015610a6d57600080fd5b50610349610a7c3660046137d7565b612148565b348015610a8d57600080fd5b507f00000000000000000000000000000000000000000000000000000000000000006103cf565b60006001600160e01b031982166332a2ad4360e11b1480610ae557506001600160e01b03198216630271189760e51b145b80610b0057506301ffc9a760e01b6001600160e01b03198316145b92915050565b905090565b610b13612153565b7f00000000000000000000000000000000000000000000000000000000000000004614610b5b5760405162461bcd60e51b8152600401610b5290614265565b60405180910390fd5b604051633b0d4dd760e01b8152600c600482810191909152602482015260009073__$b1c1335e68417b4234016f4aa58fdfac77$__90633b0d4dd790604401602060405180830381865af4158015610bb7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bdb91906142a9565b90506000610be76118a8565b9050610bf28361218b565b60045b6040805183815260208101869052908101849052600080516020614ae2833981519152906060015b60405180910390a2505050565b606060038054610c39906142c2565b80601f0160208091040260200160405190810160405280929190818152602001828054610c65906142c2565b8015610cb25780601f10610c8757610100808354040283529160200191610cb2565b820191906000526020600020905b815481529060010190602001808311610c9557829003601f168201915b5050505050905090565b600080610ccb86868686611cdc565b9050610ce081610cdb6004612219565b61223c565b506000604051634844252360e11b815260040160405180910390fd5b610d04612153565b7f00000000000000000000000000000000000000000000000000000000000000004614610d435760405162461bcd60e51b8152600401610b5290614265565b604051633b0d4dd760e01b8152600c60048201526000602482018190529073__$b1c1335e68417b4234016f4aa58fdfac77$__90633b0d4dd790604401602060405180830381865af4158015610d9d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dc191906142a9565b90506000600b8054610dd2906142c2565b80601f0160208091040260200160405190810160405280929190818152602001828054610dfe906142c2565b8015610e4b5780601f10610e2057610100808354040283529160200191610e4b565b820191906000526020600020905b815481529060010190602001808311610e2e57829003601f168201915b5050505050905082600b9081610e619190614347565b507f67c6aa39e9b4a701119ddc2f40a18145fff9b6f4fa224d5f29c28755f719ffb2818484604051610e9593929190614406565b60405180910390a1505050565b600080610eb186868686611cdc565b9050610ed181610ec16005612219565b610ecb6004612219565b1761223c565b506000818152600460205260409020805460ff60f01b1916600160f01b17905530610ef93090565b6001600160a01b031614610f8b5760005b8651811015610f8957306001600160a01b0316878281518110610f2f57610f2f61443c565b60200260200101516001600160a01b031603610f7957610f79858281518110610f5a57610f5a61443c565b602002602001015180519060200120600561227b90919063ffffffff16565b610f8281614468565b9050610f0a565b505b610f9881878787876122dd565b6040518181527f712ae1383f79ac853f8d882153778e0260ef8f03b504e2866e0593e04d2b291f906020015b60405180910390a195945050505050565b600090815260046020526040902054600160a01b900465ffffffffffff1690565b6000610b0660085465ffffffffffff1690565b6000818152600460205260408120805460ff600160f01b8204811691600160f81b900416811561103e57506007949350505050565b801561104f57506002949350505050565b600061105a86610fd5565b90508060000361108057604051636ad0607560e01b815260048101879052602401610b52565b600061108a611809565b65ffffffffffff1690508082106110a8575060009695505050505050565b60006110b388611c19565b90508181106110ca57506001979650505050505050565b6110d3886123bd565b15806110f357506000888152600960205260409020805460019091015411155b1561110657506003979650505050505050565b60008881526004602052604090206001015465ffffffffffff1660000361113557506004979650505050505050565b506005979650505050505050565b60008061115286868686611cdc565b905061116281610cdb6000612219565b506000818152600460205260409020546001600160a01b0316331461119c5760405163233d98e360e01b8152336004820152602401610b52565b6111a8868686866123f4565b9695505050505050565b60607f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316634bf5d7e96040518163ffffffff1660e01b8152600401600060405180830381865afa92505050801561123357506040513d6000823e601f3d908101601f1916820160405261123091908101906144b1565b60015b61126f575060408051808201909152601d81527f6d6f64653d626c6f636b6e756d6265722666726f6d3d64656661756c74000000602082015290565b919050565b600080339050611295848285604051806020016040528060008152506124a5565b949350505050565b6000806113808761137a7f3e83946653575f9a39005e1545185629e92736b7528ab20ca3816f315424a8118c8c8c6112f28e6001600160a01b0316600090815260026020526040902080546001810190915590565b8d8d6040516113029291906144f9565b60405180910390208c8051906020012060405160200161135f9796959493929190968752602087019590955260ff9390931660408601526001600160a01b03919091166060850152608084015260a083015260c082015260e00190565b604051602081830303815290604052805190602001206124d1565b856124fe565b9050806113ab576040516394ab6c0760e01b81526001600160a01b0388166004820152602401610b52565b6113ef89888a89898080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508b9250612572915050565b9998505050505050505050565b60008033905061144687828888888080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508a9250612572915050565b979650505050505050565b600a80546000918290611465600184614509565b815481106114755761147561443c565b6000918252602090912001805490915065ffffffffffff811690600160301b90046001600160d01b03168582116114b8576001600160d01b031695945050505050565b6114cc6114c487612654565b600a9061268b565b6001600160d01b03169695505050505050565b6114e7612153565b7f000000000000000000000000000000000000000000000000000000000000000046146115265760405162461bcd60e51b8152600401610b5290614265565b604051633b0d4dd760e01b8152600c60048201526001602482015260009073__$b1c1335e68417b4234016f4aa58fdfac77$__90633b0d4dd790604401602060405180830381865af4158015611580573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115a491906142a9565b905060006115b0610ff6565b90506115bb83612740565b60016040805183815265ffffffffffff86166020820152908101849052600080516020614ae283398151915290606001610c1d565b6000803390506111a886828787878080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506124a592505050565b60003361164581846127a6565b61166d5760405163d9b3955760e01b81526001600160a01b0382166004820152602401610b52565b6000611677611c0e565b905080156116e45760006116a683600161168f611809565b611699919061451c565b65ffffffffffff16612044565b9050818110156116e257604051636121770b60e11b81526001600160a01b03841660048201526024810182905260448101839052606401610b52565b505b6114468787878786612897565b600060608060008060006060611705612ab7565b61170d612ae4565b60408051600080825260208201909252600f60f81b9b939a50919850469750309650945092509050565b6000806117c38461137a7ff2aad550cf55f045cb27e9c559f9889fdfb6e6cdaa032301d6ea397784ae51d789898961178c8b6001600160a01b0316600090815260026020526040902080546001810190915590565b60408051602081019690965285019390935260ff90911660608401526001600160a01b0316608083015260a082015260c00161135f565b9050806117ee576040516394ab6c0760e01b81526001600160a01b0385166004820152602401610b52565b6111a8868587604051806020016040528060008152506124a5565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166391ddadf46040518163ffffffff1660e01b8152600401602060405180830381865afa925050508015611885575060408051601f3d908101601f1916820190925261188291810190614542565b60015b61126f57610b06612b11565b600061189e848484612b1c565b90505b9392505050565b60006118b4600a612bb2565b6001600160d01b0316905090565b600080600073__$b1c1335e68417b4234016f4aa58fdfac77$__63c0af65918530600c6040518463ffffffff1660e01b81526004016119039392919061455f565b600060405180830381865af4158015611920573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261194891908101906145ad565b9194509250905060ff8316611a505760008280602001905181019061196d91906144b1565b90506000600b805461197e906142c2565b80601f01602080910402602001604051908101604052809291908181526020018280546119aa906142c2565b80156119f75780601f106119cc576101008083540402835291602001916119f7565b820191906000526020600020905b8154815290600101906020018083116119da57829003601f168201915b5050505050905081600b9081611a0d9190614347565b507f67c6aa39e9b4a701119ddc2f40a18145fff9b6f4fa224d5f29c28755f719ffb2818385604051611a4193929190614406565b60405180910390a15050611c08565b60001960ff841601611ac1576000611a6783614606565b60d01c90506000611a76610ff6565b9050611a8182612740565b60016040805183815265ffffffffffff85166020820152908101859052600080516020614ae2833981519152906060015b60405180910390a25050611c08565b60011960ff841601611b34576000611ad88361463d565b60e01c90506000611af660085463ffffffff600160301b9091041690565b9050611b0182612beb565b60026040805183815263ffffffff85166020820152908101859052600080516020614ae283398151915290606001611ab2565b60021960ff841601611b9b57600082806020019051810190611b5691906142a9565b90506000611b62611c0e565b9050611b6d82612c89565b60036040805183815260208101859052908101859052600080516020614ae283398151915290606001611ab2565b60031960ff841601611c0857600082806020019051810190611bbd91906142a9565b90506000611bc96118a8565b9050611bd48261218b565b60046040805183815260208101859052908101859052600080516020614ae28339815191529060600160405180910390a250505b50505050565b6000610b0660075490565b600081815260046020526040812054611c4e90600160d01b810463ffffffff1690600160a01b900465ffffffffffff16614670565b65ffffffffffff1692915050565b611c64612153565b600080856001600160a01b0316858585604051611c829291906144f9565b60006040518083038185875af1925050503d8060008114611cbf576040519150601f19603f3d011682016040523d82523d6000602084013e611cc4565b606091505b5091509150611cd38282612cca565b50505050505050565b600084848484604051602001611cf5949392919061471a565b60408051601f19818403018152919052805160209091012095945050505050565b60607f00000000000000000000000000000000000000000000000000000000000000004614611d935760405162461bcd60e51b815260206004820152602360248201527f50726f6f6673206f6e6c792067656e657261746564206f6e20686f6d6520636860448201526230b4b760e91b6064820152608401610b52565b604051630564edeb60e31b8152600c600482015260ff8416602482015260009073__$b1c1335e68417b4234016f4aa58fdfac77$__90632b276f5890604401602060405180830381865af4158015611def573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e1391906142a9565b604051637352178160e01b815290915073__$b1c1335e68417b4234016f4aa58fdfac77$__90637352178190611e53903090889088908790600401614765565b600060405180830381865af4158015611e70573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261129591908101906147a3565b600b8054611ea5906142c2565b80601f0160208091040260200160405190810160405280929190818152602001828054611ed1906142c2565b8015611f1e5780601f10611ef357610100808354040283529160200191611f1e565b820191906000526020600020905b815481529060010190602001808311611f0157829003601f168201915b505050505081565b611f2e612153565b7f00000000000000000000000000000000000000000000000000000000000000004614611f6d5760405162461bcd60e51b8152600401610b5290614265565b604051633b0d4dd760e01b8152600c60048201526002602482015260009073__$b1c1335e68417b4234016f4aa58fdfac77$__90633b0d4dd790604401602060405180830381865af4158015611fc7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611feb91906142a9565b9050600061200660085463ffffffff600160301b9091041690565b905061201183612beb565b60026040805183815263ffffffff86166020820152908101849052600080516020614ae283398151915290606001610c1d565b60006118a1838361206060408051602081019091526000815290565b612b1c565b61206d612153565b7f000000000000000000000000000000000000000000000000000000000000000046146120ac5760405162461bcd60e51b8152600401610b5290614265565b604051633b0d4dd760e01b8152600c60048201526003602482015260009073__$b1c1335e68417b4234016f4aa58fdfac77$__90633b0d4dd790604401602060405180830381865af4158015612106573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061212a91906142a9565b90506000612136611c0e565b905061214183612c89565b6003610bf5565b6000610b0082612ce6565b303314612175576040516347096e4760e01b8152336004820152602401610b52565b565b806121826005612d90565b03612177575b50565b6064808211156121b85760405163243e544560e01b81526004810183905260248101829052604401610b52565b60006121c26118a8565b90506121e16121cf611809565b6121d885612dff565b600a9190612e33565b505060408051828152602081018590527f0553476bf02ef2726e8ce5ced78d63e26e602e4a2257b1f559418e24b46339979101610e95565b600081600781111561222d5761222d613bc1565b600160ff919091161b92915050565b60008061224884611009565b905060008361225683612219565b16036118a1578381846040516331b75e4d60e01b8152600401610b52939291906147d7565b81546001600160801b03600160801b8204811691811660018301909116036122a7576122a76041612e4e565b6001600160801b03808216600090815260018086016020526040909120939093558354919092018216600160801b029116179055565b60005b84518110156123b5576000808683815181106122fe576122fe61443c565b60200260200101516001600160a01b03168684815181106123215761232161443c565b602002602001015186858151811061233b5761233b61443c565b602002602001015160405161235091906147f9565b60006040518083038185875af1925050503d806000811461238d576040519150601f19603f3d011682016040523d82523d6000602084013e612392565b606091505b50915091506123a18282612cca565b505050806123ae90614468565b90506122e0565b505050505050565b6000818152600960205260408120600281015460018201546123df9190614815565b6123eb610a7c85610fd5565b11159392505050565b60008061240386868686611cdc565b9050612451816124136007612219565b61241d6006612219565b6124276002612219565b6001612434600782614828565b61243f906002614925565b6124499190614509565b18181861223c565b506000818152600460205260409081902080546001600160f81b0316600160f81b179055517f789cf55be980739dad1d0699b93b58e806b51c9d96619bfa8fe0a28abaa7b30c90610fc49083815260200190565b60006124c8858585856124c360408051602081019091526000815290565b612572565b95945050505050565b6000610b006124de612e60565b8360405161190160f01b8152600281019290925260228201526042902090565b6000836001600160a01b03163b6000036125605760008061251f8585612f8b565b509092509050600081600381111561253957612539613bc1565b1480156125575750856001600160a01b0316826001600160a01b0316145b925050506118a1565b61256b848484612fd8565b90506118a1565b600061258286610cdb6001612219565b5060006125988661259289610fd5565b85612b1c565b905060006125a988888885886130b3565b9050835160000361260057866001600160a01b03167fb8e138887d0aa13bab447e82de9d5c1777041ecd21ca36ba824ff1e6c07ddda4898884896040516125f39493929190614934565b60405180910390a2611446565b866001600160a01b03167fe2babfbac5889a709b63bb7f598b324e08bc5a4fb9ec647fb3cbc9ec07eb8712898884898960405161264195949392919061495c565b60405180910390a2979650505050505050565b600065ffffffffffff821115612687576040516306dfcc6560e41b81526030600482015260248101839052604401610b52565b5090565b8154600090818160058111156126ea5760006126a6846131b6565b6126b09085614509565b60008881526020902090915081015465ffffffffffff90811690871610156126da578091506126e8565b6126e5816001614815565b92505b505b60006126f88787858561330f565b905080156127335761271d8761270f600184614509565b600091825260209091200190565b54600160301b90046001600160d01b0316611446565b6000979650505050505050565b6008546040805165ffffffffffff928316815291831660208301527fc565b045403dc03c2eea82b81a0465edad9e2e7fc4d97e11421c209da93d7a93910160405180910390a16008805465ffffffffffff191665ffffffffffff92909216919091179055565b805160009060348110156127be576001915050610b00565b82810160131901516001600160a01b031981166b046e0e4dee0dee6cae47a60f60a31b146127f157600192505050610b00565b6000806127ff602885614509565b90505b83811015612876576000806128368884815181106128225761282261443c565b01602001516001600160f81b031916613371565b915091508161284e5760019650505050505050610b00565b8060ff166004856001600160a01b0316901b17935050508061286f90614468565b9050612802565b50856001600160a01b0316816001600160a01b031614935050505092915050565b60006128ac8686868680519060200120611cdc565b9050845186511415806128c157508351865114155b806128cb57508551155b1561290057855184518651604051630447b05d60e41b8152600481019390935260248301919091526044820152606401610b52565b600081815260046020526040902054600160a01b900465ffffffffffff161561294b578061292d82611009565b6040516331b75e4d60e01b8152610b529291906000906004016147d7565b6000612955610ff6565b61295d611809565b65ffffffffffff1661296f9190614815565b9050600061298a60085463ffffffff600160301b9091041690565b600084815260046020526040902080546001600160a01b0319166001600160a01b0387161781559091506129bd83612654565b815465ffffffffffff91909116600160a01b0265ffffffffffff60a01b199091161781556129ea82613403565b815463ffffffff91909116600160d01b0263ffffffff60d01b1990911617815588517f7d84a6263ae0d98d3329bd7b46bb4e8d6f98cd35a7adb45c274c8b7fd5ebd5e090859087908c908c906001600160401b03811115612a4d57612a4d61386a565b604051908082528060200260200182016040528015612a8057816020015b6060815260200190600190039081612a6b5790505b508c89612a8d8a82614815565b8e604051612aa3999897969594939291906149a2565b60405180910390a150505095945050505050565b6060610b067f00000000000000000000000000000000000000000000000000000000000000006000613434565b6060610b067f00000000000000000000000000000000000000000000000000000000000000006001613434565b6000610b0643612654565b60007f0000000000000000000000000000000000000000000000000000000000000000604051630748d63560e31b81526001600160a01b038681166004830152602482018690529190911690633a46b1a890604401602060405180830381865afa158015612b8e573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061189e91906142a9565b80546000908015612be257612bcc8361270f600184614509565b54600160301b90046001600160d01b03166118a1565b60009392505050565b8063ffffffff16600003612c155760405163f1cfbf0560e01b815260006004820152602401610b52565b6008546040805163ffffffff600160301b9093048316815291831660208301527f7e3f7f0708a84de9203036abaa450dccc85ad5ff52f78c170f3edb55cf5e8828910160405180910390a16008805463ffffffff909216600160301b0269ffffffff00000000000019909216919091179055565b60075460408051918252602082018390527fccb45da8d5717e6c4544694297c4ba5cf151d455c9bb0ed4fc7a38411bc05461910160405180910390a1600755565b606082612cdf57612cda826134df565b610b00565b5080610b00565b60006064612cf383611451565b604051632394e7a360e21b8152600481018590526001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001690638e539e8c90602401602060405180830381865afa158015612d58573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612d7c91906142a9565b612d869190614a79565b610b009190614aa6565b80546000906001600160801b0380821691600160801b9004168103612db957612db96031612e4e565b6001600160801b038181166000908152600185810160205260408220805492905585546fffffffffffffffffffffffffffffffff19169301909116919091179092555090565b60006001600160d01b03821115612687576040516306dfcc6560e41b815260d0600482015260248101839052604401610b52565b600080612e41858585613508565b915091505b935093915050565b634e487b71600052806020526024601cfd5b6000306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016148015612eb957507f000000000000000000000000000000000000000000000000000000000000000046145b15612ee357507f000000000000000000000000000000000000000000000000000000000000000090565b610b06604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f60208201527f0000000000000000000000000000000000000000000000000000000000000000918101919091527f000000000000000000000000000000000000000000000000000000000000000060608201524660808201523060a082015260009060c00160405160208183030381529060405280519060200120905090565b60008060008351604103612fc55760208401516040850151606086015160001a612fb78882858561365c565b955095509550505050612fd1565b50508151600091506002905b9250925092565b6000806000856001600160a01b03168585604051602401612ffa929190614ac8565b60408051601f198184030181529181526020820180516001600160e01b0316630b135d3f60e11b1790525161302f91906147f9565b600060405180830381855afa9150503d806000811461306a576040519150601f19603f3d011682016040523d82523d6000602084013e61306f565b606091505b509150915081801561308357506020815110155b80156111a857508051630b135d3f60e11b906130a890830160209081019084016142a9565b149695505050505050565b60008581526009602090815260408083206001600160a01b03881684526003810190925282205460ff1615613106576040516371c6af4960e01b81526001600160a01b0387166004820152602401610b52565b6001600160a01b03861660009081526003820160205260409020805460ff1916600117905560ff851661315257838160000160008282546131479190614815565b909155506131ab9050565b60001960ff86160161317257838160010160008282546131479190614815565b60011960ff86160161319257838160020160008282546131479190614815565b6040516303599be160e11b815260040160405180910390fd5b509195945050505050565b6000600182116131c4575090565b816001600160801b82106131dd5760809190911c9060401b5b6801000000000000000082106131f85760409190911c9060201b5b640100000000821061320f5760209190911c9060101b5b6201000082106132245760109190911c9060081b5b61010082106132385760089190911c9060041b5b6010821061324b5760049190911c9060021b5b600482106132575760011b5b600302600190811c9081858161326f5761326f614a90565b048201901c9050600181858161328757613287614a90565b048201901c9050600181858161329f5761329f614a90565b048201901c905060018185816132b7576132b7614a90565b048201901c905060018185816132cf576132cf614a90565b048201901c905060018185816132e7576132e7614a90565b048201901c905061330681858161330057613300614a90565b04821190565b90039392505050565b60005b81831015613369576000613326848461372b565b60008781526020902090915065ffffffffffff86169082015465ffffffffffff16111561335557809250613363565b613360816001614815565b93505b50613312565b509392505050565b60008060f883901c602f8111801561338c5750603a8160ff16105b156133a157600194602f199091019350915050565b8060ff1660401080156133b7575060478160ff16105b156133cc576001946036199091019350915050565b8060ff1660601080156133e2575060678160ff16105b156133f7576001946056199091019350915050565b50600093849350915050565b600063ffffffff821115612687576040516306dfcc6560e41b81526020600482015260248101839052604401610b52565b606060ff831461344e5761344783613746565b9050610b00565b81805461345a906142c2565b80601f0160208091040260200160405190810160405280929190818152602001828054613486906142c2565b80156134d35780601f106134a8576101008083540402835291602001916134d3565b820191906000526020600020905b8154815290600101906020018083116134b657829003601f168201915b50505050509050610b00565b8051156134ef5780518082602001fd5b60405163d6bda27560e01b815260040160405180910390fd5b8254600090819080156136015760006135268761270f600185614509565b805490915065ffffffffffff80821691600160301b90046001600160d01b031690881682111561356957604051632520601d60e01b815260040160405180910390fd5b8765ffffffffffff168265ffffffffffff16036135a257825465ffffffffffff16600160301b6001600160d01b038916021783556135f3565b6040805180820190915265ffffffffffff808a1682526001600160d01b03808a1660208085019182528d54600181018f5560008f81529190912094519151909216600160301b029216919091179101555b9450859350612e4692505050565b50506040805180820190915265ffffffffffff80851682526001600160d01b0380851660208085019182528854600181018a5560008a815291822095519251909316600160301b029190931617920191909155905081612e46565b600080807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08411156136975750600091506003905082613721565b604080516000808252602082018084528a905260ff891692820192909252606081018790526080810186905260019060a0016020604051602081039080840390855afa1580156136eb573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b03811661371757506000925060019150829050613721565b9250600091508190505b9450945094915050565b600061373a6002848418614aa6565b6118a190848416614815565b6060600061375383613785565b604080516020808252818301909252919250600091906020820181803683375050509182525060208101929092525090565b600060ff8216601f811115610b0057604051632cd44ac360e21b815260040160405180910390fd5b6000602082840312156137bf57600080fd5b81356001600160e01b0319811681146118a157600080fd5b6000602082840312156137e957600080fd5b5035919050565b60005b8381101561380b5781810151838201526020016137f3565b50506000910152565b6000815180845261382c8160208601602086016137f0565b601f01601f19169290920160200192915050565b6020815260006118a16020830184613814565b80356001600160a01b038116811461126f57600080fd5b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b03811182821017156138a8576138a861386a565b604052919050565b60006001600160401b038211156138c9576138c961386a565b50601f01601f191660200190565b600082601f8301126138e857600080fd5b81356138fb6138f6826138b0565b613880565b81815284602083860101111561391057600080fd5b816020850160208301376000918101602001919091529392505050565b6000806000806080858703121561394357600080fd5b61394c85613853565b935061395a60208601613853565b92506040850135915060608501356001600160401b0381111561397c57600080fd5b613988878288016138d7565b91505092959194509250565b60006001600160401b038211156139ad576139ad61386a565b5060051b60200190565b600082601f8301126139c857600080fd5b813560206139d86138f683613994565b82815260059290921b840181019181810190868411156139f757600080fd5b8286015b84811015613a1957613a0c81613853565b83529183019183016139fb565b509695505050505050565b600082601f830112613a3557600080fd5b81356020613a456138f683613994565b82815260059290921b84018101918181019086841115613a6457600080fd5b8286015b84811015613a195780358352918301918301613a68565b600082601f830112613a9057600080fd5b81356020613aa06138f683613994565b82815260059290921b84018101918181019086841115613abf57600080fd5b8286015b84811015613a195780356001600160401b03811115613ae25760008081fd5b613af08986838b01016138d7565b845250918301918301613ac3565b60008060008060808587031215613b1457600080fd5b84356001600160401b0380821115613b2b57600080fd5b613b37888389016139b7565b95506020870135915080821115613b4d57600080fd5b613b5988838901613a24565b94506040870135915080821115613b6f57600080fd5b50613b7c87828801613a7f565b949793965093946060013593505050565b600060208284031215613b9f57600080fd5b81356001600160401b03811115613bb557600080fd5b611295848285016138d7565b634e487b7160e01b600052602160045260246000fd5b60088110613bf557634e487b7160e01b600052602160045260246000fd5b9052565b60208101610b008284613bd7565b60008060408385031215613c1a57600080fd5b82359150613c2a60208401613853565b90509250929050565b60ff8116811461218857600080fd5b60008060408385031215613c5557600080fd5b823591506020830135613c6781613c33565b809150509250929050565b60008083601f840112613c8457600080fd5b5081356001600160401b03811115613c9b57600080fd5b602083019150836020828501011115613cb357600080fd5b9250929050565b600080600080600080600060c0888a031215613cd557600080fd5b873596506020880135613ce781613c33565b9550613cf560408901613853565b945060608801356001600160401b0380821115613d1157600080fd5b613d1d8b838c01613c72565b909650945060808a0135915080821115613d3657600080fd5b613d428b838c016138d7565b935060a08a0135915080821115613d5857600080fd5b50613d658a828b016138d7565b91505092959891949750929550565b600080600080600060808688031215613d8c57600080fd5b853594506020860135613d9e81613c33565b935060408601356001600160401b0380821115613dba57600080fd5b613dc689838a01613c72565b90955093506060880135915080821115613ddf57600080fd5b50613dec888289016138d7565b9150509295509295909350565b65ffffffffffff8116811461218857600080fd5b600060208284031215613e1f57600080fd5b81356118a181613df9565b60008060008060608587031215613e4057600080fd5b843593506020850135613e5281613c33565b925060408501356001600160401b03811115613e6d57600080fd5b613e7987828801613c72565b95989497509550505050565b60008060008060808587031215613e9b57600080fd5b84356001600160401b0380821115613eb257600080fd5b613ebe888389016139b7565b95506020870135915080821115613ed457600080fd5b613ee088838901613a24565b94506040870135915080821115613ef657600080fd5b613f0288838901613a7f565b93506060870135915080821115613f1857600080fd5b50613988878288016138d7565b600060208284031215613f3757600080fd5b6118a182613853565b600081518084526020808501945080840160005b83811015613f7057815187529582019590820190600101613f54565b509495945050505050565b60ff60f81b8816815260e060208201526000613f9a60e0830189613814565b8281036040840152613fac8189613814565b606084018890526001600160a01b038716608085015260a0840186905283810360c08501529050613fdd8185613f40565b9a9950505050505050505050565b6000806000806080858703121561400157600080fd5b84359350602085013561401381613c33565b925061402160408601613853565b915060608501356001600160401b0381111561397c57600080fd5b60008060006060848603121561405157600080fd5b61405a84613853565b92506020840135915060408401356001600160401b0381111561407c57600080fd5b614088868287016138d7565b9150509250925092565b600080600080600060a086880312156140aa57600080fd5b6140b386613853565b94506140c160208701613853565b935060408601356001600160401b03808211156140dd57600080fd5b6140e989838a01613a24565b945060608801359150808211156140ff57600080fd5b61410b89838a01613a24565b93506080880135915080821115613ddf57600080fd5b6000806000806060858703121561413757600080fd5b61414085613853565b93506020850135925060408501356001600160401b03811115613e6d57600080fd5b6000806040838503121561417557600080fd5b823561418081613c33565b915060208301356001600160401b0381111561419b57600080fd5b6141a7858286016138d7565b9150509250929050565b6000602082840312156141c357600080fd5b813563ffffffff811681146118a157600080fd5b600080604083850312156141ea57600080fd5b6141f383613853565b946020939093013593505050565b600080600080600060a0868803121561421957600080fd5b61422286613853565b945061423060208701613853565b9350604086013592506060860135915060808601356001600160401b0381111561425957600080fd5b613dec888289016138d7565b60208082526024908201527f4f7065726174696f6e206f6e6c7920616c6c6f776564206f6e20686f6d6520636040820152633430b4b760e11b606082015260800190565b6000602082840312156142bb57600080fd5b5051919050565b600181811c908216806142d657607f821691505b6020821081036142f657634e487b7160e01b600052602260045260246000fd5b50919050565b601f82111561434257600081815260208120601f850160051c810160208610156143235750805b601f850160051c820191505b818110156123b55782815560010161432f565b505050565b81516001600160401b038111156143605761436061386a565b6143748161436e84546142c2565b846142fc565b602080601f8311600181146143a957600084156143915750858301515b600019600386901b1c1916600185901b1785556123b5565b600085815260208120601f198616915b828110156143d8578886015182559484019460019091019084016143b9565b50858210156143f65787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6060815260006144196060830186613814565b828103602084015261442b8186613814565b915050826040830152949350505050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60006001820161447a5761447a614452565b5060010190565b600061448f6138f6846138b0565b90508281528383830111156144a357600080fd5b6118a18360208301846137f0565b6000602082840312156144c357600080fd5b81516001600160401b038111156144d957600080fd5b8201601f810184136144ea57600080fd5b61129584825160208401614481565b8183823760009101908152919050565b81810381811115610b0057610b00614452565b65ffffffffffff82811682821603908082111561453b5761453b614452565b5092915050565b60006020828403121561455457600080fd5b81516118a181613df9565b6060815260006145726060830186613814565b6001600160a01b039490941660208301525060400152919050565b600082601f83011261459e57600080fd5b6118a183835160208501614481565b6000806000606084860312156145c257600080fd5b83516145cd81613c33565b60208501519093506001600160401b038111156145e957600080fd5b6145f58682870161458d565b925050604084015190509250925092565b805160208201516001600160d01b031980821692919060068310156146355780818460060360031b1b83161693505b505050919050565b805160208201516001600160e01b031980821692919060048310156146355760049290920360031b82901b161692915050565b65ffffffffffff81811683821601908082111561453b5761453b614452565b600081518084526020808501945080840160005b83811015613f705781516001600160a01b0316875295820195908201906001016146a3565b6000815180845260208085019450848260051b860182860160005b8581101561470d5783830389526146fb838351613814565b988501989250908401906001016146e3565b5090979650505050505050565b60808152600061472d608083018761468f565b828103602084015261473f8187613f40565b9050828103604084015261475381866146c8565b91505082606083015295945050505050565b6001600160a01b038516815260ff8416602082015260806040820181905260009061479290830185613814565b905082606083015295945050505050565b6000602082840312156147b557600080fd5b81516001600160401b038111156147cb57600080fd5b6112958482850161458d565b838152606081016147eb6020830185613bd7565b826040830152949350505050565b6000825161480b8184602087016137f0565b9190910192915050565b80820180821115610b0057610b00614452565b60ff8181168382160190811115610b0057610b00614452565b600181815b8085111561487c57816000190482111561486257614862614452565b8085161561486f57918102915b93841c9390800290614846565b509250929050565b60008261489357506001610b00565b816148a057506000610b00565b81600181146148b657600281146148c0576148dc565b6001915050610b00565b60ff8411156148d1576148d1614452565b50506001821b610b00565b5060208310610133831016604e8410600b84101617156148ff575081810a610b00565b6149098383614841565b806000190482111561491d5761491d614452565b029392505050565b60006118a160ff841683614884565b84815260ff841660208201528260408201526080606082015260006111a86080830184613814565b85815260ff8516602082015283604082015260a06060820152600061498460a0830185613814565b82810360808401526149968185613814565b98975050505050505050565b60006101208b8352602060018060a01b038c16818501528160408501526149cb8285018c61468f565b915083820360608501526149df828b613f40565b915083820360808501528189518084528284019150828160051b850101838c0160005b83811015614a3057601f19878403018552614a1e838351613814565b94860194925090850190600101614a02565b505086810360a0880152614a44818c6146c8565b9450505050508560c08401528460e0840152828103610100840152614a698185613814565b9c9b505050505050505050505050565b8082028115828204841417610b0057610b00614452565b634e487b7160e01b600052601260045260246000fd5b600082614ac357634e487b7160e01b600052601260045260246000fd5b500490565b82815260406020820152600061189e604083018461381456fe80c51ad8a7db1a7a86cc355b77bd5cd7ea08f6071ea91d85a8f792734700a0eca26469706673582212205c5a83ff074db246f409ffc8bc5a5c810ce8a95783beb88564ba8a597a7cef8c64736f6c63430008140033", + "deployedBytecode": "0x6080604052600436106102e85760003560e01c80637ecebe0011610190578063c01f9e37116100dc578063e2f3dce011610095578063ece40cc11161006f578063ece40cc114610a15578063f23a6e6114610a35578063f8ce560a14610a61578063fc0c546a14610a8157600080fd5b8063e2f3dce0146109c0578063e540d01d146109d5578063eb9019d4146109f557600080fd5b8063c01f9e37146108d3578063c28bc2fa146108f3578063c59057e414610906578063cc31491c14610926578063dd4e2ba514610946578063deaaa7cc1461098c57600080fd5b80639fa92f9d11610149578063ab58fb8e11610123578063ab58fb8e1461083a578063b47a321814610872578063b58131b014610892578063bc197c81146108a757600080fd5b80639fa92f9d146107d0578063a7713a7014610804578063a9a952941461081957600080fd5b80637ecebe00146106f257806384b0196e146107285780638ff262e31461075057806391ddadf41461077057806397c3d3341461079c5780639a802a6d146107b057600080fd5b80633e4f49e61161024f578063567813881161020857806360c4247f116101e257806360c4247f1461067257806379051887146106925780637b3c71d3146106b25780637d5e81e2146106d257600080fd5b806356781388146106125780635b8d0e0d146106325780635f398a141461065257600080fd5b80633e4f49e6146104e75780634385963214610514578063452115d61461055e5780634bf5d7e91461057e578063544ffc9c1461059357806354fd4d50146105e857600080fd5b8063160cbed7116102a1578063160cbed71461042b5780631985ba761461044b5780632656227d1461046b5780632d63f6931461047e5780632fe3e2611461049e5780633932abb1146104d257600080fd5b806301ffc9a7146102f657806302a251a31461032b57806306f3f9e61461035757806306fdde0314610377578063143489d014610399578063150b7a02146103e757600080fd5b366102f157005b005b600080fd5b34801561030257600080fd5b506103166103113660046137ad565b610ab4565b60405190151581526020015b60405180910390f35b34801561033757600080fd5b50600854600160301b900463ffffffff165b604051908152602001610322565b34801561036357600080fd5b506102ef6103723660046137d7565b610b0b565b34801561038357600080fd5b5061038c610c2a565b6040516103229190613840565b3480156103a557600080fd5b506103cf6103b43660046137d7565b6000908152600460205260409020546001600160a01b031690565b6040516001600160a01b039091168152602001610322565b3480156103f357600080fd5b5061041261040236600461392d565b630a85bd0160e11b949350505050565b6040516001600160e01b03199091168152602001610322565b34801561043757600080fd5b50610349610446366004613afe565b610cbc565b34801561045757600080fd5b506102ef610466366004613b8d565b610cfc565b610349610479366004613afe565b610ea2565b34801561048a57600080fd5b506103496104993660046137d7565b610fd5565b3480156104aa57600080fd5b506103497f3e83946653575f9a39005e1545185629e92736b7528ab20ca3816f315424a81181565b3480156104de57600080fd5b50610349610ff6565b3480156104f357600080fd5b506105076105023660046137d7565b611009565b6040516103229190613bf9565b34801561052057600080fd5b5061031661052f366004613c07565b60008281526009602090815260408083206001600160a01b038516845260030190915290205460ff1692915050565b34801561056a57600080fd5b50610349610579366004613afe565b611143565b34801561058a57600080fd5b5061038c6111b2565b34801561059f57600080fd5b506105cd6105ae3660046137d7565b6000908152600960205260409020805460018201546002909201549092565b60408051938452602084019290925290820152606001610322565b3480156105f457600080fd5b506040805180820190915260018152603160f81b602082015261038c565b34801561061e57600080fd5b5061034961062d366004613c42565b611274565b34801561063e57600080fd5b5061034961064d366004613cba565b61129d565b34801561065e57600080fd5b5061034961066d366004613d74565b6113fc565b34801561067e57600080fd5b5061034961068d3660046137d7565b611451565b34801561069e57600080fd5b506102ef6106ad366004613e0d565b6114df565b3480156106be57600080fd5b506103496106cd366004613e2a565b6115f0565b3480156106de57600080fd5b506103496106ed366004613e85565b611638565b3480156106fe57600080fd5b5061034961070d366004613f25565b6001600160a01b031660009081526002602052604090205490565b34801561073457600080fd5b5061073d6116f1565b6040516103229796959493929190613f7b565b34801561075c57600080fd5b5061034961076b366004613feb565b611737565b34801561077c57600080fd5b50610785611809565b60405165ffffffffffff9091168152602001610322565b3480156107a857600080fd5b506064610349565b3480156107bc57600080fd5b506103496107cb36600461403c565b611891565b3480156107dc57600080fd5b506103497f000000000000000000000000000000000000000000000000000000000000000081565b34801561081057600080fd5b506103496118a8565b34801561082557600080fd5b506103166108343660046137d7565b50600090565b34801561084657600080fd5b506103496108553660046137d7565b60009081526004602052604090206001015465ffffffffffff1690565b34801561087e57600080fd5b506102ef61088d366004613b8d565b6118c2565b34801561089e57600080fd5b50610349611c0e565b3480156108b357600080fd5b506104126108c2366004614092565b63bc197c8160e01b95945050505050565b3480156108df57600080fd5b506103496108ee3660046137d7565b611c19565b6102ef610901366004614121565b611c5c565b34801561091257600080fd5b50610349610921366004613afe565b611cdc565b34801561093257600080fd5b5061038c610941366004614162565b611d16565b34801561095257600080fd5b506040805180820190915260208082527f737570706f72743d627261766f2671756f72756d3d666f722c6162737461696e9082015261038c565b34801561099857600080fd5b506103497ff2aad550cf55f045cb27e9c559f9889fdfb6e6cdaa032301d6ea397784ae51d781565b3480156109cc57600080fd5b5061038c611e98565b3480156109e157600080fd5b506102ef6109f03660046141b1565b611f26565b348015610a0157600080fd5b50610349610a103660046141d7565b612044565b348015610a2157600080fd5b506102ef610a303660046137d7565b612065565b348015610a4157600080fd5b50610412610a50366004614201565b63f23a6e6160e01b95945050505050565b348015610a6d57600080fd5b50610349610a7c3660046137d7565b612148565b348015610a8d57600080fd5b507f00000000000000000000000000000000000000000000000000000000000000006103cf565b60006001600160e01b031982166332a2ad4360e11b1480610ae557506001600160e01b03198216630271189760e51b145b80610b0057506301ffc9a760e01b6001600160e01b03198316145b92915050565b905090565b610b13612153565b7f00000000000000000000000000000000000000000000000000000000000000004614610b5b5760405162461bcd60e51b8152600401610b5290614265565b60405180910390fd5b604051633b0d4dd760e01b8152600c600482810191909152602482015260009073__$b1c1335e68417b4234016f4aa58fdfac77$__90633b0d4dd790604401602060405180830381865af4158015610bb7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bdb91906142a9565b90506000610be76118a8565b9050610bf28361218b565b60045b6040805183815260208101869052908101849052600080516020614ae2833981519152906060015b60405180910390a2505050565b606060038054610c39906142c2565b80601f0160208091040260200160405190810160405280929190818152602001828054610c65906142c2565b8015610cb25780601f10610c8757610100808354040283529160200191610cb2565b820191906000526020600020905b815481529060010190602001808311610c9557829003601f168201915b5050505050905090565b600080610ccb86868686611cdc565b9050610ce081610cdb6004612219565b61223c565b506000604051634844252360e11b815260040160405180910390fd5b610d04612153565b7f00000000000000000000000000000000000000000000000000000000000000004614610d435760405162461bcd60e51b8152600401610b5290614265565b604051633b0d4dd760e01b8152600c60048201526000602482018190529073__$b1c1335e68417b4234016f4aa58fdfac77$__90633b0d4dd790604401602060405180830381865af4158015610d9d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dc191906142a9565b90506000600b8054610dd2906142c2565b80601f0160208091040260200160405190810160405280929190818152602001828054610dfe906142c2565b8015610e4b5780601f10610e2057610100808354040283529160200191610e4b565b820191906000526020600020905b815481529060010190602001808311610e2e57829003601f168201915b5050505050905082600b9081610e619190614347565b507f67c6aa39e9b4a701119ddc2f40a18145fff9b6f4fa224d5f29c28755f719ffb2818484604051610e9593929190614406565b60405180910390a1505050565b600080610eb186868686611cdc565b9050610ed181610ec16005612219565b610ecb6004612219565b1761223c565b506000818152600460205260409020805460ff60f01b1916600160f01b17905530610ef93090565b6001600160a01b031614610f8b5760005b8651811015610f8957306001600160a01b0316878281518110610f2f57610f2f61443c565b60200260200101516001600160a01b031603610f7957610f79858281518110610f5a57610f5a61443c565b602002602001015180519060200120600561227b90919063ffffffff16565b610f8281614468565b9050610f0a565b505b610f9881878787876122dd565b6040518181527f712ae1383f79ac853f8d882153778e0260ef8f03b504e2866e0593e04d2b291f906020015b60405180910390a195945050505050565b600090815260046020526040902054600160a01b900465ffffffffffff1690565b6000610b0660085465ffffffffffff1690565b6000818152600460205260408120805460ff600160f01b8204811691600160f81b900416811561103e57506007949350505050565b801561104f57506002949350505050565b600061105a86610fd5565b90508060000361108057604051636ad0607560e01b815260048101879052602401610b52565b600061108a611809565b65ffffffffffff1690508082106110a8575060009695505050505050565b60006110b388611c19565b90508181106110ca57506001979650505050505050565b6110d3886123bd565b15806110f357506000888152600960205260409020805460019091015411155b1561110657506003979650505050505050565b60008881526004602052604090206001015465ffffffffffff1660000361113557506004979650505050505050565b506005979650505050505050565b60008061115286868686611cdc565b905061116281610cdb6000612219565b506000818152600460205260409020546001600160a01b0316331461119c5760405163233d98e360e01b8152336004820152602401610b52565b6111a8868686866123f4565b9695505050505050565b60607f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316634bf5d7e96040518163ffffffff1660e01b8152600401600060405180830381865afa92505050801561123357506040513d6000823e601f3d908101601f1916820160405261123091908101906144b1565b60015b61126f575060408051808201909152601d81527f6d6f64653d626c6f636b6e756d6265722666726f6d3d64656661756c74000000602082015290565b919050565b600080339050611295848285604051806020016040528060008152506124a5565b949350505050565b6000806113808761137a7f3e83946653575f9a39005e1545185629e92736b7528ab20ca3816f315424a8118c8c8c6112f28e6001600160a01b0316600090815260026020526040902080546001810190915590565b8d8d6040516113029291906144f9565b60405180910390208c8051906020012060405160200161135f9796959493929190968752602087019590955260ff9390931660408601526001600160a01b03919091166060850152608084015260a083015260c082015260e00190565b604051602081830303815290604052805190602001206124d1565b856124fe565b9050806113ab576040516394ab6c0760e01b81526001600160a01b0388166004820152602401610b52565b6113ef89888a89898080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508b9250612572915050565b9998505050505050505050565b60008033905061144687828888888080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508a9250612572915050565b979650505050505050565b600a80546000918290611465600184614509565b815481106114755761147561443c565b6000918252602090912001805490915065ffffffffffff811690600160301b90046001600160d01b03168582116114b8576001600160d01b031695945050505050565b6114cc6114c487612654565b600a9061268b565b6001600160d01b03169695505050505050565b6114e7612153565b7f000000000000000000000000000000000000000000000000000000000000000046146115265760405162461bcd60e51b8152600401610b5290614265565b604051633b0d4dd760e01b8152600c60048201526001602482015260009073__$b1c1335e68417b4234016f4aa58fdfac77$__90633b0d4dd790604401602060405180830381865af4158015611580573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115a491906142a9565b905060006115b0610ff6565b90506115bb83612740565b60016040805183815265ffffffffffff86166020820152908101849052600080516020614ae283398151915290606001610c1d565b6000803390506111a886828787878080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506124a592505050565b60003361164581846127a6565b61166d5760405163d9b3955760e01b81526001600160a01b0382166004820152602401610b52565b6000611677611c0e565b905080156116e45760006116a683600161168f611809565b611699919061451c565b65ffffffffffff16612044565b9050818110156116e257604051636121770b60e11b81526001600160a01b03841660048201526024810182905260448101839052606401610b52565b505b6114468787878786612897565b600060608060008060006060611705612ab7565b61170d612ae4565b60408051600080825260208201909252600f60f81b9b939a50919850469750309650945092509050565b6000806117c38461137a7ff2aad550cf55f045cb27e9c559f9889fdfb6e6cdaa032301d6ea397784ae51d789898961178c8b6001600160a01b0316600090815260026020526040902080546001810190915590565b60408051602081019690965285019390935260ff90911660608401526001600160a01b0316608083015260a082015260c00161135f565b9050806117ee576040516394ab6c0760e01b81526001600160a01b0385166004820152602401610b52565b6111a8868587604051806020016040528060008152506124a5565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166391ddadf46040518163ffffffff1660e01b8152600401602060405180830381865afa925050508015611885575060408051601f3d908101601f1916820190925261188291810190614542565b60015b61126f57610b06612b11565b600061189e848484612b1c565b90505b9392505050565b60006118b4600a612bb2565b6001600160d01b0316905090565b600080600073__$b1c1335e68417b4234016f4aa58fdfac77$__63c0af65918530600c6040518463ffffffff1660e01b81526004016119039392919061455f565b600060405180830381865af4158015611920573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261194891908101906145ad565b9194509250905060ff8316611a505760008280602001905181019061196d91906144b1565b90506000600b805461197e906142c2565b80601f01602080910402602001604051908101604052809291908181526020018280546119aa906142c2565b80156119f75780601f106119cc576101008083540402835291602001916119f7565b820191906000526020600020905b8154815290600101906020018083116119da57829003601f168201915b5050505050905081600b9081611a0d9190614347565b507f67c6aa39e9b4a701119ddc2f40a18145fff9b6f4fa224d5f29c28755f719ffb2818385604051611a4193929190614406565b60405180910390a15050611c08565b60001960ff841601611ac1576000611a6783614606565b60d01c90506000611a76610ff6565b9050611a8182612740565b60016040805183815265ffffffffffff85166020820152908101859052600080516020614ae2833981519152906060015b60405180910390a25050611c08565b60011960ff841601611b34576000611ad88361463d565b60e01c90506000611af660085463ffffffff600160301b9091041690565b9050611b0182612beb565b60026040805183815263ffffffff85166020820152908101859052600080516020614ae283398151915290606001611ab2565b60021960ff841601611b9b57600082806020019051810190611b5691906142a9565b90506000611b62611c0e565b9050611b6d82612c89565b60036040805183815260208101859052908101859052600080516020614ae283398151915290606001611ab2565b60031960ff841601611c0857600082806020019051810190611bbd91906142a9565b90506000611bc96118a8565b9050611bd48261218b565b60046040805183815260208101859052908101859052600080516020614ae28339815191529060600160405180910390a250505b50505050565b6000610b0660075490565b600081815260046020526040812054611c4e90600160d01b810463ffffffff1690600160a01b900465ffffffffffff16614670565b65ffffffffffff1692915050565b611c64612153565b600080856001600160a01b0316858585604051611c829291906144f9565b60006040518083038185875af1925050503d8060008114611cbf576040519150601f19603f3d011682016040523d82523d6000602084013e611cc4565b606091505b5091509150611cd38282612cca565b50505050505050565b600084848484604051602001611cf5949392919061471a565b60408051601f19818403018152919052805160209091012095945050505050565b60607f00000000000000000000000000000000000000000000000000000000000000004614611d935760405162461bcd60e51b815260206004820152602360248201527f50726f6f6673206f6e6c792067656e657261746564206f6e20686f6d6520636860448201526230b4b760e91b6064820152608401610b52565b604051630564edeb60e31b8152600c600482015260ff8416602482015260009073__$b1c1335e68417b4234016f4aa58fdfac77$__90632b276f5890604401602060405180830381865af4158015611def573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e1391906142a9565b604051637352178160e01b815290915073__$b1c1335e68417b4234016f4aa58fdfac77$__90637352178190611e53903090889088908790600401614765565b600060405180830381865af4158015611e70573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261129591908101906147a3565b600b8054611ea5906142c2565b80601f0160208091040260200160405190810160405280929190818152602001828054611ed1906142c2565b8015611f1e5780601f10611ef357610100808354040283529160200191611f1e565b820191906000526020600020905b815481529060010190602001808311611f0157829003601f168201915b505050505081565b611f2e612153565b7f00000000000000000000000000000000000000000000000000000000000000004614611f6d5760405162461bcd60e51b8152600401610b5290614265565b604051633b0d4dd760e01b8152600c60048201526002602482015260009073__$b1c1335e68417b4234016f4aa58fdfac77$__90633b0d4dd790604401602060405180830381865af4158015611fc7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611feb91906142a9565b9050600061200660085463ffffffff600160301b9091041690565b905061201183612beb565b60026040805183815263ffffffff86166020820152908101849052600080516020614ae283398151915290606001610c1d565b60006118a1838361206060408051602081019091526000815290565b612b1c565b61206d612153565b7f000000000000000000000000000000000000000000000000000000000000000046146120ac5760405162461bcd60e51b8152600401610b5290614265565b604051633b0d4dd760e01b8152600c60048201526003602482015260009073__$b1c1335e68417b4234016f4aa58fdfac77$__90633b0d4dd790604401602060405180830381865af4158015612106573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061212a91906142a9565b90506000612136611c0e565b905061214183612c89565b6003610bf5565b6000610b0082612ce6565b303314612175576040516347096e4760e01b8152336004820152602401610b52565b565b806121826005612d90565b03612177575b50565b6064808211156121b85760405163243e544560e01b81526004810183905260248101829052604401610b52565b60006121c26118a8565b90506121e16121cf611809565b6121d885612dff565b600a9190612e33565b505060408051828152602081018590527f0553476bf02ef2726e8ce5ced78d63e26e602e4a2257b1f559418e24b46339979101610e95565b600081600781111561222d5761222d613bc1565b600160ff919091161b92915050565b60008061224884611009565b905060008361225683612219565b16036118a1578381846040516331b75e4d60e01b8152600401610b52939291906147d7565b81546001600160801b03600160801b8204811691811660018301909116036122a7576122a76041612e4e565b6001600160801b03808216600090815260018086016020526040909120939093558354919092018216600160801b029116179055565b60005b84518110156123b5576000808683815181106122fe576122fe61443c565b60200260200101516001600160a01b03168684815181106123215761232161443c565b602002602001015186858151811061233b5761233b61443c565b602002602001015160405161235091906147f9565b60006040518083038185875af1925050503d806000811461238d576040519150601f19603f3d011682016040523d82523d6000602084013e612392565b606091505b50915091506123a18282612cca565b505050806123ae90614468565b90506122e0565b505050505050565b6000818152600960205260408120600281015460018201546123df9190614815565b6123eb610a7c85610fd5565b11159392505050565b60008061240386868686611cdc565b9050612451816124136007612219565b61241d6006612219565b6124276002612219565b6001612434600782614828565b61243f906002614925565b6124499190614509565b18181861223c565b506000818152600460205260409081902080546001600160f81b0316600160f81b179055517f789cf55be980739dad1d0699b93b58e806b51c9d96619bfa8fe0a28abaa7b30c90610fc49083815260200190565b60006124c8858585856124c360408051602081019091526000815290565b612572565b95945050505050565b6000610b006124de612e60565b8360405161190160f01b8152600281019290925260228201526042902090565b6000836001600160a01b03163b6000036125605760008061251f8585612f8b565b509092509050600081600381111561253957612539613bc1565b1480156125575750856001600160a01b0316826001600160a01b0316145b925050506118a1565b61256b848484612fd8565b90506118a1565b600061258286610cdb6001612219565b5060006125988661259289610fd5565b85612b1c565b905060006125a988888885886130b3565b9050835160000361260057866001600160a01b03167fb8e138887d0aa13bab447e82de9d5c1777041ecd21ca36ba824ff1e6c07ddda4898884896040516125f39493929190614934565b60405180910390a2611446565b866001600160a01b03167fe2babfbac5889a709b63bb7f598b324e08bc5a4fb9ec647fb3cbc9ec07eb8712898884898960405161264195949392919061495c565b60405180910390a2979650505050505050565b600065ffffffffffff821115612687576040516306dfcc6560e41b81526030600482015260248101839052604401610b52565b5090565b8154600090818160058111156126ea5760006126a6846131b6565b6126b09085614509565b60008881526020902090915081015465ffffffffffff90811690871610156126da578091506126e8565b6126e5816001614815565b92505b505b60006126f88787858561330f565b905080156127335761271d8761270f600184614509565b600091825260209091200190565b54600160301b90046001600160d01b0316611446565b6000979650505050505050565b6008546040805165ffffffffffff928316815291831660208301527fc565b045403dc03c2eea82b81a0465edad9e2e7fc4d97e11421c209da93d7a93910160405180910390a16008805465ffffffffffff191665ffffffffffff92909216919091179055565b805160009060348110156127be576001915050610b00565b82810160131901516001600160a01b031981166b046e0e4dee0dee6cae47a60f60a31b146127f157600192505050610b00565b6000806127ff602885614509565b90505b83811015612876576000806128368884815181106128225761282261443c565b01602001516001600160f81b031916613371565b915091508161284e5760019650505050505050610b00565b8060ff166004856001600160a01b0316901b17935050508061286f90614468565b9050612802565b50856001600160a01b0316816001600160a01b031614935050505092915050565b60006128ac8686868680519060200120611cdc565b9050845186511415806128c157508351865114155b806128cb57508551155b1561290057855184518651604051630447b05d60e41b8152600481019390935260248301919091526044820152606401610b52565b600081815260046020526040902054600160a01b900465ffffffffffff161561294b578061292d82611009565b6040516331b75e4d60e01b8152610b529291906000906004016147d7565b6000612955610ff6565b61295d611809565b65ffffffffffff1661296f9190614815565b9050600061298a60085463ffffffff600160301b9091041690565b600084815260046020526040902080546001600160a01b0319166001600160a01b0387161781559091506129bd83612654565b815465ffffffffffff91909116600160a01b0265ffffffffffff60a01b199091161781556129ea82613403565b815463ffffffff91909116600160d01b0263ffffffff60d01b1990911617815588517f7d84a6263ae0d98d3329bd7b46bb4e8d6f98cd35a7adb45c274c8b7fd5ebd5e090859087908c908c906001600160401b03811115612a4d57612a4d61386a565b604051908082528060200260200182016040528015612a8057816020015b6060815260200190600190039081612a6b5790505b508c89612a8d8a82614815565b8e604051612aa3999897969594939291906149a2565b60405180910390a150505095945050505050565b6060610b067f00000000000000000000000000000000000000000000000000000000000000006000613434565b6060610b067f00000000000000000000000000000000000000000000000000000000000000006001613434565b6000610b0643612654565b60007f0000000000000000000000000000000000000000000000000000000000000000604051630748d63560e31b81526001600160a01b038681166004830152602482018690529190911690633a46b1a890604401602060405180830381865afa158015612b8e573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061189e91906142a9565b80546000908015612be257612bcc8361270f600184614509565b54600160301b90046001600160d01b03166118a1565b60009392505050565b8063ffffffff16600003612c155760405163f1cfbf0560e01b815260006004820152602401610b52565b6008546040805163ffffffff600160301b9093048316815291831660208301527f7e3f7f0708a84de9203036abaa450dccc85ad5ff52f78c170f3edb55cf5e8828910160405180910390a16008805463ffffffff909216600160301b0269ffffffff00000000000019909216919091179055565b60075460408051918252602082018390527fccb45da8d5717e6c4544694297c4ba5cf151d455c9bb0ed4fc7a38411bc05461910160405180910390a1600755565b606082612cdf57612cda826134df565b610b00565b5080610b00565b60006064612cf383611451565b604051632394e7a360e21b8152600481018590526001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001690638e539e8c90602401602060405180830381865afa158015612d58573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612d7c91906142a9565b612d869190614a79565b610b009190614aa6565b80546000906001600160801b0380821691600160801b9004168103612db957612db96031612e4e565b6001600160801b038181166000908152600185810160205260408220805492905585546fffffffffffffffffffffffffffffffff19169301909116919091179092555090565b60006001600160d01b03821115612687576040516306dfcc6560e41b815260d0600482015260248101839052604401610b52565b600080612e41858585613508565b915091505b935093915050565b634e487b71600052806020526024601cfd5b6000306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016148015612eb957507f000000000000000000000000000000000000000000000000000000000000000046145b15612ee357507f000000000000000000000000000000000000000000000000000000000000000090565b610b06604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f60208201527f0000000000000000000000000000000000000000000000000000000000000000918101919091527f000000000000000000000000000000000000000000000000000000000000000060608201524660808201523060a082015260009060c00160405160208183030381529060405280519060200120905090565b60008060008351604103612fc55760208401516040850151606086015160001a612fb78882858561365c565b955095509550505050612fd1565b50508151600091506002905b9250925092565b6000806000856001600160a01b03168585604051602401612ffa929190614ac8565b60408051601f198184030181529181526020820180516001600160e01b0316630b135d3f60e11b1790525161302f91906147f9565b600060405180830381855afa9150503d806000811461306a576040519150601f19603f3d011682016040523d82523d6000602084013e61306f565b606091505b509150915081801561308357506020815110155b80156111a857508051630b135d3f60e11b906130a890830160209081019084016142a9565b149695505050505050565b60008581526009602090815260408083206001600160a01b03881684526003810190925282205460ff1615613106576040516371c6af4960e01b81526001600160a01b0387166004820152602401610b52565b6001600160a01b03861660009081526003820160205260409020805460ff1916600117905560ff851661315257838160000160008282546131479190614815565b909155506131ab9050565b60001960ff86160161317257838160010160008282546131479190614815565b60011960ff86160161319257838160020160008282546131479190614815565b6040516303599be160e11b815260040160405180910390fd5b509195945050505050565b6000600182116131c4575090565b816001600160801b82106131dd5760809190911c9060401b5b6801000000000000000082106131f85760409190911c9060201b5b640100000000821061320f5760209190911c9060101b5b6201000082106132245760109190911c9060081b5b61010082106132385760089190911c9060041b5b6010821061324b5760049190911c9060021b5b600482106132575760011b5b600302600190811c9081858161326f5761326f614a90565b048201901c9050600181858161328757613287614a90565b048201901c9050600181858161329f5761329f614a90565b048201901c905060018185816132b7576132b7614a90565b048201901c905060018185816132cf576132cf614a90565b048201901c905060018185816132e7576132e7614a90565b048201901c905061330681858161330057613300614a90565b04821190565b90039392505050565b60005b81831015613369576000613326848461372b565b60008781526020902090915065ffffffffffff86169082015465ffffffffffff16111561335557809250613363565b613360816001614815565b93505b50613312565b509392505050565b60008060f883901c602f8111801561338c5750603a8160ff16105b156133a157600194602f199091019350915050565b8060ff1660401080156133b7575060478160ff16105b156133cc576001946036199091019350915050565b8060ff1660601080156133e2575060678160ff16105b156133f7576001946056199091019350915050565b50600093849350915050565b600063ffffffff821115612687576040516306dfcc6560e41b81526020600482015260248101839052604401610b52565b606060ff831461344e5761344783613746565b9050610b00565b81805461345a906142c2565b80601f0160208091040260200160405190810160405280929190818152602001828054613486906142c2565b80156134d35780601f106134a8576101008083540402835291602001916134d3565b820191906000526020600020905b8154815290600101906020018083116134b657829003601f168201915b50505050509050610b00565b8051156134ef5780518082602001fd5b60405163d6bda27560e01b815260040160405180910390fd5b8254600090819080156136015760006135268761270f600185614509565b805490915065ffffffffffff80821691600160301b90046001600160d01b031690881682111561356957604051632520601d60e01b815260040160405180910390fd5b8765ffffffffffff168265ffffffffffff16036135a257825465ffffffffffff16600160301b6001600160d01b038916021783556135f3565b6040805180820190915265ffffffffffff808a1682526001600160d01b03808a1660208085019182528d54600181018f5560008f81529190912094519151909216600160301b029216919091179101555b9450859350612e4692505050565b50506040805180820190915265ffffffffffff80851682526001600160d01b0380851660208085019182528854600181018a5560008a815291822095519251909316600160301b029190931617920191909155905081612e46565b600080807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08411156136975750600091506003905082613721565b604080516000808252602082018084528a905260ff891692820192909252606081018790526080810186905260019060a0016020604051602081039080840390855afa1580156136eb573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b03811661371757506000925060019150829050613721565b9250600091508190505b9450945094915050565b600061373a6002848418614aa6565b6118a190848416614815565b6060600061375383613785565b604080516020808252818301909252919250600091906020820181803683375050509182525060208101929092525090565b600060ff8216601f811115610b0057604051632cd44ac360e21b815260040160405180910390fd5b6000602082840312156137bf57600080fd5b81356001600160e01b0319811681146118a157600080fd5b6000602082840312156137e957600080fd5b5035919050565b60005b8381101561380b5781810151838201526020016137f3565b50506000910152565b6000815180845261382c8160208601602086016137f0565b601f01601f19169290920160200192915050565b6020815260006118a16020830184613814565b80356001600160a01b038116811461126f57600080fd5b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b03811182821017156138a8576138a861386a565b604052919050565b60006001600160401b038211156138c9576138c961386a565b50601f01601f191660200190565b600082601f8301126138e857600080fd5b81356138fb6138f6826138b0565b613880565b81815284602083860101111561391057600080fd5b816020850160208301376000918101602001919091529392505050565b6000806000806080858703121561394357600080fd5b61394c85613853565b935061395a60208601613853565b92506040850135915060608501356001600160401b0381111561397c57600080fd5b613988878288016138d7565b91505092959194509250565b60006001600160401b038211156139ad576139ad61386a565b5060051b60200190565b600082601f8301126139c857600080fd5b813560206139d86138f683613994565b82815260059290921b840181019181810190868411156139f757600080fd5b8286015b84811015613a1957613a0c81613853565b83529183019183016139fb565b509695505050505050565b600082601f830112613a3557600080fd5b81356020613a456138f683613994565b82815260059290921b84018101918181019086841115613a6457600080fd5b8286015b84811015613a195780358352918301918301613a68565b600082601f830112613a9057600080fd5b81356020613aa06138f683613994565b82815260059290921b84018101918181019086841115613abf57600080fd5b8286015b84811015613a195780356001600160401b03811115613ae25760008081fd5b613af08986838b01016138d7565b845250918301918301613ac3565b60008060008060808587031215613b1457600080fd5b84356001600160401b0380821115613b2b57600080fd5b613b37888389016139b7565b95506020870135915080821115613b4d57600080fd5b613b5988838901613a24565b94506040870135915080821115613b6f57600080fd5b50613b7c87828801613a7f565b949793965093946060013593505050565b600060208284031215613b9f57600080fd5b81356001600160401b03811115613bb557600080fd5b611295848285016138d7565b634e487b7160e01b600052602160045260246000fd5b60088110613bf557634e487b7160e01b600052602160045260246000fd5b9052565b60208101610b008284613bd7565b60008060408385031215613c1a57600080fd5b82359150613c2a60208401613853565b90509250929050565b60ff8116811461218857600080fd5b60008060408385031215613c5557600080fd5b823591506020830135613c6781613c33565b809150509250929050565b60008083601f840112613c8457600080fd5b5081356001600160401b03811115613c9b57600080fd5b602083019150836020828501011115613cb357600080fd5b9250929050565b600080600080600080600060c0888a031215613cd557600080fd5b873596506020880135613ce781613c33565b9550613cf560408901613853565b945060608801356001600160401b0380821115613d1157600080fd5b613d1d8b838c01613c72565b909650945060808a0135915080821115613d3657600080fd5b613d428b838c016138d7565b935060a08a0135915080821115613d5857600080fd5b50613d658a828b016138d7565b91505092959891949750929550565b600080600080600060808688031215613d8c57600080fd5b853594506020860135613d9e81613c33565b935060408601356001600160401b0380821115613dba57600080fd5b613dc689838a01613c72565b90955093506060880135915080821115613ddf57600080fd5b50613dec888289016138d7565b9150509295509295909350565b65ffffffffffff8116811461218857600080fd5b600060208284031215613e1f57600080fd5b81356118a181613df9565b60008060008060608587031215613e4057600080fd5b843593506020850135613e5281613c33565b925060408501356001600160401b03811115613e6d57600080fd5b613e7987828801613c72565b95989497509550505050565b60008060008060808587031215613e9b57600080fd5b84356001600160401b0380821115613eb257600080fd5b613ebe888389016139b7565b95506020870135915080821115613ed457600080fd5b613ee088838901613a24565b94506040870135915080821115613ef657600080fd5b613f0288838901613a7f565b93506060870135915080821115613f1857600080fd5b50613988878288016138d7565b600060208284031215613f3757600080fd5b6118a182613853565b600081518084526020808501945080840160005b83811015613f7057815187529582019590820190600101613f54565b509495945050505050565b60ff60f81b8816815260e060208201526000613f9a60e0830189613814565b8281036040840152613fac8189613814565b606084018890526001600160a01b038716608085015260a0840186905283810360c08501529050613fdd8185613f40565b9a9950505050505050505050565b6000806000806080858703121561400157600080fd5b84359350602085013561401381613c33565b925061402160408601613853565b915060608501356001600160401b0381111561397c57600080fd5b60008060006060848603121561405157600080fd5b61405a84613853565b92506020840135915060408401356001600160401b0381111561407c57600080fd5b614088868287016138d7565b9150509250925092565b600080600080600060a086880312156140aa57600080fd5b6140b386613853565b94506140c160208701613853565b935060408601356001600160401b03808211156140dd57600080fd5b6140e989838a01613a24565b945060608801359150808211156140ff57600080fd5b61410b89838a01613a24565b93506080880135915080821115613ddf57600080fd5b6000806000806060858703121561413757600080fd5b61414085613853565b93506020850135925060408501356001600160401b03811115613e6d57600080fd5b6000806040838503121561417557600080fd5b823561418081613c33565b915060208301356001600160401b0381111561419b57600080fd5b6141a7858286016138d7565b9150509250929050565b6000602082840312156141c357600080fd5b813563ffffffff811681146118a157600080fd5b600080604083850312156141ea57600080fd5b6141f383613853565b946020939093013593505050565b600080600080600060a0868803121561421957600080fd5b61422286613853565b945061423060208701613853565b9350604086013592506060860135915060808601356001600160401b0381111561425957600080fd5b613dec888289016138d7565b60208082526024908201527f4f7065726174696f6e206f6e6c7920616c6c6f776564206f6e20686f6d6520636040820152633430b4b760e11b606082015260800190565b6000602082840312156142bb57600080fd5b5051919050565b600181811c908216806142d657607f821691505b6020821081036142f657634e487b7160e01b600052602260045260246000fd5b50919050565b601f82111561434257600081815260208120601f850160051c810160208610156143235750805b601f850160051c820191505b818110156123b55782815560010161432f565b505050565b81516001600160401b038111156143605761436061386a565b6143748161436e84546142c2565b846142fc565b602080601f8311600181146143a957600084156143915750858301515b600019600386901b1c1916600185901b1785556123b5565b600085815260208120601f198616915b828110156143d8578886015182559484019460019091019084016143b9565b50858210156143f65787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6060815260006144196060830186613814565b828103602084015261442b8186613814565b915050826040830152949350505050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60006001820161447a5761447a614452565b5060010190565b600061448f6138f6846138b0565b90508281528383830111156144a357600080fd5b6118a18360208301846137f0565b6000602082840312156144c357600080fd5b81516001600160401b038111156144d957600080fd5b8201601f810184136144ea57600080fd5b61129584825160208401614481565b8183823760009101908152919050565b81810381811115610b0057610b00614452565b65ffffffffffff82811682821603908082111561453b5761453b614452565b5092915050565b60006020828403121561455457600080fd5b81516118a181613df9565b6060815260006145726060830186613814565b6001600160a01b039490941660208301525060400152919050565b600082601f83011261459e57600080fd5b6118a183835160208501614481565b6000806000606084860312156145c257600080fd5b83516145cd81613c33565b60208501519093506001600160401b038111156145e957600080fd5b6145f58682870161458d565b925050604084015190509250925092565b805160208201516001600160d01b031980821692919060068310156146355780818460060360031b1b83161693505b505050919050565b805160208201516001600160e01b031980821692919060048310156146355760049290920360031b82901b161692915050565b65ffffffffffff81811683821601908082111561453b5761453b614452565b600081518084526020808501945080840160005b83811015613f705781516001600160a01b0316875295820195908201906001016146a3565b6000815180845260208085019450848260051b860182860160005b8581101561470d5783830389526146fb838351613814565b988501989250908401906001016146e3565b5090979650505050505050565b60808152600061472d608083018761468f565b828103602084015261473f8187613f40565b9050828103604084015261475381866146c8565b91505082606083015295945050505050565b6001600160a01b038516815260ff8416602082015260806040820181905260009061479290830185613814565b905082606083015295945050505050565b6000602082840312156147b557600080fd5b81516001600160401b038111156147cb57600080fd5b6112958482850161458d565b838152606081016147eb6020830185613bd7565b826040830152949350505050565b6000825161480b8184602087016137f0565b9190910192915050565b80820180821115610b0057610b00614452565b60ff8181168382160190811115610b0057610b00614452565b600181815b8085111561487c57816000190482111561486257614862614452565b8085161561486f57918102915b93841c9390800290614846565b509250929050565b60008261489357506001610b00565b816148a057506000610b00565b81600181146148b657600281146148c0576148dc565b6001915050610b00565b60ff8411156148d1576148d1614452565b50506001821b610b00565b5060208310610133831016604e8410600b84101617156148ff575081810a610b00565b6149098383614841565b806000190482111561491d5761491d614452565b029392505050565b60006118a160ff841683614884565b84815260ff841660208201528260408201526080606082015260006111a86080830184613814565b85815260ff8516602082015283604082015260a06060820152600061498460a0830185613814565b82810360808401526149968185613814565b98975050505050505050565b60006101208b8352602060018060a01b038c16818501528160408501526149cb8285018c61468f565b915083820360608501526149df828b613f40565b915083820360808501528189518084528284019150828160051b850101838c0160005b83811015614a3057601f19878403018552614a1e838351613814565b94860194925090850190600101614a02565b505086810360a0880152614a44818c6146c8565b9450505050508560c08401528460e0840152828103610100840152614a698185613814565b9c9b505050505050505050505050565b8082028115828204841417610b0057610b00614452565b634e487b7160e01b600052601260045260246000fd5b600082614ac357634e487b7160e01b600052601260045260246000fd5b500490565b82815260406020820152600061189e604083018461381456fe80c51ad8a7db1a7a86cc355b77bd5cd7ea08f6071ea91d85a8f792734700a0eca26469706673582212205c5a83ff074db246f409ffc8bc5a5c810ce8a95783beb88564ba8a597a7cef8c64736f6c63430008140033", + "libraries": { + "ProofHandler": "0x0152ee45780385dACCCCB128D816031CfFe5F36B" + }, + "devdoc": { + "author": "Web3 Hackers Collective", + "custom:security-contact": "julien@strat.cc", + "details": "Extends OpenZeppelin's Governor contract with cross-chain parameter updates", + "errors": { + "CheckpointUnorderedInsertion()": [ + { + "details": "A value was attempted to be inserted on a past checkpoint." + } + ], + "FailedCall()": [ + { + "details": "A call to an address target failed. The target may have reverted." + } + ], + "GovernorAlreadyCastVote(address)": [ + { + "details": "The vote was already cast." + } + ], + "GovernorAlreadyQueuedProposal(uint256)": [ + { + "details": "The proposal has already been queued." + } + ], + "GovernorDisabledDeposit()": [ + { + "details": "Token deposits are disabled in this contract." + } + ], + "GovernorInsufficientProposerVotes(address,uint256,uint256)": [ + { + "details": "The `proposer` does not have the required votes to create a proposal." + } + ], + "GovernorInvalidProposalLength(uint256,uint256,uint256)": [ + { + "details": "Empty proposal or a mismatch between the parameters length for a proposal call." + } + ], + "GovernorInvalidQuorumFraction(uint256,uint256)": [ + { + "details": "The quorum set is not a valid fraction." + } + ], + "GovernorInvalidSignature(address)": [ + { + "details": "The provided signature is not valid for the expected `voter`. If the `voter` is a contract, the signature is not valid using {IERC1271-isValidSignature}." + } + ], + "GovernorInvalidVoteParams()": [ + { + "details": "The provided params buffer is not supported by the counting module." + } + ], + "GovernorInvalidVoteType()": [ + { + "details": "The vote type used is not valid for the corresponding counting module." + } + ], + "GovernorInvalidVotingPeriod(uint256)": [ + { + "details": "The voting period set is not a valid period." + } + ], + "GovernorNonexistentProposal(uint256)": [ + { + "details": "The `proposalId` doesn't exist." + } + ], + "GovernorNotQueuedProposal(uint256)": [ + { + "details": "The proposal hasn't been queued yet." + } + ], + "GovernorOnlyExecutor(address)": [ + { + "details": "The `account` is not the governance executor." + } + ], + "GovernorOnlyProposer(address)": [ + { + "details": "The `account` is not a proposer." + } + ], + "GovernorQueueNotImplemented()": [ + { + "details": "Queue operation is not implemented for this governor. Execute should be called directly." + } + ], + "GovernorRestrictedProposer(address)": [ + { + "details": "The `proposer` is not allowed to create a proposal." + } + ], + "GovernorUnexpectedProposalState(uint256,uint8,bytes32)": [ + { + "details": "The current state of a proposal is not the required for performing an operation. The `expectedStates` is a bitmap with the bits enabled for each ProposalState enum position counting from right to left. NOTE: If `expectedState` is `bytes32(0)`, the proposal is expected to not be in any state (i.e. not exist). This is the case when a proposal that is expected to be unset is already initiated (the proposal is duplicated). See {Governor-_encodeStateBitmap}." + } + ], + "InvalidAccountNonce(address,uint256)": [ + { + "details": "The nonce used for an `account` is not the expected current nonce." + } + ], + "SafeCastOverflowedUintDowncast(uint8,uint256)": [ + { + "details": "Value doesn't fit in an uint of `bits` size." + } + ] + }, + "events": { + "EIP712DomainChanged()": { + "details": "MAY be emitted to signal that the domain could have changed." + }, + "GovernanceParameterUpdated(uint8,uint256,uint256,uint256)": { + "params": { + "newValue": "New value", + "nonce": "Update sequence number", + "oldValue": "Previous value", + "operationType": "Type of parameter updated" + } + }, + "ManifestoUpdated(string,string,uint256)": { + "params": { + "newManifesto": "New manifesto CID", + "nonce": "Update sequence number", + "oldManifesto": "Previous manifesto CID" + } + }, + "ProposalCanceled(uint256)": { + "details": "Emitted when a proposal is canceled." + }, + "ProposalCreated(uint256,address,address[],uint256[],string[],bytes[],uint256,uint256,string)": { + "details": "Emitted when a proposal is created." + }, + "ProposalExecuted(uint256)": { + "details": "Emitted when a proposal is executed." + }, + "ProposalQueued(uint256,uint256)": { + "details": "Emitted when a proposal is queued." + }, + "VoteCast(address,uint256,uint8,uint256,string)": { + "details": "Emitted when a vote is cast without params. Note: `support` values should be seen as buckets. Their interpretation depends on the voting module used." + }, + "VoteCastWithParams(address,uint256,uint8,uint256,string,bytes)": { + "details": "Emitted when a vote is cast with params. Note: `support` values should be seen as buckets. Their interpretation depends on the voting module used. `params` are additional encoded parameters. Their interpretation also depends on the voting module used." + } + }, + "kind": "dev", + "methods": { + "CLOCK_MODE()": { + "details": "Machine-readable description of the clock as specified in ERC-6372." + }, + "COUNTING_MODE()": { + "details": "See {IGovernor-COUNTING_MODE}." + }, + "cancel(address[],uint256[],bytes[],bytes32)": { + "details": "See {IGovernor-cancel}." + }, + "castVote(uint256,uint8)": { + "details": "See {IGovernor-castVote}." + }, + "castVoteBySig(uint256,uint8,address,bytes)": { + "details": "See {IGovernor-castVoteBySig}." + }, + "castVoteWithReason(uint256,uint8,string)": { + "details": "See {IGovernor-castVoteWithReason}." + }, + "castVoteWithReasonAndParams(uint256,uint8,string,bytes)": { + "details": "See {IGovernor-castVoteWithReasonAndParams}." + }, + "castVoteWithReasonAndParamsBySig(uint256,uint8,address,string,bytes,bytes)": { + "details": "See {IGovernor-castVoteWithReasonAndParamsBySig}." + }, + "claimParameterUpdate(bytes)": { + "params": { + "proof": "Proof generated by home chain" + } + }, + "clock()": { + "details": "Clock (as specified in ERC-6372) is set to match the token's clock. Fallback to block numbers if the token does not implement ERC-6372." + }, + "constructor": { + "details": "Sets up initial governance parameters and manifesto", + "params": { + "_home": "Chain ID where this contract is considered home", + "_manifestoCid": "Initial manifesto CID", + "_name": "Name of the governance contract", + "_proposalThreshold": "Minimum votes needed to create a proposal", + "_quorum": "Minimum participation percentage required", + "_token": "The voting token contract address", + "_votingDelay": "Time before voting begins", + "_votingPeriod": "Duration of voting period" + } + }, + "eip712Domain()": { + "details": "See {IERC-5267}." + }, + "execute(address[],uint256[],bytes[],bytes32)": { + "details": "See {IGovernor-execute}." + }, + "generateParameterProof(uint8,bytes)": { + "params": { + "operationType": "Type of parameter being updated", + "value": "Encoded parameter value" + }, + "returns": { + "proof": "Encoded proof data" + } + }, + "getVotes(address,uint256)": { + "details": "See {IGovernor-getVotes}." + }, + "getVotesWithParams(address,uint256,bytes)": { + "details": "See {IGovernor-getVotesWithParams}." + }, + "hasVoted(uint256,address)": { + "details": "See {IGovernor-hasVoted}." + }, + "hashProposal(address[],uint256[],bytes[],bytes32)": { + "details": "See {IGovernor-hashProposal}. The proposal id is produced by hashing the ABI encoded `targets` array, the `values` array, the `calldatas` array and the descriptionHash (bytes32 which itself is the keccak256 hash of the description string). This proposal id can be produced from the proposal data which is part of the {ProposalCreated} event. It can even be computed in advance, before the proposal is submitted. Note that the chainId and the governor address are not part of the proposal id computation. Consequently, the same proposal (with same operation and same description) will have the same id if submitted on multiple governors across multiple networks. This also means that in order to execute the same operation twice (on the same governor) the proposer will have to change the description in order to avoid proposal id conflicts." + }, + "name()": { + "details": "See {IGovernor-name}." + }, + "nonces(address)": { + "details": "Returns the next unused nonce for an address." + }, + "onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)": { + "details": "See {IERC1155Receiver-onERC1155BatchReceived}. Receiving tokens is disabled if the governance executor is other than the governor itself (eg. when using with a timelock)." + }, + "onERC1155Received(address,address,uint256,uint256,bytes)": { + "details": "See {IERC1155Receiver-onERC1155Received}. Receiving tokens is disabled if the governance executor is other than the governor itself (eg. when using with a timelock)." + }, + "onERC721Received(address,address,uint256,bytes)": { + "details": "See {IERC721Receiver-onERC721Received}. Receiving tokens is disabled if the governance executor is other than the governor itself (eg. when using with a timelock)." + }, + "proposalDeadline(uint256)": { + "details": "See {IGovernor-proposalDeadline}." + }, + "proposalEta(uint256)": { + "details": "See {IGovernor-proposalEta}." + }, + "proposalNeedsQueuing(uint256)": { + "details": "See {IGovernor-proposalNeedsQueuing}." + }, + "proposalProposer(uint256)": { + "details": "See {IGovernor-proposalProposer}." + }, + "proposalSnapshot(uint256)": { + "details": "See {IGovernor-proposalSnapshot}." + }, + "proposalVotes(uint256)": { + "details": "Accessor to the internal vote counts." + }, + "propose(address[],uint256[],bytes[],string)": { + "details": "See {IGovernor-propose}. This function has opt-in frontrunning protection, described in {_isValidDescriptionForProposer}." + }, + "queue(address[],uint256[],bytes[],bytes32)": { + "details": "See {IGovernor-queue}." + }, + "quorumDenominator()": { + "details": "Returns the quorum denominator. Defaults to 100, but may be overridden." + }, + "quorumNumerator()": { + "details": "Returns the current quorum numerator. See {quorumDenominator}." + }, + "quorumNumerator(uint256)": { + "details": "Returns the quorum numerator at a specific timepoint. See {quorumDenominator}." + }, + "relay(address,uint256,bytes)": { + "details": "Relays a transaction or function call to an arbitrary target. In cases where the governance executor is some contract other than the governor itself, like when using a timelock, this function can be invoked in a governance proposal to recover tokens or Ether that was sent to the governor contract by mistake. Note that if the executor is simply the governor itself, use of `relay` is redundant." + }, + "setManifesto(string)": { + "params": { + "newManifesto": "New manifesto CID" + } + }, + "setProposalThreshold(uint256)": { + "params": { + "newProposalThreshold": "New proposal threshold value" + } + }, + "setVotingDelay(uint48)": { + "params": { + "newVotingDelay": "New voting delay value" + } + }, + "setVotingPeriod(uint32)": { + "params": { + "newVotingPeriod": "New voting period value" + } + }, + "state(uint256)": { + "details": "See {IGovernor-state}." + }, + "supportsInterface(bytes4)": { + "details": "See {IERC165-supportsInterface}." + }, + "token()": { + "details": "The token that voting power is sourced from." + }, + "updateQuorumNumerator(uint256)": { + "params": { + "newQuorumNumerator": "New quorum numerator value" + } + }, + "version()": { + "details": "See {IGovernor-version}." + } + }, + "title": "Cross-chain Governance Contract", + "version": 1 + }, + "userdoc": { + "events": { + "GovernanceParameterUpdated(uint8,uint256,uint256,uint256)": { + "notice": "Emitted when a governance parameter is updated" + }, + "ManifestoUpdated(string,string,uint256)": { + "notice": "Emitted when the manifesto is updated" + } + }, + "kind": "user", + "methods": { + "claimParameterUpdate(bytes)": { + "notice": "Claims a parameter update on a foreign chain" + }, + "constructor": { + "notice": "Initializes the governance contract" + }, + "generateParameterProof(uint8,bytes)": { + "notice": "Generates proof for parameter updates" + }, + "home()": { + "notice": "Chain ID where this contract was originally deployed" + }, + "manifesto()": { + "notice": "IPFS CID of the DAO's manifesto" + }, + "setManifesto(string)": { + "notice": "Updates the DAO's manifesto on the home chain" + }, + "setProposalThreshold(uint256)": { + "notice": "Updates the proposal threshold parameter on the home chain" + }, + "setVotingDelay(uint48)": { + "notice": "Updates the voting delay parameter on the home chain" + }, + "setVotingPeriod(uint32)": { + "notice": "Updates the voting period parameter on the home chain" + }, + "updateQuorumNumerator(uint256)": { + "notice": "Updates the quorum numerator on the home chain" + } + }, + "notice": "Implementation of a DAO with cross-chain synchronization capabilities", + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 7382, + "contract": "contracts/variants/crosschain/Gov.sol:Gov", + "label": "_nameFallback", + "offset": 0, + "slot": "0", + "type": "t_string_storage" + }, + { + "astId": 7384, + "contract": "contracts/variants/crosschain/Gov.sol:Gov", + "label": "_versionFallback", + "offset": 0, + "slot": "1", + "type": "t_string_storage" + }, + { + "astId": 6230, + "contract": "contracts/variants/crosschain/Gov.sol:Gov", + "label": "_nonces", + "offset": 0, + "slot": "2", + "type": "t_mapping(t_address,t_uint256)" + }, + { + "astId": 237, + "contract": "contracts/variants/crosschain/Gov.sol:Gov", + "label": "_name", + "offset": 0, + "slot": "3", + "type": "t_string_storage" + }, + { + "astId": 242, + "contract": "contracts/variants/crosschain/Gov.sol:Gov", + "label": "_proposals", + "offset": 0, + "slot": "4", + "type": "t_mapping(t_uint256,t_struct(ProposalCore)215_storage)" + }, + { + "astId": 245, + "contract": "contracts/variants/crosschain/Gov.sol:Gov", + "label": "_governanceCall", + "offset": 0, + "slot": "5", + "type": "t_struct(Bytes32Deque)12901_storage" + }, + { + "astId": 2663, + "contract": "contracts/variants/crosschain/Gov.sol:Gov", + "label": "_proposalThreshold", + "offset": 0, + "slot": "7", + "type": "t_uint256" + }, + { + "astId": 2665, + "contract": "contracts/variants/crosschain/Gov.sol:Gov", + "label": "_votingDelay", + "offset": 0, + "slot": "8", + "type": "t_uint48" + }, + { + "astId": 2667, + "contract": "contracts/variants/crosschain/Gov.sol:Gov", + "label": "_votingPeriod", + "offset": 6, + "slot": "8", + "type": "t_uint32" + }, + { + "astId": 2450, + "contract": "contracts/variants/crosschain/Gov.sol:Gov", + "label": "_proposalVotes", + "offset": 0, + "slot": "9", + "type": "t_mapping(t_uint256,t_struct(ProposalVote)2445_storage)" + }, + { + "astId": 2969, + "contract": "contracts/variants/crosschain/Gov.sol:Gov", + "label": "_quorumNumeratorHistory", + "offset": 0, + "slot": "10", + "type": "t_struct(Trace208)11842_storage" + }, + { + "astId": 13540, + "contract": "contracts/variants/crosschain/Gov.sol:Gov", + "label": "manifesto", + "offset": 0, + "slot": "11", + "type": "t_string_storage" + }, + { + "astId": 13544, + "contract": "contracts/variants/crosschain/Gov.sol:Gov", + "label": "_proofStorage", + "offset": 0, + "slot": "12", + "type": "t_struct(ProofStorage)14687_storage" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + }, + "t_array(t_struct(Checkpoint208)11847_storage)dyn_storage": { + "base": "t_struct(Checkpoint208)11847_storage", + "encoding": "dynamic_array", + "label": "struct Checkpoints.Checkpoint208[]", + "numberOfBytes": "32" + }, + "t_bool": { + "encoding": "inplace", + "label": "bool", + "numberOfBytes": "1" + }, + "t_bytes32": { + "encoding": "inplace", + "label": "bytes32", + "numberOfBytes": "32" + }, + "t_mapping(t_address,t_bool)": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => bool)", + "numberOfBytes": "32", + "value": "t_bool" + }, + "t_mapping(t_address,t_uint256)": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => uint256)", + "numberOfBytes": "32", + "value": "t_uint256" + }, + "t_mapping(t_bytes32,t_bool)": { + "encoding": "mapping", + "key": "t_bytes32", + "label": "mapping(bytes32 => bool)", + "numberOfBytes": "32", + "value": "t_bool" + }, + "t_mapping(t_uint128,t_bytes32)": { + "encoding": "mapping", + "key": "t_uint128", + "label": "mapping(uint128 => bytes32)", + "numberOfBytes": "32", + "value": "t_bytes32" + }, + "t_mapping(t_uint256,t_struct(ProposalCore)215_storage)": { + "encoding": "mapping", + "key": "t_uint256", + "label": "mapping(uint256 => struct Governor.ProposalCore)", + "numberOfBytes": "32", + "value": "t_struct(ProposalCore)215_storage" + }, + "t_mapping(t_uint256,t_struct(ProposalVote)2445_storage)": { + "encoding": "mapping", + "key": "t_uint256", + "label": "mapping(uint256 => struct GovernorCountingSimple.ProposalVote)", + "numberOfBytes": "32", + "value": "t_struct(ProposalVote)2445_storage" + }, + "t_mapping(t_uint8,t_uint256)": { + "encoding": "mapping", + "key": "t_uint8", + "label": "mapping(uint8 => uint256)", + "numberOfBytes": "32", + "value": "t_uint256" + }, + "t_string_storage": { + "encoding": "bytes", + "label": "string", + "numberOfBytes": "32" + }, + "t_struct(Bytes32Deque)12901_storage": { + "encoding": "inplace", + "label": "struct DoubleEndedQueue.Bytes32Deque", + "members": [ + { + "astId": 12894, + "contract": "contracts/variants/crosschain/Gov.sol:Gov", + "label": "_begin", + "offset": 0, + "slot": "0", + "type": "t_uint128" + }, + { + "astId": 12896, + "contract": "contracts/variants/crosschain/Gov.sol:Gov", + "label": "_end", + "offset": 16, + "slot": "0", + "type": "t_uint128" + }, + { + "astId": 12900, + "contract": "contracts/variants/crosschain/Gov.sol:Gov", + "label": "_data", + "offset": 0, + "slot": "1", + "type": "t_mapping(t_uint128,t_bytes32)" + } + ], + "numberOfBytes": "64" + }, + "t_struct(Checkpoint208)11847_storage": { + "encoding": "inplace", + "label": "struct Checkpoints.Checkpoint208", + "members": [ + { + "astId": 11844, + "contract": "contracts/variants/crosschain/Gov.sol:Gov", + "label": "_key", + "offset": 0, + "slot": "0", + "type": "t_uint48" + }, + { + "astId": 11846, + "contract": "contracts/variants/crosschain/Gov.sol:Gov", + "label": "_value", + "offset": 6, + "slot": "0", + "type": "t_uint208" + } + ], + "numberOfBytes": "32" + }, + "t_struct(ProofStorage)14687_storage": { + "encoding": "inplace", + "label": "struct ProofHandler.ProofStorage", + "members": [ + { + "astId": 14682, + "contract": "contracts/variants/crosschain/Gov.sol:Gov", + "label": "updateAppliedOnChain", + "offset": 0, + "slot": "0", + "type": "t_mapping(t_bytes32,t_bool)" + }, + { + "astId": 14686, + "contract": "contracts/variants/crosschain/Gov.sol:Gov", + "label": "currentNonce", + "offset": 0, + "slot": "1", + "type": "t_mapping(t_uint8,t_uint256)" + } + ], + "numberOfBytes": "64" + }, + "t_struct(ProposalCore)215_storage": { + "encoding": "inplace", + "label": "struct Governor.ProposalCore", + "members": [ + { + "astId": 204, + "contract": "contracts/variants/crosschain/Gov.sol:Gov", + "label": "proposer", + "offset": 0, + "slot": "0", + "type": "t_address" + }, + { + "astId": 206, + "contract": "contracts/variants/crosschain/Gov.sol:Gov", + "label": "voteStart", + "offset": 20, + "slot": "0", + "type": "t_uint48" + }, + { + "astId": 208, + "contract": "contracts/variants/crosschain/Gov.sol:Gov", + "label": "voteDuration", + "offset": 26, + "slot": "0", + "type": "t_uint32" + }, + { + "astId": 210, + "contract": "contracts/variants/crosschain/Gov.sol:Gov", + "label": "executed", + "offset": 30, + "slot": "0", + "type": "t_bool" + }, + { + "astId": 212, + "contract": "contracts/variants/crosschain/Gov.sol:Gov", + "label": "canceled", + "offset": 31, + "slot": "0", + "type": "t_bool" + }, + { + "astId": 214, + "contract": "contracts/variants/crosschain/Gov.sol:Gov", + "label": "etaSeconds", + "offset": 0, + "slot": "1", + "type": "t_uint48" + } + ], + "numberOfBytes": "64" + }, + "t_struct(ProposalVote)2445_storage": { + "encoding": "inplace", + "label": "struct GovernorCountingSimple.ProposalVote", + "members": [ + { + "astId": 2436, + "contract": "contracts/variants/crosschain/Gov.sol:Gov", + "label": "againstVotes", + "offset": 0, + "slot": "0", + "type": "t_uint256" + }, + { + "astId": 2438, + "contract": "contracts/variants/crosschain/Gov.sol:Gov", + "label": "forVotes", + "offset": 0, + "slot": "1", + "type": "t_uint256" + }, + { + "astId": 2440, + "contract": "contracts/variants/crosschain/Gov.sol:Gov", + "label": "abstainVotes", + "offset": 0, + "slot": "2", + "type": "t_uint256" + }, + { + "astId": 2444, + "contract": "contracts/variants/crosschain/Gov.sol:Gov", + "label": "hasVoted", + "offset": 0, + "slot": "3", + "type": "t_mapping(t_address,t_bool)" + } + ], + "numberOfBytes": "128" + }, + "t_struct(Trace208)11842_storage": { + "encoding": "inplace", + "label": "struct Checkpoints.Trace208", + "members": [ + { + "astId": 11841, + "contract": "contracts/variants/crosschain/Gov.sol:Gov", + "label": "_checkpoints", + "offset": 0, + "slot": "0", + "type": "t_array(t_struct(Checkpoint208)11847_storage)dyn_storage" + } + ], + "numberOfBytes": "32" + }, + "t_uint128": { + "encoding": "inplace", + "label": "uint128", + "numberOfBytes": "16" + }, + "t_uint208": { + "encoding": "inplace", + "label": "uint208", + "numberOfBytes": "26" + }, + "t_uint256": { + "encoding": "inplace", + "label": "uint256", + "numberOfBytes": "32" + }, + "t_uint32": { + "encoding": "inplace", + "label": "uint32", + "numberOfBytes": "4" + }, + "t_uint48": { + "encoding": "inplace", + "label": "uint48", + "numberOfBytes": "6" + }, + "t_uint8": { + "encoding": "inplace", + "label": "uint8", + "numberOfBytes": "1" + } + } + } +} \ No newline at end of file diff --git a/deployments/arbitrumSepolia/CrosschainNFT.json b/deployments/arbitrumSepolia/CrosschainNFT.json new file mode 100644 index 0000000..4ead327 --- /dev/null +++ b/deployments/arbitrumSepolia/CrosschainNFT.json @@ -0,0 +1,2098 @@ +{ + "address": "0x8583CEbA0d2C5cAe1a1BCff975Faa97063D14953", + "abi": [ + { + "inputs": [ + { + "internalType": "uint256", + "name": "_home", + "type": "uint256" + }, + { + "internalType": "address", + "name": "initialOwner", + "type": "address" + }, + { + "internalType": "address[]", + "name": "_firstMembers", + "type": "address[]" + }, + { + "internalType": "string", + "name": "_uri", + "type": "string" + }, + { + "internalType": "string", + "name": "_name", + "type": "string" + }, + { + "internalType": "string", + "name": "_symbol", + "type": "string" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [], + "name": "CheckpointUnorderedInsertion", + "type": "error" + }, + { + "inputs": [], + "name": "ECDSAInvalidSignature", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "length", + "type": "uint256" + } + ], + "name": "ECDSAInvalidSignatureLength", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + } + ], + "name": "ECDSAInvalidSignatureS", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "timepoint", + "type": "uint256" + }, + { + "internalType": "uint48", + "name": "clock", + "type": "uint48" + } + ], + "name": "ERC5805FutureLookup", + "type": "error" + }, + { + "inputs": [], + "name": "ERC6372InconsistentClock", + "type": "error" + }, + { + "inputs": [], + "name": "ERC721EnumerableForbiddenBatchMint", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + }, + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "ERC721IncorrectOwner", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "operator", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } + ], + "name": "ERC721InsufficientApproval", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "approver", + "type": "address" + } + ], + "name": "ERC721InvalidApprover", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "operator", + "type": "address" + } + ], + "name": "ERC721InvalidOperator", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "ERC721InvalidOwner", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "receiver", + "type": "address" + } + ], + "name": "ERC721InvalidReceiver", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "name": "ERC721InvalidSender", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } + ], + "name": "ERC721NonexistentToken", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "uint256", + "name": "index", + "type": "uint256" + } + ], + "name": "ERC721OutOfBoundsIndex", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "currentNonce", + "type": "uint256" + } + ], + "name": "InvalidAccountNonce", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidShortString", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "OwnableInvalidOwner", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "OwnableUnauthorizedAccount", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint8", + "name": "bits", + "type": "uint8" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "SafeCastOverflowedUintDowncast", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "str", + "type": "string" + } + ], + "name": "StringTooLong", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "expiry", + "type": "uint256" + } + ], + "name": "VotesExpiredSignature", + "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": [ + { + "indexed": false, + "internalType": "uint256", + "name": "_fromTokenId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_toTokenId", + "type": "uint256" + } + ], + "name": "BatchMetadataUpdate", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "delegator", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "fromDelegate", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "toDelegate", + "type": "address" + } + ], + "name": "DelegateChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "delegate", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "previousVotes", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newVotes", + "type": "uint256" + } + ], + "name": "DelegateVotesChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "delegator", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "delegatee", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + } + ], + "name": "DelegationSynced", + "type": "event" + }, + { + "anonymous": false, + "inputs": [], + "name": "EIP712DomainChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "address", + "name": "member", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + } + ], + "name": "MembershipClaimed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "address", + "name": "member", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + } + ], + "name": "MembershipRevoked", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "_tokenId", + "type": "uint256" + } + ], + "name": "MetadataUpdate", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "string", + "name": "newUri", + "type": "string" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + } + ], + "name": "MetadataUpdated", + "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": 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": "CLOCK_MODE", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "pure", + "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": [ + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } + ], + "name": "burn", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "proof", + "type": "bytes" + } + ], + "name": "claimDelegation", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "proof", + "type": "bytes" + } + ], + "name": "claimOperation", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "clock", + "outputs": [ + { + "internalType": "uint48", + "name": "", + "type": "uint48" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "delegatee", + "type": "address" + } + ], + "name": "delegate", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "delegatee", + "type": "address" + }, + { + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "expiry", + "type": "uint256" + }, + { + "internalType": "uint8", + "name": "v", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "r", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + } + ], + "name": "delegateBySig", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "delegates", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "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": [ + { + "internalType": "address", + "name": "delegator", + "type": "address" + }, + { + "internalType": "address", + "name": "delegatee", + "type": "address" + } + ], + "name": "generateDelegationProof", + "outputs": [ + { + "internalType": "bytes", + "name": "", + "type": "bytes" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint8", + "name": "operationType", + "type": "uint8" + }, + { + "internalType": "bytes", + "name": "params", + "type": "bytes" + } + ], + "name": "generateOperationProof", + "outputs": [ + { + "internalType": "bytes", + "name": "", + "type": "bytes" + } + ], + "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": "uint256", + "name": "timepoint", + "type": "uint256" + } + ], + "name": "getPastTotalSupply", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "timepoint", + "type": "uint256" + } + ], + "name": "getPastVotes", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "getVotes", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } + ], + "name": "govBurn", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "home", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "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": [], + "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": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "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": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "string", + "name": "uri", + "type": "string" + } + ], + "name": "safeMint", + "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": [ + { + "internalType": "address", + "name": "operator", + "type": "address" + }, + { + "internalType": "bool", + "name": "approved", + "type": "bool" + } + ], + "name": "setApprovalForAll", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + }, + { + "internalType": "string", + "name": "uri", + "type": "string" + } + ], + "name": "setMetadata", + "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": "index", + "type": "uint256" + } + ], + "name": "tokenByIndex", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "uint256", + "name": "index", + "type": "uint256" + } + ], + "name": "tokenOfOwnerByIndex", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "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" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "args": [ + 11155111, + "0x27292E1a901E3E0bE7d144aDba4CAD07da2d8a42", + [ + "0xD8a394e7d7894bDF2C57139fF17e5CBAa29Dd977", + "0xe61A1a5278290B6520f0CEf3F2c71Ba70CF5cf4C" + ], + "https://bafkreicj62l5xu6pk2xx7x7n6b7rpunxb4ehlh7fevyjapid3556smuz4y.ipfs.w3s.link/", + "Membership NFT", + "MEMBER" + ], + "numDeployments": 1, + "solcInputHash": "c27a34cff02617821c386fb97b476bc1", + "metadata": "{\"compiler\":{\"version\":\"0.8.20+commit.a1b79de6\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_home\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"initialOwner\",\"type\":\"address\"},{\"internalType\":\"address[]\",\"name\":\"_firstMembers\",\"type\":\"address[]\"},{\"internalType\":\"string\",\"name\":\"_uri\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"_name\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"_symbol\",\"type\":\"string\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"CheckpointUnorderedInsertion\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ECDSAInvalidSignature\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"length\",\"type\":\"uint256\"}],\"name\":\"ECDSAInvalidSignatureLength\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"name\":\"ECDSAInvalidSignatureS\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"timepoint\",\"type\":\"uint256\"},{\"internalType\":\"uint48\",\"name\":\"clock\",\"type\":\"uint48\"}],\"name\":\"ERC5805FutureLookup\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ERC6372InconsistentClock\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ERC721EnumerableForbiddenBatchMint\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"ERC721IncorrectOwner\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"ERC721InsufficientApproval\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"approver\",\"type\":\"address\"}],\"name\":\"ERC721InvalidApprover\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"}],\"name\":\"ERC721InvalidOperator\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"ERC721InvalidOwner\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"}],\"name\":\"ERC721InvalidReceiver\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"ERC721InvalidSender\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"ERC721NonexistentToken\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"index\",\"type\":\"uint256\"}],\"name\":\"ERC721OutOfBoundsIndex\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"currentNonce\",\"type\":\"uint256\"}],\"name\":\"InvalidAccountNonce\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidShortString\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"OwnableInvalidOwner\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"OwnableUnauthorizedAccount\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint8\",\"name\":\"bits\",\"type\":\"uint8\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"SafeCastOverflowedUintDowncast\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"str\",\"type\":\"string\"}],\"name\":\"StringTooLong\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expiry\",\"type\":\"uint256\"}],\"name\":\"VotesExpiredSignature\",\"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\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_fromTokenId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_toTokenId\",\"type\":\"uint256\"}],\"name\":\"BatchMetadataUpdate\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"delegator\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"fromDelegate\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"toDelegate\",\"type\":\"address\"}],\"name\":\"DelegateChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"delegate\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"previousVotes\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newVotes\",\"type\":\"uint256\"}],\"name\":\"DelegateVotesChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"delegator\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"delegatee\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"}],\"name\":\"DelegationSynced\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[],\"name\":\"EIP712DomainChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"member\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"}],\"name\":\"MembershipClaimed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"member\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"}],\"name\":\"MembershipRevoked\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_tokenId\",\"type\":\"uint256\"}],\"name\":\"MetadataUpdate\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"newUri\",\"type\":\"string\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"}],\"name\":\"MetadataUpdated\",\"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\":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\":\"CLOCK_MODE\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"pure\",\"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\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"burn\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"proof\",\"type\":\"bytes\"}],\"name\":\"claimDelegation\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"proof\",\"type\":\"bytes\"}],\"name\":\"claimOperation\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"clock\",\"outputs\":[{\"internalType\":\"uint48\",\"name\":\"\",\"type\":\"uint48\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"delegatee\",\"type\":\"address\"}],\"name\":\"delegate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"delegatee\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expiry\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"name\":\"delegateBySig\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"delegates\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"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\":[{\"internalType\":\"address\",\"name\":\"delegator\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"delegatee\",\"type\":\"address\"}],\"name\":\"generateDelegationProof\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint8\",\"name\":\"operationType\",\"type\":\"uint8\"},{\"internalType\":\"bytes\",\"name\":\"params\",\"type\":\"bytes\"}],\"name\":\"generateOperationProof\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"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\":\"uint256\",\"name\":\"timepoint\",\"type\":\"uint256\"}],\"name\":\"getPastTotalSupply\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"timepoint\",\"type\":\"uint256\"}],\"name\":\"getPastVotes\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"getVotes\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"govBurn\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"home\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"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\":[],\"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\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"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\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"uri\",\"type\":\"string\"}],\"name\":\"safeMint\",\"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\":[{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"approved\",\"type\":\"bool\"}],\"name\":\"setApprovalForAll\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"string\",\"name\":\"uri\",\"type\":\"string\"}],\"name\":\"setMetadata\",\"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\":\"index\",\"type\":\"uint256\"}],\"name\":\"tokenByIndex\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"index\",\"type\":\"uint256\"}],\"name\":\"tokenOfOwnerByIndex\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"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\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"author\":\"Web3 Hackers Collective\",\"custom:security-contact\":\"julien@strat.cc\",\"details\":\"Extends OpenZeppelin's NFT standards with cross-chain operation support and delegation\",\"errors\":{\"CheckpointUnorderedInsertion()\":[{\"details\":\"A value was attempted to be inserted on a past checkpoint.\"}],\"ECDSAInvalidSignature()\":[{\"details\":\"The signature derives the `address(0)`.\"}],\"ECDSAInvalidSignatureLength(uint256)\":[{\"details\":\"The signature has an invalid length.\"}],\"ECDSAInvalidSignatureS(bytes32)\":[{\"details\":\"The signature has an S value that is in the upper half order.\"}],\"ERC5805FutureLookup(uint256,uint48)\":[{\"details\":\"Lookup to future votes is not available.\"}],\"ERC6372InconsistentClock()\":[{\"details\":\"The clock was incorrectly modified.\"}],\"ERC721EnumerableForbiddenBatchMint()\":[{\"details\":\"Batch mint is not allowed.\"}],\"ERC721IncorrectOwner(address,uint256,address)\":[{\"details\":\"Indicates an error related to the ownership over a particular token. Used in transfers.\",\"params\":{\"owner\":\"Address of the current owner of a token.\",\"sender\":\"Address whose tokens are being transferred.\",\"tokenId\":\"Identifier number of a token.\"}}],\"ERC721InsufficientApproval(address,uint256)\":[{\"details\":\"Indicates a failure with the `operator`\\u2019s approval. Used in transfers.\",\"params\":{\"operator\":\"Address that may be allowed to operate on tokens without being their owner.\",\"tokenId\":\"Identifier number of a token.\"}}],\"ERC721InvalidApprover(address)\":[{\"details\":\"Indicates a failure with the `approver` of a token to be approved. Used in approvals.\",\"params\":{\"approver\":\"Address initiating an approval operation.\"}}],\"ERC721InvalidOperator(address)\":[{\"details\":\"Indicates a failure with the `operator` to be approved. Used in approvals.\",\"params\":{\"operator\":\"Address that may be allowed to operate on tokens without being their owner.\"}}],\"ERC721InvalidOwner(address)\":[{\"details\":\"Indicates that an address can't be an owner. For example, `address(0)` is a forbidden owner in ERC-20. Used in balance queries.\",\"params\":{\"owner\":\"Address of the current owner of a token.\"}}],\"ERC721InvalidReceiver(address)\":[{\"details\":\"Indicates a failure with the token `receiver`. Used in transfers.\",\"params\":{\"receiver\":\"Address to which tokens are being transferred.\"}}],\"ERC721InvalidSender(address)\":[{\"details\":\"Indicates a failure with the token `sender`. Used in transfers.\",\"params\":{\"sender\":\"Address whose tokens are being transferred.\"}}],\"ERC721NonexistentToken(uint256)\":[{\"details\":\"Indicates a `tokenId` whose `owner` is the zero address.\",\"params\":{\"tokenId\":\"Identifier number of a token.\"}}],\"ERC721OutOfBoundsIndex(address,uint256)\":[{\"details\":\"An `owner`'s token query was out of bounds for `index`. NOTE: The owner being `address(0)` indicates a global out of bounds index.\"}],\"InvalidAccountNonce(address,uint256)\":[{\"details\":\"The nonce used for an `account` is not the expected current nonce.\"}],\"OwnableInvalidOwner(address)\":[{\"details\":\"The owner is not a valid owner account. (eg. `address(0)`)\"}],\"OwnableUnauthorizedAccount(address)\":[{\"details\":\"The caller account is not authorized to perform an operation.\"}],\"SafeCastOverflowedUintDowncast(uint8,uint256)\":[{\"details\":\"Value doesn't fit in an uint of `bits` size.\"}],\"VotesExpiredSignature(uint256)\":[{\"details\":\"The signature used has expired.\"}]},\"events\":{\"Approval(address,address,uint256)\":{\"details\":\"Emitted when `owner` enables `approved` to manage the `tokenId` token.\"},\"ApprovalForAll(address,address,bool)\":{\"details\":\"Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.\"},\"BatchMetadataUpdate(uint256,uint256)\":{\"details\":\"This event emits when the metadata of a range of tokens is changed. So that the third-party platforms such as NFT market could timely update the images and related attributes of the NFTs.\"},\"DelegateChanged(address,address,address)\":{\"details\":\"Emitted when an account changes their delegate.\"},\"DelegateVotesChanged(address,uint256,uint256)\":{\"details\":\"Emitted when a token transfer or delegate change results in changes to a delegate's number of voting units.\"},\"DelegationSynced(address,address,uint256)\":{\"params\":{\"delegatee\":\"The address receiving the delegation\",\"delegator\":\"The address delegating their voting power\",\"nonce\":\"Operation sequence number\"}},\"EIP712DomainChanged()\":{\"details\":\"MAY be emitted to signal that the domain could have changed.\"},\"MembershipClaimed(uint256,address,uint256)\":{\"params\":{\"member\":\"The address receiving the membership\",\"nonce\":\"Operation sequence number\",\"tokenId\":\"The ID of the claimed token\"}},\"MembershipRevoked(uint256,address,uint256)\":{\"params\":{\"member\":\"The address losing membership\",\"nonce\":\"Operation sequence number\",\"tokenId\":\"The ID of the revoked token\"}},\"MetadataUpdate(uint256)\":{\"details\":\"This event emits when the metadata of a token is changed. So that the third-party platforms such as NFT market could timely update the images and related attributes of the NFT.\"},\"MetadataUpdated(uint256,string,uint256)\":{\"params\":{\"newUri\":\"The new metadata URI\",\"nonce\":\"Operation sequence number\",\"tokenId\":\"The ID of the updated token\"}},\"Transfer(address,address,uint256)\":{\"details\":\"Emitted when `tokenId` token is transferred from `from` to `to`.\"}},\"kind\":\"dev\",\"methods\":{\"CLOCK_MODE()\":{\"returns\":{\"_0\":\"String indicating timestamp-based voting\"}},\"approve(address,uint256)\":{\"details\":\"See {IERC721-approve}.\"},\"balanceOf(address)\":{\"details\":\"See {IERC721-balanceOf}.\"},\"burn(uint256)\":{\"details\":\"Burns `tokenId`. See {ERC721-_burn}. Requirements: - The caller must own `tokenId` or be an approved operator.\"},\"claimDelegation(bytes)\":{\"params\":{\"proof\":\"Proof generated by home chain\"}},\"claimOperation(bytes)\":{\"params\":{\"proof\":\"Proof generated by home chain\"}},\"clock()\":{\"details\":\"Used for voting snapshots\",\"returns\":{\"_0\":\"Current block timestamp\"}},\"constructor\":{\"params\":{\"_firstMembers\":\"Array of initial member addresses\",\"_home\":\"Chain ID where contract is considered home\",\"_name\":\"Token collection name\",\"_symbol\":\"Token collection symbol\",\"_uri\":\"Initial token URI\",\"initialOwner\":\"Initial contract owner\"}},\"delegate(address)\":{\"details\":\"Overrides ERC721Votes delegate function to add cross-chain functionality\",\"params\":{\"delegatee\":\"Address to delegate voting power to\"}},\"delegateBySig(address,uint256,uint256,uint8,bytes32,bytes32)\":{\"details\":\"Delegates votes from signer to `delegatee`.\"},\"delegates(address)\":{\"details\":\"Returns the delegate that `account` has chosen.\"},\"eip712Domain()\":{\"details\":\"See {IERC-5267}.\"},\"generateDelegationProof(address,address)\":{\"details\":\"Only callable on home chain\",\"params\":{\"delegatee\":\"Address receiving delegation\",\"delegator\":\"Address delegating voting power\"},\"returns\":{\"_0\":\"Encoded proof data\"}},\"generateOperationProof(uint8,bytes)\":{\"details\":\"Only callable on home chain\",\"params\":{\"operationType\":\"Type of operation\",\"params\":\"Operation parameters\"},\"returns\":{\"_0\":\"Encoded proof data\"}},\"getApproved(uint256)\":{\"details\":\"See {IERC721-getApproved}.\"},\"getPastTotalSupply(uint256)\":{\"details\":\"Returns the total supply of votes available at a specific moment in the past. If the `clock()` is configured to use block numbers, this will return the value at the end of the corresponding block. NOTE: This value is the sum of all available votes, which is not necessarily the sum of all delegated votes. Votes that have not been delegated are still part of total supply, even though they would not participate in a vote. Requirements: - `timepoint` must be in the past. If operating using block numbers, the block must be already mined.\"},\"getPastVotes(address,uint256)\":{\"details\":\"Returns the amount of votes that `account` had at a specific moment in the past. If the `clock()` is configured to use block numbers, this will return the value at the end of the corresponding block. Requirements: - `timepoint` must be in the past. If operating using block numbers, the block must be already mined.\"},\"getVotes(address)\":{\"details\":\"Returns the current amount of votes that `account` has.\"},\"govBurn(uint256)\":{\"details\":\"Only callable by owner (governance) on home chain\",\"params\":{\"tokenId\":\"ID of token to burn\"}},\"isApprovedForAll(address,address)\":{\"details\":\"See {IERC721-isApprovedForAll}.\"},\"name()\":{\"details\":\"See {IERC721Metadata-name}.\"},\"nonces(address)\":{\"details\":\"Returns the next unused nonce for an address.\"},\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"ownerOf(uint256)\":{\"details\":\"See {IERC721-ownerOf}.\"},\"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.\"},\"safeMint(address,string)\":{\"details\":\"Only callable by owner (governance) on home chain\",\"params\":{\"to\":\"Address to mint token to\",\"uri\":\"Token metadata URI\"}},\"safeTransferFrom(address,address,uint256)\":{\"details\":\"See {IERC721-safeTransferFrom}.\"},\"safeTransferFrom(address,address,uint256,bytes)\":{\"details\":\"See {IERC721-safeTransferFrom}.\"},\"setApprovalForAll(address,bool)\":{\"details\":\"See {IERC721-setApprovalForAll}.\"},\"setMetadata(uint256,string)\":{\"details\":\"Only callable by owner (governance) on home chain\",\"params\":{\"tokenId\":\"ID of token to update\",\"uri\":\"New metadata URI\"}},\"supportsInterface(bytes4)\":{\"params\":{\"interfaceId\":\"Interface identifier to check\"},\"returns\":{\"_0\":\"bool True if interface is supported\"}},\"symbol()\":{\"details\":\"See {IERC721Metadata-symbol}.\"},\"tokenByIndex(uint256)\":{\"details\":\"See {IERC721Enumerable-tokenByIndex}.\"},\"tokenOfOwnerByIndex(address,uint256)\":{\"details\":\"See {IERC721Enumerable-tokenOfOwnerByIndex}.\"},\"tokenURI(uint256)\":{\"params\":{\"tokenId\":\"Token ID to query\"},\"returns\":{\"_0\":\"URI string\"}},\"totalSupply()\":{\"details\":\"See {IERC721Enumerable-totalSupply}.\"},\"transferFrom(address,address,uint256)\":{\"details\":\"See {IERC721-transferFrom}.\"},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.\"}},\"title\":\"Cross-chain Membership NFT Contract\",\"version\":1},\"userdoc\":{\"events\":{\"DelegationSynced(address,address,uint256)\":{\"notice\":\"Emitted when delegation is synchronized across chains\"},\"MembershipClaimed(uint256,address,uint256)\":{\"notice\":\"Emitted when a membership is claimed\"},\"MembershipRevoked(uint256,address,uint256)\":{\"notice\":\"Emitted when a membership is revoked\"},\"MetadataUpdated(uint256,string,uint256)\":{\"notice\":\"Emitted when metadata is updated\"}},\"kind\":\"user\",\"methods\":{\"CLOCK_MODE()\":{\"notice\":\"Gets clock mode description\"},\"claimDelegation(bytes)\":{\"notice\":\"Claims a delegation operation on a foreign chain\"},\"claimOperation(bytes)\":{\"notice\":\"Claims an NFT operation on a foreign chain\"},\"clock()\":{\"notice\":\"Gets current timestamp\"},\"constructor\":{\"notice\":\"Initializes the NFT contract\"},\"delegate(address)\":{\"notice\":\"Delegates voting power to another address on home chain\"},\"generateDelegationProof(address,address)\":{\"notice\":\"Generates proof for delegation\"},\"generateOperationProof(uint8,bytes)\":{\"notice\":\"Generates proof for NFT operations\"},\"govBurn(uint256)\":{\"notice\":\"Burns token on home chain\"},\"home()\":{\"notice\":\"Chain ID where contract was originally deployed\"},\"safeMint(address,string)\":{\"notice\":\"Adds a new member on home chain\"},\"setMetadata(uint256,string)\":{\"notice\":\"Updates token metadata on home chain\"},\"supportsInterface(bytes4)\":{\"notice\":\"Checks interface support\"},\"tokenURI(uint256)\":{\"notice\":\"Gets token URI\"}},\"notice\":\"Non-transferable NFT implementation for DAO membership with cross-chain capabilities\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/variants/crosschain/NFT.sol\":\"NFT\"},\"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 v5.0.0) (access/Ownable.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {Context} from \\\"../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 * The initial owner is set to the address provided by the deployer. This can\\n * 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 /**\\n * @dev The caller account is not authorized to perform an operation.\\n */\\n error OwnableUnauthorizedAccount(address account);\\n\\n /**\\n * @dev The owner is not a valid owner account. (eg. `address(0)`)\\n */\\n error OwnableInvalidOwner(address owner);\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the address provided by the deployer as the initial owner.\\n */\\n constructor(address initialOwner) {\\n if (initialOwner == address(0)) {\\n revert OwnableInvalidOwner(address(0));\\n }\\n _transferOwnership(initialOwner);\\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 if (owner() != _msgSender()) {\\n revert OwnableUnauthorizedAccount(_msgSender());\\n }\\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 if (newOwner == address(0)) {\\n revert OwnableInvalidOwner(address(0));\\n }\\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\":\"0xff6d0bb2e285473e5311d9d3caacb525ae3538a80758c10649a4d61029b017bb\",\"license\":\"MIT\"},\"@openzeppelin/contracts/governance/utils/IVotes.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (governance/utils/IVotes.sol)\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Common interface for {ERC20Votes}, {ERC721Votes}, and other {Votes}-enabled contracts.\\n */\\ninterface IVotes {\\n /**\\n * @dev The signature used has expired.\\n */\\n error VotesExpiredSignature(uint256 expiry);\\n\\n /**\\n * @dev Emitted when an account changes their delegate.\\n */\\n event DelegateChanged(address indexed delegator, address indexed fromDelegate, address indexed toDelegate);\\n\\n /**\\n * @dev Emitted when a token transfer or delegate change results in changes to a delegate's number of voting units.\\n */\\n event DelegateVotesChanged(address indexed delegate, uint256 previousVotes, uint256 newVotes);\\n\\n /**\\n * @dev Returns the current amount of votes that `account` has.\\n */\\n function getVotes(address account) external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of votes that `account` had at a specific moment in the past. If the `clock()` is\\n * configured to use block numbers, this will return the value at the end of the corresponding block.\\n */\\n function getPastVotes(address account, uint256 timepoint) external view returns (uint256);\\n\\n /**\\n * @dev Returns the total supply of votes available at a specific moment in the past. If the `clock()` is\\n * configured to use block numbers, this will return the value at the end of the corresponding block.\\n *\\n * NOTE: This value is the sum of all available votes, which is not necessarily the sum of all delegated votes.\\n * Votes that have not been delegated are still part of total supply, even though they would not participate in a\\n * vote.\\n */\\n function getPastTotalSupply(uint256 timepoint) external view returns (uint256);\\n\\n /**\\n * @dev Returns the delegate that `account` has chosen.\\n */\\n function delegates(address account) external view returns (address);\\n\\n /**\\n * @dev Delegates votes from the sender to `delegatee`.\\n */\\n function delegate(address delegatee) external;\\n\\n /**\\n * @dev Delegates votes from signer to `delegatee`.\\n */\\n function delegateBySig(address delegatee, uint256 nonce, uint256 expiry, uint8 v, bytes32 r, bytes32 s) external;\\n}\\n\",\"keccak256\":\"0x5e2b397ae88fd5c68e4f6762eb9f65f65c36702eb57796495f471d024ce70947\",\"license\":\"MIT\"},\"@openzeppelin/contracts/governance/utils/Votes.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (governance/utils/Votes.sol)\\npragma solidity ^0.8.20;\\n\\nimport {IERC5805} from \\\"../../interfaces/IERC5805.sol\\\";\\nimport {Context} from \\\"../../utils/Context.sol\\\";\\nimport {Nonces} from \\\"../../utils/Nonces.sol\\\";\\nimport {EIP712} from \\\"../../utils/cryptography/EIP712.sol\\\";\\nimport {Checkpoints} from \\\"../../utils/structs/Checkpoints.sol\\\";\\nimport {SafeCast} from \\\"../../utils/math/SafeCast.sol\\\";\\nimport {ECDSA} from \\\"../../utils/cryptography/ECDSA.sol\\\";\\nimport {Time} from \\\"../../utils/types/Time.sol\\\";\\n\\n/**\\n * @dev This is a base abstract contract that tracks voting units, which are a measure of voting power that can be\\n * transferred, and provides a system of vote delegation, where an account can delegate its voting units to a sort of\\n * \\\"representative\\\" that will pool delegated voting units from different accounts and can then use it to vote in\\n * decisions. In fact, voting units _must_ be delegated in order to count as actual votes, and an account has to\\n * delegate those votes to itself if it wishes to participate in decisions and does not have a trusted representative.\\n *\\n * This contract is often combined with a token contract such that voting units correspond to token units. For an\\n * example, see {ERC721Votes}.\\n *\\n * The full history of delegate votes is tracked on-chain so that governance protocols can consider votes as distributed\\n * at a particular block number to protect against flash loans and double voting. The opt-in delegate system makes the\\n * cost of this history tracking optional.\\n *\\n * When using this module the derived contract must implement {_getVotingUnits} (for example, make it return\\n * {ERC721-balanceOf}), and can use {_transferVotingUnits} to track a change in the distribution of those units (in the\\n * previous example, it would be included in {ERC721-_update}).\\n */\\nabstract contract Votes is Context, EIP712, Nonces, IERC5805 {\\n using Checkpoints for Checkpoints.Trace208;\\n\\n bytes32 private constant DELEGATION_TYPEHASH =\\n keccak256(\\\"Delegation(address delegatee,uint256 nonce,uint256 expiry)\\\");\\n\\n mapping(address account => address) private _delegatee;\\n\\n mapping(address delegatee => Checkpoints.Trace208) private _delegateCheckpoints;\\n\\n Checkpoints.Trace208 private _totalCheckpoints;\\n\\n /**\\n * @dev The clock was incorrectly modified.\\n */\\n error ERC6372InconsistentClock();\\n\\n /**\\n * @dev Lookup to future votes is not available.\\n */\\n error ERC5805FutureLookup(uint256 timepoint, uint48 clock);\\n\\n /**\\n * @dev Clock used for flagging checkpoints. Can be overridden to implement timestamp based\\n * checkpoints (and voting), in which case {CLOCK_MODE} should be overridden as well to match.\\n */\\n function clock() public view virtual returns (uint48) {\\n return Time.blockNumber();\\n }\\n\\n /**\\n * @dev Machine-readable description of the clock as specified in ERC-6372.\\n */\\n // solhint-disable-next-line func-name-mixedcase\\n function CLOCK_MODE() public view virtual returns (string memory) {\\n // Check that the clock was not modified\\n if (clock() != Time.blockNumber()) {\\n revert ERC6372InconsistentClock();\\n }\\n return \\\"mode=blocknumber&from=default\\\";\\n }\\n\\n /**\\n * @dev Returns the current amount of votes that `account` has.\\n */\\n function getVotes(address account) public view virtual returns (uint256) {\\n return _delegateCheckpoints[account].latest();\\n }\\n\\n /**\\n * @dev Returns the amount of votes that `account` had at a specific moment in the past. If the `clock()` is\\n * configured to use block numbers, this will return the value at the end of the corresponding block.\\n *\\n * Requirements:\\n *\\n * - `timepoint` must be in the past. If operating using block numbers, the block must be already mined.\\n */\\n function getPastVotes(address account, uint256 timepoint) public view virtual returns (uint256) {\\n uint48 currentTimepoint = clock();\\n if (timepoint >= currentTimepoint) {\\n revert ERC5805FutureLookup(timepoint, currentTimepoint);\\n }\\n return _delegateCheckpoints[account].upperLookupRecent(SafeCast.toUint48(timepoint));\\n }\\n\\n /**\\n * @dev Returns the total supply of votes available at a specific moment in the past. If the `clock()` is\\n * configured to use block numbers, this will return the value at the end of the corresponding block.\\n *\\n * NOTE: This value is the sum of all available votes, which is not necessarily the sum of all delegated votes.\\n * Votes that have not been delegated are still part of total supply, even though they would not participate in a\\n * vote.\\n *\\n * Requirements:\\n *\\n * - `timepoint` must be in the past. If operating using block numbers, the block must be already mined.\\n */\\n function getPastTotalSupply(uint256 timepoint) public view virtual returns (uint256) {\\n uint48 currentTimepoint = clock();\\n if (timepoint >= currentTimepoint) {\\n revert ERC5805FutureLookup(timepoint, currentTimepoint);\\n }\\n return _totalCheckpoints.upperLookupRecent(SafeCast.toUint48(timepoint));\\n }\\n\\n /**\\n * @dev Returns the current total supply of votes.\\n */\\n function _getTotalSupply() internal view virtual returns (uint256) {\\n return _totalCheckpoints.latest();\\n }\\n\\n /**\\n * @dev Returns the delegate that `account` has chosen.\\n */\\n function delegates(address account) public view virtual returns (address) {\\n return _delegatee[account];\\n }\\n\\n /**\\n * @dev Delegates votes from the sender to `delegatee`.\\n */\\n function delegate(address delegatee) public virtual {\\n address account = _msgSender();\\n _delegate(account, delegatee);\\n }\\n\\n /**\\n * @dev Delegates votes from signer to `delegatee`.\\n */\\n function delegateBySig(\\n address delegatee,\\n uint256 nonce,\\n uint256 expiry,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) public virtual {\\n if (block.timestamp > expiry) {\\n revert VotesExpiredSignature(expiry);\\n }\\n address signer = ECDSA.recover(\\n _hashTypedDataV4(keccak256(abi.encode(DELEGATION_TYPEHASH, delegatee, nonce, expiry))),\\n v,\\n r,\\n s\\n );\\n _useCheckedNonce(signer, nonce);\\n _delegate(signer, delegatee);\\n }\\n\\n /**\\n * @dev Delegate all of `account`'s voting units to `delegatee`.\\n *\\n * Emits events {IVotes-DelegateChanged} and {IVotes-DelegateVotesChanged}.\\n */\\n function _delegate(address account, address delegatee) internal virtual {\\n address oldDelegate = delegates(account);\\n _delegatee[account] = delegatee;\\n\\n emit DelegateChanged(account, oldDelegate, delegatee);\\n _moveDelegateVotes(oldDelegate, delegatee, _getVotingUnits(account));\\n }\\n\\n /**\\n * @dev Transfers, mints, or burns voting units. To register a mint, `from` should be zero. To register a burn, `to`\\n * should be zero. Total supply of voting units will be adjusted with mints and burns.\\n */\\n function _transferVotingUnits(address from, address to, uint256 amount) internal virtual {\\n if (from == address(0)) {\\n _push(_totalCheckpoints, _add, SafeCast.toUint208(amount));\\n }\\n if (to == address(0)) {\\n _push(_totalCheckpoints, _subtract, SafeCast.toUint208(amount));\\n }\\n _moveDelegateVotes(delegates(from), delegates(to), amount);\\n }\\n\\n /**\\n * @dev Moves delegated votes from one delegate to another.\\n */\\n function _moveDelegateVotes(address from, address to, uint256 amount) internal virtual {\\n if (from != to && amount > 0) {\\n if (from != address(0)) {\\n (uint256 oldValue, uint256 newValue) = _push(\\n _delegateCheckpoints[from],\\n _subtract,\\n SafeCast.toUint208(amount)\\n );\\n emit DelegateVotesChanged(from, oldValue, newValue);\\n }\\n if (to != address(0)) {\\n (uint256 oldValue, uint256 newValue) = _push(\\n _delegateCheckpoints[to],\\n _add,\\n SafeCast.toUint208(amount)\\n );\\n emit DelegateVotesChanged(to, oldValue, newValue);\\n }\\n }\\n }\\n\\n /**\\n * @dev Get number of checkpoints for `account`.\\n */\\n function _numCheckpoints(address account) internal view virtual returns (uint32) {\\n return SafeCast.toUint32(_delegateCheckpoints[account].length());\\n }\\n\\n /**\\n * @dev Get the `pos`-th checkpoint for `account`.\\n */\\n function _checkpoints(\\n address account,\\n uint32 pos\\n ) internal view virtual returns (Checkpoints.Checkpoint208 memory) {\\n return _delegateCheckpoints[account].at(pos);\\n }\\n\\n function _push(\\n Checkpoints.Trace208 storage store,\\n function(uint208, uint208) view returns (uint208) op,\\n uint208 delta\\n ) private returns (uint208 oldValue, uint208 newValue) {\\n return store.push(clock(), op(store.latest(), delta));\\n }\\n\\n function _add(uint208 a, uint208 b) private pure returns (uint208) {\\n return a + b;\\n }\\n\\n function _subtract(uint208 a, uint208 b) private pure returns (uint208) {\\n return a - b;\\n }\\n\\n /**\\n * @dev Must return the voting units held by an account.\\n */\\n function _getVotingUnits(address) internal view virtual returns (uint256);\\n}\\n\",\"keccak256\":\"0x9128a324d265044430e5fa4a6a2853e92d6a62a2a5a69c2fc623f5b7b8cf3f34\",\"license\":\"MIT\"},\"@openzeppelin/contracts/interfaces/IERC165.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC165.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {IERC165} from \\\"../utils/introspection/IERC165.sol\\\";\\n\",\"keccak256\":\"0xde7e9fd9aee8d4f40772f96bb3b58836cbc6dfc0227014a061947f8821ea9724\",\"license\":\"MIT\"},\"@openzeppelin/contracts/interfaces/IERC4906.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (interfaces/IERC4906.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {IERC165} from \\\"./IERC165.sol\\\";\\nimport {IERC721} from \\\"./IERC721.sol\\\";\\n\\n/// @title ERC-721 Metadata Update Extension\\ninterface IERC4906 is IERC165, IERC721 {\\n /// @dev This event emits when the metadata of a token is changed.\\n /// So that the third-party platforms such as NFT market could\\n /// timely update the images and related attributes of the NFT.\\n event MetadataUpdate(uint256 _tokenId);\\n\\n /// @dev This event emits when the metadata of a range of tokens is changed.\\n /// So that the third-party platforms such as NFT market could\\n /// timely update the images and related attributes of the NFTs.\\n event BatchMetadataUpdate(uint256 _fromTokenId, uint256 _toTokenId);\\n}\\n\",\"keccak256\":\"0x1b8691e244f6e11d987459993671db0af33e6a29f7805eac6a9925cc6b601957\",\"license\":\"MIT\"},\"@openzeppelin/contracts/interfaces/IERC5267.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC5267.sol)\\n\\npragma solidity ^0.8.20;\\n\\ninterface IERC5267 {\\n /**\\n * @dev MAY be emitted to signal that the domain could have changed.\\n */\\n event EIP712DomainChanged();\\n\\n /**\\n * @dev returns the fields and values that describe the domain separator used by this contract for EIP-712\\n * signature.\\n */\\n function eip712Domain()\\n external\\n view\\n returns (\\n bytes1 fields,\\n string memory name,\\n string memory version,\\n uint256 chainId,\\n address verifyingContract,\\n bytes32 salt,\\n uint256[] memory extensions\\n );\\n}\\n\",\"keccak256\":\"0x92aa1df62dc3d33f1656d63bede0923e0df0b706ad4137c8b10b0a8fe549fd92\",\"license\":\"MIT\"},\"@openzeppelin/contracts/interfaces/IERC5805.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC5805.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {IVotes} from \\\"../governance/utils/IVotes.sol\\\";\\nimport {IERC6372} from \\\"./IERC6372.sol\\\";\\n\\ninterface IERC5805 is IERC6372, IVotes {}\\n\",\"keccak256\":\"0x4b9b89f91adbb7d3574f85394754cfb08c5b4eafca8a7061e2094a019ab8f818\",\"license\":\"MIT\"},\"@openzeppelin/contracts/interfaces/IERC6372.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC6372.sol)\\n\\npragma solidity ^0.8.20;\\n\\ninterface IERC6372 {\\n /**\\n * @dev Clock used for flagging checkpoints. Can be overridden to implement timestamp based checkpoints (and voting).\\n */\\n function clock() external view returns (uint48);\\n\\n /**\\n * @dev Description of the clock\\n */\\n // solhint-disable-next-line func-name-mixedcase\\n function CLOCK_MODE() external view returns (string memory);\\n}\\n\",\"keccak256\":\"0xeb2857b7dafb7e0d8526dbfe794e6c047df2851c9e6ee91dc4a55f3c34af5d33\",\"license\":\"MIT\"},\"@openzeppelin/contracts/interfaces/IERC721.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC721.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {IERC721} from \\\"../token/ERC721/IERC721.sol\\\";\\n\",\"keccak256\":\"0xc4d7ebf63eb2f6bf3fee1b6c0ee775efa9f31b4843a5511d07eea147e212932d\",\"license\":\"MIT\"},\"@openzeppelin/contracts/interfaces/draft-IERC6093.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (interfaces/draft-IERC6093.sol)\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Standard ERC-20 Errors\\n * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC-20 tokens.\\n */\\ninterface IERC20Errors {\\n /**\\n * @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers.\\n * @param sender Address whose tokens are being transferred.\\n * @param balance Current balance for the interacting account.\\n * @param needed Minimum amount required to perform a transfer.\\n */\\n error ERC20InsufficientBalance(address sender, uint256 balance, uint256 needed);\\n\\n /**\\n * @dev Indicates a failure with the token `sender`. Used in transfers.\\n * @param sender Address whose tokens are being transferred.\\n */\\n error ERC20InvalidSender(address sender);\\n\\n /**\\n * @dev Indicates a failure with the token `receiver`. Used in transfers.\\n * @param receiver Address to which tokens are being transferred.\\n */\\n error ERC20InvalidReceiver(address receiver);\\n\\n /**\\n * @dev Indicates a failure with the `spender`\\u2019s `allowance`. Used in transfers.\\n * @param spender Address that may be allowed to operate on tokens without being their owner.\\n * @param allowance Amount of tokens a `spender` is allowed to operate with.\\n * @param needed Minimum amount required to perform a transfer.\\n */\\n error ERC20InsufficientAllowance(address spender, uint256 allowance, uint256 needed);\\n\\n /**\\n * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.\\n * @param approver Address initiating an approval operation.\\n */\\n error ERC20InvalidApprover(address approver);\\n\\n /**\\n * @dev Indicates a failure with the `spender` to be approved. Used in approvals.\\n * @param spender Address that may be allowed to operate on tokens without being their owner.\\n */\\n error ERC20InvalidSpender(address spender);\\n}\\n\\n/**\\n * @dev Standard ERC-721 Errors\\n * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC-721 tokens.\\n */\\ninterface IERC721Errors {\\n /**\\n * @dev Indicates that an address can't be an owner. For example, `address(0)` is a forbidden owner in ERC-20.\\n * Used in balance queries.\\n * @param owner Address of the current owner of a token.\\n */\\n error ERC721InvalidOwner(address owner);\\n\\n /**\\n * @dev Indicates a `tokenId` whose `owner` is the zero address.\\n * @param tokenId Identifier number of a token.\\n */\\n error ERC721NonexistentToken(uint256 tokenId);\\n\\n /**\\n * @dev Indicates an error related to the ownership over a particular token. Used in transfers.\\n * @param sender Address whose tokens are being transferred.\\n * @param tokenId Identifier number of a token.\\n * @param owner Address of the current owner of a token.\\n */\\n error ERC721IncorrectOwner(address sender, uint256 tokenId, address owner);\\n\\n /**\\n * @dev Indicates a failure with the token `sender`. Used in transfers.\\n * @param sender Address whose tokens are being transferred.\\n */\\n error ERC721InvalidSender(address sender);\\n\\n /**\\n * @dev Indicates a failure with the token `receiver`. Used in transfers.\\n * @param receiver Address to which tokens are being transferred.\\n */\\n error ERC721InvalidReceiver(address receiver);\\n\\n /**\\n * @dev Indicates a failure with the `operator`\\u2019s approval. Used in transfers.\\n * @param operator Address that may be allowed to operate on tokens without being their owner.\\n * @param tokenId Identifier number of a token.\\n */\\n error ERC721InsufficientApproval(address operator, uint256 tokenId);\\n\\n /**\\n * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.\\n * @param approver Address initiating an approval operation.\\n */\\n error ERC721InvalidApprover(address approver);\\n\\n /**\\n * @dev Indicates a failure with the `operator` to be approved. Used in approvals.\\n * @param operator Address that may be allowed to operate on tokens without being their owner.\\n */\\n error ERC721InvalidOperator(address operator);\\n}\\n\\n/**\\n * @dev Standard ERC-1155 Errors\\n * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC-1155 tokens.\\n */\\ninterface IERC1155Errors {\\n /**\\n * @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers.\\n * @param sender Address whose tokens are being transferred.\\n * @param balance Current balance for the interacting account.\\n * @param needed Minimum amount required to perform a transfer.\\n * @param tokenId Identifier number of a token.\\n */\\n error ERC1155InsufficientBalance(address sender, uint256 balance, uint256 needed, uint256 tokenId);\\n\\n /**\\n * @dev Indicates a failure with the token `sender`. Used in transfers.\\n * @param sender Address whose tokens are being transferred.\\n */\\n error ERC1155InvalidSender(address sender);\\n\\n /**\\n * @dev Indicates a failure with the token `receiver`. Used in transfers.\\n * @param receiver Address to which tokens are being transferred.\\n */\\n error ERC1155InvalidReceiver(address receiver);\\n\\n /**\\n * @dev Indicates a failure with the `operator`\\u2019s approval. Used in transfers.\\n * @param operator Address that may be allowed to operate on tokens without being their owner.\\n * @param owner Address of the current owner of a token.\\n */\\n error ERC1155MissingApprovalForAll(address operator, address owner);\\n\\n /**\\n * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.\\n * @param approver Address initiating an approval operation.\\n */\\n error ERC1155InvalidApprover(address approver);\\n\\n /**\\n * @dev Indicates a failure with the `operator` to be approved. Used in approvals.\\n * @param operator Address that may be allowed to operate on tokens without being their owner.\\n */\\n error ERC1155InvalidOperator(address operator);\\n\\n /**\\n * @dev Indicates an array length mismatch between ids and values in a safeBatchTransferFrom operation.\\n * Used in batch transfers.\\n * @param idsLength Length of the array of token identifiers\\n * @param valuesLength Length of the array of token amounts\\n */\\n error ERC1155InvalidArrayLength(uint256 idsLength, uint256 valuesLength);\\n}\\n\",\"keccak256\":\"0x880da465c203cec76b10d72dbd87c80f387df4102274f23eea1f9c9b0918792b\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC721/ERC721.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC721/ERC721.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {IERC721} from \\\"./IERC721.sol\\\";\\nimport {IERC721Metadata} from \\\"./extensions/IERC721Metadata.sol\\\";\\nimport {ERC721Utils} from \\\"./utils/ERC721Utils.sol\\\";\\nimport {Context} from \\\"../../utils/Context.sol\\\";\\nimport {Strings} from \\\"../../utils/Strings.sol\\\";\\nimport {IERC165, ERC165} from \\\"../../utils/introspection/ERC165.sol\\\";\\nimport {IERC721Errors} from \\\"../../interfaces/draft-IERC6093.sol\\\";\\n\\n/**\\n * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC-721] Non-Fungible Token Standard, including\\n * the Metadata extension, but not including the Enumerable extension, which is available separately as\\n * {ERC721Enumerable}.\\n */\\nabstract contract ERC721 is Context, ERC165, IERC721, IERC721Metadata, IERC721Errors {\\n using Strings for uint256;\\n\\n // Token name\\n string private _name;\\n\\n // Token symbol\\n string private _symbol;\\n\\n mapping(uint256 tokenId => address) private _owners;\\n\\n mapping(address owner => uint256) private _balances;\\n\\n mapping(uint256 tokenId => address) private _tokenApprovals;\\n\\n mapping(address owner => mapping(address operator => bool)) private _operatorApprovals;\\n\\n /**\\n * @dev Initializes the contract by setting a `name` and a `symbol` to the token collection.\\n */\\n constructor(string memory name_, string memory symbol_) {\\n _name = name_;\\n _symbol = symbol_;\\n }\\n\\n /**\\n * @dev See {IERC165-supportsInterface}.\\n */\\n function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {\\n return\\n interfaceId == type(IERC721).interfaceId ||\\n interfaceId == type(IERC721Metadata).interfaceId ||\\n super.supportsInterface(interfaceId);\\n }\\n\\n /**\\n * @dev See {IERC721-balanceOf}.\\n */\\n function balanceOf(address owner) public view virtual returns (uint256) {\\n if (owner == address(0)) {\\n revert ERC721InvalidOwner(address(0));\\n }\\n return _balances[owner];\\n }\\n\\n /**\\n * @dev See {IERC721-ownerOf}.\\n */\\n function ownerOf(uint256 tokenId) public view virtual returns (address) {\\n return _requireOwned(tokenId);\\n }\\n\\n /**\\n * @dev See {IERC721Metadata-name}.\\n */\\n function name() public view virtual returns (string memory) {\\n return _name;\\n }\\n\\n /**\\n * @dev See {IERC721Metadata-symbol}.\\n */\\n function symbol() public view virtual returns (string memory) {\\n return _symbol;\\n }\\n\\n /**\\n * @dev See {IERC721Metadata-tokenURI}.\\n */\\n function tokenURI(uint256 tokenId) public view virtual returns (string memory) {\\n _requireOwned(tokenId);\\n\\n string memory baseURI = _baseURI();\\n return bytes(baseURI).length > 0 ? string.concat(baseURI, tokenId.toString()) : \\\"\\\";\\n }\\n\\n /**\\n * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each\\n * token will be the concatenation of the `baseURI` and the `tokenId`. Empty\\n * by default, can be overridden in child contracts.\\n */\\n function _baseURI() internal view virtual returns (string memory) {\\n return \\\"\\\";\\n }\\n\\n /**\\n * @dev See {IERC721-approve}.\\n */\\n function approve(address to, uint256 tokenId) public virtual {\\n _approve(to, tokenId, _msgSender());\\n }\\n\\n /**\\n * @dev See {IERC721-getApproved}.\\n */\\n function getApproved(uint256 tokenId) public view virtual returns (address) {\\n _requireOwned(tokenId);\\n\\n return _getApproved(tokenId);\\n }\\n\\n /**\\n * @dev See {IERC721-setApprovalForAll}.\\n */\\n function setApprovalForAll(address operator, bool approved) public virtual {\\n _setApprovalForAll(_msgSender(), operator, approved);\\n }\\n\\n /**\\n * @dev See {IERC721-isApprovedForAll}.\\n */\\n function isApprovedForAll(address owner, address operator) public view virtual returns (bool) {\\n return _operatorApprovals[owner][operator];\\n }\\n\\n /**\\n * @dev See {IERC721-transferFrom}.\\n */\\n function transferFrom(address from, address to, uint256 tokenId) public virtual {\\n if (to == address(0)) {\\n revert ERC721InvalidReceiver(address(0));\\n }\\n // Setting an \\\"auth\\\" arguments enables the `_isAuthorized` check which verifies that the token exists\\n // (from != 0). Therefore, it is not needed to verify that the return value is not 0 here.\\n address previousOwner = _update(to, tokenId, _msgSender());\\n if (previousOwner != from) {\\n revert ERC721IncorrectOwner(from, tokenId, previousOwner);\\n }\\n }\\n\\n /**\\n * @dev See {IERC721-safeTransferFrom}.\\n */\\n function safeTransferFrom(address from, address to, uint256 tokenId) public {\\n safeTransferFrom(from, to, tokenId, \\\"\\\");\\n }\\n\\n /**\\n * @dev See {IERC721-safeTransferFrom}.\\n */\\n function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory data) public virtual {\\n transferFrom(from, to, tokenId);\\n ERC721Utils.checkOnERC721Received(_msgSender(), from, to, tokenId, data);\\n }\\n\\n /**\\n * @dev Returns the owner of the `tokenId`. Does NOT revert if token doesn't exist\\n *\\n * IMPORTANT: Any overrides to this function that add ownership of tokens not tracked by the\\n * core ERC-721 logic MUST be matched with the use of {_increaseBalance} to keep balances\\n * consistent with ownership. The invariant to preserve is that for any address `a` the value returned by\\n * `balanceOf(a)` must be equal to the number of tokens such that `_ownerOf(tokenId)` is `a`.\\n */\\n function _ownerOf(uint256 tokenId) internal view virtual returns (address) {\\n return _owners[tokenId];\\n }\\n\\n /**\\n * @dev Returns the approved address for `tokenId`. Returns 0 if `tokenId` is not minted.\\n */\\n function _getApproved(uint256 tokenId) internal view virtual returns (address) {\\n return _tokenApprovals[tokenId];\\n }\\n\\n /**\\n * @dev Returns whether `spender` is allowed to manage `owner`'s tokens, or `tokenId` in\\n * particular (ignoring whether it is owned by `owner`).\\n *\\n * WARNING: This function assumes that `owner` is the actual owner of `tokenId` and does not verify this\\n * assumption.\\n */\\n function _isAuthorized(address owner, address spender, uint256 tokenId) internal view virtual returns (bool) {\\n return\\n spender != address(0) &&\\n (owner == spender || isApprovedForAll(owner, spender) || _getApproved(tokenId) == spender);\\n }\\n\\n /**\\n * @dev Checks if `spender` can operate on `tokenId`, assuming the provided `owner` is the actual owner.\\n * Reverts if:\\n * - `spender` does not have approval from `owner` for `tokenId`.\\n * - `spender` does not have approval to manage all of `owner`'s assets.\\n *\\n * WARNING: This function assumes that `owner` is the actual owner of `tokenId` and does not verify this\\n * assumption.\\n */\\n function _checkAuthorized(address owner, address spender, uint256 tokenId) internal view virtual {\\n if (!_isAuthorized(owner, spender, tokenId)) {\\n if (owner == address(0)) {\\n revert ERC721NonexistentToken(tokenId);\\n } else {\\n revert ERC721InsufficientApproval(spender, tokenId);\\n }\\n }\\n }\\n\\n /**\\n * @dev Unsafe write access to the balances, used by extensions that \\\"mint\\\" tokens using an {ownerOf} override.\\n *\\n * NOTE: the value is limited to type(uint128).max. This protect against _balance overflow. It is unrealistic that\\n * a uint256 would ever overflow from increments when these increments are bounded to uint128 values.\\n *\\n * WARNING: Increasing an account's balance using this function tends to be paired with an override of the\\n * {_ownerOf} function to resolve the ownership of the corresponding tokens so that balances and ownership\\n * remain consistent with one another.\\n */\\n function _increaseBalance(address account, uint128 value) internal virtual {\\n unchecked {\\n _balances[account] += value;\\n }\\n }\\n\\n /**\\n * @dev Transfers `tokenId` from its current owner to `to`, or alternatively mints (or burns) if the current owner\\n * (or `to`) is the zero address. Returns the owner of the `tokenId` before the update.\\n *\\n * The `auth` argument is optional. If the value passed is non 0, then this function will check that\\n * `auth` is either the owner of the token, or approved to operate on the token (by the owner).\\n *\\n * Emits a {Transfer} event.\\n *\\n * NOTE: If overriding this function in a way that tracks balances, see also {_increaseBalance}.\\n */\\n function _update(address to, uint256 tokenId, address auth) internal virtual returns (address) {\\n address from = _ownerOf(tokenId);\\n\\n // Perform (optional) operator check\\n if (auth != address(0)) {\\n _checkAuthorized(from, auth, tokenId);\\n }\\n\\n // Execute the update\\n if (from != address(0)) {\\n // Clear approval. No need to re-authorize or emit the Approval event\\n _approve(address(0), tokenId, address(0), false);\\n\\n unchecked {\\n _balances[from] -= 1;\\n }\\n }\\n\\n if (to != address(0)) {\\n unchecked {\\n _balances[to] += 1;\\n }\\n }\\n\\n _owners[tokenId] = to;\\n\\n emit Transfer(from, to, tokenId);\\n\\n return from;\\n }\\n\\n /**\\n * @dev Mints `tokenId` and transfers it to `to`.\\n *\\n * WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible\\n *\\n * Requirements:\\n *\\n * - `tokenId` must not exist.\\n * - `to` cannot be the zero address.\\n *\\n * Emits a {Transfer} event.\\n */\\n function _mint(address to, uint256 tokenId) internal {\\n if (to == address(0)) {\\n revert ERC721InvalidReceiver(address(0));\\n }\\n address previousOwner = _update(to, tokenId, address(0));\\n if (previousOwner != address(0)) {\\n revert ERC721InvalidSender(address(0));\\n }\\n }\\n\\n /**\\n * @dev Mints `tokenId`, transfers it to `to` and checks for `to` acceptance.\\n *\\n * Requirements:\\n *\\n * - `tokenId` must not exist.\\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\\n *\\n * Emits a {Transfer} event.\\n */\\n function _safeMint(address to, uint256 tokenId) internal {\\n _safeMint(to, tokenId, \\\"\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is\\n * forwarded in {IERC721Receiver-onERC721Received} to contract recipients.\\n */\\n function _safeMint(address to, uint256 tokenId, bytes memory data) internal virtual {\\n _mint(to, tokenId);\\n ERC721Utils.checkOnERC721Received(_msgSender(), address(0), to, tokenId, data);\\n }\\n\\n /**\\n * @dev Destroys `tokenId`.\\n * The approval is cleared when the token is burned.\\n * This is an internal function that does not check if the sender is authorized to operate on the token.\\n *\\n * Requirements:\\n *\\n * - `tokenId` must exist.\\n *\\n * Emits a {Transfer} event.\\n */\\n function _burn(uint256 tokenId) internal {\\n address previousOwner = _update(address(0), tokenId, address(0));\\n if (previousOwner == address(0)) {\\n revert ERC721NonexistentToken(tokenId);\\n }\\n }\\n\\n /**\\n * @dev Transfers `tokenId` from `from` to `to`.\\n * As opposed to {transferFrom}, this imposes no restrictions on msg.sender.\\n *\\n * Requirements:\\n *\\n * - `to` cannot be the zero address.\\n * - `tokenId` token must be owned by `from`.\\n *\\n * Emits a {Transfer} event.\\n */\\n function _transfer(address from, address to, uint256 tokenId) internal {\\n if (to == address(0)) {\\n revert ERC721InvalidReceiver(address(0));\\n }\\n address previousOwner = _update(to, tokenId, address(0));\\n if (previousOwner == address(0)) {\\n revert ERC721NonexistentToken(tokenId);\\n } else if (previousOwner != from) {\\n revert ERC721IncorrectOwner(from, tokenId, previousOwner);\\n }\\n }\\n\\n /**\\n * @dev Safely transfers `tokenId` token from `from` to `to`, checking that contract recipients\\n * are aware of the ERC-721 standard to prevent tokens from being forever locked.\\n *\\n * `data` is additional data, it has no specified format and it is sent in call to `to`.\\n *\\n * This internal function is like {safeTransferFrom} in the sense that it invokes\\n * {IERC721Receiver-onERC721Received} on the receiver, and can be used to e.g.\\n * implement alternative mechanisms to perform token transfer, such as signature-based.\\n *\\n * Requirements:\\n *\\n * - `tokenId` token must exist and be owned by `from`.\\n * - `to` cannot be the zero address.\\n * - `from` cannot be the zero address.\\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\\n *\\n * Emits a {Transfer} event.\\n */\\n function _safeTransfer(address from, address to, uint256 tokenId) internal {\\n _safeTransfer(from, to, tokenId, \\\"\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-ERC721-_safeTransfer-address-address-uint256-}[`_safeTransfer`], with an additional `data` parameter which is\\n * forwarded in {IERC721Receiver-onERC721Received} to contract recipients.\\n */\\n function _safeTransfer(address from, address to, uint256 tokenId, bytes memory data) internal virtual {\\n _transfer(from, to, tokenId);\\n ERC721Utils.checkOnERC721Received(_msgSender(), from, to, tokenId, data);\\n }\\n\\n /**\\n * @dev Approve `to` to operate on `tokenId`\\n *\\n * The `auth` argument is optional. If the value passed is non 0, then this function will check that `auth` is\\n * either the owner of the token, or approved to operate on all tokens held by this owner.\\n *\\n * Emits an {Approval} event.\\n *\\n * Overrides to this logic should be done to the variant with an additional `bool emitEvent` argument.\\n */\\n function _approve(address to, uint256 tokenId, address auth) internal {\\n _approve(to, tokenId, auth, true);\\n }\\n\\n /**\\n * @dev Variant of `_approve` with an optional flag to enable or disable the {Approval} event. The event is not\\n * emitted in the context of transfers.\\n */\\n function _approve(address to, uint256 tokenId, address auth, bool emitEvent) internal virtual {\\n // Avoid reading the owner unless necessary\\n if (emitEvent || auth != address(0)) {\\n address owner = _requireOwned(tokenId);\\n\\n // We do not use _isAuthorized because single-token approvals should not be able to call approve\\n if (auth != address(0) && owner != auth && !isApprovedForAll(owner, auth)) {\\n revert ERC721InvalidApprover(auth);\\n }\\n\\n if (emitEvent) {\\n emit Approval(owner, to, tokenId);\\n }\\n }\\n\\n _tokenApprovals[tokenId] = to;\\n }\\n\\n /**\\n * @dev Approve `operator` to operate on all of `owner` tokens\\n *\\n * Requirements:\\n * - operator can't be the address zero.\\n *\\n * Emits an {ApprovalForAll} event.\\n */\\n function _setApprovalForAll(address owner, address operator, bool approved) internal virtual {\\n if (operator == address(0)) {\\n revert ERC721InvalidOperator(operator);\\n }\\n _operatorApprovals[owner][operator] = approved;\\n emit ApprovalForAll(owner, operator, approved);\\n }\\n\\n /**\\n * @dev Reverts if the `tokenId` doesn't have a current owner (it hasn't been minted, or it has been burned).\\n * Returns the owner.\\n *\\n * Overrides to ownership logic should be done to {_ownerOf}.\\n */\\n function _requireOwned(uint256 tokenId) internal view returns (address) {\\n address owner = _ownerOf(tokenId);\\n if (owner == address(0)) {\\n revert ERC721NonexistentToken(tokenId);\\n }\\n return owner;\\n }\\n}\\n\",\"keccak256\":\"0x39ed367e54765186281efcfe83e47cf0ad62cc879f10e191360712507125f29a\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC721/IERC721.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC721/IERC721.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {IERC165} from \\\"../../utils/introspection/IERC165.sol\\\";\\n\\n/**\\n * @dev Required interface of an ERC-721 compliant contract.\\n */\\ninterface IERC721 is IERC165 {\\n /**\\n * @dev Emitted when `tokenId` token is transferred from `from` to `to`.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);\\n\\n /**\\n * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.\\n */\\n event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);\\n\\n /**\\n * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.\\n */\\n event ApprovalForAll(address indexed owner, address indexed operator, bool approved);\\n\\n /**\\n * @dev Returns the number of tokens in ``owner``'s account.\\n */\\n function balanceOf(address owner) external view returns (uint256 balance);\\n\\n /**\\n * @dev Returns the owner of the `tokenId` token.\\n *\\n * Requirements:\\n *\\n * - `tokenId` must exist.\\n */\\n function ownerOf(uint256 tokenId) external view returns (address owner);\\n\\n /**\\n * @dev Safely transfers `tokenId` token from `from` to `to`.\\n *\\n * Requirements:\\n *\\n * - `from` cannot be the zero address.\\n * - `to` cannot be the zero address.\\n * - `tokenId` token must exist and be owned by `from`.\\n * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.\\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon\\n * a safe transfer.\\n *\\n * Emits a {Transfer} event.\\n */\\n function safeTransferFrom(address from, address to, uint256 tokenId, bytes calldata data) external;\\n\\n /**\\n * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients\\n * are aware of the ERC-721 protocol to prevent tokens from being forever locked.\\n *\\n * Requirements:\\n *\\n * - `from` cannot be the zero address.\\n * - `to` cannot be the zero address.\\n * - `tokenId` token must exist and be owned by `from`.\\n * - If the caller is not `from`, it must have been allowed to move this token by either {approve} or\\n * {setApprovalForAll}.\\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon\\n * a safe transfer.\\n *\\n * Emits a {Transfer} event.\\n */\\n function safeTransferFrom(address from, address to, uint256 tokenId) external;\\n\\n /**\\n * @dev Transfers `tokenId` token from `from` to `to`.\\n *\\n * WARNING: Note that the caller is responsible to confirm that the recipient is capable of receiving ERC-721\\n * or else they may be permanently lost. Usage of {safeTransferFrom} prevents loss, though the caller must\\n * understand this adds an external call which potentially creates a reentrancy vulnerability.\\n *\\n * Requirements:\\n *\\n * - `from` cannot be the zero address.\\n * - `to` cannot be the zero address.\\n * - `tokenId` token must be owned by `from`.\\n * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(address from, address to, uint256 tokenId) external;\\n\\n /**\\n * @dev Gives permission to `to` to transfer `tokenId` token to another account.\\n * The approval is cleared when the token is transferred.\\n *\\n * Only a single account can be approved at a time, so approving the zero address clears previous approvals.\\n *\\n * Requirements:\\n *\\n * - The caller must own the token or be an approved operator.\\n * - `tokenId` must exist.\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address to, uint256 tokenId) external;\\n\\n /**\\n * @dev Approve or remove `operator` as an operator for the caller.\\n * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.\\n *\\n * Requirements:\\n *\\n * - The `operator` cannot be the address zero.\\n *\\n * Emits an {ApprovalForAll} event.\\n */\\n function setApprovalForAll(address operator, bool approved) external;\\n\\n /**\\n * @dev Returns the account approved for `tokenId` token.\\n *\\n * Requirements:\\n *\\n * - `tokenId` must exist.\\n */\\n function getApproved(uint256 tokenId) external view returns (address operator);\\n\\n /**\\n * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.\\n *\\n * See {setApprovalForAll}\\n */\\n function isApprovedForAll(address owner, address operator) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x5dc63d1c6a12fe1b17793e1745877b2fcbe1964c3edfd0a482fac21ca8f18261\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC721/IERC721Receiver.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @title ERC-721 token receiver interface\\n * @dev Interface for any contract that wants to support safeTransfers\\n * from ERC-721 asset contracts.\\n */\\ninterface IERC721Receiver {\\n /**\\n * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom}\\n * by `operator` from `from`, this function is called.\\n *\\n * It must return its Solidity selector to confirm the token transfer.\\n * If any other value is returned or the interface is not implemented by the recipient, the transfer will be\\n * reverted.\\n *\\n * The selector can be obtained in Solidity with `IERC721Receiver.onERC721Received.selector`.\\n */\\n function onERC721Received(\\n address operator,\\n address from,\\n uint256 tokenId,\\n bytes calldata data\\n ) external returns (bytes4);\\n}\\n\",\"keccak256\":\"0xb5afb8e8eebc4d1c6404df2f5e1e6d2c3d24fd01e5dfc855314951ecfaae462d\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC721/extensions/ERC721Burnable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC721/extensions/ERC721Burnable.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {ERC721} from \\\"../ERC721.sol\\\";\\nimport {Context} from \\\"../../../utils/Context.sol\\\";\\n\\n/**\\n * @title ERC-721 Burnable Token\\n * @dev ERC-721 Token that can be burned (destroyed).\\n */\\nabstract contract ERC721Burnable is Context, ERC721 {\\n /**\\n * @dev Burns `tokenId`. See {ERC721-_burn}.\\n *\\n * Requirements:\\n *\\n * - The caller must own `tokenId` or be an approved operator.\\n */\\n function burn(uint256 tokenId) public virtual {\\n // Setting an \\\"auth\\\" arguments enables the `_isAuthorized` check which verifies that the token exists\\n // (from != 0). Therefore, it is not needed to verify that the return value is not 0 here.\\n _update(address(0), tokenId, _msgSender());\\n }\\n}\\n\",\"keccak256\":\"0xdee1ff07172e443c6600581fc4f11e7830a6d33e4e551752935b835d52a09404\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC721/extensions/ERC721Enumerable.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {ERC721} from \\\"../ERC721.sol\\\";\\nimport {IERC721Enumerable} from \\\"./IERC721Enumerable.sol\\\";\\nimport {IERC165} from \\\"../../../utils/introspection/ERC165.sol\\\";\\n\\n/**\\n * @dev This implements an optional extension of {ERC721} defined in the ERC that adds enumerability\\n * of all the token ids in the contract as well as all token ids owned by each account.\\n *\\n * CAUTION: {ERC721} extensions that implement custom `balanceOf` logic, such as {ERC721Consecutive},\\n * interfere with enumerability and should not be used together with {ERC721Enumerable}.\\n */\\nabstract contract ERC721Enumerable is ERC721, IERC721Enumerable {\\n mapping(address owner => mapping(uint256 index => uint256)) private _ownedTokens;\\n mapping(uint256 tokenId => uint256) private _ownedTokensIndex;\\n\\n uint256[] private _allTokens;\\n mapping(uint256 tokenId => uint256) private _allTokensIndex;\\n\\n /**\\n * @dev An `owner`'s token query was out of bounds for `index`.\\n *\\n * NOTE: The owner being `address(0)` indicates a global out of bounds index.\\n */\\n error ERC721OutOfBoundsIndex(address owner, uint256 index);\\n\\n /**\\n * @dev Batch mint is not allowed.\\n */\\n error ERC721EnumerableForbiddenBatchMint();\\n\\n /**\\n * @dev See {IERC165-supportsInterface}.\\n */\\n function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165, ERC721) returns (bool) {\\n return interfaceId == type(IERC721Enumerable).interfaceId || super.supportsInterface(interfaceId);\\n }\\n\\n /**\\n * @dev See {IERC721Enumerable-tokenOfOwnerByIndex}.\\n */\\n function tokenOfOwnerByIndex(address owner, uint256 index) public view virtual returns (uint256) {\\n if (index >= balanceOf(owner)) {\\n revert ERC721OutOfBoundsIndex(owner, index);\\n }\\n return _ownedTokens[owner][index];\\n }\\n\\n /**\\n * @dev See {IERC721Enumerable-totalSupply}.\\n */\\n function totalSupply() public view virtual returns (uint256) {\\n return _allTokens.length;\\n }\\n\\n /**\\n * @dev See {IERC721Enumerable-tokenByIndex}.\\n */\\n function tokenByIndex(uint256 index) public view virtual returns (uint256) {\\n if (index >= totalSupply()) {\\n revert ERC721OutOfBoundsIndex(address(0), index);\\n }\\n return _allTokens[index];\\n }\\n\\n /**\\n * @dev See {ERC721-_update}.\\n */\\n function _update(address to, uint256 tokenId, address auth) internal virtual override returns (address) {\\n address previousOwner = super._update(to, tokenId, auth);\\n\\n if (previousOwner == address(0)) {\\n _addTokenToAllTokensEnumeration(tokenId);\\n } else if (previousOwner != to) {\\n _removeTokenFromOwnerEnumeration(previousOwner, tokenId);\\n }\\n if (to == address(0)) {\\n _removeTokenFromAllTokensEnumeration(tokenId);\\n } else if (previousOwner != to) {\\n _addTokenToOwnerEnumeration(to, tokenId);\\n }\\n\\n return previousOwner;\\n }\\n\\n /**\\n * @dev Private function to add a token to this extension's ownership-tracking data structures.\\n * @param to address representing the new owner of the given token ID\\n * @param tokenId uint256 ID of the token to be added to the tokens list of the given address\\n */\\n function _addTokenToOwnerEnumeration(address to, uint256 tokenId) private {\\n uint256 length = balanceOf(to) - 1;\\n _ownedTokens[to][length] = tokenId;\\n _ownedTokensIndex[tokenId] = length;\\n }\\n\\n /**\\n * @dev Private function to add a token to this extension's token tracking data structures.\\n * @param tokenId uint256 ID of the token to be added to the tokens list\\n */\\n function _addTokenToAllTokensEnumeration(uint256 tokenId) private {\\n _allTokensIndex[tokenId] = _allTokens.length;\\n _allTokens.push(tokenId);\\n }\\n\\n /**\\n * @dev Private function to remove a token from this extension's ownership-tracking data structures. Note that\\n * while the token is not assigned a new owner, the `_ownedTokensIndex` mapping is _not_ updated: this allows for\\n * gas optimizations e.g. when performing a transfer operation (avoiding double writes).\\n * This has O(1) time complexity, but alters the order of the _ownedTokens array.\\n * @param from address representing the previous owner of the given token ID\\n * @param tokenId uint256 ID of the token to be removed from the tokens list of the given address\\n */\\n function _removeTokenFromOwnerEnumeration(address from, uint256 tokenId) private {\\n // To prevent a gap in from's tokens array, we store the last token in the index of the token to delete, and\\n // then delete the last slot (swap and pop).\\n\\n uint256 lastTokenIndex = balanceOf(from);\\n uint256 tokenIndex = _ownedTokensIndex[tokenId];\\n\\n mapping(uint256 index => uint256) storage _ownedTokensByOwner = _ownedTokens[from];\\n\\n // When the token to delete is the last token, the swap operation is unnecessary\\n if (tokenIndex != lastTokenIndex) {\\n uint256 lastTokenId = _ownedTokensByOwner[lastTokenIndex];\\n\\n _ownedTokensByOwner[tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token\\n _ownedTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index\\n }\\n\\n // This also deletes the contents at the last position of the array\\n delete _ownedTokensIndex[tokenId];\\n delete _ownedTokensByOwner[lastTokenIndex];\\n }\\n\\n /**\\n * @dev Private function to remove a token from this extension's token tracking data structures.\\n * This has O(1) time complexity, but alters the order of the _allTokens array.\\n * @param tokenId uint256 ID of the token to be removed from the tokens list\\n */\\n function _removeTokenFromAllTokensEnumeration(uint256 tokenId) private {\\n // To prevent a gap in the tokens array, we store the last token in the index of the token to delete, and\\n // then delete the last slot (swap and pop).\\n\\n uint256 lastTokenIndex = _allTokens.length - 1;\\n uint256 tokenIndex = _allTokensIndex[tokenId];\\n\\n // When the token to delete is the last token, the swap operation is unnecessary. However, since this occurs so\\n // rarely (when the last minted token is burnt) that we still do the swap here to avoid the gas cost of adding\\n // an 'if' statement (like in _removeTokenFromOwnerEnumeration)\\n uint256 lastTokenId = _allTokens[lastTokenIndex];\\n\\n _allTokens[tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token\\n _allTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index\\n\\n // This also deletes the contents at the last position of the array\\n delete _allTokensIndex[tokenId];\\n _allTokens.pop();\\n }\\n\\n /**\\n * See {ERC721-_increaseBalance}. We need that to account tokens that were minted in batch\\n */\\n function _increaseBalance(address account, uint128 amount) internal virtual override {\\n if (amount > 0) {\\n revert ERC721EnumerableForbiddenBatchMint();\\n }\\n super._increaseBalance(account, amount);\\n }\\n}\\n\",\"keccak256\":\"0x5191f783af281c75b7de0f1e3e36cdc6ac5cb2358d929584c4953fd02fa2b5eb\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC721/extensions/ERC721URIStorage.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {ERC721} from \\\"../ERC721.sol\\\";\\nimport {Strings} from \\\"../../../utils/Strings.sol\\\";\\nimport {IERC4906} from \\\"../../../interfaces/IERC4906.sol\\\";\\nimport {IERC165} from \\\"../../../interfaces/IERC165.sol\\\";\\n\\n/**\\n * @dev ERC-721 token with storage based token URI management.\\n */\\nabstract contract ERC721URIStorage is IERC4906, ERC721 {\\n using Strings for uint256;\\n\\n // Interface ID as defined in ERC-4906. This does not correspond to a traditional interface ID as ERC-4906 only\\n // defines events and does not include any external function.\\n bytes4 private constant ERC4906_INTERFACE_ID = bytes4(0x49064906);\\n\\n // Optional mapping for token URIs\\n mapping(uint256 tokenId => string) private _tokenURIs;\\n\\n /**\\n * @dev See {IERC165-supportsInterface}\\n */\\n function supportsInterface(bytes4 interfaceId) public view virtual override(ERC721, IERC165) returns (bool) {\\n return interfaceId == ERC4906_INTERFACE_ID || super.supportsInterface(interfaceId);\\n }\\n\\n /**\\n * @dev See {IERC721Metadata-tokenURI}.\\n */\\n function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {\\n _requireOwned(tokenId);\\n\\n string memory _tokenURI = _tokenURIs[tokenId];\\n string memory base = _baseURI();\\n\\n // If there is no base URI, return the token URI.\\n if (bytes(base).length == 0) {\\n return _tokenURI;\\n }\\n // If both are set, concatenate the baseURI and tokenURI (via string.concat).\\n if (bytes(_tokenURI).length > 0) {\\n return string.concat(base, _tokenURI);\\n }\\n\\n return super.tokenURI(tokenId);\\n }\\n\\n /**\\n * @dev Sets `_tokenURI` as the tokenURI of `tokenId`.\\n *\\n * Emits {MetadataUpdate}.\\n */\\n function _setTokenURI(uint256 tokenId, string memory _tokenURI) internal virtual {\\n _tokenURIs[tokenId] = _tokenURI;\\n emit MetadataUpdate(tokenId);\\n }\\n}\\n\",\"keccak256\":\"0xe52813067c6d5838eeb34e1da8beb2514371a7d778266013b04ca3be1dda7100\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC721/extensions/ERC721Votes.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC721/extensions/ERC721Votes.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {ERC721} from \\\"../ERC721.sol\\\";\\nimport {Votes} from \\\"../../../governance/utils/Votes.sol\\\";\\n\\n/**\\n * @dev Extension of ERC-721 to support voting and delegation as implemented by {Votes}, where each individual NFT counts\\n * as 1 vote unit.\\n *\\n * Tokens do not count as votes until they are delegated, because votes must be tracked which incurs an additional cost\\n * on every transfer. Token holders can either delegate to a trusted representative who will decide how to make use of\\n * the votes in governance decisions, or they can delegate to themselves to be their own representative.\\n */\\nabstract contract ERC721Votes is ERC721, Votes {\\n /**\\n * @dev See {ERC721-_update}. Adjusts votes when tokens are transferred.\\n *\\n * Emits a {IVotes-DelegateVotesChanged} event.\\n */\\n function _update(address to, uint256 tokenId, address auth) internal virtual override returns (address) {\\n address previousOwner = super._update(to, tokenId, auth);\\n\\n _transferVotingUnits(previousOwner, to, 1);\\n\\n return previousOwner;\\n }\\n\\n /**\\n * @dev Returns the balance of `account`.\\n *\\n * WARNING: Overriding this function will likely result in incorrect vote tracking.\\n */\\n function _getVotingUnits(address account) internal view virtual override returns (uint256) {\\n return balanceOf(account);\\n }\\n\\n /**\\n * @dev See {ERC721-_increaseBalance}. We need that to account tokens that were minted in batch.\\n */\\n function _increaseBalance(address account, uint128 amount) internal virtual override {\\n super._increaseBalance(account, amount);\\n _transferVotingUnits(address(0), account, amount);\\n }\\n}\\n\",\"keccak256\":\"0x8b245d62f3ce9596d3a52c7b6c738cd95a40fe8dba898e90fcce18bb7a2d8239\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC721/extensions/IERC721Enumerable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC721/extensions/IERC721Enumerable.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {IERC721} from \\\"../IERC721.sol\\\";\\n\\n/**\\n * @title ERC-721 Non-Fungible Token Standard, optional enumeration extension\\n * @dev See https://eips.ethereum.org/EIPS/eip-721\\n */\\ninterface IERC721Enumerable is IERC721 {\\n /**\\n * @dev Returns the total amount of tokens stored by the contract.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns a token ID owned by `owner` at a given `index` of its token list.\\n * Use along with {balanceOf} to enumerate all of ``owner``'s tokens.\\n */\\n function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256);\\n\\n /**\\n * @dev Returns a token ID at a given `index` of all the tokens stored by the contract.\\n * Use along with {totalSupply} to enumerate all tokens.\\n */\\n function tokenByIndex(uint256 index) external view returns (uint256);\\n}\\n\",\"keccak256\":\"0x3d6954a93ac198a2ffa384fa58ccf18e7e235263e051a394328002eff4e073de\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC721/extensions/IERC721Metadata.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {IERC721} from \\\"../IERC721.sol\\\";\\n\\n/**\\n * @title ERC-721 Non-Fungible Token Standard, optional metadata extension\\n * @dev See https://eips.ethereum.org/EIPS/eip-721\\n */\\ninterface IERC721Metadata is IERC721 {\\n /**\\n * @dev Returns the token collection name.\\n */\\n function name() external view returns (string memory);\\n\\n /**\\n * @dev Returns the token collection symbol.\\n */\\n function symbol() external view returns (string memory);\\n\\n /**\\n * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token.\\n */\\n function tokenURI(uint256 tokenId) external view returns (string memory);\\n}\\n\",\"keccak256\":\"0x37d1aaaa5a2908a09e9dcf56a26ddf762ecf295afb5964695937344fc6802ce1\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC721/utils/ERC721Utils.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC721/utils/ERC721Utils.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {IERC721Receiver} from \\\"../IERC721Receiver.sol\\\";\\nimport {IERC721Errors} from \\\"../../../interfaces/draft-IERC6093.sol\\\";\\n\\n/**\\n * @dev Library that provide common ERC-721 utility functions.\\n *\\n * See https://eips.ethereum.org/EIPS/eip-721[ERC-721].\\n *\\n * _Available since v5.1._\\n */\\nlibrary ERC721Utils {\\n /**\\n * @dev Performs an acceptance check for the provided `operator` by calling {IERC721-onERC721Received}\\n * on the `to` address. The `operator` is generally the address that initiated the token transfer (i.e. `msg.sender`).\\n *\\n * The acceptance call is not executed and treated as a no-op if the target address doesn't contain code (i.e. an EOA).\\n * Otherwise, the recipient must implement {IERC721Receiver-onERC721Received} and return the acceptance magic value to accept\\n * the transfer.\\n */\\n function checkOnERC721Received(\\n address operator,\\n address from,\\n address to,\\n uint256 tokenId,\\n bytes memory data\\n ) internal {\\n if (to.code.length > 0) {\\n try IERC721Receiver(to).onERC721Received(operator, from, tokenId, data) returns (bytes4 retval) {\\n if (retval != IERC721Receiver.onERC721Received.selector) {\\n // Token rejected\\n revert IERC721Errors.ERC721InvalidReceiver(to);\\n }\\n } catch (bytes memory reason) {\\n if (reason.length == 0) {\\n // non-IERC721Receiver implementer\\n revert IERC721Errors.ERC721InvalidReceiver(to);\\n } else {\\n assembly (\\\"memory-safe\\\") {\\n revert(add(32, reason), mload(reason))\\n }\\n }\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x40399695922383778f9f540a620bec475a2f8e0f08d41f0005682842e28a9855\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)\\n\\npragma solidity ^0.8.20;\\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\":\"0x493033a8d1b176a037b2cc6a04dad01a5c157722049bbecf632ca876224dd4b2\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Nonces.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/Nonces.sol)\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Provides tracking nonces for addresses. Nonces will only increment.\\n */\\nabstract contract Nonces {\\n /**\\n * @dev The nonce used for an `account` is not the expected current nonce.\\n */\\n error InvalidAccountNonce(address account, uint256 currentNonce);\\n\\n mapping(address account => uint256) private _nonces;\\n\\n /**\\n * @dev Returns the next unused nonce for an address.\\n */\\n function nonces(address owner) public view virtual returns (uint256) {\\n return _nonces[owner];\\n }\\n\\n /**\\n * @dev Consumes a nonce.\\n *\\n * Returns the current value and increments nonce.\\n */\\n function _useNonce(address owner) internal virtual returns (uint256) {\\n // For each account, the nonce has an initial value of 0, can only be incremented by one, and cannot be\\n // decremented or reset. This guarantees that the nonce never overflows.\\n unchecked {\\n // It is important to do x++ and not ++x here.\\n return _nonces[owner]++;\\n }\\n }\\n\\n /**\\n * @dev Same as {_useNonce} but checking that `nonce` is the next valid for `owner`.\\n */\\n function _useCheckedNonce(address owner, uint256 nonce) internal virtual {\\n uint256 current = _useNonce(owner);\\n if (nonce != current) {\\n revert InvalidAccountNonce(owner, current);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x0082767004fca261c332e9ad100868327a863a88ef724e844857128845ab350f\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Panic.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/Panic.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Helper library for emitting standardized panic codes.\\n *\\n * ```solidity\\n * contract Example {\\n * using Panic for uint256;\\n *\\n * // Use any of the declared internal constants\\n * function foo() { Panic.GENERIC.panic(); }\\n *\\n * // Alternatively\\n * function foo() { Panic.panic(Panic.GENERIC); }\\n * }\\n * ```\\n *\\n * Follows the list from https://github.com/ethereum/solidity/blob/v0.8.24/libsolutil/ErrorCodes.h[libsolutil].\\n *\\n * _Available since v5.1._\\n */\\n// slither-disable-next-line unused-state\\nlibrary Panic {\\n /// @dev generic / unspecified error\\n uint256 internal constant GENERIC = 0x00;\\n /// @dev used by the assert() builtin\\n uint256 internal constant ASSERT = 0x01;\\n /// @dev arithmetic underflow or overflow\\n uint256 internal constant UNDER_OVERFLOW = 0x11;\\n /// @dev division or modulo by zero\\n uint256 internal constant DIVISION_BY_ZERO = 0x12;\\n /// @dev enum conversion error\\n uint256 internal constant ENUM_CONVERSION_ERROR = 0x21;\\n /// @dev invalid encoding in storage\\n uint256 internal constant STORAGE_ENCODING_ERROR = 0x22;\\n /// @dev empty array pop\\n uint256 internal constant EMPTY_ARRAY_POP = 0x31;\\n /// @dev array out of bounds access\\n uint256 internal constant ARRAY_OUT_OF_BOUNDS = 0x32;\\n /// @dev resource error (too large allocation or too large array)\\n uint256 internal constant RESOURCE_ERROR = 0x41;\\n /// @dev calling invalid internal function\\n uint256 internal constant INVALID_INTERNAL_FUNCTION = 0x51;\\n\\n /// @dev Reverts with a panic code. Recommended to use with\\n /// the internal constants with predefined codes.\\n function panic(uint256 code) internal pure {\\n assembly (\\\"memory-safe\\\") {\\n mstore(0x00, 0x4e487b71)\\n mstore(0x20, code)\\n revert(0x1c, 0x24)\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf7fe324703a64fc51702311dc51562d5cb1497734f074e4f483bfb6717572d7a\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/ShortStrings.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/ShortStrings.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {StorageSlot} from \\\"./StorageSlot.sol\\\";\\n\\n// | string | 0xAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA |\\n// | length | 0x BB |\\ntype ShortString is bytes32;\\n\\n/**\\n * @dev This library provides functions to convert short memory strings\\n * into a `ShortString` type that can be used as an immutable variable.\\n *\\n * Strings of arbitrary length can be optimized using this library if\\n * they are short enough (up to 31 bytes) by packing them with their\\n * length (1 byte) in a single EVM word (32 bytes). Additionally, a\\n * fallback mechanism can be used for every other case.\\n *\\n * Usage example:\\n *\\n * ```solidity\\n * contract Named {\\n * using ShortStrings for *;\\n *\\n * ShortString private immutable _name;\\n * string private _nameFallback;\\n *\\n * constructor(string memory contractName) {\\n * _name = contractName.toShortStringWithFallback(_nameFallback);\\n * }\\n *\\n * function name() external view returns (string memory) {\\n * return _name.toStringWithFallback(_nameFallback);\\n * }\\n * }\\n * ```\\n */\\nlibrary ShortStrings {\\n // Used as an identifier for strings longer than 31 bytes.\\n bytes32 private constant FALLBACK_SENTINEL = 0x00000000000000000000000000000000000000000000000000000000000000FF;\\n\\n error StringTooLong(string str);\\n error InvalidShortString();\\n\\n /**\\n * @dev Encode a string of at most 31 chars into a `ShortString`.\\n *\\n * This will trigger a `StringTooLong` error is the input string is too long.\\n */\\n function toShortString(string memory str) internal pure returns (ShortString) {\\n bytes memory bstr = bytes(str);\\n if (bstr.length > 31) {\\n revert StringTooLong(str);\\n }\\n return ShortString.wrap(bytes32(uint256(bytes32(bstr)) | bstr.length));\\n }\\n\\n /**\\n * @dev Decode a `ShortString` back to a \\\"normal\\\" string.\\n */\\n function toString(ShortString sstr) internal pure returns (string memory) {\\n uint256 len = byteLength(sstr);\\n // using `new string(len)` would work locally but is not memory safe.\\n string memory str = new string(32);\\n assembly (\\\"memory-safe\\\") {\\n mstore(str, len)\\n mstore(add(str, 0x20), sstr)\\n }\\n return str;\\n }\\n\\n /**\\n * @dev Return the length of a `ShortString`.\\n */\\n function byteLength(ShortString sstr) internal pure returns (uint256) {\\n uint256 result = uint256(ShortString.unwrap(sstr)) & 0xFF;\\n if (result > 31) {\\n revert InvalidShortString();\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Encode a string into a `ShortString`, or write it to storage if it is too long.\\n */\\n function toShortStringWithFallback(string memory value, string storage store) internal returns (ShortString) {\\n if (bytes(value).length < 32) {\\n return toShortString(value);\\n } else {\\n StorageSlot.getStringSlot(store).value = value;\\n return ShortString.wrap(FALLBACK_SENTINEL);\\n }\\n }\\n\\n /**\\n * @dev Decode a string that was encoded to `ShortString` or written to storage using {setWithFallback}.\\n */\\n function toStringWithFallback(ShortString value, string storage store) internal pure returns (string memory) {\\n if (ShortString.unwrap(value) != FALLBACK_SENTINEL) {\\n return toString(value);\\n } else {\\n return store;\\n }\\n }\\n\\n /**\\n * @dev Return the length of a string that was encoded to `ShortString` or written to storage using\\n * {setWithFallback}.\\n *\\n * WARNING: This will return the \\\"byte length\\\" of the string. This may not reflect the actual length in terms of\\n * actual characters as the UTF-8 encoding of a single character can span over multiple bytes.\\n */\\n function byteLengthWithFallback(ShortString value, string storage store) internal view returns (uint256) {\\n if (ShortString.unwrap(value) != FALLBACK_SENTINEL) {\\n return byteLength(value);\\n } else {\\n return bytes(store).length;\\n }\\n }\\n}\\n\",\"keccak256\":\"0x7d94fa0af099a2172eb01f9c8a8a443cbe7e0e43654841563e4e09968efdb549\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/StorageSlot.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/StorageSlot.sol)\\n// This file was procedurally generated from scripts/generate/templates/StorageSlot.js.\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Library for reading and writing primitive types to specific storage slots.\\n *\\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\\n * This library helps with reading and writing to such slots without the need for inline assembly.\\n *\\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\\n *\\n * Example usage to set ERC-1967 implementation slot:\\n * ```solidity\\n * contract ERC1967 {\\n * // Define the slot. Alternatively, use the SlotDerivation library to derive the slot.\\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n *\\n * function _getImplementation() internal view returns (address) {\\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n * }\\n *\\n * function _setImplementation(address newImplementation) internal {\\n * require(newImplementation.code.length > 0);\\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n * }\\n * }\\n * ```\\n *\\n * TIP: Consider using this library along with {SlotDerivation}.\\n */\\nlibrary StorageSlot {\\n struct AddressSlot {\\n address value;\\n }\\n\\n struct BooleanSlot {\\n bool value;\\n }\\n\\n struct Bytes32Slot {\\n bytes32 value;\\n }\\n\\n struct Uint256Slot {\\n uint256 value;\\n }\\n\\n struct Int256Slot {\\n int256 value;\\n }\\n\\n struct StringSlot {\\n string value;\\n }\\n\\n struct BytesSlot {\\n bytes value;\\n }\\n\\n /**\\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\\n */\\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\\n assembly (\\\"memory-safe\\\") {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns a `BooleanSlot` with member `value` located at `slot`.\\n */\\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\\n assembly (\\\"memory-safe\\\") {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns a `Bytes32Slot` with member `value` located at `slot`.\\n */\\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\\n assembly (\\\"memory-safe\\\") {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns a `Uint256Slot` with member `value` located at `slot`.\\n */\\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\\n assembly (\\\"memory-safe\\\") {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns a `Int256Slot` with member `value` located at `slot`.\\n */\\n function getInt256Slot(bytes32 slot) internal pure returns (Int256Slot storage r) {\\n assembly (\\\"memory-safe\\\") {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns a `StringSlot` with member `value` located at `slot`.\\n */\\n function getStringSlot(bytes32 slot) internal pure returns (StringSlot storage r) {\\n assembly (\\\"memory-safe\\\") {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `StringSlot` representation of the string storage pointer `store`.\\n */\\n function getStringSlot(string storage store) internal pure returns (StringSlot storage r) {\\n assembly (\\\"memory-safe\\\") {\\n r.slot := store.slot\\n }\\n }\\n\\n /**\\n * @dev Returns a `BytesSlot` with member `value` located at `slot`.\\n */\\n function getBytesSlot(bytes32 slot) internal pure returns (BytesSlot storage r) {\\n assembly (\\\"memory-safe\\\") {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `BytesSlot` representation of the bytes storage pointer `store`.\\n */\\n function getBytesSlot(bytes storage store) internal pure returns (BytesSlot storage r) {\\n assembly (\\\"memory-safe\\\") {\\n r.slot := store.slot\\n }\\n }\\n}\\n\",\"keccak256\":\"0xcf74f855663ce2ae00ed8352666b7935f6cddea2932fdf2c3ecd30a9b1cd0e97\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Strings.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/Strings.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {Math} from \\\"./math/Math.sol\\\";\\nimport {SignedMath} from \\\"./math/SignedMath.sol\\\";\\n\\n/**\\n * @dev String operations.\\n */\\nlibrary Strings {\\n bytes16 private constant HEX_DIGITS = \\\"0123456789abcdef\\\";\\n uint8 private constant ADDRESS_LENGTH = 20;\\n\\n /**\\n * @dev The `value` string doesn't fit in the specified `length`.\\n */\\n error StringsInsufficientHexLength(uint256 value, uint256 length);\\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 assembly (\\\"memory-safe\\\") {\\n ptr := add(buffer, add(32, length))\\n }\\n while (true) {\\n ptr--;\\n assembly (\\\"memory-safe\\\") {\\n mstore8(ptr, byte(mod(value, 10), HEX_DIGITS))\\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 toStringSigned(int256 value) internal pure returns (string memory) {\\n return string.concat(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 uint256 localValue = value;\\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] = HEX_DIGITS[localValue & 0xf];\\n localValue >>= 4;\\n }\\n if (localValue != 0) {\\n revert StringsInsufficientHexLength(value, length);\\n }\\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\\n * 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 Converts an `address` with fixed length of 20 bytes to its checksummed ASCII `string` hexadecimal\\n * representation, according to EIP-55.\\n */\\n function toChecksumHexString(address addr) internal pure returns (string memory) {\\n bytes memory buffer = bytes(toHexString(addr));\\n\\n // hash the hex part of buffer (skip length + 2 bytes, length 40)\\n uint256 hashValue;\\n assembly (\\\"memory-safe\\\") {\\n hashValue := shr(96, keccak256(add(buffer, 0x22), 40))\\n }\\n\\n for (uint256 i = 41; i > 1; --i) {\\n // possible values for buffer[i] are 48 (0) to 57 (9) and 97 (a) to 102 (f)\\n if (hashValue & 0xf > 7 && uint8(buffer[i]) > 96) {\\n // case shift by xoring with 0x20\\n buffer[i] ^= 0x20;\\n }\\n hashValue >>= 4;\\n }\\n return string(buffer);\\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 bytes(a).length == bytes(b).length && keccak256(bytes(a)) == keccak256(bytes(b));\\n }\\n}\\n\",\"keccak256\":\"0x725209b582291bb83058e3078624b53d15a133f7401c30295e7f3704181d2aed\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/cryptography/ECDSA.sol)\\n\\npragma solidity ^0.8.20;\\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 }\\n\\n /**\\n * @dev The signature derives the `address(0)`.\\n */\\n error ECDSAInvalidSignature();\\n\\n /**\\n * @dev The signature has an invalid length.\\n */\\n error ECDSAInvalidSignatureLength(uint256 length);\\n\\n /**\\n * @dev The signature has an S value that is in the upper half order.\\n */\\n error ECDSAInvalidSignatureS(bytes32 s);\\n\\n /**\\n * @dev Returns the address that signed a hashed message (`hash`) with `signature` or an error. This will not\\n * return address(0) without also returning an error description. Errors are documented using an enum (error type)\\n * and a bytes32 providing additional information about the error.\\n *\\n * If no error is returned, then the address can be used for verification purposes.\\n *\\n * The `ecrecover` EVM precompile 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 {MessageHashUtils-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 function tryRecover(\\n bytes32 hash,\\n bytes memory signature\\n ) internal pure returns (address recovered, RecoverError err, bytes32 errArg) {\\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 assembly (\\\"memory-safe\\\") {\\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, bytes32(signature.length));\\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 precompile 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 {MessageHashUtils-toEthSignedMessageHash} on it.\\n */\\n function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {\\n (address recovered, RecoverError error, bytes32 errorArg) = tryRecover(hash, signature);\\n _throwError(error, errorArg);\\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[ERC-2098 short signatures]\\n */\\n function tryRecover(\\n bytes32 hash,\\n bytes32 r,\\n bytes32 vs\\n ) internal pure returns (address recovered, RecoverError err, bytes32 errArg) {\\n unchecked {\\n bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff);\\n // We do not check for an overflow here since the shift operation results in 0 or 1.\\n uint8 v = uint8((uint256(vs) >> 255) + 27);\\n return tryRecover(hash, v, r, s);\\n }\\n }\\n\\n /**\\n * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately.\\n */\\n function recover(bytes32 hash, bytes32 r, bytes32 vs) internal pure returns (address) {\\n (address recovered, RecoverError error, bytes32 errorArg) = tryRecover(hash, r, vs);\\n _throwError(error, errorArg);\\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 function tryRecover(\\n bytes32 hash,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) internal pure returns (address recovered, RecoverError err, bytes32 errArg) {\\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, s);\\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, bytes32(0));\\n }\\n\\n return (signer, RecoverError.NoError, bytes32(0));\\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, bytes32 errorArg) = tryRecover(hash, v, r, s);\\n _throwError(error, errorArg);\\n return recovered;\\n }\\n\\n /**\\n * @dev Optionally reverts with the corresponding custom error according to the `error` argument provided.\\n */\\n function _throwError(RecoverError error, bytes32 errorArg) private pure {\\n if (error == RecoverError.NoError) {\\n return; // no error: do nothing\\n } else if (error == RecoverError.InvalidSignature) {\\n revert ECDSAInvalidSignature();\\n } else if (error == RecoverError.InvalidSignatureLength) {\\n revert ECDSAInvalidSignatureLength(uint256(errorArg));\\n } else if (error == RecoverError.InvalidSignatureS) {\\n revert ECDSAInvalidSignatureS(errorArg);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x69f54c02b7d81d505910ec198c11ed4c6a728418a868b906b4a0cf29946fda84\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/cryptography/EIP712.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/cryptography/EIP712.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {MessageHashUtils} from \\\"./MessageHashUtils.sol\\\";\\nimport {ShortStrings, ShortString} from \\\"../ShortStrings.sol\\\";\\nimport {IERC5267} from \\\"../../interfaces/IERC5267.sol\\\";\\n\\n/**\\n * @dev https://eips.ethereum.org/EIPS/eip-712[EIP-712] is a standard for hashing and signing of typed structured data.\\n *\\n * The encoding scheme specified in the EIP requires a domain separator and a hash of the typed structured data, whose\\n * encoding is very generic and therefore its implementation in Solidity is not feasible, thus this contract\\n * does not implement the encoding itself. Protocols need to implement the type-specific encoding they need in order to\\n * produce the hash of their typed data using a combination of `abi.encode` and `keccak256`.\\n *\\n * This contract implements the EIP-712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding\\n * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA\\n * ({_hashTypedDataV4}).\\n *\\n * The implementation of the domain separator was designed to be as efficient as possible while still properly updating\\n * the chain id to protect against replay attacks on an eventual fork of the chain.\\n *\\n * NOTE: This contract implements the version of the encoding known as \\\"v4\\\", as implemented by the JSON RPC method\\n * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask].\\n *\\n * NOTE: In the upgradeable version of this contract, the cached values will correspond to the address, and the domain\\n * separator of the implementation contract. This will cause the {_domainSeparatorV4} function to always rebuild the\\n * separator from the immutable values, which is cheaper than accessing a cached version in cold storage.\\n *\\n * @custom:oz-upgrades-unsafe-allow state-variable-immutable\\n */\\nabstract contract EIP712 is IERC5267 {\\n using ShortStrings for *;\\n\\n bytes32 private constant TYPE_HASH =\\n keccak256(\\\"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)\\\");\\n\\n // Cache the domain separator as an immutable value, but also store the chain id that it corresponds to, in order to\\n // invalidate the cached domain separator if the chain id changes.\\n bytes32 private immutable _cachedDomainSeparator;\\n uint256 private immutable _cachedChainId;\\n address private immutable _cachedThis;\\n\\n bytes32 private immutable _hashedName;\\n bytes32 private immutable _hashedVersion;\\n\\n ShortString private immutable _name;\\n ShortString private immutable _version;\\n string private _nameFallback;\\n string private _versionFallback;\\n\\n /**\\n * @dev Initializes the domain separator and parameter caches.\\n *\\n * The meaning of `name` and `version` is specified in\\n * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP-712]:\\n *\\n * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol.\\n * - `version`: the current major version of the signing domain.\\n *\\n * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart\\n * contract upgrade].\\n */\\n constructor(string memory name, string memory version) {\\n _name = name.toShortStringWithFallback(_nameFallback);\\n _version = version.toShortStringWithFallback(_versionFallback);\\n _hashedName = keccak256(bytes(name));\\n _hashedVersion = keccak256(bytes(version));\\n\\n _cachedChainId = block.chainid;\\n _cachedDomainSeparator = _buildDomainSeparator();\\n _cachedThis = address(this);\\n }\\n\\n /**\\n * @dev Returns the domain separator for the current chain.\\n */\\n function _domainSeparatorV4() internal view returns (bytes32) {\\n if (address(this) == _cachedThis && block.chainid == _cachedChainId) {\\n return _cachedDomainSeparator;\\n } else {\\n return _buildDomainSeparator();\\n }\\n }\\n\\n function _buildDomainSeparator() private view returns (bytes32) {\\n return keccak256(abi.encode(TYPE_HASH, _hashedName, _hashedVersion, block.chainid, address(this)));\\n }\\n\\n /**\\n * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this\\n * function returns the hash of the fully encoded EIP712 message for this domain.\\n *\\n * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example:\\n *\\n * ```solidity\\n * bytes32 digest = _hashTypedDataV4(keccak256(abi.encode(\\n * keccak256(\\\"Mail(address to,string contents)\\\"),\\n * mailTo,\\n * keccak256(bytes(mailContents))\\n * )));\\n * address signer = ECDSA.recover(digest, signature);\\n * ```\\n */\\n function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) {\\n return MessageHashUtils.toTypedDataHash(_domainSeparatorV4(), structHash);\\n }\\n\\n /**\\n * @dev See {IERC-5267}.\\n */\\n function eip712Domain()\\n public\\n view\\n virtual\\n returns (\\n bytes1 fields,\\n string memory name,\\n string memory version,\\n uint256 chainId,\\n address verifyingContract,\\n bytes32 salt,\\n uint256[] memory extensions\\n )\\n {\\n return (\\n hex\\\"0f\\\", // 01111\\n _EIP712Name(),\\n _EIP712Version(),\\n block.chainid,\\n address(this),\\n bytes32(0),\\n new uint256[](0)\\n );\\n }\\n\\n /**\\n * @dev The name parameter for the EIP712 domain.\\n *\\n * NOTE: By default this function reads _name which is an immutable value.\\n * It only reads from storage if necessary (in case the value is too large to fit in a ShortString).\\n */\\n // solhint-disable-next-line func-name-mixedcase\\n function _EIP712Name() internal view returns (string memory) {\\n return _name.toStringWithFallback(_nameFallback);\\n }\\n\\n /**\\n * @dev The version parameter for the EIP712 domain.\\n *\\n * NOTE: By default this function reads _version which is an immutable value.\\n * It only reads from storage if necessary (in case the value is too large to fit in a ShortString).\\n */\\n // solhint-disable-next-line func-name-mixedcase\\n function _EIP712Version() internal view returns (string memory) {\\n return _version.toStringWithFallback(_versionFallback);\\n }\\n}\\n\",\"keccak256\":\"0x10eb97d047f8d84fe263a02bb4a656ac6674f6679d74532cc37546289e073a9d\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/cryptography/MessageHashUtils.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/cryptography/MessageHashUtils.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {Strings} from \\\"../Strings.sol\\\";\\n\\n/**\\n * @dev Signature message hash utilities for producing digests to be consumed by {ECDSA} recovery or signing.\\n *\\n * The library provides methods for generating a hash of a message that conforms to the\\n * https://eips.ethereum.org/EIPS/eip-191[ERC-191] and https://eips.ethereum.org/EIPS/eip-712[EIP 712]\\n * specifications.\\n */\\nlibrary MessageHashUtils {\\n /**\\n * @dev Returns the keccak256 digest of an ERC-191 signed data with version\\n * `0x45` (`personal_sign` messages).\\n *\\n * The digest is calculated by prefixing a bytes32 `messageHash` with\\n * `\\\"\\\\x19Ethereum Signed Message:\\\\n32\\\"` and hashing the result. It corresponds with the\\n * hash signed when using the https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] JSON-RPC method.\\n *\\n * NOTE: The `messageHash` parameter is intended to be the result of hashing a raw message with\\n * keccak256, although any bytes32 value can be safely used because the final digest will\\n * be re-hashed.\\n *\\n * See {ECDSA-recover}.\\n */\\n function toEthSignedMessageHash(bytes32 messageHash) internal pure returns (bytes32 digest) {\\n assembly (\\\"memory-safe\\\") {\\n mstore(0x00, \\\"\\\\x19Ethereum Signed Message:\\\\n32\\\") // 32 is the bytes-length of messageHash\\n mstore(0x1c, messageHash) // 0x1c (28) is the length of the prefix\\n digest := keccak256(0x00, 0x3c) // 0x3c is the length of the prefix (0x1c) + messageHash (0x20)\\n }\\n }\\n\\n /**\\n * @dev Returns the keccak256 digest of an ERC-191 signed data with version\\n * `0x45` (`personal_sign` messages).\\n *\\n * The digest is calculated by prefixing an arbitrary `message` with\\n * `\\\"\\\\x19Ethereum Signed Message:\\\\n\\\" + len(message)` and hashing the result. It corresponds with the\\n * hash signed when using the https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] JSON-RPC method.\\n *\\n * See {ECDSA-recover}.\\n */\\n function toEthSignedMessageHash(bytes memory message) internal pure returns (bytes32) {\\n return\\n keccak256(bytes.concat(\\\"\\\\x19Ethereum Signed Message:\\\\n\\\", bytes(Strings.toString(message.length)), message));\\n }\\n\\n /**\\n * @dev Returns the keccak256 digest of an ERC-191 signed data with version\\n * `0x00` (data with intended validator).\\n *\\n * The digest is calculated by prefixing an arbitrary `data` with `\\\"\\\\x19\\\\x00\\\"` and the intended\\n * `validator` address. Then hashing the result.\\n *\\n * See {ECDSA-recover}.\\n */\\n function toDataWithIntendedValidatorHash(address validator, bytes memory data) internal pure returns (bytes32) {\\n return keccak256(abi.encodePacked(hex\\\"19_00\\\", validator, data));\\n }\\n\\n /**\\n * @dev Returns the keccak256 digest of an EIP-712 typed data (ERC-191 version `0x01`).\\n *\\n * The digest is calculated from a `domainSeparator` and a `structHash`, by prefixing them with\\n * `\\\\x19\\\\x01` and hashing the result. It corresponds to the hash signed by the\\n * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`] JSON-RPC method as part of EIP-712.\\n *\\n * See {ECDSA-recover}.\\n */\\n function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32 digest) {\\n assembly (\\\"memory-safe\\\") {\\n let ptr := mload(0x40)\\n mstore(ptr, hex\\\"19_01\\\")\\n mstore(add(ptr, 0x02), domainSeparator)\\n mstore(add(ptr, 0x22), structHash)\\n digest := keccak256(ptr, 0x42)\\n }\\n }\\n}\\n\",\"keccak256\":\"0x4515543bc4c78561f6bea83ecfdfc3dead55bd59858287d682045b11de1ae575\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/introspection/ERC165.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/introspection/ERC165.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {IERC165} from \\\"./IERC165.sol\\\";\\n\\n/**\\n * @dev Implementation of the {IERC165} interface.\\n *\\n * Contracts that want to implement ERC-165 should inherit from this contract and override {supportsInterface} to check\\n * for the additional interface id that will be supported. For example:\\n *\\n * ```solidity\\n * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\\n * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);\\n * }\\n * ```\\n */\\nabstract contract ERC165 is IERC165 {\\n /**\\n * @dev See {IERC165-supportsInterface}.\\n */\\n function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) {\\n return interfaceId == type(IERC165).interfaceId;\\n }\\n}\\n\",\"keccak256\":\"0xddce8e17e3d3f9ed818b4f4c4478a8262aab8b11ed322f1bf5ed705bb4bd97fa\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/introspection/IERC165.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/introspection/IERC165.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Interface of the ERC-165 standard, as defined in the\\n * https://eips.ethereum.org/EIPS/eip-165[ERC].\\n *\\n * Implementers can declare support of contract interfaces, which can then be\\n * queried by others ({ERC165Checker}).\\n *\\n * For an implementation, see {ERC165}.\\n */\\ninterface IERC165 {\\n /**\\n * @dev Returns true if this contract implements the interface defined by\\n * `interfaceId`. See the corresponding\\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[ERC section]\\n * to learn more about how these ids are created.\\n *\\n * This function call must use less than 30 000 gas.\\n */\\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x79796192ec90263f21b464d5bc90b777a525971d3de8232be80d9c4f9fb353b8\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/math/Math.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/math/Math.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {Panic} from \\\"../Panic.sol\\\";\\nimport {SafeCast} from \\\"./SafeCast.sol\\\";\\n\\n/**\\n * @dev Standard math utilities missing in the Solidity language.\\n */\\nlibrary Math {\\n enum Rounding {\\n Floor, // Toward negative infinity\\n Ceil, // Toward positive infinity\\n Trunc, // Toward zero\\n Expand // Away from zero\\n }\\n\\n /**\\n * @dev Returns the addition of two unsigned integers, with an success flag (no overflow).\\n */\\n function tryAdd(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\\n unchecked {\\n uint256 c = a + b;\\n if (c < a) return (false, 0);\\n return (true, c);\\n }\\n }\\n\\n /**\\n * @dev Returns the subtraction of two unsigned integers, with an success flag (no overflow).\\n */\\n function trySub(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\\n unchecked {\\n if (b > a) return (false, 0);\\n return (true, a - b);\\n }\\n }\\n\\n /**\\n * @dev Returns the multiplication of two unsigned integers, with an success flag (no overflow).\\n */\\n function tryMul(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\\n unchecked {\\n // Gas optimization: this is cheaper than requiring 'a' not being zero, but the\\n // benefit is lost if 'b' is also tested.\\n // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522\\n if (a == 0) return (true, 0);\\n uint256 c = a * b;\\n if (c / a != b) return (false, 0);\\n return (true, c);\\n }\\n }\\n\\n /**\\n * @dev Returns the division of two unsigned integers, with a success flag (no division by zero).\\n */\\n function tryDiv(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\\n unchecked {\\n if (b == 0) return (false, 0);\\n return (true, a / b);\\n }\\n }\\n\\n /**\\n * @dev Returns the remainder of dividing two unsigned integers, with a success flag (no division by zero).\\n */\\n function tryMod(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\\n unchecked {\\n if (b == 0) return (false, 0);\\n return (true, a % b);\\n }\\n }\\n\\n /**\\n * @dev Branchless ternary evaluation for `a ? b : c`. Gas costs are constant.\\n *\\n * IMPORTANT: This function may reduce bytecode size and consume less gas when used standalone.\\n * However, the compiler may optimize Solidity ternary operations (i.e. `a ? b : c`) to only compute\\n * one branch when needed, making this function more expensive.\\n */\\n function ternary(bool condition, uint256 a, uint256 b) internal pure returns (uint256) {\\n unchecked {\\n // branchless ternary works because:\\n // b ^ (a ^ b) == a\\n // b ^ 0 == b\\n return b ^ ((a ^ b) * SafeCast.toUint(condition));\\n }\\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 ternary(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 ternary(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 towards infinity instead\\n * of rounding towards zero.\\n */\\n function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {\\n if (b == 0) {\\n // Guarantee the same behavior as in a regular Solidity division.\\n Panic.panic(Panic.DIVISION_BY_ZERO);\\n }\\n\\n // The following calculation ensures accurate ceiling division without overflow.\\n // Since a is non-zero, (a - 1) / b will not overflow.\\n // The largest possible result occurs when (a - 1) / b is type(uint256).max,\\n // but the largest value we can obtain is type(uint256).max - 1, which happens\\n // when a = type(uint256).max and b = 1.\\n unchecked {\\n return SafeCast.toUint(a > 0) * ((a - 1) / b + 1);\\n }\\n }\\n\\n /**\\n * @dev Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or\\n * denominator == 0.\\n *\\n * Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv) with further edits by\\n * 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\\u00b2\\u2075\\u2076 and mod 2\\u00b2\\u2075\\u2076 - 1, then use\\n // the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256\\n // variables such that product = prod1 * 2\\u00b2\\u2075\\u2076 + prod0.\\n uint256 prod0 = x * y; // 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 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\\u00b2\\u2075\\u2076. Also prevents denominator == 0.\\n if (denominator <= prod1) {\\n Panic.panic(ternary(denominator == 0, Panic.DIVISION_BY_ZERO, Panic.UNDER_OVERFLOW));\\n }\\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.\\n // Always >= 1. See https://cs.stackexchange.com/q/138556/92363.\\n\\n uint256 twos = denominator & (0 - denominator);\\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\\u00b2\\u2075\\u2076 / 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\\u00b2\\u2075\\u2076. Now that denominator is an odd number, it has an inverse modulo 2\\u00b2\\u2075\\u2076 such\\n // that denominator * inv \\u2261 1 mod 2\\u00b2\\u2075\\u2076. Compute the inverse by starting with a seed that is correct for\\n // four bits. That is, denominator * inv \\u2261 1 mod 2\\u2074.\\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\\n // works in modular arithmetic, doubling the correct bits in each step.\\n inverse *= 2 - denominator * inverse; // inverse mod 2\\u2078\\n inverse *= 2 - denominator * inverse; // inverse mod 2\\u00b9\\u2076\\n inverse *= 2 - denominator * inverse; // inverse mod 2\\u00b3\\u00b2\\n inverse *= 2 - denominator * inverse; // inverse mod 2\\u2076\\u2074\\n inverse *= 2 - denominator * inverse; // inverse mod 2\\u00b9\\u00b2\\u2078\\n inverse *= 2 - denominator * inverse; // inverse mod 2\\u00b2\\u2075\\u2076\\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\\u00b2\\u2075\\u2076. Since the preconditions guarantee that the outcome is\\n // less than 2\\u00b2\\u2075\\u2076, 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 * @dev 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 return mulDiv(x, y, denominator) + SafeCast.toUint(unsignedRoundsUp(rounding) && mulmod(x, y, denominator) > 0);\\n }\\n\\n /**\\n * @dev Calculate the modular multiplicative inverse of a number in Z/nZ.\\n *\\n * If n is a prime, then Z/nZ is a field. In that case all elements are inversible, except 0.\\n * If n is not a prime, then Z/nZ is not a field, and some elements might not be inversible.\\n *\\n * If the input value is not inversible, 0 is returned.\\n *\\n * NOTE: If you know for sure that n is (big) a prime, it may be cheaper to use Fermat's little theorem and get the\\n * inverse using `Math.modExp(a, n - 2, n)`. See {invModPrime}.\\n */\\n function invMod(uint256 a, uint256 n) internal pure returns (uint256) {\\n unchecked {\\n if (n == 0) return 0;\\n\\n // The inverse modulo is calculated using the Extended Euclidean Algorithm (iterative version)\\n // Used to compute integers x and y such that: ax + ny = gcd(a, n).\\n // When the gcd is 1, then the inverse of a modulo n exists and it's x.\\n // ax + ny = 1\\n // ax = 1 + (-y)n\\n // ax \\u2261 1 (mod n) # x is the inverse of a modulo n\\n\\n // If the remainder is 0 the gcd is n right away.\\n uint256 remainder = a % n;\\n uint256 gcd = n;\\n\\n // Therefore the initial coefficients are:\\n // ax + ny = gcd(a, n) = n\\n // 0a + 1n = n\\n int256 x = 0;\\n int256 y = 1;\\n\\n while (remainder != 0) {\\n uint256 quotient = gcd / remainder;\\n\\n (gcd, remainder) = (\\n // The old remainder is the next gcd to try.\\n remainder,\\n // Compute the next remainder.\\n // Can't overflow given that (a % gcd) * (gcd // (a % gcd)) <= gcd\\n // where gcd is at most n (capped to type(uint256).max)\\n gcd - remainder * quotient\\n );\\n\\n (x, y) = (\\n // Increment the coefficient of a.\\n y,\\n // Decrement the coefficient of n.\\n // Can overflow, but the result is casted to uint256 so that the\\n // next value of y is \\\"wrapped around\\\" to a value between 0 and n - 1.\\n x - y * int256(quotient)\\n );\\n }\\n\\n if (gcd != 1) return 0; // No inverse exists.\\n return ternary(x < 0, n - uint256(-x), uint256(x)); // Wrap the result if it's negative.\\n }\\n }\\n\\n /**\\n * @dev Variant of {invMod}. More efficient, but only works if `p` is known to be a prime greater than `2`.\\n *\\n * From https://en.wikipedia.org/wiki/Fermat%27s_little_theorem[Fermat's little theorem], we know that if p is\\n * prime, then `a**(p-1) \\u2261 1 mod p`. As a consequence, we have `a * a**(p-2) \\u2261 1 mod p`, which means that\\n * `a**(p-2)` is the modular multiplicative inverse of a in Fp.\\n *\\n * NOTE: this function does NOT check that `p` is a prime greater than `2`.\\n */\\n function invModPrime(uint256 a, uint256 p) internal view returns (uint256) {\\n unchecked {\\n return Math.modExp(a, p - 2, p);\\n }\\n }\\n\\n /**\\n * @dev Returns the modular exponentiation of the specified base, exponent and modulus (b ** e % m)\\n *\\n * Requirements:\\n * - modulus can't be zero\\n * - underlying staticcall to precompile must succeed\\n *\\n * IMPORTANT: The result is only valid if the underlying call succeeds. When using this function, make\\n * sure the chain you're using it on supports the precompiled contract for modular exponentiation\\n * at address 0x05 as specified in https://eips.ethereum.org/EIPS/eip-198[EIP-198]. Otherwise,\\n * the underlying function will succeed given the lack of a revert, but the result may be incorrectly\\n * interpreted as 0.\\n */\\n function modExp(uint256 b, uint256 e, uint256 m) internal view returns (uint256) {\\n (bool success, uint256 result) = tryModExp(b, e, m);\\n if (!success) {\\n Panic.panic(Panic.DIVISION_BY_ZERO);\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Returns the modular exponentiation of the specified base, exponent and modulus (b ** e % m).\\n * It includes a success flag indicating if the operation succeeded. Operation will be marked as failed if trying\\n * to operate modulo 0 or if the underlying precompile reverted.\\n *\\n * IMPORTANT: The result is only valid if the success flag is true. When using this function, make sure the chain\\n * you're using it on supports the precompiled contract for modular exponentiation at address 0x05 as specified in\\n * https://eips.ethereum.org/EIPS/eip-198[EIP-198]. Otherwise, the underlying function will succeed given the lack\\n * of a revert, but the result may be incorrectly interpreted as 0.\\n */\\n function tryModExp(uint256 b, uint256 e, uint256 m) internal view returns (bool success, uint256 result) {\\n if (m == 0) return (false, 0);\\n assembly (\\\"memory-safe\\\") {\\n let ptr := mload(0x40)\\n // | Offset | Content | Content (Hex) |\\n // |-----------|------------|--------------------------------------------------------------------|\\n // | 0x00:0x1f | size of b | 0x0000000000000000000000000000000000000000000000000000000000000020 |\\n // | 0x20:0x3f | size of e | 0x0000000000000000000000000000000000000000000000000000000000000020 |\\n // | 0x40:0x5f | size of m | 0x0000000000000000000000000000000000000000000000000000000000000020 |\\n // | 0x60:0x7f | value of b | 0x<.............................................................b> |\\n // | 0x80:0x9f | value of e | 0x<.............................................................e> |\\n // | 0xa0:0xbf | value of m | 0x<.............................................................m> |\\n mstore(ptr, 0x20)\\n mstore(add(ptr, 0x20), 0x20)\\n mstore(add(ptr, 0x40), 0x20)\\n mstore(add(ptr, 0x60), b)\\n mstore(add(ptr, 0x80), e)\\n mstore(add(ptr, 0xa0), m)\\n\\n // Given the result < m, it's guaranteed to fit in 32 bytes,\\n // so we can use the memory scratch space located at offset 0.\\n success := staticcall(gas(), 0x05, ptr, 0xc0, 0x00, 0x20)\\n result := mload(0x00)\\n }\\n }\\n\\n /**\\n * @dev Variant of {modExp} that supports inputs of arbitrary length.\\n */\\n function modExp(bytes memory b, bytes memory e, bytes memory m) internal view returns (bytes memory) {\\n (bool success, bytes memory result) = tryModExp(b, e, m);\\n if (!success) {\\n Panic.panic(Panic.DIVISION_BY_ZERO);\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Variant of {tryModExp} that supports inputs of arbitrary length.\\n */\\n function tryModExp(\\n bytes memory b,\\n bytes memory e,\\n bytes memory m\\n ) internal view returns (bool success, bytes memory result) {\\n if (_zeroBytes(m)) return (false, new bytes(0));\\n\\n uint256 mLen = m.length;\\n\\n // Encode call args in result and move the free memory pointer\\n result = abi.encodePacked(b.length, e.length, mLen, b, e, m);\\n\\n assembly (\\\"memory-safe\\\") {\\n let dataPtr := add(result, 0x20)\\n // Write result on top of args to avoid allocating extra memory.\\n success := staticcall(gas(), 0x05, dataPtr, mload(result), dataPtr, mLen)\\n // Overwrite the length.\\n // result.length > returndatasize() is guaranteed because returndatasize() == m.length\\n mstore(result, mLen)\\n // Set the memory pointer after the returned data.\\n mstore(0x40, add(dataPtr, mLen))\\n }\\n }\\n\\n /**\\n * @dev Returns whether the provided byte array is zero.\\n */\\n function _zeroBytes(bytes memory byteArray) private pure returns (bool) {\\n for (uint256 i = 0; i < byteArray.length; ++i) {\\n if (byteArray[i] != 0) {\\n return false;\\n }\\n }\\n return true;\\n }\\n\\n /**\\n * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded\\n * towards zero.\\n *\\n * This method is based on Newton's method for computing square roots; the algorithm is restricted to only\\n * using integer operations.\\n */\\n function sqrt(uint256 a) internal pure returns (uint256) {\\n unchecked {\\n // Take care of easy edge cases when a == 0 or a == 1\\n if (a <= 1) {\\n return a;\\n }\\n\\n // In this function, we use Newton's method to get a root of `f(x) := x\\u00b2 - a`. It involves building a\\n // sequence x_n that converges toward sqrt(a). For each iteration x_n, we also define the error between\\n // the current value as `\\u03b5_n = | x_n - sqrt(a) |`.\\n //\\n // For our first estimation, we consider `e` the smallest power of 2 which is bigger than the square root\\n // of the target. (i.e. `2**(e-1) \\u2264 sqrt(a) < 2**e`). We know that `e \\u2264 128` because `(2\\u00b9\\u00b2\\u2078)\\u00b2 = 2\\u00b2\\u2075\\u2076` is\\n // bigger than any uint256.\\n //\\n // By noticing that\\n // `2**(e-1) \\u2264 sqrt(a) < 2**e \\u2192 (2**(e-1))\\u00b2 \\u2264 a < (2**e)\\u00b2 \\u2192 2**(2*e-2) \\u2264 a < 2**(2*e)`\\n // we can deduce that `e - 1` is `log2(a) / 2`. We can thus compute `x_n = 2**(e-1)` using a method similar\\n // to the msb function.\\n uint256 aa = a;\\n uint256 xn = 1;\\n\\n if (aa >= (1 << 128)) {\\n aa >>= 128;\\n xn <<= 64;\\n }\\n if (aa >= (1 << 64)) {\\n aa >>= 64;\\n xn <<= 32;\\n }\\n if (aa >= (1 << 32)) {\\n aa >>= 32;\\n xn <<= 16;\\n }\\n if (aa >= (1 << 16)) {\\n aa >>= 16;\\n xn <<= 8;\\n }\\n if (aa >= (1 << 8)) {\\n aa >>= 8;\\n xn <<= 4;\\n }\\n if (aa >= (1 << 4)) {\\n aa >>= 4;\\n xn <<= 2;\\n }\\n if (aa >= (1 << 2)) {\\n xn <<= 1;\\n }\\n\\n // We now have x_n such that `x_n = 2**(e-1) \\u2264 sqrt(a) < 2**e = 2 * x_n`. This implies \\u03b5_n \\u2264 2**(e-1).\\n //\\n // We can refine our estimation by noticing that the middle of that interval minimizes the error.\\n // If we move x_n to equal 2**(e-1) + 2**(e-2), then we reduce the error to \\u03b5_n \\u2264 2**(e-2).\\n // This is going to be our x_0 (and \\u03b5_0)\\n xn = (3 * xn) >> 1; // \\u03b5_0 := | x_0 - sqrt(a) | \\u2264 2**(e-2)\\n\\n // From here, Newton's method give us:\\n // x_{n+1} = (x_n + a / x_n) / 2\\n //\\n // One should note that:\\n // x_{n+1}\\u00b2 - a = ((x_n + a / x_n) / 2)\\u00b2 - a\\n // = ((x_n\\u00b2 + a) / (2 * x_n))\\u00b2 - a\\n // = (x_n\\u2074 + 2 * a * x_n\\u00b2 + a\\u00b2) / (4 * x_n\\u00b2) - a\\n // = (x_n\\u2074 + 2 * a * x_n\\u00b2 + a\\u00b2 - 4 * a * x_n\\u00b2) / (4 * x_n\\u00b2)\\n // = (x_n\\u2074 - 2 * a * x_n\\u00b2 + a\\u00b2) / (4 * x_n\\u00b2)\\n // = (x_n\\u00b2 - a)\\u00b2 / (2 * x_n)\\u00b2\\n // = ((x_n\\u00b2 - a) / (2 * x_n))\\u00b2\\n // \\u2265 0\\n // Which proves that for all n \\u2265 1, sqrt(a) \\u2264 x_n\\n //\\n // This gives us the proof of quadratic convergence of the sequence:\\n // \\u03b5_{n+1} = | x_{n+1} - sqrt(a) |\\n // = | (x_n + a / x_n) / 2 - sqrt(a) |\\n // = | (x_n\\u00b2 + a - 2*x_n*sqrt(a)) / (2 * x_n) |\\n // = | (x_n - sqrt(a))\\u00b2 / (2 * x_n) |\\n // = | \\u03b5_n\\u00b2 / (2 * x_n) |\\n // = \\u03b5_n\\u00b2 / | (2 * x_n) |\\n //\\n // For the first iteration, we have a special case where x_0 is known:\\n // \\u03b5_1 = \\u03b5_0\\u00b2 / | (2 * x_0) |\\n // \\u2264 (2**(e-2))\\u00b2 / (2 * (2**(e-1) + 2**(e-2)))\\n // \\u2264 2**(2*e-4) / (3 * 2**(e-1))\\n // \\u2264 2**(e-3) / 3\\n // \\u2264 2**(e-3-log2(3))\\n // \\u2264 2**(e-4.5)\\n //\\n // For the following iterations, we use the fact that, 2**(e-1) \\u2264 sqrt(a) \\u2264 x_n:\\n // \\u03b5_{n+1} = \\u03b5_n\\u00b2 / | (2 * x_n) |\\n // \\u2264 (2**(e-k))\\u00b2 / (2 * 2**(e-1))\\n // \\u2264 2**(2*e-2*k) / 2**e\\n // \\u2264 2**(e-2*k)\\n xn = (xn + a / xn) >> 1; // \\u03b5_1 := | x_1 - sqrt(a) | \\u2264 2**(e-4.5) -- special case, see above\\n xn = (xn + a / xn) >> 1; // \\u03b5_2 := | x_2 - sqrt(a) | \\u2264 2**(e-9) -- general case with k = 4.5\\n xn = (xn + a / xn) >> 1; // \\u03b5_3 := | x_3 - sqrt(a) | \\u2264 2**(e-18) -- general case with k = 9\\n xn = (xn + a / xn) >> 1; // \\u03b5_4 := | x_4 - sqrt(a) | \\u2264 2**(e-36) -- general case with k = 18\\n xn = (xn + a / xn) >> 1; // \\u03b5_5 := | x_5 - sqrt(a) | \\u2264 2**(e-72) -- general case with k = 36\\n xn = (xn + a / xn) >> 1; // \\u03b5_6 := | x_6 - sqrt(a) | \\u2264 2**(e-144) -- general case with k = 72\\n\\n // Because e \\u2264 128 (as discussed during the first estimation phase), we know have reached a precision\\n // \\u03b5_6 \\u2264 2**(e-144) < 1. Given we're operating on integers, then we can ensure that xn is now either\\n // sqrt(a) or sqrt(a) + 1.\\n return xn - SafeCast.toUint(xn > a / xn);\\n }\\n }\\n\\n /**\\n * @dev 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 + SafeCast.toUint(unsignedRoundsUp(rounding) && result * result < a);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 2 of a positive value rounded towards zero.\\n * Returns 0 if given 0.\\n */\\n function log2(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n uint256 exp;\\n unchecked {\\n exp = 128 * SafeCast.toUint(value > (1 << 128) - 1);\\n value >>= exp;\\n result += exp;\\n\\n exp = 64 * SafeCast.toUint(value > (1 << 64) - 1);\\n value >>= exp;\\n result += exp;\\n\\n exp = 32 * SafeCast.toUint(value > (1 << 32) - 1);\\n value >>= exp;\\n result += exp;\\n\\n exp = 16 * SafeCast.toUint(value > (1 << 16) - 1);\\n value >>= exp;\\n result += exp;\\n\\n exp = 8 * SafeCast.toUint(value > (1 << 8) - 1);\\n value >>= exp;\\n result += exp;\\n\\n exp = 4 * SafeCast.toUint(value > (1 << 4) - 1);\\n value >>= exp;\\n result += exp;\\n\\n exp = 2 * SafeCast.toUint(value > (1 << 2) - 1);\\n value >>= exp;\\n result += exp;\\n\\n result += SafeCast.toUint(value > 1);\\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 + SafeCast.toUint(unsignedRoundsUp(rounding) && 1 << result < value);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 10 of a positive value rounded towards zero.\\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 + SafeCast.toUint(unsignedRoundsUp(rounding) && 10 ** result < value);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 256 of a positive value rounded towards zero.\\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 uint256 isGt;\\n unchecked {\\n isGt = SafeCast.toUint(value > (1 << 128) - 1);\\n value >>= isGt * 128;\\n result += isGt * 16;\\n\\n isGt = SafeCast.toUint(value > (1 << 64) - 1);\\n value >>= isGt * 64;\\n result += isGt * 8;\\n\\n isGt = SafeCast.toUint(value > (1 << 32) - 1);\\n value >>= isGt * 32;\\n result += isGt * 4;\\n\\n isGt = SafeCast.toUint(value > (1 << 16) - 1);\\n value >>= isGt * 16;\\n result += isGt * 2;\\n\\n result += SafeCast.toUint(value > (1 << 8) - 1);\\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 + SafeCast.toUint(unsignedRoundsUp(rounding) && 1 << (result << 3) < value);\\n }\\n }\\n\\n /**\\n * @dev Returns whether a provided rounding mode is considered rounding up for unsigned integers.\\n */\\n function unsignedRoundsUp(Rounding rounding) internal pure returns (bool) {\\n return uint8(rounding) % 2 == 1;\\n }\\n}\\n\",\"keccak256\":\"0xa00be322d7db5786750ce0ac7e2f5b633ac30a5ed5fa1ced1e74acfc19acecea\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/math/SafeCast.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/math/SafeCast.sol)\\n// This file was procedurally generated from scripts/generate/templates/SafeCast.js.\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Wrappers over Solidity's uintXX/intXX/bool casting operators with added overflow\\n * checks.\\n *\\n * Downcasting from uint256/int256 in Solidity does not revert on overflow. This can\\n * easily result in undesired exploitation or bugs, since developers usually\\n * assume that overflows raise errors. `SafeCast` restores this intuition by\\n * reverting the transaction when such an operation overflows.\\n *\\n * Using this library instead of the unchecked operations eliminates an entire\\n * class of bugs, so it's recommended to use it always.\\n */\\nlibrary SafeCast {\\n /**\\n * @dev Value doesn't fit in an uint of `bits` size.\\n */\\n error SafeCastOverflowedUintDowncast(uint8 bits, uint256 value);\\n\\n /**\\n * @dev An int value doesn't fit in an uint of `bits` size.\\n */\\n error SafeCastOverflowedIntToUint(int256 value);\\n\\n /**\\n * @dev Value doesn't fit in an int of `bits` size.\\n */\\n error SafeCastOverflowedIntDowncast(uint8 bits, int256 value);\\n\\n /**\\n * @dev An uint value doesn't fit in an int of `bits` size.\\n */\\n error SafeCastOverflowedUintToInt(uint256 value);\\n\\n /**\\n * @dev Returns the downcasted uint248 from uint256, reverting on\\n * overflow (when the input is greater than largest uint248).\\n *\\n * Counterpart to Solidity's `uint248` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 248 bits\\n */\\n function toUint248(uint256 value) internal pure returns (uint248) {\\n if (value > type(uint248).max) {\\n revert SafeCastOverflowedUintDowncast(248, value);\\n }\\n return uint248(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint240 from uint256, reverting on\\n * overflow (when the input is greater than largest uint240).\\n *\\n * Counterpart to Solidity's `uint240` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 240 bits\\n */\\n function toUint240(uint256 value) internal pure returns (uint240) {\\n if (value > type(uint240).max) {\\n revert SafeCastOverflowedUintDowncast(240, value);\\n }\\n return uint240(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint232 from uint256, reverting on\\n * overflow (when the input is greater than largest uint232).\\n *\\n * Counterpart to Solidity's `uint232` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 232 bits\\n */\\n function toUint232(uint256 value) internal pure returns (uint232) {\\n if (value > type(uint232).max) {\\n revert SafeCastOverflowedUintDowncast(232, value);\\n }\\n return uint232(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint224 from uint256, reverting on\\n * overflow (when the input is greater than largest uint224).\\n *\\n * Counterpart to Solidity's `uint224` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 224 bits\\n */\\n function toUint224(uint256 value) internal pure returns (uint224) {\\n if (value > type(uint224).max) {\\n revert SafeCastOverflowedUintDowncast(224, value);\\n }\\n return uint224(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint216 from uint256, reverting on\\n * overflow (when the input is greater than largest uint216).\\n *\\n * Counterpart to Solidity's `uint216` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 216 bits\\n */\\n function toUint216(uint256 value) internal pure returns (uint216) {\\n if (value > type(uint216).max) {\\n revert SafeCastOverflowedUintDowncast(216, value);\\n }\\n return uint216(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint208 from uint256, reverting on\\n * overflow (when the input is greater than largest uint208).\\n *\\n * Counterpart to Solidity's `uint208` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 208 bits\\n */\\n function toUint208(uint256 value) internal pure returns (uint208) {\\n if (value > type(uint208).max) {\\n revert SafeCastOverflowedUintDowncast(208, value);\\n }\\n return uint208(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint200 from uint256, reverting on\\n * overflow (when the input is greater than largest uint200).\\n *\\n * Counterpart to Solidity's `uint200` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 200 bits\\n */\\n function toUint200(uint256 value) internal pure returns (uint200) {\\n if (value > type(uint200).max) {\\n revert SafeCastOverflowedUintDowncast(200, value);\\n }\\n return uint200(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint192 from uint256, reverting on\\n * overflow (when the input is greater than largest uint192).\\n *\\n * Counterpart to Solidity's `uint192` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 192 bits\\n */\\n function toUint192(uint256 value) internal pure returns (uint192) {\\n if (value > type(uint192).max) {\\n revert SafeCastOverflowedUintDowncast(192, value);\\n }\\n return uint192(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint184 from uint256, reverting on\\n * overflow (when the input is greater than largest uint184).\\n *\\n * Counterpart to Solidity's `uint184` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 184 bits\\n */\\n function toUint184(uint256 value) internal pure returns (uint184) {\\n if (value > type(uint184).max) {\\n revert SafeCastOverflowedUintDowncast(184, value);\\n }\\n return uint184(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint176 from uint256, reverting on\\n * overflow (when the input is greater than largest uint176).\\n *\\n * Counterpart to Solidity's `uint176` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 176 bits\\n */\\n function toUint176(uint256 value) internal pure returns (uint176) {\\n if (value > type(uint176).max) {\\n revert SafeCastOverflowedUintDowncast(176, value);\\n }\\n return uint176(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint168 from uint256, reverting on\\n * overflow (when the input is greater than largest uint168).\\n *\\n * Counterpart to Solidity's `uint168` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 168 bits\\n */\\n function toUint168(uint256 value) internal pure returns (uint168) {\\n if (value > type(uint168).max) {\\n revert SafeCastOverflowedUintDowncast(168, value);\\n }\\n return uint168(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint160 from uint256, reverting on\\n * overflow (when the input is greater than largest uint160).\\n *\\n * Counterpart to Solidity's `uint160` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 160 bits\\n */\\n function toUint160(uint256 value) internal pure returns (uint160) {\\n if (value > type(uint160).max) {\\n revert SafeCastOverflowedUintDowncast(160, value);\\n }\\n return uint160(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint152 from uint256, reverting on\\n * overflow (when the input is greater than largest uint152).\\n *\\n * Counterpart to Solidity's `uint152` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 152 bits\\n */\\n function toUint152(uint256 value) internal pure returns (uint152) {\\n if (value > type(uint152).max) {\\n revert SafeCastOverflowedUintDowncast(152, value);\\n }\\n return uint152(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint144 from uint256, reverting on\\n * overflow (when the input is greater than largest uint144).\\n *\\n * Counterpart to Solidity's `uint144` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 144 bits\\n */\\n function toUint144(uint256 value) internal pure returns (uint144) {\\n if (value > type(uint144).max) {\\n revert SafeCastOverflowedUintDowncast(144, value);\\n }\\n return uint144(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint136 from uint256, reverting on\\n * overflow (when the input is greater than largest uint136).\\n *\\n * Counterpart to Solidity's `uint136` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 136 bits\\n */\\n function toUint136(uint256 value) internal pure returns (uint136) {\\n if (value > type(uint136).max) {\\n revert SafeCastOverflowedUintDowncast(136, value);\\n }\\n return uint136(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint128 from uint256, reverting on\\n * overflow (when the input is greater than largest uint128).\\n *\\n * Counterpart to Solidity's `uint128` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 128 bits\\n */\\n function toUint128(uint256 value) internal pure returns (uint128) {\\n if (value > type(uint128).max) {\\n revert SafeCastOverflowedUintDowncast(128, value);\\n }\\n return uint128(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint120 from uint256, reverting on\\n * overflow (when the input is greater than largest uint120).\\n *\\n * Counterpart to Solidity's `uint120` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 120 bits\\n */\\n function toUint120(uint256 value) internal pure returns (uint120) {\\n if (value > type(uint120).max) {\\n revert SafeCastOverflowedUintDowncast(120, value);\\n }\\n return uint120(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint112 from uint256, reverting on\\n * overflow (when the input is greater than largest uint112).\\n *\\n * Counterpart to Solidity's `uint112` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 112 bits\\n */\\n function toUint112(uint256 value) internal pure returns (uint112) {\\n if (value > type(uint112).max) {\\n revert SafeCastOverflowedUintDowncast(112, value);\\n }\\n return uint112(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint104 from uint256, reverting on\\n * overflow (when the input is greater than largest uint104).\\n *\\n * Counterpart to Solidity's `uint104` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 104 bits\\n */\\n function toUint104(uint256 value) internal pure returns (uint104) {\\n if (value > type(uint104).max) {\\n revert SafeCastOverflowedUintDowncast(104, value);\\n }\\n return uint104(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint96 from uint256, reverting on\\n * overflow (when the input is greater than largest uint96).\\n *\\n * Counterpart to Solidity's `uint96` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 96 bits\\n */\\n function toUint96(uint256 value) internal pure returns (uint96) {\\n if (value > type(uint96).max) {\\n revert SafeCastOverflowedUintDowncast(96, value);\\n }\\n return uint96(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint88 from uint256, reverting on\\n * overflow (when the input is greater than largest uint88).\\n *\\n * Counterpart to Solidity's `uint88` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 88 bits\\n */\\n function toUint88(uint256 value) internal pure returns (uint88) {\\n if (value > type(uint88).max) {\\n revert SafeCastOverflowedUintDowncast(88, value);\\n }\\n return uint88(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint80 from uint256, reverting on\\n * overflow (when the input is greater than largest uint80).\\n *\\n * Counterpart to Solidity's `uint80` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 80 bits\\n */\\n function toUint80(uint256 value) internal pure returns (uint80) {\\n if (value > type(uint80).max) {\\n revert SafeCastOverflowedUintDowncast(80, value);\\n }\\n return uint80(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint72 from uint256, reverting on\\n * overflow (when the input is greater than largest uint72).\\n *\\n * Counterpart to Solidity's `uint72` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 72 bits\\n */\\n function toUint72(uint256 value) internal pure returns (uint72) {\\n if (value > type(uint72).max) {\\n revert SafeCastOverflowedUintDowncast(72, value);\\n }\\n return uint72(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint64 from uint256, reverting on\\n * overflow (when the input is greater than largest uint64).\\n *\\n * Counterpart to Solidity's `uint64` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 64 bits\\n */\\n function toUint64(uint256 value) internal pure returns (uint64) {\\n if (value > type(uint64).max) {\\n revert SafeCastOverflowedUintDowncast(64, value);\\n }\\n return uint64(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint56 from uint256, reverting on\\n * overflow (when the input is greater than largest uint56).\\n *\\n * Counterpart to Solidity's `uint56` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 56 bits\\n */\\n function toUint56(uint256 value) internal pure returns (uint56) {\\n if (value > type(uint56).max) {\\n revert SafeCastOverflowedUintDowncast(56, value);\\n }\\n return uint56(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint48 from uint256, reverting on\\n * overflow (when the input is greater than largest uint48).\\n *\\n * Counterpart to Solidity's `uint48` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 48 bits\\n */\\n function toUint48(uint256 value) internal pure returns (uint48) {\\n if (value > type(uint48).max) {\\n revert SafeCastOverflowedUintDowncast(48, value);\\n }\\n return uint48(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint40 from uint256, reverting on\\n * overflow (when the input is greater than largest uint40).\\n *\\n * Counterpart to Solidity's `uint40` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 40 bits\\n */\\n function toUint40(uint256 value) internal pure returns (uint40) {\\n if (value > type(uint40).max) {\\n revert SafeCastOverflowedUintDowncast(40, value);\\n }\\n return uint40(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint32 from uint256, reverting on\\n * overflow (when the input is greater than largest uint32).\\n *\\n * Counterpart to Solidity's `uint32` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 32 bits\\n */\\n function toUint32(uint256 value) internal pure returns (uint32) {\\n if (value > type(uint32).max) {\\n revert SafeCastOverflowedUintDowncast(32, value);\\n }\\n return uint32(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint24 from uint256, reverting on\\n * overflow (when the input is greater than largest uint24).\\n *\\n * Counterpart to Solidity's `uint24` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 24 bits\\n */\\n function toUint24(uint256 value) internal pure returns (uint24) {\\n if (value > type(uint24).max) {\\n revert SafeCastOverflowedUintDowncast(24, value);\\n }\\n return uint24(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint16 from uint256, reverting on\\n * overflow (when the input is greater than largest uint16).\\n *\\n * Counterpart to Solidity's `uint16` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 16 bits\\n */\\n function toUint16(uint256 value) internal pure returns (uint16) {\\n if (value > type(uint16).max) {\\n revert SafeCastOverflowedUintDowncast(16, value);\\n }\\n return uint16(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint8 from uint256, reverting on\\n * overflow (when the input is greater than largest uint8).\\n *\\n * Counterpart to Solidity's `uint8` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 8 bits\\n */\\n function toUint8(uint256 value) internal pure returns (uint8) {\\n if (value > type(uint8).max) {\\n revert SafeCastOverflowedUintDowncast(8, value);\\n }\\n return uint8(value);\\n }\\n\\n /**\\n * @dev Converts a signed int256 into an unsigned uint256.\\n *\\n * Requirements:\\n *\\n * - input must be greater than or equal to 0.\\n */\\n function toUint256(int256 value) internal pure returns (uint256) {\\n if (value < 0) {\\n revert SafeCastOverflowedIntToUint(value);\\n }\\n return uint256(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted int248 from int256, reverting on\\n * overflow (when the input is less than smallest int248 or\\n * greater than largest int248).\\n *\\n * Counterpart to Solidity's `int248` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 248 bits\\n */\\n function toInt248(int256 value) internal pure returns (int248 downcasted) {\\n downcasted = int248(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(248, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int240 from int256, reverting on\\n * overflow (when the input is less than smallest int240 or\\n * greater than largest int240).\\n *\\n * Counterpart to Solidity's `int240` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 240 bits\\n */\\n function toInt240(int256 value) internal pure returns (int240 downcasted) {\\n downcasted = int240(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(240, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int232 from int256, reverting on\\n * overflow (when the input is less than smallest int232 or\\n * greater than largest int232).\\n *\\n * Counterpart to Solidity's `int232` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 232 bits\\n */\\n function toInt232(int256 value) internal pure returns (int232 downcasted) {\\n downcasted = int232(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(232, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int224 from int256, reverting on\\n * overflow (when the input is less than smallest int224 or\\n * greater than largest int224).\\n *\\n * Counterpart to Solidity's `int224` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 224 bits\\n */\\n function toInt224(int256 value) internal pure returns (int224 downcasted) {\\n downcasted = int224(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(224, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int216 from int256, reverting on\\n * overflow (when the input is less than smallest int216 or\\n * greater than largest int216).\\n *\\n * Counterpart to Solidity's `int216` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 216 bits\\n */\\n function toInt216(int256 value) internal pure returns (int216 downcasted) {\\n downcasted = int216(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(216, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int208 from int256, reverting on\\n * overflow (when the input is less than smallest int208 or\\n * greater than largest int208).\\n *\\n * Counterpart to Solidity's `int208` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 208 bits\\n */\\n function toInt208(int256 value) internal pure returns (int208 downcasted) {\\n downcasted = int208(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(208, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int200 from int256, reverting on\\n * overflow (when the input is less than smallest int200 or\\n * greater than largest int200).\\n *\\n * Counterpart to Solidity's `int200` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 200 bits\\n */\\n function toInt200(int256 value) internal pure returns (int200 downcasted) {\\n downcasted = int200(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(200, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int192 from int256, reverting on\\n * overflow (when the input is less than smallest int192 or\\n * greater than largest int192).\\n *\\n * Counterpart to Solidity's `int192` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 192 bits\\n */\\n function toInt192(int256 value) internal pure returns (int192 downcasted) {\\n downcasted = int192(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(192, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int184 from int256, reverting on\\n * overflow (when the input is less than smallest int184 or\\n * greater than largest int184).\\n *\\n * Counterpart to Solidity's `int184` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 184 bits\\n */\\n function toInt184(int256 value) internal pure returns (int184 downcasted) {\\n downcasted = int184(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(184, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int176 from int256, reverting on\\n * overflow (when the input is less than smallest int176 or\\n * greater than largest int176).\\n *\\n * Counterpart to Solidity's `int176` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 176 bits\\n */\\n function toInt176(int256 value) internal pure returns (int176 downcasted) {\\n downcasted = int176(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(176, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int168 from int256, reverting on\\n * overflow (when the input is less than smallest int168 or\\n * greater than largest int168).\\n *\\n * Counterpart to Solidity's `int168` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 168 bits\\n */\\n function toInt168(int256 value) internal pure returns (int168 downcasted) {\\n downcasted = int168(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(168, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int160 from int256, reverting on\\n * overflow (when the input is less than smallest int160 or\\n * greater than largest int160).\\n *\\n * Counterpart to Solidity's `int160` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 160 bits\\n */\\n function toInt160(int256 value) internal pure returns (int160 downcasted) {\\n downcasted = int160(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(160, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int152 from int256, reverting on\\n * overflow (when the input is less than smallest int152 or\\n * greater than largest int152).\\n *\\n * Counterpart to Solidity's `int152` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 152 bits\\n */\\n function toInt152(int256 value) internal pure returns (int152 downcasted) {\\n downcasted = int152(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(152, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int144 from int256, reverting on\\n * overflow (when the input is less than smallest int144 or\\n * greater than largest int144).\\n *\\n * Counterpart to Solidity's `int144` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 144 bits\\n */\\n function toInt144(int256 value) internal pure returns (int144 downcasted) {\\n downcasted = int144(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(144, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int136 from int256, reverting on\\n * overflow (when the input is less than smallest int136 or\\n * greater than largest int136).\\n *\\n * Counterpart to Solidity's `int136` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 136 bits\\n */\\n function toInt136(int256 value) internal pure returns (int136 downcasted) {\\n downcasted = int136(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(136, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int128 from int256, reverting on\\n * overflow (when the input is less than smallest int128 or\\n * greater than largest int128).\\n *\\n * Counterpart to Solidity's `int128` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 128 bits\\n */\\n function toInt128(int256 value) internal pure returns (int128 downcasted) {\\n downcasted = int128(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(128, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int120 from int256, reverting on\\n * overflow (when the input is less than smallest int120 or\\n * greater than largest int120).\\n *\\n * Counterpart to Solidity's `int120` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 120 bits\\n */\\n function toInt120(int256 value) internal pure returns (int120 downcasted) {\\n downcasted = int120(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(120, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int112 from int256, reverting on\\n * overflow (when the input is less than smallest int112 or\\n * greater than largest int112).\\n *\\n * Counterpart to Solidity's `int112` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 112 bits\\n */\\n function toInt112(int256 value) internal pure returns (int112 downcasted) {\\n downcasted = int112(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(112, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int104 from int256, reverting on\\n * overflow (when the input is less than smallest int104 or\\n * greater than largest int104).\\n *\\n * Counterpart to Solidity's `int104` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 104 bits\\n */\\n function toInt104(int256 value) internal pure returns (int104 downcasted) {\\n downcasted = int104(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(104, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int96 from int256, reverting on\\n * overflow (when the input is less than smallest int96 or\\n * greater than largest int96).\\n *\\n * Counterpart to Solidity's `int96` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 96 bits\\n */\\n function toInt96(int256 value) internal pure returns (int96 downcasted) {\\n downcasted = int96(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(96, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int88 from int256, reverting on\\n * overflow (when the input is less than smallest int88 or\\n * greater than largest int88).\\n *\\n * Counterpart to Solidity's `int88` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 88 bits\\n */\\n function toInt88(int256 value) internal pure returns (int88 downcasted) {\\n downcasted = int88(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(88, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int80 from int256, reverting on\\n * overflow (when the input is less than smallest int80 or\\n * greater than largest int80).\\n *\\n * Counterpart to Solidity's `int80` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 80 bits\\n */\\n function toInt80(int256 value) internal pure returns (int80 downcasted) {\\n downcasted = int80(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(80, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int72 from int256, reverting on\\n * overflow (when the input is less than smallest int72 or\\n * greater than largest int72).\\n *\\n * Counterpart to Solidity's `int72` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 72 bits\\n */\\n function toInt72(int256 value) internal pure returns (int72 downcasted) {\\n downcasted = int72(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(72, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int64 from int256, reverting on\\n * overflow (when the input is less than smallest int64 or\\n * greater than largest int64).\\n *\\n * Counterpart to Solidity's `int64` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 64 bits\\n */\\n function toInt64(int256 value) internal pure returns (int64 downcasted) {\\n downcasted = int64(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(64, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int56 from int256, reverting on\\n * overflow (when the input is less than smallest int56 or\\n * greater than largest int56).\\n *\\n * Counterpart to Solidity's `int56` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 56 bits\\n */\\n function toInt56(int256 value) internal pure returns (int56 downcasted) {\\n downcasted = int56(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(56, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int48 from int256, reverting on\\n * overflow (when the input is less than smallest int48 or\\n * greater than largest int48).\\n *\\n * Counterpart to Solidity's `int48` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 48 bits\\n */\\n function toInt48(int256 value) internal pure returns (int48 downcasted) {\\n downcasted = int48(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(48, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int40 from int256, reverting on\\n * overflow (when the input is less than smallest int40 or\\n * greater than largest int40).\\n *\\n * Counterpart to Solidity's `int40` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 40 bits\\n */\\n function toInt40(int256 value) internal pure returns (int40 downcasted) {\\n downcasted = int40(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(40, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int32 from int256, reverting on\\n * overflow (when the input is less than smallest int32 or\\n * greater than largest int32).\\n *\\n * Counterpart to Solidity's `int32` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 32 bits\\n */\\n function toInt32(int256 value) internal pure returns (int32 downcasted) {\\n downcasted = int32(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(32, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int24 from int256, reverting on\\n * overflow (when the input is less than smallest int24 or\\n * greater than largest int24).\\n *\\n * Counterpart to Solidity's `int24` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 24 bits\\n */\\n function toInt24(int256 value) internal pure returns (int24 downcasted) {\\n downcasted = int24(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(24, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int16 from int256, reverting on\\n * overflow (when the input is less than smallest int16 or\\n * greater than largest int16).\\n *\\n * Counterpart to Solidity's `int16` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 16 bits\\n */\\n function toInt16(int256 value) internal pure returns (int16 downcasted) {\\n downcasted = int16(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(16, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int8 from int256, reverting on\\n * overflow (when the input is less than smallest int8 or\\n * greater than largest int8).\\n *\\n * Counterpart to Solidity's `int8` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 8 bits\\n */\\n function toInt8(int256 value) internal pure returns (int8 downcasted) {\\n downcasted = int8(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(8, value);\\n }\\n }\\n\\n /**\\n * @dev Converts an unsigned uint256 into a signed int256.\\n *\\n * Requirements:\\n *\\n * - input must be less than or equal to maxInt256.\\n */\\n function toInt256(uint256 value) internal pure returns (int256) {\\n // Note: Unsafe cast below is okay because `type(int256).max` is guaranteed to be positive\\n if (value > uint256(type(int256).max)) {\\n revert SafeCastOverflowedUintToInt(value);\\n }\\n return int256(value);\\n }\\n\\n /**\\n * @dev Cast a boolean (false or true) to a uint256 (0 or 1) with no jump.\\n */\\n function toUint(bool b) internal pure returns (uint256 u) {\\n assembly (\\\"memory-safe\\\") {\\n u := iszero(iszero(b))\\n }\\n }\\n}\\n\",\"keccak256\":\"0x195533c86d0ef72bcc06456a4f66a9b941f38eb403739b00f21fd7c1abd1ae54\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/math/SignedMath.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/math/SignedMath.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {SafeCast} from \\\"./SafeCast.sol\\\";\\n\\n/**\\n * @dev Standard signed math utilities missing in the Solidity language.\\n */\\nlibrary SignedMath {\\n /**\\n * @dev Branchless ternary evaluation for `a ? b : c`. Gas costs are constant.\\n *\\n * IMPORTANT: This function may reduce bytecode size and consume less gas when used standalone.\\n * However, the compiler may optimize Solidity ternary operations (i.e. `a ? b : c`) to only compute\\n * one branch when needed, making this function more expensive.\\n */\\n function ternary(bool condition, int256 a, int256 b) internal pure returns (int256) {\\n unchecked {\\n // branchless ternary works because:\\n // b ^ (a ^ b) == a\\n // b ^ 0 == b\\n return b ^ ((a ^ b) * int256(SafeCast.toUint(condition)));\\n }\\n }\\n\\n /**\\n * @dev Returns the largest of two signed numbers.\\n */\\n function max(int256 a, int256 b) internal pure returns (int256) {\\n return ternary(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 ternary(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 // Formula from the \\\"Bit Twiddling Hacks\\\" by Sean Eron Anderson.\\n // Since `n` is a signed integer, the generated bytecode will use the SAR opcode to perform the right shift,\\n // taking advantage of the most significant (or \\\"sign\\\" bit) in two's complement representation.\\n // This opcode adds new most significant bits set to the value of the previous most significant bit. As a result,\\n // the mask will either be `bytes32(0)` (if n is positive) or `~bytes32(0)` (if n is negative).\\n int256 mask = n >> 255;\\n\\n // A `bytes32(0)` mask leaves the input unchanged, while a `~bytes32(0)` mask complements it.\\n return uint256((n + mask) ^ mask);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xb1970fac7b64e6c09611e6691791e848d5e3fe410fa5899e7df2e0afd77a99e3\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/structs/Checkpoints.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/structs/Checkpoints.sol)\\n// This file was procedurally generated from scripts/generate/templates/Checkpoints.js.\\n\\npragma solidity ^0.8.20;\\n\\nimport {Math} from \\\"../math/Math.sol\\\";\\n\\n/**\\n * @dev This library defines the `Trace*` struct, for checkpointing values as they change at different points in\\n * time, and later looking up past values by block number. See {Votes} as an example.\\n *\\n * To create a history of checkpoints define a variable type `Checkpoints.Trace*` in your contract, and store a new\\n * checkpoint for the current transaction block using the {push} function.\\n */\\nlibrary Checkpoints {\\n /**\\n * @dev A value was attempted to be inserted on a past checkpoint.\\n */\\n error CheckpointUnorderedInsertion();\\n\\n struct Trace224 {\\n Checkpoint224[] _checkpoints;\\n }\\n\\n struct Checkpoint224 {\\n uint32 _key;\\n uint224 _value;\\n }\\n\\n /**\\n * @dev Pushes a (`key`, `value`) pair into a Trace224 so that it is stored as the checkpoint.\\n *\\n * Returns previous value and new value.\\n *\\n * IMPORTANT: Never accept `key` as a user input, since an arbitrary `type(uint32).max` key set will disable the\\n * library.\\n */\\n function push(\\n Trace224 storage self,\\n uint32 key,\\n uint224 value\\n ) internal returns (uint224 oldValue, uint224 newValue) {\\n return _insert(self._checkpoints, key, value);\\n }\\n\\n /**\\n * @dev Returns the value in the first (oldest) checkpoint with key greater or equal than the search key, or zero if\\n * there is none.\\n */\\n function lowerLookup(Trace224 storage self, uint32 key) internal view returns (uint224) {\\n uint256 len = self._checkpoints.length;\\n uint256 pos = _lowerBinaryLookup(self._checkpoints, key, 0, len);\\n return pos == len ? 0 : _unsafeAccess(self._checkpoints, pos)._value;\\n }\\n\\n /**\\n * @dev Returns the value in the last (most recent) checkpoint with key lower or equal than the search key, or zero\\n * if there is none.\\n */\\n function upperLookup(Trace224 storage self, uint32 key) internal view returns (uint224) {\\n uint256 len = self._checkpoints.length;\\n uint256 pos = _upperBinaryLookup(self._checkpoints, key, 0, len);\\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\\n }\\n\\n /**\\n * @dev Returns the value in the last (most recent) checkpoint with key lower or equal than the search key, or zero\\n * if there is none.\\n *\\n * NOTE: This is a variant of {upperLookup} that is optimised to find \\\"recent\\\" checkpoint (checkpoints with high\\n * keys).\\n */\\n function upperLookupRecent(Trace224 storage self, uint32 key) internal view returns (uint224) {\\n uint256 len = self._checkpoints.length;\\n\\n uint256 low = 0;\\n uint256 high = len;\\n\\n if (len > 5) {\\n uint256 mid = len - Math.sqrt(len);\\n if (key < _unsafeAccess(self._checkpoints, mid)._key) {\\n high = mid;\\n } else {\\n low = mid + 1;\\n }\\n }\\n\\n uint256 pos = _upperBinaryLookup(self._checkpoints, key, low, high);\\n\\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\\n }\\n\\n /**\\n * @dev Returns the value in the most recent checkpoint, or zero if there are no checkpoints.\\n */\\n function latest(Trace224 storage self) internal view returns (uint224) {\\n uint256 pos = self._checkpoints.length;\\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\\n }\\n\\n /**\\n * @dev Returns whether there is a checkpoint in the structure (i.e. it is not empty), and if so the key and value\\n * in the most recent checkpoint.\\n */\\n function latestCheckpoint(Trace224 storage self) internal view returns (bool exists, uint32 _key, uint224 _value) {\\n uint256 pos = self._checkpoints.length;\\n if (pos == 0) {\\n return (false, 0, 0);\\n } else {\\n Checkpoint224 storage ckpt = _unsafeAccess(self._checkpoints, pos - 1);\\n return (true, ckpt._key, ckpt._value);\\n }\\n }\\n\\n /**\\n * @dev Returns the number of checkpoint.\\n */\\n function length(Trace224 storage self) internal view returns (uint256) {\\n return self._checkpoints.length;\\n }\\n\\n /**\\n * @dev Returns checkpoint at given position.\\n */\\n function at(Trace224 storage self, uint32 pos) internal view returns (Checkpoint224 memory) {\\n return self._checkpoints[pos];\\n }\\n\\n /**\\n * @dev Pushes a (`key`, `value`) pair into an ordered list of checkpoints, either by inserting a new checkpoint,\\n * or by updating the last one.\\n */\\n function _insert(\\n Checkpoint224[] storage self,\\n uint32 key,\\n uint224 value\\n ) private returns (uint224 oldValue, uint224 newValue) {\\n uint256 pos = self.length;\\n\\n if (pos > 0) {\\n Checkpoint224 storage last = _unsafeAccess(self, pos - 1);\\n uint32 lastKey = last._key;\\n uint224 lastValue = last._value;\\n\\n // Checkpoint keys must be non-decreasing.\\n if (lastKey > key) {\\n revert CheckpointUnorderedInsertion();\\n }\\n\\n // Update or push new checkpoint\\n if (lastKey == key) {\\n last._value = value;\\n } else {\\n self.push(Checkpoint224({_key: key, _value: value}));\\n }\\n return (lastValue, value);\\n } else {\\n self.push(Checkpoint224({_key: key, _value: value}));\\n return (0, value);\\n }\\n }\\n\\n /**\\n * @dev Return the index of the first (oldest) checkpoint with key strictly bigger than the search key, or `high`\\n * if there is none. `low` and `high` define a section where to do the search, with inclusive `low` and exclusive\\n * `high`.\\n *\\n * WARNING: `high` should not be greater than the array's length.\\n */\\n function _upperBinaryLookup(\\n Checkpoint224[] storage self,\\n uint32 key,\\n uint256 low,\\n uint256 high\\n ) private view returns (uint256) {\\n while (low < high) {\\n uint256 mid = Math.average(low, high);\\n if (_unsafeAccess(self, mid)._key > key) {\\n high = mid;\\n } else {\\n low = mid + 1;\\n }\\n }\\n return high;\\n }\\n\\n /**\\n * @dev Return the index of the first (oldest) checkpoint with key greater or equal than the search key, or `high`\\n * if there is none. `low` and `high` define a section where to do the search, with inclusive `low` and exclusive\\n * `high`.\\n *\\n * WARNING: `high` should not be greater than the array's length.\\n */\\n function _lowerBinaryLookup(\\n Checkpoint224[] storage self,\\n uint32 key,\\n uint256 low,\\n uint256 high\\n ) private view returns (uint256) {\\n while (low < high) {\\n uint256 mid = Math.average(low, high);\\n if (_unsafeAccess(self, mid)._key < key) {\\n low = mid + 1;\\n } else {\\n high = mid;\\n }\\n }\\n return high;\\n }\\n\\n /**\\n * @dev Access an element of the array without performing bounds check. The position is assumed to be within bounds.\\n */\\n function _unsafeAccess(\\n Checkpoint224[] storage self,\\n uint256 pos\\n ) private pure returns (Checkpoint224 storage result) {\\n assembly {\\n mstore(0, self.slot)\\n result.slot := add(keccak256(0, 0x20), pos)\\n }\\n }\\n\\n struct Trace208 {\\n Checkpoint208[] _checkpoints;\\n }\\n\\n struct Checkpoint208 {\\n uint48 _key;\\n uint208 _value;\\n }\\n\\n /**\\n * @dev Pushes a (`key`, `value`) pair into a Trace208 so that it is stored as the checkpoint.\\n *\\n * Returns previous value and new value.\\n *\\n * IMPORTANT: Never accept `key` as a user input, since an arbitrary `type(uint48).max` key set will disable the\\n * library.\\n */\\n function push(\\n Trace208 storage self,\\n uint48 key,\\n uint208 value\\n ) internal returns (uint208 oldValue, uint208 newValue) {\\n return _insert(self._checkpoints, key, value);\\n }\\n\\n /**\\n * @dev Returns the value in the first (oldest) checkpoint with key greater or equal than the search key, or zero if\\n * there is none.\\n */\\n function lowerLookup(Trace208 storage self, uint48 key) internal view returns (uint208) {\\n uint256 len = self._checkpoints.length;\\n uint256 pos = _lowerBinaryLookup(self._checkpoints, key, 0, len);\\n return pos == len ? 0 : _unsafeAccess(self._checkpoints, pos)._value;\\n }\\n\\n /**\\n * @dev Returns the value in the last (most recent) checkpoint with key lower or equal than the search key, or zero\\n * if there is none.\\n */\\n function upperLookup(Trace208 storage self, uint48 key) internal view returns (uint208) {\\n uint256 len = self._checkpoints.length;\\n uint256 pos = _upperBinaryLookup(self._checkpoints, key, 0, len);\\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\\n }\\n\\n /**\\n * @dev Returns the value in the last (most recent) checkpoint with key lower or equal than the search key, or zero\\n * if there is none.\\n *\\n * NOTE: This is a variant of {upperLookup} that is optimised to find \\\"recent\\\" checkpoint (checkpoints with high\\n * keys).\\n */\\n function upperLookupRecent(Trace208 storage self, uint48 key) internal view returns (uint208) {\\n uint256 len = self._checkpoints.length;\\n\\n uint256 low = 0;\\n uint256 high = len;\\n\\n if (len > 5) {\\n uint256 mid = len - Math.sqrt(len);\\n if (key < _unsafeAccess(self._checkpoints, mid)._key) {\\n high = mid;\\n } else {\\n low = mid + 1;\\n }\\n }\\n\\n uint256 pos = _upperBinaryLookup(self._checkpoints, key, low, high);\\n\\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\\n }\\n\\n /**\\n * @dev Returns the value in the most recent checkpoint, or zero if there are no checkpoints.\\n */\\n function latest(Trace208 storage self) internal view returns (uint208) {\\n uint256 pos = self._checkpoints.length;\\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\\n }\\n\\n /**\\n * @dev Returns whether there is a checkpoint in the structure (i.e. it is not empty), and if so the key and value\\n * in the most recent checkpoint.\\n */\\n function latestCheckpoint(Trace208 storage self) internal view returns (bool exists, uint48 _key, uint208 _value) {\\n uint256 pos = self._checkpoints.length;\\n if (pos == 0) {\\n return (false, 0, 0);\\n } else {\\n Checkpoint208 storage ckpt = _unsafeAccess(self._checkpoints, pos - 1);\\n return (true, ckpt._key, ckpt._value);\\n }\\n }\\n\\n /**\\n * @dev Returns the number of checkpoint.\\n */\\n function length(Trace208 storage self) internal view returns (uint256) {\\n return self._checkpoints.length;\\n }\\n\\n /**\\n * @dev Returns checkpoint at given position.\\n */\\n function at(Trace208 storage self, uint32 pos) internal view returns (Checkpoint208 memory) {\\n return self._checkpoints[pos];\\n }\\n\\n /**\\n * @dev Pushes a (`key`, `value`) pair into an ordered list of checkpoints, either by inserting a new checkpoint,\\n * or by updating the last one.\\n */\\n function _insert(\\n Checkpoint208[] storage self,\\n uint48 key,\\n uint208 value\\n ) private returns (uint208 oldValue, uint208 newValue) {\\n uint256 pos = self.length;\\n\\n if (pos > 0) {\\n Checkpoint208 storage last = _unsafeAccess(self, pos - 1);\\n uint48 lastKey = last._key;\\n uint208 lastValue = last._value;\\n\\n // Checkpoint keys must be non-decreasing.\\n if (lastKey > key) {\\n revert CheckpointUnorderedInsertion();\\n }\\n\\n // Update or push new checkpoint\\n if (lastKey == key) {\\n last._value = value;\\n } else {\\n self.push(Checkpoint208({_key: key, _value: value}));\\n }\\n return (lastValue, value);\\n } else {\\n self.push(Checkpoint208({_key: key, _value: value}));\\n return (0, value);\\n }\\n }\\n\\n /**\\n * @dev Return the index of the first (oldest) checkpoint with key strictly bigger than the search key, or `high`\\n * if there is none. `low` and `high` define a section where to do the search, with inclusive `low` and exclusive\\n * `high`.\\n *\\n * WARNING: `high` should not be greater than the array's length.\\n */\\n function _upperBinaryLookup(\\n Checkpoint208[] storage self,\\n uint48 key,\\n uint256 low,\\n uint256 high\\n ) private view returns (uint256) {\\n while (low < high) {\\n uint256 mid = Math.average(low, high);\\n if (_unsafeAccess(self, mid)._key > key) {\\n high = mid;\\n } else {\\n low = mid + 1;\\n }\\n }\\n return high;\\n }\\n\\n /**\\n * @dev Return the index of the first (oldest) checkpoint with key greater or equal than the search key, or `high`\\n * if there is none. `low` and `high` define a section where to do the search, with inclusive `low` and exclusive\\n * `high`.\\n *\\n * WARNING: `high` should not be greater than the array's length.\\n */\\n function _lowerBinaryLookup(\\n Checkpoint208[] storage self,\\n uint48 key,\\n uint256 low,\\n uint256 high\\n ) private view returns (uint256) {\\n while (low < high) {\\n uint256 mid = Math.average(low, high);\\n if (_unsafeAccess(self, mid)._key < key) {\\n low = mid + 1;\\n } else {\\n high = mid;\\n }\\n }\\n return high;\\n }\\n\\n /**\\n * @dev Access an element of the array without performing bounds check. The position is assumed to be within bounds.\\n */\\n function _unsafeAccess(\\n Checkpoint208[] storage self,\\n uint256 pos\\n ) private pure returns (Checkpoint208 storage result) {\\n assembly {\\n mstore(0, self.slot)\\n result.slot := add(keccak256(0, 0x20), pos)\\n }\\n }\\n\\n struct Trace160 {\\n Checkpoint160[] _checkpoints;\\n }\\n\\n struct Checkpoint160 {\\n uint96 _key;\\n uint160 _value;\\n }\\n\\n /**\\n * @dev Pushes a (`key`, `value`) pair into a Trace160 so that it is stored as the checkpoint.\\n *\\n * Returns previous value and new value.\\n *\\n * IMPORTANT: Never accept `key` as a user input, since an arbitrary `type(uint96).max` key set will disable the\\n * library.\\n */\\n function push(\\n Trace160 storage self,\\n uint96 key,\\n uint160 value\\n ) internal returns (uint160 oldValue, uint160 newValue) {\\n return _insert(self._checkpoints, key, value);\\n }\\n\\n /**\\n * @dev Returns the value in the first (oldest) checkpoint with key greater or equal than the search key, or zero if\\n * there is none.\\n */\\n function lowerLookup(Trace160 storage self, uint96 key) internal view returns (uint160) {\\n uint256 len = self._checkpoints.length;\\n uint256 pos = _lowerBinaryLookup(self._checkpoints, key, 0, len);\\n return pos == len ? 0 : _unsafeAccess(self._checkpoints, pos)._value;\\n }\\n\\n /**\\n * @dev Returns the value in the last (most recent) checkpoint with key lower or equal than the search key, or zero\\n * if there is none.\\n */\\n function upperLookup(Trace160 storage self, uint96 key) internal view returns (uint160) {\\n uint256 len = self._checkpoints.length;\\n uint256 pos = _upperBinaryLookup(self._checkpoints, key, 0, len);\\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\\n }\\n\\n /**\\n * @dev Returns the value in the last (most recent) checkpoint with key lower or equal than the search key, or zero\\n * if there is none.\\n *\\n * NOTE: This is a variant of {upperLookup} that is optimised to find \\\"recent\\\" checkpoint (checkpoints with high\\n * keys).\\n */\\n function upperLookupRecent(Trace160 storage self, uint96 key) internal view returns (uint160) {\\n uint256 len = self._checkpoints.length;\\n\\n uint256 low = 0;\\n uint256 high = len;\\n\\n if (len > 5) {\\n uint256 mid = len - Math.sqrt(len);\\n if (key < _unsafeAccess(self._checkpoints, mid)._key) {\\n high = mid;\\n } else {\\n low = mid + 1;\\n }\\n }\\n\\n uint256 pos = _upperBinaryLookup(self._checkpoints, key, low, high);\\n\\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\\n }\\n\\n /**\\n * @dev Returns the value in the most recent checkpoint, or zero if there are no checkpoints.\\n */\\n function latest(Trace160 storage self) internal view returns (uint160) {\\n uint256 pos = self._checkpoints.length;\\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\\n }\\n\\n /**\\n * @dev Returns whether there is a checkpoint in the structure (i.e. it is not empty), and if so the key and value\\n * in the most recent checkpoint.\\n */\\n function latestCheckpoint(Trace160 storage self) internal view returns (bool exists, uint96 _key, uint160 _value) {\\n uint256 pos = self._checkpoints.length;\\n if (pos == 0) {\\n return (false, 0, 0);\\n } else {\\n Checkpoint160 storage ckpt = _unsafeAccess(self._checkpoints, pos - 1);\\n return (true, ckpt._key, ckpt._value);\\n }\\n }\\n\\n /**\\n * @dev Returns the number of checkpoint.\\n */\\n function length(Trace160 storage self) internal view returns (uint256) {\\n return self._checkpoints.length;\\n }\\n\\n /**\\n * @dev Returns checkpoint at given position.\\n */\\n function at(Trace160 storage self, uint32 pos) internal view returns (Checkpoint160 memory) {\\n return self._checkpoints[pos];\\n }\\n\\n /**\\n * @dev Pushes a (`key`, `value`) pair into an ordered list of checkpoints, either by inserting a new checkpoint,\\n * or by updating the last one.\\n */\\n function _insert(\\n Checkpoint160[] storage self,\\n uint96 key,\\n uint160 value\\n ) private returns (uint160 oldValue, uint160 newValue) {\\n uint256 pos = self.length;\\n\\n if (pos > 0) {\\n Checkpoint160 storage last = _unsafeAccess(self, pos - 1);\\n uint96 lastKey = last._key;\\n uint160 lastValue = last._value;\\n\\n // Checkpoint keys must be non-decreasing.\\n if (lastKey > key) {\\n revert CheckpointUnorderedInsertion();\\n }\\n\\n // Update or push new checkpoint\\n if (lastKey == key) {\\n last._value = value;\\n } else {\\n self.push(Checkpoint160({_key: key, _value: value}));\\n }\\n return (lastValue, value);\\n } else {\\n self.push(Checkpoint160({_key: key, _value: value}));\\n return (0, value);\\n }\\n }\\n\\n /**\\n * @dev Return the index of the first (oldest) checkpoint with key strictly bigger than the search key, or `high`\\n * if there is none. `low` and `high` define a section where to do the search, with inclusive `low` and exclusive\\n * `high`.\\n *\\n * WARNING: `high` should not be greater than the array's length.\\n */\\n function _upperBinaryLookup(\\n Checkpoint160[] storage self,\\n uint96 key,\\n uint256 low,\\n uint256 high\\n ) private view returns (uint256) {\\n while (low < high) {\\n uint256 mid = Math.average(low, high);\\n if (_unsafeAccess(self, mid)._key > key) {\\n high = mid;\\n } else {\\n low = mid + 1;\\n }\\n }\\n return high;\\n }\\n\\n /**\\n * @dev Return the index of the first (oldest) checkpoint with key greater or equal than the search key, or `high`\\n * if there is none. `low` and `high` define a section where to do the search, with inclusive `low` and exclusive\\n * `high`.\\n *\\n * WARNING: `high` should not be greater than the array's length.\\n */\\n function _lowerBinaryLookup(\\n Checkpoint160[] storage self,\\n uint96 key,\\n uint256 low,\\n uint256 high\\n ) private view returns (uint256) {\\n while (low < high) {\\n uint256 mid = Math.average(low, high);\\n if (_unsafeAccess(self, mid)._key < key) {\\n low = mid + 1;\\n } else {\\n high = mid;\\n }\\n }\\n return high;\\n }\\n\\n /**\\n * @dev Access an element of the array without performing bounds check. The position is assumed to be within bounds.\\n */\\n function _unsafeAccess(\\n Checkpoint160[] storage self,\\n uint256 pos\\n ) private pure returns (Checkpoint160 storage result) {\\n assembly {\\n mstore(0, self.slot)\\n result.slot := add(keccak256(0, 0x20), pos)\\n }\\n }\\n}\\n\",\"keccak256\":\"0x66364cd3247ea71cdb58f080f5d5ed6732433a8001413139661841535494692f\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/types/Time.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/types/Time.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {Math} from \\\"../math/Math.sol\\\";\\nimport {SafeCast} from \\\"../math/SafeCast.sol\\\";\\n\\n/**\\n * @dev This library provides helpers for manipulating time-related objects.\\n *\\n * It uses the following types:\\n * - `uint48` for timepoints\\n * - `uint32` for durations\\n *\\n * While the library doesn't provide specific types for timepoints and duration, it does provide:\\n * - a `Delay` type to represent duration that can be programmed to change value automatically at a given point\\n * - additional helper functions\\n */\\nlibrary Time {\\n using Time for *;\\n\\n /**\\n * @dev Get the block timestamp as a Timepoint.\\n */\\n function timestamp() internal view returns (uint48) {\\n return SafeCast.toUint48(block.timestamp);\\n }\\n\\n /**\\n * @dev Get the block number as a Timepoint.\\n */\\n function blockNumber() internal view returns (uint48) {\\n return SafeCast.toUint48(block.number);\\n }\\n\\n // ==================================================== Delay =====================================================\\n /**\\n * @dev A `Delay` is a uint32 duration that can be programmed to change value automatically at a given point in the\\n * future. The \\\"effect\\\" timepoint describes when the transitions happens from the \\\"old\\\" value to the \\\"new\\\" value.\\n * This allows updating the delay applied to some operation while keeping some guarantees.\\n *\\n * In particular, the {update} function guarantees that if the delay is reduced, the old delay still applies for\\n * some time. For example if the delay is currently 7 days to do an upgrade, the admin should not be able to set\\n * the delay to 0 and upgrade immediately. If the admin wants to reduce the delay, the old delay (7 days) should\\n * still apply for some time.\\n *\\n *\\n * The `Delay` type is 112 bits long, and packs the following:\\n *\\n * ```\\n * | [uint48]: effect date (timepoint)\\n * | | [uint32]: value before (duration)\\n * \\u2193 \\u2193 \\u2193 [uint32]: value after (duration)\\n * 0xAAAAAAAAAAAABBBBBBBBCCCCCCCC\\n * ```\\n *\\n * NOTE: The {get} and {withUpdate} functions operate using timestamps. Block number based delays are not currently\\n * supported.\\n */\\n type Delay is uint112;\\n\\n /**\\n * @dev Wrap a duration into a Delay to add the one-step \\\"update in the future\\\" feature\\n */\\n function toDelay(uint32 duration) internal pure returns (Delay) {\\n return Delay.wrap(duration);\\n }\\n\\n /**\\n * @dev Get the value at a given timepoint plus the pending value and effect timepoint if there is a scheduled\\n * change after this timepoint. If the effect timepoint is 0, then the pending value should not be considered.\\n */\\n function _getFullAt(\\n Delay self,\\n uint48 timepoint\\n ) private pure returns (uint32 valueBefore, uint32 valueAfter, uint48 effect) {\\n (valueBefore, valueAfter, effect) = self.unpack();\\n return effect <= timepoint ? (valueAfter, 0, 0) : (valueBefore, valueAfter, effect);\\n }\\n\\n /**\\n * @dev Get the current value plus the pending value and effect timepoint if there is a scheduled change. If the\\n * effect timepoint is 0, then the pending value should not be considered.\\n */\\n function getFull(Delay self) internal view returns (uint32 valueBefore, uint32 valueAfter, uint48 effect) {\\n return _getFullAt(self, timestamp());\\n }\\n\\n /**\\n * @dev Get the current value.\\n */\\n function get(Delay self) internal view returns (uint32) {\\n (uint32 delay, , ) = self.getFull();\\n return delay;\\n }\\n\\n /**\\n * @dev Update a Delay object so that it takes a new duration after a timepoint that is automatically computed to\\n * enforce the old delay at the moment of the update. Returns the updated Delay object and the timestamp when the\\n * new delay becomes effective.\\n */\\n function withUpdate(\\n Delay self,\\n uint32 newValue,\\n uint32 minSetback\\n ) internal view returns (Delay updatedDelay, uint48 effect) {\\n uint32 value = self.get();\\n uint32 setback = uint32(Math.max(minSetback, value > newValue ? value - newValue : 0));\\n effect = timestamp() + setback;\\n return (pack(value, newValue, effect), effect);\\n }\\n\\n /**\\n * @dev Split a delay into its components: valueBefore, valueAfter and effect (transition timepoint).\\n */\\n function unpack(Delay self) internal pure returns (uint32 valueBefore, uint32 valueAfter, uint48 effect) {\\n uint112 raw = Delay.unwrap(self);\\n\\n valueAfter = uint32(raw);\\n valueBefore = uint32(raw >> 32);\\n effect = uint48(raw >> 64);\\n\\n return (valueBefore, valueAfter, effect);\\n }\\n\\n /**\\n * @dev pack the components into a Delay object.\\n */\\n function pack(uint32 valueBefore, uint32 valueAfter, uint48 effect) internal pure returns (Delay) {\\n return Delay.wrap((uint112(effect) << 64) | (uint112(valueBefore) << 32) | uint112(valueAfter));\\n }\\n}\\n\",\"keccak256\":\"0x36776530f012618bc7526ceb28e77b85e582cb12d9b9466a71d4bd6bf952e4cc\",\"license\":\"MIT\"},\"contracts/variants/crosschain/NFT.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity ^0.8.20;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC721/ERC721.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC721/extensions/ERC721Burnable.sol\\\";\\nimport \\\"@openzeppelin/contracts/access/Ownable.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/cryptography/EIP712.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC721/extensions/ERC721Votes.sol\\\";\\nimport \\\"./ProofHandler.sol\\\";\\n\\n/**\\n * @title Cross-chain Membership NFT Contract\\n * @author Web3 Hackers Collective\\n * @notice Non-transferable NFT implementation for DAO membership with cross-chain capabilities\\n * @dev Extends OpenZeppelin's NFT standards with cross-chain operation support and delegation\\n * @custom:security-contact julien@strat.cc\\n */\\ncontract NFT is\\n ERC721,\\n ERC721Enumerable,\\n ERC721URIStorage,\\n ERC721Burnable,\\n Ownable,\\n EIP712,\\n ERC721Votes\\n{\\n using ProofHandler for ProofHandler.ProofStorage;\\n\\n /// @notice Chain ID where contract was originally deployed\\n uint256 public immutable home;\\n\\n /// @notice Next token ID to be minted\\n uint256 private _nextTokenId;\\n\\n /// @notice Storage for proof handling\\n ProofHandler.ProofStorage private _proofStorage;\\n\\n /// @notice Types of operations that can be synchronized across chains\\n enum OperationType {\\n MINT,\\n BURN,\\n SET_METADATA,\\n DELEGATE\\n }\\n\\n /// @notice Emitted when a membership is claimed\\n /// @param tokenId The ID of the claimed token\\n /// @param member The address receiving the membership\\n /// @param nonce Operation sequence number\\n event MembershipClaimed(uint256 indexed tokenId, address indexed member, uint256 nonce);\\n\\n /// @notice Emitted when a membership is revoked\\n /// @param tokenId The ID of the revoked token\\n /// @param member The address losing membership\\n /// @param nonce Operation sequence number\\n event MembershipRevoked(uint256 indexed tokenId, address indexed member, uint256 nonce);\\n\\n /// @notice Emitted when metadata is updated\\n /// @param tokenId The ID of the updated token\\n /// @param newUri The new metadata URI\\n /// @param nonce Operation sequence number\\n event MetadataUpdated(uint256 indexed tokenId, string newUri, uint256 nonce);\\n\\n /// @notice Emitted when delegation is synchronized across chains\\n /// @param delegator The address delegating their voting power\\n /// @param delegatee The address receiving the delegation\\n /// @param nonce Operation sequence number\\n event DelegationSynced(address indexed delegator, address indexed delegatee, uint256 nonce);\\n\\n /// @notice Restricts functions to home chain\\n modifier onlyHomeChain() {\\n require(block.chainid == home, \\\"Operation only allowed on home chain\\\");\\n _;\\n }\\n\\n /**\\n * @notice Initializes the NFT contract\\n * @param _home Chain ID where contract is considered home\\n * @param initialOwner Initial contract owner\\n * @param _firstMembers Array of initial member addresses\\n * @param _uri Initial token URI\\n * @param _name Token collection name\\n * @param _symbol Token collection symbol\\n */\\n constructor(\\n uint256 _home,\\n address initialOwner,\\n address[] memory _firstMembers,\\n string memory _uri,\\n string memory _name,\\n string memory _symbol\\n ) ERC721(_name, _symbol) Ownable(initialOwner) EIP712(_name, \\\"1\\\") {\\n home = _home;\\n for (uint i; i < _firstMembers.length; i++) {\\n _govMint(_firstMembers[i], _uri);\\n _delegate(_firstMembers[i], _firstMembers[i]);\\n }\\n }\\n\\n /**\\n * @notice Adds a new member on home chain\\n * @dev Only callable by owner (governance) on home chain\\n * @param to Address to mint token to\\n * @param uri Token metadata URI\\n */\\n function safeMint(address to, string memory uri) public onlyOwner onlyHomeChain {\\n uint256 nonce = _proofStorage.incrementNonce(uint8(OperationType.MINT));\\n _govMint(to, uri);\\n emit MembershipClaimed(_nextTokenId - 1, to, nonce);\\n }\\n\\n /**\\n * @notice Burns token on home chain\\n * @dev Only callable by owner (governance) on home chain\\n * @param tokenId ID of token to burn\\n */\\n function govBurn(uint256 tokenId) public onlyOwner onlyHomeChain {\\n uint256 nonce = _proofStorage.incrementNonce(uint8(OperationType.BURN));\\n address owner = ownerOf(tokenId);\\n _burn(tokenId);\\n emit MembershipRevoked(tokenId, owner, nonce);\\n }\\n\\n /**\\n * @notice Updates token metadata on home chain\\n * @dev Only callable by owner (governance) on home chain\\n * @param tokenId ID of token to update\\n * @param uri New metadata URI\\n */\\n function setMetadata(uint256 tokenId, string memory uri) public onlyOwner onlyHomeChain {\\n uint256 nonce = _proofStorage.incrementNonce(uint8(OperationType.SET_METADATA));\\n _setTokenURI(tokenId, uri);\\n emit MetadataUpdated(tokenId, uri, nonce);\\n }\\n\\n /**\\n * @notice Delegates voting power to another address on home chain\\n * @dev Overrides ERC721Votes delegate function to add cross-chain functionality\\n * @param delegatee Address to delegate voting power to\\n */\\n function delegate(address delegatee) public virtual override onlyHomeChain {\\n uint256 nonce = _proofStorage.incrementNonce(uint8(OperationType.DELEGATE));\\n _delegate(_msgSender(), delegatee);\\n emit DelegationSynced(_msgSender(), delegatee, nonce);\\n }\\n\\n /**\\n * @notice Generates proof for NFT operations\\n * @dev Only callable on home chain\\n * @param operationType Type of operation\\n * @param params Operation parameters\\n * @return Encoded proof data\\n */\\n function generateOperationProof(\\n uint8 operationType,\\n bytes memory params\\n ) external view returns (bytes memory) {\\n require(block.chainid == home, \\\"Proofs only generated on home chain\\\");\\n uint256 nextNonce = _proofStorage.getNextNonce(operationType);\\n return ProofHandler.generateProof(address(this), operationType, params, nextNonce);\\n }\\n\\n /**\\n * @notice Generates proof for delegation\\n * @dev Only callable on home chain\\n * @param delegator Address delegating voting power\\n * @param delegatee Address receiving delegation\\n * @return Encoded proof data\\n */\\n function generateDelegationProof(\\n address delegator,\\n address delegatee\\n ) external view returns (bytes memory) {\\n require(block.chainid == home, \\\"Proofs only generated on home chain\\\");\\n uint256 nextNonce = _proofStorage.getNextNonce(uint8(OperationType.DELEGATE));\\n bytes memory params = abi.encode(delegator, delegatee);\\n return\\n ProofHandler.generateProof(\\n address(this),\\n uint8(OperationType.DELEGATE),\\n params,\\n nextNonce\\n );\\n }\\n\\n // Claim operations\\n\\n /**\\n * @notice Claims an NFT operation on a foreign chain\\n * @param proof Proof generated by home chain\\n */\\n function claimOperation(bytes memory proof) external {\\n (uint8 operationType, bytes memory params, uint256 nonce) = ProofHandler\\n .verifyAndClaimProof(proof, address(this), _proofStorage);\\n\\n if (operationType == uint8(OperationType.MINT)) {\\n (address to, string memory uri) = abi.decode(params, (address, string));\\n _govMint(to, uri);\\n emit MembershipClaimed(_nextTokenId - 1, to, nonce);\\n } else if (operationType == uint8(OperationType.BURN)) {\\n uint256 tokenId = abi.decode(params, (uint256));\\n address owner = ownerOf(tokenId);\\n _burn(tokenId);\\n emit MembershipRevoked(tokenId, owner, nonce);\\n } else if (operationType == uint8(OperationType.SET_METADATA)) {\\n (uint256 tokenId, string memory uri) = abi.decode(params, (uint256, string));\\n _setTokenURI(tokenId, uri);\\n emit MetadataUpdated(tokenId, uri, nonce);\\n } else if (operationType == uint8(OperationType.DELEGATE)) {\\n (address delegator, address delegatee) = abi.decode(params, (address, address));\\n _delegate(delegator, delegatee);\\n emit DelegationSynced(delegator, delegatee, nonce);\\n }\\n }\\n\\n /**\\n * @notice Claims a delegation operation on a foreign chain\\n * @param proof Proof generated by home chain\\n */\\n function claimDelegation(bytes memory proof) external {\\n (uint8 operationType, bytes memory params, uint256 nonce) = ProofHandler\\n .verifyAndClaimProof(proof, address(this), _proofStorage);\\n\\n require(operationType == uint8(OperationType.DELEGATE), \\\"Invalid operation type\\\");\\n (address delegator, address delegatee) = abi.decode(params, (address, address));\\n\\n _delegate(delegator, delegatee);\\n emit DelegationSynced(delegator, delegatee, nonce);\\n }\\n\\n /**\\n * @notice Internal function for minting without proof verification\\n * @param to Address to receive token\\n * @param uri Token metadata URI\\n */\\n function _govMint(address to, string memory uri) internal {\\n uint256 tokenId = _nextTokenId++;\\n _safeMint(to, tokenId);\\n _setTokenURI(tokenId, uri);\\n _delegate(to, to);\\n }\\n\\n // Required overrides\\n\\n /**\\n * @notice Updates token data\\n * @dev Overrides ERC721 _update to make NFTs non-transferable\\n * @param to Recipient address\\n * @param tokenId Token ID\\n * @param auth Address authorized for transfer\\n * @return Previous owner address\\n */\\n function _update(\\n address to,\\n uint256 tokenId,\\n address auth\\n ) internal override(ERC721, ERC721Enumerable, ERC721Votes) returns (address) {\\n require(auth == address(0) || to == address(0), \\\"NFT is not transferable\\\");\\n return super._update(to, tokenId, auth);\\n }\\n\\n /**\\n * @notice Increments account balance\\n * @dev Internal override to maintain compatibility\\n * @param account Account to update\\n * @param value Amount to increase by\\n */\\n function _increaseBalance(\\n address account,\\n uint128 value\\n ) internal override(ERC721, ERC721Enumerable, ERC721Votes) {\\n super._increaseBalance(account, value);\\n }\\n\\n /**\\n * @notice Gets token URI\\n * @param tokenId Token ID to query\\n * @return URI string\\n */\\n function tokenURI(\\n uint256 tokenId\\n ) public view override(ERC721, ERC721URIStorage) returns (string memory) {\\n return super.tokenURI(tokenId);\\n }\\n\\n /**\\n * @notice Checks interface support\\n * @param interfaceId Interface identifier to check\\n * @return bool True if interface is supported\\n */\\n function supportsInterface(\\n bytes4 interfaceId\\n ) public view override(ERC721, ERC721Enumerable, ERC721URIStorage) returns (bool) {\\n return super.supportsInterface(interfaceId);\\n }\\n\\n /**\\n * @notice Gets current timestamp\\n * @dev Used for voting snapshots\\n * @return Current block timestamp\\n */\\n function clock() public view override returns (uint48) {\\n return uint48(block.timestamp);\\n }\\n\\n /**\\n * @notice Gets clock mode description\\n * @return String indicating timestamp-based voting\\n */\\n function CLOCK_MODE() public pure override returns (string memory) {\\n return \\\"mode=timestamp\\\";\\n }\\n}\\n\",\"keccak256\":\"0x3d703da3e4617f28dc5b0b763ff0485c49bcb162e4eb33d90f7384c7a1f5aed5\",\"license\":\"GPL-3.0\"},\"contracts/variants/crosschain/ProofHandler.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity ^0.8.20;\\n\\n/**\\n * @title Proof Handler Library\\n * @author Web3 Hackers Collective\\n * @notice Library for standardized cross-chain proof generation and verification\\n * @dev Handles proof generation, verification, and tracking for cross-chain operations\\n * @custom:security-contact julien@strat.cc\\n */\\nlibrary ProofHandler {\\n /// @notice Tracks which proofs have been applied on each chain\\n struct ProofStorage {\\n mapping(bytes32 => bool) updateAppliedOnChain;\\n mapping(uint8 => uint256) currentNonce;\\n }\\n\\n /// @dev Emitted when a proof is claimed\\n event ProofClaimed(uint8 indexed operationType, bytes params, uint256 nonce);\\n\\n /**\\n * @notice Generates a proof for cross-chain operations\\n * @param contractAddress Address of contract generating the proof\\n * @param operationType Type of operation being performed\\n * @param params Operation parameters\\n * @param nonce Current nonce for this operation type\\n * @return proof Encoded proof data\\n */\\n function generateProof(\\n address contractAddress,\\n uint8 operationType,\\n bytes memory params,\\n uint256 nonce\\n ) public pure returns (bytes memory proof) {\\n bytes32 message = keccak256(\\n abi.encodePacked(contractAddress, operationType, params, nonce)\\n );\\n bytes32 digest = keccak256(abi.encodePacked(\\\"\\\\x19Ethereum Signed Message:\\\\n32\\\", message));\\n\\n return abi.encode(operationType, params, nonce, digest);\\n }\\n\\n /**\\n * @notice Verifies and claims a proof\\n * @param proof Proof to verify and claim\\n * @param contractAddress Address of contract claiming the proof\\n * @param storage_ Proof storage struct\\n * @return operationType The type of operation being performed\\n * @return params The operation parameters\\n * @return nonce The operation sequence number\\n */\\n function verifyAndClaimProof(\\n bytes memory proof,\\n address contractAddress,\\n ProofStorage storage storage_\\n ) public returns (uint8 operationType, bytes memory params, uint256 nonce) {\\n bytes32 digest;\\n (operationType, params, nonce, digest) = abi.decode(\\n proof,\\n (uint8, bytes, uint256, bytes32)\\n );\\n\\n bytes32 proofHash = keccak256(proof);\\n require(!storage_.updateAppliedOnChain[proofHash], \\\"Proof already claimed\\\");\\n require(nonce == storage_.currentNonce[operationType] + 1, \\\"Invalid nonce\\\");\\n\\n bytes32 message = keccak256(\\n abi.encodePacked(contractAddress, operationType, params, nonce)\\n );\\n bytes32 expectedDigest = keccak256(\\n abi.encodePacked(\\\"\\\\x19Ethereum Signed Message:\\\\n32\\\", message)\\n );\\n require(digest == expectedDigest, \\\"Invalid proof\\\");\\n\\n storage_.updateAppliedOnChain[proofHash] = true;\\n storage_.currentNonce[operationType] = nonce;\\n\\n emit ProofClaimed(operationType, params, nonce);\\n\\n return (operationType, params, nonce);\\n }\\n\\n /**\\n * @notice Gets the next nonce for an operation type\\n * @param storage_ Proof storage struct\\n * @param operationType Type of operation\\n * @return nonce Next nonce value\\n */\\n function getNextNonce(\\n ProofStorage storage storage_,\\n uint8 operationType\\n ) public view returns (uint256 nonce) {\\n return storage_.currentNonce[operationType] + 1;\\n }\\n\\n /**\\n * @notice Increments the nonce for an operation type\\n * @param storage_ Proof storage struct\\n * @param operationType Type of operation\\n * @return nonce New nonce value\\n */\\n function incrementNonce(\\n ProofStorage storage storage_,\\n uint8 operationType\\n ) public returns (uint256 nonce) {\\n storage_.currentNonce[operationType]++;\\n return storage_.currentNonce[operationType];\\n }\\n}\\n\",\"keccak256\":\"0x3719e47c508f29977d48842c5c1d27cce7cb289cbb592526f170f98135ff41a7\",\"license\":\"GPL-3.0\"}},\"version\":1}", + "bytecode": "0x6101806040523480156200001257600080fd5b50604051620050023803806200500283398101604081905262000035916200126d565b6040805180820190915260018152603160f81b602082015282908682846000620000608382620013c8565b5060016200006f8282620013c8565b5050506001600160a01b038116620000a257604051631e4fbdf760e01b8152600060048201526024015b60405180910390fd5b620000ad8162000210565b50620000bb82600c62000262565b61012052620000cc81600d62000262565b61014052815160208084019190912060e052815190820120610100524660a0526200015a60e05161010051604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f60208201529081019290925260608201524660808201523060a082015260009060c00160405160208183030381529060405280519060200120905090565b60805250503060c05261016086905260005b84518110156200020357620001a48582815181106200018f576200018f62001494565b6020026020010151856200029b60201b60201c565b620001ee858281518110620001bd57620001bd62001494565b6020026020010151868381518110620001da57620001da62001494565b6020026020010151620002dd60201b60201c565b80620001fa81620014c0565b9150506200016c565b5050505050505062001628565b600b80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600060208351101562000282576200027a8362000353565b905062000295565b816200028f8482620013c8565b5060ff90505b92915050565b6012805460009182620002ae83620014c0565b909155509050620002c0838262000396565b620002cc8183620003bc565b620002d88380620002dd565b505050565b6001600160a01b038281166000818152600f602052604080822080548686166001600160a01b0319821681179092559151919094169392849290917f3134e8a2e6d97e929a7e54011ea5485d7d196dd5f0ba4d4ef95803e8e3fc257f9190a4620002d881836200034d866200040e565b6200041b565b600080829050601f8151111562000381578260405163305a27a960e01b81526004016200009991906200150a565b80516200038e826200151f565b179392505050565b620003b88282604051806020016040528060008152506200058860201b60201c565b5050565b6000828152600a60205260409020620003d68282620013c8565b506040518281527ff8e1a15aba9398e019f0b49df1a4fde98ee17ae345cb5f6b5e2c27f5033e8ce79060200160405180910390a15050565b60006200029582620005a4565b816001600160a01b0316836001600160a01b0316141580156200043e5750600081115b15620002d8576001600160a01b03831615620004e7576001600160a01b038316600090815260106020908152604082208291620004929190620005ee901b62001593176200048c8662000603565b6200063d565b6001600160d01b031691506001600160d01b03169150846001600160a01b031660008051602062004fe28339815191528383604051620004dc929190918252602082015260400190565b60405180910390a250505b6001600160a01b03821615620002d8576001600160a01b0382166000908152601060209081526040822082916200052f919062000671901b620015a6176200048c8662000603565b6001600160d01b031691506001600160d01b03169150836001600160a01b031660008051602062004fe2833981519152838360405162000579929190918252602082015260400190565b60405180910390a25050505050565b6200059483836200067f565b620002d8336000858585620006e9565b60006001600160a01b038216620005d2576040516322718ad960e21b81526000600482015260240162000099565b506001600160a01b031660009081526003602052604090205490565b6000620005fc828462001544565b9392505050565b60006001600160d01b0382111562000639576040516306dfcc6560e41b815260d060048201526024810183905260440162000099565b5090565b60008062000664426200065b620006548862000821565b868860201c565b87919062000870565b915091505b935093915050565b6000620005fc82846200156e565b6001600160a01b038216620006ab57604051633250574960e11b81526000600482015260240162000099565b6000620006ba83838362000880565b90506001600160a01b03811615620002d8576040516339e3563760e11b81526000600482015260240162000099565b6001600160a01b0383163b156200081a57604051630a85bd0160e11b81526001600160a01b0384169063150b7a02906200072e90889088908790879060040162001591565b6020604051808303816000875af19250505080156200076c575060408051601f3d908101601f191682019092526200076991810190620015d0565b60015b620007da573d8080156200079d576040519150601f19603f3d011682016040523d82523d6000602084013e620007a2565b606091505b508051600003620007d257604051633250574960e11b81526001600160a01b038516600482015260240162000099565b805181602001fd5b6001600160e01b03198116630a85bd0160e11b146200081857604051633250574960e11b81526001600160a01b038516600482015260240162000099565b505b5050505050565b8054600090801562000867576200084d836200083f600184620015fc565b600091825260209091200190565b54660100000000000090046001600160d01b0316620005fc565b60009392505050565b6000806200066485858562000903565b60006001600160a01b0382161580620008a057506001600160a01b038416155b620008ee5760405162461bcd60e51b815260206004820152601760248201527f4e4654206973206e6f74207472616e7366657261626c65000000000000000000604482015260640162000099565b620008fb84848462000a6c565b949350505050565b82546000908190801562000a0d57600062000925876200083f600185620015fc565b805490915065ffffffffffff80821691660100000000000090046001600160d01b03169088168211156200096c57604051632520601d60e01b815260040160405180910390fd5b8765ffffffffffff168265ffffffffffff1603620009aa57825465ffffffffffff1666010000000000006001600160d01b03891602178355620009fe565b6040805180820190915265ffffffffffff808a1682526001600160d01b03808a1660208085019182528d54600181018f5560008f815291909120945191519092166601000000000000029216919091179101555b94508593506200066992505050565b50506040805180820190915265ffffffffffff80851682526001600160d01b0380851660208085019182528854600181018a5560008a815291822095519251909316660100000000000002919093161792019190915590508162000669565b60008062000a7c85858562000a8c565b9050620008fb8186600162000b68565b60008062000a9c85858562000bfa565b90506001600160a01b03811662000afc5762000af684600880546000838152600960205260408120829055600182018355919091527ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee30155565b62000b22565b846001600160a01b0316816001600160a01b03161462000b225762000b22818562000cf9565b6001600160a01b03851662000b425762000b3c8462000d7d565b620008fb565b846001600160a01b0316816001600160a01b031614620008fb57620008fb858562000e37565b6001600160a01b03831662000b975762000b946011620015a66200067160201b176200048c8462000603565b50505b6001600160a01b03821662000bc65762000bc3601162001593620005ee60201b176200048c8462000603565b50505b6001600160a01b038381166000908152600f6020526040808220548584168352912054620002d8929182169116836200041b565b6000828152600260205260408120546001600160a01b039081169083161562000c2a5762000c2a81848662000e8b565b6001600160a01b0381161562000c6a5762000c49600085818062000ef5565b6001600160a01b038116600090815260036020526040902080546000190190555b6001600160a01b0385161562000c9a576001600160a01b0385166000908152600360205260409020805460010190555b60008481526002602052604080822080546001600160a01b0319166001600160a01b0389811691821790925591518793918516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4949350505050565b600062000d0683620005a4565b6000838152600760209081526040808320546001600160a01b038816845260069092529091209192509081831462000d5e57600083815260208281526040808320548584528184208190558352600790915290208290555b6000938452600760209081526040808620869055938552525081205550565b60085460009062000d9190600190620015fc565b6000838152600960205260408120546008805493945090928490811062000dbc5762000dbc62001494565b90600052602060002001549050806008838154811062000de05762000de062001494565b600091825260208083209091019290925582815260099091526040808220849055858252812055600880548062000e1b5762000e1b62001612565b6001900381819060005260206000200160009055905550505050565b6000600162000e4684620005a4565b62000e529190620015fc565b6001600160a01b039093166000908152600660209081526040808320868452825280832085905593825260079052919091209190915550565b62000e9883838362001023565b620002d8576001600160a01b03831662000ec957604051637e27328960e01b81526004810182905260240162000099565b60405163177e802f60e01b81526001600160a01b03831660048201526024810182905260440162000099565b808062000f0a57506001600160a01b03821615155b1562000ff357600062000f1d84620010a9565b90506001600160a01b0383161580159062000f4a5750826001600160a01b0316816001600160a01b031614155b801562000f7d57506001600160a01b0380821660009081526005602090815260408083209387168352929052205460ff16155b1562000fa85760405163a9fbf51f60e01b81526001600160a01b038416600482015260240162000099565b811562000ff15783856001600160a01b0316826001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45b505b5050600090815260046020526040902080546001600160a01b0319166001600160a01b0392909216919091179055565b60006001600160a01b03831615801590620008fb5750826001600160a01b0316846001600160a01b031614806200107f57506001600160a01b0380851660009081526005602090815260408083209387168352929052205460ff165b80620008fb5750506000908152600460205260409020546001600160a01b03908116911614919050565b6000818152600260205260408120546001600160a01b0316806200029557604051637e27328960e01b81526004810184905260240162000099565b80516001600160a01b0381168114620010fc57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b038111828210171562001142576200114262001101565b604052919050565b600082601f8301126200115c57600080fd5b815160206001600160401b038211156200117a576200117a62001101565b8160051b6200118b82820162001117565b9283528481018201928281019087851115620011a657600080fd5b83870192505b84831015620011d057620011c083620010e4565b82529183019190830190620011ac565b979650505050505050565b60005b83811015620011f8578181015183820152602001620011de565b50506000910152565b600082601f8301126200121357600080fd5b81516001600160401b038111156200122f576200122f62001101565b62001244601f8201601f191660200162001117565b8181528460208386010111156200125a57600080fd5b620008fb826020830160208701620011db565b60008060008060008060c087890312156200128757600080fd5b865195506200129960208801620010e4565b60408801519095506001600160401b0380821115620012b757600080fd5b620012c58a838b016200114a565b95506060890151915080821115620012dc57600080fd5b620012ea8a838b0162001201565b945060808901519150808211156200130157600080fd5b6200130f8a838b0162001201565b935060a08901519150808211156200132657600080fd5b506200133589828a0162001201565b9150509295509295509295565b600181811c908216806200135757607f821691505b6020821081036200137857634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115620002d857600081815260208120601f850160051c81016020861015620013a75750805b601f850160051c820191505b818110156200081857828155600101620013b3565b81516001600160401b03811115620013e457620013e462001101565b620013fc81620013f5845462001342565b846200137e565b602080601f8311600181146200143457600084156200141b5750858301515b600019600386901b1c1916600185901b17855562000818565b600085815260208120601f198616915b82811015620014655788860151825594840194600190910190840162001444565b5085821015620014845787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060018201620014d557620014d5620014aa565b5060010190565b60008151808452620014f6816020860160208601620011db565b601f01601f19169290920160200192915050565b602081526000620005fc6020830184620014dc565b80516020808301519190811015620013785760001960209190910360031b1b16919050565b6001600160d01b03828116828216039080821115620015675762001567620014aa565b5092915050565b6001600160d01b03818116838216019080821115620015675762001567620014aa565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090620015c690830184620014dc565b9695505050505050565b600060208284031215620015e357600080fd5b81516001600160e01b031981168114620005fc57600080fd5b81810381811115620002955762000295620014aa565b634e487b7160e01b600052603160045260246000fd5b60805160a05160c05160e0516101005161012051610140516101605161392a620016b8600039600081816104df015281816106fb0152818161092301528181610ad001528181610bd801528181610ea101526114170152600061196a015260006119380152600061235a015260006123320152600061228d015260006122b7015260006122e1015261392a6000f3fe608060405234801561001057600080fd5b50600436106102325760003560e01c8063711864781161013057806395d89b41116100b8578063c3cda5201161007c578063c3cda52014610527578063c87b56dd1461053a578063d204c45e1461054d578063e985e9c514610560578063f2fde38b1461057357600080fd5b806395d89b41146104bf5780639ab24eb0146104c75780639fa92f9d146104da578063a22cb46514610501578063b88d4fde1461051457600080fd5b806381b62086116100ff57806381b620861461045757806384b0196e1461046a5780638da5cb5b146104855780638e539e8c1461049657806391ddadf4146104a957600080fd5b80637118647814610400578063715018a6146104135780637610248e1461041b5780637ecebe001461042e57600080fd5b806342842e0e116101be578063587cde1e11610182578063587cde1e14610388578063593aa283146103b45780635c19a95c146103c75780636352211e146103da57806370a08231146103ed57600080fd5b806342842e0e1461031257806342966c6814610325578063482ffa5e146103385780634bf5d7e91461034b5780634f6ccce71461037557600080fd5b806318160ddd1161020557806318160ddd146102b457806323b872dd146102c657806326926d46146102d95780632f745c59146102ec5780633a46b1a8146102ff57600080fd5b806301ffc9a71461023757806306fdde031461025f578063081812fc14610274578063095ea7b31461029f575b600080fd5b61024a610245366004612ec2565b610586565b60405190151581526020015b60405180910390f35b610267610597565b6040516102569190612f2f565b610287610282366004612f42565b610629565b6040516001600160a01b039091168152602001610256565b6102b26102ad366004612f70565b610652565b005b6008545b604051908152602001610256565b6102b26102d4366004612f9c565b610661565b6102b26102e7366004612f42565b6106f1565b6102b86102fa366004612f70565b610817565b6102b861030d366004612f70565b61087c565b6102b2610320366004612f9c565b6108f3565b6102b2610333366004612f42565b610913565b6102676103463660046130b1565b61091f565b60408051808201909152600e81526d06d6f64653d74696d657374616d760941b6020820152610267565b6102b8610383366004612f42565b610a6d565b610287610396366004613101565b6001600160a01b039081166000908152600f60205260409020541690565b6102b26103c236600461311e565b610ac6565b6102b26103d5366004613101565b610bd6565b6102876103e8366004612f42565b610ce3565b6102b86103fb366004613101565b610cee565b6102b261040e36600461314f565b610d36565b6102b2610e89565b610267610429366004613184565b610e9d565b6102b861043c366004613101565b6001600160a01b03166000908152600e602052604090205490565b6102b261046536600461314f565b611024565b61047261123d565b60405161025697969594939291906131bd565b600b546001600160a01b0316610287565b6102b86104a4366004612f42565b611283565b60405165ffffffffffff42168152602001610256565b6102676112e3565b6102b86104d5366004613101565b6112f2565b6102b87f000000000000000000000000000000000000000000000000000000000000000081565b6102b261050f366004613253565b611322565b6102b2610522366004613286565b61132d565b6102b26105353660046132f2565b611345565b610267610548366004612f42565b611402565b6102b261055b36600461334e565b61140d565b61024a61056e366004613184565b611527565b6102b2610581366004613101565b611555565b6000610591826115b2565b92915050565b6060600080546105a69061336c565b80601f01602080910402602001604051908101604052809291908181526020018280546105d29061336c565b801561061f5780601f106105f45761010080835404028352916020019161061f565b820191906000526020600020905b81548152906001019060200180831161060257829003601f168201915b5050505050905090565b6000610634826115d7565b506000828152600460205260409020546001600160a01b0316610591565b61065d828233611610565b5050565b6001600160a01b03821661069057604051633250574960e11b8152600060048201526024015b60405180910390fd5b600061069d83833361161d565b9050836001600160a01b0316816001600160a01b0316146106eb576040516364283d7b60e01b81526001600160a01b0380861660048301526024820184905282166044820152606401610687565b50505050565b6106f9611693565b7f000000000000000000000000000000000000000000000000000000000000000046146107385760405162461bcd60e51b8152600401610687906133a6565b604051633b0d4dd760e01b8152601360048201526001602482015260009073__$b1c1335e68417b4234016f4aa58fdfac77$__90633b0d4dd790604401602060405180830381865af4158015610792573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107b69190613400565b905060006107c383610ce3565b90506107ce836116c0565b806001600160a01b0316837f81c00ee14a307a39bcddd8f17801cf3101f1c49c8dea9ee90ec0c04a61b5a0078460405161080a91815260200190565b60405180910390a3505050565b600061082283610cee565b82106108535760405163295f44f760e21b81526001600160a01b038416600482015260248101839052604401610687565b506001600160a01b03919091166000908152600660209081526040808320938352929052205490565b60004265ffffffffffff811683106108b857604051637669fc0f60e11b81526004810184905265ffffffffffff82166024820152604401610687565b6108e26108c4846116fb565b6001600160a01b038616600090815260106020526040902090611732565b6001600160d01b0316949350505050565b61090e8383836040518060200160405280600081525061132d565b505050565b61065d6000823361161d565b60607f000000000000000000000000000000000000000000000000000000000000000046146109605760405162461bcd60e51b815260040161068790613419565b604051630564edeb60e31b81526013600482015260ff8416602482015260009073__$b1c1335e68417b4234016f4aa58fdfac77$__90632b276f5890604401602060405180830381865af41580156109bc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109e09190613400565b604051637352178160e01b815290915073__$b1c1335e68417b4234016f4aa58fdfac77$__90637352178190610a2090309088908890879060040161345c565b600060405180830381865af4158015610a3d573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610a6591908101906134df565b949350505050565b6000610a7860085490565b8210610aa15760405163295f44f760e21b81526000600482015260248101839052604401610687565b60088281548110610ab457610ab4613514565b90600052602060002001549050919050565b610ace611693565b7f00000000000000000000000000000000000000000000000000000000000000004614610b0d5760405162461bcd60e51b8152600401610687906133a6565b604051633b0d4dd760e01b8152601360048201526002602482015260009073__$b1c1335e68417b4234016f4aa58fdfac77$__90633b0d4dd790604401602060405180830381865af4158015610b67573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b8b9190613400565b9050610b9783836117e8565b827faef83f88d7b64742932e336e35ec4ebdbf35e2824c4cc154007911e95b72367e8383604051610bc992919061352a565b60405180910390a2505050565b7f00000000000000000000000000000000000000000000000000000000000000004614610c155760405162461bcd60e51b8152600401610687906133a6565b604051633b0d4dd760e01b8152601360048201526003602482015260009073__$b1c1335e68417b4234016f4aa58fdfac77$__90633b0d4dd790604401602060405180830381865af4158015610c6f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c939190613400565b9050610c9f3383611838565b6040518181526001600160a01b0383169033907fa2527a1c304fba1df9beb0da8db977345b95154faa8004c7b3485f52e34dcd0a9060200160405180910390a35050565b6000610591826115d7565b60006001600160a01b038216610d1a576040516322718ad960e21b815260006004820152602401610687565b506001600160a01b031660009081526003602052604090205490565b600080600073__$b1c1335e68417b4234016f4aa58fdfac77$__63c0af6591853060136040518463ffffffff1660e01b8152600401610d779392919061354c565b600060405180830381865af4158015610d94573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610dbc919081019061357a565b9194509250905060ff8316600314610e0f5760405162461bcd60e51b8152602060048201526016602482015275496e76616c6964206f7065726174696f6e207479706560501b6044820152606401610687565b60008083806020019051810190610e2691906135d4565b91509150610e348282611838565b806001600160a01b0316826001600160a01b03167fa2527a1c304fba1df9beb0da8db977345b95154faa8004c7b3485f52e34dcd0a85604051610e7991815260200190565b60405180910390a3505050505050565b610e91611693565b610e9b60006118aa565b565b60607f00000000000000000000000000000000000000000000000000000000000000004614610ede5760405162461bcd60e51b815260040161068790613419565b604051630564edeb60e31b8152601360048201526003602482015260009073__$b1c1335e68417b4234016f4aa58fdfac77$__90632b276f5890604401602060405180830381865af4158015610f38573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f5c9190613400565b905060008484604051602001610f889291906001600160a01b0392831681529116602082015260400190565b60408051808303601f1901815290829052637352178160e01b8252915073__$b1c1335e68417b4234016f4aa58fdfac77$__90637352178190610fd69030906003908690889060040161345c565b600060405180830381865af4158015610ff3573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261101b91908101906134df565b95945050505050565b600080600073__$b1c1335e68417b4234016f4aa58fdfac77$__63c0af6591853060136040518463ffffffff1660e01b81526004016110659392919061354c565b600060405180830381865af4158015611082573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526110aa919081019061357a565b9194509250905060ff831661113257600080838060200190518101906110d09190613603565b915091506110de82826118fc565b816001600160a01b031660016012546110f79190613660565b6040518581527f22ef8ac73166382773e470f8f887ac4c54dcf377f397431fe0ac6f60261fabaf906020015b60405180910390a350506106eb565b60001960ff8416016111a8576000828060200190518101906111549190613400565b9050600061116182610ce3565b905061116c826116c0565b806001600160a01b0316827f81c00ee14a307a39bcddd8f17801cf3101f1c49c8dea9ee90ec0c04a61b5a0078560405161112391815260200190565b60011960ff84160161121a57600080838060200190518101906111cb9190613673565b915091506111d982826117e8565b817faef83f88d7b64742932e336e35ec4ebdbf35e2824c4cc154007911e95b72367e828560405161120b92919061352a565b60405180910390a250506106eb565b60021960ff8416016106eb5760008083806020019051810190610e2691906135d4565b600060608060008060006060611251611931565b611259611963565b60408051600080825260208201909252600f60f81b9b939a50919850469750309650945092509050565b60004265ffffffffffff811683106112bf57604051637669fc0f60e11b81526004810184905265ffffffffffff82166024820152604401610687565b6112d36112cb846116fb565b601190611732565b6001600160d01b03169392505050565b6060600180546105a69061336c565b6001600160a01b038116600090815260106020526040812061131390611990565b6001600160d01b031692915050565b61065d3383836119c9565b611338848484610661565b6106eb3385858585611a60565b8342111561136957604051632341d78760e11b815260048101859052602401610687565b604080517fe48329057bfd03d55e49b547132e39cffd9c1820ad7b9d4c5307691425d15adf60208201526001600160a01b0388169181019190915260608101869052608081018590526000906113e3906113db9060a00160405160208183030381529060405280519060200120611b8b565b858585611bb8565b90506113ef8187611be6565b6113f98188611838565b50505050505050565b606061059182611c39565b611415611693565b7f000000000000000000000000000000000000000000000000000000000000000046146114545760405162461bcd60e51b8152600401610687906133a6565b604051633b0d4dd760e01b8152601360048201526000602482018190529073__$b1c1335e68417b4234016f4aa58fdfac77$__90633b0d4dd790604401602060405180830381865af41580156114ae573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114d29190613400565b90506114de83836118fc565b826001600160a01b031660016012546114f79190613660565b6040518381527f22ef8ac73166382773e470f8f887ac4c54dcf377f397431fe0ac6f60261fabaf9060200161080a565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205460ff1690565b61155d611693565b6001600160a01b03811661158757604051631e4fbdf760e01b815260006004820152602401610687565b611590816118aa565b50565b600061159f82846136a4565b9392505050565b600061159f82846136cb565b60006001600160e01b03198216632483248360e11b1480610591575061059182611d42565b6000818152600260205260408120546001600160a01b03168061059157604051637e27328960e01b815260048101849052602401610687565b61090e8383836001611d67565b60006001600160a01b038216158061163c57506001600160a01b038416155b6116885760405162461bcd60e51b815260206004820152601760248201527f4e4654206973206e6f74207472616e7366657261626c650000000000000000006044820152606401610687565b610a65848484611e6d565b600b546001600160a01b03163314610e9b5760405163118cdaa760e01b8152336004820152602401610687565b60006116cf600083600061161d565b90506001600160a01b03811661065d57604051637e27328960e01b815260048101839052602401610687565b600065ffffffffffff82111561172e576040516306dfcc6560e41b81526030600482015260248101839052604401610687565b5090565b81546000908181600581111561179157600061174d84611e89565b6117579085613660565b60008881526020902090915081015465ffffffffffff90811690871610156117815780915061178f565b61178c8160016136eb565b92505b505b600061179f87878585611fe2565b905080156117da576117c4876117b6600184613660565b600091825260209091200190565b54600160301b90046001600160d01b03166117dd565b60005b979650505050505050565b6000828152600a602052604090206118008282613744565b506040518281527ff8e1a15aba9398e019f0b49df1a4fde98ee17ae345cb5f6b5e2c27f5033e8ce79060200160405180910390a15050565b6001600160a01b038281166000818152600f602052604080822080548686166001600160a01b0319821681179092559151919094169392849290917f3134e8a2e6d97e929a7e54011ea5485d7d196dd5f0ba4d4ef95803e8e3fc257f9190a461090e81836118a586612044565b61204f565b600b80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b601280546000918261190d83613804565b91905055905061191d83826121bb565b61192781836117e8565b61090e8384611838565b606061195e7f0000000000000000000000000000000000000000000000000000000000000000600c6121d5565b905090565b606061195e7f0000000000000000000000000000000000000000000000000000000000000000600d6121d5565b805460009080156119c0576119aa836117b6600184613660565b54600160301b90046001600160d01b031661159f565b60009392505050565b6001600160a01b0382166119fb57604051630b61174360e31b81526001600160a01b0383166004820152602401610687565b6001600160a01b03838116600081815260056020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910161080a565b6001600160a01b0383163b15611b8457604051630a85bd0160e11b81526001600160a01b0384169063150b7a0290611aa290889088908790879060040161381d565b6020604051808303816000875af1925050508015611add575060408051601f3d908101601f19168201909252611ada9181019061385a565b60015b611b46573d808015611b0b576040519150601f19603f3d011682016040523d82523d6000602084013e611b10565b606091505b508051600003611b3e57604051633250574960e11b81526001600160a01b0385166004820152602401610687565b805181602001fd5b6001600160e01b03198116630a85bd0160e11b14611b8257604051633250574960e11b81526001600160a01b0385166004820152602401610687565b505b5050505050565b6000610591611b98612280565b8360405161190160f01b8152600281019290925260228201526042902090565b600080600080611bca888888886123ab565b925092509250611bda828261247a565b50909695505050505050565b6001600160a01b0382166000908152600e6020526040902080546001810190915581811461090e576040516301d4b62360e61b81526001600160a01b038416600482015260248101829052604401610687565b6060611c44826115d7565b506000828152600a602052604081208054611c5e9061336c565b80601f0160208091040260200160405190810160405280929190818152602001828054611c8a9061336c565b8015611cd75780601f10611cac57610100808354040283529160200191611cd7565b820191906000526020600020905b815481529060010190602001808311611cba57829003601f168201915b505050505090506000611cf560408051602081019091526000815290565b90508051600003611d07575092915050565b815115611d39578082604051602001611d21929190613877565b60405160208183030381529060405292505050919050565b610a6584612533565b60006001600160e01b0319821663780e9d6360e01b14806105915750610591826125a7565b8080611d7b57506001600160a01b03821615155b15611e3d576000611d8b846115d7565b90506001600160a01b03831615801590611db75750826001600160a01b0316816001600160a01b031614155b8015611dca5750611dc88184611527565b155b15611df35760405163a9fbf51f60e01b81526001600160a01b0384166004820152602401610687565b8115611e3b5783856001600160a01b0316826001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45b505b5050600090815260046020526040902080546001600160a01b0319166001600160a01b0392909216919091179055565b600080611e7b8585856125f7565b9050610a65818660016126c4565b600060018211611e97575090565b816001600160801b8210611eb05760809190911c9060401b5b680100000000000000008210611ecb5760409190911c9060201b5b6401000000008210611ee25760209190911c9060101b5b620100008210611ef75760109190911c9060081b5b6101008210611f0b5760089190911c9060041b5b60108210611f1e5760049190911c9060021b5b60048210611f2a5760011b5b600302600190811c90818581611f4257611f426138a6565b048201901c90506001818581611f5a57611f5a6138a6565b048201901c90506001818581611f7257611f726138a6565b048201901c90506001818581611f8a57611f8a6138a6565b048201901c90506001818581611fa257611fa26138a6565b048201901c90506001818581611fba57611fba6138a6565b048201901c9050611fd9818581611fd357611fd36138a6565b04821190565b90039392505050565b60005b8183101561203c576000611ff9848461273a565b60008781526020902090915065ffffffffffff86169082015465ffffffffffff16111561202857809250612036565b6120338160016136eb565b93505b50611fe5565b509392505050565b600061059182610cee565b816001600160a01b0316836001600160a01b0316141580156120715750600081115b1561090e576001600160a01b03831615612119576001600160a01b038316600090815260106020526040812081906120b4906115936120af86612755565b612789565b6001600160d01b031691506001600160d01b03169150846001600160a01b03167fdec2bacdd2f05b59de34da9b523dff8be42e5e38e818c82fdb0bae774387a724838360405161210e929190918252602082015260400190565b60405180910390a250505b6001600160a01b0382161561090e576001600160a01b03821660009081526010602052604081208190612152906115a66120af86612755565b6001600160d01b031691506001600160d01b03169150836001600160a01b03167fdec2bacdd2f05b59de34da9b523dff8be42e5e38e818c82fdb0bae774387a72483836040516121ac929190918252602082015260400190565b60405180910390a25050505050565b61065d8282604051806020016040528060008152506127bb565b606060ff83146121ef576121e8836127d3565b9050610591565b8180546121fb9061336c565b80601f01602080910402602001604051908101604052809291908181526020018280546122279061336c565b80156122745780601f1061224957610100808354040283529160200191612274565b820191906000526020600020905b81548152906001019060200180831161225757829003601f168201915b50505050509050610591565b6000306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480156122d957507f000000000000000000000000000000000000000000000000000000000000000046145b1561230357507f000000000000000000000000000000000000000000000000000000000000000090565b61195e604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f60208201527f0000000000000000000000000000000000000000000000000000000000000000918101919091527f000000000000000000000000000000000000000000000000000000000000000060608201524660808201523060a082015260009060c00160405160208183030381529060405280519060200120905090565b600080807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08411156123e65750600091506003905082612470565b604080516000808252602082018084528a905260ff891692820192909252606081018790526080810186905260019060a0016020604051602081039080840390855afa15801561243a573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b03811661246657506000925060019150829050612470565b9250600091508190505b9450945094915050565b600082600381111561248e5761248e6133ea565b03612497575050565b60018260038111156124ab576124ab6133ea565b036124c95760405163f645eedf60e01b815260040160405180910390fd5b60028260038111156124dd576124dd6133ea565b036124fe5760405163fce698f760e01b815260048101829052602401610687565b6003826003811115612512576125126133ea565b0361065d576040516335e2f38360e21b815260048101829052602401610687565b606061253e826115d7565b50600061255660408051602081019091526000815290565b90506000815111612576576040518060200160405280600081525061159f565b8061258084612812565b604051602001612591929190613877565b6040516020818303038152906040529392505050565b60006001600160e01b031982166380ac58cd60e01b14806125d857506001600160e01b03198216635b5e139f60e01b145b8061059157506301ffc9a760e01b6001600160e01b0319831614610591565b6000806126058585856128a5565b90506001600160a01b0381166126625761265d84600880546000838152600960205260408120829055600182018355919091527ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee30155565b612685565b846001600160a01b0316816001600160a01b03161461268557612685818561299e565b6001600160a01b0385166126a15761269c84612a1f565b610a65565b846001600160a01b0316816001600160a01b031614610a6557610a658585612ace565b6001600160a01b0383166126e6576126e360116115a66120af84612755565b50505b6001600160a01b0382166127085761270560116115936120af84612755565b50505b6001600160a01b038381166000908152600f602052604080822054858416835291205461090e9291821691168361204f565b600061274960028484186138bc565b61159f908484166136eb565b60006001600160d01b0382111561172e576040516306dfcc6560e41b815260d0600482015260248101839052604401610687565b6000806127ae426127a661279c88611990565b868863ffffffff16565b879190612b1e565b915091505b935093915050565b6127c58383612b2c565b61090e336000858585611a60565b606060006127e083612b91565b604080516020808252818301909252919250600091906020820181803683375050509182525060208101929092525090565b6060600061281f83612bb9565b600101905060008167ffffffffffffffff81111561283f5761283f612fec565b6040519080825280601f01601f191660200182016040528015612869576020820181803683370190505b5090508181016020015b600019016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a850494508461287357509392505050565b6000828152600260205260408120546001600160a01b03908116908316156128d2576128d2818486612c91565b6001600160a01b03811615612910576128ef600085600080611d67565b6001600160a01b038116600090815260036020526040902080546000190190555b6001600160a01b0385161561293f576001600160a01b0385166000908152600360205260409020805460010190555b60008481526002602052604080822080546001600160a01b0319166001600160a01b0389811691821790925591518793918516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4949350505050565b60006129a983610cee565b6000838152600760209081526040808320546001600160a01b0388168452600690925290912091925090818314612a0057600083815260208281526040808320548584528184208190558352600790915290208290555b6000938452600760209081526040808620869055938552525081205550565b600854600090612a3190600190613660565b60008381526009602052604081205460088054939450909284908110612a5957612a59613514565b906000526020600020015490508060088381548110612a7a57612a7a613514565b6000918252602080832090910192909255828152600990915260408082208490558582528120556008805480612ab257612ab26138de565b6001900381819060005260206000200160009055905550505050565b60006001612adb84610cee565b612ae59190613660565b6001600160a01b039093166000908152600660209081526040808320868452825280832085905593825260079052919091209190915550565b6000806127ae858585612cf5565b6001600160a01b038216612b5657604051633250574960e11b815260006004820152602401610687565b6000612b648383600061161d565b90506001600160a01b0381161561090e576040516339e3563760e11b815260006004820152602401610687565b600060ff8216601f81111561059157604051632cd44ac360e21b815260040160405180910390fd5b60008072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b8310612bf85772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6d04ee2d6d415b85acef81000000008310612c24576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc100008310612c4257662386f26fc10000830492506010015b6305f5e1008310612c5a576305f5e100830492506008015b6127108310612c6e57612710830492506004015b60648310612c80576064830492506002015b600a83106105915760010192915050565b612c9c838383612e49565b61090e576001600160a01b038316612cca57604051637e27328960e01b815260048101829052602401610687565b60405163177e802f60e01b81526001600160a01b038316600482015260248101829052604401610687565b825460009081908015612dee576000612d13876117b6600185613660565b805490915065ffffffffffff80821691600160301b90046001600160d01b0316908816821115612d5657604051632520601d60e01b815260040160405180910390fd5b8765ffffffffffff168265ffffffffffff1603612d8f57825465ffffffffffff16600160301b6001600160d01b03891602178355612de0565b6040805180820190915265ffffffffffff808a1682526001600160d01b03808a1660208085019182528d54600181018f5560008f81529190912094519151909216600160301b029216919091179101555b94508593506127b392505050565b50506040805180820190915265ffffffffffff80851682526001600160d01b0380851660208085019182528854600181018a5560008a815291822095519251909316600160301b0291909316179201919091559050816127b3565b60006001600160a01b03831615801590610a655750826001600160a01b0316846001600160a01b03161480612e835750612e838484611527565b80610a655750506000908152600460205260409020546001600160a01b03908116911614919050565b6001600160e01b03198116811461159057600080fd5b600060208284031215612ed457600080fd5b813561159f81612eac565b60005b83811015612efa578181015183820152602001612ee2565b50506000910152565b60008151808452612f1b816020860160208601612edf565b601f01601f19169290920160200192915050565b60208152600061159f6020830184612f03565b600060208284031215612f5457600080fd5b5035919050565b6001600160a01b038116811461159057600080fd5b60008060408385031215612f8357600080fd5b8235612f8e81612f5b565b946020939093013593505050565b600080600060608486031215612fb157600080fd5b8335612fbc81612f5b565b92506020840135612fcc81612f5b565b929592945050506040919091013590565b60ff8116811461159057600080fd5b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff8111828210171561302b5761302b612fec565b604052919050565b600067ffffffffffffffff82111561304d5761304d612fec565b50601f01601f191660200190565b600082601f83011261306c57600080fd5b813561307f61307a82613033565b613002565b81815284602083860101111561309457600080fd5b816020850160208301376000918101602001919091529392505050565b600080604083850312156130c457600080fd5b82356130cf81612fdd565b9150602083013567ffffffffffffffff8111156130eb57600080fd5b6130f78582860161305b565b9150509250929050565b60006020828403121561311357600080fd5b813561159f81612f5b565b6000806040838503121561313157600080fd5b82359150602083013567ffffffffffffffff8111156130eb57600080fd5b60006020828403121561316157600080fd5b813567ffffffffffffffff81111561317857600080fd5b610a658482850161305b565b6000806040838503121561319757600080fd5b82356131a281612f5b565b915060208301356131b281612f5b565b809150509250929050565b60ff60f81b881681526000602060e0818401526131dd60e084018a612f03565b83810360408501526131ef818a612f03565b606085018990526001600160a01b038816608086015260a0850187905284810360c0860152855180825283870192509083019060005b8181101561324157835183529284019291840191600101613225565b50909c9b505050505050505050505050565b6000806040838503121561326657600080fd5b823561327181612f5b565b9150602083013580151581146131b257600080fd5b6000806000806080858703121561329c57600080fd5b84356132a781612f5b565b935060208501356132b781612f5b565b925060408501359150606085013567ffffffffffffffff8111156132da57600080fd5b6132e68782880161305b565b91505092959194509250565b60008060008060008060c0878903121561330b57600080fd5b863561331681612f5b565b95506020870135945060408701359350606087013561333481612fdd565b9598949750929560808101359460a0909101359350915050565b6000806040838503121561336157600080fd5b82356130cf81612f5b565b600181811c9082168061338057607f821691505b6020821081036133a057634e487b7160e01b600052602260045260246000fd5b50919050565b60208082526024908201527f4f7065726174696f6e206f6e6c7920616c6c6f776564206f6e20686f6d6520636040820152633430b4b760e11b606082015260800190565b634e487b7160e01b600052602160045260246000fd5b60006020828403121561341257600080fd5b5051919050565b60208082526023908201527f50726f6f6673206f6e6c792067656e657261746564206f6e20686f6d6520636860408201526230b4b760e91b606082015260800190565b6001600160a01b038516815260ff8416602082015260806040820181905260009061348990830185612f03565b905082606083015295945050505050565b600082601f8301126134ab57600080fd5b81516134b961307a82613033565b8181528460208386010111156134ce57600080fd5b610a65826020830160208701612edf565b6000602082840312156134f157600080fd5b815167ffffffffffffffff81111561350857600080fd5b610a658482850161349a565b634e487b7160e01b600052603260045260246000fd5b60408152600061353d6040830185612f03565b90508260208301529392505050565b60608152600061355f6060830186612f03565b6001600160a01b039490941660208301525060400152919050565b60008060006060848603121561358f57600080fd5b835161359a81612fdd565b602085015190935067ffffffffffffffff8111156135b757600080fd5b6135c38682870161349a565b925050604084015190509250925092565b600080604083850312156135e757600080fd5b82516135f281612f5b565b60208401519092506131b281612f5b565b6000806040838503121561361657600080fd5b825161362181612f5b565b602084015190925067ffffffffffffffff81111561363e57600080fd5b6130f78582860161349a565b634e487b7160e01b600052601160045260246000fd5b818103818111156105915761059161364a565b6000806040838503121561368657600080fd5b82519150602083015167ffffffffffffffff81111561363e57600080fd5b6001600160d01b038281168282160390808211156136c4576136c461364a565b5092915050565b6001600160d01b038181168382160190808211156136c4576136c461364a565b808201808211156105915761059161364a565b601f82111561090e57600081815260208120601f850160051c810160208610156137255750805b601f850160051c820191505b81811015611b8257828155600101613731565b815167ffffffffffffffff81111561375e5761375e612fec565b6137728161376c845461336c565b846136fe565b602080601f8311600181146137a7576000841561378f5750858301515b600019600386901b1c1916600185901b178555611b82565b600085815260208120601f198616915b828110156137d6578886015182559484019460019091019084016137b7565b50858210156137f45787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6000600182016138165761381661364a565b5060010190565b6001600160a01b038581168252841660208201526040810183905260806060820181905260009061385090830184612f03565b9695505050505050565b60006020828403121561386c57600080fd5b815161159f81612eac565b60008351613889818460208801612edf565b83519083019061389d818360208801612edf565b01949350505050565b634e487b7160e01b600052601260045260246000fd5b6000826138d957634e487b7160e01b600052601260045260246000fd5b500490565b634e487b7160e01b600052603160045260246000fdfea26469706673582212200861948c00ac12a29e05900592c5ed3f68c88227f729b466bf3d29f5a5208d1064736f6c63430008140033dec2bacdd2f05b59de34da9b523dff8be42e5e38e818c82fdb0bae774387a724", + "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106102325760003560e01c8063711864781161013057806395d89b41116100b8578063c3cda5201161007c578063c3cda52014610527578063c87b56dd1461053a578063d204c45e1461054d578063e985e9c514610560578063f2fde38b1461057357600080fd5b806395d89b41146104bf5780639ab24eb0146104c75780639fa92f9d146104da578063a22cb46514610501578063b88d4fde1461051457600080fd5b806381b62086116100ff57806381b620861461045757806384b0196e1461046a5780638da5cb5b146104855780638e539e8c1461049657806391ddadf4146104a957600080fd5b80637118647814610400578063715018a6146104135780637610248e1461041b5780637ecebe001461042e57600080fd5b806342842e0e116101be578063587cde1e11610182578063587cde1e14610388578063593aa283146103b45780635c19a95c146103c75780636352211e146103da57806370a08231146103ed57600080fd5b806342842e0e1461031257806342966c6814610325578063482ffa5e146103385780634bf5d7e91461034b5780634f6ccce71461037557600080fd5b806318160ddd1161020557806318160ddd146102b457806323b872dd146102c657806326926d46146102d95780632f745c59146102ec5780633a46b1a8146102ff57600080fd5b806301ffc9a71461023757806306fdde031461025f578063081812fc14610274578063095ea7b31461029f575b600080fd5b61024a610245366004612ec2565b610586565b60405190151581526020015b60405180910390f35b610267610597565b6040516102569190612f2f565b610287610282366004612f42565b610629565b6040516001600160a01b039091168152602001610256565b6102b26102ad366004612f70565b610652565b005b6008545b604051908152602001610256565b6102b26102d4366004612f9c565b610661565b6102b26102e7366004612f42565b6106f1565b6102b86102fa366004612f70565b610817565b6102b861030d366004612f70565b61087c565b6102b2610320366004612f9c565b6108f3565b6102b2610333366004612f42565b610913565b6102676103463660046130b1565b61091f565b60408051808201909152600e81526d06d6f64653d74696d657374616d760941b6020820152610267565b6102b8610383366004612f42565b610a6d565b610287610396366004613101565b6001600160a01b039081166000908152600f60205260409020541690565b6102b26103c236600461311e565b610ac6565b6102b26103d5366004613101565b610bd6565b6102876103e8366004612f42565b610ce3565b6102b86103fb366004613101565b610cee565b6102b261040e36600461314f565b610d36565b6102b2610e89565b610267610429366004613184565b610e9d565b6102b861043c366004613101565b6001600160a01b03166000908152600e602052604090205490565b6102b261046536600461314f565b611024565b61047261123d565b60405161025697969594939291906131bd565b600b546001600160a01b0316610287565b6102b86104a4366004612f42565b611283565b60405165ffffffffffff42168152602001610256565b6102676112e3565b6102b86104d5366004613101565b6112f2565b6102b87f000000000000000000000000000000000000000000000000000000000000000081565b6102b261050f366004613253565b611322565b6102b2610522366004613286565b61132d565b6102b26105353660046132f2565b611345565b610267610548366004612f42565b611402565b6102b261055b36600461334e565b61140d565b61024a61056e366004613184565b611527565b6102b2610581366004613101565b611555565b6000610591826115b2565b92915050565b6060600080546105a69061336c565b80601f01602080910402602001604051908101604052809291908181526020018280546105d29061336c565b801561061f5780601f106105f45761010080835404028352916020019161061f565b820191906000526020600020905b81548152906001019060200180831161060257829003601f168201915b5050505050905090565b6000610634826115d7565b506000828152600460205260409020546001600160a01b0316610591565b61065d828233611610565b5050565b6001600160a01b03821661069057604051633250574960e11b8152600060048201526024015b60405180910390fd5b600061069d83833361161d565b9050836001600160a01b0316816001600160a01b0316146106eb576040516364283d7b60e01b81526001600160a01b0380861660048301526024820184905282166044820152606401610687565b50505050565b6106f9611693565b7f000000000000000000000000000000000000000000000000000000000000000046146107385760405162461bcd60e51b8152600401610687906133a6565b604051633b0d4dd760e01b8152601360048201526001602482015260009073__$b1c1335e68417b4234016f4aa58fdfac77$__90633b0d4dd790604401602060405180830381865af4158015610792573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107b69190613400565b905060006107c383610ce3565b90506107ce836116c0565b806001600160a01b0316837f81c00ee14a307a39bcddd8f17801cf3101f1c49c8dea9ee90ec0c04a61b5a0078460405161080a91815260200190565b60405180910390a3505050565b600061082283610cee565b82106108535760405163295f44f760e21b81526001600160a01b038416600482015260248101839052604401610687565b506001600160a01b03919091166000908152600660209081526040808320938352929052205490565b60004265ffffffffffff811683106108b857604051637669fc0f60e11b81526004810184905265ffffffffffff82166024820152604401610687565b6108e26108c4846116fb565b6001600160a01b038616600090815260106020526040902090611732565b6001600160d01b0316949350505050565b61090e8383836040518060200160405280600081525061132d565b505050565b61065d6000823361161d565b60607f000000000000000000000000000000000000000000000000000000000000000046146109605760405162461bcd60e51b815260040161068790613419565b604051630564edeb60e31b81526013600482015260ff8416602482015260009073__$b1c1335e68417b4234016f4aa58fdfac77$__90632b276f5890604401602060405180830381865af41580156109bc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109e09190613400565b604051637352178160e01b815290915073__$b1c1335e68417b4234016f4aa58fdfac77$__90637352178190610a2090309088908890879060040161345c565b600060405180830381865af4158015610a3d573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610a6591908101906134df565b949350505050565b6000610a7860085490565b8210610aa15760405163295f44f760e21b81526000600482015260248101839052604401610687565b60088281548110610ab457610ab4613514565b90600052602060002001549050919050565b610ace611693565b7f00000000000000000000000000000000000000000000000000000000000000004614610b0d5760405162461bcd60e51b8152600401610687906133a6565b604051633b0d4dd760e01b8152601360048201526002602482015260009073__$b1c1335e68417b4234016f4aa58fdfac77$__90633b0d4dd790604401602060405180830381865af4158015610b67573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b8b9190613400565b9050610b9783836117e8565b827faef83f88d7b64742932e336e35ec4ebdbf35e2824c4cc154007911e95b72367e8383604051610bc992919061352a565b60405180910390a2505050565b7f00000000000000000000000000000000000000000000000000000000000000004614610c155760405162461bcd60e51b8152600401610687906133a6565b604051633b0d4dd760e01b8152601360048201526003602482015260009073__$b1c1335e68417b4234016f4aa58fdfac77$__90633b0d4dd790604401602060405180830381865af4158015610c6f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c939190613400565b9050610c9f3383611838565b6040518181526001600160a01b0383169033907fa2527a1c304fba1df9beb0da8db977345b95154faa8004c7b3485f52e34dcd0a9060200160405180910390a35050565b6000610591826115d7565b60006001600160a01b038216610d1a576040516322718ad960e21b815260006004820152602401610687565b506001600160a01b031660009081526003602052604090205490565b600080600073__$b1c1335e68417b4234016f4aa58fdfac77$__63c0af6591853060136040518463ffffffff1660e01b8152600401610d779392919061354c565b600060405180830381865af4158015610d94573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610dbc919081019061357a565b9194509250905060ff8316600314610e0f5760405162461bcd60e51b8152602060048201526016602482015275496e76616c6964206f7065726174696f6e207479706560501b6044820152606401610687565b60008083806020019051810190610e2691906135d4565b91509150610e348282611838565b806001600160a01b0316826001600160a01b03167fa2527a1c304fba1df9beb0da8db977345b95154faa8004c7b3485f52e34dcd0a85604051610e7991815260200190565b60405180910390a3505050505050565b610e91611693565b610e9b60006118aa565b565b60607f00000000000000000000000000000000000000000000000000000000000000004614610ede5760405162461bcd60e51b815260040161068790613419565b604051630564edeb60e31b8152601360048201526003602482015260009073__$b1c1335e68417b4234016f4aa58fdfac77$__90632b276f5890604401602060405180830381865af4158015610f38573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f5c9190613400565b905060008484604051602001610f889291906001600160a01b0392831681529116602082015260400190565b60408051808303601f1901815290829052637352178160e01b8252915073__$b1c1335e68417b4234016f4aa58fdfac77$__90637352178190610fd69030906003908690889060040161345c565b600060405180830381865af4158015610ff3573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261101b91908101906134df565b95945050505050565b600080600073__$b1c1335e68417b4234016f4aa58fdfac77$__63c0af6591853060136040518463ffffffff1660e01b81526004016110659392919061354c565b600060405180830381865af4158015611082573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526110aa919081019061357a565b9194509250905060ff831661113257600080838060200190518101906110d09190613603565b915091506110de82826118fc565b816001600160a01b031660016012546110f79190613660565b6040518581527f22ef8ac73166382773e470f8f887ac4c54dcf377f397431fe0ac6f60261fabaf906020015b60405180910390a350506106eb565b60001960ff8416016111a8576000828060200190518101906111549190613400565b9050600061116182610ce3565b905061116c826116c0565b806001600160a01b0316827f81c00ee14a307a39bcddd8f17801cf3101f1c49c8dea9ee90ec0c04a61b5a0078560405161112391815260200190565b60011960ff84160161121a57600080838060200190518101906111cb9190613673565b915091506111d982826117e8565b817faef83f88d7b64742932e336e35ec4ebdbf35e2824c4cc154007911e95b72367e828560405161120b92919061352a565b60405180910390a250506106eb565b60021960ff8416016106eb5760008083806020019051810190610e2691906135d4565b600060608060008060006060611251611931565b611259611963565b60408051600080825260208201909252600f60f81b9b939a50919850469750309650945092509050565b60004265ffffffffffff811683106112bf57604051637669fc0f60e11b81526004810184905265ffffffffffff82166024820152604401610687565b6112d36112cb846116fb565b601190611732565b6001600160d01b03169392505050565b6060600180546105a69061336c565b6001600160a01b038116600090815260106020526040812061131390611990565b6001600160d01b031692915050565b61065d3383836119c9565b611338848484610661565b6106eb3385858585611a60565b8342111561136957604051632341d78760e11b815260048101859052602401610687565b604080517fe48329057bfd03d55e49b547132e39cffd9c1820ad7b9d4c5307691425d15adf60208201526001600160a01b0388169181019190915260608101869052608081018590526000906113e3906113db9060a00160405160208183030381529060405280519060200120611b8b565b858585611bb8565b90506113ef8187611be6565b6113f98188611838565b50505050505050565b606061059182611c39565b611415611693565b7f000000000000000000000000000000000000000000000000000000000000000046146114545760405162461bcd60e51b8152600401610687906133a6565b604051633b0d4dd760e01b8152601360048201526000602482018190529073__$b1c1335e68417b4234016f4aa58fdfac77$__90633b0d4dd790604401602060405180830381865af41580156114ae573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114d29190613400565b90506114de83836118fc565b826001600160a01b031660016012546114f79190613660565b6040518381527f22ef8ac73166382773e470f8f887ac4c54dcf377f397431fe0ac6f60261fabaf9060200161080a565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205460ff1690565b61155d611693565b6001600160a01b03811661158757604051631e4fbdf760e01b815260006004820152602401610687565b611590816118aa565b50565b600061159f82846136a4565b9392505050565b600061159f82846136cb565b60006001600160e01b03198216632483248360e11b1480610591575061059182611d42565b6000818152600260205260408120546001600160a01b03168061059157604051637e27328960e01b815260048101849052602401610687565b61090e8383836001611d67565b60006001600160a01b038216158061163c57506001600160a01b038416155b6116885760405162461bcd60e51b815260206004820152601760248201527f4e4654206973206e6f74207472616e7366657261626c650000000000000000006044820152606401610687565b610a65848484611e6d565b600b546001600160a01b03163314610e9b5760405163118cdaa760e01b8152336004820152602401610687565b60006116cf600083600061161d565b90506001600160a01b03811661065d57604051637e27328960e01b815260048101839052602401610687565b600065ffffffffffff82111561172e576040516306dfcc6560e41b81526030600482015260248101839052604401610687565b5090565b81546000908181600581111561179157600061174d84611e89565b6117579085613660565b60008881526020902090915081015465ffffffffffff90811690871610156117815780915061178f565b61178c8160016136eb565b92505b505b600061179f87878585611fe2565b905080156117da576117c4876117b6600184613660565b600091825260209091200190565b54600160301b90046001600160d01b03166117dd565b60005b979650505050505050565b6000828152600a602052604090206118008282613744565b506040518281527ff8e1a15aba9398e019f0b49df1a4fde98ee17ae345cb5f6b5e2c27f5033e8ce79060200160405180910390a15050565b6001600160a01b038281166000818152600f602052604080822080548686166001600160a01b0319821681179092559151919094169392849290917f3134e8a2e6d97e929a7e54011ea5485d7d196dd5f0ba4d4ef95803e8e3fc257f9190a461090e81836118a586612044565b61204f565b600b80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b601280546000918261190d83613804565b91905055905061191d83826121bb565b61192781836117e8565b61090e8384611838565b606061195e7f0000000000000000000000000000000000000000000000000000000000000000600c6121d5565b905090565b606061195e7f0000000000000000000000000000000000000000000000000000000000000000600d6121d5565b805460009080156119c0576119aa836117b6600184613660565b54600160301b90046001600160d01b031661159f565b60009392505050565b6001600160a01b0382166119fb57604051630b61174360e31b81526001600160a01b0383166004820152602401610687565b6001600160a01b03838116600081815260056020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910161080a565b6001600160a01b0383163b15611b8457604051630a85bd0160e11b81526001600160a01b0384169063150b7a0290611aa290889088908790879060040161381d565b6020604051808303816000875af1925050508015611add575060408051601f3d908101601f19168201909252611ada9181019061385a565b60015b611b46573d808015611b0b576040519150601f19603f3d011682016040523d82523d6000602084013e611b10565b606091505b508051600003611b3e57604051633250574960e11b81526001600160a01b0385166004820152602401610687565b805181602001fd5b6001600160e01b03198116630a85bd0160e11b14611b8257604051633250574960e11b81526001600160a01b0385166004820152602401610687565b505b5050505050565b6000610591611b98612280565b8360405161190160f01b8152600281019290925260228201526042902090565b600080600080611bca888888886123ab565b925092509250611bda828261247a565b50909695505050505050565b6001600160a01b0382166000908152600e6020526040902080546001810190915581811461090e576040516301d4b62360e61b81526001600160a01b038416600482015260248101829052604401610687565b6060611c44826115d7565b506000828152600a602052604081208054611c5e9061336c565b80601f0160208091040260200160405190810160405280929190818152602001828054611c8a9061336c565b8015611cd75780601f10611cac57610100808354040283529160200191611cd7565b820191906000526020600020905b815481529060010190602001808311611cba57829003601f168201915b505050505090506000611cf560408051602081019091526000815290565b90508051600003611d07575092915050565b815115611d39578082604051602001611d21929190613877565b60405160208183030381529060405292505050919050565b610a6584612533565b60006001600160e01b0319821663780e9d6360e01b14806105915750610591826125a7565b8080611d7b57506001600160a01b03821615155b15611e3d576000611d8b846115d7565b90506001600160a01b03831615801590611db75750826001600160a01b0316816001600160a01b031614155b8015611dca5750611dc88184611527565b155b15611df35760405163a9fbf51f60e01b81526001600160a01b0384166004820152602401610687565b8115611e3b5783856001600160a01b0316826001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45b505b5050600090815260046020526040902080546001600160a01b0319166001600160a01b0392909216919091179055565b600080611e7b8585856125f7565b9050610a65818660016126c4565b600060018211611e97575090565b816001600160801b8210611eb05760809190911c9060401b5b680100000000000000008210611ecb5760409190911c9060201b5b6401000000008210611ee25760209190911c9060101b5b620100008210611ef75760109190911c9060081b5b6101008210611f0b5760089190911c9060041b5b60108210611f1e5760049190911c9060021b5b60048210611f2a5760011b5b600302600190811c90818581611f4257611f426138a6565b048201901c90506001818581611f5a57611f5a6138a6565b048201901c90506001818581611f7257611f726138a6565b048201901c90506001818581611f8a57611f8a6138a6565b048201901c90506001818581611fa257611fa26138a6565b048201901c90506001818581611fba57611fba6138a6565b048201901c9050611fd9818581611fd357611fd36138a6565b04821190565b90039392505050565b60005b8183101561203c576000611ff9848461273a565b60008781526020902090915065ffffffffffff86169082015465ffffffffffff16111561202857809250612036565b6120338160016136eb565b93505b50611fe5565b509392505050565b600061059182610cee565b816001600160a01b0316836001600160a01b0316141580156120715750600081115b1561090e576001600160a01b03831615612119576001600160a01b038316600090815260106020526040812081906120b4906115936120af86612755565b612789565b6001600160d01b031691506001600160d01b03169150846001600160a01b03167fdec2bacdd2f05b59de34da9b523dff8be42e5e38e818c82fdb0bae774387a724838360405161210e929190918252602082015260400190565b60405180910390a250505b6001600160a01b0382161561090e576001600160a01b03821660009081526010602052604081208190612152906115a66120af86612755565b6001600160d01b031691506001600160d01b03169150836001600160a01b03167fdec2bacdd2f05b59de34da9b523dff8be42e5e38e818c82fdb0bae774387a72483836040516121ac929190918252602082015260400190565b60405180910390a25050505050565b61065d8282604051806020016040528060008152506127bb565b606060ff83146121ef576121e8836127d3565b9050610591565b8180546121fb9061336c565b80601f01602080910402602001604051908101604052809291908181526020018280546122279061336c565b80156122745780601f1061224957610100808354040283529160200191612274565b820191906000526020600020905b81548152906001019060200180831161225757829003601f168201915b50505050509050610591565b6000306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480156122d957507f000000000000000000000000000000000000000000000000000000000000000046145b1561230357507f000000000000000000000000000000000000000000000000000000000000000090565b61195e604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f60208201527f0000000000000000000000000000000000000000000000000000000000000000918101919091527f000000000000000000000000000000000000000000000000000000000000000060608201524660808201523060a082015260009060c00160405160208183030381529060405280519060200120905090565b600080807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08411156123e65750600091506003905082612470565b604080516000808252602082018084528a905260ff891692820192909252606081018790526080810186905260019060a0016020604051602081039080840390855afa15801561243a573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b03811661246657506000925060019150829050612470565b9250600091508190505b9450945094915050565b600082600381111561248e5761248e6133ea565b03612497575050565b60018260038111156124ab576124ab6133ea565b036124c95760405163f645eedf60e01b815260040160405180910390fd5b60028260038111156124dd576124dd6133ea565b036124fe5760405163fce698f760e01b815260048101829052602401610687565b6003826003811115612512576125126133ea565b0361065d576040516335e2f38360e21b815260048101829052602401610687565b606061253e826115d7565b50600061255660408051602081019091526000815290565b90506000815111612576576040518060200160405280600081525061159f565b8061258084612812565b604051602001612591929190613877565b6040516020818303038152906040529392505050565b60006001600160e01b031982166380ac58cd60e01b14806125d857506001600160e01b03198216635b5e139f60e01b145b8061059157506301ffc9a760e01b6001600160e01b0319831614610591565b6000806126058585856128a5565b90506001600160a01b0381166126625761265d84600880546000838152600960205260408120829055600182018355919091527ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee30155565b612685565b846001600160a01b0316816001600160a01b03161461268557612685818561299e565b6001600160a01b0385166126a15761269c84612a1f565b610a65565b846001600160a01b0316816001600160a01b031614610a6557610a658585612ace565b6001600160a01b0383166126e6576126e360116115a66120af84612755565b50505b6001600160a01b0382166127085761270560116115936120af84612755565b50505b6001600160a01b038381166000908152600f602052604080822054858416835291205461090e9291821691168361204f565b600061274960028484186138bc565b61159f908484166136eb565b60006001600160d01b0382111561172e576040516306dfcc6560e41b815260d0600482015260248101839052604401610687565b6000806127ae426127a661279c88611990565b868863ffffffff16565b879190612b1e565b915091505b935093915050565b6127c58383612b2c565b61090e336000858585611a60565b606060006127e083612b91565b604080516020808252818301909252919250600091906020820181803683375050509182525060208101929092525090565b6060600061281f83612bb9565b600101905060008167ffffffffffffffff81111561283f5761283f612fec565b6040519080825280601f01601f191660200182016040528015612869576020820181803683370190505b5090508181016020015b600019016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a850494508461287357509392505050565b6000828152600260205260408120546001600160a01b03908116908316156128d2576128d2818486612c91565b6001600160a01b03811615612910576128ef600085600080611d67565b6001600160a01b038116600090815260036020526040902080546000190190555b6001600160a01b0385161561293f576001600160a01b0385166000908152600360205260409020805460010190555b60008481526002602052604080822080546001600160a01b0319166001600160a01b0389811691821790925591518793918516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4949350505050565b60006129a983610cee565b6000838152600760209081526040808320546001600160a01b0388168452600690925290912091925090818314612a0057600083815260208281526040808320548584528184208190558352600790915290208290555b6000938452600760209081526040808620869055938552525081205550565b600854600090612a3190600190613660565b60008381526009602052604081205460088054939450909284908110612a5957612a59613514565b906000526020600020015490508060088381548110612a7a57612a7a613514565b6000918252602080832090910192909255828152600990915260408082208490558582528120556008805480612ab257612ab26138de565b6001900381819060005260206000200160009055905550505050565b60006001612adb84610cee565b612ae59190613660565b6001600160a01b039093166000908152600660209081526040808320868452825280832085905593825260079052919091209190915550565b6000806127ae858585612cf5565b6001600160a01b038216612b5657604051633250574960e11b815260006004820152602401610687565b6000612b648383600061161d565b90506001600160a01b0381161561090e576040516339e3563760e11b815260006004820152602401610687565b600060ff8216601f81111561059157604051632cd44ac360e21b815260040160405180910390fd5b60008072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b8310612bf85772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6d04ee2d6d415b85acef81000000008310612c24576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc100008310612c4257662386f26fc10000830492506010015b6305f5e1008310612c5a576305f5e100830492506008015b6127108310612c6e57612710830492506004015b60648310612c80576064830492506002015b600a83106105915760010192915050565b612c9c838383612e49565b61090e576001600160a01b038316612cca57604051637e27328960e01b815260048101829052602401610687565b60405163177e802f60e01b81526001600160a01b038316600482015260248101829052604401610687565b825460009081908015612dee576000612d13876117b6600185613660565b805490915065ffffffffffff80821691600160301b90046001600160d01b0316908816821115612d5657604051632520601d60e01b815260040160405180910390fd5b8765ffffffffffff168265ffffffffffff1603612d8f57825465ffffffffffff16600160301b6001600160d01b03891602178355612de0565b6040805180820190915265ffffffffffff808a1682526001600160d01b03808a1660208085019182528d54600181018f5560008f81529190912094519151909216600160301b029216919091179101555b94508593506127b392505050565b50506040805180820190915265ffffffffffff80851682526001600160d01b0380851660208085019182528854600181018a5560008a815291822095519251909316600160301b0291909316179201919091559050816127b3565b60006001600160a01b03831615801590610a655750826001600160a01b0316846001600160a01b03161480612e835750612e838484611527565b80610a655750506000908152600460205260409020546001600160a01b03908116911614919050565b6001600160e01b03198116811461159057600080fd5b600060208284031215612ed457600080fd5b813561159f81612eac565b60005b83811015612efa578181015183820152602001612ee2565b50506000910152565b60008151808452612f1b816020860160208601612edf565b601f01601f19169290920160200192915050565b60208152600061159f6020830184612f03565b600060208284031215612f5457600080fd5b5035919050565b6001600160a01b038116811461159057600080fd5b60008060408385031215612f8357600080fd5b8235612f8e81612f5b565b946020939093013593505050565b600080600060608486031215612fb157600080fd5b8335612fbc81612f5b565b92506020840135612fcc81612f5b565b929592945050506040919091013590565b60ff8116811461159057600080fd5b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff8111828210171561302b5761302b612fec565b604052919050565b600067ffffffffffffffff82111561304d5761304d612fec565b50601f01601f191660200190565b600082601f83011261306c57600080fd5b813561307f61307a82613033565b613002565b81815284602083860101111561309457600080fd5b816020850160208301376000918101602001919091529392505050565b600080604083850312156130c457600080fd5b82356130cf81612fdd565b9150602083013567ffffffffffffffff8111156130eb57600080fd5b6130f78582860161305b565b9150509250929050565b60006020828403121561311357600080fd5b813561159f81612f5b565b6000806040838503121561313157600080fd5b82359150602083013567ffffffffffffffff8111156130eb57600080fd5b60006020828403121561316157600080fd5b813567ffffffffffffffff81111561317857600080fd5b610a658482850161305b565b6000806040838503121561319757600080fd5b82356131a281612f5b565b915060208301356131b281612f5b565b809150509250929050565b60ff60f81b881681526000602060e0818401526131dd60e084018a612f03565b83810360408501526131ef818a612f03565b606085018990526001600160a01b038816608086015260a0850187905284810360c0860152855180825283870192509083019060005b8181101561324157835183529284019291840191600101613225565b50909c9b505050505050505050505050565b6000806040838503121561326657600080fd5b823561327181612f5b565b9150602083013580151581146131b257600080fd5b6000806000806080858703121561329c57600080fd5b84356132a781612f5b565b935060208501356132b781612f5b565b925060408501359150606085013567ffffffffffffffff8111156132da57600080fd5b6132e68782880161305b565b91505092959194509250565b60008060008060008060c0878903121561330b57600080fd5b863561331681612f5b565b95506020870135945060408701359350606087013561333481612fdd565b9598949750929560808101359460a0909101359350915050565b6000806040838503121561336157600080fd5b82356130cf81612f5b565b600181811c9082168061338057607f821691505b6020821081036133a057634e487b7160e01b600052602260045260246000fd5b50919050565b60208082526024908201527f4f7065726174696f6e206f6e6c7920616c6c6f776564206f6e20686f6d6520636040820152633430b4b760e11b606082015260800190565b634e487b7160e01b600052602160045260246000fd5b60006020828403121561341257600080fd5b5051919050565b60208082526023908201527f50726f6f6673206f6e6c792067656e657261746564206f6e20686f6d6520636860408201526230b4b760e91b606082015260800190565b6001600160a01b038516815260ff8416602082015260806040820181905260009061348990830185612f03565b905082606083015295945050505050565b600082601f8301126134ab57600080fd5b81516134b961307a82613033565b8181528460208386010111156134ce57600080fd5b610a65826020830160208701612edf565b6000602082840312156134f157600080fd5b815167ffffffffffffffff81111561350857600080fd5b610a658482850161349a565b634e487b7160e01b600052603260045260246000fd5b60408152600061353d6040830185612f03565b90508260208301529392505050565b60608152600061355f6060830186612f03565b6001600160a01b039490941660208301525060400152919050565b60008060006060848603121561358f57600080fd5b835161359a81612fdd565b602085015190935067ffffffffffffffff8111156135b757600080fd5b6135c38682870161349a565b925050604084015190509250925092565b600080604083850312156135e757600080fd5b82516135f281612f5b565b60208401519092506131b281612f5b565b6000806040838503121561361657600080fd5b825161362181612f5b565b602084015190925067ffffffffffffffff81111561363e57600080fd5b6130f78582860161349a565b634e487b7160e01b600052601160045260246000fd5b818103818111156105915761059161364a565b6000806040838503121561368657600080fd5b82519150602083015167ffffffffffffffff81111561363e57600080fd5b6001600160d01b038281168282160390808211156136c4576136c461364a565b5092915050565b6001600160d01b038181168382160190808211156136c4576136c461364a565b808201808211156105915761059161364a565b601f82111561090e57600081815260208120601f850160051c810160208610156137255750805b601f850160051c820191505b81811015611b8257828155600101613731565b815167ffffffffffffffff81111561375e5761375e612fec565b6137728161376c845461336c565b846136fe565b602080601f8311600181146137a7576000841561378f5750858301515b600019600386901b1c1916600185901b178555611b82565b600085815260208120601f198616915b828110156137d6578886015182559484019460019091019084016137b7565b50858210156137f45787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6000600182016138165761381661364a565b5060010190565b6001600160a01b038581168252841660208201526040810183905260806060820181905260009061385090830184612f03565b9695505050505050565b60006020828403121561386c57600080fd5b815161159f81612eac565b60008351613889818460208801612edf565b83519083019061389d818360208801612edf565b01949350505050565b634e487b7160e01b600052601260045260246000fd5b6000826138d957634e487b7160e01b600052601260045260246000fd5b500490565b634e487b7160e01b600052603160045260246000fdfea26469706673582212200861948c00ac12a29e05900592c5ed3f68c88227f729b466bf3d29f5a5208d1064736f6c63430008140033", + "libraries": { + "ProofHandler": "0x0152ee45780385dACCCCB128D816031CfFe5F36B" + }, + "devdoc": { + "author": "Web3 Hackers Collective", + "custom:security-contact": "julien@strat.cc", + "details": "Extends OpenZeppelin's NFT standards with cross-chain operation support and delegation", + "errors": { + "CheckpointUnorderedInsertion()": [ + { + "details": "A value was attempted to be inserted on a past checkpoint." + } + ], + "ECDSAInvalidSignature()": [ + { + "details": "The signature derives the `address(0)`." + } + ], + "ECDSAInvalidSignatureLength(uint256)": [ + { + "details": "The signature has an invalid length." + } + ], + "ECDSAInvalidSignatureS(bytes32)": [ + { + "details": "The signature has an S value that is in the upper half order." + } + ], + "ERC5805FutureLookup(uint256,uint48)": [ + { + "details": "Lookup to future votes is not available." + } + ], + "ERC6372InconsistentClock()": [ + { + "details": "The clock was incorrectly modified." + } + ], + "ERC721EnumerableForbiddenBatchMint()": [ + { + "details": "Batch mint is not allowed." + } + ], + "ERC721IncorrectOwner(address,uint256,address)": [ + { + "details": "Indicates an error related to the ownership over a particular token. Used in transfers.", + "params": { + "owner": "Address of the current owner of a token.", + "sender": "Address whose tokens are being transferred.", + "tokenId": "Identifier number of a token." + } + } + ], + "ERC721InsufficientApproval(address,uint256)": [ + { + "details": "Indicates a failure with the `operator`’s approval. Used in transfers.", + "params": { + "operator": "Address that may be allowed to operate on tokens without being their owner.", + "tokenId": "Identifier number of a token." + } + } + ], + "ERC721InvalidApprover(address)": [ + { + "details": "Indicates a failure with the `approver` of a token to be approved. Used in approvals.", + "params": { + "approver": "Address initiating an approval operation." + } + } + ], + "ERC721InvalidOperator(address)": [ + { + "details": "Indicates a failure with the `operator` to be approved. Used in approvals.", + "params": { + "operator": "Address that may be allowed to operate on tokens without being their owner." + } + } + ], + "ERC721InvalidOwner(address)": [ + { + "details": "Indicates that an address can't be an owner. For example, `address(0)` is a forbidden owner in ERC-20. Used in balance queries.", + "params": { + "owner": "Address of the current owner of a token." + } + } + ], + "ERC721InvalidReceiver(address)": [ + { + "details": "Indicates a failure with the token `receiver`. Used in transfers.", + "params": { + "receiver": "Address to which tokens are being transferred." + } + } + ], + "ERC721InvalidSender(address)": [ + { + "details": "Indicates a failure with the token `sender`. Used in transfers.", + "params": { + "sender": "Address whose tokens are being transferred." + } + } + ], + "ERC721NonexistentToken(uint256)": [ + { + "details": "Indicates a `tokenId` whose `owner` is the zero address.", + "params": { + "tokenId": "Identifier number of a token." + } + } + ], + "ERC721OutOfBoundsIndex(address,uint256)": [ + { + "details": "An `owner`'s token query was out of bounds for `index`. NOTE: The owner being `address(0)` indicates a global out of bounds index." + } + ], + "InvalidAccountNonce(address,uint256)": [ + { + "details": "The nonce used for an `account` is not the expected current nonce." + } + ], + "OwnableInvalidOwner(address)": [ + { + "details": "The owner is not a valid owner account. (eg. `address(0)`)" + } + ], + "OwnableUnauthorizedAccount(address)": [ + { + "details": "The caller account is not authorized to perform an operation." + } + ], + "SafeCastOverflowedUintDowncast(uint8,uint256)": [ + { + "details": "Value doesn't fit in an uint of `bits` size." + } + ], + "VotesExpiredSignature(uint256)": [ + { + "details": "The signature used has expired." + } + ] + }, + "events": { + "Approval(address,address,uint256)": { + "details": "Emitted when `owner` enables `approved` to manage the `tokenId` token." + }, + "ApprovalForAll(address,address,bool)": { + "details": "Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets." + }, + "BatchMetadataUpdate(uint256,uint256)": { + "details": "This event emits when the metadata of a range of tokens is changed. So that the third-party platforms such as NFT market could timely update the images and related attributes of the NFTs." + }, + "DelegateChanged(address,address,address)": { + "details": "Emitted when an account changes their delegate." + }, + "DelegateVotesChanged(address,uint256,uint256)": { + "details": "Emitted when a token transfer or delegate change results in changes to a delegate's number of voting units." + }, + "DelegationSynced(address,address,uint256)": { + "params": { + "delegatee": "The address receiving the delegation", + "delegator": "The address delegating their voting power", + "nonce": "Operation sequence number" + } + }, + "EIP712DomainChanged()": { + "details": "MAY be emitted to signal that the domain could have changed." + }, + "MembershipClaimed(uint256,address,uint256)": { + "params": { + "member": "The address receiving the membership", + "nonce": "Operation sequence number", + "tokenId": "The ID of the claimed token" + } + }, + "MembershipRevoked(uint256,address,uint256)": { + "params": { + "member": "The address losing membership", + "nonce": "Operation sequence number", + "tokenId": "The ID of the revoked token" + } + }, + "MetadataUpdate(uint256)": { + "details": "This event emits when the metadata of a token is changed. So that the third-party platforms such as NFT market could timely update the images and related attributes of the NFT." + }, + "MetadataUpdated(uint256,string,uint256)": { + "params": { + "newUri": "The new metadata URI", + "nonce": "Operation sequence number", + "tokenId": "The ID of the updated token" + } + }, + "Transfer(address,address,uint256)": { + "details": "Emitted when `tokenId` token is transferred from `from` to `to`." + } + }, + "kind": "dev", + "methods": { + "CLOCK_MODE()": { + "returns": { + "_0": "String indicating timestamp-based voting" + } + }, + "approve(address,uint256)": { + "details": "See {IERC721-approve}." + }, + "balanceOf(address)": { + "details": "See {IERC721-balanceOf}." + }, + "burn(uint256)": { + "details": "Burns `tokenId`. See {ERC721-_burn}. Requirements: - The caller must own `tokenId` or be an approved operator." + }, + "claimDelegation(bytes)": { + "params": { + "proof": "Proof generated by home chain" + } + }, + "claimOperation(bytes)": { + "params": { + "proof": "Proof generated by home chain" + } + }, + "clock()": { + "details": "Used for voting snapshots", + "returns": { + "_0": "Current block timestamp" + } + }, + "constructor": { + "params": { + "_firstMembers": "Array of initial member addresses", + "_home": "Chain ID where contract is considered home", + "_name": "Token collection name", + "_symbol": "Token collection symbol", + "_uri": "Initial token URI", + "initialOwner": "Initial contract owner" + } + }, + "delegate(address)": { + "details": "Overrides ERC721Votes delegate function to add cross-chain functionality", + "params": { + "delegatee": "Address to delegate voting power to" + } + }, + "delegateBySig(address,uint256,uint256,uint8,bytes32,bytes32)": { + "details": "Delegates votes from signer to `delegatee`." + }, + "delegates(address)": { + "details": "Returns the delegate that `account` has chosen." + }, + "eip712Domain()": { + "details": "See {IERC-5267}." + }, + "generateDelegationProof(address,address)": { + "details": "Only callable on home chain", + "params": { + "delegatee": "Address receiving delegation", + "delegator": "Address delegating voting power" + }, + "returns": { + "_0": "Encoded proof data" + } + }, + "generateOperationProof(uint8,bytes)": { + "details": "Only callable on home chain", + "params": { + "operationType": "Type of operation", + "params": "Operation parameters" + }, + "returns": { + "_0": "Encoded proof data" + } + }, + "getApproved(uint256)": { + "details": "See {IERC721-getApproved}." + }, + "getPastTotalSupply(uint256)": { + "details": "Returns the total supply of votes available at a specific moment in the past. If the `clock()` is configured to use block numbers, this will return the value at the end of the corresponding block. NOTE: This value is the sum of all available votes, which is not necessarily the sum of all delegated votes. Votes that have not been delegated are still part of total supply, even though they would not participate in a vote. Requirements: - `timepoint` must be in the past. If operating using block numbers, the block must be already mined." + }, + "getPastVotes(address,uint256)": { + "details": "Returns the amount of votes that `account` had at a specific moment in the past. If the `clock()` is configured to use block numbers, this will return the value at the end of the corresponding block. Requirements: - `timepoint` must be in the past. If operating using block numbers, the block must be already mined." + }, + "getVotes(address)": { + "details": "Returns the current amount of votes that `account` has." + }, + "govBurn(uint256)": { + "details": "Only callable by owner (governance) on home chain", + "params": { + "tokenId": "ID of token to burn" + } + }, + "isApprovedForAll(address,address)": { + "details": "See {IERC721-isApprovedForAll}." + }, + "name()": { + "details": "See {IERC721Metadata-name}." + }, + "nonces(address)": { + "details": "Returns the next unused nonce for an address." + }, + "owner()": { + "details": "Returns the address of the current owner." + }, + "ownerOf(uint256)": { + "details": "See {IERC721-ownerOf}." + }, + "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." + }, + "safeMint(address,string)": { + "details": "Only callable by owner (governance) on home chain", + "params": { + "to": "Address to mint token to", + "uri": "Token metadata URI" + } + }, + "safeTransferFrom(address,address,uint256)": { + "details": "See {IERC721-safeTransferFrom}." + }, + "safeTransferFrom(address,address,uint256,bytes)": { + "details": "See {IERC721-safeTransferFrom}." + }, + "setApprovalForAll(address,bool)": { + "details": "See {IERC721-setApprovalForAll}." + }, + "setMetadata(uint256,string)": { + "details": "Only callable by owner (governance) on home chain", + "params": { + "tokenId": "ID of token to update", + "uri": "New metadata URI" + } + }, + "supportsInterface(bytes4)": { + "params": { + "interfaceId": "Interface identifier to check" + }, + "returns": { + "_0": "bool True if interface is supported" + } + }, + "symbol()": { + "details": "See {IERC721Metadata-symbol}." + }, + "tokenByIndex(uint256)": { + "details": "See {IERC721Enumerable-tokenByIndex}." + }, + "tokenOfOwnerByIndex(address,uint256)": { + "details": "See {IERC721Enumerable-tokenOfOwnerByIndex}." + }, + "tokenURI(uint256)": { + "params": { + "tokenId": "Token ID to query" + }, + "returns": { + "_0": "URI string" + } + }, + "totalSupply()": { + "details": "See {IERC721Enumerable-totalSupply}." + }, + "transferFrom(address,address,uint256)": { + "details": "See {IERC721-transferFrom}." + }, + "transferOwnership(address)": { + "details": "Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner." + } + }, + "title": "Cross-chain Membership NFT Contract", + "version": 1 + }, + "userdoc": { + "events": { + "DelegationSynced(address,address,uint256)": { + "notice": "Emitted when delegation is synchronized across chains" + }, + "MembershipClaimed(uint256,address,uint256)": { + "notice": "Emitted when a membership is claimed" + }, + "MembershipRevoked(uint256,address,uint256)": { + "notice": "Emitted when a membership is revoked" + }, + "MetadataUpdated(uint256,string,uint256)": { + "notice": "Emitted when metadata is updated" + } + }, + "kind": "user", + "methods": { + "CLOCK_MODE()": { + "notice": "Gets clock mode description" + }, + "claimDelegation(bytes)": { + "notice": "Claims a delegation operation on a foreign chain" + }, + "claimOperation(bytes)": { + "notice": "Claims an NFT operation on a foreign chain" + }, + "clock()": { + "notice": "Gets current timestamp" + }, + "constructor": { + "notice": "Initializes the NFT contract" + }, + "delegate(address)": { + "notice": "Delegates voting power to another address on home chain" + }, + "generateDelegationProof(address,address)": { + "notice": "Generates proof for delegation" + }, + "generateOperationProof(uint8,bytes)": { + "notice": "Generates proof for NFT operations" + }, + "govBurn(uint256)": { + "notice": "Burns token on home chain" + }, + "home()": { + "notice": "Chain ID where contract was originally deployed" + }, + "safeMint(address,string)": { + "notice": "Adds a new member on home chain" + }, + "setMetadata(uint256,string)": { + "notice": "Updates token metadata on home chain" + }, + "supportsInterface(bytes4)": { + "notice": "Checks interface support" + }, + "tokenURI(uint256)": { + "notice": "Gets token URI" + } + }, + "notice": "Non-transferable NFT implementation for DAO membership with cross-chain capabilities", + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 1030, + "contract": "contracts/variants/crosschain/NFT.sol:NFT", + "label": "_name", + "offset": 0, + "slot": "0", + "type": "t_string_storage" + }, + { + "astId": 1032, + "contract": "contracts/variants/crosschain/NFT.sol:NFT", + "label": "_symbol", + "offset": 0, + "slot": "1", + "type": "t_string_storage" + }, + { + "astId": 1036, + "contract": "contracts/variants/crosschain/NFT.sol:NFT", + "label": "_owners", + "offset": 0, + "slot": "2", + "type": "t_mapping(t_uint256,t_address)" + }, + { + "astId": 1040, + "contract": "contracts/variants/crosschain/NFT.sol:NFT", + "label": "_balances", + "offset": 0, + "slot": "3", + "type": "t_mapping(t_address,t_uint256)" + }, + { + "astId": 1044, + "contract": "contracts/variants/crosschain/NFT.sol:NFT", + "label": "_tokenApprovals", + "offset": 0, + "slot": "4", + "type": "t_mapping(t_uint256,t_address)" + }, + { + "astId": 1050, + "contract": "contracts/variants/crosschain/NFT.sol:NFT", + "label": "_operatorApprovals", + "offset": 0, + "slot": "5", + "type": "t_mapping(t_address,t_mapping(t_address,t_bool))" + }, + { + "astId": 2137, + "contract": "contracts/variants/crosschain/NFT.sol:NFT", + "label": "_ownedTokens", + "offset": 0, + "slot": "6", + "type": "t_mapping(t_address,t_mapping(t_uint256,t_uint256))" + }, + { + "astId": 2141, + "contract": "contracts/variants/crosschain/NFT.sol:NFT", + "label": "_ownedTokensIndex", + "offset": 0, + "slot": "7", + "type": "t_mapping(t_uint256,t_uint256)" + }, + { + "astId": 2144, + "contract": "contracts/variants/crosschain/NFT.sol:NFT", + "label": "_allTokens", + "offset": 0, + "slot": "8", + "type": "t_array(t_uint256)dyn_storage" + }, + { + "astId": 2148, + "contract": "contracts/variants/crosschain/NFT.sol:NFT", + "label": "_allTokensIndex", + "offset": 0, + "slot": "9", + "type": "t_mapping(t_uint256,t_uint256)" + }, + { + "astId": 2532, + "contract": "contracts/variants/crosschain/NFT.sol:NFT", + "label": "_tokenURIs", + "offset": 0, + "slot": "10", + "type": "t_mapping(t_uint256,t_string_storage)" + }, + { + "astId": 8, + "contract": "contracts/variants/crosschain/NFT.sol:NFT", + "label": "_owner", + "offset": 0, + "slot": "11", + "type": "t_address" + }, + { + "astId": 4046, + "contract": "contracts/variants/crosschain/NFT.sol:NFT", + "label": "_nameFallback", + "offset": 0, + "slot": "12", + "type": "t_string_storage" + }, + { + "astId": 4048, + "contract": "contracts/variants/crosschain/NFT.sol:NFT", + "label": "_versionFallback", + "offset": 0, + "slot": "13", + "type": "t_string_storage" + }, + { + "astId": 2894, + "contract": "contracts/variants/crosschain/NFT.sol:NFT", + "label": "_nonces", + "offset": 0, + "slot": "14", + "type": "t_mapping(t_address,t_uint256)" + }, + { + "astId": 270, + "contract": "contracts/variants/crosschain/NFT.sol:NFT", + "label": "_delegatee", + "offset": 0, + "slot": "15", + "type": "t_mapping(t_address,t_address)" + }, + { + "astId": 275, + "contract": "contracts/variants/crosschain/NFT.sol:NFT", + "label": "_delegateCheckpoints", + "offset": 0, + "slot": "16", + "type": "t_mapping(t_address,t_struct(Trace208)8398_storage)" + }, + { + "astId": 278, + "contract": "contracts/variants/crosschain/NFT.sol:NFT", + "label": "_totalCheckpoints", + "offset": 0, + "slot": "17", + "type": "t_struct(Trace208)8398_storage" + }, + { + "astId": 9751, + "contract": "contracts/variants/crosschain/NFT.sol:NFT", + "label": "_nextTokenId", + "offset": 0, + "slot": "18", + "type": "t_uint256" + }, + { + "astId": 9755, + "contract": "contracts/variants/crosschain/NFT.sol:NFT", + "label": "_proofStorage", + "offset": 0, + "slot": "19", + "type": "t_struct(ProofStorage)10489_storage" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + }, + "t_array(t_struct(Checkpoint208)8403_storage)dyn_storage": { + "base": "t_struct(Checkpoint208)8403_storage", + "encoding": "dynamic_array", + "label": "struct Checkpoints.Checkpoint208[]", + "numberOfBytes": "32" + }, + "t_array(t_uint256)dyn_storage": { + "base": "t_uint256", + "encoding": "dynamic_array", + "label": "uint256[]", + "numberOfBytes": "32" + }, + "t_bool": { + "encoding": "inplace", + "label": "bool", + "numberOfBytes": "1" + }, + "t_bytes32": { + "encoding": "inplace", + "label": "bytes32", + "numberOfBytes": "32" + }, + "t_mapping(t_address,t_address)": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => address)", + "numberOfBytes": "32", + "value": "t_address" + }, + "t_mapping(t_address,t_bool)": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => bool)", + "numberOfBytes": "32", + "value": "t_bool" + }, + "t_mapping(t_address,t_mapping(t_address,t_bool))": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => mapping(address => bool))", + "numberOfBytes": "32", + "value": "t_mapping(t_address,t_bool)" + }, + "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_address,t_struct(Trace208)8398_storage)": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => struct Checkpoints.Trace208)", + "numberOfBytes": "32", + "value": "t_struct(Trace208)8398_storage" + }, + "t_mapping(t_address,t_uint256)": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => uint256)", + "numberOfBytes": "32", + "value": "t_uint256" + }, + "t_mapping(t_bytes32,t_bool)": { + "encoding": "mapping", + "key": "t_bytes32", + "label": "mapping(bytes32 => bool)", + "numberOfBytes": "32", + "value": "t_bool" + }, + "t_mapping(t_uint256,t_address)": { + "encoding": "mapping", + "key": "t_uint256", + "label": "mapping(uint256 => address)", + "numberOfBytes": "32", + "value": "t_address" + }, + "t_mapping(t_uint256,t_string_storage)": { + "encoding": "mapping", + "key": "t_uint256", + "label": "mapping(uint256 => string)", + "numberOfBytes": "32", + "value": "t_string_storage" + }, + "t_mapping(t_uint256,t_uint256)": { + "encoding": "mapping", + "key": "t_uint256", + "label": "mapping(uint256 => uint256)", + "numberOfBytes": "32", + "value": "t_uint256" + }, + "t_mapping(t_uint8,t_uint256)": { + "encoding": "mapping", + "key": "t_uint8", + "label": "mapping(uint8 => uint256)", + "numberOfBytes": "32", + "value": "t_uint256" + }, + "t_string_storage": { + "encoding": "bytes", + "label": "string", + "numberOfBytes": "32" + }, + "t_struct(Checkpoint208)8403_storage": { + "encoding": "inplace", + "label": "struct Checkpoints.Checkpoint208", + "members": [ + { + "astId": 8400, + "contract": "contracts/variants/crosschain/NFT.sol:NFT", + "label": "_key", + "offset": 0, + "slot": "0", + "type": "t_uint48" + }, + { + "astId": 8402, + "contract": "contracts/variants/crosschain/NFT.sol:NFT", + "label": "_value", + "offset": 6, + "slot": "0", + "type": "t_uint208" + } + ], + "numberOfBytes": "32" + }, + "t_struct(ProofStorage)10489_storage": { + "encoding": "inplace", + "label": "struct ProofHandler.ProofStorage", + "members": [ + { + "astId": 10484, + "contract": "contracts/variants/crosschain/NFT.sol:NFT", + "label": "updateAppliedOnChain", + "offset": 0, + "slot": "0", + "type": "t_mapping(t_bytes32,t_bool)" + }, + { + "astId": 10488, + "contract": "contracts/variants/crosschain/NFT.sol:NFT", + "label": "currentNonce", + "offset": 0, + "slot": "1", + "type": "t_mapping(t_uint8,t_uint256)" + } + ], + "numberOfBytes": "64" + }, + "t_struct(Trace208)8398_storage": { + "encoding": "inplace", + "label": "struct Checkpoints.Trace208", + "members": [ + { + "astId": 8397, + "contract": "contracts/variants/crosschain/NFT.sol:NFT", + "label": "_checkpoints", + "offset": 0, + "slot": "0", + "type": "t_array(t_struct(Checkpoint208)8403_storage)dyn_storage" + } + ], + "numberOfBytes": "32" + }, + "t_uint208": { + "encoding": "inplace", + "label": "uint208", + "numberOfBytes": "26" + }, + "t_uint256": { + "encoding": "inplace", + "label": "uint256", + "numberOfBytes": "32" + }, + "t_uint48": { + "encoding": "inplace", + "label": "uint48", + "numberOfBytes": "6" + }, + "t_uint8": { + "encoding": "inplace", + "label": "uint8", + "numberOfBytes": "1" + } + } + } +} \ No newline at end of file diff --git a/deployments/op-sepolia/ProofHandler.json b/deployments/arbitrumSepolia/ProofHandler.json similarity index 94% rename from deployments/op-sepolia/ProofHandler.json rename to deployments/arbitrumSepolia/ProofHandler.json index c1b41f3..3ec826e 100644 --- a/deployments/op-sepolia/ProofHandler.json +++ b/deployments/arbitrumSepolia/ProofHandler.json @@ -61,22 +61,6 @@ "type": "function" } ], - "transactionHash": "0xc411a6ecc3873cff0a6d716a3849641434e55a6bc5c7951dc0b2bca023e9afd3", - "receipt": { - "to": "0x4e59b44847b379578588920cA78FbF26c0B4956C", - "from": "0x27292E1a901E3E0bE7d144aDba4CAD07da2d8a42", - "contractAddress": null, - "transactionIndex": 1, - "gasUsed": "518229", - "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x1115c45c99cbb520ae8840bc2518558624ddc7c53c3aa27b3c3ac33e259e0179", - "transactionHash": "0xc411a6ecc3873cff0a6d716a3849641434e55a6bc5c7951dc0b2bca023e9afd3", - "logs": [], - "blockNumber": 20641662, - "cumulativeGasUsed": "562044", - "status": 1, - "byzantium": true - }, "args": [], "numDeployments": 1, "solcInputHash": "96a9008abeaccbd30a9b75989ce7f0fd", diff --git a/deployments/arbitrumSepolia/solcInputs/77ec5f062950e8c4875fd27ffb65d267.json b/deployments/arbitrumSepolia/solcInputs/77ec5f062950e8c4875fd27ffb65d267.json new file mode 100644 index 0000000..8590478 --- /dev/null +++ b/deployments/arbitrumSepolia/solcInputs/77ec5f062950e8c4875fd27ffb65d267.json @@ -0,0 +1,186 @@ +{ + "language": "Solidity", + "sources": { + "@openzeppelin/contracts/access/Ownable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol)\n\npragma solidity ^0.8.20;\n\nimport {Context} from \"../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 * The initial owner is set to the address provided by the deployer. This can\n * 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 /**\n * @dev The caller account is not authorized to perform an operation.\n */\n error OwnableUnauthorizedAccount(address account);\n\n /**\n * @dev The owner is not a valid owner account. (eg. `address(0)`)\n */\n error OwnableInvalidOwner(address owner);\n\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n /**\n * @dev Initializes the contract setting the address provided by the deployer as the initial owner.\n */\n constructor(address initialOwner) {\n if (initialOwner == address(0)) {\n revert OwnableInvalidOwner(address(0));\n }\n _transferOwnership(initialOwner);\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 if (owner() != _msgSender()) {\n revert OwnableUnauthorizedAccount(_msgSender());\n }\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 if (newOwner == address(0)) {\n revert OwnableInvalidOwner(address(0));\n }\n _transferOwnership(newOwner);\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Internal function without access restriction.\n */\n function _transferOwnership(address newOwner) internal virtual {\n address oldOwner = _owner;\n _owner = newOwner;\n emit OwnershipTransferred(oldOwner, newOwner);\n }\n}\n" + }, + "@openzeppelin/contracts/governance/extensions/GovernorCountingSimple.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (governance/extensions/GovernorCountingSimple.sol)\n\npragma solidity ^0.8.20;\n\nimport {Governor} from \"../Governor.sol\";\n\n/**\n * @dev Extension of {Governor} for simple, 3 options, vote counting.\n */\nabstract contract GovernorCountingSimple is Governor {\n /**\n * @dev Supported vote types. Matches Governor Bravo ordering.\n */\n enum VoteType {\n Against,\n For,\n Abstain\n }\n\n struct ProposalVote {\n uint256 againstVotes;\n uint256 forVotes;\n uint256 abstainVotes;\n mapping(address voter => bool) hasVoted;\n }\n\n mapping(uint256 proposalId => ProposalVote) private _proposalVotes;\n\n /**\n * @dev See {IGovernor-COUNTING_MODE}.\n */\n // solhint-disable-next-line func-name-mixedcase\n function COUNTING_MODE() public pure virtual override returns (string memory) {\n return \"support=bravo&quorum=for,abstain\";\n }\n\n /**\n * @dev See {IGovernor-hasVoted}.\n */\n function hasVoted(uint256 proposalId, address account) public view virtual override returns (bool) {\n return _proposalVotes[proposalId].hasVoted[account];\n }\n\n /**\n * @dev Accessor to the internal vote counts.\n */\n function proposalVotes(\n uint256 proposalId\n ) public view virtual returns (uint256 againstVotes, uint256 forVotes, uint256 abstainVotes) {\n ProposalVote storage proposalVote = _proposalVotes[proposalId];\n return (proposalVote.againstVotes, proposalVote.forVotes, proposalVote.abstainVotes);\n }\n\n /**\n * @dev See {Governor-_quorumReached}.\n */\n function _quorumReached(uint256 proposalId) internal view virtual override returns (bool) {\n ProposalVote storage proposalVote = _proposalVotes[proposalId];\n\n return quorum(proposalSnapshot(proposalId)) <= proposalVote.forVotes + proposalVote.abstainVotes;\n }\n\n /**\n * @dev See {Governor-_voteSucceeded}. In this module, the forVotes must be strictly over the againstVotes.\n */\n function _voteSucceeded(uint256 proposalId) internal view virtual override returns (bool) {\n ProposalVote storage proposalVote = _proposalVotes[proposalId];\n\n return proposalVote.forVotes > proposalVote.againstVotes;\n }\n\n /**\n * @dev See {Governor-_countVote}. In this module, the support follows the `VoteType` enum (from Governor Bravo).\n */\n function _countVote(\n uint256 proposalId,\n address account,\n uint8 support,\n uint256 totalWeight,\n bytes memory // params\n ) internal virtual override returns (uint256) {\n ProposalVote storage proposalVote = _proposalVotes[proposalId];\n\n if (proposalVote.hasVoted[account]) {\n revert GovernorAlreadyCastVote(account);\n }\n proposalVote.hasVoted[account] = true;\n\n if (support == uint8(VoteType.Against)) {\n proposalVote.againstVotes += totalWeight;\n } else if (support == uint8(VoteType.For)) {\n proposalVote.forVotes += totalWeight;\n } else if (support == uint8(VoteType.Abstain)) {\n proposalVote.abstainVotes += totalWeight;\n } else {\n revert GovernorInvalidVoteType();\n }\n\n return totalWeight;\n }\n}\n" + }, + "@openzeppelin/contracts/governance/extensions/GovernorSettings.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (governance/extensions/GovernorSettings.sol)\n\npragma solidity ^0.8.20;\n\nimport {Governor} from \"../Governor.sol\";\n\n/**\n * @dev Extension of {Governor} for settings updatable through governance.\n */\nabstract contract GovernorSettings is Governor {\n // amount of token\n uint256 private _proposalThreshold;\n // timepoint: limited to uint48 in core (same as clock() type)\n uint48 private _votingDelay;\n // duration: limited to uint32 in core\n uint32 private _votingPeriod;\n\n event VotingDelaySet(uint256 oldVotingDelay, uint256 newVotingDelay);\n event VotingPeriodSet(uint256 oldVotingPeriod, uint256 newVotingPeriod);\n event ProposalThresholdSet(uint256 oldProposalThreshold, uint256 newProposalThreshold);\n\n /**\n * @dev Initialize the governance parameters.\n */\n constructor(uint48 initialVotingDelay, uint32 initialVotingPeriod, uint256 initialProposalThreshold) {\n _setVotingDelay(initialVotingDelay);\n _setVotingPeriod(initialVotingPeriod);\n _setProposalThreshold(initialProposalThreshold);\n }\n\n /**\n * @dev See {IGovernor-votingDelay}.\n */\n function votingDelay() public view virtual override returns (uint256) {\n return _votingDelay;\n }\n\n /**\n * @dev See {IGovernor-votingPeriod}.\n */\n function votingPeriod() public view virtual override returns (uint256) {\n return _votingPeriod;\n }\n\n /**\n * @dev See {Governor-proposalThreshold}.\n */\n function proposalThreshold() public view virtual override returns (uint256) {\n return _proposalThreshold;\n }\n\n /**\n * @dev Update the voting delay. This operation can only be performed through a governance proposal.\n *\n * Emits a {VotingDelaySet} event.\n */\n function setVotingDelay(uint48 newVotingDelay) public virtual onlyGovernance {\n _setVotingDelay(newVotingDelay);\n }\n\n /**\n * @dev Update the voting period. This operation can only be performed through a governance proposal.\n *\n * Emits a {VotingPeriodSet} event.\n */\n function setVotingPeriod(uint32 newVotingPeriod) public virtual onlyGovernance {\n _setVotingPeriod(newVotingPeriod);\n }\n\n /**\n * @dev Update the proposal threshold. This operation can only be performed through a governance proposal.\n *\n * Emits a {ProposalThresholdSet} event.\n */\n function setProposalThreshold(uint256 newProposalThreshold) public virtual onlyGovernance {\n _setProposalThreshold(newProposalThreshold);\n }\n\n /**\n * @dev Internal setter for the voting delay.\n *\n * Emits a {VotingDelaySet} event.\n */\n function _setVotingDelay(uint48 newVotingDelay) internal virtual {\n emit VotingDelaySet(_votingDelay, newVotingDelay);\n _votingDelay = newVotingDelay;\n }\n\n /**\n * @dev Internal setter for the voting period.\n *\n * Emits a {VotingPeriodSet} event.\n */\n function _setVotingPeriod(uint32 newVotingPeriod) internal virtual {\n if (newVotingPeriod == 0) {\n revert GovernorInvalidVotingPeriod(0);\n }\n emit VotingPeriodSet(_votingPeriod, newVotingPeriod);\n _votingPeriod = newVotingPeriod;\n }\n\n /**\n * @dev Internal setter for the proposal threshold.\n *\n * Emits a {ProposalThresholdSet} event.\n */\n function _setProposalThreshold(uint256 newProposalThreshold) internal virtual {\n emit ProposalThresholdSet(_proposalThreshold, newProposalThreshold);\n _proposalThreshold = newProposalThreshold;\n }\n}\n" + }, + "@openzeppelin/contracts/governance/extensions/GovernorVotes.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (governance/extensions/GovernorVotes.sol)\n\npragma solidity ^0.8.20;\n\nimport {Governor} from \"../Governor.sol\";\nimport {IVotes} from \"../utils/IVotes.sol\";\nimport {IERC5805} from \"../../interfaces/IERC5805.sol\";\nimport {SafeCast} from \"../../utils/math/SafeCast.sol\";\nimport {Time} from \"../../utils/types/Time.sol\";\n\n/**\n * @dev Extension of {Governor} for voting weight extraction from an {ERC20Votes} token, or since v4.5 an {ERC721Votes}\n * token.\n */\nabstract contract GovernorVotes is Governor {\n IERC5805 private immutable _token;\n\n constructor(IVotes tokenAddress) {\n _token = IERC5805(address(tokenAddress));\n }\n\n /**\n * @dev The token that voting power is sourced from.\n */\n function token() public view virtual returns (IERC5805) {\n return _token;\n }\n\n /**\n * @dev Clock (as specified in ERC-6372) is set to match the token's clock. Fallback to block numbers if the token\n * does not implement ERC-6372.\n */\n function clock() public view virtual override returns (uint48) {\n try token().clock() returns (uint48 timepoint) {\n return timepoint;\n } catch {\n return Time.blockNumber();\n }\n }\n\n /**\n * @dev Machine-readable description of the clock as specified in ERC-6372.\n */\n // solhint-disable-next-line func-name-mixedcase\n function CLOCK_MODE() public view virtual override returns (string memory) {\n try token().CLOCK_MODE() returns (string memory clockmode) {\n return clockmode;\n } catch {\n return \"mode=blocknumber&from=default\";\n }\n }\n\n /**\n * Read the voting weight from the token's built in snapshot mechanism (see {Governor-_getVotes}).\n */\n function _getVotes(\n address account,\n uint256 timepoint,\n bytes memory /*params*/\n ) internal view virtual override returns (uint256) {\n return token().getPastVotes(account, timepoint);\n }\n}\n" + }, + "@openzeppelin/contracts/governance/extensions/GovernorVotesQuorumFraction.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (governance/extensions/GovernorVotesQuorumFraction.sol)\n\npragma solidity ^0.8.20;\n\nimport {GovernorVotes} from \"./GovernorVotes.sol\";\nimport {SafeCast} from \"../../utils/math/SafeCast.sol\";\nimport {Checkpoints} from \"../../utils/structs/Checkpoints.sol\";\n\n/**\n * @dev Extension of {Governor} for voting weight extraction from an {ERC20Votes} token and a quorum expressed as a\n * fraction of the total supply.\n */\nabstract contract GovernorVotesQuorumFraction is GovernorVotes {\n using Checkpoints for Checkpoints.Trace208;\n\n Checkpoints.Trace208 private _quorumNumeratorHistory;\n\n event QuorumNumeratorUpdated(uint256 oldQuorumNumerator, uint256 newQuorumNumerator);\n\n /**\n * @dev The quorum set is not a valid fraction.\n */\n error GovernorInvalidQuorumFraction(uint256 quorumNumerator, uint256 quorumDenominator);\n\n /**\n * @dev Initialize quorum as a fraction of the token's total supply.\n *\n * The fraction is specified as `numerator / denominator`. By default the denominator is 100, so quorum is\n * specified as a percent: a numerator of 10 corresponds to quorum being 10% of total supply. The denominator can be\n * customized by overriding {quorumDenominator}.\n */\n constructor(uint256 quorumNumeratorValue) {\n _updateQuorumNumerator(quorumNumeratorValue);\n }\n\n /**\n * @dev Returns the current quorum numerator. See {quorumDenominator}.\n */\n function quorumNumerator() public view virtual returns (uint256) {\n return _quorumNumeratorHistory.latest();\n }\n\n /**\n * @dev Returns the quorum numerator at a specific timepoint. See {quorumDenominator}.\n */\n function quorumNumerator(uint256 timepoint) public view virtual returns (uint256) {\n uint256 length = _quorumNumeratorHistory._checkpoints.length;\n\n // Optimistic search, check the latest checkpoint\n Checkpoints.Checkpoint208 storage latest = _quorumNumeratorHistory._checkpoints[length - 1];\n uint48 latestKey = latest._key;\n uint208 latestValue = latest._value;\n if (latestKey <= timepoint) {\n return latestValue;\n }\n\n // Otherwise, do the binary search\n return _quorumNumeratorHistory.upperLookupRecent(SafeCast.toUint48(timepoint));\n }\n\n /**\n * @dev Returns the quorum denominator. Defaults to 100, but may be overridden.\n */\n function quorumDenominator() public view virtual returns (uint256) {\n return 100;\n }\n\n /**\n * @dev Returns the quorum for a timepoint, in terms of number of votes: `supply * numerator / denominator`.\n */\n function quorum(uint256 timepoint) public view virtual override returns (uint256) {\n return (token().getPastTotalSupply(timepoint) * quorumNumerator(timepoint)) / quorumDenominator();\n }\n\n /**\n * @dev Changes the quorum numerator.\n *\n * Emits a {QuorumNumeratorUpdated} event.\n *\n * Requirements:\n *\n * - Must be called through a governance proposal.\n * - New numerator must be smaller or equal to the denominator.\n */\n function updateQuorumNumerator(uint256 newQuorumNumerator) external virtual onlyGovernance {\n _updateQuorumNumerator(newQuorumNumerator);\n }\n\n /**\n * @dev Changes the quorum numerator.\n *\n * Emits a {QuorumNumeratorUpdated} event.\n *\n * Requirements:\n *\n * - New numerator must be smaller or equal to the denominator.\n */\n function _updateQuorumNumerator(uint256 newQuorumNumerator) internal virtual {\n uint256 denominator = quorumDenominator();\n if (newQuorumNumerator > denominator) {\n revert GovernorInvalidQuorumFraction(newQuorumNumerator, denominator);\n }\n\n uint256 oldQuorumNumerator = quorumNumerator();\n _quorumNumeratorHistory.push(clock(), SafeCast.toUint208(newQuorumNumerator));\n\n emit QuorumNumeratorUpdated(oldQuorumNumerator, newQuorumNumerator);\n }\n}\n" + }, + "@openzeppelin/contracts/governance/Governor.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (governance/Governor.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC721Receiver} from \"../token/ERC721/IERC721Receiver.sol\";\nimport {IERC1155Receiver} from \"../token/ERC1155/IERC1155Receiver.sol\";\nimport {EIP712} from \"../utils/cryptography/EIP712.sol\";\nimport {SignatureChecker} from \"../utils/cryptography/SignatureChecker.sol\";\nimport {IERC165, ERC165} from \"../utils/introspection/ERC165.sol\";\nimport {SafeCast} from \"../utils/math/SafeCast.sol\";\nimport {DoubleEndedQueue} from \"../utils/structs/DoubleEndedQueue.sol\";\nimport {Address} from \"../utils/Address.sol\";\nimport {Context} from \"../utils/Context.sol\";\nimport {Nonces} from \"../utils/Nonces.sol\";\nimport {IGovernor, IERC6372} from \"./IGovernor.sol\";\n\n/**\n * @dev Core of the governance system, designed to be extended through various modules.\n *\n * This contract is abstract and requires several functions to be implemented in various modules:\n *\n * - A counting module must implement {quorum}, {_quorumReached}, {_voteSucceeded} and {_countVote}\n * - A voting module must implement {_getVotes}\n * - Additionally, {votingPeriod} must also be implemented\n */\nabstract contract Governor is Context, ERC165, EIP712, Nonces, IGovernor, IERC721Receiver, IERC1155Receiver {\n using DoubleEndedQueue for DoubleEndedQueue.Bytes32Deque;\n\n bytes32 public constant BALLOT_TYPEHASH =\n keccak256(\"Ballot(uint256 proposalId,uint8 support,address voter,uint256 nonce)\");\n bytes32 public constant EXTENDED_BALLOT_TYPEHASH =\n keccak256(\n \"ExtendedBallot(uint256 proposalId,uint8 support,address voter,uint256 nonce,string reason,bytes params)\"\n );\n\n struct ProposalCore {\n address proposer;\n uint48 voteStart;\n uint32 voteDuration;\n bool executed;\n bool canceled;\n uint48 etaSeconds;\n }\n\n bytes32 private constant ALL_PROPOSAL_STATES_BITMAP = bytes32((2 ** (uint8(type(ProposalState).max) + 1)) - 1);\n string private _name;\n\n mapping(uint256 proposalId => ProposalCore) private _proposals;\n\n // This queue keeps track of the governor operating on itself. Calls to functions protected by the {onlyGovernance}\n // modifier needs to be whitelisted in this queue. Whitelisting is set in {execute}, consumed by the\n // {onlyGovernance} modifier and eventually reset after {_executeOperations} completes. This ensures that the\n // execution of {onlyGovernance} protected calls can only be achieved through successful proposals.\n DoubleEndedQueue.Bytes32Deque private _governanceCall;\n\n /**\n * @dev Restricts a function so it can only be executed through governance proposals. For example, governance\n * parameter setters in {GovernorSettings} are protected using this modifier.\n *\n * The governance executing address may be different from the Governor's own address, for example it could be a\n * timelock. This can be customized by modules by overriding {_executor}. The executor is only able to invoke these\n * functions during the execution of the governor's {execute} function, and not under any other circumstances. Thus,\n * for example, additional timelock proposers are not able to change governance parameters without going through the\n * governance protocol (since v4.6).\n */\n modifier onlyGovernance() {\n _checkGovernance();\n _;\n }\n\n /**\n * @dev Sets the value for {name} and {version}\n */\n constructor(string memory name_) EIP712(name_, version()) {\n _name = name_;\n }\n\n /**\n * @dev Function to receive ETH that will be handled by the governor (disabled if executor is a third party contract)\n */\n receive() external payable virtual {\n if (_executor() != address(this)) {\n revert GovernorDisabledDeposit();\n }\n }\n\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165, ERC165) returns (bool) {\n return\n interfaceId == type(IGovernor).interfaceId ||\n interfaceId == type(IERC1155Receiver).interfaceId ||\n super.supportsInterface(interfaceId);\n }\n\n /**\n * @dev See {IGovernor-name}.\n */\n function name() public view virtual returns (string memory) {\n return _name;\n }\n\n /**\n * @dev See {IGovernor-version}.\n */\n function version() public view virtual returns (string memory) {\n return \"1\";\n }\n\n /**\n * @dev See {IGovernor-hashProposal}.\n *\n * The proposal id is produced by hashing the ABI encoded `targets` array, the `values` array, the `calldatas` array\n * and the descriptionHash (bytes32 which itself is the keccak256 hash of the description string). This proposal id\n * can be produced from the proposal data which is part of the {ProposalCreated} event. It can even be computed in\n * advance, before the proposal is submitted.\n *\n * Note that the chainId and the governor address are not part of the proposal id computation. Consequently, the\n * same proposal (with same operation and same description) will have the same id if submitted on multiple governors\n * across multiple networks. This also means that in order to execute the same operation twice (on the same\n * governor) the proposer will have to change the description in order to avoid proposal id conflicts.\n */\n function hashProposal(\n address[] memory targets,\n uint256[] memory values,\n bytes[] memory calldatas,\n bytes32 descriptionHash\n ) public pure virtual returns (uint256) {\n return uint256(keccak256(abi.encode(targets, values, calldatas, descriptionHash)));\n }\n\n /**\n * @dev See {IGovernor-state}.\n */\n function state(uint256 proposalId) public view virtual returns (ProposalState) {\n // We read the struct fields into the stack at once so Solidity emits a single SLOAD\n ProposalCore storage proposal = _proposals[proposalId];\n bool proposalExecuted = proposal.executed;\n bool proposalCanceled = proposal.canceled;\n\n if (proposalExecuted) {\n return ProposalState.Executed;\n }\n\n if (proposalCanceled) {\n return ProposalState.Canceled;\n }\n\n uint256 snapshot = proposalSnapshot(proposalId);\n\n if (snapshot == 0) {\n revert GovernorNonexistentProposal(proposalId);\n }\n\n uint256 currentTimepoint = clock();\n\n if (snapshot >= currentTimepoint) {\n return ProposalState.Pending;\n }\n\n uint256 deadline = proposalDeadline(proposalId);\n\n if (deadline >= currentTimepoint) {\n return ProposalState.Active;\n } else if (!_quorumReached(proposalId) || !_voteSucceeded(proposalId)) {\n return ProposalState.Defeated;\n } else if (proposalEta(proposalId) == 0) {\n return ProposalState.Succeeded;\n } else {\n return ProposalState.Queued;\n }\n }\n\n /**\n * @dev See {IGovernor-proposalThreshold}.\n */\n function proposalThreshold() public view virtual returns (uint256) {\n return 0;\n }\n\n /**\n * @dev See {IGovernor-proposalSnapshot}.\n */\n function proposalSnapshot(uint256 proposalId) public view virtual returns (uint256) {\n return _proposals[proposalId].voteStart;\n }\n\n /**\n * @dev See {IGovernor-proposalDeadline}.\n */\n function proposalDeadline(uint256 proposalId) public view virtual returns (uint256) {\n return _proposals[proposalId].voteStart + _proposals[proposalId].voteDuration;\n }\n\n /**\n * @dev See {IGovernor-proposalProposer}.\n */\n function proposalProposer(uint256 proposalId) public view virtual returns (address) {\n return _proposals[proposalId].proposer;\n }\n\n /**\n * @dev See {IGovernor-proposalEta}.\n */\n function proposalEta(uint256 proposalId) public view virtual returns (uint256) {\n return _proposals[proposalId].etaSeconds;\n }\n\n /**\n * @dev See {IGovernor-proposalNeedsQueuing}.\n */\n function proposalNeedsQueuing(uint256) public view virtual returns (bool) {\n return false;\n }\n\n /**\n * @dev Reverts if the `msg.sender` is not the executor. In case the executor is not this contract\n * itself, the function reverts if `msg.data` is not whitelisted as a result of an {execute}\n * operation. See {onlyGovernance}.\n */\n function _checkGovernance() internal virtual {\n if (_executor() != _msgSender()) {\n revert GovernorOnlyExecutor(_msgSender());\n }\n if (_executor() != address(this)) {\n bytes32 msgDataHash = keccak256(_msgData());\n // loop until popping the expected operation - throw if deque is empty (operation not authorized)\n while (_governanceCall.popFront() != msgDataHash) {}\n }\n }\n\n /**\n * @dev Amount of votes already cast passes the threshold limit.\n */\n function _quorumReached(uint256 proposalId) internal view virtual returns (bool);\n\n /**\n * @dev Is the proposal successful or not.\n */\n function _voteSucceeded(uint256 proposalId) internal view virtual returns (bool);\n\n /**\n * @dev Get the voting weight of `account` at a specific `timepoint`, for a vote as described by `params`.\n */\n function _getVotes(address account, uint256 timepoint, bytes memory params) internal view virtual returns (uint256);\n\n /**\n * @dev Register a vote for `proposalId` by `account` with a given `support`, voting `weight` and voting `params`.\n *\n * Note: Support is generic and can represent various things depending on the voting system used.\n */\n function _countVote(\n uint256 proposalId,\n address account,\n uint8 support,\n uint256 totalWeight,\n bytes memory params\n ) internal virtual returns (uint256);\n\n /**\n * @dev Default additional encoded parameters used by castVote methods that don't include them\n *\n * Note: Should be overridden by specific implementations to use an appropriate value, the\n * meaning of the additional params, in the context of that implementation\n */\n function _defaultParams() internal view virtual returns (bytes memory) {\n return \"\";\n }\n\n /**\n * @dev See {IGovernor-propose}. This function has opt-in frontrunning protection, described in {_isValidDescriptionForProposer}.\n */\n function propose(\n address[] memory targets,\n uint256[] memory values,\n bytes[] memory calldatas,\n string memory description\n ) public virtual returns (uint256) {\n address proposer = _msgSender();\n\n // check description restriction\n if (!_isValidDescriptionForProposer(proposer, description)) {\n revert GovernorRestrictedProposer(proposer);\n }\n\n // check proposal threshold\n uint256 votesThreshold = proposalThreshold();\n if (votesThreshold > 0) {\n uint256 proposerVotes = getVotes(proposer, clock() - 1);\n if (proposerVotes < votesThreshold) {\n revert GovernorInsufficientProposerVotes(proposer, proposerVotes, votesThreshold);\n }\n }\n\n return _propose(targets, values, calldatas, description, proposer);\n }\n\n /**\n * @dev Internal propose mechanism. Can be overridden to add more logic on proposal creation.\n *\n * Emits a {IGovernor-ProposalCreated} event.\n */\n function _propose(\n address[] memory targets,\n uint256[] memory values,\n bytes[] memory calldatas,\n string memory description,\n address proposer\n ) internal virtual returns (uint256 proposalId) {\n proposalId = hashProposal(targets, values, calldatas, keccak256(bytes(description)));\n\n if (targets.length != values.length || targets.length != calldatas.length || targets.length == 0) {\n revert GovernorInvalidProposalLength(targets.length, calldatas.length, values.length);\n }\n if (_proposals[proposalId].voteStart != 0) {\n revert GovernorUnexpectedProposalState(proposalId, state(proposalId), bytes32(0));\n }\n\n uint256 snapshot = clock() + votingDelay();\n uint256 duration = votingPeriod();\n\n ProposalCore storage proposal = _proposals[proposalId];\n proposal.proposer = proposer;\n proposal.voteStart = SafeCast.toUint48(snapshot);\n proposal.voteDuration = SafeCast.toUint32(duration);\n\n emit ProposalCreated(\n proposalId,\n proposer,\n targets,\n values,\n new string[](targets.length),\n calldatas,\n snapshot,\n snapshot + duration,\n description\n );\n\n // Using a named return variable to avoid stack too deep errors\n }\n\n /**\n * @dev See {IGovernor-queue}.\n */\n function queue(\n address[] memory targets,\n uint256[] memory values,\n bytes[] memory calldatas,\n bytes32 descriptionHash\n ) public virtual returns (uint256) {\n uint256 proposalId = hashProposal(targets, values, calldatas, descriptionHash);\n\n _validateStateBitmap(proposalId, _encodeStateBitmap(ProposalState.Succeeded));\n\n uint48 etaSeconds = _queueOperations(proposalId, targets, values, calldatas, descriptionHash);\n\n if (etaSeconds != 0) {\n _proposals[proposalId].etaSeconds = etaSeconds;\n emit ProposalQueued(proposalId, etaSeconds);\n } else {\n revert GovernorQueueNotImplemented();\n }\n\n return proposalId;\n }\n\n /**\n * @dev Internal queuing mechanism. Can be overridden (without a super call) to modify the way queuing is\n * performed (for example adding a vault/timelock).\n *\n * This is empty by default, and must be overridden to implement queuing.\n *\n * This function returns a timestamp that describes the expected ETA for execution. If the returned value is 0\n * (which is the default value), the core will consider queueing did not succeed, and the public {queue} function\n * will revert.\n *\n * NOTE: Calling this function directly will NOT check the current state of the proposal, or emit the\n * `ProposalQueued` event. Queuing a proposal should be done using {queue}.\n */\n function _queueOperations(\n uint256 /*proposalId*/,\n address[] memory /*targets*/,\n uint256[] memory /*values*/,\n bytes[] memory /*calldatas*/,\n bytes32 /*descriptionHash*/\n ) internal virtual returns (uint48) {\n return 0;\n }\n\n /**\n * @dev See {IGovernor-execute}.\n */\n function execute(\n address[] memory targets,\n uint256[] memory values,\n bytes[] memory calldatas,\n bytes32 descriptionHash\n ) public payable virtual returns (uint256) {\n uint256 proposalId = hashProposal(targets, values, calldatas, descriptionHash);\n\n _validateStateBitmap(\n proposalId,\n _encodeStateBitmap(ProposalState.Succeeded) | _encodeStateBitmap(ProposalState.Queued)\n );\n\n // mark as executed before calls to avoid reentrancy\n _proposals[proposalId].executed = true;\n\n // before execute: register governance call in queue.\n if (_executor() != address(this)) {\n for (uint256 i = 0; i < targets.length; ++i) {\n if (targets[i] == address(this)) {\n _governanceCall.pushBack(keccak256(calldatas[i]));\n }\n }\n }\n\n _executeOperations(proposalId, targets, values, calldatas, descriptionHash);\n\n // after execute: cleanup governance call queue.\n if (_executor() != address(this) && !_governanceCall.empty()) {\n _governanceCall.clear();\n }\n\n emit ProposalExecuted(proposalId);\n\n return proposalId;\n }\n\n /**\n * @dev Internal execution mechanism. Can be overridden (without a super call) to modify the way execution is\n * performed (for example adding a vault/timelock).\n *\n * NOTE: Calling this function directly will NOT check the current state of the proposal, set the executed flag to\n * true or emit the `ProposalExecuted` event. Executing a proposal should be done using {execute} or {_execute}.\n */\n function _executeOperations(\n uint256 /* proposalId */,\n address[] memory targets,\n uint256[] memory values,\n bytes[] memory calldatas,\n bytes32 /*descriptionHash*/\n ) internal virtual {\n for (uint256 i = 0; i < targets.length; ++i) {\n (bool success, bytes memory returndata) = targets[i].call{value: values[i]}(calldatas[i]);\n Address.verifyCallResult(success, returndata);\n }\n }\n\n /**\n * @dev See {IGovernor-cancel}.\n */\n function cancel(\n address[] memory targets,\n uint256[] memory values,\n bytes[] memory calldatas,\n bytes32 descriptionHash\n ) public virtual returns (uint256) {\n // The proposalId will be recomputed in the `_cancel` call further down. However we need the value before we\n // do the internal call, because we need to check the proposal state BEFORE the internal `_cancel` call\n // changes it. The `hashProposal` duplication has a cost that is limited, and that we accept.\n uint256 proposalId = hashProposal(targets, values, calldatas, descriptionHash);\n\n // public cancel restrictions (on top of existing _cancel restrictions).\n _validateStateBitmap(proposalId, _encodeStateBitmap(ProposalState.Pending));\n if (_msgSender() != proposalProposer(proposalId)) {\n revert GovernorOnlyProposer(_msgSender());\n }\n\n return _cancel(targets, values, calldatas, descriptionHash);\n }\n\n /**\n * @dev Internal cancel mechanism with minimal restrictions. A proposal can be cancelled in any state other than\n * Canceled, Expired, or Executed. Once cancelled a proposal can't be re-submitted.\n *\n * Emits a {IGovernor-ProposalCanceled} event.\n */\n function _cancel(\n address[] memory targets,\n uint256[] memory values,\n bytes[] memory calldatas,\n bytes32 descriptionHash\n ) internal virtual returns (uint256) {\n uint256 proposalId = hashProposal(targets, values, calldatas, descriptionHash);\n\n _validateStateBitmap(\n proposalId,\n ALL_PROPOSAL_STATES_BITMAP ^\n _encodeStateBitmap(ProposalState.Canceled) ^\n _encodeStateBitmap(ProposalState.Expired) ^\n _encodeStateBitmap(ProposalState.Executed)\n );\n\n _proposals[proposalId].canceled = true;\n emit ProposalCanceled(proposalId);\n\n return proposalId;\n }\n\n /**\n * @dev See {IGovernor-getVotes}.\n */\n function getVotes(address account, uint256 timepoint) public view virtual returns (uint256) {\n return _getVotes(account, timepoint, _defaultParams());\n }\n\n /**\n * @dev See {IGovernor-getVotesWithParams}.\n */\n function getVotesWithParams(\n address account,\n uint256 timepoint,\n bytes memory params\n ) public view virtual returns (uint256) {\n return _getVotes(account, timepoint, params);\n }\n\n /**\n * @dev See {IGovernor-castVote}.\n */\n function castVote(uint256 proposalId, uint8 support) public virtual returns (uint256) {\n address voter = _msgSender();\n return _castVote(proposalId, voter, support, \"\");\n }\n\n /**\n * @dev See {IGovernor-castVoteWithReason}.\n */\n function castVoteWithReason(\n uint256 proposalId,\n uint8 support,\n string calldata reason\n ) public virtual returns (uint256) {\n address voter = _msgSender();\n return _castVote(proposalId, voter, support, reason);\n }\n\n /**\n * @dev See {IGovernor-castVoteWithReasonAndParams}.\n */\n function castVoteWithReasonAndParams(\n uint256 proposalId,\n uint8 support,\n string calldata reason,\n bytes memory params\n ) public virtual returns (uint256) {\n address voter = _msgSender();\n return _castVote(proposalId, voter, support, reason, params);\n }\n\n /**\n * @dev See {IGovernor-castVoteBySig}.\n */\n function castVoteBySig(\n uint256 proposalId,\n uint8 support,\n address voter,\n bytes memory signature\n ) public virtual returns (uint256) {\n bool valid = SignatureChecker.isValidSignatureNow(\n voter,\n _hashTypedDataV4(keccak256(abi.encode(BALLOT_TYPEHASH, proposalId, support, voter, _useNonce(voter)))),\n signature\n );\n\n if (!valid) {\n revert GovernorInvalidSignature(voter);\n }\n\n return _castVote(proposalId, voter, support, \"\");\n }\n\n /**\n * @dev See {IGovernor-castVoteWithReasonAndParamsBySig}.\n */\n function castVoteWithReasonAndParamsBySig(\n uint256 proposalId,\n uint8 support,\n address voter,\n string calldata reason,\n bytes memory params,\n bytes memory signature\n ) public virtual returns (uint256) {\n bool valid = SignatureChecker.isValidSignatureNow(\n voter,\n _hashTypedDataV4(\n keccak256(\n abi.encode(\n EXTENDED_BALLOT_TYPEHASH,\n proposalId,\n support,\n voter,\n _useNonce(voter),\n keccak256(bytes(reason)),\n keccak256(params)\n )\n )\n ),\n signature\n );\n\n if (!valid) {\n revert GovernorInvalidSignature(voter);\n }\n\n return _castVote(proposalId, voter, support, reason, params);\n }\n\n /**\n * @dev Internal vote casting mechanism: Check that the vote is pending, that it has not been cast yet, retrieve\n * voting weight using {IGovernor-getVotes} and call the {_countVote} internal function. Uses the _defaultParams().\n *\n * Emits a {IGovernor-VoteCast} event.\n */\n function _castVote(\n uint256 proposalId,\n address account,\n uint8 support,\n string memory reason\n ) internal virtual returns (uint256) {\n return _castVote(proposalId, account, support, reason, _defaultParams());\n }\n\n /**\n * @dev Internal vote casting mechanism: Check that the vote is pending, that it has not been cast yet, retrieve\n * voting weight using {IGovernor-getVotes} and call the {_countVote} internal function.\n *\n * Emits a {IGovernor-VoteCast} event.\n */\n function _castVote(\n uint256 proposalId,\n address account,\n uint8 support,\n string memory reason,\n bytes memory params\n ) internal virtual returns (uint256) {\n _validateStateBitmap(proposalId, _encodeStateBitmap(ProposalState.Active));\n\n uint256 totalWeight = _getVotes(account, proposalSnapshot(proposalId), params);\n uint256 votedWeight = _countVote(proposalId, account, support, totalWeight, params);\n\n if (params.length == 0) {\n emit VoteCast(account, proposalId, support, votedWeight, reason);\n } else {\n emit VoteCastWithParams(account, proposalId, support, votedWeight, reason, params);\n }\n\n return votedWeight;\n }\n\n /**\n * @dev Relays a transaction or function call to an arbitrary target. In cases where the governance executor\n * is some contract other than the governor itself, like when using a timelock, this function can be invoked\n * in a governance proposal to recover tokens or Ether that was sent to the governor contract by mistake.\n * Note that if the executor is simply the governor itself, use of `relay` is redundant.\n */\n function relay(address target, uint256 value, bytes calldata data) external payable virtual onlyGovernance {\n (bool success, bytes memory returndata) = target.call{value: value}(data);\n Address.verifyCallResult(success, returndata);\n }\n\n /**\n * @dev Address through which the governor executes action. Will be overloaded by module that execute actions\n * through another contract such as a timelock.\n */\n function _executor() internal view virtual returns (address) {\n return address(this);\n }\n\n /**\n * @dev See {IERC721Receiver-onERC721Received}.\n * Receiving tokens is disabled if the governance executor is other than the governor itself (eg. when using with a timelock).\n */\n function onERC721Received(address, address, uint256, bytes memory) public virtual returns (bytes4) {\n if (_executor() != address(this)) {\n revert GovernorDisabledDeposit();\n }\n return this.onERC721Received.selector;\n }\n\n /**\n * @dev See {IERC1155Receiver-onERC1155Received}.\n * Receiving tokens is disabled if the governance executor is other than the governor itself (eg. when using with a timelock).\n */\n function onERC1155Received(address, address, uint256, uint256, bytes memory) public virtual returns (bytes4) {\n if (_executor() != address(this)) {\n revert GovernorDisabledDeposit();\n }\n return this.onERC1155Received.selector;\n }\n\n /**\n * @dev See {IERC1155Receiver-onERC1155BatchReceived}.\n * Receiving tokens is disabled if the governance executor is other than the governor itself (eg. when using with a timelock).\n */\n function onERC1155BatchReceived(\n address,\n address,\n uint256[] memory,\n uint256[] memory,\n bytes memory\n ) public virtual returns (bytes4) {\n if (_executor() != address(this)) {\n revert GovernorDisabledDeposit();\n }\n return this.onERC1155BatchReceived.selector;\n }\n\n /**\n * @dev Encodes a `ProposalState` into a `bytes32` representation where each bit enabled corresponds to\n * the underlying position in the `ProposalState` enum. For example:\n *\n * 0x000...10000\n * ^^^^^^------ ...\n * ^----- Succeeded\n * ^---- Defeated\n * ^--- Canceled\n * ^-- Active\n * ^- Pending\n */\n function _encodeStateBitmap(ProposalState proposalState) internal pure returns (bytes32) {\n return bytes32(1 << uint8(proposalState));\n }\n\n /**\n * @dev Check that the current state of a proposal matches the requirements described by the `allowedStates` bitmap.\n * This bitmap should be built using `_encodeStateBitmap`.\n *\n * If requirements are not met, reverts with a {GovernorUnexpectedProposalState} error.\n */\n function _validateStateBitmap(uint256 proposalId, bytes32 allowedStates) private view returns (ProposalState) {\n ProposalState currentState = state(proposalId);\n if (_encodeStateBitmap(currentState) & allowedStates == bytes32(0)) {\n revert GovernorUnexpectedProposalState(proposalId, currentState, allowedStates);\n }\n return currentState;\n }\n\n /*\n * @dev Check if the proposer is authorized to submit a proposal with the given description.\n *\n * If the proposal description ends with `#proposer=0x???`, where `0x???` is an address written as a hex string\n * (case insensitive), then the submission of this proposal will only be authorized to said address.\n *\n * This is used for frontrunning protection. By adding this pattern at the end of their proposal, one can ensure\n * that no other address can submit the same proposal. An attacker would have to either remove or change that part,\n * which would result in a different proposal id.\n *\n * If the description does not match this pattern, it is unrestricted and anyone can submit it. This includes:\n * - If the `0x???` part is not a valid hex string.\n * - If the `0x???` part is a valid hex string, but does not contain exactly 40 hex digits.\n * - If it ends with the expected suffix followed by newlines or other whitespace.\n * - If it ends with some other similar suffix, e.g. `#other=abc`.\n * - If it does not end with any such suffix.\n */\n function _isValidDescriptionForProposer(\n address proposer,\n string memory description\n ) internal view virtual returns (bool) {\n uint256 len = bytes(description).length;\n\n // Length is too short to contain a valid proposer suffix\n if (len < 52) {\n return true;\n }\n\n // Extract what would be the `#proposer=0x` marker beginning the suffix\n bytes12 marker;\n assembly (\"memory-safe\") {\n // - Start of the string contents in memory = description + 32\n // - First character of the marker = len - 52\n // - Length of \"#proposer=0x0000000000000000000000000000000000000000\" = 52\n // - We read the memory word starting at the first character of the marker:\n // - (description + 32) + (len - 52) = description + (len - 20)\n // - Note: Solidity will ignore anything past the first 12 bytes\n marker := mload(add(description, sub(len, 20)))\n }\n\n // If the marker is not found, there is no proposer suffix to check\n if (marker != bytes12(\"#proposer=0x\")) {\n return true;\n }\n\n // Parse the 40 characters following the marker as uint160\n uint160 recovered = 0;\n for (uint256 i = len - 40; i < len; ++i) {\n (bool isHex, uint8 value) = _tryHexToUint(bytes(description)[i]);\n // If any of the characters is not a hex digit, ignore the suffix entirely\n if (!isHex) {\n return true;\n }\n recovered = (recovered << 4) | value;\n }\n\n return recovered == uint160(proposer);\n }\n\n /**\n * @dev Try to parse a character from a string as a hex value. Returns `(true, value)` if the char is in\n * `[0-9a-fA-F]` and `(false, 0)` otherwise. Value is guaranteed to be in the range `0 <= value < 16`\n */\n function _tryHexToUint(bytes1 char) private pure returns (bool isHex, uint8 value) {\n uint8 c = uint8(char);\n unchecked {\n // Case 0-9\n if (47 < c && c < 58) {\n return (true, c - 48);\n }\n // Case A-F\n else if (64 < c && c < 71) {\n return (true, c - 55);\n }\n // Case a-f\n else if (96 < c && c < 103) {\n return (true, c - 87);\n }\n // Else: not a hex char\n else {\n return (false, 0);\n }\n }\n }\n\n /**\n * @inheritdoc IERC6372\n */\n function clock() public view virtual returns (uint48);\n\n /**\n * @inheritdoc IERC6372\n */\n // solhint-disable-next-line func-name-mixedcase\n function CLOCK_MODE() public view virtual returns (string memory);\n\n /**\n * @inheritdoc IGovernor\n */\n function votingDelay() public view virtual returns (uint256);\n\n /**\n * @inheritdoc IGovernor\n */\n function votingPeriod() public view virtual returns (uint256);\n\n /**\n * @inheritdoc IGovernor\n */\n function quorum(uint256 timepoint) public view virtual returns (uint256);\n}\n" + }, + "@openzeppelin/contracts/governance/IGovernor.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (governance/IGovernor.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC165} from \"../interfaces/IERC165.sol\";\nimport {IERC6372} from \"../interfaces/IERC6372.sol\";\n\n/**\n * @dev Interface of the {Governor} core.\n *\n * NOTE: Event parameters lack the `indexed` keyword for compatibility with GovernorBravo events.\n * Making event parameters `indexed` affects how events are decoded, potentially breaking existing indexers.\n */\ninterface IGovernor is IERC165, IERC6372 {\n enum ProposalState {\n Pending,\n Active,\n Canceled,\n Defeated,\n Succeeded,\n Queued,\n Expired,\n Executed\n }\n\n /**\n * @dev Empty proposal or a mismatch between the parameters length for a proposal call.\n */\n error GovernorInvalidProposalLength(uint256 targets, uint256 calldatas, uint256 values);\n\n /**\n * @dev The vote was already cast.\n */\n error GovernorAlreadyCastVote(address voter);\n\n /**\n * @dev Token deposits are disabled in this contract.\n */\n error GovernorDisabledDeposit();\n\n /**\n * @dev The `account` is not a proposer.\n */\n error GovernorOnlyProposer(address account);\n\n /**\n * @dev The `account` is not the governance executor.\n */\n error GovernorOnlyExecutor(address account);\n\n /**\n * @dev The `proposalId` doesn't exist.\n */\n error GovernorNonexistentProposal(uint256 proposalId);\n\n /**\n * @dev The current state of a proposal is not the required for performing an operation.\n * The `expectedStates` is a bitmap with the bits enabled for each ProposalState enum position\n * counting from right to left.\n *\n * NOTE: If `expectedState` is `bytes32(0)`, the proposal is expected to not be in any state (i.e. not exist).\n * This is the case when a proposal that is expected to be unset is already initiated (the proposal is duplicated).\n *\n * See {Governor-_encodeStateBitmap}.\n */\n error GovernorUnexpectedProposalState(uint256 proposalId, ProposalState current, bytes32 expectedStates);\n\n /**\n * @dev The voting period set is not a valid period.\n */\n error GovernorInvalidVotingPeriod(uint256 votingPeriod);\n\n /**\n * @dev The `proposer` does not have the required votes to create a proposal.\n */\n error GovernorInsufficientProposerVotes(address proposer, uint256 votes, uint256 threshold);\n\n /**\n * @dev The `proposer` is not allowed to create a proposal.\n */\n error GovernorRestrictedProposer(address proposer);\n\n /**\n * @dev The vote type used is not valid for the corresponding counting module.\n */\n error GovernorInvalidVoteType();\n\n /**\n * @dev The provided params buffer is not supported by the counting module.\n */\n error GovernorInvalidVoteParams();\n\n /**\n * @dev Queue operation is not implemented for this governor. Execute should be called directly.\n */\n error GovernorQueueNotImplemented();\n\n /**\n * @dev The proposal hasn't been queued yet.\n */\n error GovernorNotQueuedProposal(uint256 proposalId);\n\n /**\n * @dev The proposal has already been queued.\n */\n error GovernorAlreadyQueuedProposal(uint256 proposalId);\n\n /**\n * @dev The provided signature is not valid for the expected `voter`.\n * If the `voter` is a contract, the signature is not valid using {IERC1271-isValidSignature}.\n */\n error GovernorInvalidSignature(address voter);\n\n /**\n * @dev Emitted when a proposal is created.\n */\n event ProposalCreated(\n uint256 proposalId,\n address proposer,\n address[] targets,\n uint256[] values,\n string[] signatures,\n bytes[] calldatas,\n uint256 voteStart,\n uint256 voteEnd,\n string description\n );\n\n /**\n * @dev Emitted when a proposal is queued.\n */\n event ProposalQueued(uint256 proposalId, uint256 etaSeconds);\n\n /**\n * @dev Emitted when a proposal is executed.\n */\n event ProposalExecuted(uint256 proposalId);\n\n /**\n * @dev Emitted when a proposal is canceled.\n */\n event ProposalCanceled(uint256 proposalId);\n\n /**\n * @dev Emitted when a vote is cast without params.\n *\n * Note: `support` values should be seen as buckets. Their interpretation depends on the voting module used.\n */\n event VoteCast(address indexed voter, uint256 proposalId, uint8 support, uint256 weight, string reason);\n\n /**\n * @dev Emitted when a vote is cast with params.\n *\n * Note: `support` values should be seen as buckets. Their interpretation depends on the voting module used.\n * `params` are additional encoded parameters. Their interpretation also depends on the voting module used.\n */\n event VoteCastWithParams(\n address indexed voter,\n uint256 proposalId,\n uint8 support,\n uint256 weight,\n string reason,\n bytes params\n );\n\n /**\n * @notice module:core\n * @dev Name of the governor instance (used in building the EIP-712 domain separator).\n */\n function name() external view returns (string memory);\n\n /**\n * @notice module:core\n * @dev Version of the governor instance (used in building the EIP-712 domain separator). Default: \"1\"\n */\n function version() external view returns (string memory);\n\n /**\n * @notice module:voting\n * @dev A description of the possible `support` values for {castVote} and the way these votes are counted, meant to\n * be consumed by UIs to show correct vote options and interpret the results. The string is a URL-encoded sequence of\n * key-value pairs that each describe one aspect, for example `support=bravo&quorum=for,abstain`.\n *\n * There are 2 standard keys: `support` and `quorum`.\n *\n * - `support=bravo` refers to the vote options 0 = Against, 1 = For, 2 = Abstain, as in `GovernorBravo`.\n * - `quorum=bravo` means that only For votes are counted towards quorum.\n * - `quorum=for,abstain` means that both For and Abstain votes are counted towards quorum.\n *\n * If a counting module makes use of encoded `params`, it should include this under a `params` key with a unique\n * name that describes the behavior. For example:\n *\n * - `params=fractional` might refer to a scheme where votes are divided fractionally between for/against/abstain.\n * - `params=erc721` might refer to a scheme where specific NFTs are delegated to vote.\n *\n * NOTE: The string can be decoded by the standard\n * https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams[`URLSearchParams`]\n * JavaScript class.\n */\n // solhint-disable-next-line func-name-mixedcase\n function COUNTING_MODE() external view returns (string memory);\n\n /**\n * @notice module:core\n * @dev Hashing function used to (re)build the proposal id from the proposal details..\n */\n function hashProposal(\n address[] memory targets,\n uint256[] memory values,\n bytes[] memory calldatas,\n bytes32 descriptionHash\n ) external pure returns (uint256);\n\n /**\n * @notice module:core\n * @dev Current state of a proposal, following Compound's convention\n */\n function state(uint256 proposalId) external view returns (ProposalState);\n\n /**\n * @notice module:core\n * @dev The number of votes required in order for a voter to become a proposer.\n */\n function proposalThreshold() external view returns (uint256);\n\n /**\n * @notice module:core\n * @dev Timepoint used to retrieve user's votes and quorum. If using block number (as per Compound's Comp), the\n * snapshot is performed at the end of this block. Hence, voting for this proposal starts at the beginning of the\n * following block.\n */\n function proposalSnapshot(uint256 proposalId) external view returns (uint256);\n\n /**\n * @notice module:core\n * @dev Timepoint at which votes close. If using block number, votes close at the end of this block, so it is\n * possible to cast a vote during this block.\n */\n function proposalDeadline(uint256 proposalId) external view returns (uint256);\n\n /**\n * @notice module:core\n * @dev The account that created a proposal.\n */\n function proposalProposer(uint256 proposalId) external view returns (address);\n\n /**\n * @notice module:core\n * @dev The time when a queued proposal becomes executable (\"ETA\"). Unlike {proposalSnapshot} and\n * {proposalDeadline}, this doesn't use the governor clock, and instead relies on the executor's clock which may be\n * different. In most cases this will be a timestamp.\n */\n function proposalEta(uint256 proposalId) external view returns (uint256);\n\n /**\n * @notice module:core\n * @dev Whether a proposal needs to be queued before execution.\n */\n function proposalNeedsQueuing(uint256 proposalId) external view returns (bool);\n\n /**\n * @notice module:user-config\n * @dev Delay, between the proposal is created and the vote starts. The unit this duration is expressed in depends\n * on the clock (see ERC-6372) this contract uses.\n *\n * This can be increased to leave time for users to buy voting power, or delegate it, before the voting of a\n * proposal starts.\n *\n * NOTE: While this interface returns a uint256, timepoints are stored as uint48 following the ERC-6372 clock type.\n * Consequently this value must fit in a uint48 (when added to the current clock). See {IERC6372-clock}.\n */\n function votingDelay() external view returns (uint256);\n\n /**\n * @notice module:user-config\n * @dev Delay between the vote start and vote end. The unit this duration is expressed in depends on the clock\n * (see ERC-6372) this contract uses.\n *\n * NOTE: The {votingDelay} can delay the start of the vote. This must be considered when setting the voting\n * duration compared to the voting delay.\n *\n * NOTE: This value is stored when the proposal is submitted so that possible changes to the value do not affect\n * proposals that have already been submitted. The type used to save it is a uint32. Consequently, while this\n * interface returns a uint256, the value it returns should fit in a uint32.\n */\n function votingPeriod() external view returns (uint256);\n\n /**\n * @notice module:user-config\n * @dev Minimum number of cast voted required for a proposal to be successful.\n *\n * NOTE: The `timepoint` parameter corresponds to the snapshot used for counting vote. This allows to scale the\n * quorum depending on values such as the totalSupply of a token at this timepoint (see {ERC20Votes}).\n */\n function quorum(uint256 timepoint) external view returns (uint256);\n\n /**\n * @notice module:reputation\n * @dev Voting power of an `account` at a specific `timepoint`.\n *\n * Note: this can be implemented in a number of ways, for example by reading the delegated balance from one (or\n * multiple), {ERC20Votes} tokens.\n */\n function getVotes(address account, uint256 timepoint) external view returns (uint256);\n\n /**\n * @notice module:reputation\n * @dev Voting power of an `account` at a specific `timepoint` given additional encoded parameters.\n */\n function getVotesWithParams(\n address account,\n uint256 timepoint,\n bytes memory params\n ) external view returns (uint256);\n\n /**\n * @notice module:voting\n * @dev Returns whether `account` has cast a vote on `proposalId`.\n */\n function hasVoted(uint256 proposalId, address account) external view returns (bool);\n\n /**\n * @dev Create a new proposal. Vote start after a delay specified by {IGovernor-votingDelay} and lasts for a\n * duration specified by {IGovernor-votingPeriod}.\n *\n * Emits a {ProposalCreated} event.\n *\n * NOTE: The state of the Governor and `targets` may change between the proposal creation and its execution.\n * This may be the result of third party actions on the targeted contracts, or other governor proposals.\n * For example, the balance of this contract could be updated or its access control permissions may be modified,\n * possibly compromising the proposal's ability to execute successfully (e.g. the governor doesn't have enough\n * value to cover a proposal with multiple transfers).\n */\n function propose(\n address[] memory targets,\n uint256[] memory values,\n bytes[] memory calldatas,\n string memory description\n ) external returns (uint256 proposalId);\n\n /**\n * @dev Queue a proposal. Some governors require this step to be performed before execution can happen. If queuing\n * is not necessary, this function may revert.\n * Queuing a proposal requires the quorum to be reached, the vote to be successful, and the deadline to be reached.\n *\n * Emits a {ProposalQueued} event.\n */\n function queue(\n address[] memory targets,\n uint256[] memory values,\n bytes[] memory calldatas,\n bytes32 descriptionHash\n ) external returns (uint256 proposalId);\n\n /**\n * @dev Execute a successful proposal. This requires the quorum to be reached, the vote to be successful, and the\n * deadline to be reached. Depending on the governor it might also be required that the proposal was queued and\n * that some delay passed.\n *\n * Emits a {ProposalExecuted} event.\n *\n * NOTE: Some modules can modify the requirements for execution, for example by adding an additional timelock.\n */\n function execute(\n address[] memory targets,\n uint256[] memory values,\n bytes[] memory calldatas,\n bytes32 descriptionHash\n ) external payable returns (uint256 proposalId);\n\n /**\n * @dev Cancel a proposal. A proposal is cancellable by the proposer, but only while it is Pending state, i.e.\n * before the vote starts.\n *\n * Emits a {ProposalCanceled} event.\n */\n function cancel(\n address[] memory targets,\n uint256[] memory values,\n bytes[] memory calldatas,\n bytes32 descriptionHash\n ) external returns (uint256 proposalId);\n\n /**\n * @dev Cast a vote\n *\n * Emits a {VoteCast} event.\n */\n function castVote(uint256 proposalId, uint8 support) external returns (uint256 balance);\n\n /**\n * @dev Cast a vote with a reason\n *\n * Emits a {VoteCast} event.\n */\n function castVoteWithReason(\n uint256 proposalId,\n uint8 support,\n string calldata reason\n ) external returns (uint256 balance);\n\n /**\n * @dev Cast a vote with a reason and additional encoded parameters\n *\n * Emits a {VoteCast} or {VoteCastWithParams} event depending on the length of params.\n */\n function castVoteWithReasonAndParams(\n uint256 proposalId,\n uint8 support,\n string calldata reason,\n bytes memory params\n ) external returns (uint256 balance);\n\n /**\n * @dev Cast a vote using the voter's signature, including ERC-1271 signature support.\n *\n * Emits a {VoteCast} event.\n */\n function castVoteBySig(\n uint256 proposalId,\n uint8 support,\n address voter,\n bytes memory signature\n ) external returns (uint256 balance);\n\n /**\n * @dev Cast a vote with a reason and additional encoded parameters using the voter's signature,\n * including ERC-1271 signature support.\n *\n * Emits a {VoteCast} or {VoteCastWithParams} event depending on the length of params.\n */\n function castVoteWithReasonAndParamsBySig(\n uint256 proposalId,\n uint8 support,\n address voter,\n string calldata reason,\n bytes memory params,\n bytes memory signature\n ) external returns (uint256 balance);\n}\n" + }, + "@openzeppelin/contracts/governance/utils/IVotes.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (governance/utils/IVotes.sol)\npragma solidity ^0.8.20;\n\n/**\n * @dev Common interface for {ERC20Votes}, {ERC721Votes}, and other {Votes}-enabled contracts.\n */\ninterface IVotes {\n /**\n * @dev The signature used has expired.\n */\n error VotesExpiredSignature(uint256 expiry);\n\n /**\n * @dev Emitted when an account changes their delegate.\n */\n event DelegateChanged(address indexed delegator, address indexed fromDelegate, address indexed toDelegate);\n\n /**\n * @dev Emitted when a token transfer or delegate change results in changes to a delegate's number of voting units.\n */\n event DelegateVotesChanged(address indexed delegate, uint256 previousVotes, uint256 newVotes);\n\n /**\n * @dev Returns the current amount of votes that `account` has.\n */\n function getVotes(address account) external view returns (uint256);\n\n /**\n * @dev Returns the amount of votes that `account` had at a specific moment in the past. If the `clock()` is\n * configured to use block numbers, this will return the value at the end of the corresponding block.\n */\n function getPastVotes(address account, uint256 timepoint) external view returns (uint256);\n\n /**\n * @dev Returns the total supply of votes available at a specific moment in the past. If the `clock()` is\n * configured to use block numbers, this will return the value at the end of the corresponding block.\n *\n * NOTE: This value is the sum of all available votes, which is not necessarily the sum of all delegated votes.\n * Votes that have not been delegated are still part of total supply, even though they would not participate in a\n * vote.\n */\n function getPastTotalSupply(uint256 timepoint) external view returns (uint256);\n\n /**\n * @dev Returns the delegate that `account` has chosen.\n */\n function delegates(address account) external view returns (address);\n\n /**\n * @dev Delegates votes from the sender to `delegatee`.\n */\n function delegate(address delegatee) external;\n\n /**\n * @dev Delegates votes from signer to `delegatee`.\n */\n function delegateBySig(address delegatee, uint256 nonce, uint256 expiry, uint8 v, bytes32 r, bytes32 s) external;\n}\n" + }, + "@openzeppelin/contracts/governance/utils/Votes.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (governance/utils/Votes.sol)\npragma solidity ^0.8.20;\n\nimport {IERC5805} from \"../../interfaces/IERC5805.sol\";\nimport {Context} from \"../../utils/Context.sol\";\nimport {Nonces} from \"../../utils/Nonces.sol\";\nimport {EIP712} from \"../../utils/cryptography/EIP712.sol\";\nimport {Checkpoints} from \"../../utils/structs/Checkpoints.sol\";\nimport {SafeCast} from \"../../utils/math/SafeCast.sol\";\nimport {ECDSA} from \"../../utils/cryptography/ECDSA.sol\";\nimport {Time} from \"../../utils/types/Time.sol\";\n\n/**\n * @dev This is a base abstract contract that tracks voting units, which are a measure of voting power that can be\n * transferred, and provides a system of vote delegation, where an account can delegate its voting units to a sort of\n * \"representative\" that will pool delegated voting units from different accounts and can then use it to vote in\n * decisions. In fact, voting units _must_ be delegated in order to count as actual votes, and an account has to\n * delegate those votes to itself if it wishes to participate in decisions and does not have a trusted representative.\n *\n * This contract is often combined with a token contract such that voting units correspond to token units. For an\n * example, see {ERC721Votes}.\n *\n * The full history of delegate votes is tracked on-chain so that governance protocols can consider votes as distributed\n * at a particular block number to protect against flash loans and double voting. The opt-in delegate system makes the\n * cost of this history tracking optional.\n *\n * When using this module the derived contract must implement {_getVotingUnits} (for example, make it return\n * {ERC721-balanceOf}), and can use {_transferVotingUnits} to track a change in the distribution of those units (in the\n * previous example, it would be included in {ERC721-_update}).\n */\nabstract contract Votes is Context, EIP712, Nonces, IERC5805 {\n using Checkpoints for Checkpoints.Trace208;\n\n bytes32 private constant DELEGATION_TYPEHASH =\n keccak256(\"Delegation(address delegatee,uint256 nonce,uint256 expiry)\");\n\n mapping(address account => address) private _delegatee;\n\n mapping(address delegatee => Checkpoints.Trace208) private _delegateCheckpoints;\n\n Checkpoints.Trace208 private _totalCheckpoints;\n\n /**\n * @dev The clock was incorrectly modified.\n */\n error ERC6372InconsistentClock();\n\n /**\n * @dev Lookup to future votes is not available.\n */\n error ERC5805FutureLookup(uint256 timepoint, uint48 clock);\n\n /**\n * @dev Clock used for flagging checkpoints. Can be overridden to implement timestamp based\n * checkpoints (and voting), in which case {CLOCK_MODE} should be overridden as well to match.\n */\n function clock() public view virtual returns (uint48) {\n return Time.blockNumber();\n }\n\n /**\n * @dev Machine-readable description of the clock as specified in ERC-6372.\n */\n // solhint-disable-next-line func-name-mixedcase\n function CLOCK_MODE() public view virtual returns (string memory) {\n // Check that the clock was not modified\n if (clock() != Time.blockNumber()) {\n revert ERC6372InconsistentClock();\n }\n return \"mode=blocknumber&from=default\";\n }\n\n /**\n * @dev Returns the current amount of votes that `account` has.\n */\n function getVotes(address account) public view virtual returns (uint256) {\n return _delegateCheckpoints[account].latest();\n }\n\n /**\n * @dev Returns the amount of votes that `account` had at a specific moment in the past. If the `clock()` is\n * configured to use block numbers, this will return the value at the end of the corresponding block.\n *\n * Requirements:\n *\n * - `timepoint` must be in the past. If operating using block numbers, the block must be already mined.\n */\n function getPastVotes(address account, uint256 timepoint) public view virtual returns (uint256) {\n uint48 currentTimepoint = clock();\n if (timepoint >= currentTimepoint) {\n revert ERC5805FutureLookup(timepoint, currentTimepoint);\n }\n return _delegateCheckpoints[account].upperLookupRecent(SafeCast.toUint48(timepoint));\n }\n\n /**\n * @dev Returns the total supply of votes available at a specific moment in the past. If the `clock()` is\n * configured to use block numbers, this will return the value at the end of the corresponding block.\n *\n * NOTE: This value is the sum of all available votes, which is not necessarily the sum of all delegated votes.\n * Votes that have not been delegated are still part of total supply, even though they would not participate in a\n * vote.\n *\n * Requirements:\n *\n * - `timepoint` must be in the past. If operating using block numbers, the block must be already mined.\n */\n function getPastTotalSupply(uint256 timepoint) public view virtual returns (uint256) {\n uint48 currentTimepoint = clock();\n if (timepoint >= currentTimepoint) {\n revert ERC5805FutureLookup(timepoint, currentTimepoint);\n }\n return _totalCheckpoints.upperLookupRecent(SafeCast.toUint48(timepoint));\n }\n\n /**\n * @dev Returns the current total supply of votes.\n */\n function _getTotalSupply() internal view virtual returns (uint256) {\n return _totalCheckpoints.latest();\n }\n\n /**\n * @dev Returns the delegate that `account` has chosen.\n */\n function delegates(address account) public view virtual returns (address) {\n return _delegatee[account];\n }\n\n /**\n * @dev Delegates votes from the sender to `delegatee`.\n */\n function delegate(address delegatee) public virtual {\n address account = _msgSender();\n _delegate(account, delegatee);\n }\n\n /**\n * @dev Delegates votes from signer to `delegatee`.\n */\n function delegateBySig(\n address delegatee,\n uint256 nonce,\n uint256 expiry,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) public virtual {\n if (block.timestamp > expiry) {\n revert VotesExpiredSignature(expiry);\n }\n address signer = ECDSA.recover(\n _hashTypedDataV4(keccak256(abi.encode(DELEGATION_TYPEHASH, delegatee, nonce, expiry))),\n v,\n r,\n s\n );\n _useCheckedNonce(signer, nonce);\n _delegate(signer, delegatee);\n }\n\n /**\n * @dev Delegate all of `account`'s voting units to `delegatee`.\n *\n * Emits events {IVotes-DelegateChanged} and {IVotes-DelegateVotesChanged}.\n */\n function _delegate(address account, address delegatee) internal virtual {\n address oldDelegate = delegates(account);\n _delegatee[account] = delegatee;\n\n emit DelegateChanged(account, oldDelegate, delegatee);\n _moveDelegateVotes(oldDelegate, delegatee, _getVotingUnits(account));\n }\n\n /**\n * @dev Transfers, mints, or burns voting units. To register a mint, `from` should be zero. To register a burn, `to`\n * should be zero. Total supply of voting units will be adjusted with mints and burns.\n */\n function _transferVotingUnits(address from, address to, uint256 amount) internal virtual {\n if (from == address(0)) {\n _push(_totalCheckpoints, _add, SafeCast.toUint208(amount));\n }\n if (to == address(0)) {\n _push(_totalCheckpoints, _subtract, SafeCast.toUint208(amount));\n }\n _moveDelegateVotes(delegates(from), delegates(to), amount);\n }\n\n /**\n * @dev Moves delegated votes from one delegate to another.\n */\n function _moveDelegateVotes(address from, address to, uint256 amount) internal virtual {\n if (from != to && amount > 0) {\n if (from != address(0)) {\n (uint256 oldValue, uint256 newValue) = _push(\n _delegateCheckpoints[from],\n _subtract,\n SafeCast.toUint208(amount)\n );\n emit DelegateVotesChanged(from, oldValue, newValue);\n }\n if (to != address(0)) {\n (uint256 oldValue, uint256 newValue) = _push(\n _delegateCheckpoints[to],\n _add,\n SafeCast.toUint208(amount)\n );\n emit DelegateVotesChanged(to, oldValue, newValue);\n }\n }\n }\n\n /**\n * @dev Get number of checkpoints for `account`.\n */\n function _numCheckpoints(address account) internal view virtual returns (uint32) {\n return SafeCast.toUint32(_delegateCheckpoints[account].length());\n }\n\n /**\n * @dev Get the `pos`-th checkpoint for `account`.\n */\n function _checkpoints(\n address account,\n uint32 pos\n ) internal view virtual returns (Checkpoints.Checkpoint208 memory) {\n return _delegateCheckpoints[account].at(pos);\n }\n\n function _push(\n Checkpoints.Trace208 storage store,\n function(uint208, uint208) view returns (uint208) op,\n uint208 delta\n ) private returns (uint208 oldValue, uint208 newValue) {\n return store.push(clock(), op(store.latest(), delta));\n }\n\n function _add(uint208 a, uint208 b) private pure returns (uint208) {\n return a + b;\n }\n\n function _subtract(uint208 a, uint208 b) private pure returns (uint208) {\n return a - b;\n }\n\n /**\n * @dev Must return the voting units held by an account.\n */\n function _getVotingUnits(address) internal view virtual returns (uint256);\n}\n" + }, + "@openzeppelin/contracts/interfaces/draft-IERC6093.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (interfaces/draft-IERC6093.sol)\npragma solidity ^0.8.20;\n\n/**\n * @dev Standard ERC-20 Errors\n * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC-20 tokens.\n */\ninterface IERC20Errors {\n /**\n * @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers.\n * @param sender Address whose tokens are being transferred.\n * @param balance Current balance for the interacting account.\n * @param needed Minimum amount required to perform a transfer.\n */\n error ERC20InsufficientBalance(address sender, uint256 balance, uint256 needed);\n\n /**\n * @dev Indicates a failure with the token `sender`. Used in transfers.\n * @param sender Address whose tokens are being transferred.\n */\n error ERC20InvalidSender(address sender);\n\n /**\n * @dev Indicates a failure with the token `receiver`. Used in transfers.\n * @param receiver Address to which tokens are being transferred.\n */\n error ERC20InvalidReceiver(address receiver);\n\n /**\n * @dev Indicates a failure with the `spender`’s `allowance`. Used in transfers.\n * @param spender Address that may be allowed to operate on tokens without being their owner.\n * @param allowance Amount of tokens a `spender` is allowed to operate with.\n * @param needed Minimum amount required to perform a transfer.\n */\n error ERC20InsufficientAllowance(address spender, uint256 allowance, uint256 needed);\n\n /**\n * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.\n * @param approver Address initiating an approval operation.\n */\n error ERC20InvalidApprover(address approver);\n\n /**\n * @dev Indicates a failure with the `spender` to be approved. Used in approvals.\n * @param spender Address that may be allowed to operate on tokens without being their owner.\n */\n error ERC20InvalidSpender(address spender);\n}\n\n/**\n * @dev Standard ERC-721 Errors\n * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC-721 tokens.\n */\ninterface IERC721Errors {\n /**\n * @dev Indicates that an address can't be an owner. For example, `address(0)` is a forbidden owner in ERC-20.\n * Used in balance queries.\n * @param owner Address of the current owner of a token.\n */\n error ERC721InvalidOwner(address owner);\n\n /**\n * @dev Indicates a `tokenId` whose `owner` is the zero address.\n * @param tokenId Identifier number of a token.\n */\n error ERC721NonexistentToken(uint256 tokenId);\n\n /**\n * @dev Indicates an error related to the ownership over a particular token. Used in transfers.\n * @param sender Address whose tokens are being transferred.\n * @param tokenId Identifier number of a token.\n * @param owner Address of the current owner of a token.\n */\n error ERC721IncorrectOwner(address sender, uint256 tokenId, address owner);\n\n /**\n * @dev Indicates a failure with the token `sender`. Used in transfers.\n * @param sender Address whose tokens are being transferred.\n */\n error ERC721InvalidSender(address sender);\n\n /**\n * @dev Indicates a failure with the token `receiver`. Used in transfers.\n * @param receiver Address to which tokens are being transferred.\n */\n error ERC721InvalidReceiver(address receiver);\n\n /**\n * @dev Indicates a failure with the `operator`’s approval. Used in transfers.\n * @param operator Address that may be allowed to operate on tokens without being their owner.\n * @param tokenId Identifier number of a token.\n */\n error ERC721InsufficientApproval(address operator, uint256 tokenId);\n\n /**\n * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.\n * @param approver Address initiating an approval operation.\n */\n error ERC721InvalidApprover(address approver);\n\n /**\n * @dev Indicates a failure with the `operator` to be approved. Used in approvals.\n * @param operator Address that may be allowed to operate on tokens without being their owner.\n */\n error ERC721InvalidOperator(address operator);\n}\n\n/**\n * @dev Standard ERC-1155 Errors\n * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC-1155 tokens.\n */\ninterface IERC1155Errors {\n /**\n * @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers.\n * @param sender Address whose tokens are being transferred.\n * @param balance Current balance for the interacting account.\n * @param needed Minimum amount required to perform a transfer.\n * @param tokenId Identifier number of a token.\n */\n error ERC1155InsufficientBalance(address sender, uint256 balance, uint256 needed, uint256 tokenId);\n\n /**\n * @dev Indicates a failure with the token `sender`. Used in transfers.\n * @param sender Address whose tokens are being transferred.\n */\n error ERC1155InvalidSender(address sender);\n\n /**\n * @dev Indicates a failure with the token `receiver`. Used in transfers.\n * @param receiver Address to which tokens are being transferred.\n */\n error ERC1155InvalidReceiver(address receiver);\n\n /**\n * @dev Indicates a failure with the `operator`’s approval. Used in transfers.\n * @param operator Address that may be allowed to operate on tokens without being their owner.\n * @param owner Address of the current owner of a token.\n */\n error ERC1155MissingApprovalForAll(address operator, address owner);\n\n /**\n * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.\n * @param approver Address initiating an approval operation.\n */\n error ERC1155InvalidApprover(address approver);\n\n /**\n * @dev Indicates a failure with the `operator` to be approved. Used in approvals.\n * @param operator Address that may be allowed to operate on tokens without being their owner.\n */\n error ERC1155InvalidOperator(address operator);\n\n /**\n * @dev Indicates an array length mismatch between ids and values in a safeBatchTransferFrom operation.\n * Used in batch transfers.\n * @param idsLength Length of the array of token identifiers\n * @param valuesLength Length of the array of token amounts\n */\n error ERC1155InvalidArrayLength(uint256 idsLength, uint256 valuesLength);\n}\n" + }, + "@openzeppelin/contracts/interfaces/IERC1271.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (interfaces/IERC1271.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Interface of the ERC-1271 standard signature validation method for\n * contracts as defined in https://eips.ethereum.org/EIPS/eip-1271[ERC-1271].\n */\ninterface IERC1271 {\n /**\n * @dev Should return whether the signature provided is valid for the provided data\n * @param hash Hash of the data to be signed\n * @param signature Signature byte array associated with _data\n */\n function isValidSignature(bytes32 hash, bytes memory signature) external view returns (bytes4 magicValue);\n}\n" + }, + "@openzeppelin/contracts/interfaces/IERC165.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC165.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC165} from \"../utils/introspection/IERC165.sol\";\n" + }, + "@openzeppelin/contracts/interfaces/IERC4906.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (interfaces/IERC4906.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC165} from \"./IERC165.sol\";\nimport {IERC721} from \"./IERC721.sol\";\n\n/// @title ERC-721 Metadata Update Extension\ninterface IERC4906 is IERC165, IERC721 {\n /// @dev This event emits when the metadata of a token is changed.\n /// So that the third-party platforms such as NFT market could\n /// timely update the images and related attributes of the NFT.\n event MetadataUpdate(uint256 _tokenId);\n\n /// @dev This event emits when the metadata of a range of tokens is changed.\n /// So that the third-party platforms such as NFT market could\n /// timely update the images and related attributes of the NFTs.\n event BatchMetadataUpdate(uint256 _fromTokenId, uint256 _toTokenId);\n}\n" + }, + "@openzeppelin/contracts/interfaces/IERC5267.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC5267.sol)\n\npragma solidity ^0.8.20;\n\ninterface IERC5267 {\n /**\n * @dev MAY be emitted to signal that the domain could have changed.\n */\n event EIP712DomainChanged();\n\n /**\n * @dev returns the fields and values that describe the domain separator used by this contract for EIP-712\n * signature.\n */\n function eip712Domain()\n external\n view\n returns (\n bytes1 fields,\n string memory name,\n string memory version,\n uint256 chainId,\n address verifyingContract,\n bytes32 salt,\n uint256[] memory extensions\n );\n}\n" + }, + "@openzeppelin/contracts/interfaces/IERC5805.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC5805.sol)\n\npragma solidity ^0.8.20;\n\nimport {IVotes} from \"../governance/utils/IVotes.sol\";\nimport {IERC6372} from \"./IERC6372.sol\";\n\ninterface IERC5805 is IERC6372, IVotes {}\n" + }, + "@openzeppelin/contracts/interfaces/IERC6372.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC6372.sol)\n\npragma solidity ^0.8.20;\n\ninterface IERC6372 {\n /**\n * @dev Clock used for flagging checkpoints. Can be overridden to implement timestamp based checkpoints (and voting).\n */\n function clock() external view returns (uint48);\n\n /**\n * @dev Description of the clock\n */\n // solhint-disable-next-line func-name-mixedcase\n function CLOCK_MODE() external view returns (string memory);\n}\n" + }, + "@openzeppelin/contracts/interfaces/IERC721.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC721.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC721} from \"../token/ERC721/IERC721.sol\";\n" + }, + "@openzeppelin/contracts/token/ERC1155/IERC1155Receiver.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC1155/IERC1155Receiver.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC165} from \"../../utils/introspection/IERC165.sol\";\n\n/**\n * @dev Interface that must be implemented by smart contracts in order to receive\n * ERC-1155 token transfers.\n */\ninterface IERC1155Receiver is IERC165 {\n /**\n * @dev Handles the receipt of a single ERC-1155 token type. This function is\n * called at the end of a `safeTransferFrom` after the balance has been updated.\n *\n * NOTE: To accept the transfer, this must return\n * `bytes4(keccak256(\"onERC1155Received(address,address,uint256,uint256,bytes)\"))`\n * (i.e. 0xf23a6e61, or its own function selector).\n *\n * @param operator The address which initiated the transfer (i.e. msg.sender)\n * @param from The address which previously owned the token\n * @param id The ID of the token being transferred\n * @param value The amount of tokens being transferred\n * @param data Additional data with no specified format\n * @return `bytes4(keccak256(\"onERC1155Received(address,address,uint256,uint256,bytes)\"))` if transfer is allowed\n */\n function onERC1155Received(\n address operator,\n address from,\n uint256 id,\n uint256 value,\n bytes calldata data\n ) external returns (bytes4);\n\n /**\n * @dev Handles the receipt of a multiple ERC-1155 token types. This function\n * is called at the end of a `safeBatchTransferFrom` after the balances have\n * been updated.\n *\n * NOTE: To accept the transfer(s), this must return\n * `bytes4(keccak256(\"onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)\"))`\n * (i.e. 0xbc197c81, or its own function selector).\n *\n * @param operator The address which initiated the batch transfer (i.e. msg.sender)\n * @param from The address which previously owned the token\n * @param ids An array containing ids of each token being transferred (order and length must match values array)\n * @param values An array containing amounts of each token being transferred (order and length must match ids array)\n * @param data Additional data with no specified format\n * @return `bytes4(keccak256(\"onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)\"))` if transfer is allowed\n */\n function onERC1155BatchReceived(\n address operator,\n address from,\n uint256[] calldata ids,\n uint256[] calldata values,\n bytes calldata data\n ) external returns (bytes4);\n}\n" + }, + "@openzeppelin/contracts/token/ERC721/ERC721.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC721/ERC721.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC721} from \"./IERC721.sol\";\nimport {IERC721Metadata} from \"./extensions/IERC721Metadata.sol\";\nimport {ERC721Utils} from \"./utils/ERC721Utils.sol\";\nimport {Context} from \"../../utils/Context.sol\";\nimport {Strings} from \"../../utils/Strings.sol\";\nimport {IERC165, ERC165} from \"../../utils/introspection/ERC165.sol\";\nimport {IERC721Errors} from \"../../interfaces/draft-IERC6093.sol\";\n\n/**\n * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC-721] Non-Fungible Token Standard, including\n * the Metadata extension, but not including the Enumerable extension, which is available separately as\n * {ERC721Enumerable}.\n */\nabstract contract ERC721 is Context, ERC165, IERC721, IERC721Metadata, IERC721Errors {\n using Strings for uint256;\n\n // Token name\n string private _name;\n\n // Token symbol\n string private _symbol;\n\n mapping(uint256 tokenId => address) private _owners;\n\n mapping(address owner => uint256) private _balances;\n\n mapping(uint256 tokenId => address) private _tokenApprovals;\n\n mapping(address owner => mapping(address operator => bool)) private _operatorApprovals;\n\n /**\n * @dev Initializes the contract by setting a `name` and a `symbol` to the token collection.\n */\n constructor(string memory name_, string memory symbol_) {\n _name = name_;\n _symbol = symbol_;\n }\n\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {\n return\n interfaceId == type(IERC721).interfaceId ||\n interfaceId == type(IERC721Metadata).interfaceId ||\n super.supportsInterface(interfaceId);\n }\n\n /**\n * @dev See {IERC721-balanceOf}.\n */\n function balanceOf(address owner) public view virtual returns (uint256) {\n if (owner == address(0)) {\n revert ERC721InvalidOwner(address(0));\n }\n return _balances[owner];\n }\n\n /**\n * @dev See {IERC721-ownerOf}.\n */\n function ownerOf(uint256 tokenId) public view virtual returns (address) {\n return _requireOwned(tokenId);\n }\n\n /**\n * @dev See {IERC721Metadata-name}.\n */\n function name() public view virtual returns (string memory) {\n return _name;\n }\n\n /**\n * @dev See {IERC721Metadata-symbol}.\n */\n function symbol() public view virtual returns (string memory) {\n return _symbol;\n }\n\n /**\n * @dev See {IERC721Metadata-tokenURI}.\n */\n function tokenURI(uint256 tokenId) public view virtual returns (string memory) {\n _requireOwned(tokenId);\n\n string memory baseURI = _baseURI();\n return bytes(baseURI).length > 0 ? string.concat(baseURI, tokenId.toString()) : \"\";\n }\n\n /**\n * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each\n * token will be the concatenation of the `baseURI` and the `tokenId`. Empty\n * by default, can be overridden in child contracts.\n */\n function _baseURI() internal view virtual returns (string memory) {\n return \"\";\n }\n\n /**\n * @dev See {IERC721-approve}.\n */\n function approve(address to, uint256 tokenId) public virtual {\n _approve(to, tokenId, _msgSender());\n }\n\n /**\n * @dev See {IERC721-getApproved}.\n */\n function getApproved(uint256 tokenId) public view virtual returns (address) {\n _requireOwned(tokenId);\n\n return _getApproved(tokenId);\n }\n\n /**\n * @dev See {IERC721-setApprovalForAll}.\n */\n function setApprovalForAll(address operator, bool approved) public virtual {\n _setApprovalForAll(_msgSender(), operator, approved);\n }\n\n /**\n * @dev See {IERC721-isApprovedForAll}.\n */\n function isApprovedForAll(address owner, address operator) public view virtual returns (bool) {\n return _operatorApprovals[owner][operator];\n }\n\n /**\n * @dev See {IERC721-transferFrom}.\n */\n function transferFrom(address from, address to, uint256 tokenId) public virtual {\n if (to == address(0)) {\n revert ERC721InvalidReceiver(address(0));\n }\n // Setting an \"auth\" arguments enables the `_isAuthorized` check which verifies that the token exists\n // (from != 0). Therefore, it is not needed to verify that the return value is not 0 here.\n address previousOwner = _update(to, tokenId, _msgSender());\n if (previousOwner != from) {\n revert ERC721IncorrectOwner(from, tokenId, previousOwner);\n }\n }\n\n /**\n * @dev See {IERC721-safeTransferFrom}.\n */\n function safeTransferFrom(address from, address to, uint256 tokenId) public {\n safeTransferFrom(from, to, tokenId, \"\");\n }\n\n /**\n * @dev See {IERC721-safeTransferFrom}.\n */\n function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory data) public virtual {\n transferFrom(from, to, tokenId);\n ERC721Utils.checkOnERC721Received(_msgSender(), from, to, tokenId, data);\n }\n\n /**\n * @dev Returns the owner of the `tokenId`. Does NOT revert if token doesn't exist\n *\n * IMPORTANT: Any overrides to this function that add ownership of tokens not tracked by the\n * core ERC-721 logic MUST be matched with the use of {_increaseBalance} to keep balances\n * consistent with ownership. The invariant to preserve is that for any address `a` the value returned by\n * `balanceOf(a)` must be equal to the number of tokens such that `_ownerOf(tokenId)` is `a`.\n */\n function _ownerOf(uint256 tokenId) internal view virtual returns (address) {\n return _owners[tokenId];\n }\n\n /**\n * @dev Returns the approved address for `tokenId`. Returns 0 if `tokenId` is not minted.\n */\n function _getApproved(uint256 tokenId) internal view virtual returns (address) {\n return _tokenApprovals[tokenId];\n }\n\n /**\n * @dev Returns whether `spender` is allowed to manage `owner`'s tokens, or `tokenId` in\n * particular (ignoring whether it is owned by `owner`).\n *\n * WARNING: This function assumes that `owner` is the actual owner of `tokenId` and does not verify this\n * assumption.\n */\n function _isAuthorized(address owner, address spender, uint256 tokenId) internal view virtual returns (bool) {\n return\n spender != address(0) &&\n (owner == spender || isApprovedForAll(owner, spender) || _getApproved(tokenId) == spender);\n }\n\n /**\n * @dev Checks if `spender` can operate on `tokenId`, assuming the provided `owner` is the actual owner.\n * Reverts if:\n * - `spender` does not have approval from `owner` for `tokenId`.\n * - `spender` does not have approval to manage all of `owner`'s assets.\n *\n * WARNING: This function assumes that `owner` is the actual owner of `tokenId` and does not verify this\n * assumption.\n */\n function _checkAuthorized(address owner, address spender, uint256 tokenId) internal view virtual {\n if (!_isAuthorized(owner, spender, tokenId)) {\n if (owner == address(0)) {\n revert ERC721NonexistentToken(tokenId);\n } else {\n revert ERC721InsufficientApproval(spender, tokenId);\n }\n }\n }\n\n /**\n * @dev Unsafe write access to the balances, used by extensions that \"mint\" tokens using an {ownerOf} override.\n *\n * NOTE: the value is limited to type(uint128).max. This protect against _balance overflow. It is unrealistic that\n * a uint256 would ever overflow from increments when these increments are bounded to uint128 values.\n *\n * WARNING: Increasing an account's balance using this function tends to be paired with an override of the\n * {_ownerOf} function to resolve the ownership of the corresponding tokens so that balances and ownership\n * remain consistent with one another.\n */\n function _increaseBalance(address account, uint128 value) internal virtual {\n unchecked {\n _balances[account] += value;\n }\n }\n\n /**\n * @dev Transfers `tokenId` from its current owner to `to`, or alternatively mints (or burns) if the current owner\n * (or `to`) is the zero address. Returns the owner of the `tokenId` before the update.\n *\n * The `auth` argument is optional. If the value passed is non 0, then this function will check that\n * `auth` is either the owner of the token, or approved to operate on the token (by the owner).\n *\n * Emits a {Transfer} event.\n *\n * NOTE: If overriding this function in a way that tracks balances, see also {_increaseBalance}.\n */\n function _update(address to, uint256 tokenId, address auth) internal virtual returns (address) {\n address from = _ownerOf(tokenId);\n\n // Perform (optional) operator check\n if (auth != address(0)) {\n _checkAuthorized(from, auth, tokenId);\n }\n\n // Execute the update\n if (from != address(0)) {\n // Clear approval. No need to re-authorize or emit the Approval event\n _approve(address(0), tokenId, address(0), false);\n\n unchecked {\n _balances[from] -= 1;\n }\n }\n\n if (to != address(0)) {\n unchecked {\n _balances[to] += 1;\n }\n }\n\n _owners[tokenId] = to;\n\n emit Transfer(from, to, tokenId);\n\n return from;\n }\n\n /**\n * @dev Mints `tokenId` and transfers it to `to`.\n *\n * WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible\n *\n * Requirements:\n *\n * - `tokenId` must not exist.\n * - `to` cannot be the zero address.\n *\n * Emits a {Transfer} event.\n */\n function _mint(address to, uint256 tokenId) internal {\n if (to == address(0)) {\n revert ERC721InvalidReceiver(address(0));\n }\n address previousOwner = _update(to, tokenId, address(0));\n if (previousOwner != address(0)) {\n revert ERC721InvalidSender(address(0));\n }\n }\n\n /**\n * @dev Mints `tokenId`, transfers it to `to` and checks for `to` acceptance.\n *\n * Requirements:\n *\n * - `tokenId` must not exist.\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\n *\n * Emits a {Transfer} event.\n */\n function _safeMint(address to, uint256 tokenId) internal {\n _safeMint(to, tokenId, \"\");\n }\n\n /**\n * @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is\n * forwarded in {IERC721Receiver-onERC721Received} to contract recipients.\n */\n function _safeMint(address to, uint256 tokenId, bytes memory data) internal virtual {\n _mint(to, tokenId);\n ERC721Utils.checkOnERC721Received(_msgSender(), address(0), to, tokenId, data);\n }\n\n /**\n * @dev Destroys `tokenId`.\n * The approval is cleared when the token is burned.\n * This is an internal function that does not check if the sender is authorized to operate on the token.\n *\n * Requirements:\n *\n * - `tokenId` must exist.\n *\n * Emits a {Transfer} event.\n */\n function _burn(uint256 tokenId) internal {\n address previousOwner = _update(address(0), tokenId, address(0));\n if (previousOwner == address(0)) {\n revert ERC721NonexistentToken(tokenId);\n }\n }\n\n /**\n * @dev Transfers `tokenId` from `from` to `to`.\n * As opposed to {transferFrom}, this imposes no restrictions on msg.sender.\n *\n * Requirements:\n *\n * - `to` cannot be the zero address.\n * - `tokenId` token must be owned by `from`.\n *\n * Emits a {Transfer} event.\n */\n function _transfer(address from, address to, uint256 tokenId) internal {\n if (to == address(0)) {\n revert ERC721InvalidReceiver(address(0));\n }\n address previousOwner = _update(to, tokenId, address(0));\n if (previousOwner == address(0)) {\n revert ERC721NonexistentToken(tokenId);\n } else if (previousOwner != from) {\n revert ERC721IncorrectOwner(from, tokenId, previousOwner);\n }\n }\n\n /**\n * @dev Safely transfers `tokenId` token from `from` to `to`, checking that contract recipients\n * are aware of the ERC-721 standard to prevent tokens from being forever locked.\n *\n * `data` is additional data, it has no specified format and it is sent in call to `to`.\n *\n * This internal function is like {safeTransferFrom} in the sense that it invokes\n * {IERC721Receiver-onERC721Received} on the receiver, and can be used to e.g.\n * implement alternative mechanisms to perform token transfer, such as signature-based.\n *\n * Requirements:\n *\n * - `tokenId` token must exist and be owned by `from`.\n * - `to` cannot be the zero address.\n * - `from` cannot be the zero address.\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\n *\n * Emits a {Transfer} event.\n */\n function _safeTransfer(address from, address to, uint256 tokenId) internal {\n _safeTransfer(from, to, tokenId, \"\");\n }\n\n /**\n * @dev Same as {xref-ERC721-_safeTransfer-address-address-uint256-}[`_safeTransfer`], with an additional `data` parameter which is\n * forwarded in {IERC721Receiver-onERC721Received} to contract recipients.\n */\n function _safeTransfer(address from, address to, uint256 tokenId, bytes memory data) internal virtual {\n _transfer(from, to, tokenId);\n ERC721Utils.checkOnERC721Received(_msgSender(), from, to, tokenId, data);\n }\n\n /**\n * @dev Approve `to` to operate on `tokenId`\n *\n * The `auth` argument is optional. If the value passed is non 0, then this function will check that `auth` is\n * either the owner of the token, or approved to operate on all tokens held by this owner.\n *\n * Emits an {Approval} event.\n *\n * Overrides to this logic should be done to the variant with an additional `bool emitEvent` argument.\n */\n function _approve(address to, uint256 tokenId, address auth) internal {\n _approve(to, tokenId, auth, true);\n }\n\n /**\n * @dev Variant of `_approve` with an optional flag to enable or disable the {Approval} event. The event is not\n * emitted in the context of transfers.\n */\n function _approve(address to, uint256 tokenId, address auth, bool emitEvent) internal virtual {\n // Avoid reading the owner unless necessary\n if (emitEvent || auth != address(0)) {\n address owner = _requireOwned(tokenId);\n\n // We do not use _isAuthorized because single-token approvals should not be able to call approve\n if (auth != address(0) && owner != auth && !isApprovedForAll(owner, auth)) {\n revert ERC721InvalidApprover(auth);\n }\n\n if (emitEvent) {\n emit Approval(owner, to, tokenId);\n }\n }\n\n _tokenApprovals[tokenId] = to;\n }\n\n /**\n * @dev Approve `operator` to operate on all of `owner` tokens\n *\n * Requirements:\n * - operator can't be the address zero.\n *\n * Emits an {ApprovalForAll} event.\n */\n function _setApprovalForAll(address owner, address operator, bool approved) internal virtual {\n if (operator == address(0)) {\n revert ERC721InvalidOperator(operator);\n }\n _operatorApprovals[owner][operator] = approved;\n emit ApprovalForAll(owner, operator, approved);\n }\n\n /**\n * @dev Reverts if the `tokenId` doesn't have a current owner (it hasn't been minted, or it has been burned).\n * Returns the owner.\n *\n * Overrides to ownership logic should be done to {_ownerOf}.\n */\n function _requireOwned(uint256 tokenId) internal view returns (address) {\n address owner = _ownerOf(tokenId);\n if (owner == address(0)) {\n revert ERC721NonexistentToken(tokenId);\n }\n return owner;\n }\n}\n" + }, + "@openzeppelin/contracts/token/ERC721/extensions/ERC721Burnable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC721/extensions/ERC721Burnable.sol)\n\npragma solidity ^0.8.20;\n\nimport {ERC721} from \"../ERC721.sol\";\nimport {Context} from \"../../../utils/Context.sol\";\n\n/**\n * @title ERC-721 Burnable Token\n * @dev ERC-721 Token that can be burned (destroyed).\n */\nabstract contract ERC721Burnable is Context, ERC721 {\n /**\n * @dev Burns `tokenId`. See {ERC721-_burn}.\n *\n * Requirements:\n *\n * - The caller must own `tokenId` or be an approved operator.\n */\n function burn(uint256 tokenId) public virtual {\n // Setting an \"auth\" arguments enables the `_isAuthorized` check which verifies that the token exists\n // (from != 0). Therefore, it is not needed to verify that the return value is not 0 here.\n _update(address(0), tokenId, _msgSender());\n }\n}\n" + }, + "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC721/extensions/ERC721Enumerable.sol)\n\npragma solidity ^0.8.20;\n\nimport {ERC721} from \"../ERC721.sol\";\nimport {IERC721Enumerable} from \"./IERC721Enumerable.sol\";\nimport {IERC165} from \"../../../utils/introspection/ERC165.sol\";\n\n/**\n * @dev This implements an optional extension of {ERC721} defined in the ERC that adds enumerability\n * of all the token ids in the contract as well as all token ids owned by each account.\n *\n * CAUTION: {ERC721} extensions that implement custom `balanceOf` logic, such as {ERC721Consecutive},\n * interfere with enumerability and should not be used together with {ERC721Enumerable}.\n */\nabstract contract ERC721Enumerable is ERC721, IERC721Enumerable {\n mapping(address owner => mapping(uint256 index => uint256)) private _ownedTokens;\n mapping(uint256 tokenId => uint256) private _ownedTokensIndex;\n\n uint256[] private _allTokens;\n mapping(uint256 tokenId => uint256) private _allTokensIndex;\n\n /**\n * @dev An `owner`'s token query was out of bounds for `index`.\n *\n * NOTE: The owner being `address(0)` indicates a global out of bounds index.\n */\n error ERC721OutOfBoundsIndex(address owner, uint256 index);\n\n /**\n * @dev Batch mint is not allowed.\n */\n error ERC721EnumerableForbiddenBatchMint();\n\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165, ERC721) returns (bool) {\n return interfaceId == type(IERC721Enumerable).interfaceId || super.supportsInterface(interfaceId);\n }\n\n /**\n * @dev See {IERC721Enumerable-tokenOfOwnerByIndex}.\n */\n function tokenOfOwnerByIndex(address owner, uint256 index) public view virtual returns (uint256) {\n if (index >= balanceOf(owner)) {\n revert ERC721OutOfBoundsIndex(owner, index);\n }\n return _ownedTokens[owner][index];\n }\n\n /**\n * @dev See {IERC721Enumerable-totalSupply}.\n */\n function totalSupply() public view virtual returns (uint256) {\n return _allTokens.length;\n }\n\n /**\n * @dev See {IERC721Enumerable-tokenByIndex}.\n */\n function tokenByIndex(uint256 index) public view virtual returns (uint256) {\n if (index >= totalSupply()) {\n revert ERC721OutOfBoundsIndex(address(0), index);\n }\n return _allTokens[index];\n }\n\n /**\n * @dev See {ERC721-_update}.\n */\n function _update(address to, uint256 tokenId, address auth) internal virtual override returns (address) {\n address previousOwner = super._update(to, tokenId, auth);\n\n if (previousOwner == address(0)) {\n _addTokenToAllTokensEnumeration(tokenId);\n } else if (previousOwner != to) {\n _removeTokenFromOwnerEnumeration(previousOwner, tokenId);\n }\n if (to == address(0)) {\n _removeTokenFromAllTokensEnumeration(tokenId);\n } else if (previousOwner != to) {\n _addTokenToOwnerEnumeration(to, tokenId);\n }\n\n return previousOwner;\n }\n\n /**\n * @dev Private function to add a token to this extension's ownership-tracking data structures.\n * @param to address representing the new owner of the given token ID\n * @param tokenId uint256 ID of the token to be added to the tokens list of the given address\n */\n function _addTokenToOwnerEnumeration(address to, uint256 tokenId) private {\n uint256 length = balanceOf(to) - 1;\n _ownedTokens[to][length] = tokenId;\n _ownedTokensIndex[tokenId] = length;\n }\n\n /**\n * @dev Private function to add a token to this extension's token tracking data structures.\n * @param tokenId uint256 ID of the token to be added to the tokens list\n */\n function _addTokenToAllTokensEnumeration(uint256 tokenId) private {\n _allTokensIndex[tokenId] = _allTokens.length;\n _allTokens.push(tokenId);\n }\n\n /**\n * @dev Private function to remove a token from this extension's ownership-tracking data structures. Note that\n * while the token is not assigned a new owner, the `_ownedTokensIndex` mapping is _not_ updated: this allows for\n * gas optimizations e.g. when performing a transfer operation (avoiding double writes).\n * This has O(1) time complexity, but alters the order of the _ownedTokens array.\n * @param from address representing the previous owner of the given token ID\n * @param tokenId uint256 ID of the token to be removed from the tokens list of the given address\n */\n function _removeTokenFromOwnerEnumeration(address from, uint256 tokenId) private {\n // To prevent a gap in from's tokens array, we store the last token in the index of the token to delete, and\n // then delete the last slot (swap and pop).\n\n uint256 lastTokenIndex = balanceOf(from);\n uint256 tokenIndex = _ownedTokensIndex[tokenId];\n\n mapping(uint256 index => uint256) storage _ownedTokensByOwner = _ownedTokens[from];\n\n // When the token to delete is the last token, the swap operation is unnecessary\n if (tokenIndex != lastTokenIndex) {\n uint256 lastTokenId = _ownedTokensByOwner[lastTokenIndex];\n\n _ownedTokensByOwner[tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token\n _ownedTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index\n }\n\n // This also deletes the contents at the last position of the array\n delete _ownedTokensIndex[tokenId];\n delete _ownedTokensByOwner[lastTokenIndex];\n }\n\n /**\n * @dev Private function to remove a token from this extension's token tracking data structures.\n * This has O(1) time complexity, but alters the order of the _allTokens array.\n * @param tokenId uint256 ID of the token to be removed from the tokens list\n */\n function _removeTokenFromAllTokensEnumeration(uint256 tokenId) private {\n // To prevent a gap in the tokens array, we store the last token in the index of the token to delete, and\n // then delete the last slot (swap and pop).\n\n uint256 lastTokenIndex = _allTokens.length - 1;\n uint256 tokenIndex = _allTokensIndex[tokenId];\n\n // When the token to delete is the last token, the swap operation is unnecessary. However, since this occurs so\n // rarely (when the last minted token is burnt) that we still do the swap here to avoid the gas cost of adding\n // an 'if' statement (like in _removeTokenFromOwnerEnumeration)\n uint256 lastTokenId = _allTokens[lastTokenIndex];\n\n _allTokens[tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token\n _allTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index\n\n // This also deletes the contents at the last position of the array\n delete _allTokensIndex[tokenId];\n _allTokens.pop();\n }\n\n /**\n * See {ERC721-_increaseBalance}. We need that to account tokens that were minted in batch\n */\n function _increaseBalance(address account, uint128 amount) internal virtual override {\n if (amount > 0) {\n revert ERC721EnumerableForbiddenBatchMint();\n }\n super._increaseBalance(account, amount);\n }\n}\n" + }, + "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC721/extensions/ERC721URIStorage.sol)\n\npragma solidity ^0.8.20;\n\nimport {ERC721} from \"../ERC721.sol\";\nimport {Strings} from \"../../../utils/Strings.sol\";\nimport {IERC4906} from \"../../../interfaces/IERC4906.sol\";\nimport {IERC165} from \"../../../interfaces/IERC165.sol\";\n\n/**\n * @dev ERC-721 token with storage based token URI management.\n */\nabstract contract ERC721URIStorage is IERC4906, ERC721 {\n using Strings for uint256;\n\n // Interface ID as defined in ERC-4906. This does not correspond to a traditional interface ID as ERC-4906 only\n // defines events and does not include any external function.\n bytes4 private constant ERC4906_INTERFACE_ID = bytes4(0x49064906);\n\n // Optional mapping for token URIs\n mapping(uint256 tokenId => string) private _tokenURIs;\n\n /**\n * @dev See {IERC165-supportsInterface}\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override(ERC721, IERC165) returns (bool) {\n return interfaceId == ERC4906_INTERFACE_ID || super.supportsInterface(interfaceId);\n }\n\n /**\n * @dev See {IERC721Metadata-tokenURI}.\n */\n function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {\n _requireOwned(tokenId);\n\n string memory _tokenURI = _tokenURIs[tokenId];\n string memory base = _baseURI();\n\n // If there is no base URI, return the token URI.\n if (bytes(base).length == 0) {\n return _tokenURI;\n }\n // If both are set, concatenate the baseURI and tokenURI (via string.concat).\n if (bytes(_tokenURI).length > 0) {\n return string.concat(base, _tokenURI);\n }\n\n return super.tokenURI(tokenId);\n }\n\n /**\n * @dev Sets `_tokenURI` as the tokenURI of `tokenId`.\n *\n * Emits {MetadataUpdate}.\n */\n function _setTokenURI(uint256 tokenId, string memory _tokenURI) internal virtual {\n _tokenURIs[tokenId] = _tokenURI;\n emit MetadataUpdate(tokenId);\n }\n}\n" + }, + "@openzeppelin/contracts/token/ERC721/extensions/ERC721Votes.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC721/extensions/ERC721Votes.sol)\n\npragma solidity ^0.8.20;\n\nimport {ERC721} from \"../ERC721.sol\";\nimport {Votes} from \"../../../governance/utils/Votes.sol\";\n\n/**\n * @dev Extension of ERC-721 to support voting and delegation as implemented by {Votes}, where each individual NFT counts\n * as 1 vote unit.\n *\n * Tokens do not count as votes until they are delegated, because votes must be tracked which incurs an additional cost\n * on every transfer. Token holders can either delegate to a trusted representative who will decide how to make use of\n * the votes in governance decisions, or they can delegate to themselves to be their own representative.\n */\nabstract contract ERC721Votes is ERC721, Votes {\n /**\n * @dev See {ERC721-_update}. Adjusts votes when tokens are transferred.\n *\n * Emits a {IVotes-DelegateVotesChanged} event.\n */\n function _update(address to, uint256 tokenId, address auth) internal virtual override returns (address) {\n address previousOwner = super._update(to, tokenId, auth);\n\n _transferVotingUnits(previousOwner, to, 1);\n\n return previousOwner;\n }\n\n /**\n * @dev Returns the balance of `account`.\n *\n * WARNING: Overriding this function will likely result in incorrect vote tracking.\n */\n function _getVotingUnits(address account) internal view virtual override returns (uint256) {\n return balanceOf(account);\n }\n\n /**\n * @dev See {ERC721-_increaseBalance}. We need that to account tokens that were minted in batch.\n */\n function _increaseBalance(address account, uint128 amount) internal virtual override {\n super._increaseBalance(account, amount);\n _transferVotingUnits(address(0), account, amount);\n }\n}\n" + }, + "@openzeppelin/contracts/token/ERC721/extensions/IERC721Enumerable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC721/extensions/IERC721Enumerable.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC721} from \"../IERC721.sol\";\n\n/**\n * @title ERC-721 Non-Fungible Token Standard, optional enumeration extension\n * @dev See https://eips.ethereum.org/EIPS/eip-721\n */\ninterface IERC721Enumerable is IERC721 {\n /**\n * @dev Returns the total amount of tokens stored by the contract.\n */\n function totalSupply() external view returns (uint256);\n\n /**\n * @dev Returns a token ID owned by `owner` at a given `index` of its token list.\n * Use along with {balanceOf} to enumerate all of ``owner``'s tokens.\n */\n function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256);\n\n /**\n * @dev Returns a token ID at a given `index` of all the tokens stored by the contract.\n * Use along with {totalSupply} to enumerate all tokens.\n */\n function tokenByIndex(uint256 index) external view returns (uint256);\n}\n" + }, + "@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC721/extensions/IERC721Metadata.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC721} from \"../IERC721.sol\";\n\n/**\n * @title ERC-721 Non-Fungible Token Standard, optional metadata extension\n * @dev See https://eips.ethereum.org/EIPS/eip-721\n */\ninterface IERC721Metadata is IERC721 {\n /**\n * @dev Returns the token collection name.\n */\n function name() external view returns (string memory);\n\n /**\n * @dev Returns the token collection symbol.\n */\n function symbol() external view returns (string memory);\n\n /**\n * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token.\n */\n function tokenURI(uint256 tokenId) external view returns (string memory);\n}\n" + }, + "@openzeppelin/contracts/token/ERC721/IERC721.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC721/IERC721.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC165} from \"../../utils/introspection/IERC165.sol\";\n\n/**\n * @dev Required interface of an ERC-721 compliant contract.\n */\ninterface IERC721 is IERC165 {\n /**\n * @dev Emitted when `tokenId` token is transferred from `from` to `to`.\n */\n event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);\n\n /**\n * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.\n */\n event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);\n\n /**\n * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.\n */\n event ApprovalForAll(address indexed owner, address indexed operator, bool approved);\n\n /**\n * @dev Returns the number of tokens in ``owner``'s account.\n */\n function balanceOf(address owner) external view returns (uint256 balance);\n\n /**\n * @dev Returns the owner of the `tokenId` token.\n *\n * Requirements:\n *\n * - `tokenId` must exist.\n */\n function ownerOf(uint256 tokenId) external view returns (address owner);\n\n /**\n * @dev Safely transfers `tokenId` token from `from` to `to`.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `tokenId` token must exist and be owned by `from`.\n * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon\n * a safe transfer.\n *\n * Emits a {Transfer} event.\n */\n function safeTransferFrom(address from, address to, uint256 tokenId, bytes calldata data) external;\n\n /**\n * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients\n * are aware of the ERC-721 protocol to prevent tokens from being forever locked.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `tokenId` token must exist and be owned by `from`.\n * - If the caller is not `from`, it must have been allowed to move this token by either {approve} or\n * {setApprovalForAll}.\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon\n * a safe transfer.\n *\n * Emits a {Transfer} event.\n */\n function safeTransferFrom(address from, address to, uint256 tokenId) external;\n\n /**\n * @dev Transfers `tokenId` token from `from` to `to`.\n *\n * WARNING: Note that the caller is responsible to confirm that the recipient is capable of receiving ERC-721\n * or else they may be permanently lost. Usage of {safeTransferFrom} prevents loss, though the caller must\n * understand this adds an external call which potentially creates a reentrancy vulnerability.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `tokenId` token must be owned by `from`.\n * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(address from, address to, uint256 tokenId) external;\n\n /**\n * @dev Gives permission to `to` to transfer `tokenId` token to another account.\n * The approval is cleared when the token is transferred.\n *\n * Only a single account can be approved at a time, so approving the zero address clears previous approvals.\n *\n * Requirements:\n *\n * - The caller must own the token or be an approved operator.\n * - `tokenId` must exist.\n *\n * Emits an {Approval} event.\n */\n function approve(address to, uint256 tokenId) external;\n\n /**\n * @dev Approve or remove `operator` as an operator for the caller.\n * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.\n *\n * Requirements:\n *\n * - The `operator` cannot be the address zero.\n *\n * Emits an {ApprovalForAll} event.\n */\n function setApprovalForAll(address operator, bool approved) external;\n\n /**\n * @dev Returns the account approved for `tokenId` token.\n *\n * Requirements:\n *\n * - `tokenId` must exist.\n */\n function getApproved(uint256 tokenId) external view returns (address operator);\n\n /**\n * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.\n *\n * See {setApprovalForAll}\n */\n function isApprovedForAll(address owner, address operator) external view returns (bool);\n}\n" + }, + "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC721/IERC721Receiver.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @title ERC-721 token receiver interface\n * @dev Interface for any contract that wants to support safeTransfers\n * from ERC-721 asset contracts.\n */\ninterface IERC721Receiver {\n /**\n * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom}\n * by `operator` from `from`, this function is called.\n *\n * It must return its Solidity selector to confirm the token transfer.\n * If any other value is returned or the interface is not implemented by the recipient, the transfer will be\n * reverted.\n *\n * The selector can be obtained in Solidity with `IERC721Receiver.onERC721Received.selector`.\n */\n function onERC721Received(\n address operator,\n address from,\n uint256 tokenId,\n bytes calldata data\n ) external returns (bytes4);\n}\n" + }, + "@openzeppelin/contracts/token/ERC721/utils/ERC721Utils.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC721/utils/ERC721Utils.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC721Receiver} from \"../IERC721Receiver.sol\";\nimport {IERC721Errors} from \"../../../interfaces/draft-IERC6093.sol\";\n\n/**\n * @dev Library that provide common ERC-721 utility functions.\n *\n * See https://eips.ethereum.org/EIPS/eip-721[ERC-721].\n *\n * _Available since v5.1._\n */\nlibrary ERC721Utils {\n /**\n * @dev Performs an acceptance check for the provided `operator` by calling {IERC721-onERC721Received}\n * on the `to` address. The `operator` is generally the address that initiated the token transfer (i.e. `msg.sender`).\n *\n * The acceptance call is not executed and treated as a no-op if the target address doesn't contain code (i.e. an EOA).\n * Otherwise, the recipient must implement {IERC721Receiver-onERC721Received} and return the acceptance magic value to accept\n * the transfer.\n */\n function checkOnERC721Received(\n address operator,\n address from,\n address to,\n uint256 tokenId,\n bytes memory data\n ) internal {\n if (to.code.length > 0) {\n try IERC721Receiver(to).onERC721Received(operator, from, tokenId, data) returns (bytes4 retval) {\n if (retval != IERC721Receiver.onERC721Received.selector) {\n // Token rejected\n revert IERC721Errors.ERC721InvalidReceiver(to);\n }\n } catch (bytes memory reason) {\n if (reason.length == 0) {\n // non-IERC721Receiver implementer\n revert IERC721Errors.ERC721InvalidReceiver(to);\n } else {\n assembly (\"memory-safe\") {\n revert(add(32, reason), mload(reason))\n }\n }\n }\n }\n }\n}\n" + }, + "@openzeppelin/contracts/utils/Address.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/Address.sol)\n\npragma solidity ^0.8.20;\n\nimport {Errors} from \"./Errors.sol\";\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary Address {\n /**\n * @dev There's no code at `target` (it is not a contract).\n */\n error AddressEmptyCode(address target);\n\n /**\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\n * `recipient`, forwarding all available gas and reverting on errors.\n *\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\n * imposed by `transfer`, making them unable to receive funds via\n * `transfer`. {sendValue} removes this limitation.\n *\n * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n *\n * IMPORTANT: because control is transferred to `recipient`, care must be\n * taken to not create reentrancy vulnerabilities. Consider using\n * {ReentrancyGuard} or the\n * https://solidity.readthedocs.io/en/v0.8.20/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n */\n function sendValue(address payable recipient, uint256 amount) internal {\n if (address(this).balance < amount) {\n revert Errors.InsufficientBalance(address(this).balance, amount);\n }\n\n (bool success, ) = recipient.call{value: amount}(\"\");\n if (!success) {\n revert Errors.FailedCall();\n }\n }\n\n /**\n * @dev Performs a Solidity function call using a low level `call`. A\n * plain `call` is an unsafe replacement for a function call: use this\n * function instead.\n *\n * If `target` reverts with a revert reason or custom error, it is bubbled\n * up by this function (like regular Solidity function calls). However, if\n * the call reverted with no returned reason, this function reverts with a\n * {Errors.FailedCall} error.\n *\n * Returns the raw returned data. To convert to the expected return value,\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\n *\n * Requirements:\n *\n * - `target` must be a contract.\n * - calling `target` with `data` must not revert.\n */\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but also transferring `value` wei to `target`.\n *\n * Requirements:\n *\n * - the calling contract must have an ETH balance of at least `value`.\n * - the called Solidity function must be `payable`.\n */\n function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {\n if (address(this).balance < value) {\n revert Errors.InsufficientBalance(address(this).balance, value);\n }\n (bool success, bytes memory returndata) = target.call{value: value}(data);\n return verifyCallResultFromTarget(target, success, returndata);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a static call.\n */\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\n (bool success, bytes memory returndata) = target.staticcall(data);\n return verifyCallResultFromTarget(target, success, returndata);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a delegate call.\n */\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\n (bool success, bytes memory returndata) = target.delegatecall(data);\n return verifyCallResultFromTarget(target, success, returndata);\n }\n\n /**\n * @dev Tool to verify that a low level call to smart-contract was successful, and reverts if the target\n * was not a contract or bubbling up the revert reason (falling back to {Errors.FailedCall}) in case\n * of an unsuccessful call.\n */\n function verifyCallResultFromTarget(\n address target,\n bool success,\n bytes memory returndata\n ) internal view returns (bytes memory) {\n if (!success) {\n _revert(returndata);\n } else {\n // only check if target is a contract if the call was successful and the return data is empty\n // otherwise we already know that it was a contract\n if (returndata.length == 0 && target.code.length == 0) {\n revert AddressEmptyCode(target);\n }\n return returndata;\n }\n }\n\n /**\n * @dev Tool to verify that a low level call was successful, and reverts if it wasn't, either by bubbling the\n * revert reason or with a default {Errors.FailedCall} error.\n */\n function verifyCallResult(bool success, bytes memory returndata) internal pure returns (bytes memory) {\n if (!success) {\n _revert(returndata);\n } else {\n return returndata;\n }\n }\n\n /**\n * @dev Reverts with returndata if present. Otherwise reverts with {Errors.FailedCall}.\n */\n function _revert(bytes memory returndata) private pure {\n // Look for revert reason and bubble it up if present\n if (returndata.length > 0) {\n // The easiest way to bubble the revert reason is using memory via assembly\n assembly (\"memory-safe\") {\n let returndata_size := mload(returndata)\n revert(add(32, returndata), returndata_size)\n }\n } else {\n revert Errors.FailedCall();\n }\n }\n}\n" + }, + "@openzeppelin/contracts/utils/Context.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract Context {\n function _msgSender() internal view virtual returns (address) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual returns (bytes calldata) {\n return msg.data;\n }\n\n function _contextSuffixLength() internal view virtual returns (uint256) {\n return 0;\n }\n}\n" + }, + "@openzeppelin/contracts/utils/cryptography/ECDSA.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/cryptography/ECDSA.sol)\n\npragma solidity ^0.8.20;\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 }\n\n /**\n * @dev The signature derives the `address(0)`.\n */\n error ECDSAInvalidSignature();\n\n /**\n * @dev The signature has an invalid length.\n */\n error ECDSAInvalidSignatureLength(uint256 length);\n\n /**\n * @dev The signature has an S value that is in the upper half order.\n */\n error ECDSAInvalidSignatureS(bytes32 s);\n\n /**\n * @dev Returns the address that signed a hashed message (`hash`) with `signature` or an error. This will not\n * return address(0) without also returning an error description. Errors are documented using an enum (error type)\n * and a bytes32 providing additional information about the error.\n *\n * If no error is returned, then the address can be used for verification purposes.\n *\n * The `ecrecover` EVM precompile 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 {MessageHashUtils-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 function tryRecover(\n bytes32 hash,\n bytes memory signature\n ) internal pure returns (address recovered, RecoverError err, bytes32 errArg) {\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 assembly (\"memory-safe\") {\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, bytes32(signature.length));\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 precompile 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 {MessageHashUtils-toEthSignedMessageHash} on it.\n */\n function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {\n (address recovered, RecoverError error, bytes32 errorArg) = tryRecover(hash, signature);\n _throwError(error, errorArg);\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[ERC-2098 short signatures]\n */\n function tryRecover(\n bytes32 hash,\n bytes32 r,\n bytes32 vs\n ) internal pure returns (address recovered, RecoverError err, bytes32 errArg) {\n unchecked {\n bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff);\n // We do not check for an overflow here since the shift operation results in 0 or 1.\n uint8 v = uint8((uint256(vs) >> 255) + 27);\n return tryRecover(hash, v, r, s);\n }\n }\n\n /**\n * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately.\n */\n function recover(bytes32 hash, bytes32 r, bytes32 vs) internal pure returns (address) {\n (address recovered, RecoverError error, bytes32 errorArg) = tryRecover(hash, r, vs);\n _throwError(error, errorArg);\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 function tryRecover(\n bytes32 hash,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) internal pure returns (address recovered, RecoverError err, bytes32 errArg) {\n // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature\n // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines\n // the valid range for s in (301): 0 < s < secp256k1n ÷ 2 + 1, and for v in (302): v ∈ {27, 28}. Most\n // signatures from current libraries generate a unique signature with an s-value in the lower half order.\n //\n // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value\n // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or\n // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept\n // these malleable signatures as well.\n if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) {\n return (address(0), RecoverError.InvalidSignatureS, s);\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, bytes32(0));\n }\n\n return (signer, RecoverError.NoError, bytes32(0));\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, bytes32 errorArg) = tryRecover(hash, v, r, s);\n _throwError(error, errorArg);\n return recovered;\n }\n\n /**\n * @dev Optionally reverts with the corresponding custom error according to the `error` argument provided.\n */\n function _throwError(RecoverError error, bytes32 errorArg) private pure {\n if (error == RecoverError.NoError) {\n return; // no error: do nothing\n } else if (error == RecoverError.InvalidSignature) {\n revert ECDSAInvalidSignature();\n } else if (error == RecoverError.InvalidSignatureLength) {\n revert ECDSAInvalidSignatureLength(uint256(errorArg));\n } else if (error == RecoverError.InvalidSignatureS) {\n revert ECDSAInvalidSignatureS(errorArg);\n }\n }\n}\n" + }, + "@openzeppelin/contracts/utils/cryptography/EIP712.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/cryptography/EIP712.sol)\n\npragma solidity ^0.8.20;\n\nimport {MessageHashUtils} from \"./MessageHashUtils.sol\";\nimport {ShortStrings, ShortString} from \"../ShortStrings.sol\";\nimport {IERC5267} from \"../../interfaces/IERC5267.sol\";\n\n/**\n * @dev https://eips.ethereum.org/EIPS/eip-712[EIP-712] is a standard for hashing and signing of typed structured data.\n *\n * The encoding scheme specified in the EIP requires a domain separator and a hash of the typed structured data, whose\n * encoding is very generic and therefore its implementation in Solidity is not feasible, thus this contract\n * does not implement the encoding itself. Protocols need to implement the type-specific encoding they need in order to\n * produce the hash of their typed data using a combination of `abi.encode` and `keccak256`.\n *\n * This contract implements the EIP-712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding\n * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA\n * ({_hashTypedDataV4}).\n *\n * The implementation of the domain separator was designed to be as efficient as possible while still properly updating\n * the chain id to protect against replay attacks on an eventual fork of the chain.\n *\n * NOTE: This contract implements the version of the encoding known as \"v4\", as implemented by the JSON RPC method\n * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask].\n *\n * NOTE: In the upgradeable version of this contract, the cached values will correspond to the address, and the domain\n * separator of the implementation contract. This will cause the {_domainSeparatorV4} function to always rebuild the\n * separator from the immutable values, which is cheaper than accessing a cached version in cold storage.\n *\n * @custom:oz-upgrades-unsafe-allow state-variable-immutable\n */\nabstract contract EIP712 is IERC5267 {\n using ShortStrings for *;\n\n bytes32 private constant TYPE_HASH =\n keccak256(\"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)\");\n\n // Cache the domain separator as an immutable value, but also store the chain id that it corresponds to, in order to\n // invalidate the cached domain separator if the chain id changes.\n bytes32 private immutable _cachedDomainSeparator;\n uint256 private immutable _cachedChainId;\n address private immutable _cachedThis;\n\n bytes32 private immutable _hashedName;\n bytes32 private immutable _hashedVersion;\n\n ShortString private immutable _name;\n ShortString private immutable _version;\n string private _nameFallback;\n string private _versionFallback;\n\n /**\n * @dev Initializes the domain separator and parameter caches.\n *\n * The meaning of `name` and `version` is specified in\n * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP-712]:\n *\n * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol.\n * - `version`: the current major version of the signing domain.\n *\n * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart\n * contract upgrade].\n */\n constructor(string memory name, string memory version) {\n _name = name.toShortStringWithFallback(_nameFallback);\n _version = version.toShortStringWithFallback(_versionFallback);\n _hashedName = keccak256(bytes(name));\n _hashedVersion = keccak256(bytes(version));\n\n _cachedChainId = block.chainid;\n _cachedDomainSeparator = _buildDomainSeparator();\n _cachedThis = address(this);\n }\n\n /**\n * @dev Returns the domain separator for the current chain.\n */\n function _domainSeparatorV4() internal view returns (bytes32) {\n if (address(this) == _cachedThis && block.chainid == _cachedChainId) {\n return _cachedDomainSeparator;\n } else {\n return _buildDomainSeparator();\n }\n }\n\n function _buildDomainSeparator() private view returns (bytes32) {\n return keccak256(abi.encode(TYPE_HASH, _hashedName, _hashedVersion, block.chainid, address(this)));\n }\n\n /**\n * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this\n * function returns the hash of the fully encoded EIP712 message for this domain.\n *\n * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example:\n *\n * ```solidity\n * bytes32 digest = _hashTypedDataV4(keccak256(abi.encode(\n * keccak256(\"Mail(address to,string contents)\"),\n * mailTo,\n * keccak256(bytes(mailContents))\n * )));\n * address signer = ECDSA.recover(digest, signature);\n * ```\n */\n function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) {\n return MessageHashUtils.toTypedDataHash(_domainSeparatorV4(), structHash);\n }\n\n /**\n * @dev See {IERC-5267}.\n */\n function eip712Domain()\n public\n view\n virtual\n returns (\n bytes1 fields,\n string memory name,\n string memory version,\n uint256 chainId,\n address verifyingContract,\n bytes32 salt,\n uint256[] memory extensions\n )\n {\n return (\n hex\"0f\", // 01111\n _EIP712Name(),\n _EIP712Version(),\n block.chainid,\n address(this),\n bytes32(0),\n new uint256[](0)\n );\n }\n\n /**\n * @dev The name parameter for the EIP712 domain.\n *\n * NOTE: By default this function reads _name which is an immutable value.\n * It only reads from storage if necessary (in case the value is too large to fit in a ShortString).\n */\n // solhint-disable-next-line func-name-mixedcase\n function _EIP712Name() internal view returns (string memory) {\n return _name.toStringWithFallback(_nameFallback);\n }\n\n /**\n * @dev The version parameter for the EIP712 domain.\n *\n * NOTE: By default this function reads _version which is an immutable value.\n * It only reads from storage if necessary (in case the value is too large to fit in a ShortString).\n */\n // solhint-disable-next-line func-name-mixedcase\n function _EIP712Version() internal view returns (string memory) {\n return _version.toStringWithFallback(_versionFallback);\n }\n}\n" + }, + "@openzeppelin/contracts/utils/cryptography/MessageHashUtils.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/cryptography/MessageHashUtils.sol)\n\npragma solidity ^0.8.20;\n\nimport {Strings} from \"../Strings.sol\";\n\n/**\n * @dev Signature message hash utilities for producing digests to be consumed by {ECDSA} recovery or signing.\n *\n * The library provides methods for generating a hash of a message that conforms to the\n * https://eips.ethereum.org/EIPS/eip-191[ERC-191] and https://eips.ethereum.org/EIPS/eip-712[EIP 712]\n * specifications.\n */\nlibrary MessageHashUtils {\n /**\n * @dev Returns the keccak256 digest of an ERC-191 signed data with version\n * `0x45` (`personal_sign` messages).\n *\n * The digest is calculated by prefixing a bytes32 `messageHash` with\n * `\"\\x19Ethereum Signed Message:\\n32\"` and hashing the result. It corresponds with the\n * hash signed when using the https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] JSON-RPC method.\n *\n * NOTE: The `messageHash` parameter is intended to be the result of hashing a raw message with\n * keccak256, although any bytes32 value can be safely used because the final digest will\n * be re-hashed.\n *\n * See {ECDSA-recover}.\n */\n function toEthSignedMessageHash(bytes32 messageHash) internal pure returns (bytes32 digest) {\n assembly (\"memory-safe\") {\n mstore(0x00, \"\\x19Ethereum Signed Message:\\n32\") // 32 is the bytes-length of messageHash\n mstore(0x1c, messageHash) // 0x1c (28) is the length of the prefix\n digest := keccak256(0x00, 0x3c) // 0x3c is the length of the prefix (0x1c) + messageHash (0x20)\n }\n }\n\n /**\n * @dev Returns the keccak256 digest of an ERC-191 signed data with version\n * `0x45` (`personal_sign` messages).\n *\n * The digest is calculated by prefixing an arbitrary `message` with\n * `\"\\x19Ethereum Signed Message:\\n\" + len(message)` and hashing the result. It corresponds with the\n * hash signed when using the https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] JSON-RPC method.\n *\n * See {ECDSA-recover}.\n */\n function toEthSignedMessageHash(bytes memory message) internal pure returns (bytes32) {\n return\n keccak256(bytes.concat(\"\\x19Ethereum Signed Message:\\n\", bytes(Strings.toString(message.length)), message));\n }\n\n /**\n * @dev Returns the keccak256 digest of an ERC-191 signed data with version\n * `0x00` (data with intended validator).\n *\n * The digest is calculated by prefixing an arbitrary `data` with `\"\\x19\\x00\"` and the intended\n * `validator` address. Then hashing the result.\n *\n * See {ECDSA-recover}.\n */\n function toDataWithIntendedValidatorHash(address validator, bytes memory data) internal pure returns (bytes32) {\n return keccak256(abi.encodePacked(hex\"19_00\", validator, data));\n }\n\n /**\n * @dev Returns the keccak256 digest of an EIP-712 typed data (ERC-191 version `0x01`).\n *\n * The digest is calculated from a `domainSeparator` and a `structHash`, by prefixing them with\n * `\\x19\\x01` and hashing the result. It corresponds to the hash signed by the\n * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`] JSON-RPC method as part of EIP-712.\n *\n * See {ECDSA-recover}.\n */\n function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32 digest) {\n assembly (\"memory-safe\") {\n let ptr := mload(0x40)\n mstore(ptr, hex\"19_01\")\n mstore(add(ptr, 0x02), domainSeparator)\n mstore(add(ptr, 0x22), structHash)\n digest := keccak256(ptr, 0x42)\n }\n }\n}\n" + }, + "@openzeppelin/contracts/utils/cryptography/SignatureChecker.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/cryptography/SignatureChecker.sol)\n\npragma solidity ^0.8.20;\n\nimport {ECDSA} from \"./ECDSA.sol\";\nimport {IERC1271} from \"../../interfaces/IERC1271.sol\";\n\n/**\n * @dev Signature verification helper that can be used instead of `ECDSA.recover` to seamlessly support both ECDSA\n * signatures from externally owned accounts (EOAs) as well as ERC-1271 signatures from smart contract wallets like\n * Argent and Safe Wallet (previously Gnosis Safe).\n */\nlibrary SignatureChecker {\n /**\n * @dev Checks if a signature is valid for a given signer and data hash. If the signer is a smart contract, the\n * signature is validated against that smart contract using ERC-1271, otherwise it's validated using `ECDSA.recover`.\n *\n * NOTE: Unlike ECDSA signatures, contract signatures are revocable, and the outcome of this function can thus\n * change through time. It could return true at block N and false at block N+1 (or the opposite).\n */\n function isValidSignatureNow(address signer, bytes32 hash, bytes memory signature) internal view returns (bool) {\n if (signer.code.length == 0) {\n (address recovered, ECDSA.RecoverError err, ) = ECDSA.tryRecover(hash, signature);\n return err == ECDSA.RecoverError.NoError && recovered == signer;\n } else {\n return isValidERC1271SignatureNow(signer, hash, signature);\n }\n }\n\n /**\n * @dev Checks if a signature is valid for a given signer and data hash. The signature is validated\n * against the signer smart contract using ERC-1271.\n *\n * NOTE: Unlike ECDSA signatures, contract signatures are revocable, and the outcome of this function can thus\n * change through time. It could return true at block N and false at block N+1 (or the opposite).\n */\n function isValidERC1271SignatureNow(\n address signer,\n bytes32 hash,\n bytes memory signature\n ) internal view returns (bool) {\n (bool success, bytes memory result) = signer.staticcall(\n abi.encodeCall(IERC1271.isValidSignature, (hash, signature))\n );\n return (success &&\n result.length >= 32 &&\n abi.decode(result, (bytes32)) == bytes32(IERC1271.isValidSignature.selector));\n }\n}\n" + }, + "@openzeppelin/contracts/utils/Errors.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/Errors.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Collection of common custom errors used in multiple contracts\n *\n * IMPORTANT: Backwards compatibility is not guaranteed in future versions of the library.\n * It is recommended to avoid relying on the error API for critical functionality.\n *\n * _Available since v5.1._\n */\nlibrary Errors {\n /**\n * @dev The ETH balance of the account is not enough to perform the operation.\n */\n error InsufficientBalance(uint256 balance, uint256 needed);\n\n /**\n * @dev A call to an address target failed. The target may have reverted.\n */\n error FailedCall();\n\n /**\n * @dev The deployment failed.\n */\n error FailedDeployment();\n\n /**\n * @dev A necessary precompile is missing.\n */\n error MissingPrecompile(address);\n}\n" + }, + "@openzeppelin/contracts/utils/introspection/ERC165.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/introspection/ERC165.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC165} from \"./IERC165.sol\";\n\n/**\n * @dev Implementation of the {IERC165} interface.\n *\n * Contracts that want to implement ERC-165 should inherit from this contract and override {supportsInterface} to check\n * for the additional interface id that will be supported. For example:\n *\n * ```solidity\n * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);\n * }\n * ```\n */\nabstract contract ERC165 is IERC165 {\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) {\n return interfaceId == type(IERC165).interfaceId;\n }\n}\n" + }, + "@openzeppelin/contracts/utils/introspection/IERC165.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/introspection/IERC165.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Interface of the ERC-165 standard, as defined in the\n * https://eips.ethereum.org/EIPS/eip-165[ERC].\n *\n * Implementers can declare support of contract interfaces, which can then be\n * queried by others ({ERC165Checker}).\n *\n * For an implementation, see {ERC165}.\n */\ninterface IERC165 {\n /**\n * @dev Returns true if this contract implements the interface defined by\n * `interfaceId`. See the corresponding\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[ERC section]\n * to learn more about how these ids are created.\n *\n * This function call must use less than 30 000 gas.\n */\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\n}\n" + }, + "@openzeppelin/contracts/utils/math/Math.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/math/Math.sol)\n\npragma solidity ^0.8.20;\n\nimport {Panic} from \"../Panic.sol\";\nimport {SafeCast} from \"./SafeCast.sol\";\n\n/**\n * @dev Standard math utilities missing in the Solidity language.\n */\nlibrary Math {\n enum Rounding {\n Floor, // Toward negative infinity\n Ceil, // Toward positive infinity\n Trunc, // Toward zero\n Expand // Away from zero\n }\n\n /**\n * @dev Returns the addition of two unsigned integers, with an success flag (no overflow).\n */\n function tryAdd(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\n unchecked {\n uint256 c = a + b;\n if (c < a) return (false, 0);\n return (true, c);\n }\n }\n\n /**\n * @dev Returns the subtraction of two unsigned integers, with an success flag (no overflow).\n */\n function trySub(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\n unchecked {\n if (b > a) return (false, 0);\n return (true, a - b);\n }\n }\n\n /**\n * @dev Returns the multiplication of two unsigned integers, with an success flag (no overflow).\n */\n function tryMul(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\n unchecked {\n // Gas optimization: this is cheaper than requiring 'a' not being zero, but the\n // benefit is lost if 'b' is also tested.\n // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522\n if (a == 0) return (true, 0);\n uint256 c = a * b;\n if (c / a != b) return (false, 0);\n return (true, c);\n }\n }\n\n /**\n * @dev Returns the division of two unsigned integers, with a success flag (no division by zero).\n */\n function tryDiv(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\n unchecked {\n if (b == 0) return (false, 0);\n return (true, a / b);\n }\n }\n\n /**\n * @dev Returns the remainder of dividing two unsigned integers, with a success flag (no division by zero).\n */\n function tryMod(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\n unchecked {\n if (b == 0) return (false, 0);\n return (true, a % b);\n }\n }\n\n /**\n * @dev Branchless ternary evaluation for `a ? b : c`. Gas costs are constant.\n *\n * IMPORTANT: This function may reduce bytecode size and consume less gas when used standalone.\n * However, the compiler may optimize Solidity ternary operations (i.e. `a ? b : c`) to only compute\n * one branch when needed, making this function more expensive.\n */\n function ternary(bool condition, uint256 a, uint256 b) internal pure returns (uint256) {\n unchecked {\n // branchless ternary works because:\n // b ^ (a ^ b) == a\n // b ^ 0 == b\n return b ^ ((a ^ b) * SafeCast.toUint(condition));\n }\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 ternary(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 ternary(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 towards infinity instead\n * of rounding towards zero.\n */\n function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {\n if (b == 0) {\n // Guarantee the same behavior as in a regular Solidity division.\n Panic.panic(Panic.DIVISION_BY_ZERO);\n }\n\n // The following calculation ensures accurate ceiling division without overflow.\n // Since a is non-zero, (a - 1) / b will not overflow.\n // The largest possible result occurs when (a - 1) / b is type(uint256).max,\n // but the largest value we can obtain is type(uint256).max - 1, which happens\n // when a = type(uint256).max and b = 1.\n unchecked {\n return SafeCast.toUint(a > 0) * ((a - 1) / b + 1);\n }\n }\n\n /**\n * @dev Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or\n * denominator == 0.\n *\n * Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv) with further edits by\n * 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²⁵⁶ and mod 2²⁵⁶ - 1, then use\n // the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256\n // variables such that product = prod1 * 2²⁵⁶ + prod0.\n uint256 prod0 = x * y; // 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 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²⁵⁶. Also prevents denominator == 0.\n if (denominator <= prod1) {\n Panic.panic(ternary(denominator == 0, Panic.DIVISION_BY_ZERO, Panic.UNDER_OVERFLOW));\n }\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.\n // Always >= 1. See https://cs.stackexchange.com/q/138556/92363.\n\n uint256 twos = denominator & (0 - denominator);\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²⁵⁶ / 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²⁵⁶. Now that denominator is an odd number, it has an inverse modulo 2²⁵⁶ such\n // that denominator * inv ≡ 1 mod 2²⁵⁶. Compute the inverse by starting with a seed that is correct for\n // four bits. That is, denominator * inv ≡ 1 mod 2⁴.\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\n // works in modular arithmetic, doubling the correct bits in each step.\n inverse *= 2 - denominator * inverse; // inverse mod 2⁸\n inverse *= 2 - denominator * inverse; // inverse mod 2¹⁶\n inverse *= 2 - denominator * inverse; // inverse mod 2³²\n inverse *= 2 - denominator * inverse; // inverse mod 2⁶⁴\n inverse *= 2 - denominator * inverse; // inverse mod 2¹²⁸\n inverse *= 2 - denominator * inverse; // inverse mod 2²⁵⁶\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²⁵⁶. Since the preconditions guarantee that the outcome is\n // less than 2²⁵⁶, 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 * @dev 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 return mulDiv(x, y, denominator) + SafeCast.toUint(unsignedRoundsUp(rounding) && mulmod(x, y, denominator) > 0);\n }\n\n /**\n * @dev Calculate the modular multiplicative inverse of a number in Z/nZ.\n *\n * If n is a prime, then Z/nZ is a field. In that case all elements are inversible, except 0.\n * If n is not a prime, then Z/nZ is not a field, and some elements might not be inversible.\n *\n * If the input value is not inversible, 0 is returned.\n *\n * NOTE: If you know for sure that n is (big) a prime, it may be cheaper to use Fermat's little theorem and get the\n * inverse using `Math.modExp(a, n - 2, n)`. See {invModPrime}.\n */\n function invMod(uint256 a, uint256 n) internal pure returns (uint256) {\n unchecked {\n if (n == 0) return 0;\n\n // The inverse modulo is calculated using the Extended Euclidean Algorithm (iterative version)\n // Used to compute integers x and y such that: ax + ny = gcd(a, n).\n // When the gcd is 1, then the inverse of a modulo n exists and it's x.\n // ax + ny = 1\n // ax = 1 + (-y)n\n // ax ≡ 1 (mod n) # x is the inverse of a modulo n\n\n // If the remainder is 0 the gcd is n right away.\n uint256 remainder = a % n;\n uint256 gcd = n;\n\n // Therefore the initial coefficients are:\n // ax + ny = gcd(a, n) = n\n // 0a + 1n = n\n int256 x = 0;\n int256 y = 1;\n\n while (remainder != 0) {\n uint256 quotient = gcd / remainder;\n\n (gcd, remainder) = (\n // The old remainder is the next gcd to try.\n remainder,\n // Compute the next remainder.\n // Can't overflow given that (a % gcd) * (gcd // (a % gcd)) <= gcd\n // where gcd is at most n (capped to type(uint256).max)\n gcd - remainder * quotient\n );\n\n (x, y) = (\n // Increment the coefficient of a.\n y,\n // Decrement the coefficient of n.\n // Can overflow, but the result is casted to uint256 so that the\n // next value of y is \"wrapped around\" to a value between 0 and n - 1.\n x - y * int256(quotient)\n );\n }\n\n if (gcd != 1) return 0; // No inverse exists.\n return ternary(x < 0, n - uint256(-x), uint256(x)); // Wrap the result if it's negative.\n }\n }\n\n /**\n * @dev Variant of {invMod}. More efficient, but only works if `p` is known to be a prime greater than `2`.\n *\n * From https://en.wikipedia.org/wiki/Fermat%27s_little_theorem[Fermat's little theorem], we know that if p is\n * prime, then `a**(p-1) ≡ 1 mod p`. As a consequence, we have `a * a**(p-2) ≡ 1 mod p`, which means that\n * `a**(p-2)` is the modular multiplicative inverse of a in Fp.\n *\n * NOTE: this function does NOT check that `p` is a prime greater than `2`.\n */\n function invModPrime(uint256 a, uint256 p) internal view returns (uint256) {\n unchecked {\n return Math.modExp(a, p - 2, p);\n }\n }\n\n /**\n * @dev Returns the modular exponentiation of the specified base, exponent and modulus (b ** e % m)\n *\n * Requirements:\n * - modulus can't be zero\n * - underlying staticcall to precompile must succeed\n *\n * IMPORTANT: The result is only valid if the underlying call succeeds. When using this function, make\n * sure the chain you're using it on supports the precompiled contract for modular exponentiation\n * at address 0x05 as specified in https://eips.ethereum.org/EIPS/eip-198[EIP-198]. Otherwise,\n * the underlying function will succeed given the lack of a revert, but the result may be incorrectly\n * interpreted as 0.\n */\n function modExp(uint256 b, uint256 e, uint256 m) internal view returns (uint256) {\n (bool success, uint256 result) = tryModExp(b, e, m);\n if (!success) {\n Panic.panic(Panic.DIVISION_BY_ZERO);\n }\n return result;\n }\n\n /**\n * @dev Returns the modular exponentiation of the specified base, exponent and modulus (b ** e % m).\n * It includes a success flag indicating if the operation succeeded. Operation will be marked as failed if trying\n * to operate modulo 0 or if the underlying precompile reverted.\n *\n * IMPORTANT: The result is only valid if the success flag is true. When using this function, make sure the chain\n * you're using it on supports the precompiled contract for modular exponentiation at address 0x05 as specified in\n * https://eips.ethereum.org/EIPS/eip-198[EIP-198]. Otherwise, the underlying function will succeed given the lack\n * of a revert, but the result may be incorrectly interpreted as 0.\n */\n function tryModExp(uint256 b, uint256 e, uint256 m) internal view returns (bool success, uint256 result) {\n if (m == 0) return (false, 0);\n assembly (\"memory-safe\") {\n let ptr := mload(0x40)\n // | Offset | Content | Content (Hex) |\n // |-----------|------------|--------------------------------------------------------------------|\n // | 0x00:0x1f | size of b | 0x0000000000000000000000000000000000000000000000000000000000000020 |\n // | 0x20:0x3f | size of e | 0x0000000000000000000000000000000000000000000000000000000000000020 |\n // | 0x40:0x5f | size of m | 0x0000000000000000000000000000000000000000000000000000000000000020 |\n // | 0x60:0x7f | value of b | 0x<.............................................................b> |\n // | 0x80:0x9f | value of e | 0x<.............................................................e> |\n // | 0xa0:0xbf | value of m | 0x<.............................................................m> |\n mstore(ptr, 0x20)\n mstore(add(ptr, 0x20), 0x20)\n mstore(add(ptr, 0x40), 0x20)\n mstore(add(ptr, 0x60), b)\n mstore(add(ptr, 0x80), e)\n mstore(add(ptr, 0xa0), m)\n\n // Given the result < m, it's guaranteed to fit in 32 bytes,\n // so we can use the memory scratch space located at offset 0.\n success := staticcall(gas(), 0x05, ptr, 0xc0, 0x00, 0x20)\n result := mload(0x00)\n }\n }\n\n /**\n * @dev Variant of {modExp} that supports inputs of arbitrary length.\n */\n function modExp(bytes memory b, bytes memory e, bytes memory m) internal view returns (bytes memory) {\n (bool success, bytes memory result) = tryModExp(b, e, m);\n if (!success) {\n Panic.panic(Panic.DIVISION_BY_ZERO);\n }\n return result;\n }\n\n /**\n * @dev Variant of {tryModExp} that supports inputs of arbitrary length.\n */\n function tryModExp(\n bytes memory b,\n bytes memory e,\n bytes memory m\n ) internal view returns (bool success, bytes memory result) {\n if (_zeroBytes(m)) return (false, new bytes(0));\n\n uint256 mLen = m.length;\n\n // Encode call args in result and move the free memory pointer\n result = abi.encodePacked(b.length, e.length, mLen, b, e, m);\n\n assembly (\"memory-safe\") {\n let dataPtr := add(result, 0x20)\n // Write result on top of args to avoid allocating extra memory.\n success := staticcall(gas(), 0x05, dataPtr, mload(result), dataPtr, mLen)\n // Overwrite the length.\n // result.length > returndatasize() is guaranteed because returndatasize() == m.length\n mstore(result, mLen)\n // Set the memory pointer after the returned data.\n mstore(0x40, add(dataPtr, mLen))\n }\n }\n\n /**\n * @dev Returns whether the provided byte array is zero.\n */\n function _zeroBytes(bytes memory byteArray) private pure returns (bool) {\n for (uint256 i = 0; i < byteArray.length; ++i) {\n if (byteArray[i] != 0) {\n return false;\n }\n }\n return true;\n }\n\n /**\n * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded\n * towards zero.\n *\n * This method is based on Newton's method for computing square roots; the algorithm is restricted to only\n * using integer operations.\n */\n function sqrt(uint256 a) internal pure returns (uint256) {\n unchecked {\n // Take care of easy edge cases when a == 0 or a == 1\n if (a <= 1) {\n return a;\n }\n\n // In this function, we use Newton's method to get a root of `f(x) := x² - a`. It involves building a\n // sequence x_n that converges toward sqrt(a). For each iteration x_n, we also define the error between\n // the current value as `ε_n = | x_n - sqrt(a) |`.\n //\n // For our first estimation, we consider `e` the smallest power of 2 which is bigger than the square root\n // of the target. (i.e. `2**(e-1) ≤ sqrt(a) < 2**e`). We know that `e ≤ 128` because `(2¹²⁸)² = 2²⁵⁶` is\n // bigger than any uint256.\n //\n // By noticing that\n // `2**(e-1) ≤ sqrt(a) < 2**e → (2**(e-1))² ≤ a < (2**e)² → 2**(2*e-2) ≤ a < 2**(2*e)`\n // we can deduce that `e - 1` is `log2(a) / 2`. We can thus compute `x_n = 2**(e-1)` using a method similar\n // to the msb function.\n uint256 aa = a;\n uint256 xn = 1;\n\n if (aa >= (1 << 128)) {\n aa >>= 128;\n xn <<= 64;\n }\n if (aa >= (1 << 64)) {\n aa >>= 64;\n xn <<= 32;\n }\n if (aa >= (1 << 32)) {\n aa >>= 32;\n xn <<= 16;\n }\n if (aa >= (1 << 16)) {\n aa >>= 16;\n xn <<= 8;\n }\n if (aa >= (1 << 8)) {\n aa >>= 8;\n xn <<= 4;\n }\n if (aa >= (1 << 4)) {\n aa >>= 4;\n xn <<= 2;\n }\n if (aa >= (1 << 2)) {\n xn <<= 1;\n }\n\n // We now have x_n such that `x_n = 2**(e-1) ≤ sqrt(a) < 2**e = 2 * x_n`. This implies ε_n ≤ 2**(e-1).\n //\n // We can refine our estimation by noticing that the middle of that interval minimizes the error.\n // If we move x_n to equal 2**(e-1) + 2**(e-2), then we reduce the error to ε_n ≤ 2**(e-2).\n // This is going to be our x_0 (and ε_0)\n xn = (3 * xn) >> 1; // ε_0 := | x_0 - sqrt(a) | ≤ 2**(e-2)\n\n // From here, Newton's method give us:\n // x_{n+1} = (x_n + a / x_n) / 2\n //\n // One should note that:\n // x_{n+1}² - a = ((x_n + a / x_n) / 2)² - a\n // = ((x_n² + a) / (2 * x_n))² - a\n // = (x_n⁴ + 2 * a * x_n² + a²) / (4 * x_n²) - a\n // = (x_n⁴ + 2 * a * x_n² + a² - 4 * a * x_n²) / (4 * x_n²)\n // = (x_n⁴ - 2 * a * x_n² + a²) / (4 * x_n²)\n // = (x_n² - a)² / (2 * x_n)²\n // = ((x_n² - a) / (2 * x_n))²\n // ≥ 0\n // Which proves that for all n ≥ 1, sqrt(a) ≤ x_n\n //\n // This gives us the proof of quadratic convergence of the sequence:\n // ε_{n+1} = | x_{n+1} - sqrt(a) |\n // = | (x_n + a / x_n) / 2 - sqrt(a) |\n // = | (x_n² + a - 2*x_n*sqrt(a)) / (2 * x_n) |\n // = | (x_n - sqrt(a))² / (2 * x_n) |\n // = | ε_n² / (2 * x_n) |\n // = ε_n² / | (2 * x_n) |\n //\n // For the first iteration, we have a special case where x_0 is known:\n // ε_1 = ε_0² / | (2 * x_0) |\n // ≤ (2**(e-2))² / (2 * (2**(e-1) + 2**(e-2)))\n // ≤ 2**(2*e-4) / (3 * 2**(e-1))\n // ≤ 2**(e-3) / 3\n // ≤ 2**(e-3-log2(3))\n // ≤ 2**(e-4.5)\n //\n // For the following iterations, we use the fact that, 2**(e-1) ≤ sqrt(a) ≤ x_n:\n // ε_{n+1} = ε_n² / | (2 * x_n) |\n // ≤ (2**(e-k))² / (2 * 2**(e-1))\n // ≤ 2**(2*e-2*k) / 2**e\n // ≤ 2**(e-2*k)\n xn = (xn + a / xn) >> 1; // ε_1 := | x_1 - sqrt(a) | ≤ 2**(e-4.5) -- special case, see above\n xn = (xn + a / xn) >> 1; // ε_2 := | x_2 - sqrt(a) | ≤ 2**(e-9) -- general case with k = 4.5\n xn = (xn + a / xn) >> 1; // ε_3 := | x_3 - sqrt(a) | ≤ 2**(e-18) -- general case with k = 9\n xn = (xn + a / xn) >> 1; // ε_4 := | x_4 - sqrt(a) | ≤ 2**(e-36) -- general case with k = 18\n xn = (xn + a / xn) >> 1; // ε_5 := | x_5 - sqrt(a) | ≤ 2**(e-72) -- general case with k = 36\n xn = (xn + a / xn) >> 1; // ε_6 := | x_6 - sqrt(a) | ≤ 2**(e-144) -- general case with k = 72\n\n // Because e ≤ 128 (as discussed during the first estimation phase), we know have reached a precision\n // ε_6 ≤ 2**(e-144) < 1. Given we're operating on integers, then we can ensure that xn is now either\n // sqrt(a) or sqrt(a) + 1.\n return xn - SafeCast.toUint(xn > a / xn);\n }\n }\n\n /**\n * @dev 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 + SafeCast.toUint(unsignedRoundsUp(rounding) && result * result < a);\n }\n }\n\n /**\n * @dev Return the log in base 2 of a positive value rounded towards zero.\n * Returns 0 if given 0.\n */\n function log2(uint256 value) internal pure returns (uint256) {\n uint256 result = 0;\n uint256 exp;\n unchecked {\n exp = 128 * SafeCast.toUint(value > (1 << 128) - 1);\n value >>= exp;\n result += exp;\n\n exp = 64 * SafeCast.toUint(value > (1 << 64) - 1);\n value >>= exp;\n result += exp;\n\n exp = 32 * SafeCast.toUint(value > (1 << 32) - 1);\n value >>= exp;\n result += exp;\n\n exp = 16 * SafeCast.toUint(value > (1 << 16) - 1);\n value >>= exp;\n result += exp;\n\n exp = 8 * SafeCast.toUint(value > (1 << 8) - 1);\n value >>= exp;\n result += exp;\n\n exp = 4 * SafeCast.toUint(value > (1 << 4) - 1);\n value >>= exp;\n result += exp;\n\n exp = 2 * SafeCast.toUint(value > (1 << 2) - 1);\n value >>= exp;\n result += exp;\n\n result += SafeCast.toUint(value > 1);\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 + SafeCast.toUint(unsignedRoundsUp(rounding) && 1 << result < value);\n }\n }\n\n /**\n * @dev Return the log in base 10 of a positive value rounded towards zero.\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 + SafeCast.toUint(unsignedRoundsUp(rounding) && 10 ** result < value);\n }\n }\n\n /**\n * @dev Return the log in base 256 of a positive value rounded towards zero.\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 uint256 isGt;\n unchecked {\n isGt = SafeCast.toUint(value > (1 << 128) - 1);\n value >>= isGt * 128;\n result += isGt * 16;\n\n isGt = SafeCast.toUint(value > (1 << 64) - 1);\n value >>= isGt * 64;\n result += isGt * 8;\n\n isGt = SafeCast.toUint(value > (1 << 32) - 1);\n value >>= isGt * 32;\n result += isGt * 4;\n\n isGt = SafeCast.toUint(value > (1 << 16) - 1);\n value >>= isGt * 16;\n result += isGt * 2;\n\n result += SafeCast.toUint(value > (1 << 8) - 1);\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 + SafeCast.toUint(unsignedRoundsUp(rounding) && 1 << (result << 3) < value);\n }\n }\n\n /**\n * @dev Returns whether a provided rounding mode is considered rounding up for unsigned integers.\n */\n function unsignedRoundsUp(Rounding rounding) internal pure returns (bool) {\n return uint8(rounding) % 2 == 1;\n }\n}\n" + }, + "@openzeppelin/contracts/utils/math/SafeCast.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/math/SafeCast.sol)\n// This file was procedurally generated from scripts/generate/templates/SafeCast.js.\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Wrappers over Solidity's uintXX/intXX/bool casting operators with added overflow\n * checks.\n *\n * Downcasting from uint256/int256 in Solidity does not revert on overflow. This can\n * easily result in undesired exploitation or bugs, since developers usually\n * assume that overflows raise errors. `SafeCast` restores this intuition by\n * reverting the transaction when such an operation overflows.\n *\n * Using this library instead of the unchecked operations eliminates an entire\n * class of bugs, so it's recommended to use it always.\n */\nlibrary SafeCast {\n /**\n * @dev Value doesn't fit in an uint of `bits` size.\n */\n error SafeCastOverflowedUintDowncast(uint8 bits, uint256 value);\n\n /**\n * @dev An int value doesn't fit in an uint of `bits` size.\n */\n error SafeCastOverflowedIntToUint(int256 value);\n\n /**\n * @dev Value doesn't fit in an int of `bits` size.\n */\n error SafeCastOverflowedIntDowncast(uint8 bits, int256 value);\n\n /**\n * @dev An uint value doesn't fit in an int of `bits` size.\n */\n error SafeCastOverflowedUintToInt(uint256 value);\n\n /**\n * @dev Returns the downcasted uint248 from uint256, reverting on\n * overflow (when the input is greater than largest uint248).\n *\n * Counterpart to Solidity's `uint248` operator.\n *\n * Requirements:\n *\n * - input must fit into 248 bits\n */\n function toUint248(uint256 value) internal pure returns (uint248) {\n if (value > type(uint248).max) {\n revert SafeCastOverflowedUintDowncast(248, value);\n }\n return uint248(value);\n }\n\n /**\n * @dev Returns the downcasted uint240 from uint256, reverting on\n * overflow (when the input is greater than largest uint240).\n *\n * Counterpart to Solidity's `uint240` operator.\n *\n * Requirements:\n *\n * - input must fit into 240 bits\n */\n function toUint240(uint256 value) internal pure returns (uint240) {\n if (value > type(uint240).max) {\n revert SafeCastOverflowedUintDowncast(240, value);\n }\n return uint240(value);\n }\n\n /**\n * @dev Returns the downcasted uint232 from uint256, reverting on\n * overflow (when the input is greater than largest uint232).\n *\n * Counterpart to Solidity's `uint232` operator.\n *\n * Requirements:\n *\n * - input must fit into 232 bits\n */\n function toUint232(uint256 value) internal pure returns (uint232) {\n if (value > type(uint232).max) {\n revert SafeCastOverflowedUintDowncast(232, value);\n }\n return uint232(value);\n }\n\n /**\n * @dev Returns the downcasted uint224 from uint256, reverting on\n * overflow (when the input is greater than largest uint224).\n *\n * Counterpart to Solidity's `uint224` operator.\n *\n * Requirements:\n *\n * - input must fit into 224 bits\n */\n function toUint224(uint256 value) internal pure returns (uint224) {\n if (value > type(uint224).max) {\n revert SafeCastOverflowedUintDowncast(224, value);\n }\n return uint224(value);\n }\n\n /**\n * @dev Returns the downcasted uint216 from uint256, reverting on\n * overflow (when the input is greater than largest uint216).\n *\n * Counterpart to Solidity's `uint216` operator.\n *\n * Requirements:\n *\n * - input must fit into 216 bits\n */\n function toUint216(uint256 value) internal pure returns (uint216) {\n if (value > type(uint216).max) {\n revert SafeCastOverflowedUintDowncast(216, value);\n }\n return uint216(value);\n }\n\n /**\n * @dev Returns the downcasted uint208 from uint256, reverting on\n * overflow (when the input is greater than largest uint208).\n *\n * Counterpart to Solidity's `uint208` operator.\n *\n * Requirements:\n *\n * - input must fit into 208 bits\n */\n function toUint208(uint256 value) internal pure returns (uint208) {\n if (value > type(uint208).max) {\n revert SafeCastOverflowedUintDowncast(208, value);\n }\n return uint208(value);\n }\n\n /**\n * @dev Returns the downcasted uint200 from uint256, reverting on\n * overflow (when the input is greater than largest uint200).\n *\n * Counterpart to Solidity's `uint200` operator.\n *\n * Requirements:\n *\n * - input must fit into 200 bits\n */\n function toUint200(uint256 value) internal pure returns (uint200) {\n if (value > type(uint200).max) {\n revert SafeCastOverflowedUintDowncast(200, value);\n }\n return uint200(value);\n }\n\n /**\n * @dev Returns the downcasted uint192 from uint256, reverting on\n * overflow (when the input is greater than largest uint192).\n *\n * Counterpart to Solidity's `uint192` operator.\n *\n * Requirements:\n *\n * - input must fit into 192 bits\n */\n function toUint192(uint256 value) internal pure returns (uint192) {\n if (value > type(uint192).max) {\n revert SafeCastOverflowedUintDowncast(192, value);\n }\n return uint192(value);\n }\n\n /**\n * @dev Returns the downcasted uint184 from uint256, reverting on\n * overflow (when the input is greater than largest uint184).\n *\n * Counterpart to Solidity's `uint184` operator.\n *\n * Requirements:\n *\n * - input must fit into 184 bits\n */\n function toUint184(uint256 value) internal pure returns (uint184) {\n if (value > type(uint184).max) {\n revert SafeCastOverflowedUintDowncast(184, value);\n }\n return uint184(value);\n }\n\n /**\n * @dev Returns the downcasted uint176 from uint256, reverting on\n * overflow (when the input is greater than largest uint176).\n *\n * Counterpart to Solidity's `uint176` operator.\n *\n * Requirements:\n *\n * - input must fit into 176 bits\n */\n function toUint176(uint256 value) internal pure returns (uint176) {\n if (value > type(uint176).max) {\n revert SafeCastOverflowedUintDowncast(176, value);\n }\n return uint176(value);\n }\n\n /**\n * @dev Returns the downcasted uint168 from uint256, reverting on\n * overflow (when the input is greater than largest uint168).\n *\n * Counterpart to Solidity's `uint168` operator.\n *\n * Requirements:\n *\n * - input must fit into 168 bits\n */\n function toUint168(uint256 value) internal pure returns (uint168) {\n if (value > type(uint168).max) {\n revert SafeCastOverflowedUintDowncast(168, value);\n }\n return uint168(value);\n }\n\n /**\n * @dev Returns the downcasted uint160 from uint256, reverting on\n * overflow (when the input is greater than largest uint160).\n *\n * Counterpart to Solidity's `uint160` operator.\n *\n * Requirements:\n *\n * - input must fit into 160 bits\n */\n function toUint160(uint256 value) internal pure returns (uint160) {\n if (value > type(uint160).max) {\n revert SafeCastOverflowedUintDowncast(160, value);\n }\n return uint160(value);\n }\n\n /**\n * @dev Returns the downcasted uint152 from uint256, reverting on\n * overflow (when the input is greater than largest uint152).\n *\n * Counterpart to Solidity's `uint152` operator.\n *\n * Requirements:\n *\n * - input must fit into 152 bits\n */\n function toUint152(uint256 value) internal pure returns (uint152) {\n if (value > type(uint152).max) {\n revert SafeCastOverflowedUintDowncast(152, value);\n }\n return uint152(value);\n }\n\n /**\n * @dev Returns the downcasted uint144 from uint256, reverting on\n * overflow (when the input is greater than largest uint144).\n *\n * Counterpart to Solidity's `uint144` operator.\n *\n * Requirements:\n *\n * - input must fit into 144 bits\n */\n function toUint144(uint256 value) internal pure returns (uint144) {\n if (value > type(uint144).max) {\n revert SafeCastOverflowedUintDowncast(144, value);\n }\n return uint144(value);\n }\n\n /**\n * @dev Returns the downcasted uint136 from uint256, reverting on\n * overflow (when the input is greater than largest uint136).\n *\n * Counterpart to Solidity's `uint136` operator.\n *\n * Requirements:\n *\n * - input must fit into 136 bits\n */\n function toUint136(uint256 value) internal pure returns (uint136) {\n if (value > type(uint136).max) {\n revert SafeCastOverflowedUintDowncast(136, value);\n }\n return uint136(value);\n }\n\n /**\n * @dev Returns the downcasted uint128 from uint256, reverting on\n * overflow (when the input is greater than largest uint128).\n *\n * Counterpart to Solidity's `uint128` operator.\n *\n * Requirements:\n *\n * - input must fit into 128 bits\n */\n function toUint128(uint256 value) internal pure returns (uint128) {\n if (value > type(uint128).max) {\n revert SafeCastOverflowedUintDowncast(128, value);\n }\n return uint128(value);\n }\n\n /**\n * @dev Returns the downcasted uint120 from uint256, reverting on\n * overflow (when the input is greater than largest uint120).\n *\n * Counterpart to Solidity's `uint120` operator.\n *\n * Requirements:\n *\n * - input must fit into 120 bits\n */\n function toUint120(uint256 value) internal pure returns (uint120) {\n if (value > type(uint120).max) {\n revert SafeCastOverflowedUintDowncast(120, value);\n }\n return uint120(value);\n }\n\n /**\n * @dev Returns the downcasted uint112 from uint256, reverting on\n * overflow (when the input is greater than largest uint112).\n *\n * Counterpart to Solidity's `uint112` operator.\n *\n * Requirements:\n *\n * - input must fit into 112 bits\n */\n function toUint112(uint256 value) internal pure returns (uint112) {\n if (value > type(uint112).max) {\n revert SafeCastOverflowedUintDowncast(112, value);\n }\n return uint112(value);\n }\n\n /**\n * @dev Returns the downcasted uint104 from uint256, reverting on\n * overflow (when the input is greater than largest uint104).\n *\n * Counterpart to Solidity's `uint104` operator.\n *\n * Requirements:\n *\n * - input must fit into 104 bits\n */\n function toUint104(uint256 value) internal pure returns (uint104) {\n if (value > type(uint104).max) {\n revert SafeCastOverflowedUintDowncast(104, value);\n }\n return uint104(value);\n }\n\n /**\n * @dev Returns the downcasted uint96 from uint256, reverting on\n * overflow (when the input is greater than largest uint96).\n *\n * Counterpart to Solidity's `uint96` operator.\n *\n * Requirements:\n *\n * - input must fit into 96 bits\n */\n function toUint96(uint256 value) internal pure returns (uint96) {\n if (value > type(uint96).max) {\n revert SafeCastOverflowedUintDowncast(96, value);\n }\n return uint96(value);\n }\n\n /**\n * @dev Returns the downcasted uint88 from uint256, reverting on\n * overflow (when the input is greater than largest uint88).\n *\n * Counterpart to Solidity's `uint88` operator.\n *\n * Requirements:\n *\n * - input must fit into 88 bits\n */\n function toUint88(uint256 value) internal pure returns (uint88) {\n if (value > type(uint88).max) {\n revert SafeCastOverflowedUintDowncast(88, value);\n }\n return uint88(value);\n }\n\n /**\n * @dev Returns the downcasted uint80 from uint256, reverting on\n * overflow (when the input is greater than largest uint80).\n *\n * Counterpart to Solidity's `uint80` operator.\n *\n * Requirements:\n *\n * - input must fit into 80 bits\n */\n function toUint80(uint256 value) internal pure returns (uint80) {\n if (value > type(uint80).max) {\n revert SafeCastOverflowedUintDowncast(80, value);\n }\n return uint80(value);\n }\n\n /**\n * @dev Returns the downcasted uint72 from uint256, reverting on\n * overflow (when the input is greater than largest uint72).\n *\n * Counterpart to Solidity's `uint72` operator.\n *\n * Requirements:\n *\n * - input must fit into 72 bits\n */\n function toUint72(uint256 value) internal pure returns (uint72) {\n if (value > type(uint72).max) {\n revert SafeCastOverflowedUintDowncast(72, value);\n }\n return uint72(value);\n }\n\n /**\n * @dev Returns the downcasted uint64 from uint256, reverting on\n * overflow (when the input is greater than largest uint64).\n *\n * Counterpart to Solidity's `uint64` operator.\n *\n * Requirements:\n *\n * - input must fit into 64 bits\n */\n function toUint64(uint256 value) internal pure returns (uint64) {\n if (value > type(uint64).max) {\n revert SafeCastOverflowedUintDowncast(64, value);\n }\n return uint64(value);\n }\n\n /**\n * @dev Returns the downcasted uint56 from uint256, reverting on\n * overflow (when the input is greater than largest uint56).\n *\n * Counterpart to Solidity's `uint56` operator.\n *\n * Requirements:\n *\n * - input must fit into 56 bits\n */\n function toUint56(uint256 value) internal pure returns (uint56) {\n if (value > type(uint56).max) {\n revert SafeCastOverflowedUintDowncast(56, value);\n }\n return uint56(value);\n }\n\n /**\n * @dev Returns the downcasted uint48 from uint256, reverting on\n * overflow (when the input is greater than largest uint48).\n *\n * Counterpart to Solidity's `uint48` operator.\n *\n * Requirements:\n *\n * - input must fit into 48 bits\n */\n function toUint48(uint256 value) internal pure returns (uint48) {\n if (value > type(uint48).max) {\n revert SafeCastOverflowedUintDowncast(48, value);\n }\n return uint48(value);\n }\n\n /**\n * @dev Returns the downcasted uint40 from uint256, reverting on\n * overflow (when the input is greater than largest uint40).\n *\n * Counterpart to Solidity's `uint40` operator.\n *\n * Requirements:\n *\n * - input must fit into 40 bits\n */\n function toUint40(uint256 value) internal pure returns (uint40) {\n if (value > type(uint40).max) {\n revert SafeCastOverflowedUintDowncast(40, value);\n }\n return uint40(value);\n }\n\n /**\n * @dev Returns the downcasted uint32 from uint256, reverting on\n * overflow (when the input is greater than largest uint32).\n *\n * Counterpart to Solidity's `uint32` operator.\n *\n * Requirements:\n *\n * - input must fit into 32 bits\n */\n function toUint32(uint256 value) internal pure returns (uint32) {\n if (value > type(uint32).max) {\n revert SafeCastOverflowedUintDowncast(32, value);\n }\n return uint32(value);\n }\n\n /**\n * @dev Returns the downcasted uint24 from uint256, reverting on\n * overflow (when the input is greater than largest uint24).\n *\n * Counterpart to Solidity's `uint24` operator.\n *\n * Requirements:\n *\n * - input must fit into 24 bits\n */\n function toUint24(uint256 value) internal pure returns (uint24) {\n if (value > type(uint24).max) {\n revert SafeCastOverflowedUintDowncast(24, value);\n }\n return uint24(value);\n }\n\n /**\n * @dev Returns the downcasted uint16 from uint256, reverting on\n * overflow (when the input is greater than largest uint16).\n *\n * Counterpart to Solidity's `uint16` operator.\n *\n * Requirements:\n *\n * - input must fit into 16 bits\n */\n function toUint16(uint256 value) internal pure returns (uint16) {\n if (value > type(uint16).max) {\n revert SafeCastOverflowedUintDowncast(16, value);\n }\n return uint16(value);\n }\n\n /**\n * @dev Returns the downcasted uint8 from uint256, reverting on\n * overflow (when the input is greater than largest uint8).\n *\n * Counterpart to Solidity's `uint8` operator.\n *\n * Requirements:\n *\n * - input must fit into 8 bits\n */\n function toUint8(uint256 value) internal pure returns (uint8) {\n if (value > type(uint8).max) {\n revert SafeCastOverflowedUintDowncast(8, value);\n }\n return uint8(value);\n }\n\n /**\n * @dev Converts a signed int256 into an unsigned uint256.\n *\n * Requirements:\n *\n * - input must be greater than or equal to 0.\n */\n function toUint256(int256 value) internal pure returns (uint256) {\n if (value < 0) {\n revert SafeCastOverflowedIntToUint(value);\n }\n return uint256(value);\n }\n\n /**\n * @dev Returns the downcasted int248 from int256, reverting on\n * overflow (when the input is less than smallest int248 or\n * greater than largest int248).\n *\n * Counterpart to Solidity's `int248` operator.\n *\n * Requirements:\n *\n * - input must fit into 248 bits\n */\n function toInt248(int256 value) internal pure returns (int248 downcasted) {\n downcasted = int248(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(248, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int240 from int256, reverting on\n * overflow (when the input is less than smallest int240 or\n * greater than largest int240).\n *\n * Counterpart to Solidity's `int240` operator.\n *\n * Requirements:\n *\n * - input must fit into 240 bits\n */\n function toInt240(int256 value) internal pure returns (int240 downcasted) {\n downcasted = int240(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(240, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int232 from int256, reverting on\n * overflow (when the input is less than smallest int232 or\n * greater than largest int232).\n *\n * Counterpart to Solidity's `int232` operator.\n *\n * Requirements:\n *\n * - input must fit into 232 bits\n */\n function toInt232(int256 value) internal pure returns (int232 downcasted) {\n downcasted = int232(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(232, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int224 from int256, reverting on\n * overflow (when the input is less than smallest int224 or\n * greater than largest int224).\n *\n * Counterpart to Solidity's `int224` operator.\n *\n * Requirements:\n *\n * - input must fit into 224 bits\n */\n function toInt224(int256 value) internal pure returns (int224 downcasted) {\n downcasted = int224(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(224, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int216 from int256, reverting on\n * overflow (when the input is less than smallest int216 or\n * greater than largest int216).\n *\n * Counterpart to Solidity's `int216` operator.\n *\n * Requirements:\n *\n * - input must fit into 216 bits\n */\n function toInt216(int256 value) internal pure returns (int216 downcasted) {\n downcasted = int216(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(216, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int208 from int256, reverting on\n * overflow (when the input is less than smallest int208 or\n * greater than largest int208).\n *\n * Counterpart to Solidity's `int208` operator.\n *\n * Requirements:\n *\n * - input must fit into 208 bits\n */\n function toInt208(int256 value) internal pure returns (int208 downcasted) {\n downcasted = int208(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(208, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int200 from int256, reverting on\n * overflow (when the input is less than smallest int200 or\n * greater than largest int200).\n *\n * Counterpart to Solidity's `int200` operator.\n *\n * Requirements:\n *\n * - input must fit into 200 bits\n */\n function toInt200(int256 value) internal pure returns (int200 downcasted) {\n downcasted = int200(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(200, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int192 from int256, reverting on\n * overflow (when the input is less than smallest int192 or\n * greater than largest int192).\n *\n * Counterpart to Solidity's `int192` operator.\n *\n * Requirements:\n *\n * - input must fit into 192 bits\n */\n function toInt192(int256 value) internal pure returns (int192 downcasted) {\n downcasted = int192(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(192, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int184 from int256, reverting on\n * overflow (when the input is less than smallest int184 or\n * greater than largest int184).\n *\n * Counterpart to Solidity's `int184` operator.\n *\n * Requirements:\n *\n * - input must fit into 184 bits\n */\n function toInt184(int256 value) internal pure returns (int184 downcasted) {\n downcasted = int184(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(184, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int176 from int256, reverting on\n * overflow (when the input is less than smallest int176 or\n * greater than largest int176).\n *\n * Counterpart to Solidity's `int176` operator.\n *\n * Requirements:\n *\n * - input must fit into 176 bits\n */\n function toInt176(int256 value) internal pure returns (int176 downcasted) {\n downcasted = int176(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(176, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int168 from int256, reverting on\n * overflow (when the input is less than smallest int168 or\n * greater than largest int168).\n *\n * Counterpart to Solidity's `int168` operator.\n *\n * Requirements:\n *\n * - input must fit into 168 bits\n */\n function toInt168(int256 value) internal pure returns (int168 downcasted) {\n downcasted = int168(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(168, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int160 from int256, reverting on\n * overflow (when the input is less than smallest int160 or\n * greater than largest int160).\n *\n * Counterpart to Solidity's `int160` operator.\n *\n * Requirements:\n *\n * - input must fit into 160 bits\n */\n function toInt160(int256 value) internal pure returns (int160 downcasted) {\n downcasted = int160(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(160, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int152 from int256, reverting on\n * overflow (when the input is less than smallest int152 or\n * greater than largest int152).\n *\n * Counterpart to Solidity's `int152` operator.\n *\n * Requirements:\n *\n * - input must fit into 152 bits\n */\n function toInt152(int256 value) internal pure returns (int152 downcasted) {\n downcasted = int152(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(152, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int144 from int256, reverting on\n * overflow (when the input is less than smallest int144 or\n * greater than largest int144).\n *\n * Counterpart to Solidity's `int144` operator.\n *\n * Requirements:\n *\n * - input must fit into 144 bits\n */\n function toInt144(int256 value) internal pure returns (int144 downcasted) {\n downcasted = int144(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(144, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int136 from int256, reverting on\n * overflow (when the input is less than smallest int136 or\n * greater than largest int136).\n *\n * Counterpart to Solidity's `int136` operator.\n *\n * Requirements:\n *\n * - input must fit into 136 bits\n */\n function toInt136(int256 value) internal pure returns (int136 downcasted) {\n downcasted = int136(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(136, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int128 from int256, reverting on\n * overflow (when the input is less than smallest int128 or\n * greater than largest int128).\n *\n * Counterpart to Solidity's `int128` operator.\n *\n * Requirements:\n *\n * - input must fit into 128 bits\n */\n function toInt128(int256 value) internal pure returns (int128 downcasted) {\n downcasted = int128(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(128, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int120 from int256, reverting on\n * overflow (when the input is less than smallest int120 or\n * greater than largest int120).\n *\n * Counterpart to Solidity's `int120` operator.\n *\n * Requirements:\n *\n * - input must fit into 120 bits\n */\n function toInt120(int256 value) internal pure returns (int120 downcasted) {\n downcasted = int120(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(120, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int112 from int256, reverting on\n * overflow (when the input is less than smallest int112 or\n * greater than largest int112).\n *\n * Counterpart to Solidity's `int112` operator.\n *\n * Requirements:\n *\n * - input must fit into 112 bits\n */\n function toInt112(int256 value) internal pure returns (int112 downcasted) {\n downcasted = int112(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(112, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int104 from int256, reverting on\n * overflow (when the input is less than smallest int104 or\n * greater than largest int104).\n *\n * Counterpart to Solidity's `int104` operator.\n *\n * Requirements:\n *\n * - input must fit into 104 bits\n */\n function toInt104(int256 value) internal pure returns (int104 downcasted) {\n downcasted = int104(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(104, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int96 from int256, reverting on\n * overflow (when the input is less than smallest int96 or\n * greater than largest int96).\n *\n * Counterpart to Solidity's `int96` operator.\n *\n * Requirements:\n *\n * - input must fit into 96 bits\n */\n function toInt96(int256 value) internal pure returns (int96 downcasted) {\n downcasted = int96(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(96, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int88 from int256, reverting on\n * overflow (when the input is less than smallest int88 or\n * greater than largest int88).\n *\n * Counterpart to Solidity's `int88` operator.\n *\n * Requirements:\n *\n * - input must fit into 88 bits\n */\n function toInt88(int256 value) internal pure returns (int88 downcasted) {\n downcasted = int88(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(88, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int80 from int256, reverting on\n * overflow (when the input is less than smallest int80 or\n * greater than largest int80).\n *\n * Counterpart to Solidity's `int80` operator.\n *\n * Requirements:\n *\n * - input must fit into 80 bits\n */\n function toInt80(int256 value) internal pure returns (int80 downcasted) {\n downcasted = int80(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(80, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int72 from int256, reverting on\n * overflow (when the input is less than smallest int72 or\n * greater than largest int72).\n *\n * Counterpart to Solidity's `int72` operator.\n *\n * Requirements:\n *\n * - input must fit into 72 bits\n */\n function toInt72(int256 value) internal pure returns (int72 downcasted) {\n downcasted = int72(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(72, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int64 from int256, reverting on\n * overflow (when the input is less than smallest int64 or\n * greater than largest int64).\n *\n * Counterpart to Solidity's `int64` operator.\n *\n * Requirements:\n *\n * - input must fit into 64 bits\n */\n function toInt64(int256 value) internal pure returns (int64 downcasted) {\n downcasted = int64(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(64, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int56 from int256, reverting on\n * overflow (when the input is less than smallest int56 or\n * greater than largest int56).\n *\n * Counterpart to Solidity's `int56` operator.\n *\n * Requirements:\n *\n * - input must fit into 56 bits\n */\n function toInt56(int256 value) internal pure returns (int56 downcasted) {\n downcasted = int56(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(56, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int48 from int256, reverting on\n * overflow (when the input is less than smallest int48 or\n * greater than largest int48).\n *\n * Counterpart to Solidity's `int48` operator.\n *\n * Requirements:\n *\n * - input must fit into 48 bits\n */\n function toInt48(int256 value) internal pure returns (int48 downcasted) {\n downcasted = int48(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(48, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int40 from int256, reverting on\n * overflow (when the input is less than smallest int40 or\n * greater than largest int40).\n *\n * Counterpart to Solidity's `int40` operator.\n *\n * Requirements:\n *\n * - input must fit into 40 bits\n */\n function toInt40(int256 value) internal pure returns (int40 downcasted) {\n downcasted = int40(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(40, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int32 from int256, reverting on\n * overflow (when the input is less than smallest int32 or\n * greater than largest int32).\n *\n * Counterpart to Solidity's `int32` operator.\n *\n * Requirements:\n *\n * - input must fit into 32 bits\n */\n function toInt32(int256 value) internal pure returns (int32 downcasted) {\n downcasted = int32(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(32, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int24 from int256, reverting on\n * overflow (when the input is less than smallest int24 or\n * greater than largest int24).\n *\n * Counterpart to Solidity's `int24` operator.\n *\n * Requirements:\n *\n * - input must fit into 24 bits\n */\n function toInt24(int256 value) internal pure returns (int24 downcasted) {\n downcasted = int24(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(24, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int16 from int256, reverting on\n * overflow (when the input is less than smallest int16 or\n * greater than largest int16).\n *\n * Counterpart to Solidity's `int16` operator.\n *\n * Requirements:\n *\n * - input must fit into 16 bits\n */\n function toInt16(int256 value) internal pure returns (int16 downcasted) {\n downcasted = int16(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(16, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int8 from int256, reverting on\n * overflow (when the input is less than smallest int8 or\n * greater than largest int8).\n *\n * Counterpart to Solidity's `int8` operator.\n *\n * Requirements:\n *\n * - input must fit into 8 bits\n */\n function toInt8(int256 value) internal pure returns (int8 downcasted) {\n downcasted = int8(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(8, value);\n }\n }\n\n /**\n * @dev Converts an unsigned uint256 into a signed int256.\n *\n * Requirements:\n *\n * - input must be less than or equal to maxInt256.\n */\n function toInt256(uint256 value) internal pure returns (int256) {\n // Note: Unsafe cast below is okay because `type(int256).max` is guaranteed to be positive\n if (value > uint256(type(int256).max)) {\n revert SafeCastOverflowedUintToInt(value);\n }\n return int256(value);\n }\n\n /**\n * @dev Cast a boolean (false or true) to a uint256 (0 or 1) with no jump.\n */\n function toUint(bool b) internal pure returns (uint256 u) {\n assembly (\"memory-safe\") {\n u := iszero(iszero(b))\n }\n }\n}\n" + }, + "@openzeppelin/contracts/utils/math/SignedMath.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/math/SignedMath.sol)\n\npragma solidity ^0.8.20;\n\nimport {SafeCast} from \"./SafeCast.sol\";\n\n/**\n * @dev Standard signed math utilities missing in the Solidity language.\n */\nlibrary SignedMath {\n /**\n * @dev Branchless ternary evaluation for `a ? b : c`. Gas costs are constant.\n *\n * IMPORTANT: This function may reduce bytecode size and consume less gas when used standalone.\n * However, the compiler may optimize Solidity ternary operations (i.e. `a ? b : c`) to only compute\n * one branch when needed, making this function more expensive.\n */\n function ternary(bool condition, int256 a, int256 b) internal pure returns (int256) {\n unchecked {\n // branchless ternary works because:\n // b ^ (a ^ b) == a\n // b ^ 0 == b\n return b ^ ((a ^ b) * int256(SafeCast.toUint(condition)));\n }\n }\n\n /**\n * @dev Returns the largest of two signed numbers.\n */\n function max(int256 a, int256 b) internal pure returns (int256) {\n return ternary(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 ternary(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 // Formula from the \"Bit Twiddling Hacks\" by Sean Eron Anderson.\n // Since `n` is a signed integer, the generated bytecode will use the SAR opcode to perform the right shift,\n // taking advantage of the most significant (or \"sign\" bit) in two's complement representation.\n // This opcode adds new most significant bits set to the value of the previous most significant bit. As a result,\n // the mask will either be `bytes32(0)` (if n is positive) or `~bytes32(0)` (if n is negative).\n int256 mask = n >> 255;\n\n // A `bytes32(0)` mask leaves the input unchanged, while a `~bytes32(0)` mask complements it.\n return uint256((n + mask) ^ mask);\n }\n }\n}\n" + }, + "@openzeppelin/contracts/utils/Nonces.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/Nonces.sol)\npragma solidity ^0.8.20;\n\n/**\n * @dev Provides tracking nonces for addresses. Nonces will only increment.\n */\nabstract contract Nonces {\n /**\n * @dev The nonce used for an `account` is not the expected current nonce.\n */\n error InvalidAccountNonce(address account, uint256 currentNonce);\n\n mapping(address account => uint256) private _nonces;\n\n /**\n * @dev Returns the next unused nonce for an address.\n */\n function nonces(address owner) public view virtual returns (uint256) {\n return _nonces[owner];\n }\n\n /**\n * @dev Consumes a nonce.\n *\n * Returns the current value and increments nonce.\n */\n function _useNonce(address owner) internal virtual returns (uint256) {\n // For each account, the nonce has an initial value of 0, can only be incremented by one, and cannot be\n // decremented or reset. This guarantees that the nonce never overflows.\n unchecked {\n // It is important to do x++ and not ++x here.\n return _nonces[owner]++;\n }\n }\n\n /**\n * @dev Same as {_useNonce} but checking that `nonce` is the next valid for `owner`.\n */\n function _useCheckedNonce(address owner, uint256 nonce) internal virtual {\n uint256 current = _useNonce(owner);\n if (nonce != current) {\n revert InvalidAccountNonce(owner, current);\n }\n }\n}\n" + }, + "@openzeppelin/contracts/utils/Panic.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/Panic.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Helper library for emitting standardized panic codes.\n *\n * ```solidity\n * contract Example {\n * using Panic for uint256;\n *\n * // Use any of the declared internal constants\n * function foo() { Panic.GENERIC.panic(); }\n *\n * // Alternatively\n * function foo() { Panic.panic(Panic.GENERIC); }\n * }\n * ```\n *\n * Follows the list from https://github.com/ethereum/solidity/blob/v0.8.24/libsolutil/ErrorCodes.h[libsolutil].\n *\n * _Available since v5.1._\n */\n// slither-disable-next-line unused-state\nlibrary Panic {\n /// @dev generic / unspecified error\n uint256 internal constant GENERIC = 0x00;\n /// @dev used by the assert() builtin\n uint256 internal constant ASSERT = 0x01;\n /// @dev arithmetic underflow or overflow\n uint256 internal constant UNDER_OVERFLOW = 0x11;\n /// @dev division or modulo by zero\n uint256 internal constant DIVISION_BY_ZERO = 0x12;\n /// @dev enum conversion error\n uint256 internal constant ENUM_CONVERSION_ERROR = 0x21;\n /// @dev invalid encoding in storage\n uint256 internal constant STORAGE_ENCODING_ERROR = 0x22;\n /// @dev empty array pop\n uint256 internal constant EMPTY_ARRAY_POP = 0x31;\n /// @dev array out of bounds access\n uint256 internal constant ARRAY_OUT_OF_BOUNDS = 0x32;\n /// @dev resource error (too large allocation or too large array)\n uint256 internal constant RESOURCE_ERROR = 0x41;\n /// @dev calling invalid internal function\n uint256 internal constant INVALID_INTERNAL_FUNCTION = 0x51;\n\n /// @dev Reverts with a panic code. Recommended to use with\n /// the internal constants with predefined codes.\n function panic(uint256 code) internal pure {\n assembly (\"memory-safe\") {\n mstore(0x00, 0x4e487b71)\n mstore(0x20, code)\n revert(0x1c, 0x24)\n }\n }\n}\n" + }, + "@openzeppelin/contracts/utils/ShortStrings.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/ShortStrings.sol)\n\npragma solidity ^0.8.20;\n\nimport {StorageSlot} from \"./StorageSlot.sol\";\n\n// | string | 0xAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA |\n// | length | 0x BB |\ntype ShortString is bytes32;\n\n/**\n * @dev This library provides functions to convert short memory strings\n * into a `ShortString` type that can be used as an immutable variable.\n *\n * Strings of arbitrary length can be optimized using this library if\n * they are short enough (up to 31 bytes) by packing them with their\n * length (1 byte) in a single EVM word (32 bytes). Additionally, a\n * fallback mechanism can be used for every other case.\n *\n * Usage example:\n *\n * ```solidity\n * contract Named {\n * using ShortStrings for *;\n *\n * ShortString private immutable _name;\n * string private _nameFallback;\n *\n * constructor(string memory contractName) {\n * _name = contractName.toShortStringWithFallback(_nameFallback);\n * }\n *\n * function name() external view returns (string memory) {\n * return _name.toStringWithFallback(_nameFallback);\n * }\n * }\n * ```\n */\nlibrary ShortStrings {\n // Used as an identifier for strings longer than 31 bytes.\n bytes32 private constant FALLBACK_SENTINEL = 0x00000000000000000000000000000000000000000000000000000000000000FF;\n\n error StringTooLong(string str);\n error InvalidShortString();\n\n /**\n * @dev Encode a string of at most 31 chars into a `ShortString`.\n *\n * This will trigger a `StringTooLong` error is the input string is too long.\n */\n function toShortString(string memory str) internal pure returns (ShortString) {\n bytes memory bstr = bytes(str);\n if (bstr.length > 31) {\n revert StringTooLong(str);\n }\n return ShortString.wrap(bytes32(uint256(bytes32(bstr)) | bstr.length));\n }\n\n /**\n * @dev Decode a `ShortString` back to a \"normal\" string.\n */\n function toString(ShortString sstr) internal pure returns (string memory) {\n uint256 len = byteLength(sstr);\n // using `new string(len)` would work locally but is not memory safe.\n string memory str = new string(32);\n assembly (\"memory-safe\") {\n mstore(str, len)\n mstore(add(str, 0x20), sstr)\n }\n return str;\n }\n\n /**\n * @dev Return the length of a `ShortString`.\n */\n function byteLength(ShortString sstr) internal pure returns (uint256) {\n uint256 result = uint256(ShortString.unwrap(sstr)) & 0xFF;\n if (result > 31) {\n revert InvalidShortString();\n }\n return result;\n }\n\n /**\n * @dev Encode a string into a `ShortString`, or write it to storage if it is too long.\n */\n function toShortStringWithFallback(string memory value, string storage store) internal returns (ShortString) {\n if (bytes(value).length < 32) {\n return toShortString(value);\n } else {\n StorageSlot.getStringSlot(store).value = value;\n return ShortString.wrap(FALLBACK_SENTINEL);\n }\n }\n\n /**\n * @dev Decode a string that was encoded to `ShortString` or written to storage using {setWithFallback}.\n */\n function toStringWithFallback(ShortString value, string storage store) internal pure returns (string memory) {\n if (ShortString.unwrap(value) != FALLBACK_SENTINEL) {\n return toString(value);\n } else {\n return store;\n }\n }\n\n /**\n * @dev Return the length of a string that was encoded to `ShortString` or written to storage using\n * {setWithFallback}.\n *\n * WARNING: This will return the \"byte length\" of the string. This may not reflect the actual length in terms of\n * actual characters as the UTF-8 encoding of a single character can span over multiple bytes.\n */\n function byteLengthWithFallback(ShortString value, string storage store) internal view returns (uint256) {\n if (ShortString.unwrap(value) != FALLBACK_SENTINEL) {\n return byteLength(value);\n } else {\n return bytes(store).length;\n }\n }\n}\n" + }, + "@openzeppelin/contracts/utils/StorageSlot.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/StorageSlot.sol)\n// This file was procedurally generated from scripts/generate/templates/StorageSlot.js.\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Library for reading and writing primitive types to specific storage slots.\n *\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\n * This library helps with reading and writing to such slots without the need for inline assembly.\n *\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\n *\n * Example usage to set ERC-1967 implementation slot:\n * ```solidity\n * contract ERC1967 {\n * // Define the slot. Alternatively, use the SlotDerivation library to derive the slot.\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\n *\n * function _getImplementation() internal view returns (address) {\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\n * }\n *\n * function _setImplementation(address newImplementation) internal {\n * require(newImplementation.code.length > 0);\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\n * }\n * }\n * ```\n *\n * TIP: Consider using this library along with {SlotDerivation}.\n */\nlibrary StorageSlot {\n struct AddressSlot {\n address value;\n }\n\n struct BooleanSlot {\n bool value;\n }\n\n struct Bytes32Slot {\n bytes32 value;\n }\n\n struct Uint256Slot {\n uint256 value;\n }\n\n struct Int256Slot {\n int256 value;\n }\n\n struct StringSlot {\n string value;\n }\n\n struct BytesSlot {\n bytes value;\n }\n\n /**\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\n */\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\n assembly (\"memory-safe\") {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns a `BooleanSlot` with member `value` located at `slot`.\n */\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\n assembly (\"memory-safe\") {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns a `Bytes32Slot` with member `value` located at `slot`.\n */\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\n assembly (\"memory-safe\") {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns a `Uint256Slot` with member `value` located at `slot`.\n */\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\n assembly (\"memory-safe\") {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns a `Int256Slot` with member `value` located at `slot`.\n */\n function getInt256Slot(bytes32 slot) internal pure returns (Int256Slot storage r) {\n assembly (\"memory-safe\") {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns a `StringSlot` with member `value` located at `slot`.\n */\n function getStringSlot(bytes32 slot) internal pure returns (StringSlot storage r) {\n assembly (\"memory-safe\") {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `StringSlot` representation of the string storage pointer `store`.\n */\n function getStringSlot(string storage store) internal pure returns (StringSlot storage r) {\n assembly (\"memory-safe\") {\n r.slot := store.slot\n }\n }\n\n /**\n * @dev Returns a `BytesSlot` with member `value` located at `slot`.\n */\n function getBytesSlot(bytes32 slot) internal pure returns (BytesSlot storage r) {\n assembly (\"memory-safe\") {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `BytesSlot` representation of the bytes storage pointer `store`.\n */\n function getBytesSlot(bytes storage store) internal pure returns (BytesSlot storage r) {\n assembly (\"memory-safe\") {\n r.slot := store.slot\n }\n }\n}\n" + }, + "@openzeppelin/contracts/utils/Strings.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/Strings.sol)\n\npragma solidity ^0.8.20;\n\nimport {Math} from \"./math/Math.sol\";\nimport {SignedMath} from \"./math/SignedMath.sol\";\n\n/**\n * @dev String operations.\n */\nlibrary Strings {\n bytes16 private constant HEX_DIGITS = \"0123456789abcdef\";\n uint8 private constant ADDRESS_LENGTH = 20;\n\n /**\n * @dev The `value` string doesn't fit in the specified `length`.\n */\n error StringsInsufficientHexLength(uint256 value, uint256 length);\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 assembly (\"memory-safe\") {\n ptr := add(buffer, add(32, length))\n }\n while (true) {\n ptr--;\n assembly (\"memory-safe\") {\n mstore8(ptr, byte(mod(value, 10), HEX_DIGITS))\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 toStringSigned(int256 value) internal pure returns (string memory) {\n return string.concat(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 uint256 localValue = value;\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] = HEX_DIGITS[localValue & 0xf];\n localValue >>= 4;\n }\n if (localValue != 0) {\n revert StringsInsufficientHexLength(value, length);\n }\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\n * 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 Converts an `address` with fixed length of 20 bytes to its checksummed ASCII `string` hexadecimal\n * representation, according to EIP-55.\n */\n function toChecksumHexString(address addr) internal pure returns (string memory) {\n bytes memory buffer = bytes(toHexString(addr));\n\n // hash the hex part of buffer (skip length + 2 bytes, length 40)\n uint256 hashValue;\n assembly (\"memory-safe\") {\n hashValue := shr(96, keccak256(add(buffer, 0x22), 40))\n }\n\n for (uint256 i = 41; i > 1; --i) {\n // possible values for buffer[i] are 48 (0) to 57 (9) and 97 (a) to 102 (f)\n if (hashValue & 0xf > 7 && uint8(buffer[i]) > 96) {\n // case shift by xoring with 0x20\n buffer[i] ^= 0x20;\n }\n hashValue >>= 4;\n }\n return string(buffer);\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 bytes(a).length == bytes(b).length && keccak256(bytes(a)) == keccak256(bytes(b));\n }\n}\n" + }, + "@openzeppelin/contracts/utils/structs/Checkpoints.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/structs/Checkpoints.sol)\n// This file was procedurally generated from scripts/generate/templates/Checkpoints.js.\n\npragma solidity ^0.8.20;\n\nimport {Math} from \"../math/Math.sol\";\n\n/**\n * @dev This library defines the `Trace*` struct, for checkpointing values as they change at different points in\n * time, and later looking up past values by block number. See {Votes} as an example.\n *\n * To create a history of checkpoints define a variable type `Checkpoints.Trace*` in your contract, and store a new\n * checkpoint for the current transaction block using the {push} function.\n */\nlibrary Checkpoints {\n /**\n * @dev A value was attempted to be inserted on a past checkpoint.\n */\n error CheckpointUnorderedInsertion();\n\n struct Trace224 {\n Checkpoint224[] _checkpoints;\n }\n\n struct Checkpoint224 {\n uint32 _key;\n uint224 _value;\n }\n\n /**\n * @dev Pushes a (`key`, `value`) pair into a Trace224 so that it is stored as the checkpoint.\n *\n * Returns previous value and new value.\n *\n * IMPORTANT: Never accept `key` as a user input, since an arbitrary `type(uint32).max` key set will disable the\n * library.\n */\n function push(\n Trace224 storage self,\n uint32 key,\n uint224 value\n ) internal returns (uint224 oldValue, uint224 newValue) {\n return _insert(self._checkpoints, key, value);\n }\n\n /**\n * @dev Returns the value in the first (oldest) checkpoint with key greater or equal than the search key, or zero if\n * there is none.\n */\n function lowerLookup(Trace224 storage self, uint32 key) internal view returns (uint224) {\n uint256 len = self._checkpoints.length;\n uint256 pos = _lowerBinaryLookup(self._checkpoints, key, 0, len);\n return pos == len ? 0 : _unsafeAccess(self._checkpoints, pos)._value;\n }\n\n /**\n * @dev Returns the value in the last (most recent) checkpoint with key lower or equal than the search key, or zero\n * if there is none.\n */\n function upperLookup(Trace224 storage self, uint32 key) internal view returns (uint224) {\n uint256 len = self._checkpoints.length;\n uint256 pos = _upperBinaryLookup(self._checkpoints, key, 0, len);\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\n }\n\n /**\n * @dev Returns the value in the last (most recent) checkpoint with key lower or equal than the search key, or zero\n * if there is none.\n *\n * NOTE: This is a variant of {upperLookup} that is optimised to find \"recent\" checkpoint (checkpoints with high\n * keys).\n */\n function upperLookupRecent(Trace224 storage self, uint32 key) internal view returns (uint224) {\n uint256 len = self._checkpoints.length;\n\n uint256 low = 0;\n uint256 high = len;\n\n if (len > 5) {\n uint256 mid = len - Math.sqrt(len);\n if (key < _unsafeAccess(self._checkpoints, mid)._key) {\n high = mid;\n } else {\n low = mid + 1;\n }\n }\n\n uint256 pos = _upperBinaryLookup(self._checkpoints, key, low, high);\n\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\n }\n\n /**\n * @dev Returns the value in the most recent checkpoint, or zero if there are no checkpoints.\n */\n function latest(Trace224 storage self) internal view returns (uint224) {\n uint256 pos = self._checkpoints.length;\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\n }\n\n /**\n * @dev Returns whether there is a checkpoint in the structure (i.e. it is not empty), and if so the key and value\n * in the most recent checkpoint.\n */\n function latestCheckpoint(Trace224 storage self) internal view returns (bool exists, uint32 _key, uint224 _value) {\n uint256 pos = self._checkpoints.length;\n if (pos == 0) {\n return (false, 0, 0);\n } else {\n Checkpoint224 storage ckpt = _unsafeAccess(self._checkpoints, pos - 1);\n return (true, ckpt._key, ckpt._value);\n }\n }\n\n /**\n * @dev Returns the number of checkpoint.\n */\n function length(Trace224 storage self) internal view returns (uint256) {\n return self._checkpoints.length;\n }\n\n /**\n * @dev Returns checkpoint at given position.\n */\n function at(Trace224 storage self, uint32 pos) internal view returns (Checkpoint224 memory) {\n return self._checkpoints[pos];\n }\n\n /**\n * @dev Pushes a (`key`, `value`) pair into an ordered list of checkpoints, either by inserting a new checkpoint,\n * or by updating the last one.\n */\n function _insert(\n Checkpoint224[] storage self,\n uint32 key,\n uint224 value\n ) private returns (uint224 oldValue, uint224 newValue) {\n uint256 pos = self.length;\n\n if (pos > 0) {\n Checkpoint224 storage last = _unsafeAccess(self, pos - 1);\n uint32 lastKey = last._key;\n uint224 lastValue = last._value;\n\n // Checkpoint keys must be non-decreasing.\n if (lastKey > key) {\n revert CheckpointUnorderedInsertion();\n }\n\n // Update or push new checkpoint\n if (lastKey == key) {\n last._value = value;\n } else {\n self.push(Checkpoint224({_key: key, _value: value}));\n }\n return (lastValue, value);\n } else {\n self.push(Checkpoint224({_key: key, _value: value}));\n return (0, value);\n }\n }\n\n /**\n * @dev Return the index of the first (oldest) checkpoint with key strictly bigger than the search key, or `high`\n * if there is none. `low` and `high` define a section where to do the search, with inclusive `low` and exclusive\n * `high`.\n *\n * WARNING: `high` should not be greater than the array's length.\n */\n function _upperBinaryLookup(\n Checkpoint224[] storage self,\n uint32 key,\n uint256 low,\n uint256 high\n ) private view returns (uint256) {\n while (low < high) {\n uint256 mid = Math.average(low, high);\n if (_unsafeAccess(self, mid)._key > key) {\n high = mid;\n } else {\n low = mid + 1;\n }\n }\n return high;\n }\n\n /**\n * @dev Return the index of the first (oldest) checkpoint with key greater or equal than the search key, or `high`\n * if there is none. `low` and `high` define a section where to do the search, with inclusive `low` and exclusive\n * `high`.\n *\n * WARNING: `high` should not be greater than the array's length.\n */\n function _lowerBinaryLookup(\n Checkpoint224[] storage self,\n uint32 key,\n uint256 low,\n uint256 high\n ) private view returns (uint256) {\n while (low < high) {\n uint256 mid = Math.average(low, high);\n if (_unsafeAccess(self, mid)._key < key) {\n low = mid + 1;\n } else {\n high = mid;\n }\n }\n return high;\n }\n\n /**\n * @dev Access an element of the array without performing bounds check. The position is assumed to be within bounds.\n */\n function _unsafeAccess(\n Checkpoint224[] storage self,\n uint256 pos\n ) private pure returns (Checkpoint224 storage result) {\n assembly {\n mstore(0, self.slot)\n result.slot := add(keccak256(0, 0x20), pos)\n }\n }\n\n struct Trace208 {\n Checkpoint208[] _checkpoints;\n }\n\n struct Checkpoint208 {\n uint48 _key;\n uint208 _value;\n }\n\n /**\n * @dev Pushes a (`key`, `value`) pair into a Trace208 so that it is stored as the checkpoint.\n *\n * Returns previous value and new value.\n *\n * IMPORTANT: Never accept `key` as a user input, since an arbitrary `type(uint48).max` key set will disable the\n * library.\n */\n function push(\n Trace208 storage self,\n uint48 key,\n uint208 value\n ) internal returns (uint208 oldValue, uint208 newValue) {\n return _insert(self._checkpoints, key, value);\n }\n\n /**\n * @dev Returns the value in the first (oldest) checkpoint with key greater or equal than the search key, or zero if\n * there is none.\n */\n function lowerLookup(Trace208 storage self, uint48 key) internal view returns (uint208) {\n uint256 len = self._checkpoints.length;\n uint256 pos = _lowerBinaryLookup(self._checkpoints, key, 0, len);\n return pos == len ? 0 : _unsafeAccess(self._checkpoints, pos)._value;\n }\n\n /**\n * @dev Returns the value in the last (most recent) checkpoint with key lower or equal than the search key, or zero\n * if there is none.\n */\n function upperLookup(Trace208 storage self, uint48 key) internal view returns (uint208) {\n uint256 len = self._checkpoints.length;\n uint256 pos = _upperBinaryLookup(self._checkpoints, key, 0, len);\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\n }\n\n /**\n * @dev Returns the value in the last (most recent) checkpoint with key lower or equal than the search key, or zero\n * if there is none.\n *\n * NOTE: This is a variant of {upperLookup} that is optimised to find \"recent\" checkpoint (checkpoints with high\n * keys).\n */\n function upperLookupRecent(Trace208 storage self, uint48 key) internal view returns (uint208) {\n uint256 len = self._checkpoints.length;\n\n uint256 low = 0;\n uint256 high = len;\n\n if (len > 5) {\n uint256 mid = len - Math.sqrt(len);\n if (key < _unsafeAccess(self._checkpoints, mid)._key) {\n high = mid;\n } else {\n low = mid + 1;\n }\n }\n\n uint256 pos = _upperBinaryLookup(self._checkpoints, key, low, high);\n\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\n }\n\n /**\n * @dev Returns the value in the most recent checkpoint, or zero if there are no checkpoints.\n */\n function latest(Trace208 storage self) internal view returns (uint208) {\n uint256 pos = self._checkpoints.length;\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\n }\n\n /**\n * @dev Returns whether there is a checkpoint in the structure (i.e. it is not empty), and if so the key and value\n * in the most recent checkpoint.\n */\n function latestCheckpoint(Trace208 storage self) internal view returns (bool exists, uint48 _key, uint208 _value) {\n uint256 pos = self._checkpoints.length;\n if (pos == 0) {\n return (false, 0, 0);\n } else {\n Checkpoint208 storage ckpt = _unsafeAccess(self._checkpoints, pos - 1);\n return (true, ckpt._key, ckpt._value);\n }\n }\n\n /**\n * @dev Returns the number of checkpoint.\n */\n function length(Trace208 storage self) internal view returns (uint256) {\n return self._checkpoints.length;\n }\n\n /**\n * @dev Returns checkpoint at given position.\n */\n function at(Trace208 storage self, uint32 pos) internal view returns (Checkpoint208 memory) {\n return self._checkpoints[pos];\n }\n\n /**\n * @dev Pushes a (`key`, `value`) pair into an ordered list of checkpoints, either by inserting a new checkpoint,\n * or by updating the last one.\n */\n function _insert(\n Checkpoint208[] storage self,\n uint48 key,\n uint208 value\n ) private returns (uint208 oldValue, uint208 newValue) {\n uint256 pos = self.length;\n\n if (pos > 0) {\n Checkpoint208 storage last = _unsafeAccess(self, pos - 1);\n uint48 lastKey = last._key;\n uint208 lastValue = last._value;\n\n // Checkpoint keys must be non-decreasing.\n if (lastKey > key) {\n revert CheckpointUnorderedInsertion();\n }\n\n // Update or push new checkpoint\n if (lastKey == key) {\n last._value = value;\n } else {\n self.push(Checkpoint208({_key: key, _value: value}));\n }\n return (lastValue, value);\n } else {\n self.push(Checkpoint208({_key: key, _value: value}));\n return (0, value);\n }\n }\n\n /**\n * @dev Return the index of the first (oldest) checkpoint with key strictly bigger than the search key, or `high`\n * if there is none. `low` and `high` define a section where to do the search, with inclusive `low` and exclusive\n * `high`.\n *\n * WARNING: `high` should not be greater than the array's length.\n */\n function _upperBinaryLookup(\n Checkpoint208[] storage self,\n uint48 key,\n uint256 low,\n uint256 high\n ) private view returns (uint256) {\n while (low < high) {\n uint256 mid = Math.average(low, high);\n if (_unsafeAccess(self, mid)._key > key) {\n high = mid;\n } else {\n low = mid + 1;\n }\n }\n return high;\n }\n\n /**\n * @dev Return the index of the first (oldest) checkpoint with key greater or equal than the search key, or `high`\n * if there is none. `low` and `high` define a section where to do the search, with inclusive `low` and exclusive\n * `high`.\n *\n * WARNING: `high` should not be greater than the array's length.\n */\n function _lowerBinaryLookup(\n Checkpoint208[] storage self,\n uint48 key,\n uint256 low,\n uint256 high\n ) private view returns (uint256) {\n while (low < high) {\n uint256 mid = Math.average(low, high);\n if (_unsafeAccess(self, mid)._key < key) {\n low = mid + 1;\n } else {\n high = mid;\n }\n }\n return high;\n }\n\n /**\n * @dev Access an element of the array without performing bounds check. The position is assumed to be within bounds.\n */\n function _unsafeAccess(\n Checkpoint208[] storage self,\n uint256 pos\n ) private pure returns (Checkpoint208 storage result) {\n assembly {\n mstore(0, self.slot)\n result.slot := add(keccak256(0, 0x20), pos)\n }\n }\n\n struct Trace160 {\n Checkpoint160[] _checkpoints;\n }\n\n struct Checkpoint160 {\n uint96 _key;\n uint160 _value;\n }\n\n /**\n * @dev Pushes a (`key`, `value`) pair into a Trace160 so that it is stored as the checkpoint.\n *\n * Returns previous value and new value.\n *\n * IMPORTANT: Never accept `key` as a user input, since an arbitrary `type(uint96).max` key set will disable the\n * library.\n */\n function push(\n Trace160 storage self,\n uint96 key,\n uint160 value\n ) internal returns (uint160 oldValue, uint160 newValue) {\n return _insert(self._checkpoints, key, value);\n }\n\n /**\n * @dev Returns the value in the first (oldest) checkpoint with key greater or equal than the search key, or zero if\n * there is none.\n */\n function lowerLookup(Trace160 storage self, uint96 key) internal view returns (uint160) {\n uint256 len = self._checkpoints.length;\n uint256 pos = _lowerBinaryLookup(self._checkpoints, key, 0, len);\n return pos == len ? 0 : _unsafeAccess(self._checkpoints, pos)._value;\n }\n\n /**\n * @dev Returns the value in the last (most recent) checkpoint with key lower or equal than the search key, or zero\n * if there is none.\n */\n function upperLookup(Trace160 storage self, uint96 key) internal view returns (uint160) {\n uint256 len = self._checkpoints.length;\n uint256 pos = _upperBinaryLookup(self._checkpoints, key, 0, len);\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\n }\n\n /**\n * @dev Returns the value in the last (most recent) checkpoint with key lower or equal than the search key, or zero\n * if there is none.\n *\n * NOTE: This is a variant of {upperLookup} that is optimised to find \"recent\" checkpoint (checkpoints with high\n * keys).\n */\n function upperLookupRecent(Trace160 storage self, uint96 key) internal view returns (uint160) {\n uint256 len = self._checkpoints.length;\n\n uint256 low = 0;\n uint256 high = len;\n\n if (len > 5) {\n uint256 mid = len - Math.sqrt(len);\n if (key < _unsafeAccess(self._checkpoints, mid)._key) {\n high = mid;\n } else {\n low = mid + 1;\n }\n }\n\n uint256 pos = _upperBinaryLookup(self._checkpoints, key, low, high);\n\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\n }\n\n /**\n * @dev Returns the value in the most recent checkpoint, or zero if there are no checkpoints.\n */\n function latest(Trace160 storage self) internal view returns (uint160) {\n uint256 pos = self._checkpoints.length;\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\n }\n\n /**\n * @dev Returns whether there is a checkpoint in the structure (i.e. it is not empty), and if so the key and value\n * in the most recent checkpoint.\n */\n function latestCheckpoint(Trace160 storage self) internal view returns (bool exists, uint96 _key, uint160 _value) {\n uint256 pos = self._checkpoints.length;\n if (pos == 0) {\n return (false, 0, 0);\n } else {\n Checkpoint160 storage ckpt = _unsafeAccess(self._checkpoints, pos - 1);\n return (true, ckpt._key, ckpt._value);\n }\n }\n\n /**\n * @dev Returns the number of checkpoint.\n */\n function length(Trace160 storage self) internal view returns (uint256) {\n return self._checkpoints.length;\n }\n\n /**\n * @dev Returns checkpoint at given position.\n */\n function at(Trace160 storage self, uint32 pos) internal view returns (Checkpoint160 memory) {\n return self._checkpoints[pos];\n }\n\n /**\n * @dev Pushes a (`key`, `value`) pair into an ordered list of checkpoints, either by inserting a new checkpoint,\n * or by updating the last one.\n */\n function _insert(\n Checkpoint160[] storage self,\n uint96 key,\n uint160 value\n ) private returns (uint160 oldValue, uint160 newValue) {\n uint256 pos = self.length;\n\n if (pos > 0) {\n Checkpoint160 storage last = _unsafeAccess(self, pos - 1);\n uint96 lastKey = last._key;\n uint160 lastValue = last._value;\n\n // Checkpoint keys must be non-decreasing.\n if (lastKey > key) {\n revert CheckpointUnorderedInsertion();\n }\n\n // Update or push new checkpoint\n if (lastKey == key) {\n last._value = value;\n } else {\n self.push(Checkpoint160({_key: key, _value: value}));\n }\n return (lastValue, value);\n } else {\n self.push(Checkpoint160({_key: key, _value: value}));\n return (0, value);\n }\n }\n\n /**\n * @dev Return the index of the first (oldest) checkpoint with key strictly bigger than the search key, or `high`\n * if there is none. `low` and `high` define a section where to do the search, with inclusive `low` and exclusive\n * `high`.\n *\n * WARNING: `high` should not be greater than the array's length.\n */\n function _upperBinaryLookup(\n Checkpoint160[] storage self,\n uint96 key,\n uint256 low,\n uint256 high\n ) private view returns (uint256) {\n while (low < high) {\n uint256 mid = Math.average(low, high);\n if (_unsafeAccess(self, mid)._key > key) {\n high = mid;\n } else {\n low = mid + 1;\n }\n }\n return high;\n }\n\n /**\n * @dev Return the index of the first (oldest) checkpoint with key greater or equal than the search key, or `high`\n * if there is none. `low` and `high` define a section where to do the search, with inclusive `low` and exclusive\n * `high`.\n *\n * WARNING: `high` should not be greater than the array's length.\n */\n function _lowerBinaryLookup(\n Checkpoint160[] storage self,\n uint96 key,\n uint256 low,\n uint256 high\n ) private view returns (uint256) {\n while (low < high) {\n uint256 mid = Math.average(low, high);\n if (_unsafeAccess(self, mid)._key < key) {\n low = mid + 1;\n } else {\n high = mid;\n }\n }\n return high;\n }\n\n /**\n * @dev Access an element of the array without performing bounds check. The position is assumed to be within bounds.\n */\n function _unsafeAccess(\n Checkpoint160[] storage self,\n uint256 pos\n ) private pure returns (Checkpoint160 storage result) {\n assembly {\n mstore(0, self.slot)\n result.slot := add(keccak256(0, 0x20), pos)\n }\n }\n}\n" + }, + "@openzeppelin/contracts/utils/structs/DoubleEndedQueue.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/structs/DoubleEndedQueue.sol)\npragma solidity ^0.8.20;\n\nimport {Panic} from \"../Panic.sol\";\n\n/**\n * @dev A sequence of items with the ability to efficiently push and pop items (i.e. insert and remove) on both ends of\n * the sequence (called front and back). Among other access patterns, it can be used to implement efficient LIFO and\n * FIFO queues. Storage use is optimized, and all operations are O(1) constant time. This includes {clear}, given that\n * the existing queue contents are left in storage.\n *\n * The struct is called `Bytes32Deque`. Other types can be cast to and from `bytes32`. This data structure can only be\n * used in storage, and not in memory.\n * ```solidity\n * DoubleEndedQueue.Bytes32Deque queue;\n * ```\n */\nlibrary DoubleEndedQueue {\n /**\n * @dev Indices are 128 bits so begin and end are packed in a single storage slot for efficient access.\n *\n * Struct members have an underscore prefix indicating that they are \"private\" and should not be read or written to\n * directly. Use the functions provided below instead. Modifying the struct manually may violate assumptions and\n * lead to unexpected behavior.\n *\n * The first item is at data[begin] and the last item is at data[end - 1]. This range can wrap around.\n */\n struct Bytes32Deque {\n uint128 _begin;\n uint128 _end;\n mapping(uint128 index => bytes32) _data;\n }\n\n /**\n * @dev Inserts an item at the end of the queue.\n *\n * Reverts with {Panic-RESOURCE_ERROR} if the queue is full.\n */\n function pushBack(Bytes32Deque storage deque, bytes32 value) internal {\n unchecked {\n uint128 backIndex = deque._end;\n if (backIndex + 1 == deque._begin) Panic.panic(Panic.RESOURCE_ERROR);\n deque._data[backIndex] = value;\n deque._end = backIndex + 1;\n }\n }\n\n /**\n * @dev Removes the item at the end of the queue and returns it.\n *\n * Reverts with {Panic-EMPTY_ARRAY_POP} if the queue is empty.\n */\n function popBack(Bytes32Deque storage deque) internal returns (bytes32 value) {\n unchecked {\n uint128 backIndex = deque._end;\n if (backIndex == deque._begin) Panic.panic(Panic.EMPTY_ARRAY_POP);\n --backIndex;\n value = deque._data[backIndex];\n delete deque._data[backIndex];\n deque._end = backIndex;\n }\n }\n\n /**\n * @dev Inserts an item at the beginning of the queue.\n *\n * Reverts with {Panic-RESOURCE_ERROR} if the queue is full.\n */\n function pushFront(Bytes32Deque storage deque, bytes32 value) internal {\n unchecked {\n uint128 frontIndex = deque._begin - 1;\n if (frontIndex == deque._end) Panic.panic(Panic.RESOURCE_ERROR);\n deque._data[frontIndex] = value;\n deque._begin = frontIndex;\n }\n }\n\n /**\n * @dev Removes the item at the beginning of the queue and returns it.\n *\n * Reverts with {Panic-EMPTY_ARRAY_POP} if the queue is empty.\n */\n function popFront(Bytes32Deque storage deque) internal returns (bytes32 value) {\n unchecked {\n uint128 frontIndex = deque._begin;\n if (frontIndex == deque._end) Panic.panic(Panic.EMPTY_ARRAY_POP);\n value = deque._data[frontIndex];\n delete deque._data[frontIndex];\n deque._begin = frontIndex + 1;\n }\n }\n\n /**\n * @dev Returns the item at the beginning of the queue.\n *\n * Reverts with {Panic-ARRAY_OUT_OF_BOUNDS} if the queue is empty.\n */\n function front(Bytes32Deque storage deque) internal view returns (bytes32 value) {\n if (empty(deque)) Panic.panic(Panic.ARRAY_OUT_OF_BOUNDS);\n return deque._data[deque._begin];\n }\n\n /**\n * @dev Returns the item at the end of the queue.\n *\n * Reverts with {Panic-ARRAY_OUT_OF_BOUNDS} if the queue is empty.\n */\n function back(Bytes32Deque storage deque) internal view returns (bytes32 value) {\n if (empty(deque)) Panic.panic(Panic.ARRAY_OUT_OF_BOUNDS);\n unchecked {\n return deque._data[deque._end - 1];\n }\n }\n\n /**\n * @dev Return the item at a position in the queue given by `index`, with the first item at 0 and last item at\n * `length(deque) - 1`.\n *\n * Reverts with {Panic-ARRAY_OUT_OF_BOUNDS} if the index is out of bounds.\n */\n function at(Bytes32Deque storage deque, uint256 index) internal view returns (bytes32 value) {\n if (index >= length(deque)) Panic.panic(Panic.ARRAY_OUT_OF_BOUNDS);\n // By construction, length is a uint128, so the check above ensures that index can be safely downcast to uint128\n unchecked {\n return deque._data[deque._begin + uint128(index)];\n }\n }\n\n /**\n * @dev Resets the queue back to being empty.\n *\n * NOTE: The current items are left behind in storage. This does not affect the functioning of the queue, but misses\n * out on potential gas refunds.\n */\n function clear(Bytes32Deque storage deque) internal {\n deque._begin = 0;\n deque._end = 0;\n }\n\n /**\n * @dev Returns the number of items in the queue.\n */\n function length(Bytes32Deque storage deque) internal view returns (uint256) {\n unchecked {\n return uint256(deque._end - deque._begin);\n }\n }\n\n /**\n * @dev Returns true if the queue is empty.\n */\n function empty(Bytes32Deque storage deque) internal view returns (bool) {\n return deque._end == deque._begin;\n }\n}\n" + }, + "@openzeppelin/contracts/utils/types/Time.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/types/Time.sol)\n\npragma solidity ^0.8.20;\n\nimport {Math} from \"../math/Math.sol\";\nimport {SafeCast} from \"../math/SafeCast.sol\";\n\n/**\n * @dev This library provides helpers for manipulating time-related objects.\n *\n * It uses the following types:\n * - `uint48` for timepoints\n * - `uint32` for durations\n *\n * While the library doesn't provide specific types for timepoints and duration, it does provide:\n * - a `Delay` type to represent duration that can be programmed to change value automatically at a given point\n * - additional helper functions\n */\nlibrary Time {\n using Time for *;\n\n /**\n * @dev Get the block timestamp as a Timepoint.\n */\n function timestamp() internal view returns (uint48) {\n return SafeCast.toUint48(block.timestamp);\n }\n\n /**\n * @dev Get the block number as a Timepoint.\n */\n function blockNumber() internal view returns (uint48) {\n return SafeCast.toUint48(block.number);\n }\n\n // ==================================================== Delay =====================================================\n /**\n * @dev A `Delay` is a uint32 duration that can be programmed to change value automatically at a given point in the\n * future. The \"effect\" timepoint describes when the transitions happens from the \"old\" value to the \"new\" value.\n * This allows updating the delay applied to some operation while keeping some guarantees.\n *\n * In particular, the {update} function guarantees that if the delay is reduced, the old delay still applies for\n * some time. For example if the delay is currently 7 days to do an upgrade, the admin should not be able to set\n * the delay to 0 and upgrade immediately. If the admin wants to reduce the delay, the old delay (7 days) should\n * still apply for some time.\n *\n *\n * The `Delay` type is 112 bits long, and packs the following:\n *\n * ```\n * | [uint48]: effect date (timepoint)\n * | | [uint32]: value before (duration)\n * ↓ ↓ ↓ [uint32]: value after (duration)\n * 0xAAAAAAAAAAAABBBBBBBBCCCCCCCC\n * ```\n *\n * NOTE: The {get} and {withUpdate} functions operate using timestamps. Block number based delays are not currently\n * supported.\n */\n type Delay is uint112;\n\n /**\n * @dev Wrap a duration into a Delay to add the one-step \"update in the future\" feature\n */\n function toDelay(uint32 duration) internal pure returns (Delay) {\n return Delay.wrap(duration);\n }\n\n /**\n * @dev Get the value at a given timepoint plus the pending value and effect timepoint if there is a scheduled\n * change after this timepoint. If the effect timepoint is 0, then the pending value should not be considered.\n */\n function _getFullAt(\n Delay self,\n uint48 timepoint\n ) private pure returns (uint32 valueBefore, uint32 valueAfter, uint48 effect) {\n (valueBefore, valueAfter, effect) = self.unpack();\n return effect <= timepoint ? (valueAfter, 0, 0) : (valueBefore, valueAfter, effect);\n }\n\n /**\n * @dev Get the current value plus the pending value and effect timepoint if there is a scheduled change. If the\n * effect timepoint is 0, then the pending value should not be considered.\n */\n function getFull(Delay self) internal view returns (uint32 valueBefore, uint32 valueAfter, uint48 effect) {\n return _getFullAt(self, timestamp());\n }\n\n /**\n * @dev Get the current value.\n */\n function get(Delay self) internal view returns (uint32) {\n (uint32 delay, , ) = self.getFull();\n return delay;\n }\n\n /**\n * @dev Update a Delay object so that it takes a new duration after a timepoint that is automatically computed to\n * enforce the old delay at the moment of the update. Returns the updated Delay object and the timestamp when the\n * new delay becomes effective.\n */\n function withUpdate(\n Delay self,\n uint32 newValue,\n uint32 minSetback\n ) internal view returns (Delay updatedDelay, uint48 effect) {\n uint32 value = self.get();\n uint32 setback = uint32(Math.max(minSetback, value > newValue ? value - newValue : 0));\n effect = timestamp() + setback;\n return (pack(value, newValue, effect), effect);\n }\n\n /**\n * @dev Split a delay into its components: valueBefore, valueAfter and effect (transition timepoint).\n */\n function unpack(Delay self) internal pure returns (uint32 valueBefore, uint32 valueAfter, uint48 effect) {\n uint112 raw = Delay.unwrap(self);\n\n valueAfter = uint32(raw);\n valueBefore = uint32(raw >> 32);\n effect = uint48(raw >> 64);\n\n return (valueBefore, valueAfter, effect);\n }\n\n /**\n * @dev pack the components into a Delay object.\n */\n function pack(uint32 valueBefore, uint32 valueAfter, uint48 effect) internal pure returns (Delay) {\n return Delay.wrap((uint112(effect) << 64) | (uint112(valueBefore) << 32) | uint112(valueAfter));\n }\n}\n" + }, + "contracts/variants/crosschain/Gov.sol": { + "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity ^0.8.20;\n\nimport \"@openzeppelin/contracts/governance/Governor.sol\";\nimport \"@openzeppelin/contracts/governance/extensions/GovernorSettings.sol\";\nimport \"@openzeppelin/contracts/governance/extensions/GovernorCountingSimple.sol\";\nimport \"@openzeppelin/contracts/governance/extensions/GovernorVotes.sol\";\nimport \"@openzeppelin/contracts/governance/extensions/GovernorVotesQuorumFraction.sol\";\nimport \"./ProofHandler.sol\";\n\n/**\n * @title Cross-chain Governance Contract\n * @author Web3 Hackers Collective\n * @notice Implementation of a DAO with cross-chain synchronization capabilities\n * @dev Extends OpenZeppelin's Governor contract with cross-chain parameter updates\n * @custom:security-contact julien@strat.cc\n */\ncontract Gov is\n Governor,\n GovernorSettings,\n GovernorCountingSimple,\n GovernorVotes,\n GovernorVotesQuorumFraction\n{\n /// @notice Chain ID where this contract was originally deployed\n uint256 public immutable home;\n\n /// @notice IPFS CID of the DAO's manifesto\n string public manifesto;\n\n /// @notice Storage for proof handling\n ProofHandler.ProofStorage private _proofStorage;\n\n /// @notice Types of operations that can be synchronized across chains\n enum OperationType {\n SET_MANIFESTO,\n UPDATE_VOTING_DELAY,\n UPDATE_VOTING_PERIOD,\n UPDATE_PROPOSAL_THRESHOLD,\n UPDATE_QUORUM\n }\n\n /// @notice Emitted when the manifesto is updated\n /// @param oldManifesto Previous manifesto CID\n /// @param newManifesto New manifesto CID\n /// @param nonce Update sequence number\n event ManifestoUpdated(string oldManifesto, string newManifesto, uint256 nonce);\n\n /// @notice Emitted when a governance parameter is updated\n /// @param operationType Type of parameter updated\n /// @param oldValue Previous value\n /// @param newValue New value\n /// @param nonce Update sequence number\n event GovernanceParameterUpdated(\n OperationType indexed operationType,\n uint256 oldValue,\n uint256 newValue,\n uint256 nonce\n );\n\n /// @notice Restricts functions to be called only on the home chain\n modifier onlyHomeChain() {\n require(block.chainid == home, \"Operation only allowed on home chain\");\n _;\n }\n\n /**\n * @notice Initializes the governance contract\n * @dev Sets up initial governance parameters and manifesto\n * @param _home Chain ID where this contract is considered home\n * @param _token The voting token contract address\n * @param _manifestoCid Initial manifesto CID\n * @param _name Name of the governance contract\n * @param _votingDelay Time before voting begins\n * @param _votingPeriod Duration of voting period\n * @param _proposalThreshold Minimum votes needed to create a proposal\n * @param _quorum Minimum participation percentage required\n */\n constructor(\n uint256 _home,\n IVotes _token,\n string memory _manifestoCid,\n string memory _name,\n uint48 _votingDelay,\n uint32 _votingPeriod,\n uint256 _proposalThreshold,\n uint256 _quorum\n )\n Governor(_name)\n GovernorSettings(_votingDelay, _votingPeriod, _proposalThreshold)\n GovernorVotes(_token)\n GovernorVotesQuorumFraction(_quorum)\n {\n home = _home;\n manifesto = _manifestoCid;\n }\n\n /**\n * @notice Updates the DAO's manifesto on the home chain\n * @param newManifesto New manifesto CID\n */\n function setManifesto(string memory newManifesto) public onlyGovernance onlyHomeChain {\n uint256 nonce = ProofHandler.incrementNonce(\n _proofStorage,\n uint8(OperationType.SET_MANIFESTO)\n );\n string memory oldManifesto = manifesto;\n manifesto = newManifesto;\n emit ManifestoUpdated(oldManifesto, newManifesto, nonce);\n }\n\n /**\n * @notice Updates the voting delay parameter on the home chain\n * @param newVotingDelay New voting delay value\n */\n function setVotingDelay(\n uint48 newVotingDelay\n ) public virtual override onlyGovernance onlyHomeChain {\n uint256 nonce = ProofHandler.incrementNonce(\n _proofStorage,\n uint8(OperationType.UPDATE_VOTING_DELAY)\n );\n uint256 oldValue = votingDelay();\n _setVotingDelay(newVotingDelay);\n emit GovernanceParameterUpdated(\n OperationType.UPDATE_VOTING_DELAY,\n oldValue,\n newVotingDelay,\n nonce\n );\n }\n\n /**\n * @notice Updates the voting period parameter on the home chain\n * @param newVotingPeriod New voting period value\n */\n function setVotingPeriod(\n uint32 newVotingPeriod\n ) public virtual override onlyGovernance onlyHomeChain {\n uint256 nonce = ProofHandler.incrementNonce(\n _proofStorage,\n uint8(OperationType.UPDATE_VOTING_PERIOD)\n );\n uint256 oldValue = votingPeriod();\n _setVotingPeriod(newVotingPeriod);\n emit GovernanceParameterUpdated(\n OperationType.UPDATE_VOTING_PERIOD,\n oldValue,\n newVotingPeriod,\n nonce\n );\n }\n\n /**\n * @notice Updates the proposal threshold parameter on the home chain\n * @param newProposalThreshold New proposal threshold value\n */\n function setProposalThreshold(\n uint256 newProposalThreshold\n ) public virtual override onlyGovernance onlyHomeChain {\n uint256 nonce = ProofHandler.incrementNonce(\n _proofStorage,\n uint8(OperationType.UPDATE_PROPOSAL_THRESHOLD)\n );\n uint256 oldValue = proposalThreshold();\n _setProposalThreshold(newProposalThreshold);\n emit GovernanceParameterUpdated(\n OperationType.UPDATE_PROPOSAL_THRESHOLD,\n oldValue,\n newProposalThreshold,\n nonce\n );\n }\n\n /**\n * @notice Updates the quorum numerator on the home chain\n * @param newQuorumNumerator New quorum numerator value\n */\n function updateQuorumNumerator(\n uint256 newQuorumNumerator\n ) public virtual override onlyGovernance onlyHomeChain {\n uint256 nonce = ProofHandler.incrementNonce(\n _proofStorage,\n uint8(OperationType.UPDATE_QUORUM)\n );\n uint256 oldValue = quorumNumerator();\n _updateQuorumNumerator(newQuorumNumerator);\n emit GovernanceParameterUpdated(\n OperationType.UPDATE_QUORUM,\n oldValue,\n newQuorumNumerator,\n nonce\n );\n }\n\n /**\n * @notice Generates proof for parameter updates\n * @param operationType Type of parameter being updated\n * @param value Encoded parameter value\n * @return proof Encoded proof data\n */\n function generateParameterProof(\n uint8 operationType,\n bytes memory value\n ) external view returns (bytes memory proof) {\n require(block.chainid == home, \"Proofs only generated on home chain\");\n uint256 nextNonce = ProofHandler.getNextNonce(_proofStorage, operationType);\n return ProofHandler.generateProof(address(this), operationType, value, nextNonce);\n }\n\n /**\n * @notice Claims a parameter update on a foreign chain\n * @param proof Proof generated by home chain\n */\n function claimParameterUpdate(bytes memory proof) external {\n (uint8 operationType, bytes memory value, uint256 nonce) = ProofHandler.verifyAndClaimProof(\n proof,\n address(this),\n _proofStorage\n );\n\n if (operationType == uint8(OperationType.SET_MANIFESTO)) {\n string memory newManifesto = abi.decode(value, (string));\n string memory oldManifesto = manifesto;\n manifesto = newManifesto;\n emit ManifestoUpdated(oldManifesto, newManifesto, nonce);\n } else if (operationType == uint8(OperationType.UPDATE_VOTING_DELAY)) {\n uint48 newValue = uint48(bytes6(value));\n uint256 oldValue = votingDelay();\n _setVotingDelay(newValue);\n emit GovernanceParameterUpdated(\n OperationType.UPDATE_VOTING_DELAY,\n oldValue,\n newValue,\n nonce\n );\n } else if (operationType == uint8(OperationType.UPDATE_VOTING_PERIOD)) {\n uint32 newValue = uint32(bytes4(value));\n uint256 oldValue = votingPeriod();\n _setVotingPeriod(newValue);\n emit GovernanceParameterUpdated(\n OperationType.UPDATE_VOTING_PERIOD,\n oldValue,\n newValue,\n nonce\n );\n } else if (operationType == uint8(OperationType.UPDATE_PROPOSAL_THRESHOLD)) {\n uint256 newValue = abi.decode(value, (uint256));\n uint256 oldValue = proposalThreshold();\n _setProposalThreshold(newValue);\n emit GovernanceParameterUpdated(\n OperationType.UPDATE_PROPOSAL_THRESHOLD,\n oldValue,\n newValue,\n nonce\n );\n } else if (operationType == uint8(OperationType.UPDATE_QUORUM)) {\n uint256 newValue = abi.decode(value, (uint256));\n uint256 oldValue = quorumNumerator();\n _updateQuorumNumerator(newValue);\n emit GovernanceParameterUpdated(OperationType.UPDATE_QUORUM, oldValue, newValue, nonce);\n }\n }\n\n // Required overrides\n\n function votingDelay() public view override(Governor, GovernorSettings) returns (uint256) {\n return super.votingDelay();\n }\n\n function votingPeriod() public view override(Governor, GovernorSettings) returns (uint256) {\n return super.votingPeriod();\n }\n\n function quorum(\n uint256 blockNumber\n ) public view override(Governor, GovernorVotesQuorumFraction) returns (uint256) {\n return super.quorum(blockNumber);\n }\n\n function proposalThreshold()\n public\n view\n override(Governor, GovernorSettings)\n returns (uint256)\n {\n return super.proposalThreshold();\n }\n}\n" + }, + "contracts/variants/crosschain/NFT.sol": { + "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity ^0.8.20;\n\nimport \"@openzeppelin/contracts/token/ERC721/ERC721.sol\";\nimport \"@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol\";\nimport \"@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol\";\nimport \"@openzeppelin/contracts/token/ERC721/extensions/ERC721Burnable.sol\";\nimport \"@openzeppelin/contracts/access/Ownable.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/EIP712.sol\";\nimport \"@openzeppelin/contracts/token/ERC721/extensions/ERC721Votes.sol\";\nimport \"./ProofHandler.sol\";\n\n/**\n * @title Cross-chain Membership NFT Contract\n * @author Web3 Hackers Collective\n * @notice Non-transferable NFT implementation for DAO membership with cross-chain capabilities\n * @dev Extends OpenZeppelin's NFT standards with cross-chain operation support\n * @custom:security-contact julien@strat.cc\n */\ncontract NFT is\n ERC721,\n ERC721Enumerable,\n ERC721URIStorage,\n ERC721Burnable,\n Ownable,\n EIP712,\n ERC721Votes\n{\n using ProofHandler for ProofHandler.ProofStorage;\n\n /// @notice Chain ID where contract was originally deployed\n uint256 public immutable home;\n\n /// @notice Next token ID to be minted\n uint256 private _nextTokenId;\n\n /// @notice Storage for proof handling\n ProofHandler.ProofStorage private _proofStorage;\n\n /// @notice Types of operations that can be synchronized across chains\n enum OperationType {\n MINT,\n BURN,\n SET_METADATA\n }\n\n /// @notice Emitted when a membership is claimed\n /// @param tokenId The ID of the claimed token\n /// @param member The address receiving the membership\n /// @param nonce Operation sequence number\n event MembershipClaimed(uint256 indexed tokenId, address indexed member, uint256 nonce);\n\n /// @notice Emitted when a membership is revoked\n /// @param tokenId The ID of the revoked token\n /// @param member The address losing membership\n /// @param nonce Operation sequence number\n event MembershipRevoked(uint256 indexed tokenId, address indexed member, uint256 nonce);\n\n /// @notice Emitted when metadata is updated\n /// @param tokenId The ID of the updated token\n /// @param newUri The new metadata URI\n /// @param nonce Operation sequence number\n event MetadataUpdated(uint256 indexed tokenId, string newUri, uint256 nonce);\n\n /// @notice Restricts functions to home chain\n modifier onlyHomeChain() {\n require(block.chainid == home, \"Operation only allowed on home chain\");\n _;\n }\n\n /**\n * @notice Initializes the NFT contract\n * @param _home Chain ID where contract is considered home\n * @param initialOwner Initial contract owner\n * @param _firstMembers Array of initial member addresses\n * @param _uri Initial token URI\n * @param _name Token collection name\n * @param _symbol Token collection symbol\n */\n constructor(\n uint256 _home,\n address initialOwner,\n address[] memory _firstMembers,\n string memory _uri,\n string memory _name,\n string memory _symbol\n ) ERC721(_name, _symbol) Ownable(initialOwner) EIP712(_name, \"1\") {\n home = _home;\n for (uint i; i < _firstMembers.length; i++) {\n _govMint(_firstMembers[i], _uri);\n }\n }\n\n /**\n * @notice Adds a new member on home chain\n * @dev Only callable by owner (governance) on home chain\n * @param to Address to mint token to\n * @param uri Token metadata URI\n */\n function safeMint(address to, string memory uri) public onlyOwner onlyHomeChain {\n uint256 nonce = _proofStorage.incrementNonce(uint8(OperationType.MINT));\n _govMint(to, uri);\n emit MembershipClaimed(_nextTokenId - 1, to, nonce);\n }\n\n /**\n * @notice Burns token on home chain\n * @dev Only callable by owner (governance) on home chain\n * @param tokenId ID of token to burn\n */\n function govBurn(uint256 tokenId) public onlyOwner onlyHomeChain {\n uint256 nonce = _proofStorage.incrementNonce(uint8(OperationType.BURN));\n address owner = ownerOf(tokenId);\n _burn(tokenId);\n emit MembershipRevoked(tokenId, owner, nonce);\n }\n\n /**\n * @notice Updates token metadata on home chain\n * @dev Only callable by owner (governance) on home chain\n * @param tokenId ID of token to update\n * @param uri New metadata URI\n */\n function setMetadata(uint256 tokenId, string memory uri) public onlyOwner onlyHomeChain {\n uint256 nonce = _proofStorage.incrementNonce(uint8(OperationType.SET_METADATA));\n _setTokenURI(tokenId, uri);\n emit MetadataUpdated(tokenId, uri, nonce);\n }\n\n /**\n * @notice Generates proof for NFT operations\n * @param operationType Type of operation\n * @param params Operation parameters\n * @return Encoded proof data\n */\n function generateOperationProof(\n uint8 operationType,\n bytes memory params\n ) external view returns (bytes memory) {\n require(block.chainid == home, \"Proofs only generated on home chain\");\n uint256 nextNonce = _proofStorage.getNextNonce(operationType);\n return ProofHandler.generateProof(address(this), operationType, params, nextNonce);\n }\n\n /**\n * @notice Claims an NFT operation on a foreign chain\n * @param proof Proof generated by home chain\n */\n function claimOperation(bytes memory proof) external {\n (uint8 operationType, bytes memory params, uint256 nonce) = ProofHandler\n .verifyAndClaimProof(proof, address(this), _proofStorage);\n\n if (operationType == uint8(OperationType.MINT)) {\n (address to, string memory uri) = abi.decode(params, (address, string));\n _govMint(to, uri);\n emit MembershipClaimed(_nextTokenId - 1, to, nonce);\n } else if (operationType == uint8(OperationType.BURN)) {\n uint256 tokenId = abi.decode(params, (uint256));\n address owner = ownerOf(tokenId);\n _burn(tokenId);\n emit MembershipRevoked(tokenId, owner, nonce);\n } else if (operationType == uint8(OperationType.SET_METADATA)) {\n (uint256 tokenId, string memory uri) = abi.decode(params, (uint256, string));\n _setTokenURI(tokenId, uri);\n emit MetadataUpdated(tokenId, uri, nonce);\n }\n }\n\n /**\n * @notice Internal function for minting without proof verification\n * @param to Address to receive token\n * @param uri Token metadata URI\n */\n function _govMint(address to, string memory uri) internal {\n uint256 tokenId = _nextTokenId++;\n _safeMint(to, tokenId);\n _setTokenURI(tokenId, uri);\n }\n\n // Required overrides\n\n function _update(\n address to,\n uint256 tokenId,\n address auth\n ) internal override(ERC721, ERC721Enumerable, ERC721Votes) returns (address) {\n require(auth == address(0) || to == address(0), \"NFT is not transferable\");\n return super._update(to, tokenId, auth);\n }\n\n function _increaseBalance(\n address account,\n uint128 value\n ) internal override(ERC721, ERC721Enumerable, ERC721Votes) {\n super._increaseBalance(account, value);\n }\n\n function tokenURI(\n uint256 tokenId\n ) public view override(ERC721, ERC721URIStorage) returns (string memory) {\n return super.tokenURI(tokenId);\n }\n\n function supportsInterface(\n bytes4 interfaceId\n ) public view override(ERC721, ERC721Enumerable, ERC721URIStorage) returns (bool) {\n return super.supportsInterface(interfaceId);\n }\n\n function clock() public view override returns (uint48) {\n return uint48(block.timestamp);\n }\n\n function CLOCK_MODE() public pure override returns (string memory) {\n return \"mode=timestamp\";\n }\n}\n" + }, + "contracts/variants/crosschain/ProofHandler.sol": { + "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity ^0.8.20;\n\n/**\n * @title Proof Handler Library\n * @author Web3 Hackers Collective\n * @notice Library for standardized cross-chain proof generation and verification\n * @dev Handles proof generation, verification, and tracking for cross-chain operations\n * @custom:security-contact julien@strat.cc\n */\nlibrary ProofHandler {\n /// @notice Tracks which proofs have been applied on each chain\n struct ProofStorage {\n mapping(bytes32 => bool) updateAppliedOnChain;\n mapping(uint8 => uint256) currentNonce;\n }\n\n /// @dev Emitted when a proof is claimed\n event ProofClaimed(uint8 indexed operationType, bytes params, uint256 nonce);\n\n /**\n * @notice Generates a proof for cross-chain operations\n * @param contractAddress Address of contract generating the proof\n * @param operationType Type of operation being performed\n * @param params Operation parameters\n * @param nonce Current nonce for this operation type\n * @return proof Encoded proof data\n */\n function generateProof(\n address contractAddress,\n uint8 operationType,\n bytes memory params,\n uint256 nonce\n ) public pure returns (bytes memory proof) {\n bytes32 message = keccak256(\n abi.encodePacked(contractAddress, operationType, params, nonce)\n );\n bytes32 digest = keccak256(abi.encodePacked(\"\\x19Ethereum Signed Message:\\n32\", message));\n\n return abi.encode(operationType, params, nonce, digest);\n }\n\n /**\n * @notice Verifies and claims a proof\n * @param proof Proof to verify and claim\n * @param contractAddress Address of contract claiming the proof\n * @param storage_ Proof storage struct\n * @return operationType The type of operation being performed\n * @return params The operation parameters\n * @return nonce The operation sequence number\n */\n function verifyAndClaimProof(\n bytes memory proof,\n address contractAddress,\n ProofStorage storage storage_\n ) public returns (uint8 operationType, bytes memory params, uint256 nonce) {\n bytes32 digest;\n (operationType, params, nonce, digest) = abi.decode(\n proof,\n (uint8, bytes, uint256, bytes32)\n );\n\n bytes32 proofHash = keccak256(proof);\n require(!storage_.updateAppliedOnChain[proofHash], \"Proof already claimed\");\n require(nonce == storage_.currentNonce[operationType] + 1, \"Invalid nonce\");\n\n bytes32 message = keccak256(\n abi.encodePacked(contractAddress, operationType, params, nonce)\n );\n bytes32 expectedDigest = keccak256(\n abi.encodePacked(\"\\x19Ethereum Signed Message:\\n32\", message)\n );\n require(digest == expectedDigest, \"Invalid proof\");\n\n storage_.updateAppliedOnChain[proofHash] = true;\n storage_.currentNonce[operationType] = nonce;\n\n emit ProofClaimed(operationType, params, nonce);\n\n return (operationType, params, nonce);\n }\n\n /**\n * @notice Gets the next nonce for an operation type\n * @param storage_ Proof storage struct\n * @param operationType Type of operation\n * @return nonce Next nonce value\n */\n function getNextNonce(\n ProofStorage storage storage_,\n uint8 operationType\n ) public view returns (uint256 nonce) {\n return storage_.currentNonce[operationType] + 1;\n }\n\n /**\n * @notice Increments the nonce for an operation type\n * @param storage_ Proof storage struct\n * @param operationType Type of operation\n * @return nonce New nonce value\n */\n function incrementNonce(\n ProofStorage storage storage_,\n uint8 operationType\n ) public returns (uint256 nonce) {\n storage_.currentNonce[operationType]++;\n return storage_.currentNonce[operationType];\n }\n}\n" + } + }, + "settings": { + "optimizer": { + "enabled": true, + "runs": 200 + }, + "evmVersion": "paris", + "outputSelection": { + "*": { + "*": [ + "abi", + "evm.bytecode", + "evm.deployedBytecode", + "evm.methodIdentifiers", + "metadata", + "devdoc", + "userdoc", + "storageLayout", + "evm.gasEstimates" + ], + "": [ + "ast" + ] + } + }, + "metadata": { + "useLiteralContent": true + } + } +} \ No newline at end of file diff --git a/deployments/op-sepolia/solcInputs/96a9008abeaccbd30a9b75989ce7f0fd.json b/deployments/arbitrumSepolia/solcInputs/96a9008abeaccbd30a9b75989ce7f0fd.json similarity index 100% rename from deployments/op-sepolia/solcInputs/96a9008abeaccbd30a9b75989ce7f0fd.json rename to deployments/arbitrumSepolia/solcInputs/96a9008abeaccbd30a9b75989ce7f0fd.json diff --git a/deployments/arbitrumSepolia/solcInputs/c27a34cff02617821c386fb97b476bc1.json b/deployments/arbitrumSepolia/solcInputs/c27a34cff02617821c386fb97b476bc1.json new file mode 100644 index 0000000..f692b04 --- /dev/null +++ b/deployments/arbitrumSepolia/solcInputs/c27a34cff02617821c386fb97b476bc1.json @@ -0,0 +1,147 @@ +{ + "language": "Solidity", + "sources": { + "@openzeppelin/contracts/access/Ownable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol)\n\npragma solidity ^0.8.20;\n\nimport {Context} from \"../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 * The initial owner is set to the address provided by the deployer. This can\n * 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 /**\n * @dev The caller account is not authorized to perform an operation.\n */\n error OwnableUnauthorizedAccount(address account);\n\n /**\n * @dev The owner is not a valid owner account. (eg. `address(0)`)\n */\n error OwnableInvalidOwner(address owner);\n\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n /**\n * @dev Initializes the contract setting the address provided by the deployer as the initial owner.\n */\n constructor(address initialOwner) {\n if (initialOwner == address(0)) {\n revert OwnableInvalidOwner(address(0));\n }\n _transferOwnership(initialOwner);\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 if (owner() != _msgSender()) {\n revert OwnableUnauthorizedAccount(_msgSender());\n }\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 if (newOwner == address(0)) {\n revert OwnableInvalidOwner(address(0));\n }\n _transferOwnership(newOwner);\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Internal function without access restriction.\n */\n function _transferOwnership(address newOwner) internal virtual {\n address oldOwner = _owner;\n _owner = newOwner;\n emit OwnershipTransferred(oldOwner, newOwner);\n }\n}\n" + }, + "@openzeppelin/contracts/governance/utils/IVotes.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (governance/utils/IVotes.sol)\npragma solidity ^0.8.20;\n\n/**\n * @dev Common interface for {ERC20Votes}, {ERC721Votes}, and other {Votes}-enabled contracts.\n */\ninterface IVotes {\n /**\n * @dev The signature used has expired.\n */\n error VotesExpiredSignature(uint256 expiry);\n\n /**\n * @dev Emitted when an account changes their delegate.\n */\n event DelegateChanged(address indexed delegator, address indexed fromDelegate, address indexed toDelegate);\n\n /**\n * @dev Emitted when a token transfer or delegate change results in changes to a delegate's number of voting units.\n */\n event DelegateVotesChanged(address indexed delegate, uint256 previousVotes, uint256 newVotes);\n\n /**\n * @dev Returns the current amount of votes that `account` has.\n */\n function getVotes(address account) external view returns (uint256);\n\n /**\n * @dev Returns the amount of votes that `account` had at a specific moment in the past. If the `clock()` is\n * configured to use block numbers, this will return the value at the end of the corresponding block.\n */\n function getPastVotes(address account, uint256 timepoint) external view returns (uint256);\n\n /**\n * @dev Returns the total supply of votes available at a specific moment in the past. If the `clock()` is\n * configured to use block numbers, this will return the value at the end of the corresponding block.\n *\n * NOTE: This value is the sum of all available votes, which is not necessarily the sum of all delegated votes.\n * Votes that have not been delegated are still part of total supply, even though they would not participate in a\n * vote.\n */\n function getPastTotalSupply(uint256 timepoint) external view returns (uint256);\n\n /**\n * @dev Returns the delegate that `account` has chosen.\n */\n function delegates(address account) external view returns (address);\n\n /**\n * @dev Delegates votes from the sender to `delegatee`.\n */\n function delegate(address delegatee) external;\n\n /**\n * @dev Delegates votes from signer to `delegatee`.\n */\n function delegateBySig(address delegatee, uint256 nonce, uint256 expiry, uint8 v, bytes32 r, bytes32 s) external;\n}\n" + }, + "@openzeppelin/contracts/governance/utils/Votes.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (governance/utils/Votes.sol)\npragma solidity ^0.8.20;\n\nimport {IERC5805} from \"../../interfaces/IERC5805.sol\";\nimport {Context} from \"../../utils/Context.sol\";\nimport {Nonces} from \"../../utils/Nonces.sol\";\nimport {EIP712} from \"../../utils/cryptography/EIP712.sol\";\nimport {Checkpoints} from \"../../utils/structs/Checkpoints.sol\";\nimport {SafeCast} from \"../../utils/math/SafeCast.sol\";\nimport {ECDSA} from \"../../utils/cryptography/ECDSA.sol\";\nimport {Time} from \"../../utils/types/Time.sol\";\n\n/**\n * @dev This is a base abstract contract that tracks voting units, which are a measure of voting power that can be\n * transferred, and provides a system of vote delegation, where an account can delegate its voting units to a sort of\n * \"representative\" that will pool delegated voting units from different accounts and can then use it to vote in\n * decisions. In fact, voting units _must_ be delegated in order to count as actual votes, and an account has to\n * delegate those votes to itself if it wishes to participate in decisions and does not have a trusted representative.\n *\n * This contract is often combined with a token contract such that voting units correspond to token units. For an\n * example, see {ERC721Votes}.\n *\n * The full history of delegate votes is tracked on-chain so that governance protocols can consider votes as distributed\n * at a particular block number to protect against flash loans and double voting. The opt-in delegate system makes the\n * cost of this history tracking optional.\n *\n * When using this module the derived contract must implement {_getVotingUnits} (for example, make it return\n * {ERC721-balanceOf}), and can use {_transferVotingUnits} to track a change in the distribution of those units (in the\n * previous example, it would be included in {ERC721-_update}).\n */\nabstract contract Votes is Context, EIP712, Nonces, IERC5805 {\n using Checkpoints for Checkpoints.Trace208;\n\n bytes32 private constant DELEGATION_TYPEHASH =\n keccak256(\"Delegation(address delegatee,uint256 nonce,uint256 expiry)\");\n\n mapping(address account => address) private _delegatee;\n\n mapping(address delegatee => Checkpoints.Trace208) private _delegateCheckpoints;\n\n Checkpoints.Trace208 private _totalCheckpoints;\n\n /**\n * @dev The clock was incorrectly modified.\n */\n error ERC6372InconsistentClock();\n\n /**\n * @dev Lookup to future votes is not available.\n */\n error ERC5805FutureLookup(uint256 timepoint, uint48 clock);\n\n /**\n * @dev Clock used for flagging checkpoints. Can be overridden to implement timestamp based\n * checkpoints (and voting), in which case {CLOCK_MODE} should be overridden as well to match.\n */\n function clock() public view virtual returns (uint48) {\n return Time.blockNumber();\n }\n\n /**\n * @dev Machine-readable description of the clock as specified in ERC-6372.\n */\n // solhint-disable-next-line func-name-mixedcase\n function CLOCK_MODE() public view virtual returns (string memory) {\n // Check that the clock was not modified\n if (clock() != Time.blockNumber()) {\n revert ERC6372InconsistentClock();\n }\n return \"mode=blocknumber&from=default\";\n }\n\n /**\n * @dev Returns the current amount of votes that `account` has.\n */\n function getVotes(address account) public view virtual returns (uint256) {\n return _delegateCheckpoints[account].latest();\n }\n\n /**\n * @dev Returns the amount of votes that `account` had at a specific moment in the past. If the `clock()` is\n * configured to use block numbers, this will return the value at the end of the corresponding block.\n *\n * Requirements:\n *\n * - `timepoint` must be in the past. If operating using block numbers, the block must be already mined.\n */\n function getPastVotes(address account, uint256 timepoint) public view virtual returns (uint256) {\n uint48 currentTimepoint = clock();\n if (timepoint >= currentTimepoint) {\n revert ERC5805FutureLookup(timepoint, currentTimepoint);\n }\n return _delegateCheckpoints[account].upperLookupRecent(SafeCast.toUint48(timepoint));\n }\n\n /**\n * @dev Returns the total supply of votes available at a specific moment in the past. If the `clock()` is\n * configured to use block numbers, this will return the value at the end of the corresponding block.\n *\n * NOTE: This value is the sum of all available votes, which is not necessarily the sum of all delegated votes.\n * Votes that have not been delegated are still part of total supply, even though they would not participate in a\n * vote.\n *\n * Requirements:\n *\n * - `timepoint` must be in the past. If operating using block numbers, the block must be already mined.\n */\n function getPastTotalSupply(uint256 timepoint) public view virtual returns (uint256) {\n uint48 currentTimepoint = clock();\n if (timepoint >= currentTimepoint) {\n revert ERC5805FutureLookup(timepoint, currentTimepoint);\n }\n return _totalCheckpoints.upperLookupRecent(SafeCast.toUint48(timepoint));\n }\n\n /**\n * @dev Returns the current total supply of votes.\n */\n function _getTotalSupply() internal view virtual returns (uint256) {\n return _totalCheckpoints.latest();\n }\n\n /**\n * @dev Returns the delegate that `account` has chosen.\n */\n function delegates(address account) public view virtual returns (address) {\n return _delegatee[account];\n }\n\n /**\n * @dev Delegates votes from the sender to `delegatee`.\n */\n function delegate(address delegatee) public virtual {\n address account = _msgSender();\n _delegate(account, delegatee);\n }\n\n /**\n * @dev Delegates votes from signer to `delegatee`.\n */\n function delegateBySig(\n address delegatee,\n uint256 nonce,\n uint256 expiry,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) public virtual {\n if (block.timestamp > expiry) {\n revert VotesExpiredSignature(expiry);\n }\n address signer = ECDSA.recover(\n _hashTypedDataV4(keccak256(abi.encode(DELEGATION_TYPEHASH, delegatee, nonce, expiry))),\n v,\n r,\n s\n );\n _useCheckedNonce(signer, nonce);\n _delegate(signer, delegatee);\n }\n\n /**\n * @dev Delegate all of `account`'s voting units to `delegatee`.\n *\n * Emits events {IVotes-DelegateChanged} and {IVotes-DelegateVotesChanged}.\n */\n function _delegate(address account, address delegatee) internal virtual {\n address oldDelegate = delegates(account);\n _delegatee[account] = delegatee;\n\n emit DelegateChanged(account, oldDelegate, delegatee);\n _moveDelegateVotes(oldDelegate, delegatee, _getVotingUnits(account));\n }\n\n /**\n * @dev Transfers, mints, or burns voting units. To register a mint, `from` should be zero. To register a burn, `to`\n * should be zero. Total supply of voting units will be adjusted with mints and burns.\n */\n function _transferVotingUnits(address from, address to, uint256 amount) internal virtual {\n if (from == address(0)) {\n _push(_totalCheckpoints, _add, SafeCast.toUint208(amount));\n }\n if (to == address(0)) {\n _push(_totalCheckpoints, _subtract, SafeCast.toUint208(amount));\n }\n _moveDelegateVotes(delegates(from), delegates(to), amount);\n }\n\n /**\n * @dev Moves delegated votes from one delegate to another.\n */\n function _moveDelegateVotes(address from, address to, uint256 amount) internal virtual {\n if (from != to && amount > 0) {\n if (from != address(0)) {\n (uint256 oldValue, uint256 newValue) = _push(\n _delegateCheckpoints[from],\n _subtract,\n SafeCast.toUint208(amount)\n );\n emit DelegateVotesChanged(from, oldValue, newValue);\n }\n if (to != address(0)) {\n (uint256 oldValue, uint256 newValue) = _push(\n _delegateCheckpoints[to],\n _add,\n SafeCast.toUint208(amount)\n );\n emit DelegateVotesChanged(to, oldValue, newValue);\n }\n }\n }\n\n /**\n * @dev Get number of checkpoints for `account`.\n */\n function _numCheckpoints(address account) internal view virtual returns (uint32) {\n return SafeCast.toUint32(_delegateCheckpoints[account].length());\n }\n\n /**\n * @dev Get the `pos`-th checkpoint for `account`.\n */\n function _checkpoints(\n address account,\n uint32 pos\n ) internal view virtual returns (Checkpoints.Checkpoint208 memory) {\n return _delegateCheckpoints[account].at(pos);\n }\n\n function _push(\n Checkpoints.Trace208 storage store,\n function(uint208, uint208) view returns (uint208) op,\n uint208 delta\n ) private returns (uint208 oldValue, uint208 newValue) {\n return store.push(clock(), op(store.latest(), delta));\n }\n\n function _add(uint208 a, uint208 b) private pure returns (uint208) {\n return a + b;\n }\n\n function _subtract(uint208 a, uint208 b) private pure returns (uint208) {\n return a - b;\n }\n\n /**\n * @dev Must return the voting units held by an account.\n */\n function _getVotingUnits(address) internal view virtual returns (uint256);\n}\n" + }, + "@openzeppelin/contracts/interfaces/draft-IERC6093.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (interfaces/draft-IERC6093.sol)\npragma solidity ^0.8.20;\n\n/**\n * @dev Standard ERC-20 Errors\n * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC-20 tokens.\n */\ninterface IERC20Errors {\n /**\n * @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers.\n * @param sender Address whose tokens are being transferred.\n * @param balance Current balance for the interacting account.\n * @param needed Minimum amount required to perform a transfer.\n */\n error ERC20InsufficientBalance(address sender, uint256 balance, uint256 needed);\n\n /**\n * @dev Indicates a failure with the token `sender`. Used in transfers.\n * @param sender Address whose tokens are being transferred.\n */\n error ERC20InvalidSender(address sender);\n\n /**\n * @dev Indicates a failure with the token `receiver`. Used in transfers.\n * @param receiver Address to which tokens are being transferred.\n */\n error ERC20InvalidReceiver(address receiver);\n\n /**\n * @dev Indicates a failure with the `spender`’s `allowance`. Used in transfers.\n * @param spender Address that may be allowed to operate on tokens without being their owner.\n * @param allowance Amount of tokens a `spender` is allowed to operate with.\n * @param needed Minimum amount required to perform a transfer.\n */\n error ERC20InsufficientAllowance(address spender, uint256 allowance, uint256 needed);\n\n /**\n * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.\n * @param approver Address initiating an approval operation.\n */\n error ERC20InvalidApprover(address approver);\n\n /**\n * @dev Indicates a failure with the `spender` to be approved. Used in approvals.\n * @param spender Address that may be allowed to operate on tokens without being their owner.\n */\n error ERC20InvalidSpender(address spender);\n}\n\n/**\n * @dev Standard ERC-721 Errors\n * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC-721 tokens.\n */\ninterface IERC721Errors {\n /**\n * @dev Indicates that an address can't be an owner. For example, `address(0)` is a forbidden owner in ERC-20.\n * Used in balance queries.\n * @param owner Address of the current owner of a token.\n */\n error ERC721InvalidOwner(address owner);\n\n /**\n * @dev Indicates a `tokenId` whose `owner` is the zero address.\n * @param tokenId Identifier number of a token.\n */\n error ERC721NonexistentToken(uint256 tokenId);\n\n /**\n * @dev Indicates an error related to the ownership over a particular token. Used in transfers.\n * @param sender Address whose tokens are being transferred.\n * @param tokenId Identifier number of a token.\n * @param owner Address of the current owner of a token.\n */\n error ERC721IncorrectOwner(address sender, uint256 tokenId, address owner);\n\n /**\n * @dev Indicates a failure with the token `sender`. Used in transfers.\n * @param sender Address whose tokens are being transferred.\n */\n error ERC721InvalidSender(address sender);\n\n /**\n * @dev Indicates a failure with the token `receiver`. Used in transfers.\n * @param receiver Address to which tokens are being transferred.\n */\n error ERC721InvalidReceiver(address receiver);\n\n /**\n * @dev Indicates a failure with the `operator`’s approval. Used in transfers.\n * @param operator Address that may be allowed to operate on tokens without being their owner.\n * @param tokenId Identifier number of a token.\n */\n error ERC721InsufficientApproval(address operator, uint256 tokenId);\n\n /**\n * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.\n * @param approver Address initiating an approval operation.\n */\n error ERC721InvalidApprover(address approver);\n\n /**\n * @dev Indicates a failure with the `operator` to be approved. Used in approvals.\n * @param operator Address that may be allowed to operate on tokens without being their owner.\n */\n error ERC721InvalidOperator(address operator);\n}\n\n/**\n * @dev Standard ERC-1155 Errors\n * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC-1155 tokens.\n */\ninterface IERC1155Errors {\n /**\n * @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers.\n * @param sender Address whose tokens are being transferred.\n * @param balance Current balance for the interacting account.\n * @param needed Minimum amount required to perform a transfer.\n * @param tokenId Identifier number of a token.\n */\n error ERC1155InsufficientBalance(address sender, uint256 balance, uint256 needed, uint256 tokenId);\n\n /**\n * @dev Indicates a failure with the token `sender`. Used in transfers.\n * @param sender Address whose tokens are being transferred.\n */\n error ERC1155InvalidSender(address sender);\n\n /**\n * @dev Indicates a failure with the token `receiver`. Used in transfers.\n * @param receiver Address to which tokens are being transferred.\n */\n error ERC1155InvalidReceiver(address receiver);\n\n /**\n * @dev Indicates a failure with the `operator`’s approval. Used in transfers.\n * @param operator Address that may be allowed to operate on tokens without being their owner.\n * @param owner Address of the current owner of a token.\n */\n error ERC1155MissingApprovalForAll(address operator, address owner);\n\n /**\n * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.\n * @param approver Address initiating an approval operation.\n */\n error ERC1155InvalidApprover(address approver);\n\n /**\n * @dev Indicates a failure with the `operator` to be approved. Used in approvals.\n * @param operator Address that may be allowed to operate on tokens without being their owner.\n */\n error ERC1155InvalidOperator(address operator);\n\n /**\n * @dev Indicates an array length mismatch between ids and values in a safeBatchTransferFrom operation.\n * Used in batch transfers.\n * @param idsLength Length of the array of token identifiers\n * @param valuesLength Length of the array of token amounts\n */\n error ERC1155InvalidArrayLength(uint256 idsLength, uint256 valuesLength);\n}\n" + }, + "@openzeppelin/contracts/interfaces/IERC165.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC165.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC165} from \"../utils/introspection/IERC165.sol\";\n" + }, + "@openzeppelin/contracts/interfaces/IERC4906.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (interfaces/IERC4906.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC165} from \"./IERC165.sol\";\nimport {IERC721} from \"./IERC721.sol\";\n\n/// @title ERC-721 Metadata Update Extension\ninterface IERC4906 is IERC165, IERC721 {\n /// @dev This event emits when the metadata of a token is changed.\n /// So that the third-party platforms such as NFT market could\n /// timely update the images and related attributes of the NFT.\n event MetadataUpdate(uint256 _tokenId);\n\n /// @dev This event emits when the metadata of a range of tokens is changed.\n /// So that the third-party platforms such as NFT market could\n /// timely update the images and related attributes of the NFTs.\n event BatchMetadataUpdate(uint256 _fromTokenId, uint256 _toTokenId);\n}\n" + }, + "@openzeppelin/contracts/interfaces/IERC5267.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC5267.sol)\n\npragma solidity ^0.8.20;\n\ninterface IERC5267 {\n /**\n * @dev MAY be emitted to signal that the domain could have changed.\n */\n event EIP712DomainChanged();\n\n /**\n * @dev returns the fields and values that describe the domain separator used by this contract for EIP-712\n * signature.\n */\n function eip712Domain()\n external\n view\n returns (\n bytes1 fields,\n string memory name,\n string memory version,\n uint256 chainId,\n address verifyingContract,\n bytes32 salt,\n uint256[] memory extensions\n );\n}\n" + }, + "@openzeppelin/contracts/interfaces/IERC5805.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC5805.sol)\n\npragma solidity ^0.8.20;\n\nimport {IVotes} from \"../governance/utils/IVotes.sol\";\nimport {IERC6372} from \"./IERC6372.sol\";\n\ninterface IERC5805 is IERC6372, IVotes {}\n" + }, + "@openzeppelin/contracts/interfaces/IERC6372.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC6372.sol)\n\npragma solidity ^0.8.20;\n\ninterface IERC6372 {\n /**\n * @dev Clock used for flagging checkpoints. Can be overridden to implement timestamp based checkpoints (and voting).\n */\n function clock() external view returns (uint48);\n\n /**\n * @dev Description of the clock\n */\n // solhint-disable-next-line func-name-mixedcase\n function CLOCK_MODE() external view returns (string memory);\n}\n" + }, + "@openzeppelin/contracts/interfaces/IERC721.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC721.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC721} from \"../token/ERC721/IERC721.sol\";\n" + }, + "@openzeppelin/contracts/token/ERC721/ERC721.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC721/ERC721.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC721} from \"./IERC721.sol\";\nimport {IERC721Metadata} from \"./extensions/IERC721Metadata.sol\";\nimport {ERC721Utils} from \"./utils/ERC721Utils.sol\";\nimport {Context} from \"../../utils/Context.sol\";\nimport {Strings} from \"../../utils/Strings.sol\";\nimport {IERC165, ERC165} from \"../../utils/introspection/ERC165.sol\";\nimport {IERC721Errors} from \"../../interfaces/draft-IERC6093.sol\";\n\n/**\n * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC-721] Non-Fungible Token Standard, including\n * the Metadata extension, but not including the Enumerable extension, which is available separately as\n * {ERC721Enumerable}.\n */\nabstract contract ERC721 is Context, ERC165, IERC721, IERC721Metadata, IERC721Errors {\n using Strings for uint256;\n\n // Token name\n string private _name;\n\n // Token symbol\n string private _symbol;\n\n mapping(uint256 tokenId => address) private _owners;\n\n mapping(address owner => uint256) private _balances;\n\n mapping(uint256 tokenId => address) private _tokenApprovals;\n\n mapping(address owner => mapping(address operator => bool)) private _operatorApprovals;\n\n /**\n * @dev Initializes the contract by setting a `name` and a `symbol` to the token collection.\n */\n constructor(string memory name_, string memory symbol_) {\n _name = name_;\n _symbol = symbol_;\n }\n\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {\n return\n interfaceId == type(IERC721).interfaceId ||\n interfaceId == type(IERC721Metadata).interfaceId ||\n super.supportsInterface(interfaceId);\n }\n\n /**\n * @dev See {IERC721-balanceOf}.\n */\n function balanceOf(address owner) public view virtual returns (uint256) {\n if (owner == address(0)) {\n revert ERC721InvalidOwner(address(0));\n }\n return _balances[owner];\n }\n\n /**\n * @dev See {IERC721-ownerOf}.\n */\n function ownerOf(uint256 tokenId) public view virtual returns (address) {\n return _requireOwned(tokenId);\n }\n\n /**\n * @dev See {IERC721Metadata-name}.\n */\n function name() public view virtual returns (string memory) {\n return _name;\n }\n\n /**\n * @dev See {IERC721Metadata-symbol}.\n */\n function symbol() public view virtual returns (string memory) {\n return _symbol;\n }\n\n /**\n * @dev See {IERC721Metadata-tokenURI}.\n */\n function tokenURI(uint256 tokenId) public view virtual returns (string memory) {\n _requireOwned(tokenId);\n\n string memory baseURI = _baseURI();\n return bytes(baseURI).length > 0 ? string.concat(baseURI, tokenId.toString()) : \"\";\n }\n\n /**\n * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each\n * token will be the concatenation of the `baseURI` and the `tokenId`. Empty\n * by default, can be overridden in child contracts.\n */\n function _baseURI() internal view virtual returns (string memory) {\n return \"\";\n }\n\n /**\n * @dev See {IERC721-approve}.\n */\n function approve(address to, uint256 tokenId) public virtual {\n _approve(to, tokenId, _msgSender());\n }\n\n /**\n * @dev See {IERC721-getApproved}.\n */\n function getApproved(uint256 tokenId) public view virtual returns (address) {\n _requireOwned(tokenId);\n\n return _getApproved(tokenId);\n }\n\n /**\n * @dev See {IERC721-setApprovalForAll}.\n */\n function setApprovalForAll(address operator, bool approved) public virtual {\n _setApprovalForAll(_msgSender(), operator, approved);\n }\n\n /**\n * @dev See {IERC721-isApprovedForAll}.\n */\n function isApprovedForAll(address owner, address operator) public view virtual returns (bool) {\n return _operatorApprovals[owner][operator];\n }\n\n /**\n * @dev See {IERC721-transferFrom}.\n */\n function transferFrom(address from, address to, uint256 tokenId) public virtual {\n if (to == address(0)) {\n revert ERC721InvalidReceiver(address(0));\n }\n // Setting an \"auth\" arguments enables the `_isAuthorized` check which verifies that the token exists\n // (from != 0). Therefore, it is not needed to verify that the return value is not 0 here.\n address previousOwner = _update(to, tokenId, _msgSender());\n if (previousOwner != from) {\n revert ERC721IncorrectOwner(from, tokenId, previousOwner);\n }\n }\n\n /**\n * @dev See {IERC721-safeTransferFrom}.\n */\n function safeTransferFrom(address from, address to, uint256 tokenId) public {\n safeTransferFrom(from, to, tokenId, \"\");\n }\n\n /**\n * @dev See {IERC721-safeTransferFrom}.\n */\n function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory data) public virtual {\n transferFrom(from, to, tokenId);\n ERC721Utils.checkOnERC721Received(_msgSender(), from, to, tokenId, data);\n }\n\n /**\n * @dev Returns the owner of the `tokenId`. Does NOT revert if token doesn't exist\n *\n * IMPORTANT: Any overrides to this function that add ownership of tokens not tracked by the\n * core ERC-721 logic MUST be matched with the use of {_increaseBalance} to keep balances\n * consistent with ownership. The invariant to preserve is that for any address `a` the value returned by\n * `balanceOf(a)` must be equal to the number of tokens such that `_ownerOf(tokenId)` is `a`.\n */\n function _ownerOf(uint256 tokenId) internal view virtual returns (address) {\n return _owners[tokenId];\n }\n\n /**\n * @dev Returns the approved address for `tokenId`. Returns 0 if `tokenId` is not minted.\n */\n function _getApproved(uint256 tokenId) internal view virtual returns (address) {\n return _tokenApprovals[tokenId];\n }\n\n /**\n * @dev Returns whether `spender` is allowed to manage `owner`'s tokens, or `tokenId` in\n * particular (ignoring whether it is owned by `owner`).\n *\n * WARNING: This function assumes that `owner` is the actual owner of `tokenId` and does not verify this\n * assumption.\n */\n function _isAuthorized(address owner, address spender, uint256 tokenId) internal view virtual returns (bool) {\n return\n spender != address(0) &&\n (owner == spender || isApprovedForAll(owner, spender) || _getApproved(tokenId) == spender);\n }\n\n /**\n * @dev Checks if `spender` can operate on `tokenId`, assuming the provided `owner` is the actual owner.\n * Reverts if:\n * - `spender` does not have approval from `owner` for `tokenId`.\n * - `spender` does not have approval to manage all of `owner`'s assets.\n *\n * WARNING: This function assumes that `owner` is the actual owner of `tokenId` and does not verify this\n * assumption.\n */\n function _checkAuthorized(address owner, address spender, uint256 tokenId) internal view virtual {\n if (!_isAuthorized(owner, spender, tokenId)) {\n if (owner == address(0)) {\n revert ERC721NonexistentToken(tokenId);\n } else {\n revert ERC721InsufficientApproval(spender, tokenId);\n }\n }\n }\n\n /**\n * @dev Unsafe write access to the balances, used by extensions that \"mint\" tokens using an {ownerOf} override.\n *\n * NOTE: the value is limited to type(uint128).max. This protect against _balance overflow. It is unrealistic that\n * a uint256 would ever overflow from increments when these increments are bounded to uint128 values.\n *\n * WARNING: Increasing an account's balance using this function tends to be paired with an override of the\n * {_ownerOf} function to resolve the ownership of the corresponding tokens so that balances and ownership\n * remain consistent with one another.\n */\n function _increaseBalance(address account, uint128 value) internal virtual {\n unchecked {\n _balances[account] += value;\n }\n }\n\n /**\n * @dev Transfers `tokenId` from its current owner to `to`, or alternatively mints (or burns) if the current owner\n * (or `to`) is the zero address. Returns the owner of the `tokenId` before the update.\n *\n * The `auth` argument is optional. If the value passed is non 0, then this function will check that\n * `auth` is either the owner of the token, or approved to operate on the token (by the owner).\n *\n * Emits a {Transfer} event.\n *\n * NOTE: If overriding this function in a way that tracks balances, see also {_increaseBalance}.\n */\n function _update(address to, uint256 tokenId, address auth) internal virtual returns (address) {\n address from = _ownerOf(tokenId);\n\n // Perform (optional) operator check\n if (auth != address(0)) {\n _checkAuthorized(from, auth, tokenId);\n }\n\n // Execute the update\n if (from != address(0)) {\n // Clear approval. No need to re-authorize or emit the Approval event\n _approve(address(0), tokenId, address(0), false);\n\n unchecked {\n _balances[from] -= 1;\n }\n }\n\n if (to != address(0)) {\n unchecked {\n _balances[to] += 1;\n }\n }\n\n _owners[tokenId] = to;\n\n emit Transfer(from, to, tokenId);\n\n return from;\n }\n\n /**\n * @dev Mints `tokenId` and transfers it to `to`.\n *\n * WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible\n *\n * Requirements:\n *\n * - `tokenId` must not exist.\n * - `to` cannot be the zero address.\n *\n * Emits a {Transfer} event.\n */\n function _mint(address to, uint256 tokenId) internal {\n if (to == address(0)) {\n revert ERC721InvalidReceiver(address(0));\n }\n address previousOwner = _update(to, tokenId, address(0));\n if (previousOwner != address(0)) {\n revert ERC721InvalidSender(address(0));\n }\n }\n\n /**\n * @dev Mints `tokenId`, transfers it to `to` and checks for `to` acceptance.\n *\n * Requirements:\n *\n * - `tokenId` must not exist.\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\n *\n * Emits a {Transfer} event.\n */\n function _safeMint(address to, uint256 tokenId) internal {\n _safeMint(to, tokenId, \"\");\n }\n\n /**\n * @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is\n * forwarded in {IERC721Receiver-onERC721Received} to contract recipients.\n */\n function _safeMint(address to, uint256 tokenId, bytes memory data) internal virtual {\n _mint(to, tokenId);\n ERC721Utils.checkOnERC721Received(_msgSender(), address(0), to, tokenId, data);\n }\n\n /**\n * @dev Destroys `tokenId`.\n * The approval is cleared when the token is burned.\n * This is an internal function that does not check if the sender is authorized to operate on the token.\n *\n * Requirements:\n *\n * - `tokenId` must exist.\n *\n * Emits a {Transfer} event.\n */\n function _burn(uint256 tokenId) internal {\n address previousOwner = _update(address(0), tokenId, address(0));\n if (previousOwner == address(0)) {\n revert ERC721NonexistentToken(tokenId);\n }\n }\n\n /**\n * @dev Transfers `tokenId` from `from` to `to`.\n * As opposed to {transferFrom}, this imposes no restrictions on msg.sender.\n *\n * Requirements:\n *\n * - `to` cannot be the zero address.\n * - `tokenId` token must be owned by `from`.\n *\n * Emits a {Transfer} event.\n */\n function _transfer(address from, address to, uint256 tokenId) internal {\n if (to == address(0)) {\n revert ERC721InvalidReceiver(address(0));\n }\n address previousOwner = _update(to, tokenId, address(0));\n if (previousOwner == address(0)) {\n revert ERC721NonexistentToken(tokenId);\n } else if (previousOwner != from) {\n revert ERC721IncorrectOwner(from, tokenId, previousOwner);\n }\n }\n\n /**\n * @dev Safely transfers `tokenId` token from `from` to `to`, checking that contract recipients\n * are aware of the ERC-721 standard to prevent tokens from being forever locked.\n *\n * `data` is additional data, it has no specified format and it is sent in call to `to`.\n *\n * This internal function is like {safeTransferFrom} in the sense that it invokes\n * {IERC721Receiver-onERC721Received} on the receiver, and can be used to e.g.\n * implement alternative mechanisms to perform token transfer, such as signature-based.\n *\n * Requirements:\n *\n * - `tokenId` token must exist and be owned by `from`.\n * - `to` cannot be the zero address.\n * - `from` cannot be the zero address.\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\n *\n * Emits a {Transfer} event.\n */\n function _safeTransfer(address from, address to, uint256 tokenId) internal {\n _safeTransfer(from, to, tokenId, \"\");\n }\n\n /**\n * @dev Same as {xref-ERC721-_safeTransfer-address-address-uint256-}[`_safeTransfer`], with an additional `data` parameter which is\n * forwarded in {IERC721Receiver-onERC721Received} to contract recipients.\n */\n function _safeTransfer(address from, address to, uint256 tokenId, bytes memory data) internal virtual {\n _transfer(from, to, tokenId);\n ERC721Utils.checkOnERC721Received(_msgSender(), from, to, tokenId, data);\n }\n\n /**\n * @dev Approve `to` to operate on `tokenId`\n *\n * The `auth` argument is optional. If the value passed is non 0, then this function will check that `auth` is\n * either the owner of the token, or approved to operate on all tokens held by this owner.\n *\n * Emits an {Approval} event.\n *\n * Overrides to this logic should be done to the variant with an additional `bool emitEvent` argument.\n */\n function _approve(address to, uint256 tokenId, address auth) internal {\n _approve(to, tokenId, auth, true);\n }\n\n /**\n * @dev Variant of `_approve` with an optional flag to enable or disable the {Approval} event. The event is not\n * emitted in the context of transfers.\n */\n function _approve(address to, uint256 tokenId, address auth, bool emitEvent) internal virtual {\n // Avoid reading the owner unless necessary\n if (emitEvent || auth != address(0)) {\n address owner = _requireOwned(tokenId);\n\n // We do not use _isAuthorized because single-token approvals should not be able to call approve\n if (auth != address(0) && owner != auth && !isApprovedForAll(owner, auth)) {\n revert ERC721InvalidApprover(auth);\n }\n\n if (emitEvent) {\n emit Approval(owner, to, tokenId);\n }\n }\n\n _tokenApprovals[tokenId] = to;\n }\n\n /**\n * @dev Approve `operator` to operate on all of `owner` tokens\n *\n * Requirements:\n * - operator can't be the address zero.\n *\n * Emits an {ApprovalForAll} event.\n */\n function _setApprovalForAll(address owner, address operator, bool approved) internal virtual {\n if (operator == address(0)) {\n revert ERC721InvalidOperator(operator);\n }\n _operatorApprovals[owner][operator] = approved;\n emit ApprovalForAll(owner, operator, approved);\n }\n\n /**\n * @dev Reverts if the `tokenId` doesn't have a current owner (it hasn't been minted, or it has been burned).\n * Returns the owner.\n *\n * Overrides to ownership logic should be done to {_ownerOf}.\n */\n function _requireOwned(uint256 tokenId) internal view returns (address) {\n address owner = _ownerOf(tokenId);\n if (owner == address(0)) {\n revert ERC721NonexistentToken(tokenId);\n }\n return owner;\n }\n}\n" + }, + "@openzeppelin/contracts/token/ERC721/extensions/ERC721Burnable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC721/extensions/ERC721Burnable.sol)\n\npragma solidity ^0.8.20;\n\nimport {ERC721} from \"../ERC721.sol\";\nimport {Context} from \"../../../utils/Context.sol\";\n\n/**\n * @title ERC-721 Burnable Token\n * @dev ERC-721 Token that can be burned (destroyed).\n */\nabstract contract ERC721Burnable is Context, ERC721 {\n /**\n * @dev Burns `tokenId`. See {ERC721-_burn}.\n *\n * Requirements:\n *\n * - The caller must own `tokenId` or be an approved operator.\n */\n function burn(uint256 tokenId) public virtual {\n // Setting an \"auth\" arguments enables the `_isAuthorized` check which verifies that the token exists\n // (from != 0). Therefore, it is not needed to verify that the return value is not 0 here.\n _update(address(0), tokenId, _msgSender());\n }\n}\n" + }, + "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC721/extensions/ERC721Enumerable.sol)\n\npragma solidity ^0.8.20;\n\nimport {ERC721} from \"../ERC721.sol\";\nimport {IERC721Enumerable} from \"./IERC721Enumerable.sol\";\nimport {IERC165} from \"../../../utils/introspection/ERC165.sol\";\n\n/**\n * @dev This implements an optional extension of {ERC721} defined in the ERC that adds enumerability\n * of all the token ids in the contract as well as all token ids owned by each account.\n *\n * CAUTION: {ERC721} extensions that implement custom `balanceOf` logic, such as {ERC721Consecutive},\n * interfere with enumerability and should not be used together with {ERC721Enumerable}.\n */\nabstract contract ERC721Enumerable is ERC721, IERC721Enumerable {\n mapping(address owner => mapping(uint256 index => uint256)) private _ownedTokens;\n mapping(uint256 tokenId => uint256) private _ownedTokensIndex;\n\n uint256[] private _allTokens;\n mapping(uint256 tokenId => uint256) private _allTokensIndex;\n\n /**\n * @dev An `owner`'s token query was out of bounds for `index`.\n *\n * NOTE: The owner being `address(0)` indicates a global out of bounds index.\n */\n error ERC721OutOfBoundsIndex(address owner, uint256 index);\n\n /**\n * @dev Batch mint is not allowed.\n */\n error ERC721EnumerableForbiddenBatchMint();\n\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165, ERC721) returns (bool) {\n return interfaceId == type(IERC721Enumerable).interfaceId || super.supportsInterface(interfaceId);\n }\n\n /**\n * @dev See {IERC721Enumerable-tokenOfOwnerByIndex}.\n */\n function tokenOfOwnerByIndex(address owner, uint256 index) public view virtual returns (uint256) {\n if (index >= balanceOf(owner)) {\n revert ERC721OutOfBoundsIndex(owner, index);\n }\n return _ownedTokens[owner][index];\n }\n\n /**\n * @dev See {IERC721Enumerable-totalSupply}.\n */\n function totalSupply() public view virtual returns (uint256) {\n return _allTokens.length;\n }\n\n /**\n * @dev See {IERC721Enumerable-tokenByIndex}.\n */\n function tokenByIndex(uint256 index) public view virtual returns (uint256) {\n if (index >= totalSupply()) {\n revert ERC721OutOfBoundsIndex(address(0), index);\n }\n return _allTokens[index];\n }\n\n /**\n * @dev See {ERC721-_update}.\n */\n function _update(address to, uint256 tokenId, address auth) internal virtual override returns (address) {\n address previousOwner = super._update(to, tokenId, auth);\n\n if (previousOwner == address(0)) {\n _addTokenToAllTokensEnumeration(tokenId);\n } else if (previousOwner != to) {\n _removeTokenFromOwnerEnumeration(previousOwner, tokenId);\n }\n if (to == address(0)) {\n _removeTokenFromAllTokensEnumeration(tokenId);\n } else if (previousOwner != to) {\n _addTokenToOwnerEnumeration(to, tokenId);\n }\n\n return previousOwner;\n }\n\n /**\n * @dev Private function to add a token to this extension's ownership-tracking data structures.\n * @param to address representing the new owner of the given token ID\n * @param tokenId uint256 ID of the token to be added to the tokens list of the given address\n */\n function _addTokenToOwnerEnumeration(address to, uint256 tokenId) private {\n uint256 length = balanceOf(to) - 1;\n _ownedTokens[to][length] = tokenId;\n _ownedTokensIndex[tokenId] = length;\n }\n\n /**\n * @dev Private function to add a token to this extension's token tracking data structures.\n * @param tokenId uint256 ID of the token to be added to the tokens list\n */\n function _addTokenToAllTokensEnumeration(uint256 tokenId) private {\n _allTokensIndex[tokenId] = _allTokens.length;\n _allTokens.push(tokenId);\n }\n\n /**\n * @dev Private function to remove a token from this extension's ownership-tracking data structures. Note that\n * while the token is not assigned a new owner, the `_ownedTokensIndex` mapping is _not_ updated: this allows for\n * gas optimizations e.g. when performing a transfer operation (avoiding double writes).\n * This has O(1) time complexity, but alters the order of the _ownedTokens array.\n * @param from address representing the previous owner of the given token ID\n * @param tokenId uint256 ID of the token to be removed from the tokens list of the given address\n */\n function _removeTokenFromOwnerEnumeration(address from, uint256 tokenId) private {\n // To prevent a gap in from's tokens array, we store the last token in the index of the token to delete, and\n // then delete the last slot (swap and pop).\n\n uint256 lastTokenIndex = balanceOf(from);\n uint256 tokenIndex = _ownedTokensIndex[tokenId];\n\n mapping(uint256 index => uint256) storage _ownedTokensByOwner = _ownedTokens[from];\n\n // When the token to delete is the last token, the swap operation is unnecessary\n if (tokenIndex != lastTokenIndex) {\n uint256 lastTokenId = _ownedTokensByOwner[lastTokenIndex];\n\n _ownedTokensByOwner[tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token\n _ownedTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index\n }\n\n // This also deletes the contents at the last position of the array\n delete _ownedTokensIndex[tokenId];\n delete _ownedTokensByOwner[lastTokenIndex];\n }\n\n /**\n * @dev Private function to remove a token from this extension's token tracking data structures.\n * This has O(1) time complexity, but alters the order of the _allTokens array.\n * @param tokenId uint256 ID of the token to be removed from the tokens list\n */\n function _removeTokenFromAllTokensEnumeration(uint256 tokenId) private {\n // To prevent a gap in the tokens array, we store the last token in the index of the token to delete, and\n // then delete the last slot (swap and pop).\n\n uint256 lastTokenIndex = _allTokens.length - 1;\n uint256 tokenIndex = _allTokensIndex[tokenId];\n\n // When the token to delete is the last token, the swap operation is unnecessary. However, since this occurs so\n // rarely (when the last minted token is burnt) that we still do the swap here to avoid the gas cost of adding\n // an 'if' statement (like in _removeTokenFromOwnerEnumeration)\n uint256 lastTokenId = _allTokens[lastTokenIndex];\n\n _allTokens[tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token\n _allTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index\n\n // This also deletes the contents at the last position of the array\n delete _allTokensIndex[tokenId];\n _allTokens.pop();\n }\n\n /**\n * See {ERC721-_increaseBalance}. We need that to account tokens that were minted in batch\n */\n function _increaseBalance(address account, uint128 amount) internal virtual override {\n if (amount > 0) {\n revert ERC721EnumerableForbiddenBatchMint();\n }\n super._increaseBalance(account, amount);\n }\n}\n" + }, + "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC721/extensions/ERC721URIStorage.sol)\n\npragma solidity ^0.8.20;\n\nimport {ERC721} from \"../ERC721.sol\";\nimport {Strings} from \"../../../utils/Strings.sol\";\nimport {IERC4906} from \"../../../interfaces/IERC4906.sol\";\nimport {IERC165} from \"../../../interfaces/IERC165.sol\";\n\n/**\n * @dev ERC-721 token with storage based token URI management.\n */\nabstract contract ERC721URIStorage is IERC4906, ERC721 {\n using Strings for uint256;\n\n // Interface ID as defined in ERC-4906. This does not correspond to a traditional interface ID as ERC-4906 only\n // defines events and does not include any external function.\n bytes4 private constant ERC4906_INTERFACE_ID = bytes4(0x49064906);\n\n // Optional mapping for token URIs\n mapping(uint256 tokenId => string) private _tokenURIs;\n\n /**\n * @dev See {IERC165-supportsInterface}\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override(ERC721, IERC165) returns (bool) {\n return interfaceId == ERC4906_INTERFACE_ID || super.supportsInterface(interfaceId);\n }\n\n /**\n * @dev See {IERC721Metadata-tokenURI}.\n */\n function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {\n _requireOwned(tokenId);\n\n string memory _tokenURI = _tokenURIs[tokenId];\n string memory base = _baseURI();\n\n // If there is no base URI, return the token URI.\n if (bytes(base).length == 0) {\n return _tokenURI;\n }\n // If both are set, concatenate the baseURI and tokenURI (via string.concat).\n if (bytes(_tokenURI).length > 0) {\n return string.concat(base, _tokenURI);\n }\n\n return super.tokenURI(tokenId);\n }\n\n /**\n * @dev Sets `_tokenURI` as the tokenURI of `tokenId`.\n *\n * Emits {MetadataUpdate}.\n */\n function _setTokenURI(uint256 tokenId, string memory _tokenURI) internal virtual {\n _tokenURIs[tokenId] = _tokenURI;\n emit MetadataUpdate(tokenId);\n }\n}\n" + }, + "@openzeppelin/contracts/token/ERC721/extensions/ERC721Votes.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC721/extensions/ERC721Votes.sol)\n\npragma solidity ^0.8.20;\n\nimport {ERC721} from \"../ERC721.sol\";\nimport {Votes} from \"../../../governance/utils/Votes.sol\";\n\n/**\n * @dev Extension of ERC-721 to support voting and delegation as implemented by {Votes}, where each individual NFT counts\n * as 1 vote unit.\n *\n * Tokens do not count as votes until they are delegated, because votes must be tracked which incurs an additional cost\n * on every transfer. Token holders can either delegate to a trusted representative who will decide how to make use of\n * the votes in governance decisions, or they can delegate to themselves to be their own representative.\n */\nabstract contract ERC721Votes is ERC721, Votes {\n /**\n * @dev See {ERC721-_update}. Adjusts votes when tokens are transferred.\n *\n * Emits a {IVotes-DelegateVotesChanged} event.\n */\n function _update(address to, uint256 tokenId, address auth) internal virtual override returns (address) {\n address previousOwner = super._update(to, tokenId, auth);\n\n _transferVotingUnits(previousOwner, to, 1);\n\n return previousOwner;\n }\n\n /**\n * @dev Returns the balance of `account`.\n *\n * WARNING: Overriding this function will likely result in incorrect vote tracking.\n */\n function _getVotingUnits(address account) internal view virtual override returns (uint256) {\n return balanceOf(account);\n }\n\n /**\n * @dev See {ERC721-_increaseBalance}. We need that to account tokens that were minted in batch.\n */\n function _increaseBalance(address account, uint128 amount) internal virtual override {\n super._increaseBalance(account, amount);\n _transferVotingUnits(address(0), account, amount);\n }\n}\n" + }, + "@openzeppelin/contracts/token/ERC721/extensions/IERC721Enumerable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC721/extensions/IERC721Enumerable.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC721} from \"../IERC721.sol\";\n\n/**\n * @title ERC-721 Non-Fungible Token Standard, optional enumeration extension\n * @dev See https://eips.ethereum.org/EIPS/eip-721\n */\ninterface IERC721Enumerable is IERC721 {\n /**\n * @dev Returns the total amount of tokens stored by the contract.\n */\n function totalSupply() external view returns (uint256);\n\n /**\n * @dev Returns a token ID owned by `owner` at a given `index` of its token list.\n * Use along with {balanceOf} to enumerate all of ``owner``'s tokens.\n */\n function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256);\n\n /**\n * @dev Returns a token ID at a given `index` of all the tokens stored by the contract.\n * Use along with {totalSupply} to enumerate all tokens.\n */\n function tokenByIndex(uint256 index) external view returns (uint256);\n}\n" + }, + "@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC721/extensions/IERC721Metadata.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC721} from \"../IERC721.sol\";\n\n/**\n * @title ERC-721 Non-Fungible Token Standard, optional metadata extension\n * @dev See https://eips.ethereum.org/EIPS/eip-721\n */\ninterface IERC721Metadata is IERC721 {\n /**\n * @dev Returns the token collection name.\n */\n function name() external view returns (string memory);\n\n /**\n * @dev Returns the token collection symbol.\n */\n function symbol() external view returns (string memory);\n\n /**\n * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token.\n */\n function tokenURI(uint256 tokenId) external view returns (string memory);\n}\n" + }, + "@openzeppelin/contracts/token/ERC721/IERC721.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC721/IERC721.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC165} from \"../../utils/introspection/IERC165.sol\";\n\n/**\n * @dev Required interface of an ERC-721 compliant contract.\n */\ninterface IERC721 is IERC165 {\n /**\n * @dev Emitted when `tokenId` token is transferred from `from` to `to`.\n */\n event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);\n\n /**\n * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.\n */\n event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);\n\n /**\n * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.\n */\n event ApprovalForAll(address indexed owner, address indexed operator, bool approved);\n\n /**\n * @dev Returns the number of tokens in ``owner``'s account.\n */\n function balanceOf(address owner) external view returns (uint256 balance);\n\n /**\n * @dev Returns the owner of the `tokenId` token.\n *\n * Requirements:\n *\n * - `tokenId` must exist.\n */\n function ownerOf(uint256 tokenId) external view returns (address owner);\n\n /**\n * @dev Safely transfers `tokenId` token from `from` to `to`.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `tokenId` token must exist and be owned by `from`.\n * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon\n * a safe transfer.\n *\n * Emits a {Transfer} event.\n */\n function safeTransferFrom(address from, address to, uint256 tokenId, bytes calldata data) external;\n\n /**\n * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients\n * are aware of the ERC-721 protocol to prevent tokens from being forever locked.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `tokenId` token must exist and be owned by `from`.\n * - If the caller is not `from`, it must have been allowed to move this token by either {approve} or\n * {setApprovalForAll}.\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon\n * a safe transfer.\n *\n * Emits a {Transfer} event.\n */\n function safeTransferFrom(address from, address to, uint256 tokenId) external;\n\n /**\n * @dev Transfers `tokenId` token from `from` to `to`.\n *\n * WARNING: Note that the caller is responsible to confirm that the recipient is capable of receiving ERC-721\n * or else they may be permanently lost. Usage of {safeTransferFrom} prevents loss, though the caller must\n * understand this adds an external call which potentially creates a reentrancy vulnerability.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `tokenId` token must be owned by `from`.\n * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(address from, address to, uint256 tokenId) external;\n\n /**\n * @dev Gives permission to `to` to transfer `tokenId` token to another account.\n * The approval is cleared when the token is transferred.\n *\n * Only a single account can be approved at a time, so approving the zero address clears previous approvals.\n *\n * Requirements:\n *\n * - The caller must own the token or be an approved operator.\n * - `tokenId` must exist.\n *\n * Emits an {Approval} event.\n */\n function approve(address to, uint256 tokenId) external;\n\n /**\n * @dev Approve or remove `operator` as an operator for the caller.\n * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.\n *\n * Requirements:\n *\n * - The `operator` cannot be the address zero.\n *\n * Emits an {ApprovalForAll} event.\n */\n function setApprovalForAll(address operator, bool approved) external;\n\n /**\n * @dev Returns the account approved for `tokenId` token.\n *\n * Requirements:\n *\n * - `tokenId` must exist.\n */\n function getApproved(uint256 tokenId) external view returns (address operator);\n\n /**\n * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.\n *\n * See {setApprovalForAll}\n */\n function isApprovedForAll(address owner, address operator) external view returns (bool);\n}\n" + }, + "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC721/IERC721Receiver.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @title ERC-721 token receiver interface\n * @dev Interface for any contract that wants to support safeTransfers\n * from ERC-721 asset contracts.\n */\ninterface IERC721Receiver {\n /**\n * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom}\n * by `operator` from `from`, this function is called.\n *\n * It must return its Solidity selector to confirm the token transfer.\n * If any other value is returned or the interface is not implemented by the recipient, the transfer will be\n * reverted.\n *\n * The selector can be obtained in Solidity with `IERC721Receiver.onERC721Received.selector`.\n */\n function onERC721Received(\n address operator,\n address from,\n uint256 tokenId,\n bytes calldata data\n ) external returns (bytes4);\n}\n" + }, + "@openzeppelin/contracts/token/ERC721/utils/ERC721Utils.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC721/utils/ERC721Utils.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC721Receiver} from \"../IERC721Receiver.sol\";\nimport {IERC721Errors} from \"../../../interfaces/draft-IERC6093.sol\";\n\n/**\n * @dev Library that provide common ERC-721 utility functions.\n *\n * See https://eips.ethereum.org/EIPS/eip-721[ERC-721].\n *\n * _Available since v5.1._\n */\nlibrary ERC721Utils {\n /**\n * @dev Performs an acceptance check for the provided `operator` by calling {IERC721-onERC721Received}\n * on the `to` address. The `operator` is generally the address that initiated the token transfer (i.e. `msg.sender`).\n *\n * The acceptance call is not executed and treated as a no-op if the target address doesn't contain code (i.e. an EOA).\n * Otherwise, the recipient must implement {IERC721Receiver-onERC721Received} and return the acceptance magic value to accept\n * the transfer.\n */\n function checkOnERC721Received(\n address operator,\n address from,\n address to,\n uint256 tokenId,\n bytes memory data\n ) internal {\n if (to.code.length > 0) {\n try IERC721Receiver(to).onERC721Received(operator, from, tokenId, data) returns (bytes4 retval) {\n if (retval != IERC721Receiver.onERC721Received.selector) {\n // Token rejected\n revert IERC721Errors.ERC721InvalidReceiver(to);\n }\n } catch (bytes memory reason) {\n if (reason.length == 0) {\n // non-IERC721Receiver implementer\n revert IERC721Errors.ERC721InvalidReceiver(to);\n } else {\n assembly (\"memory-safe\") {\n revert(add(32, reason), mload(reason))\n }\n }\n }\n }\n }\n}\n" + }, + "@openzeppelin/contracts/utils/Context.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract Context {\n function _msgSender() internal view virtual returns (address) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual returns (bytes calldata) {\n return msg.data;\n }\n\n function _contextSuffixLength() internal view virtual returns (uint256) {\n return 0;\n }\n}\n" + }, + "@openzeppelin/contracts/utils/cryptography/ECDSA.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/cryptography/ECDSA.sol)\n\npragma solidity ^0.8.20;\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 }\n\n /**\n * @dev The signature derives the `address(0)`.\n */\n error ECDSAInvalidSignature();\n\n /**\n * @dev The signature has an invalid length.\n */\n error ECDSAInvalidSignatureLength(uint256 length);\n\n /**\n * @dev The signature has an S value that is in the upper half order.\n */\n error ECDSAInvalidSignatureS(bytes32 s);\n\n /**\n * @dev Returns the address that signed a hashed message (`hash`) with `signature` or an error. This will not\n * return address(0) without also returning an error description. Errors are documented using an enum (error type)\n * and a bytes32 providing additional information about the error.\n *\n * If no error is returned, then the address can be used for verification purposes.\n *\n * The `ecrecover` EVM precompile 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 {MessageHashUtils-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 function tryRecover(\n bytes32 hash,\n bytes memory signature\n ) internal pure returns (address recovered, RecoverError err, bytes32 errArg) {\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 assembly (\"memory-safe\") {\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, bytes32(signature.length));\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 precompile 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 {MessageHashUtils-toEthSignedMessageHash} on it.\n */\n function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {\n (address recovered, RecoverError error, bytes32 errorArg) = tryRecover(hash, signature);\n _throwError(error, errorArg);\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[ERC-2098 short signatures]\n */\n function tryRecover(\n bytes32 hash,\n bytes32 r,\n bytes32 vs\n ) internal pure returns (address recovered, RecoverError err, bytes32 errArg) {\n unchecked {\n bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff);\n // We do not check for an overflow here since the shift operation results in 0 or 1.\n uint8 v = uint8((uint256(vs) >> 255) + 27);\n return tryRecover(hash, v, r, s);\n }\n }\n\n /**\n * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately.\n */\n function recover(bytes32 hash, bytes32 r, bytes32 vs) internal pure returns (address) {\n (address recovered, RecoverError error, bytes32 errorArg) = tryRecover(hash, r, vs);\n _throwError(error, errorArg);\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 function tryRecover(\n bytes32 hash,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) internal pure returns (address recovered, RecoverError err, bytes32 errArg) {\n // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature\n // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines\n // the valid range for s in (301): 0 < s < secp256k1n ÷ 2 + 1, and for v in (302): v ∈ {27, 28}. Most\n // signatures from current libraries generate a unique signature with an s-value in the lower half order.\n //\n // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value\n // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or\n // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept\n // these malleable signatures as well.\n if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) {\n return (address(0), RecoverError.InvalidSignatureS, s);\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, bytes32(0));\n }\n\n return (signer, RecoverError.NoError, bytes32(0));\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, bytes32 errorArg) = tryRecover(hash, v, r, s);\n _throwError(error, errorArg);\n return recovered;\n }\n\n /**\n * @dev Optionally reverts with the corresponding custom error according to the `error` argument provided.\n */\n function _throwError(RecoverError error, bytes32 errorArg) private pure {\n if (error == RecoverError.NoError) {\n return; // no error: do nothing\n } else if (error == RecoverError.InvalidSignature) {\n revert ECDSAInvalidSignature();\n } else if (error == RecoverError.InvalidSignatureLength) {\n revert ECDSAInvalidSignatureLength(uint256(errorArg));\n } else if (error == RecoverError.InvalidSignatureS) {\n revert ECDSAInvalidSignatureS(errorArg);\n }\n }\n}\n" + }, + "@openzeppelin/contracts/utils/cryptography/EIP712.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/cryptography/EIP712.sol)\n\npragma solidity ^0.8.20;\n\nimport {MessageHashUtils} from \"./MessageHashUtils.sol\";\nimport {ShortStrings, ShortString} from \"../ShortStrings.sol\";\nimport {IERC5267} from \"../../interfaces/IERC5267.sol\";\n\n/**\n * @dev https://eips.ethereum.org/EIPS/eip-712[EIP-712] is a standard for hashing and signing of typed structured data.\n *\n * The encoding scheme specified in the EIP requires a domain separator and a hash of the typed structured data, whose\n * encoding is very generic and therefore its implementation in Solidity is not feasible, thus this contract\n * does not implement the encoding itself. Protocols need to implement the type-specific encoding they need in order to\n * produce the hash of their typed data using a combination of `abi.encode` and `keccak256`.\n *\n * This contract implements the EIP-712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding\n * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA\n * ({_hashTypedDataV4}).\n *\n * The implementation of the domain separator was designed to be as efficient as possible while still properly updating\n * the chain id to protect against replay attacks on an eventual fork of the chain.\n *\n * NOTE: This contract implements the version of the encoding known as \"v4\", as implemented by the JSON RPC method\n * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask].\n *\n * NOTE: In the upgradeable version of this contract, the cached values will correspond to the address, and the domain\n * separator of the implementation contract. This will cause the {_domainSeparatorV4} function to always rebuild the\n * separator from the immutable values, which is cheaper than accessing a cached version in cold storage.\n *\n * @custom:oz-upgrades-unsafe-allow state-variable-immutable\n */\nabstract contract EIP712 is IERC5267 {\n using ShortStrings for *;\n\n bytes32 private constant TYPE_HASH =\n keccak256(\"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)\");\n\n // Cache the domain separator as an immutable value, but also store the chain id that it corresponds to, in order to\n // invalidate the cached domain separator if the chain id changes.\n bytes32 private immutable _cachedDomainSeparator;\n uint256 private immutable _cachedChainId;\n address private immutable _cachedThis;\n\n bytes32 private immutable _hashedName;\n bytes32 private immutable _hashedVersion;\n\n ShortString private immutable _name;\n ShortString private immutable _version;\n string private _nameFallback;\n string private _versionFallback;\n\n /**\n * @dev Initializes the domain separator and parameter caches.\n *\n * The meaning of `name` and `version` is specified in\n * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP-712]:\n *\n * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol.\n * - `version`: the current major version of the signing domain.\n *\n * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart\n * contract upgrade].\n */\n constructor(string memory name, string memory version) {\n _name = name.toShortStringWithFallback(_nameFallback);\n _version = version.toShortStringWithFallback(_versionFallback);\n _hashedName = keccak256(bytes(name));\n _hashedVersion = keccak256(bytes(version));\n\n _cachedChainId = block.chainid;\n _cachedDomainSeparator = _buildDomainSeparator();\n _cachedThis = address(this);\n }\n\n /**\n * @dev Returns the domain separator for the current chain.\n */\n function _domainSeparatorV4() internal view returns (bytes32) {\n if (address(this) == _cachedThis && block.chainid == _cachedChainId) {\n return _cachedDomainSeparator;\n } else {\n return _buildDomainSeparator();\n }\n }\n\n function _buildDomainSeparator() private view returns (bytes32) {\n return keccak256(abi.encode(TYPE_HASH, _hashedName, _hashedVersion, block.chainid, address(this)));\n }\n\n /**\n * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this\n * function returns the hash of the fully encoded EIP712 message for this domain.\n *\n * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example:\n *\n * ```solidity\n * bytes32 digest = _hashTypedDataV4(keccak256(abi.encode(\n * keccak256(\"Mail(address to,string contents)\"),\n * mailTo,\n * keccak256(bytes(mailContents))\n * )));\n * address signer = ECDSA.recover(digest, signature);\n * ```\n */\n function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) {\n return MessageHashUtils.toTypedDataHash(_domainSeparatorV4(), structHash);\n }\n\n /**\n * @dev See {IERC-5267}.\n */\n function eip712Domain()\n public\n view\n virtual\n returns (\n bytes1 fields,\n string memory name,\n string memory version,\n uint256 chainId,\n address verifyingContract,\n bytes32 salt,\n uint256[] memory extensions\n )\n {\n return (\n hex\"0f\", // 01111\n _EIP712Name(),\n _EIP712Version(),\n block.chainid,\n address(this),\n bytes32(0),\n new uint256[](0)\n );\n }\n\n /**\n * @dev The name parameter for the EIP712 domain.\n *\n * NOTE: By default this function reads _name which is an immutable value.\n * It only reads from storage if necessary (in case the value is too large to fit in a ShortString).\n */\n // solhint-disable-next-line func-name-mixedcase\n function _EIP712Name() internal view returns (string memory) {\n return _name.toStringWithFallback(_nameFallback);\n }\n\n /**\n * @dev The version parameter for the EIP712 domain.\n *\n * NOTE: By default this function reads _version which is an immutable value.\n * It only reads from storage if necessary (in case the value is too large to fit in a ShortString).\n */\n // solhint-disable-next-line func-name-mixedcase\n function _EIP712Version() internal view returns (string memory) {\n return _version.toStringWithFallback(_versionFallback);\n }\n}\n" + }, + "@openzeppelin/contracts/utils/cryptography/MessageHashUtils.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/cryptography/MessageHashUtils.sol)\n\npragma solidity ^0.8.20;\n\nimport {Strings} from \"../Strings.sol\";\n\n/**\n * @dev Signature message hash utilities for producing digests to be consumed by {ECDSA} recovery or signing.\n *\n * The library provides methods for generating a hash of a message that conforms to the\n * https://eips.ethereum.org/EIPS/eip-191[ERC-191] and https://eips.ethereum.org/EIPS/eip-712[EIP 712]\n * specifications.\n */\nlibrary MessageHashUtils {\n /**\n * @dev Returns the keccak256 digest of an ERC-191 signed data with version\n * `0x45` (`personal_sign` messages).\n *\n * The digest is calculated by prefixing a bytes32 `messageHash` with\n * `\"\\x19Ethereum Signed Message:\\n32\"` and hashing the result. It corresponds with the\n * hash signed when using the https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] JSON-RPC method.\n *\n * NOTE: The `messageHash` parameter is intended to be the result of hashing a raw message with\n * keccak256, although any bytes32 value can be safely used because the final digest will\n * be re-hashed.\n *\n * See {ECDSA-recover}.\n */\n function toEthSignedMessageHash(bytes32 messageHash) internal pure returns (bytes32 digest) {\n assembly (\"memory-safe\") {\n mstore(0x00, \"\\x19Ethereum Signed Message:\\n32\") // 32 is the bytes-length of messageHash\n mstore(0x1c, messageHash) // 0x1c (28) is the length of the prefix\n digest := keccak256(0x00, 0x3c) // 0x3c is the length of the prefix (0x1c) + messageHash (0x20)\n }\n }\n\n /**\n * @dev Returns the keccak256 digest of an ERC-191 signed data with version\n * `0x45` (`personal_sign` messages).\n *\n * The digest is calculated by prefixing an arbitrary `message` with\n * `\"\\x19Ethereum Signed Message:\\n\" + len(message)` and hashing the result. It corresponds with the\n * hash signed when using the https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] JSON-RPC method.\n *\n * See {ECDSA-recover}.\n */\n function toEthSignedMessageHash(bytes memory message) internal pure returns (bytes32) {\n return\n keccak256(bytes.concat(\"\\x19Ethereum Signed Message:\\n\", bytes(Strings.toString(message.length)), message));\n }\n\n /**\n * @dev Returns the keccak256 digest of an ERC-191 signed data with version\n * `0x00` (data with intended validator).\n *\n * The digest is calculated by prefixing an arbitrary `data` with `\"\\x19\\x00\"` and the intended\n * `validator` address. Then hashing the result.\n *\n * See {ECDSA-recover}.\n */\n function toDataWithIntendedValidatorHash(address validator, bytes memory data) internal pure returns (bytes32) {\n return keccak256(abi.encodePacked(hex\"19_00\", validator, data));\n }\n\n /**\n * @dev Returns the keccak256 digest of an EIP-712 typed data (ERC-191 version `0x01`).\n *\n * The digest is calculated from a `domainSeparator` and a `structHash`, by prefixing them with\n * `\\x19\\x01` and hashing the result. It corresponds to the hash signed by the\n * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`] JSON-RPC method as part of EIP-712.\n *\n * See {ECDSA-recover}.\n */\n function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32 digest) {\n assembly (\"memory-safe\") {\n let ptr := mload(0x40)\n mstore(ptr, hex\"19_01\")\n mstore(add(ptr, 0x02), domainSeparator)\n mstore(add(ptr, 0x22), structHash)\n digest := keccak256(ptr, 0x42)\n }\n }\n}\n" + }, + "@openzeppelin/contracts/utils/introspection/ERC165.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/introspection/ERC165.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC165} from \"./IERC165.sol\";\n\n/**\n * @dev Implementation of the {IERC165} interface.\n *\n * Contracts that want to implement ERC-165 should inherit from this contract and override {supportsInterface} to check\n * for the additional interface id that will be supported. For example:\n *\n * ```solidity\n * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);\n * }\n * ```\n */\nabstract contract ERC165 is IERC165 {\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) {\n return interfaceId == type(IERC165).interfaceId;\n }\n}\n" + }, + "@openzeppelin/contracts/utils/introspection/IERC165.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/introspection/IERC165.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Interface of the ERC-165 standard, as defined in the\n * https://eips.ethereum.org/EIPS/eip-165[ERC].\n *\n * Implementers can declare support of contract interfaces, which can then be\n * queried by others ({ERC165Checker}).\n *\n * For an implementation, see {ERC165}.\n */\ninterface IERC165 {\n /**\n * @dev Returns true if this contract implements the interface defined by\n * `interfaceId`. See the corresponding\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[ERC section]\n * to learn more about how these ids are created.\n *\n * This function call must use less than 30 000 gas.\n */\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\n}\n" + }, + "@openzeppelin/contracts/utils/math/Math.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/math/Math.sol)\n\npragma solidity ^0.8.20;\n\nimport {Panic} from \"../Panic.sol\";\nimport {SafeCast} from \"./SafeCast.sol\";\n\n/**\n * @dev Standard math utilities missing in the Solidity language.\n */\nlibrary Math {\n enum Rounding {\n Floor, // Toward negative infinity\n Ceil, // Toward positive infinity\n Trunc, // Toward zero\n Expand // Away from zero\n }\n\n /**\n * @dev Returns the addition of two unsigned integers, with an success flag (no overflow).\n */\n function tryAdd(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\n unchecked {\n uint256 c = a + b;\n if (c < a) return (false, 0);\n return (true, c);\n }\n }\n\n /**\n * @dev Returns the subtraction of two unsigned integers, with an success flag (no overflow).\n */\n function trySub(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\n unchecked {\n if (b > a) return (false, 0);\n return (true, a - b);\n }\n }\n\n /**\n * @dev Returns the multiplication of two unsigned integers, with an success flag (no overflow).\n */\n function tryMul(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\n unchecked {\n // Gas optimization: this is cheaper than requiring 'a' not being zero, but the\n // benefit is lost if 'b' is also tested.\n // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522\n if (a == 0) return (true, 0);\n uint256 c = a * b;\n if (c / a != b) return (false, 0);\n return (true, c);\n }\n }\n\n /**\n * @dev Returns the division of two unsigned integers, with a success flag (no division by zero).\n */\n function tryDiv(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\n unchecked {\n if (b == 0) return (false, 0);\n return (true, a / b);\n }\n }\n\n /**\n * @dev Returns the remainder of dividing two unsigned integers, with a success flag (no division by zero).\n */\n function tryMod(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\n unchecked {\n if (b == 0) return (false, 0);\n return (true, a % b);\n }\n }\n\n /**\n * @dev Branchless ternary evaluation for `a ? b : c`. Gas costs are constant.\n *\n * IMPORTANT: This function may reduce bytecode size and consume less gas when used standalone.\n * However, the compiler may optimize Solidity ternary operations (i.e. `a ? b : c`) to only compute\n * one branch when needed, making this function more expensive.\n */\n function ternary(bool condition, uint256 a, uint256 b) internal pure returns (uint256) {\n unchecked {\n // branchless ternary works because:\n // b ^ (a ^ b) == a\n // b ^ 0 == b\n return b ^ ((a ^ b) * SafeCast.toUint(condition));\n }\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 ternary(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 ternary(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 towards infinity instead\n * of rounding towards zero.\n */\n function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {\n if (b == 0) {\n // Guarantee the same behavior as in a regular Solidity division.\n Panic.panic(Panic.DIVISION_BY_ZERO);\n }\n\n // The following calculation ensures accurate ceiling division without overflow.\n // Since a is non-zero, (a - 1) / b will not overflow.\n // The largest possible result occurs when (a - 1) / b is type(uint256).max,\n // but the largest value we can obtain is type(uint256).max - 1, which happens\n // when a = type(uint256).max and b = 1.\n unchecked {\n return SafeCast.toUint(a > 0) * ((a - 1) / b + 1);\n }\n }\n\n /**\n * @dev Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or\n * denominator == 0.\n *\n * Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv) with further edits by\n * 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²⁵⁶ and mod 2²⁵⁶ - 1, then use\n // the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256\n // variables such that product = prod1 * 2²⁵⁶ + prod0.\n uint256 prod0 = x * y; // 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 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²⁵⁶. Also prevents denominator == 0.\n if (denominator <= prod1) {\n Panic.panic(ternary(denominator == 0, Panic.DIVISION_BY_ZERO, Panic.UNDER_OVERFLOW));\n }\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.\n // Always >= 1. See https://cs.stackexchange.com/q/138556/92363.\n\n uint256 twos = denominator & (0 - denominator);\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²⁵⁶ / 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²⁵⁶. Now that denominator is an odd number, it has an inverse modulo 2²⁵⁶ such\n // that denominator * inv ≡ 1 mod 2²⁵⁶. Compute the inverse by starting with a seed that is correct for\n // four bits. That is, denominator * inv ≡ 1 mod 2⁴.\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\n // works in modular arithmetic, doubling the correct bits in each step.\n inverse *= 2 - denominator * inverse; // inverse mod 2⁸\n inverse *= 2 - denominator * inverse; // inverse mod 2¹⁶\n inverse *= 2 - denominator * inverse; // inverse mod 2³²\n inverse *= 2 - denominator * inverse; // inverse mod 2⁶⁴\n inverse *= 2 - denominator * inverse; // inverse mod 2¹²⁸\n inverse *= 2 - denominator * inverse; // inverse mod 2²⁵⁶\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²⁵⁶. Since the preconditions guarantee that the outcome is\n // less than 2²⁵⁶, 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 * @dev 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 return mulDiv(x, y, denominator) + SafeCast.toUint(unsignedRoundsUp(rounding) && mulmod(x, y, denominator) > 0);\n }\n\n /**\n * @dev Calculate the modular multiplicative inverse of a number in Z/nZ.\n *\n * If n is a prime, then Z/nZ is a field. In that case all elements are inversible, except 0.\n * If n is not a prime, then Z/nZ is not a field, and some elements might not be inversible.\n *\n * If the input value is not inversible, 0 is returned.\n *\n * NOTE: If you know for sure that n is (big) a prime, it may be cheaper to use Fermat's little theorem and get the\n * inverse using `Math.modExp(a, n - 2, n)`. See {invModPrime}.\n */\n function invMod(uint256 a, uint256 n) internal pure returns (uint256) {\n unchecked {\n if (n == 0) return 0;\n\n // The inverse modulo is calculated using the Extended Euclidean Algorithm (iterative version)\n // Used to compute integers x and y such that: ax + ny = gcd(a, n).\n // When the gcd is 1, then the inverse of a modulo n exists and it's x.\n // ax + ny = 1\n // ax = 1 + (-y)n\n // ax ≡ 1 (mod n) # x is the inverse of a modulo n\n\n // If the remainder is 0 the gcd is n right away.\n uint256 remainder = a % n;\n uint256 gcd = n;\n\n // Therefore the initial coefficients are:\n // ax + ny = gcd(a, n) = n\n // 0a + 1n = n\n int256 x = 0;\n int256 y = 1;\n\n while (remainder != 0) {\n uint256 quotient = gcd / remainder;\n\n (gcd, remainder) = (\n // The old remainder is the next gcd to try.\n remainder,\n // Compute the next remainder.\n // Can't overflow given that (a % gcd) * (gcd // (a % gcd)) <= gcd\n // where gcd is at most n (capped to type(uint256).max)\n gcd - remainder * quotient\n );\n\n (x, y) = (\n // Increment the coefficient of a.\n y,\n // Decrement the coefficient of n.\n // Can overflow, but the result is casted to uint256 so that the\n // next value of y is \"wrapped around\" to a value between 0 and n - 1.\n x - y * int256(quotient)\n );\n }\n\n if (gcd != 1) return 0; // No inverse exists.\n return ternary(x < 0, n - uint256(-x), uint256(x)); // Wrap the result if it's negative.\n }\n }\n\n /**\n * @dev Variant of {invMod}. More efficient, but only works if `p` is known to be a prime greater than `2`.\n *\n * From https://en.wikipedia.org/wiki/Fermat%27s_little_theorem[Fermat's little theorem], we know that if p is\n * prime, then `a**(p-1) ≡ 1 mod p`. As a consequence, we have `a * a**(p-2) ≡ 1 mod p`, which means that\n * `a**(p-2)` is the modular multiplicative inverse of a in Fp.\n *\n * NOTE: this function does NOT check that `p` is a prime greater than `2`.\n */\n function invModPrime(uint256 a, uint256 p) internal view returns (uint256) {\n unchecked {\n return Math.modExp(a, p - 2, p);\n }\n }\n\n /**\n * @dev Returns the modular exponentiation of the specified base, exponent and modulus (b ** e % m)\n *\n * Requirements:\n * - modulus can't be zero\n * - underlying staticcall to precompile must succeed\n *\n * IMPORTANT: The result is only valid if the underlying call succeeds. When using this function, make\n * sure the chain you're using it on supports the precompiled contract for modular exponentiation\n * at address 0x05 as specified in https://eips.ethereum.org/EIPS/eip-198[EIP-198]. Otherwise,\n * the underlying function will succeed given the lack of a revert, but the result may be incorrectly\n * interpreted as 0.\n */\n function modExp(uint256 b, uint256 e, uint256 m) internal view returns (uint256) {\n (bool success, uint256 result) = tryModExp(b, e, m);\n if (!success) {\n Panic.panic(Panic.DIVISION_BY_ZERO);\n }\n return result;\n }\n\n /**\n * @dev Returns the modular exponentiation of the specified base, exponent and modulus (b ** e % m).\n * It includes a success flag indicating if the operation succeeded. Operation will be marked as failed if trying\n * to operate modulo 0 or if the underlying precompile reverted.\n *\n * IMPORTANT: The result is only valid if the success flag is true. When using this function, make sure the chain\n * you're using it on supports the precompiled contract for modular exponentiation at address 0x05 as specified in\n * https://eips.ethereum.org/EIPS/eip-198[EIP-198]. Otherwise, the underlying function will succeed given the lack\n * of a revert, but the result may be incorrectly interpreted as 0.\n */\n function tryModExp(uint256 b, uint256 e, uint256 m) internal view returns (bool success, uint256 result) {\n if (m == 0) return (false, 0);\n assembly (\"memory-safe\") {\n let ptr := mload(0x40)\n // | Offset | Content | Content (Hex) |\n // |-----------|------------|--------------------------------------------------------------------|\n // | 0x00:0x1f | size of b | 0x0000000000000000000000000000000000000000000000000000000000000020 |\n // | 0x20:0x3f | size of e | 0x0000000000000000000000000000000000000000000000000000000000000020 |\n // | 0x40:0x5f | size of m | 0x0000000000000000000000000000000000000000000000000000000000000020 |\n // | 0x60:0x7f | value of b | 0x<.............................................................b> |\n // | 0x80:0x9f | value of e | 0x<.............................................................e> |\n // | 0xa0:0xbf | value of m | 0x<.............................................................m> |\n mstore(ptr, 0x20)\n mstore(add(ptr, 0x20), 0x20)\n mstore(add(ptr, 0x40), 0x20)\n mstore(add(ptr, 0x60), b)\n mstore(add(ptr, 0x80), e)\n mstore(add(ptr, 0xa0), m)\n\n // Given the result < m, it's guaranteed to fit in 32 bytes,\n // so we can use the memory scratch space located at offset 0.\n success := staticcall(gas(), 0x05, ptr, 0xc0, 0x00, 0x20)\n result := mload(0x00)\n }\n }\n\n /**\n * @dev Variant of {modExp} that supports inputs of arbitrary length.\n */\n function modExp(bytes memory b, bytes memory e, bytes memory m) internal view returns (bytes memory) {\n (bool success, bytes memory result) = tryModExp(b, e, m);\n if (!success) {\n Panic.panic(Panic.DIVISION_BY_ZERO);\n }\n return result;\n }\n\n /**\n * @dev Variant of {tryModExp} that supports inputs of arbitrary length.\n */\n function tryModExp(\n bytes memory b,\n bytes memory e,\n bytes memory m\n ) internal view returns (bool success, bytes memory result) {\n if (_zeroBytes(m)) return (false, new bytes(0));\n\n uint256 mLen = m.length;\n\n // Encode call args in result and move the free memory pointer\n result = abi.encodePacked(b.length, e.length, mLen, b, e, m);\n\n assembly (\"memory-safe\") {\n let dataPtr := add(result, 0x20)\n // Write result on top of args to avoid allocating extra memory.\n success := staticcall(gas(), 0x05, dataPtr, mload(result), dataPtr, mLen)\n // Overwrite the length.\n // result.length > returndatasize() is guaranteed because returndatasize() == m.length\n mstore(result, mLen)\n // Set the memory pointer after the returned data.\n mstore(0x40, add(dataPtr, mLen))\n }\n }\n\n /**\n * @dev Returns whether the provided byte array is zero.\n */\n function _zeroBytes(bytes memory byteArray) private pure returns (bool) {\n for (uint256 i = 0; i < byteArray.length; ++i) {\n if (byteArray[i] != 0) {\n return false;\n }\n }\n return true;\n }\n\n /**\n * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded\n * towards zero.\n *\n * This method is based on Newton's method for computing square roots; the algorithm is restricted to only\n * using integer operations.\n */\n function sqrt(uint256 a) internal pure returns (uint256) {\n unchecked {\n // Take care of easy edge cases when a == 0 or a == 1\n if (a <= 1) {\n return a;\n }\n\n // In this function, we use Newton's method to get a root of `f(x) := x² - a`. It involves building a\n // sequence x_n that converges toward sqrt(a). For each iteration x_n, we also define the error between\n // the current value as `ε_n = | x_n - sqrt(a) |`.\n //\n // For our first estimation, we consider `e` the smallest power of 2 which is bigger than the square root\n // of the target. (i.e. `2**(e-1) ≤ sqrt(a) < 2**e`). We know that `e ≤ 128` because `(2¹²⁸)² = 2²⁵⁶` is\n // bigger than any uint256.\n //\n // By noticing that\n // `2**(e-1) ≤ sqrt(a) < 2**e → (2**(e-1))² ≤ a < (2**e)² → 2**(2*e-2) ≤ a < 2**(2*e)`\n // we can deduce that `e - 1` is `log2(a) / 2`. We can thus compute `x_n = 2**(e-1)` using a method similar\n // to the msb function.\n uint256 aa = a;\n uint256 xn = 1;\n\n if (aa >= (1 << 128)) {\n aa >>= 128;\n xn <<= 64;\n }\n if (aa >= (1 << 64)) {\n aa >>= 64;\n xn <<= 32;\n }\n if (aa >= (1 << 32)) {\n aa >>= 32;\n xn <<= 16;\n }\n if (aa >= (1 << 16)) {\n aa >>= 16;\n xn <<= 8;\n }\n if (aa >= (1 << 8)) {\n aa >>= 8;\n xn <<= 4;\n }\n if (aa >= (1 << 4)) {\n aa >>= 4;\n xn <<= 2;\n }\n if (aa >= (1 << 2)) {\n xn <<= 1;\n }\n\n // We now have x_n such that `x_n = 2**(e-1) ≤ sqrt(a) < 2**e = 2 * x_n`. This implies ε_n ≤ 2**(e-1).\n //\n // We can refine our estimation by noticing that the middle of that interval minimizes the error.\n // If we move x_n to equal 2**(e-1) + 2**(e-2), then we reduce the error to ε_n ≤ 2**(e-2).\n // This is going to be our x_0 (and ε_0)\n xn = (3 * xn) >> 1; // ε_0 := | x_0 - sqrt(a) | ≤ 2**(e-2)\n\n // From here, Newton's method give us:\n // x_{n+1} = (x_n + a / x_n) / 2\n //\n // One should note that:\n // x_{n+1}² - a = ((x_n + a / x_n) / 2)² - a\n // = ((x_n² + a) / (2 * x_n))² - a\n // = (x_n⁴ + 2 * a * x_n² + a²) / (4 * x_n²) - a\n // = (x_n⁴ + 2 * a * x_n² + a² - 4 * a * x_n²) / (4 * x_n²)\n // = (x_n⁴ - 2 * a * x_n² + a²) / (4 * x_n²)\n // = (x_n² - a)² / (2 * x_n)²\n // = ((x_n² - a) / (2 * x_n))²\n // ≥ 0\n // Which proves that for all n ≥ 1, sqrt(a) ≤ x_n\n //\n // This gives us the proof of quadratic convergence of the sequence:\n // ε_{n+1} = | x_{n+1} - sqrt(a) |\n // = | (x_n + a / x_n) / 2 - sqrt(a) |\n // = | (x_n² + a - 2*x_n*sqrt(a)) / (2 * x_n) |\n // = | (x_n - sqrt(a))² / (2 * x_n) |\n // = | ε_n² / (2 * x_n) |\n // = ε_n² / | (2 * x_n) |\n //\n // For the first iteration, we have a special case where x_0 is known:\n // ε_1 = ε_0² / | (2 * x_0) |\n // ≤ (2**(e-2))² / (2 * (2**(e-1) + 2**(e-2)))\n // ≤ 2**(2*e-4) / (3 * 2**(e-1))\n // ≤ 2**(e-3) / 3\n // ≤ 2**(e-3-log2(3))\n // ≤ 2**(e-4.5)\n //\n // For the following iterations, we use the fact that, 2**(e-1) ≤ sqrt(a) ≤ x_n:\n // ε_{n+1} = ε_n² / | (2 * x_n) |\n // ≤ (2**(e-k))² / (2 * 2**(e-1))\n // ≤ 2**(2*e-2*k) / 2**e\n // ≤ 2**(e-2*k)\n xn = (xn + a / xn) >> 1; // ε_1 := | x_1 - sqrt(a) | ≤ 2**(e-4.5) -- special case, see above\n xn = (xn + a / xn) >> 1; // ε_2 := | x_2 - sqrt(a) | ≤ 2**(e-9) -- general case with k = 4.5\n xn = (xn + a / xn) >> 1; // ε_3 := | x_3 - sqrt(a) | ≤ 2**(e-18) -- general case with k = 9\n xn = (xn + a / xn) >> 1; // ε_4 := | x_4 - sqrt(a) | ≤ 2**(e-36) -- general case with k = 18\n xn = (xn + a / xn) >> 1; // ε_5 := | x_5 - sqrt(a) | ≤ 2**(e-72) -- general case with k = 36\n xn = (xn + a / xn) >> 1; // ε_6 := | x_6 - sqrt(a) | ≤ 2**(e-144) -- general case with k = 72\n\n // Because e ≤ 128 (as discussed during the first estimation phase), we know have reached a precision\n // ε_6 ≤ 2**(e-144) < 1. Given we're operating on integers, then we can ensure that xn is now either\n // sqrt(a) or sqrt(a) + 1.\n return xn - SafeCast.toUint(xn > a / xn);\n }\n }\n\n /**\n * @dev 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 + SafeCast.toUint(unsignedRoundsUp(rounding) && result * result < a);\n }\n }\n\n /**\n * @dev Return the log in base 2 of a positive value rounded towards zero.\n * Returns 0 if given 0.\n */\n function log2(uint256 value) internal pure returns (uint256) {\n uint256 result = 0;\n uint256 exp;\n unchecked {\n exp = 128 * SafeCast.toUint(value > (1 << 128) - 1);\n value >>= exp;\n result += exp;\n\n exp = 64 * SafeCast.toUint(value > (1 << 64) - 1);\n value >>= exp;\n result += exp;\n\n exp = 32 * SafeCast.toUint(value > (1 << 32) - 1);\n value >>= exp;\n result += exp;\n\n exp = 16 * SafeCast.toUint(value > (1 << 16) - 1);\n value >>= exp;\n result += exp;\n\n exp = 8 * SafeCast.toUint(value > (1 << 8) - 1);\n value >>= exp;\n result += exp;\n\n exp = 4 * SafeCast.toUint(value > (1 << 4) - 1);\n value >>= exp;\n result += exp;\n\n exp = 2 * SafeCast.toUint(value > (1 << 2) - 1);\n value >>= exp;\n result += exp;\n\n result += SafeCast.toUint(value > 1);\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 + SafeCast.toUint(unsignedRoundsUp(rounding) && 1 << result < value);\n }\n }\n\n /**\n * @dev Return the log in base 10 of a positive value rounded towards zero.\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 + SafeCast.toUint(unsignedRoundsUp(rounding) && 10 ** result < value);\n }\n }\n\n /**\n * @dev Return the log in base 256 of a positive value rounded towards zero.\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 uint256 isGt;\n unchecked {\n isGt = SafeCast.toUint(value > (1 << 128) - 1);\n value >>= isGt * 128;\n result += isGt * 16;\n\n isGt = SafeCast.toUint(value > (1 << 64) - 1);\n value >>= isGt * 64;\n result += isGt * 8;\n\n isGt = SafeCast.toUint(value > (1 << 32) - 1);\n value >>= isGt * 32;\n result += isGt * 4;\n\n isGt = SafeCast.toUint(value > (1 << 16) - 1);\n value >>= isGt * 16;\n result += isGt * 2;\n\n result += SafeCast.toUint(value > (1 << 8) - 1);\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 + SafeCast.toUint(unsignedRoundsUp(rounding) && 1 << (result << 3) < value);\n }\n }\n\n /**\n * @dev Returns whether a provided rounding mode is considered rounding up for unsigned integers.\n */\n function unsignedRoundsUp(Rounding rounding) internal pure returns (bool) {\n return uint8(rounding) % 2 == 1;\n }\n}\n" + }, + "@openzeppelin/contracts/utils/math/SafeCast.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/math/SafeCast.sol)\n// This file was procedurally generated from scripts/generate/templates/SafeCast.js.\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Wrappers over Solidity's uintXX/intXX/bool casting operators with added overflow\n * checks.\n *\n * Downcasting from uint256/int256 in Solidity does not revert on overflow. This can\n * easily result in undesired exploitation or bugs, since developers usually\n * assume that overflows raise errors. `SafeCast` restores this intuition by\n * reverting the transaction when such an operation overflows.\n *\n * Using this library instead of the unchecked operations eliminates an entire\n * class of bugs, so it's recommended to use it always.\n */\nlibrary SafeCast {\n /**\n * @dev Value doesn't fit in an uint of `bits` size.\n */\n error SafeCastOverflowedUintDowncast(uint8 bits, uint256 value);\n\n /**\n * @dev An int value doesn't fit in an uint of `bits` size.\n */\n error SafeCastOverflowedIntToUint(int256 value);\n\n /**\n * @dev Value doesn't fit in an int of `bits` size.\n */\n error SafeCastOverflowedIntDowncast(uint8 bits, int256 value);\n\n /**\n * @dev An uint value doesn't fit in an int of `bits` size.\n */\n error SafeCastOverflowedUintToInt(uint256 value);\n\n /**\n * @dev Returns the downcasted uint248 from uint256, reverting on\n * overflow (when the input is greater than largest uint248).\n *\n * Counterpart to Solidity's `uint248` operator.\n *\n * Requirements:\n *\n * - input must fit into 248 bits\n */\n function toUint248(uint256 value) internal pure returns (uint248) {\n if (value > type(uint248).max) {\n revert SafeCastOverflowedUintDowncast(248, value);\n }\n return uint248(value);\n }\n\n /**\n * @dev Returns the downcasted uint240 from uint256, reverting on\n * overflow (when the input is greater than largest uint240).\n *\n * Counterpart to Solidity's `uint240` operator.\n *\n * Requirements:\n *\n * - input must fit into 240 bits\n */\n function toUint240(uint256 value) internal pure returns (uint240) {\n if (value > type(uint240).max) {\n revert SafeCastOverflowedUintDowncast(240, value);\n }\n return uint240(value);\n }\n\n /**\n * @dev Returns the downcasted uint232 from uint256, reverting on\n * overflow (when the input is greater than largest uint232).\n *\n * Counterpart to Solidity's `uint232` operator.\n *\n * Requirements:\n *\n * - input must fit into 232 bits\n */\n function toUint232(uint256 value) internal pure returns (uint232) {\n if (value > type(uint232).max) {\n revert SafeCastOverflowedUintDowncast(232, value);\n }\n return uint232(value);\n }\n\n /**\n * @dev Returns the downcasted uint224 from uint256, reverting on\n * overflow (when the input is greater than largest uint224).\n *\n * Counterpart to Solidity's `uint224` operator.\n *\n * Requirements:\n *\n * - input must fit into 224 bits\n */\n function toUint224(uint256 value) internal pure returns (uint224) {\n if (value > type(uint224).max) {\n revert SafeCastOverflowedUintDowncast(224, value);\n }\n return uint224(value);\n }\n\n /**\n * @dev Returns the downcasted uint216 from uint256, reverting on\n * overflow (when the input is greater than largest uint216).\n *\n * Counterpart to Solidity's `uint216` operator.\n *\n * Requirements:\n *\n * - input must fit into 216 bits\n */\n function toUint216(uint256 value) internal pure returns (uint216) {\n if (value > type(uint216).max) {\n revert SafeCastOverflowedUintDowncast(216, value);\n }\n return uint216(value);\n }\n\n /**\n * @dev Returns the downcasted uint208 from uint256, reverting on\n * overflow (when the input is greater than largest uint208).\n *\n * Counterpart to Solidity's `uint208` operator.\n *\n * Requirements:\n *\n * - input must fit into 208 bits\n */\n function toUint208(uint256 value) internal pure returns (uint208) {\n if (value > type(uint208).max) {\n revert SafeCastOverflowedUintDowncast(208, value);\n }\n return uint208(value);\n }\n\n /**\n * @dev Returns the downcasted uint200 from uint256, reverting on\n * overflow (when the input is greater than largest uint200).\n *\n * Counterpart to Solidity's `uint200` operator.\n *\n * Requirements:\n *\n * - input must fit into 200 bits\n */\n function toUint200(uint256 value) internal pure returns (uint200) {\n if (value > type(uint200).max) {\n revert SafeCastOverflowedUintDowncast(200, value);\n }\n return uint200(value);\n }\n\n /**\n * @dev Returns the downcasted uint192 from uint256, reverting on\n * overflow (when the input is greater than largest uint192).\n *\n * Counterpart to Solidity's `uint192` operator.\n *\n * Requirements:\n *\n * - input must fit into 192 bits\n */\n function toUint192(uint256 value) internal pure returns (uint192) {\n if (value > type(uint192).max) {\n revert SafeCastOverflowedUintDowncast(192, value);\n }\n return uint192(value);\n }\n\n /**\n * @dev Returns the downcasted uint184 from uint256, reverting on\n * overflow (when the input is greater than largest uint184).\n *\n * Counterpart to Solidity's `uint184` operator.\n *\n * Requirements:\n *\n * - input must fit into 184 bits\n */\n function toUint184(uint256 value) internal pure returns (uint184) {\n if (value > type(uint184).max) {\n revert SafeCastOverflowedUintDowncast(184, value);\n }\n return uint184(value);\n }\n\n /**\n * @dev Returns the downcasted uint176 from uint256, reverting on\n * overflow (when the input is greater than largest uint176).\n *\n * Counterpart to Solidity's `uint176` operator.\n *\n * Requirements:\n *\n * - input must fit into 176 bits\n */\n function toUint176(uint256 value) internal pure returns (uint176) {\n if (value > type(uint176).max) {\n revert SafeCastOverflowedUintDowncast(176, value);\n }\n return uint176(value);\n }\n\n /**\n * @dev Returns the downcasted uint168 from uint256, reverting on\n * overflow (when the input is greater than largest uint168).\n *\n * Counterpart to Solidity's `uint168` operator.\n *\n * Requirements:\n *\n * - input must fit into 168 bits\n */\n function toUint168(uint256 value) internal pure returns (uint168) {\n if (value > type(uint168).max) {\n revert SafeCastOverflowedUintDowncast(168, value);\n }\n return uint168(value);\n }\n\n /**\n * @dev Returns the downcasted uint160 from uint256, reverting on\n * overflow (when the input is greater than largest uint160).\n *\n * Counterpart to Solidity's `uint160` operator.\n *\n * Requirements:\n *\n * - input must fit into 160 bits\n */\n function toUint160(uint256 value) internal pure returns (uint160) {\n if (value > type(uint160).max) {\n revert SafeCastOverflowedUintDowncast(160, value);\n }\n return uint160(value);\n }\n\n /**\n * @dev Returns the downcasted uint152 from uint256, reverting on\n * overflow (when the input is greater than largest uint152).\n *\n * Counterpart to Solidity's `uint152` operator.\n *\n * Requirements:\n *\n * - input must fit into 152 bits\n */\n function toUint152(uint256 value) internal pure returns (uint152) {\n if (value > type(uint152).max) {\n revert SafeCastOverflowedUintDowncast(152, value);\n }\n return uint152(value);\n }\n\n /**\n * @dev Returns the downcasted uint144 from uint256, reverting on\n * overflow (when the input is greater than largest uint144).\n *\n * Counterpart to Solidity's `uint144` operator.\n *\n * Requirements:\n *\n * - input must fit into 144 bits\n */\n function toUint144(uint256 value) internal pure returns (uint144) {\n if (value > type(uint144).max) {\n revert SafeCastOverflowedUintDowncast(144, value);\n }\n return uint144(value);\n }\n\n /**\n * @dev Returns the downcasted uint136 from uint256, reverting on\n * overflow (when the input is greater than largest uint136).\n *\n * Counterpart to Solidity's `uint136` operator.\n *\n * Requirements:\n *\n * - input must fit into 136 bits\n */\n function toUint136(uint256 value) internal pure returns (uint136) {\n if (value > type(uint136).max) {\n revert SafeCastOverflowedUintDowncast(136, value);\n }\n return uint136(value);\n }\n\n /**\n * @dev Returns the downcasted uint128 from uint256, reverting on\n * overflow (when the input is greater than largest uint128).\n *\n * Counterpart to Solidity's `uint128` operator.\n *\n * Requirements:\n *\n * - input must fit into 128 bits\n */\n function toUint128(uint256 value) internal pure returns (uint128) {\n if (value > type(uint128).max) {\n revert SafeCastOverflowedUintDowncast(128, value);\n }\n return uint128(value);\n }\n\n /**\n * @dev Returns the downcasted uint120 from uint256, reverting on\n * overflow (when the input is greater than largest uint120).\n *\n * Counterpart to Solidity's `uint120` operator.\n *\n * Requirements:\n *\n * - input must fit into 120 bits\n */\n function toUint120(uint256 value) internal pure returns (uint120) {\n if (value > type(uint120).max) {\n revert SafeCastOverflowedUintDowncast(120, value);\n }\n return uint120(value);\n }\n\n /**\n * @dev Returns the downcasted uint112 from uint256, reverting on\n * overflow (when the input is greater than largest uint112).\n *\n * Counterpart to Solidity's `uint112` operator.\n *\n * Requirements:\n *\n * - input must fit into 112 bits\n */\n function toUint112(uint256 value) internal pure returns (uint112) {\n if (value > type(uint112).max) {\n revert SafeCastOverflowedUintDowncast(112, value);\n }\n return uint112(value);\n }\n\n /**\n * @dev Returns the downcasted uint104 from uint256, reverting on\n * overflow (when the input is greater than largest uint104).\n *\n * Counterpart to Solidity's `uint104` operator.\n *\n * Requirements:\n *\n * - input must fit into 104 bits\n */\n function toUint104(uint256 value) internal pure returns (uint104) {\n if (value > type(uint104).max) {\n revert SafeCastOverflowedUintDowncast(104, value);\n }\n return uint104(value);\n }\n\n /**\n * @dev Returns the downcasted uint96 from uint256, reverting on\n * overflow (when the input is greater than largest uint96).\n *\n * Counterpart to Solidity's `uint96` operator.\n *\n * Requirements:\n *\n * - input must fit into 96 bits\n */\n function toUint96(uint256 value) internal pure returns (uint96) {\n if (value > type(uint96).max) {\n revert SafeCastOverflowedUintDowncast(96, value);\n }\n return uint96(value);\n }\n\n /**\n * @dev Returns the downcasted uint88 from uint256, reverting on\n * overflow (when the input is greater than largest uint88).\n *\n * Counterpart to Solidity's `uint88` operator.\n *\n * Requirements:\n *\n * - input must fit into 88 bits\n */\n function toUint88(uint256 value) internal pure returns (uint88) {\n if (value > type(uint88).max) {\n revert SafeCastOverflowedUintDowncast(88, value);\n }\n return uint88(value);\n }\n\n /**\n * @dev Returns the downcasted uint80 from uint256, reverting on\n * overflow (when the input is greater than largest uint80).\n *\n * Counterpart to Solidity's `uint80` operator.\n *\n * Requirements:\n *\n * - input must fit into 80 bits\n */\n function toUint80(uint256 value) internal pure returns (uint80) {\n if (value > type(uint80).max) {\n revert SafeCastOverflowedUintDowncast(80, value);\n }\n return uint80(value);\n }\n\n /**\n * @dev Returns the downcasted uint72 from uint256, reverting on\n * overflow (when the input is greater than largest uint72).\n *\n * Counterpart to Solidity's `uint72` operator.\n *\n * Requirements:\n *\n * - input must fit into 72 bits\n */\n function toUint72(uint256 value) internal pure returns (uint72) {\n if (value > type(uint72).max) {\n revert SafeCastOverflowedUintDowncast(72, value);\n }\n return uint72(value);\n }\n\n /**\n * @dev Returns the downcasted uint64 from uint256, reverting on\n * overflow (when the input is greater than largest uint64).\n *\n * Counterpart to Solidity's `uint64` operator.\n *\n * Requirements:\n *\n * - input must fit into 64 bits\n */\n function toUint64(uint256 value) internal pure returns (uint64) {\n if (value > type(uint64).max) {\n revert SafeCastOverflowedUintDowncast(64, value);\n }\n return uint64(value);\n }\n\n /**\n * @dev Returns the downcasted uint56 from uint256, reverting on\n * overflow (when the input is greater than largest uint56).\n *\n * Counterpart to Solidity's `uint56` operator.\n *\n * Requirements:\n *\n * - input must fit into 56 bits\n */\n function toUint56(uint256 value) internal pure returns (uint56) {\n if (value > type(uint56).max) {\n revert SafeCastOverflowedUintDowncast(56, value);\n }\n return uint56(value);\n }\n\n /**\n * @dev Returns the downcasted uint48 from uint256, reverting on\n * overflow (when the input is greater than largest uint48).\n *\n * Counterpart to Solidity's `uint48` operator.\n *\n * Requirements:\n *\n * - input must fit into 48 bits\n */\n function toUint48(uint256 value) internal pure returns (uint48) {\n if (value > type(uint48).max) {\n revert SafeCastOverflowedUintDowncast(48, value);\n }\n return uint48(value);\n }\n\n /**\n * @dev Returns the downcasted uint40 from uint256, reverting on\n * overflow (when the input is greater than largest uint40).\n *\n * Counterpart to Solidity's `uint40` operator.\n *\n * Requirements:\n *\n * - input must fit into 40 bits\n */\n function toUint40(uint256 value) internal pure returns (uint40) {\n if (value > type(uint40).max) {\n revert SafeCastOverflowedUintDowncast(40, value);\n }\n return uint40(value);\n }\n\n /**\n * @dev Returns the downcasted uint32 from uint256, reverting on\n * overflow (when the input is greater than largest uint32).\n *\n * Counterpart to Solidity's `uint32` operator.\n *\n * Requirements:\n *\n * - input must fit into 32 bits\n */\n function toUint32(uint256 value) internal pure returns (uint32) {\n if (value > type(uint32).max) {\n revert SafeCastOverflowedUintDowncast(32, value);\n }\n return uint32(value);\n }\n\n /**\n * @dev Returns the downcasted uint24 from uint256, reverting on\n * overflow (when the input is greater than largest uint24).\n *\n * Counterpart to Solidity's `uint24` operator.\n *\n * Requirements:\n *\n * - input must fit into 24 bits\n */\n function toUint24(uint256 value) internal pure returns (uint24) {\n if (value > type(uint24).max) {\n revert SafeCastOverflowedUintDowncast(24, value);\n }\n return uint24(value);\n }\n\n /**\n * @dev Returns the downcasted uint16 from uint256, reverting on\n * overflow (when the input is greater than largest uint16).\n *\n * Counterpart to Solidity's `uint16` operator.\n *\n * Requirements:\n *\n * - input must fit into 16 bits\n */\n function toUint16(uint256 value) internal pure returns (uint16) {\n if (value > type(uint16).max) {\n revert SafeCastOverflowedUintDowncast(16, value);\n }\n return uint16(value);\n }\n\n /**\n * @dev Returns the downcasted uint8 from uint256, reverting on\n * overflow (when the input is greater than largest uint8).\n *\n * Counterpart to Solidity's `uint8` operator.\n *\n * Requirements:\n *\n * - input must fit into 8 bits\n */\n function toUint8(uint256 value) internal pure returns (uint8) {\n if (value > type(uint8).max) {\n revert SafeCastOverflowedUintDowncast(8, value);\n }\n return uint8(value);\n }\n\n /**\n * @dev Converts a signed int256 into an unsigned uint256.\n *\n * Requirements:\n *\n * - input must be greater than or equal to 0.\n */\n function toUint256(int256 value) internal pure returns (uint256) {\n if (value < 0) {\n revert SafeCastOverflowedIntToUint(value);\n }\n return uint256(value);\n }\n\n /**\n * @dev Returns the downcasted int248 from int256, reverting on\n * overflow (when the input is less than smallest int248 or\n * greater than largest int248).\n *\n * Counterpart to Solidity's `int248` operator.\n *\n * Requirements:\n *\n * - input must fit into 248 bits\n */\n function toInt248(int256 value) internal pure returns (int248 downcasted) {\n downcasted = int248(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(248, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int240 from int256, reverting on\n * overflow (when the input is less than smallest int240 or\n * greater than largest int240).\n *\n * Counterpart to Solidity's `int240` operator.\n *\n * Requirements:\n *\n * - input must fit into 240 bits\n */\n function toInt240(int256 value) internal pure returns (int240 downcasted) {\n downcasted = int240(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(240, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int232 from int256, reverting on\n * overflow (when the input is less than smallest int232 or\n * greater than largest int232).\n *\n * Counterpart to Solidity's `int232` operator.\n *\n * Requirements:\n *\n * - input must fit into 232 bits\n */\n function toInt232(int256 value) internal pure returns (int232 downcasted) {\n downcasted = int232(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(232, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int224 from int256, reverting on\n * overflow (when the input is less than smallest int224 or\n * greater than largest int224).\n *\n * Counterpart to Solidity's `int224` operator.\n *\n * Requirements:\n *\n * - input must fit into 224 bits\n */\n function toInt224(int256 value) internal pure returns (int224 downcasted) {\n downcasted = int224(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(224, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int216 from int256, reverting on\n * overflow (when the input is less than smallest int216 or\n * greater than largest int216).\n *\n * Counterpart to Solidity's `int216` operator.\n *\n * Requirements:\n *\n * - input must fit into 216 bits\n */\n function toInt216(int256 value) internal pure returns (int216 downcasted) {\n downcasted = int216(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(216, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int208 from int256, reverting on\n * overflow (when the input is less than smallest int208 or\n * greater than largest int208).\n *\n * Counterpart to Solidity's `int208` operator.\n *\n * Requirements:\n *\n * - input must fit into 208 bits\n */\n function toInt208(int256 value) internal pure returns (int208 downcasted) {\n downcasted = int208(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(208, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int200 from int256, reverting on\n * overflow (when the input is less than smallest int200 or\n * greater than largest int200).\n *\n * Counterpart to Solidity's `int200` operator.\n *\n * Requirements:\n *\n * - input must fit into 200 bits\n */\n function toInt200(int256 value) internal pure returns (int200 downcasted) {\n downcasted = int200(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(200, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int192 from int256, reverting on\n * overflow (when the input is less than smallest int192 or\n * greater than largest int192).\n *\n * Counterpart to Solidity's `int192` operator.\n *\n * Requirements:\n *\n * - input must fit into 192 bits\n */\n function toInt192(int256 value) internal pure returns (int192 downcasted) {\n downcasted = int192(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(192, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int184 from int256, reverting on\n * overflow (when the input is less than smallest int184 or\n * greater than largest int184).\n *\n * Counterpart to Solidity's `int184` operator.\n *\n * Requirements:\n *\n * - input must fit into 184 bits\n */\n function toInt184(int256 value) internal pure returns (int184 downcasted) {\n downcasted = int184(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(184, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int176 from int256, reverting on\n * overflow (when the input is less than smallest int176 or\n * greater than largest int176).\n *\n * Counterpart to Solidity's `int176` operator.\n *\n * Requirements:\n *\n * - input must fit into 176 bits\n */\n function toInt176(int256 value) internal pure returns (int176 downcasted) {\n downcasted = int176(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(176, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int168 from int256, reverting on\n * overflow (when the input is less than smallest int168 or\n * greater than largest int168).\n *\n * Counterpart to Solidity's `int168` operator.\n *\n * Requirements:\n *\n * - input must fit into 168 bits\n */\n function toInt168(int256 value) internal pure returns (int168 downcasted) {\n downcasted = int168(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(168, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int160 from int256, reverting on\n * overflow (when the input is less than smallest int160 or\n * greater than largest int160).\n *\n * Counterpart to Solidity's `int160` operator.\n *\n * Requirements:\n *\n * - input must fit into 160 bits\n */\n function toInt160(int256 value) internal pure returns (int160 downcasted) {\n downcasted = int160(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(160, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int152 from int256, reverting on\n * overflow (when the input is less than smallest int152 or\n * greater than largest int152).\n *\n * Counterpart to Solidity's `int152` operator.\n *\n * Requirements:\n *\n * - input must fit into 152 bits\n */\n function toInt152(int256 value) internal pure returns (int152 downcasted) {\n downcasted = int152(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(152, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int144 from int256, reverting on\n * overflow (when the input is less than smallest int144 or\n * greater than largest int144).\n *\n * Counterpart to Solidity's `int144` operator.\n *\n * Requirements:\n *\n * - input must fit into 144 bits\n */\n function toInt144(int256 value) internal pure returns (int144 downcasted) {\n downcasted = int144(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(144, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int136 from int256, reverting on\n * overflow (when the input is less than smallest int136 or\n * greater than largest int136).\n *\n * Counterpart to Solidity's `int136` operator.\n *\n * Requirements:\n *\n * - input must fit into 136 bits\n */\n function toInt136(int256 value) internal pure returns (int136 downcasted) {\n downcasted = int136(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(136, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int128 from int256, reverting on\n * overflow (when the input is less than smallest int128 or\n * greater than largest int128).\n *\n * Counterpart to Solidity's `int128` operator.\n *\n * Requirements:\n *\n * - input must fit into 128 bits\n */\n function toInt128(int256 value) internal pure returns (int128 downcasted) {\n downcasted = int128(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(128, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int120 from int256, reverting on\n * overflow (when the input is less than smallest int120 or\n * greater than largest int120).\n *\n * Counterpart to Solidity's `int120` operator.\n *\n * Requirements:\n *\n * - input must fit into 120 bits\n */\n function toInt120(int256 value) internal pure returns (int120 downcasted) {\n downcasted = int120(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(120, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int112 from int256, reverting on\n * overflow (when the input is less than smallest int112 or\n * greater than largest int112).\n *\n * Counterpart to Solidity's `int112` operator.\n *\n * Requirements:\n *\n * - input must fit into 112 bits\n */\n function toInt112(int256 value) internal pure returns (int112 downcasted) {\n downcasted = int112(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(112, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int104 from int256, reverting on\n * overflow (when the input is less than smallest int104 or\n * greater than largest int104).\n *\n * Counterpart to Solidity's `int104` operator.\n *\n * Requirements:\n *\n * - input must fit into 104 bits\n */\n function toInt104(int256 value) internal pure returns (int104 downcasted) {\n downcasted = int104(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(104, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int96 from int256, reverting on\n * overflow (when the input is less than smallest int96 or\n * greater than largest int96).\n *\n * Counterpart to Solidity's `int96` operator.\n *\n * Requirements:\n *\n * - input must fit into 96 bits\n */\n function toInt96(int256 value) internal pure returns (int96 downcasted) {\n downcasted = int96(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(96, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int88 from int256, reverting on\n * overflow (when the input is less than smallest int88 or\n * greater than largest int88).\n *\n * Counterpart to Solidity's `int88` operator.\n *\n * Requirements:\n *\n * - input must fit into 88 bits\n */\n function toInt88(int256 value) internal pure returns (int88 downcasted) {\n downcasted = int88(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(88, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int80 from int256, reverting on\n * overflow (when the input is less than smallest int80 or\n * greater than largest int80).\n *\n * Counterpart to Solidity's `int80` operator.\n *\n * Requirements:\n *\n * - input must fit into 80 bits\n */\n function toInt80(int256 value) internal pure returns (int80 downcasted) {\n downcasted = int80(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(80, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int72 from int256, reverting on\n * overflow (when the input is less than smallest int72 or\n * greater than largest int72).\n *\n * Counterpart to Solidity's `int72` operator.\n *\n * Requirements:\n *\n * - input must fit into 72 bits\n */\n function toInt72(int256 value) internal pure returns (int72 downcasted) {\n downcasted = int72(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(72, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int64 from int256, reverting on\n * overflow (when the input is less than smallest int64 or\n * greater than largest int64).\n *\n * Counterpart to Solidity's `int64` operator.\n *\n * Requirements:\n *\n * - input must fit into 64 bits\n */\n function toInt64(int256 value) internal pure returns (int64 downcasted) {\n downcasted = int64(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(64, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int56 from int256, reverting on\n * overflow (when the input is less than smallest int56 or\n * greater than largest int56).\n *\n * Counterpart to Solidity's `int56` operator.\n *\n * Requirements:\n *\n * - input must fit into 56 bits\n */\n function toInt56(int256 value) internal pure returns (int56 downcasted) {\n downcasted = int56(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(56, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int48 from int256, reverting on\n * overflow (when the input is less than smallest int48 or\n * greater than largest int48).\n *\n * Counterpart to Solidity's `int48` operator.\n *\n * Requirements:\n *\n * - input must fit into 48 bits\n */\n function toInt48(int256 value) internal pure returns (int48 downcasted) {\n downcasted = int48(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(48, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int40 from int256, reverting on\n * overflow (when the input is less than smallest int40 or\n * greater than largest int40).\n *\n * Counterpart to Solidity's `int40` operator.\n *\n * Requirements:\n *\n * - input must fit into 40 bits\n */\n function toInt40(int256 value) internal pure returns (int40 downcasted) {\n downcasted = int40(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(40, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int32 from int256, reverting on\n * overflow (when the input is less than smallest int32 or\n * greater than largest int32).\n *\n * Counterpart to Solidity's `int32` operator.\n *\n * Requirements:\n *\n * - input must fit into 32 bits\n */\n function toInt32(int256 value) internal pure returns (int32 downcasted) {\n downcasted = int32(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(32, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int24 from int256, reverting on\n * overflow (when the input is less than smallest int24 or\n * greater than largest int24).\n *\n * Counterpart to Solidity's `int24` operator.\n *\n * Requirements:\n *\n * - input must fit into 24 bits\n */\n function toInt24(int256 value) internal pure returns (int24 downcasted) {\n downcasted = int24(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(24, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int16 from int256, reverting on\n * overflow (when the input is less than smallest int16 or\n * greater than largest int16).\n *\n * Counterpart to Solidity's `int16` operator.\n *\n * Requirements:\n *\n * - input must fit into 16 bits\n */\n function toInt16(int256 value) internal pure returns (int16 downcasted) {\n downcasted = int16(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(16, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int8 from int256, reverting on\n * overflow (when the input is less than smallest int8 or\n * greater than largest int8).\n *\n * Counterpart to Solidity's `int8` operator.\n *\n * Requirements:\n *\n * - input must fit into 8 bits\n */\n function toInt8(int256 value) internal pure returns (int8 downcasted) {\n downcasted = int8(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(8, value);\n }\n }\n\n /**\n * @dev Converts an unsigned uint256 into a signed int256.\n *\n * Requirements:\n *\n * - input must be less than or equal to maxInt256.\n */\n function toInt256(uint256 value) internal pure returns (int256) {\n // Note: Unsafe cast below is okay because `type(int256).max` is guaranteed to be positive\n if (value > uint256(type(int256).max)) {\n revert SafeCastOverflowedUintToInt(value);\n }\n return int256(value);\n }\n\n /**\n * @dev Cast a boolean (false or true) to a uint256 (0 or 1) with no jump.\n */\n function toUint(bool b) internal pure returns (uint256 u) {\n assembly (\"memory-safe\") {\n u := iszero(iszero(b))\n }\n }\n}\n" + }, + "@openzeppelin/contracts/utils/math/SignedMath.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/math/SignedMath.sol)\n\npragma solidity ^0.8.20;\n\nimport {SafeCast} from \"./SafeCast.sol\";\n\n/**\n * @dev Standard signed math utilities missing in the Solidity language.\n */\nlibrary SignedMath {\n /**\n * @dev Branchless ternary evaluation for `a ? b : c`. Gas costs are constant.\n *\n * IMPORTANT: This function may reduce bytecode size and consume less gas when used standalone.\n * However, the compiler may optimize Solidity ternary operations (i.e. `a ? b : c`) to only compute\n * one branch when needed, making this function more expensive.\n */\n function ternary(bool condition, int256 a, int256 b) internal pure returns (int256) {\n unchecked {\n // branchless ternary works because:\n // b ^ (a ^ b) == a\n // b ^ 0 == b\n return b ^ ((a ^ b) * int256(SafeCast.toUint(condition)));\n }\n }\n\n /**\n * @dev Returns the largest of two signed numbers.\n */\n function max(int256 a, int256 b) internal pure returns (int256) {\n return ternary(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 ternary(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 // Formula from the \"Bit Twiddling Hacks\" by Sean Eron Anderson.\n // Since `n` is a signed integer, the generated bytecode will use the SAR opcode to perform the right shift,\n // taking advantage of the most significant (or \"sign\" bit) in two's complement representation.\n // This opcode adds new most significant bits set to the value of the previous most significant bit. As a result,\n // the mask will either be `bytes32(0)` (if n is positive) or `~bytes32(0)` (if n is negative).\n int256 mask = n >> 255;\n\n // A `bytes32(0)` mask leaves the input unchanged, while a `~bytes32(0)` mask complements it.\n return uint256((n + mask) ^ mask);\n }\n }\n}\n" + }, + "@openzeppelin/contracts/utils/Nonces.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/Nonces.sol)\npragma solidity ^0.8.20;\n\n/**\n * @dev Provides tracking nonces for addresses. Nonces will only increment.\n */\nabstract contract Nonces {\n /**\n * @dev The nonce used for an `account` is not the expected current nonce.\n */\n error InvalidAccountNonce(address account, uint256 currentNonce);\n\n mapping(address account => uint256) private _nonces;\n\n /**\n * @dev Returns the next unused nonce for an address.\n */\n function nonces(address owner) public view virtual returns (uint256) {\n return _nonces[owner];\n }\n\n /**\n * @dev Consumes a nonce.\n *\n * Returns the current value and increments nonce.\n */\n function _useNonce(address owner) internal virtual returns (uint256) {\n // For each account, the nonce has an initial value of 0, can only be incremented by one, and cannot be\n // decremented or reset. This guarantees that the nonce never overflows.\n unchecked {\n // It is important to do x++ and not ++x here.\n return _nonces[owner]++;\n }\n }\n\n /**\n * @dev Same as {_useNonce} but checking that `nonce` is the next valid for `owner`.\n */\n function _useCheckedNonce(address owner, uint256 nonce) internal virtual {\n uint256 current = _useNonce(owner);\n if (nonce != current) {\n revert InvalidAccountNonce(owner, current);\n }\n }\n}\n" + }, + "@openzeppelin/contracts/utils/Panic.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/Panic.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Helper library for emitting standardized panic codes.\n *\n * ```solidity\n * contract Example {\n * using Panic for uint256;\n *\n * // Use any of the declared internal constants\n * function foo() { Panic.GENERIC.panic(); }\n *\n * // Alternatively\n * function foo() { Panic.panic(Panic.GENERIC); }\n * }\n * ```\n *\n * Follows the list from https://github.com/ethereum/solidity/blob/v0.8.24/libsolutil/ErrorCodes.h[libsolutil].\n *\n * _Available since v5.1._\n */\n// slither-disable-next-line unused-state\nlibrary Panic {\n /// @dev generic / unspecified error\n uint256 internal constant GENERIC = 0x00;\n /// @dev used by the assert() builtin\n uint256 internal constant ASSERT = 0x01;\n /// @dev arithmetic underflow or overflow\n uint256 internal constant UNDER_OVERFLOW = 0x11;\n /// @dev division or modulo by zero\n uint256 internal constant DIVISION_BY_ZERO = 0x12;\n /// @dev enum conversion error\n uint256 internal constant ENUM_CONVERSION_ERROR = 0x21;\n /// @dev invalid encoding in storage\n uint256 internal constant STORAGE_ENCODING_ERROR = 0x22;\n /// @dev empty array pop\n uint256 internal constant EMPTY_ARRAY_POP = 0x31;\n /// @dev array out of bounds access\n uint256 internal constant ARRAY_OUT_OF_BOUNDS = 0x32;\n /// @dev resource error (too large allocation or too large array)\n uint256 internal constant RESOURCE_ERROR = 0x41;\n /// @dev calling invalid internal function\n uint256 internal constant INVALID_INTERNAL_FUNCTION = 0x51;\n\n /// @dev Reverts with a panic code. Recommended to use with\n /// the internal constants with predefined codes.\n function panic(uint256 code) internal pure {\n assembly (\"memory-safe\") {\n mstore(0x00, 0x4e487b71)\n mstore(0x20, code)\n revert(0x1c, 0x24)\n }\n }\n}\n" + }, + "@openzeppelin/contracts/utils/ShortStrings.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/ShortStrings.sol)\n\npragma solidity ^0.8.20;\n\nimport {StorageSlot} from \"./StorageSlot.sol\";\n\n// | string | 0xAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA |\n// | length | 0x BB |\ntype ShortString is bytes32;\n\n/**\n * @dev This library provides functions to convert short memory strings\n * into a `ShortString` type that can be used as an immutable variable.\n *\n * Strings of arbitrary length can be optimized using this library if\n * they are short enough (up to 31 bytes) by packing them with their\n * length (1 byte) in a single EVM word (32 bytes). Additionally, a\n * fallback mechanism can be used for every other case.\n *\n * Usage example:\n *\n * ```solidity\n * contract Named {\n * using ShortStrings for *;\n *\n * ShortString private immutable _name;\n * string private _nameFallback;\n *\n * constructor(string memory contractName) {\n * _name = contractName.toShortStringWithFallback(_nameFallback);\n * }\n *\n * function name() external view returns (string memory) {\n * return _name.toStringWithFallback(_nameFallback);\n * }\n * }\n * ```\n */\nlibrary ShortStrings {\n // Used as an identifier for strings longer than 31 bytes.\n bytes32 private constant FALLBACK_SENTINEL = 0x00000000000000000000000000000000000000000000000000000000000000FF;\n\n error StringTooLong(string str);\n error InvalidShortString();\n\n /**\n * @dev Encode a string of at most 31 chars into a `ShortString`.\n *\n * This will trigger a `StringTooLong` error is the input string is too long.\n */\n function toShortString(string memory str) internal pure returns (ShortString) {\n bytes memory bstr = bytes(str);\n if (bstr.length > 31) {\n revert StringTooLong(str);\n }\n return ShortString.wrap(bytes32(uint256(bytes32(bstr)) | bstr.length));\n }\n\n /**\n * @dev Decode a `ShortString` back to a \"normal\" string.\n */\n function toString(ShortString sstr) internal pure returns (string memory) {\n uint256 len = byteLength(sstr);\n // using `new string(len)` would work locally but is not memory safe.\n string memory str = new string(32);\n assembly (\"memory-safe\") {\n mstore(str, len)\n mstore(add(str, 0x20), sstr)\n }\n return str;\n }\n\n /**\n * @dev Return the length of a `ShortString`.\n */\n function byteLength(ShortString sstr) internal pure returns (uint256) {\n uint256 result = uint256(ShortString.unwrap(sstr)) & 0xFF;\n if (result > 31) {\n revert InvalidShortString();\n }\n return result;\n }\n\n /**\n * @dev Encode a string into a `ShortString`, or write it to storage if it is too long.\n */\n function toShortStringWithFallback(string memory value, string storage store) internal returns (ShortString) {\n if (bytes(value).length < 32) {\n return toShortString(value);\n } else {\n StorageSlot.getStringSlot(store).value = value;\n return ShortString.wrap(FALLBACK_SENTINEL);\n }\n }\n\n /**\n * @dev Decode a string that was encoded to `ShortString` or written to storage using {setWithFallback}.\n */\n function toStringWithFallback(ShortString value, string storage store) internal pure returns (string memory) {\n if (ShortString.unwrap(value) != FALLBACK_SENTINEL) {\n return toString(value);\n } else {\n return store;\n }\n }\n\n /**\n * @dev Return the length of a string that was encoded to `ShortString` or written to storage using\n * {setWithFallback}.\n *\n * WARNING: This will return the \"byte length\" of the string. This may not reflect the actual length in terms of\n * actual characters as the UTF-8 encoding of a single character can span over multiple bytes.\n */\n function byteLengthWithFallback(ShortString value, string storage store) internal view returns (uint256) {\n if (ShortString.unwrap(value) != FALLBACK_SENTINEL) {\n return byteLength(value);\n } else {\n return bytes(store).length;\n }\n }\n}\n" + }, + "@openzeppelin/contracts/utils/StorageSlot.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/StorageSlot.sol)\n// This file was procedurally generated from scripts/generate/templates/StorageSlot.js.\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Library for reading and writing primitive types to specific storage slots.\n *\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\n * This library helps with reading and writing to such slots without the need for inline assembly.\n *\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\n *\n * Example usage to set ERC-1967 implementation slot:\n * ```solidity\n * contract ERC1967 {\n * // Define the slot. Alternatively, use the SlotDerivation library to derive the slot.\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\n *\n * function _getImplementation() internal view returns (address) {\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\n * }\n *\n * function _setImplementation(address newImplementation) internal {\n * require(newImplementation.code.length > 0);\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\n * }\n * }\n * ```\n *\n * TIP: Consider using this library along with {SlotDerivation}.\n */\nlibrary StorageSlot {\n struct AddressSlot {\n address value;\n }\n\n struct BooleanSlot {\n bool value;\n }\n\n struct Bytes32Slot {\n bytes32 value;\n }\n\n struct Uint256Slot {\n uint256 value;\n }\n\n struct Int256Slot {\n int256 value;\n }\n\n struct StringSlot {\n string value;\n }\n\n struct BytesSlot {\n bytes value;\n }\n\n /**\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\n */\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\n assembly (\"memory-safe\") {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns a `BooleanSlot` with member `value` located at `slot`.\n */\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\n assembly (\"memory-safe\") {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns a `Bytes32Slot` with member `value` located at `slot`.\n */\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\n assembly (\"memory-safe\") {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns a `Uint256Slot` with member `value` located at `slot`.\n */\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\n assembly (\"memory-safe\") {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns a `Int256Slot` with member `value` located at `slot`.\n */\n function getInt256Slot(bytes32 slot) internal pure returns (Int256Slot storage r) {\n assembly (\"memory-safe\") {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns a `StringSlot` with member `value` located at `slot`.\n */\n function getStringSlot(bytes32 slot) internal pure returns (StringSlot storage r) {\n assembly (\"memory-safe\") {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `StringSlot` representation of the string storage pointer `store`.\n */\n function getStringSlot(string storage store) internal pure returns (StringSlot storage r) {\n assembly (\"memory-safe\") {\n r.slot := store.slot\n }\n }\n\n /**\n * @dev Returns a `BytesSlot` with member `value` located at `slot`.\n */\n function getBytesSlot(bytes32 slot) internal pure returns (BytesSlot storage r) {\n assembly (\"memory-safe\") {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `BytesSlot` representation of the bytes storage pointer `store`.\n */\n function getBytesSlot(bytes storage store) internal pure returns (BytesSlot storage r) {\n assembly (\"memory-safe\") {\n r.slot := store.slot\n }\n }\n}\n" + }, + "@openzeppelin/contracts/utils/Strings.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/Strings.sol)\n\npragma solidity ^0.8.20;\n\nimport {Math} from \"./math/Math.sol\";\nimport {SignedMath} from \"./math/SignedMath.sol\";\n\n/**\n * @dev String operations.\n */\nlibrary Strings {\n bytes16 private constant HEX_DIGITS = \"0123456789abcdef\";\n uint8 private constant ADDRESS_LENGTH = 20;\n\n /**\n * @dev The `value` string doesn't fit in the specified `length`.\n */\n error StringsInsufficientHexLength(uint256 value, uint256 length);\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 assembly (\"memory-safe\") {\n ptr := add(buffer, add(32, length))\n }\n while (true) {\n ptr--;\n assembly (\"memory-safe\") {\n mstore8(ptr, byte(mod(value, 10), HEX_DIGITS))\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 toStringSigned(int256 value) internal pure returns (string memory) {\n return string.concat(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 uint256 localValue = value;\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] = HEX_DIGITS[localValue & 0xf];\n localValue >>= 4;\n }\n if (localValue != 0) {\n revert StringsInsufficientHexLength(value, length);\n }\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\n * 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 Converts an `address` with fixed length of 20 bytes to its checksummed ASCII `string` hexadecimal\n * representation, according to EIP-55.\n */\n function toChecksumHexString(address addr) internal pure returns (string memory) {\n bytes memory buffer = bytes(toHexString(addr));\n\n // hash the hex part of buffer (skip length + 2 bytes, length 40)\n uint256 hashValue;\n assembly (\"memory-safe\") {\n hashValue := shr(96, keccak256(add(buffer, 0x22), 40))\n }\n\n for (uint256 i = 41; i > 1; --i) {\n // possible values for buffer[i] are 48 (0) to 57 (9) and 97 (a) to 102 (f)\n if (hashValue & 0xf > 7 && uint8(buffer[i]) > 96) {\n // case shift by xoring with 0x20\n buffer[i] ^= 0x20;\n }\n hashValue >>= 4;\n }\n return string(buffer);\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 bytes(a).length == bytes(b).length && keccak256(bytes(a)) == keccak256(bytes(b));\n }\n}\n" + }, + "@openzeppelin/contracts/utils/structs/Checkpoints.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/structs/Checkpoints.sol)\n// This file was procedurally generated from scripts/generate/templates/Checkpoints.js.\n\npragma solidity ^0.8.20;\n\nimport {Math} from \"../math/Math.sol\";\n\n/**\n * @dev This library defines the `Trace*` struct, for checkpointing values as they change at different points in\n * time, and later looking up past values by block number. See {Votes} as an example.\n *\n * To create a history of checkpoints define a variable type `Checkpoints.Trace*` in your contract, and store a new\n * checkpoint for the current transaction block using the {push} function.\n */\nlibrary Checkpoints {\n /**\n * @dev A value was attempted to be inserted on a past checkpoint.\n */\n error CheckpointUnorderedInsertion();\n\n struct Trace224 {\n Checkpoint224[] _checkpoints;\n }\n\n struct Checkpoint224 {\n uint32 _key;\n uint224 _value;\n }\n\n /**\n * @dev Pushes a (`key`, `value`) pair into a Trace224 so that it is stored as the checkpoint.\n *\n * Returns previous value and new value.\n *\n * IMPORTANT: Never accept `key` as a user input, since an arbitrary `type(uint32).max` key set will disable the\n * library.\n */\n function push(\n Trace224 storage self,\n uint32 key,\n uint224 value\n ) internal returns (uint224 oldValue, uint224 newValue) {\n return _insert(self._checkpoints, key, value);\n }\n\n /**\n * @dev Returns the value in the first (oldest) checkpoint with key greater or equal than the search key, or zero if\n * there is none.\n */\n function lowerLookup(Trace224 storage self, uint32 key) internal view returns (uint224) {\n uint256 len = self._checkpoints.length;\n uint256 pos = _lowerBinaryLookup(self._checkpoints, key, 0, len);\n return pos == len ? 0 : _unsafeAccess(self._checkpoints, pos)._value;\n }\n\n /**\n * @dev Returns the value in the last (most recent) checkpoint with key lower or equal than the search key, or zero\n * if there is none.\n */\n function upperLookup(Trace224 storage self, uint32 key) internal view returns (uint224) {\n uint256 len = self._checkpoints.length;\n uint256 pos = _upperBinaryLookup(self._checkpoints, key, 0, len);\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\n }\n\n /**\n * @dev Returns the value in the last (most recent) checkpoint with key lower or equal than the search key, or zero\n * if there is none.\n *\n * NOTE: This is a variant of {upperLookup} that is optimised to find \"recent\" checkpoint (checkpoints with high\n * keys).\n */\n function upperLookupRecent(Trace224 storage self, uint32 key) internal view returns (uint224) {\n uint256 len = self._checkpoints.length;\n\n uint256 low = 0;\n uint256 high = len;\n\n if (len > 5) {\n uint256 mid = len - Math.sqrt(len);\n if (key < _unsafeAccess(self._checkpoints, mid)._key) {\n high = mid;\n } else {\n low = mid + 1;\n }\n }\n\n uint256 pos = _upperBinaryLookup(self._checkpoints, key, low, high);\n\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\n }\n\n /**\n * @dev Returns the value in the most recent checkpoint, or zero if there are no checkpoints.\n */\n function latest(Trace224 storage self) internal view returns (uint224) {\n uint256 pos = self._checkpoints.length;\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\n }\n\n /**\n * @dev Returns whether there is a checkpoint in the structure (i.e. it is not empty), and if so the key and value\n * in the most recent checkpoint.\n */\n function latestCheckpoint(Trace224 storage self) internal view returns (bool exists, uint32 _key, uint224 _value) {\n uint256 pos = self._checkpoints.length;\n if (pos == 0) {\n return (false, 0, 0);\n } else {\n Checkpoint224 storage ckpt = _unsafeAccess(self._checkpoints, pos - 1);\n return (true, ckpt._key, ckpt._value);\n }\n }\n\n /**\n * @dev Returns the number of checkpoint.\n */\n function length(Trace224 storage self) internal view returns (uint256) {\n return self._checkpoints.length;\n }\n\n /**\n * @dev Returns checkpoint at given position.\n */\n function at(Trace224 storage self, uint32 pos) internal view returns (Checkpoint224 memory) {\n return self._checkpoints[pos];\n }\n\n /**\n * @dev Pushes a (`key`, `value`) pair into an ordered list of checkpoints, either by inserting a new checkpoint,\n * or by updating the last one.\n */\n function _insert(\n Checkpoint224[] storage self,\n uint32 key,\n uint224 value\n ) private returns (uint224 oldValue, uint224 newValue) {\n uint256 pos = self.length;\n\n if (pos > 0) {\n Checkpoint224 storage last = _unsafeAccess(self, pos - 1);\n uint32 lastKey = last._key;\n uint224 lastValue = last._value;\n\n // Checkpoint keys must be non-decreasing.\n if (lastKey > key) {\n revert CheckpointUnorderedInsertion();\n }\n\n // Update or push new checkpoint\n if (lastKey == key) {\n last._value = value;\n } else {\n self.push(Checkpoint224({_key: key, _value: value}));\n }\n return (lastValue, value);\n } else {\n self.push(Checkpoint224({_key: key, _value: value}));\n return (0, value);\n }\n }\n\n /**\n * @dev Return the index of the first (oldest) checkpoint with key strictly bigger than the search key, or `high`\n * if there is none. `low` and `high` define a section where to do the search, with inclusive `low` and exclusive\n * `high`.\n *\n * WARNING: `high` should not be greater than the array's length.\n */\n function _upperBinaryLookup(\n Checkpoint224[] storage self,\n uint32 key,\n uint256 low,\n uint256 high\n ) private view returns (uint256) {\n while (low < high) {\n uint256 mid = Math.average(low, high);\n if (_unsafeAccess(self, mid)._key > key) {\n high = mid;\n } else {\n low = mid + 1;\n }\n }\n return high;\n }\n\n /**\n * @dev Return the index of the first (oldest) checkpoint with key greater or equal than the search key, or `high`\n * if there is none. `low` and `high` define a section where to do the search, with inclusive `low` and exclusive\n * `high`.\n *\n * WARNING: `high` should not be greater than the array's length.\n */\n function _lowerBinaryLookup(\n Checkpoint224[] storage self,\n uint32 key,\n uint256 low,\n uint256 high\n ) private view returns (uint256) {\n while (low < high) {\n uint256 mid = Math.average(low, high);\n if (_unsafeAccess(self, mid)._key < key) {\n low = mid + 1;\n } else {\n high = mid;\n }\n }\n return high;\n }\n\n /**\n * @dev Access an element of the array without performing bounds check. The position is assumed to be within bounds.\n */\n function _unsafeAccess(\n Checkpoint224[] storage self,\n uint256 pos\n ) private pure returns (Checkpoint224 storage result) {\n assembly {\n mstore(0, self.slot)\n result.slot := add(keccak256(0, 0x20), pos)\n }\n }\n\n struct Trace208 {\n Checkpoint208[] _checkpoints;\n }\n\n struct Checkpoint208 {\n uint48 _key;\n uint208 _value;\n }\n\n /**\n * @dev Pushes a (`key`, `value`) pair into a Trace208 so that it is stored as the checkpoint.\n *\n * Returns previous value and new value.\n *\n * IMPORTANT: Never accept `key` as a user input, since an arbitrary `type(uint48).max` key set will disable the\n * library.\n */\n function push(\n Trace208 storage self,\n uint48 key,\n uint208 value\n ) internal returns (uint208 oldValue, uint208 newValue) {\n return _insert(self._checkpoints, key, value);\n }\n\n /**\n * @dev Returns the value in the first (oldest) checkpoint with key greater or equal than the search key, or zero if\n * there is none.\n */\n function lowerLookup(Trace208 storage self, uint48 key) internal view returns (uint208) {\n uint256 len = self._checkpoints.length;\n uint256 pos = _lowerBinaryLookup(self._checkpoints, key, 0, len);\n return pos == len ? 0 : _unsafeAccess(self._checkpoints, pos)._value;\n }\n\n /**\n * @dev Returns the value in the last (most recent) checkpoint with key lower or equal than the search key, or zero\n * if there is none.\n */\n function upperLookup(Trace208 storage self, uint48 key) internal view returns (uint208) {\n uint256 len = self._checkpoints.length;\n uint256 pos = _upperBinaryLookup(self._checkpoints, key, 0, len);\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\n }\n\n /**\n * @dev Returns the value in the last (most recent) checkpoint with key lower or equal than the search key, or zero\n * if there is none.\n *\n * NOTE: This is a variant of {upperLookup} that is optimised to find \"recent\" checkpoint (checkpoints with high\n * keys).\n */\n function upperLookupRecent(Trace208 storage self, uint48 key) internal view returns (uint208) {\n uint256 len = self._checkpoints.length;\n\n uint256 low = 0;\n uint256 high = len;\n\n if (len > 5) {\n uint256 mid = len - Math.sqrt(len);\n if (key < _unsafeAccess(self._checkpoints, mid)._key) {\n high = mid;\n } else {\n low = mid + 1;\n }\n }\n\n uint256 pos = _upperBinaryLookup(self._checkpoints, key, low, high);\n\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\n }\n\n /**\n * @dev Returns the value in the most recent checkpoint, or zero if there are no checkpoints.\n */\n function latest(Trace208 storage self) internal view returns (uint208) {\n uint256 pos = self._checkpoints.length;\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\n }\n\n /**\n * @dev Returns whether there is a checkpoint in the structure (i.e. it is not empty), and if so the key and value\n * in the most recent checkpoint.\n */\n function latestCheckpoint(Trace208 storage self) internal view returns (bool exists, uint48 _key, uint208 _value) {\n uint256 pos = self._checkpoints.length;\n if (pos == 0) {\n return (false, 0, 0);\n } else {\n Checkpoint208 storage ckpt = _unsafeAccess(self._checkpoints, pos - 1);\n return (true, ckpt._key, ckpt._value);\n }\n }\n\n /**\n * @dev Returns the number of checkpoint.\n */\n function length(Trace208 storage self) internal view returns (uint256) {\n return self._checkpoints.length;\n }\n\n /**\n * @dev Returns checkpoint at given position.\n */\n function at(Trace208 storage self, uint32 pos) internal view returns (Checkpoint208 memory) {\n return self._checkpoints[pos];\n }\n\n /**\n * @dev Pushes a (`key`, `value`) pair into an ordered list of checkpoints, either by inserting a new checkpoint,\n * or by updating the last one.\n */\n function _insert(\n Checkpoint208[] storage self,\n uint48 key,\n uint208 value\n ) private returns (uint208 oldValue, uint208 newValue) {\n uint256 pos = self.length;\n\n if (pos > 0) {\n Checkpoint208 storage last = _unsafeAccess(self, pos - 1);\n uint48 lastKey = last._key;\n uint208 lastValue = last._value;\n\n // Checkpoint keys must be non-decreasing.\n if (lastKey > key) {\n revert CheckpointUnorderedInsertion();\n }\n\n // Update or push new checkpoint\n if (lastKey == key) {\n last._value = value;\n } else {\n self.push(Checkpoint208({_key: key, _value: value}));\n }\n return (lastValue, value);\n } else {\n self.push(Checkpoint208({_key: key, _value: value}));\n return (0, value);\n }\n }\n\n /**\n * @dev Return the index of the first (oldest) checkpoint with key strictly bigger than the search key, or `high`\n * if there is none. `low` and `high` define a section where to do the search, with inclusive `low` and exclusive\n * `high`.\n *\n * WARNING: `high` should not be greater than the array's length.\n */\n function _upperBinaryLookup(\n Checkpoint208[] storage self,\n uint48 key,\n uint256 low,\n uint256 high\n ) private view returns (uint256) {\n while (low < high) {\n uint256 mid = Math.average(low, high);\n if (_unsafeAccess(self, mid)._key > key) {\n high = mid;\n } else {\n low = mid + 1;\n }\n }\n return high;\n }\n\n /**\n * @dev Return the index of the first (oldest) checkpoint with key greater or equal than the search key, or `high`\n * if there is none. `low` and `high` define a section where to do the search, with inclusive `low` and exclusive\n * `high`.\n *\n * WARNING: `high` should not be greater than the array's length.\n */\n function _lowerBinaryLookup(\n Checkpoint208[] storage self,\n uint48 key,\n uint256 low,\n uint256 high\n ) private view returns (uint256) {\n while (low < high) {\n uint256 mid = Math.average(low, high);\n if (_unsafeAccess(self, mid)._key < key) {\n low = mid + 1;\n } else {\n high = mid;\n }\n }\n return high;\n }\n\n /**\n * @dev Access an element of the array without performing bounds check. The position is assumed to be within bounds.\n */\n function _unsafeAccess(\n Checkpoint208[] storage self,\n uint256 pos\n ) private pure returns (Checkpoint208 storage result) {\n assembly {\n mstore(0, self.slot)\n result.slot := add(keccak256(0, 0x20), pos)\n }\n }\n\n struct Trace160 {\n Checkpoint160[] _checkpoints;\n }\n\n struct Checkpoint160 {\n uint96 _key;\n uint160 _value;\n }\n\n /**\n * @dev Pushes a (`key`, `value`) pair into a Trace160 so that it is stored as the checkpoint.\n *\n * Returns previous value and new value.\n *\n * IMPORTANT: Never accept `key` as a user input, since an arbitrary `type(uint96).max` key set will disable the\n * library.\n */\n function push(\n Trace160 storage self,\n uint96 key,\n uint160 value\n ) internal returns (uint160 oldValue, uint160 newValue) {\n return _insert(self._checkpoints, key, value);\n }\n\n /**\n * @dev Returns the value in the first (oldest) checkpoint with key greater or equal than the search key, or zero if\n * there is none.\n */\n function lowerLookup(Trace160 storage self, uint96 key) internal view returns (uint160) {\n uint256 len = self._checkpoints.length;\n uint256 pos = _lowerBinaryLookup(self._checkpoints, key, 0, len);\n return pos == len ? 0 : _unsafeAccess(self._checkpoints, pos)._value;\n }\n\n /**\n * @dev Returns the value in the last (most recent) checkpoint with key lower or equal than the search key, or zero\n * if there is none.\n */\n function upperLookup(Trace160 storage self, uint96 key) internal view returns (uint160) {\n uint256 len = self._checkpoints.length;\n uint256 pos = _upperBinaryLookup(self._checkpoints, key, 0, len);\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\n }\n\n /**\n * @dev Returns the value in the last (most recent) checkpoint with key lower or equal than the search key, or zero\n * if there is none.\n *\n * NOTE: This is a variant of {upperLookup} that is optimised to find \"recent\" checkpoint (checkpoints with high\n * keys).\n */\n function upperLookupRecent(Trace160 storage self, uint96 key) internal view returns (uint160) {\n uint256 len = self._checkpoints.length;\n\n uint256 low = 0;\n uint256 high = len;\n\n if (len > 5) {\n uint256 mid = len - Math.sqrt(len);\n if (key < _unsafeAccess(self._checkpoints, mid)._key) {\n high = mid;\n } else {\n low = mid + 1;\n }\n }\n\n uint256 pos = _upperBinaryLookup(self._checkpoints, key, low, high);\n\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\n }\n\n /**\n * @dev Returns the value in the most recent checkpoint, or zero if there are no checkpoints.\n */\n function latest(Trace160 storage self) internal view returns (uint160) {\n uint256 pos = self._checkpoints.length;\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\n }\n\n /**\n * @dev Returns whether there is a checkpoint in the structure (i.e. it is not empty), and if so the key and value\n * in the most recent checkpoint.\n */\n function latestCheckpoint(Trace160 storage self) internal view returns (bool exists, uint96 _key, uint160 _value) {\n uint256 pos = self._checkpoints.length;\n if (pos == 0) {\n return (false, 0, 0);\n } else {\n Checkpoint160 storage ckpt = _unsafeAccess(self._checkpoints, pos - 1);\n return (true, ckpt._key, ckpt._value);\n }\n }\n\n /**\n * @dev Returns the number of checkpoint.\n */\n function length(Trace160 storage self) internal view returns (uint256) {\n return self._checkpoints.length;\n }\n\n /**\n * @dev Returns checkpoint at given position.\n */\n function at(Trace160 storage self, uint32 pos) internal view returns (Checkpoint160 memory) {\n return self._checkpoints[pos];\n }\n\n /**\n * @dev Pushes a (`key`, `value`) pair into an ordered list of checkpoints, either by inserting a new checkpoint,\n * or by updating the last one.\n */\n function _insert(\n Checkpoint160[] storage self,\n uint96 key,\n uint160 value\n ) private returns (uint160 oldValue, uint160 newValue) {\n uint256 pos = self.length;\n\n if (pos > 0) {\n Checkpoint160 storage last = _unsafeAccess(self, pos - 1);\n uint96 lastKey = last._key;\n uint160 lastValue = last._value;\n\n // Checkpoint keys must be non-decreasing.\n if (lastKey > key) {\n revert CheckpointUnorderedInsertion();\n }\n\n // Update or push new checkpoint\n if (lastKey == key) {\n last._value = value;\n } else {\n self.push(Checkpoint160({_key: key, _value: value}));\n }\n return (lastValue, value);\n } else {\n self.push(Checkpoint160({_key: key, _value: value}));\n return (0, value);\n }\n }\n\n /**\n * @dev Return the index of the first (oldest) checkpoint with key strictly bigger than the search key, or `high`\n * if there is none. `low` and `high` define a section where to do the search, with inclusive `low` and exclusive\n * `high`.\n *\n * WARNING: `high` should not be greater than the array's length.\n */\n function _upperBinaryLookup(\n Checkpoint160[] storage self,\n uint96 key,\n uint256 low,\n uint256 high\n ) private view returns (uint256) {\n while (low < high) {\n uint256 mid = Math.average(low, high);\n if (_unsafeAccess(self, mid)._key > key) {\n high = mid;\n } else {\n low = mid + 1;\n }\n }\n return high;\n }\n\n /**\n * @dev Return the index of the first (oldest) checkpoint with key greater or equal than the search key, or `high`\n * if there is none. `low` and `high` define a section where to do the search, with inclusive `low` and exclusive\n * `high`.\n *\n * WARNING: `high` should not be greater than the array's length.\n */\n function _lowerBinaryLookup(\n Checkpoint160[] storage self,\n uint96 key,\n uint256 low,\n uint256 high\n ) private view returns (uint256) {\n while (low < high) {\n uint256 mid = Math.average(low, high);\n if (_unsafeAccess(self, mid)._key < key) {\n low = mid + 1;\n } else {\n high = mid;\n }\n }\n return high;\n }\n\n /**\n * @dev Access an element of the array without performing bounds check. The position is assumed to be within bounds.\n */\n function _unsafeAccess(\n Checkpoint160[] storage self,\n uint256 pos\n ) private pure returns (Checkpoint160 storage result) {\n assembly {\n mstore(0, self.slot)\n result.slot := add(keccak256(0, 0x20), pos)\n }\n }\n}\n" + }, + "@openzeppelin/contracts/utils/types/Time.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/types/Time.sol)\n\npragma solidity ^0.8.20;\n\nimport {Math} from \"../math/Math.sol\";\nimport {SafeCast} from \"../math/SafeCast.sol\";\n\n/**\n * @dev This library provides helpers for manipulating time-related objects.\n *\n * It uses the following types:\n * - `uint48` for timepoints\n * - `uint32` for durations\n *\n * While the library doesn't provide specific types for timepoints and duration, it does provide:\n * - a `Delay` type to represent duration that can be programmed to change value automatically at a given point\n * - additional helper functions\n */\nlibrary Time {\n using Time for *;\n\n /**\n * @dev Get the block timestamp as a Timepoint.\n */\n function timestamp() internal view returns (uint48) {\n return SafeCast.toUint48(block.timestamp);\n }\n\n /**\n * @dev Get the block number as a Timepoint.\n */\n function blockNumber() internal view returns (uint48) {\n return SafeCast.toUint48(block.number);\n }\n\n // ==================================================== Delay =====================================================\n /**\n * @dev A `Delay` is a uint32 duration that can be programmed to change value automatically at a given point in the\n * future. The \"effect\" timepoint describes when the transitions happens from the \"old\" value to the \"new\" value.\n * This allows updating the delay applied to some operation while keeping some guarantees.\n *\n * In particular, the {update} function guarantees that if the delay is reduced, the old delay still applies for\n * some time. For example if the delay is currently 7 days to do an upgrade, the admin should not be able to set\n * the delay to 0 and upgrade immediately. If the admin wants to reduce the delay, the old delay (7 days) should\n * still apply for some time.\n *\n *\n * The `Delay` type is 112 bits long, and packs the following:\n *\n * ```\n * | [uint48]: effect date (timepoint)\n * | | [uint32]: value before (duration)\n * ↓ ↓ ↓ [uint32]: value after (duration)\n * 0xAAAAAAAAAAAABBBBBBBBCCCCCCCC\n * ```\n *\n * NOTE: The {get} and {withUpdate} functions operate using timestamps. Block number based delays are not currently\n * supported.\n */\n type Delay is uint112;\n\n /**\n * @dev Wrap a duration into a Delay to add the one-step \"update in the future\" feature\n */\n function toDelay(uint32 duration) internal pure returns (Delay) {\n return Delay.wrap(duration);\n }\n\n /**\n * @dev Get the value at a given timepoint plus the pending value and effect timepoint if there is a scheduled\n * change after this timepoint. If the effect timepoint is 0, then the pending value should not be considered.\n */\n function _getFullAt(\n Delay self,\n uint48 timepoint\n ) private pure returns (uint32 valueBefore, uint32 valueAfter, uint48 effect) {\n (valueBefore, valueAfter, effect) = self.unpack();\n return effect <= timepoint ? (valueAfter, 0, 0) : (valueBefore, valueAfter, effect);\n }\n\n /**\n * @dev Get the current value plus the pending value and effect timepoint if there is a scheduled change. If the\n * effect timepoint is 0, then the pending value should not be considered.\n */\n function getFull(Delay self) internal view returns (uint32 valueBefore, uint32 valueAfter, uint48 effect) {\n return _getFullAt(self, timestamp());\n }\n\n /**\n * @dev Get the current value.\n */\n function get(Delay self) internal view returns (uint32) {\n (uint32 delay, , ) = self.getFull();\n return delay;\n }\n\n /**\n * @dev Update a Delay object so that it takes a new duration after a timepoint that is automatically computed to\n * enforce the old delay at the moment of the update. Returns the updated Delay object and the timestamp when the\n * new delay becomes effective.\n */\n function withUpdate(\n Delay self,\n uint32 newValue,\n uint32 minSetback\n ) internal view returns (Delay updatedDelay, uint48 effect) {\n uint32 value = self.get();\n uint32 setback = uint32(Math.max(minSetback, value > newValue ? value - newValue : 0));\n effect = timestamp() + setback;\n return (pack(value, newValue, effect), effect);\n }\n\n /**\n * @dev Split a delay into its components: valueBefore, valueAfter and effect (transition timepoint).\n */\n function unpack(Delay self) internal pure returns (uint32 valueBefore, uint32 valueAfter, uint48 effect) {\n uint112 raw = Delay.unwrap(self);\n\n valueAfter = uint32(raw);\n valueBefore = uint32(raw >> 32);\n effect = uint48(raw >> 64);\n\n return (valueBefore, valueAfter, effect);\n }\n\n /**\n * @dev pack the components into a Delay object.\n */\n function pack(uint32 valueBefore, uint32 valueAfter, uint48 effect) internal pure returns (Delay) {\n return Delay.wrap((uint112(effect) << 64) | (uint112(valueBefore) << 32) | uint112(valueAfter));\n }\n}\n" + }, + "contracts/variants/crosschain/NFT.sol": { + "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity ^0.8.20;\n\nimport \"@openzeppelin/contracts/token/ERC721/ERC721.sol\";\nimport \"@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol\";\nimport \"@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol\";\nimport \"@openzeppelin/contracts/token/ERC721/extensions/ERC721Burnable.sol\";\nimport \"@openzeppelin/contracts/access/Ownable.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/EIP712.sol\";\nimport \"@openzeppelin/contracts/token/ERC721/extensions/ERC721Votes.sol\";\nimport \"./ProofHandler.sol\";\n\n/**\n * @title Cross-chain Membership NFT Contract\n * @author Web3 Hackers Collective\n * @notice Non-transferable NFT implementation for DAO membership with cross-chain capabilities\n * @dev Extends OpenZeppelin's NFT standards with cross-chain operation support and delegation\n * @custom:security-contact julien@strat.cc\n */\ncontract NFT is\n ERC721,\n ERC721Enumerable,\n ERC721URIStorage,\n ERC721Burnable,\n Ownable,\n EIP712,\n ERC721Votes\n{\n using ProofHandler for ProofHandler.ProofStorage;\n\n /// @notice Chain ID where contract was originally deployed\n uint256 public immutable home;\n\n /// @notice Next token ID to be minted\n uint256 private _nextTokenId;\n\n /// @notice Storage for proof handling\n ProofHandler.ProofStorage private _proofStorage;\n\n /// @notice Types of operations that can be synchronized across chains\n enum OperationType {\n MINT,\n BURN,\n SET_METADATA,\n DELEGATE\n }\n\n /// @notice Emitted when a membership is claimed\n /// @param tokenId The ID of the claimed token\n /// @param member The address receiving the membership\n /// @param nonce Operation sequence number\n event MembershipClaimed(uint256 indexed tokenId, address indexed member, uint256 nonce);\n\n /// @notice Emitted when a membership is revoked\n /// @param tokenId The ID of the revoked token\n /// @param member The address losing membership\n /// @param nonce Operation sequence number\n event MembershipRevoked(uint256 indexed tokenId, address indexed member, uint256 nonce);\n\n /// @notice Emitted when metadata is updated\n /// @param tokenId The ID of the updated token\n /// @param newUri The new metadata URI\n /// @param nonce Operation sequence number\n event MetadataUpdated(uint256 indexed tokenId, string newUri, uint256 nonce);\n\n /// @notice Emitted when delegation is synchronized across chains\n /// @param delegator The address delegating their voting power\n /// @param delegatee The address receiving the delegation\n /// @param nonce Operation sequence number\n event DelegationSynced(address indexed delegator, address indexed delegatee, uint256 nonce);\n\n /// @notice Restricts functions to home chain\n modifier onlyHomeChain() {\n require(block.chainid == home, \"Operation only allowed on home chain\");\n _;\n }\n\n /**\n * @notice Initializes the NFT contract\n * @param _home Chain ID where contract is considered home\n * @param initialOwner Initial contract owner\n * @param _firstMembers Array of initial member addresses\n * @param _uri Initial token URI\n * @param _name Token collection name\n * @param _symbol Token collection symbol\n */\n constructor(\n uint256 _home,\n address initialOwner,\n address[] memory _firstMembers,\n string memory _uri,\n string memory _name,\n string memory _symbol\n ) ERC721(_name, _symbol) Ownable(initialOwner) EIP712(_name, \"1\") {\n home = _home;\n for (uint i; i < _firstMembers.length; i++) {\n _govMint(_firstMembers[i], _uri);\n _delegate(_firstMembers[i], _firstMembers[i]);\n }\n }\n\n /**\n * @notice Adds a new member on home chain\n * @dev Only callable by owner (governance) on home chain\n * @param to Address to mint token to\n * @param uri Token metadata URI\n */\n function safeMint(address to, string memory uri) public onlyOwner onlyHomeChain {\n uint256 nonce = _proofStorage.incrementNonce(uint8(OperationType.MINT));\n _govMint(to, uri);\n emit MembershipClaimed(_nextTokenId - 1, to, nonce);\n }\n\n /**\n * @notice Burns token on home chain\n * @dev Only callable by owner (governance) on home chain\n * @param tokenId ID of token to burn\n */\n function govBurn(uint256 tokenId) public onlyOwner onlyHomeChain {\n uint256 nonce = _proofStorage.incrementNonce(uint8(OperationType.BURN));\n address owner = ownerOf(tokenId);\n _burn(tokenId);\n emit MembershipRevoked(tokenId, owner, nonce);\n }\n\n /**\n * @notice Updates token metadata on home chain\n * @dev Only callable by owner (governance) on home chain\n * @param tokenId ID of token to update\n * @param uri New metadata URI\n */\n function setMetadata(uint256 tokenId, string memory uri) public onlyOwner onlyHomeChain {\n uint256 nonce = _proofStorage.incrementNonce(uint8(OperationType.SET_METADATA));\n _setTokenURI(tokenId, uri);\n emit MetadataUpdated(tokenId, uri, nonce);\n }\n\n /**\n * @notice Delegates voting power to another address on home chain\n * @dev Overrides ERC721Votes delegate function to add cross-chain functionality\n * @param delegatee Address to delegate voting power to\n */\n function delegate(address delegatee) public virtual override onlyHomeChain {\n uint256 nonce = _proofStorage.incrementNonce(uint8(OperationType.DELEGATE));\n _delegate(_msgSender(), delegatee);\n emit DelegationSynced(_msgSender(), delegatee, nonce);\n }\n\n /**\n * @notice Generates proof for NFT operations\n * @dev Only callable on home chain\n * @param operationType Type of operation\n * @param params Operation parameters\n * @return Encoded proof data\n */\n function generateOperationProof(\n uint8 operationType,\n bytes memory params\n ) external view returns (bytes memory) {\n require(block.chainid == home, \"Proofs only generated on home chain\");\n uint256 nextNonce = _proofStorage.getNextNonce(operationType);\n return ProofHandler.generateProof(address(this), operationType, params, nextNonce);\n }\n\n /**\n * @notice Generates proof for delegation\n * @dev Only callable on home chain\n * @param delegator Address delegating voting power\n * @param delegatee Address receiving delegation\n * @return Encoded proof data\n */\n function generateDelegationProof(\n address delegator,\n address delegatee\n ) external view returns (bytes memory) {\n require(block.chainid == home, \"Proofs only generated on home chain\");\n uint256 nextNonce = _proofStorage.getNextNonce(uint8(OperationType.DELEGATE));\n bytes memory params = abi.encode(delegator, delegatee);\n return\n ProofHandler.generateProof(\n address(this),\n uint8(OperationType.DELEGATE),\n params,\n nextNonce\n );\n }\n\n // Claim operations\n\n /**\n * @notice Claims an NFT operation on a foreign chain\n * @param proof Proof generated by home chain\n */\n function claimOperation(bytes memory proof) external {\n (uint8 operationType, bytes memory params, uint256 nonce) = ProofHandler\n .verifyAndClaimProof(proof, address(this), _proofStorage);\n\n if (operationType == uint8(OperationType.MINT)) {\n (address to, string memory uri) = abi.decode(params, (address, string));\n _govMint(to, uri);\n emit MembershipClaimed(_nextTokenId - 1, to, nonce);\n } else if (operationType == uint8(OperationType.BURN)) {\n uint256 tokenId = abi.decode(params, (uint256));\n address owner = ownerOf(tokenId);\n _burn(tokenId);\n emit MembershipRevoked(tokenId, owner, nonce);\n } else if (operationType == uint8(OperationType.SET_METADATA)) {\n (uint256 tokenId, string memory uri) = abi.decode(params, (uint256, string));\n _setTokenURI(tokenId, uri);\n emit MetadataUpdated(tokenId, uri, nonce);\n } else if (operationType == uint8(OperationType.DELEGATE)) {\n (address delegator, address delegatee) = abi.decode(params, (address, address));\n _delegate(delegator, delegatee);\n emit DelegationSynced(delegator, delegatee, nonce);\n }\n }\n\n /**\n * @notice Claims a delegation operation on a foreign chain\n * @param proof Proof generated by home chain\n */\n function claimDelegation(bytes memory proof) external {\n (uint8 operationType, bytes memory params, uint256 nonce) = ProofHandler\n .verifyAndClaimProof(proof, address(this), _proofStorage);\n\n require(operationType == uint8(OperationType.DELEGATE), \"Invalid operation type\");\n (address delegator, address delegatee) = abi.decode(params, (address, address));\n\n _delegate(delegator, delegatee);\n emit DelegationSynced(delegator, delegatee, nonce);\n }\n\n /**\n * @notice Internal function for minting without proof verification\n * @param to Address to receive token\n * @param uri Token metadata URI\n */\n function _govMint(address to, string memory uri) internal {\n uint256 tokenId = _nextTokenId++;\n _safeMint(to, tokenId);\n _setTokenURI(tokenId, uri);\n _delegate(to, to);\n }\n\n // Required overrides\n\n /**\n * @notice Updates token data\n * @dev Overrides ERC721 _update to make NFTs non-transferable\n * @param to Recipient address\n * @param tokenId Token ID\n * @param auth Address authorized for transfer\n * @return Previous owner address\n */\n function _update(\n address to,\n uint256 tokenId,\n address auth\n ) internal override(ERC721, ERC721Enumerable, ERC721Votes) returns (address) {\n require(auth == address(0) || to == address(0), \"NFT is not transferable\");\n return super._update(to, tokenId, auth);\n }\n\n /**\n * @notice Increments account balance\n * @dev Internal override to maintain compatibility\n * @param account Account to update\n * @param value Amount to increase by\n */\n function _increaseBalance(\n address account,\n uint128 value\n ) internal override(ERC721, ERC721Enumerable, ERC721Votes) {\n super._increaseBalance(account, value);\n }\n\n /**\n * @notice Gets token URI\n * @param tokenId Token ID to query\n * @return URI string\n */\n function tokenURI(\n uint256 tokenId\n ) public view override(ERC721, ERC721URIStorage) returns (string memory) {\n return super.tokenURI(tokenId);\n }\n\n /**\n * @notice Checks interface support\n * @param interfaceId Interface identifier to check\n * @return bool True if interface is supported\n */\n function supportsInterface(\n bytes4 interfaceId\n ) public view override(ERC721, ERC721Enumerable, ERC721URIStorage) returns (bool) {\n return super.supportsInterface(interfaceId);\n }\n\n /**\n * @notice Gets current timestamp\n * @dev Used for voting snapshots\n * @return Current block timestamp\n */\n function clock() public view override returns (uint48) {\n return uint48(block.timestamp);\n }\n\n /**\n * @notice Gets clock mode description\n * @return String indicating timestamp-based voting\n */\n function CLOCK_MODE() public pure override returns (string memory) {\n return \"mode=timestamp\";\n }\n}\n" + }, + "contracts/variants/crosschain/ProofHandler.sol": { + "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity ^0.8.20;\n\n/**\n * @title Proof Handler Library\n * @author Web3 Hackers Collective\n * @notice Library for standardized cross-chain proof generation and verification\n * @dev Handles proof generation, verification, and tracking for cross-chain operations\n * @custom:security-contact julien@strat.cc\n */\nlibrary ProofHandler {\n /// @notice Tracks which proofs have been applied on each chain\n struct ProofStorage {\n mapping(bytes32 => bool) updateAppliedOnChain;\n mapping(uint8 => uint256) currentNonce;\n }\n\n /// @dev Emitted when a proof is claimed\n event ProofClaimed(uint8 indexed operationType, bytes params, uint256 nonce);\n\n /**\n * @notice Generates a proof for cross-chain operations\n * @param contractAddress Address of contract generating the proof\n * @param operationType Type of operation being performed\n * @param params Operation parameters\n * @param nonce Current nonce for this operation type\n * @return proof Encoded proof data\n */\n function generateProof(\n address contractAddress,\n uint8 operationType,\n bytes memory params,\n uint256 nonce\n ) public pure returns (bytes memory proof) {\n bytes32 message = keccak256(\n abi.encodePacked(contractAddress, operationType, params, nonce)\n );\n bytes32 digest = keccak256(abi.encodePacked(\"\\x19Ethereum Signed Message:\\n32\", message));\n\n return abi.encode(operationType, params, nonce, digest);\n }\n\n /**\n * @notice Verifies and claims a proof\n * @param proof Proof to verify and claim\n * @param contractAddress Address of contract claiming the proof\n * @param storage_ Proof storage struct\n * @return operationType The type of operation being performed\n * @return params The operation parameters\n * @return nonce The operation sequence number\n */\n function verifyAndClaimProof(\n bytes memory proof,\n address contractAddress,\n ProofStorage storage storage_\n ) public returns (uint8 operationType, bytes memory params, uint256 nonce) {\n bytes32 digest;\n (operationType, params, nonce, digest) = abi.decode(\n proof,\n (uint8, bytes, uint256, bytes32)\n );\n\n bytes32 proofHash = keccak256(proof);\n require(!storage_.updateAppliedOnChain[proofHash], \"Proof already claimed\");\n require(nonce == storage_.currentNonce[operationType] + 1, \"Invalid nonce\");\n\n bytes32 message = keccak256(\n abi.encodePacked(contractAddress, operationType, params, nonce)\n );\n bytes32 expectedDigest = keccak256(\n abi.encodePacked(\"\\x19Ethereum Signed Message:\\n32\", message)\n );\n require(digest == expectedDigest, \"Invalid proof\");\n\n storage_.updateAppliedOnChain[proofHash] = true;\n storage_.currentNonce[operationType] = nonce;\n\n emit ProofClaimed(operationType, params, nonce);\n\n return (operationType, params, nonce);\n }\n\n /**\n * @notice Gets the next nonce for an operation type\n * @param storage_ Proof storage struct\n * @param operationType Type of operation\n * @return nonce Next nonce value\n */\n function getNextNonce(\n ProofStorage storage storage_,\n uint8 operationType\n ) public view returns (uint256 nonce) {\n return storage_.currentNonce[operationType] + 1;\n }\n\n /**\n * @notice Increments the nonce for an operation type\n * @param storage_ Proof storage struct\n * @param operationType Type of operation\n * @return nonce New nonce value\n */\n function incrementNonce(\n ProofStorage storage storage_,\n uint8 operationType\n ) public returns (uint256 nonce) {\n storage_.currentNonce[operationType]++;\n return storage_.currentNonce[operationType];\n }\n}\n" + } + }, + "settings": { + "optimizer": { + "enabled": true, + "runs": 200 + }, + "evmVersion": "paris", + "outputSelection": { + "*": { + "*": [ + "abi", + "evm.bytecode", + "evm.deployedBytecode", + "evm.methodIdentifiers", + "metadata", + "devdoc", + "userdoc", + "storageLayout", + "evm.gasEstimates" + ], + "": [ + "ast" + ] + } + }, + "metadata": { + "useLiteralContent": true + } + } +} \ No newline at end of file diff --git a/deployments/baseSepolia/.chainId b/deployments/baseSepolia/.chainId new file mode 100644 index 0000000..667f99d --- /dev/null +++ b/deployments/baseSepolia/.chainId @@ -0,0 +1 @@ +84532 \ No newline at end of file diff --git a/deployments/baseSepolia/CrosschainGov.json b/deployments/baseSepolia/CrosschainGov.json new file mode 100644 index 0000000..94e470b --- /dev/null +++ b/deployments/baseSepolia/CrosschainGov.json @@ -0,0 +1,2520 @@ +{ + "address": "0x3F92DdC0c99d9B873C424f4066F252adb72192D9", + "abi": [ + { + "inputs": [ + { + "internalType": "uint256", + "name": "_home", + "type": "uint256" + }, + { + "internalType": "contract IVotes", + "name": "_token", + "type": "address" + }, + { + "internalType": "string", + "name": "_manifestoCid", + "type": "string" + }, + { + "internalType": "string", + "name": "_name", + "type": "string" + }, + { + "internalType": "uint48", + "name": "_votingDelay", + "type": "uint48" + }, + { + "internalType": "uint32", + "name": "_votingPeriod", + "type": "uint32" + }, + { + "internalType": "uint256", + "name": "_proposalThreshold", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_quorum", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [], + "name": "CheckpointUnorderedInsertion", + "type": "error" + }, + { + "inputs": [], + "name": "FailedCall", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "voter", + "type": "address" + } + ], + "name": "GovernorAlreadyCastVote", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "proposalId", + "type": "uint256" + } + ], + "name": "GovernorAlreadyQueuedProposal", + "type": "error" + }, + { + "inputs": [], + "name": "GovernorDisabledDeposit", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "proposer", + "type": "address" + }, + { + "internalType": "uint256", + "name": "votes", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "threshold", + "type": "uint256" + } + ], + "name": "GovernorInsufficientProposerVotes", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "targets", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "calldatas", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "values", + "type": "uint256" + } + ], + "name": "GovernorInvalidProposalLength", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "quorumNumerator", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "quorumDenominator", + "type": "uint256" + } + ], + "name": "GovernorInvalidQuorumFraction", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "voter", + "type": "address" + } + ], + "name": "GovernorInvalidSignature", + "type": "error" + }, + { + "inputs": [], + "name": "GovernorInvalidVoteParams", + "type": "error" + }, + { + "inputs": [], + "name": "GovernorInvalidVoteType", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "votingPeriod", + "type": "uint256" + } + ], + "name": "GovernorInvalidVotingPeriod", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "proposalId", + "type": "uint256" + } + ], + "name": "GovernorNonexistentProposal", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "proposalId", + "type": "uint256" + } + ], + "name": "GovernorNotQueuedProposal", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "GovernorOnlyExecutor", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "GovernorOnlyProposer", + "type": "error" + }, + { + "inputs": [], + "name": "GovernorQueueNotImplemented", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "proposer", + "type": "address" + } + ], + "name": "GovernorRestrictedProposer", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "proposalId", + "type": "uint256" + }, + { + "internalType": "enum IGovernor.ProposalState", + "name": "current", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "expectedStates", + "type": "bytes32" + } + ], + "name": "GovernorUnexpectedProposalState", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "currentNonce", + "type": "uint256" + } + ], + "name": "InvalidAccountNonce", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidShortString", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint8", + "name": "bits", + "type": "uint8" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "SafeCastOverflowedUintDowncast", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "str", + "type": "string" + } + ], + "name": "StringTooLong", + "type": "error" + }, + { + "anonymous": false, + "inputs": [], + "name": "EIP712DomainChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "enum Gov.OperationType", + "name": "operationType", + "type": "uint8" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "oldValue", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newValue", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + } + ], + "name": "GovernanceParameterUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "string", + "name": "oldManifesto", + "type": "string" + }, + { + "indexed": false, + "internalType": "string", + "name": "newManifesto", + "type": "string" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + } + ], + "name": "ManifestoUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "proposalId", + "type": "uint256" + } + ], + "name": "ProposalCanceled", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "proposalId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "address", + "name": "proposer", + "type": "address" + }, + { + "indexed": false, + "internalType": "address[]", + "name": "targets", + "type": "address[]" + }, + { + "indexed": false, + "internalType": "uint256[]", + "name": "values", + "type": "uint256[]" + }, + { + "indexed": false, + "internalType": "string[]", + "name": "signatures", + "type": "string[]" + }, + { + "indexed": false, + "internalType": "bytes[]", + "name": "calldatas", + "type": "bytes[]" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "voteStart", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "voteEnd", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "string", + "name": "description", + "type": "string" + } + ], + "name": "ProposalCreated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "proposalId", + "type": "uint256" + } + ], + "name": "ProposalExecuted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "proposalId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "etaSeconds", + "type": "uint256" + } + ], + "name": "ProposalQueued", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "oldProposalThreshold", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newProposalThreshold", + "type": "uint256" + } + ], + "name": "ProposalThresholdSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "oldQuorumNumerator", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newQuorumNumerator", + "type": "uint256" + } + ], + "name": "QuorumNumeratorUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "voter", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "proposalId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint8", + "name": "support", + "type": "uint8" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "weight", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "string", + "name": "reason", + "type": "string" + } + ], + "name": "VoteCast", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "voter", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "proposalId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint8", + "name": "support", + "type": "uint8" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "weight", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "string", + "name": "reason", + "type": "string" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "params", + "type": "bytes" + } + ], + "name": "VoteCastWithParams", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "oldVotingDelay", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newVotingDelay", + "type": "uint256" + } + ], + "name": "VotingDelaySet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "oldVotingPeriod", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newVotingPeriod", + "type": "uint256" + } + ], + "name": "VotingPeriodSet", + "type": "event" + }, + { + "inputs": [], + "name": "BALLOT_TYPEHASH", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "CLOCK_MODE", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "COUNTING_MODE", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [], + "name": "EXTENDED_BALLOT_TYPEHASH", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "targets", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "values", + "type": "uint256[]" + }, + { + "internalType": "bytes[]", + "name": "calldatas", + "type": "bytes[]" + }, + { + "internalType": "bytes32", + "name": "descriptionHash", + "type": "bytes32" + } + ], + "name": "cancel", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "proposalId", + "type": "uint256" + }, + { + "internalType": "uint8", + "name": "support", + "type": "uint8" + } + ], + "name": "castVote", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "proposalId", + "type": "uint256" + }, + { + "internalType": "uint8", + "name": "support", + "type": "uint8" + }, + { + "internalType": "address", + "name": "voter", + "type": "address" + }, + { + "internalType": "bytes", + "name": "signature", + "type": "bytes" + } + ], + "name": "castVoteBySig", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "proposalId", + "type": "uint256" + }, + { + "internalType": "uint8", + "name": "support", + "type": "uint8" + }, + { + "internalType": "string", + "name": "reason", + "type": "string" + } + ], + "name": "castVoteWithReason", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "proposalId", + "type": "uint256" + }, + { + "internalType": "uint8", + "name": "support", + "type": "uint8" + }, + { + "internalType": "string", + "name": "reason", + "type": "string" + }, + { + "internalType": "bytes", + "name": "params", + "type": "bytes" + } + ], + "name": "castVoteWithReasonAndParams", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "proposalId", + "type": "uint256" + }, + { + "internalType": "uint8", + "name": "support", + "type": "uint8" + }, + { + "internalType": "address", + "name": "voter", + "type": "address" + }, + { + "internalType": "string", + "name": "reason", + "type": "string" + }, + { + "internalType": "bytes", + "name": "params", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "signature", + "type": "bytes" + } + ], + "name": "castVoteWithReasonAndParamsBySig", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "proof", + "type": "bytes" + } + ], + "name": "claimParameterUpdate", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "clock", + "outputs": [ + { + "internalType": "uint48", + "name": "", + "type": "uint48" + } + ], + "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": [ + { + "internalType": "address[]", + "name": "targets", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "values", + "type": "uint256[]" + }, + { + "internalType": "bytes[]", + "name": "calldatas", + "type": "bytes[]" + }, + { + "internalType": "bytes32", + "name": "descriptionHash", + "type": "bytes32" + } + ], + "name": "execute", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint8", + "name": "operationType", + "type": "uint8" + }, + { + "internalType": "bytes", + "name": "value", + "type": "bytes" + } + ], + "name": "generateParameterProof", + "outputs": [ + { + "internalType": "bytes", + "name": "proof", + "type": "bytes" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "timepoint", + "type": "uint256" + } + ], + "name": "getVotes", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "timepoint", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "params", + "type": "bytes" + } + ], + "name": "getVotesWithParams", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "proposalId", + "type": "uint256" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "hasVoted", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "targets", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "values", + "type": "uint256[]" + }, + { + "internalType": "bytes[]", + "name": "calldatas", + "type": "bytes[]" + }, + { + "internalType": "bytes32", + "name": "descriptionHash", + "type": "bytes32" + } + ], + "name": "hashProposal", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [], + "name": "home", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "manifesto", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "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": "", + "type": "address" + }, + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "uint256[]", + "name": "", + "type": "uint256[]" + }, + { + "internalType": "uint256[]", + "name": "", + "type": "uint256[]" + }, + { + "internalType": "bytes", + "name": "", + "type": "bytes" + } + ], + "name": "onERC1155BatchReceived", + "outputs": [ + { + "internalType": "bytes4", + "name": "", + "type": "bytes4" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "", + "type": "bytes" + } + ], + "name": "onERC1155Received", + "outputs": [ + { + "internalType": "bytes4", + "name": "", + "type": "bytes4" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "", + "type": "bytes" + } + ], + "name": "onERC721Received", + "outputs": [ + { + "internalType": "bytes4", + "name": "", + "type": "bytes4" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "proposalId", + "type": "uint256" + } + ], + "name": "proposalDeadline", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "proposalId", + "type": "uint256" + } + ], + "name": "proposalEta", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "proposalNeedsQueuing", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "proposalId", + "type": "uint256" + } + ], + "name": "proposalProposer", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "proposalId", + "type": "uint256" + } + ], + "name": "proposalSnapshot", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "proposalThreshold", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "proposalId", + "type": "uint256" + } + ], + "name": "proposalVotes", + "outputs": [ + { + "internalType": "uint256", + "name": "againstVotes", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "forVotes", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "abstainVotes", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "targets", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "values", + "type": "uint256[]" + }, + { + "internalType": "bytes[]", + "name": "calldatas", + "type": "bytes[]" + }, + { + "internalType": "string", + "name": "description", + "type": "string" + } + ], + "name": "propose", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "targets", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "values", + "type": "uint256[]" + }, + { + "internalType": "bytes[]", + "name": "calldatas", + "type": "bytes[]" + }, + { + "internalType": "bytes32", + "name": "descriptionHash", + "type": "bytes32" + } + ], + "name": "queue", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "blockNumber", + "type": "uint256" + } + ], + "name": "quorum", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "quorumDenominator", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "timepoint", + "type": "uint256" + } + ], + "name": "quorumNumerator", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "quorumNumerator", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "target", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "relay", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "newManifesto", + "type": "string" + } + ], + "name": "setManifesto", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "newProposalThreshold", + "type": "uint256" + } + ], + "name": "setProposalThreshold", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint48", + "name": "newVotingDelay", + "type": "uint48" + } + ], + "name": "setVotingDelay", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "newVotingPeriod", + "type": "uint32" + } + ], + "name": "setVotingPeriod", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "proposalId", + "type": "uint256" + } + ], + "name": "state", + "outputs": [ + { + "internalType": "enum IGovernor.ProposalState", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "interfaceId", + "type": "bytes4" + } + ], + "name": "supportsInterface", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "token", + "outputs": [ + { + "internalType": "contract IERC5805", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "newQuorumNumerator", + "type": "uint256" + } + ], + "name": "updateQuorumNumerator", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "version", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "votingDelay", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "votingPeriod", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "stateMutability": "payable", + "type": "receive" + } + ], + "args": [ + 11155111, + "0x8583CEbA0d2C5cAe1a1BCff975Faa97063D14953", + "https://bafkreifnnreoxxgkhty7v2w3qwiie6cfxpv3vcco2xldekfvbiem3nm6dm.ipfs.w3s.link/", + "Test DAO", + 0, + 200, + 1, + 5 + ], + "numDeployments": 1, + "solcInputHash": "77ec5f062950e8c4875fd27ffb65d267", + "metadata": "{\"compiler\":{\"version\":\"0.8.20+commit.a1b79de6\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_home\",\"type\":\"uint256\"},{\"internalType\":\"contract IVotes\",\"name\":\"_token\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"_manifestoCid\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"_name\",\"type\":\"string\"},{\"internalType\":\"uint48\",\"name\":\"_votingDelay\",\"type\":\"uint48\"},{\"internalType\":\"uint32\",\"name\":\"_votingPeriod\",\"type\":\"uint32\"},{\"internalType\":\"uint256\",\"name\":\"_proposalThreshold\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_quorum\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"CheckpointUnorderedInsertion\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"FailedCall\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"voter\",\"type\":\"address\"}],\"name\":\"GovernorAlreadyCastVote\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"proposalId\",\"type\":\"uint256\"}],\"name\":\"GovernorAlreadyQueuedProposal\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"GovernorDisabledDeposit\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"proposer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"votes\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"threshold\",\"type\":\"uint256\"}],\"name\":\"GovernorInsufficientProposerVotes\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"targets\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"calldatas\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"values\",\"type\":\"uint256\"}],\"name\":\"GovernorInvalidProposalLength\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"quorumNumerator\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"quorumDenominator\",\"type\":\"uint256\"}],\"name\":\"GovernorInvalidQuorumFraction\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"voter\",\"type\":\"address\"}],\"name\":\"GovernorInvalidSignature\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"GovernorInvalidVoteParams\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"GovernorInvalidVoteType\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"votingPeriod\",\"type\":\"uint256\"}],\"name\":\"GovernorInvalidVotingPeriod\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"proposalId\",\"type\":\"uint256\"}],\"name\":\"GovernorNonexistentProposal\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"proposalId\",\"type\":\"uint256\"}],\"name\":\"GovernorNotQueuedProposal\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"GovernorOnlyExecutor\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"GovernorOnlyProposer\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"GovernorQueueNotImplemented\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"proposer\",\"type\":\"address\"}],\"name\":\"GovernorRestrictedProposer\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"proposalId\",\"type\":\"uint256\"},{\"internalType\":\"enum IGovernor.ProposalState\",\"name\":\"current\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"expectedStates\",\"type\":\"bytes32\"}],\"name\":\"GovernorUnexpectedProposalState\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"currentNonce\",\"type\":\"uint256\"}],\"name\":\"InvalidAccountNonce\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidShortString\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint8\",\"name\":\"bits\",\"type\":\"uint8\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"SafeCastOverflowedUintDowncast\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"str\",\"type\":\"string\"}],\"name\":\"StringTooLong\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[],\"name\":\"EIP712DomainChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"enum Gov.OperationType\",\"name\":\"operationType\",\"type\":\"uint8\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"oldValue\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newValue\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"}],\"name\":\"GovernanceParameterUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"string\",\"name\":\"oldManifesto\",\"type\":\"string\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"newManifesto\",\"type\":\"string\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"}],\"name\":\"ManifestoUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"proposalId\",\"type\":\"uint256\"}],\"name\":\"ProposalCanceled\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"proposalId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"proposer\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address[]\",\"name\":\"targets\",\"type\":\"address[]\"},{\"indexed\":false,\"internalType\":\"uint256[]\",\"name\":\"values\",\"type\":\"uint256[]\"},{\"indexed\":false,\"internalType\":\"string[]\",\"name\":\"signatures\",\"type\":\"string[]\"},{\"indexed\":false,\"internalType\":\"bytes[]\",\"name\":\"calldatas\",\"type\":\"bytes[]\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"voteStart\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"voteEnd\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"description\",\"type\":\"string\"}],\"name\":\"ProposalCreated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"proposalId\",\"type\":\"uint256\"}],\"name\":\"ProposalExecuted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"proposalId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"etaSeconds\",\"type\":\"uint256\"}],\"name\":\"ProposalQueued\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"oldProposalThreshold\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newProposalThreshold\",\"type\":\"uint256\"}],\"name\":\"ProposalThresholdSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"oldQuorumNumerator\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newQuorumNumerator\",\"type\":\"uint256\"}],\"name\":\"QuorumNumeratorUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"voter\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"proposalId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"support\",\"type\":\"uint8\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"weight\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"reason\",\"type\":\"string\"}],\"name\":\"VoteCast\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"voter\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"proposalId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"support\",\"type\":\"uint8\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"weight\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"reason\",\"type\":\"string\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"params\",\"type\":\"bytes\"}],\"name\":\"VoteCastWithParams\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"oldVotingDelay\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newVotingDelay\",\"type\":\"uint256\"}],\"name\":\"VotingDelaySet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"oldVotingPeriod\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newVotingPeriod\",\"type\":\"uint256\"}],\"name\":\"VotingPeriodSet\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"BALLOT_TYPEHASH\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"CLOCK_MODE\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"COUNTING_MODE\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"EXTENDED_BALLOT_TYPEHASH\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"targets\",\"type\":\"address[]\"},{\"internalType\":\"uint256[]\",\"name\":\"values\",\"type\":\"uint256[]\"},{\"internalType\":\"bytes[]\",\"name\":\"calldatas\",\"type\":\"bytes[]\"},{\"internalType\":\"bytes32\",\"name\":\"descriptionHash\",\"type\":\"bytes32\"}],\"name\":\"cancel\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"proposalId\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"support\",\"type\":\"uint8\"}],\"name\":\"castVote\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"proposalId\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"support\",\"type\":\"uint8\"},{\"internalType\":\"address\",\"name\":\"voter\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"signature\",\"type\":\"bytes\"}],\"name\":\"castVoteBySig\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"proposalId\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"support\",\"type\":\"uint8\"},{\"internalType\":\"string\",\"name\":\"reason\",\"type\":\"string\"}],\"name\":\"castVoteWithReason\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"proposalId\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"support\",\"type\":\"uint8\"},{\"internalType\":\"string\",\"name\":\"reason\",\"type\":\"string\"},{\"internalType\":\"bytes\",\"name\":\"params\",\"type\":\"bytes\"}],\"name\":\"castVoteWithReasonAndParams\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"proposalId\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"support\",\"type\":\"uint8\"},{\"internalType\":\"address\",\"name\":\"voter\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"reason\",\"type\":\"string\"},{\"internalType\":\"bytes\",\"name\":\"params\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"signature\",\"type\":\"bytes\"}],\"name\":\"castVoteWithReasonAndParamsBySig\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"proof\",\"type\":\"bytes\"}],\"name\":\"claimParameterUpdate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"clock\",\"outputs\":[{\"internalType\":\"uint48\",\"name\":\"\",\"type\":\"uint48\"}],\"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\":[{\"internalType\":\"address[]\",\"name\":\"targets\",\"type\":\"address[]\"},{\"internalType\":\"uint256[]\",\"name\":\"values\",\"type\":\"uint256[]\"},{\"internalType\":\"bytes[]\",\"name\":\"calldatas\",\"type\":\"bytes[]\"},{\"internalType\":\"bytes32\",\"name\":\"descriptionHash\",\"type\":\"bytes32\"}],\"name\":\"execute\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint8\",\"name\":\"operationType\",\"type\":\"uint8\"},{\"internalType\":\"bytes\",\"name\":\"value\",\"type\":\"bytes\"}],\"name\":\"generateParameterProof\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"proof\",\"type\":\"bytes\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"timepoint\",\"type\":\"uint256\"}],\"name\":\"getVotes\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"timepoint\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"params\",\"type\":\"bytes\"}],\"name\":\"getVotesWithParams\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"proposalId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"hasVoted\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"targets\",\"type\":\"address[]\"},{\"internalType\":\"uint256[]\",\"name\":\"values\",\"type\":\"uint256[]\"},{\"internalType\":\"bytes[]\",\"name\":\"calldatas\",\"type\":\"bytes[]\"},{\"internalType\":\"bytes32\",\"name\":\"descriptionHash\",\"type\":\"bytes32\"}],\"name\":\"hashProposal\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"home\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"manifesto\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"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\":\"\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"uint256[]\",\"name\":\"\",\"type\":\"uint256[]\"},{\"internalType\":\"uint256[]\",\"name\":\"\",\"type\":\"uint256[]\"},{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"name\":\"onERC1155BatchReceived\",\"outputs\":[{\"internalType\":\"bytes4\",\"name\":\"\",\"type\":\"bytes4\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"name\":\"onERC1155Received\",\"outputs\":[{\"internalType\":\"bytes4\",\"name\":\"\",\"type\":\"bytes4\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"name\":\"onERC721Received\",\"outputs\":[{\"internalType\":\"bytes4\",\"name\":\"\",\"type\":\"bytes4\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"proposalId\",\"type\":\"uint256\"}],\"name\":\"proposalDeadline\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"proposalId\",\"type\":\"uint256\"}],\"name\":\"proposalEta\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"proposalNeedsQueuing\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"proposalId\",\"type\":\"uint256\"}],\"name\":\"proposalProposer\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"proposalId\",\"type\":\"uint256\"}],\"name\":\"proposalSnapshot\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"proposalThreshold\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"proposalId\",\"type\":\"uint256\"}],\"name\":\"proposalVotes\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"againstVotes\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"forVotes\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"abstainVotes\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"targets\",\"type\":\"address[]\"},{\"internalType\":\"uint256[]\",\"name\":\"values\",\"type\":\"uint256[]\"},{\"internalType\":\"bytes[]\",\"name\":\"calldatas\",\"type\":\"bytes[]\"},{\"internalType\":\"string\",\"name\":\"description\",\"type\":\"string\"}],\"name\":\"propose\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"targets\",\"type\":\"address[]\"},{\"internalType\":\"uint256[]\",\"name\":\"values\",\"type\":\"uint256[]\"},{\"internalType\":\"bytes[]\",\"name\":\"calldatas\",\"type\":\"bytes[]\"},{\"internalType\":\"bytes32\",\"name\":\"descriptionHash\",\"type\":\"bytes32\"}],\"name\":\"queue\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"blockNumber\",\"type\":\"uint256\"}],\"name\":\"quorum\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"quorumDenominator\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"timepoint\",\"type\":\"uint256\"}],\"name\":\"quorumNumerator\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"quorumNumerator\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"target\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"relay\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"newManifesto\",\"type\":\"string\"}],\"name\":\"setManifesto\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"newProposalThreshold\",\"type\":\"uint256\"}],\"name\":\"setProposalThreshold\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint48\",\"name\":\"newVotingDelay\",\"type\":\"uint48\"}],\"name\":\"setVotingDelay\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"newVotingPeriod\",\"type\":\"uint32\"}],\"name\":\"setVotingPeriod\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"proposalId\",\"type\":\"uint256\"}],\"name\":\"state\",\"outputs\":[{\"internalType\":\"enum IGovernor.ProposalState\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"interfaceId\",\"type\":\"bytes4\"}],\"name\":\"supportsInterface\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"token\",\"outputs\":[{\"internalType\":\"contract IERC5805\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"newQuorumNumerator\",\"type\":\"uint256\"}],\"name\":\"updateQuorumNumerator\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"version\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"votingDelay\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"votingPeriod\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"author\":\"Web3 Hackers Collective\",\"custom:security-contact\":\"julien@strat.cc\",\"details\":\"Extends OpenZeppelin's Governor contract with cross-chain parameter updates\",\"errors\":{\"CheckpointUnorderedInsertion()\":[{\"details\":\"A value was attempted to be inserted on a past checkpoint.\"}],\"FailedCall()\":[{\"details\":\"A call to an address target failed. The target may have reverted.\"}],\"GovernorAlreadyCastVote(address)\":[{\"details\":\"The vote was already cast.\"}],\"GovernorAlreadyQueuedProposal(uint256)\":[{\"details\":\"The proposal has already been queued.\"}],\"GovernorDisabledDeposit()\":[{\"details\":\"Token deposits are disabled in this contract.\"}],\"GovernorInsufficientProposerVotes(address,uint256,uint256)\":[{\"details\":\"The `proposer` does not have the required votes to create a proposal.\"}],\"GovernorInvalidProposalLength(uint256,uint256,uint256)\":[{\"details\":\"Empty proposal or a mismatch between the parameters length for a proposal call.\"}],\"GovernorInvalidQuorumFraction(uint256,uint256)\":[{\"details\":\"The quorum set is not a valid fraction.\"}],\"GovernorInvalidSignature(address)\":[{\"details\":\"The provided signature is not valid for the expected `voter`. If the `voter` is a contract, the signature is not valid using {IERC1271-isValidSignature}.\"}],\"GovernorInvalidVoteParams()\":[{\"details\":\"The provided params buffer is not supported by the counting module.\"}],\"GovernorInvalidVoteType()\":[{\"details\":\"The vote type used is not valid for the corresponding counting module.\"}],\"GovernorInvalidVotingPeriod(uint256)\":[{\"details\":\"The voting period set is not a valid period.\"}],\"GovernorNonexistentProposal(uint256)\":[{\"details\":\"The `proposalId` doesn't exist.\"}],\"GovernorNotQueuedProposal(uint256)\":[{\"details\":\"The proposal hasn't been queued yet.\"}],\"GovernorOnlyExecutor(address)\":[{\"details\":\"The `account` is not the governance executor.\"}],\"GovernorOnlyProposer(address)\":[{\"details\":\"The `account` is not a proposer.\"}],\"GovernorQueueNotImplemented()\":[{\"details\":\"Queue operation is not implemented for this governor. Execute should be called directly.\"}],\"GovernorRestrictedProposer(address)\":[{\"details\":\"The `proposer` is not allowed to create a proposal.\"}],\"GovernorUnexpectedProposalState(uint256,uint8,bytes32)\":[{\"details\":\"The current state of a proposal is not the required for performing an operation. The `expectedStates` is a bitmap with the bits enabled for each ProposalState enum position counting from right to left. NOTE: If `expectedState` is `bytes32(0)`, the proposal is expected to not be in any state (i.e. not exist). This is the case when a proposal that is expected to be unset is already initiated (the proposal is duplicated). See {Governor-_encodeStateBitmap}.\"}],\"InvalidAccountNonce(address,uint256)\":[{\"details\":\"The nonce used for an `account` is not the expected current nonce.\"}],\"SafeCastOverflowedUintDowncast(uint8,uint256)\":[{\"details\":\"Value doesn't fit in an uint of `bits` size.\"}]},\"events\":{\"EIP712DomainChanged()\":{\"details\":\"MAY be emitted to signal that the domain could have changed.\"},\"GovernanceParameterUpdated(uint8,uint256,uint256,uint256)\":{\"params\":{\"newValue\":\"New value\",\"nonce\":\"Update sequence number\",\"oldValue\":\"Previous value\",\"operationType\":\"Type of parameter updated\"}},\"ManifestoUpdated(string,string,uint256)\":{\"params\":{\"newManifesto\":\"New manifesto CID\",\"nonce\":\"Update sequence number\",\"oldManifesto\":\"Previous manifesto CID\"}},\"ProposalCanceled(uint256)\":{\"details\":\"Emitted when a proposal is canceled.\"},\"ProposalCreated(uint256,address,address[],uint256[],string[],bytes[],uint256,uint256,string)\":{\"details\":\"Emitted when a proposal is created.\"},\"ProposalExecuted(uint256)\":{\"details\":\"Emitted when a proposal is executed.\"},\"ProposalQueued(uint256,uint256)\":{\"details\":\"Emitted when a proposal is queued.\"},\"VoteCast(address,uint256,uint8,uint256,string)\":{\"details\":\"Emitted when a vote is cast without params. Note: `support` values should be seen as buckets. Their interpretation depends on the voting module used.\"},\"VoteCastWithParams(address,uint256,uint8,uint256,string,bytes)\":{\"details\":\"Emitted when a vote is cast with params. Note: `support` values should be seen as buckets. Their interpretation depends on the voting module used. `params` are additional encoded parameters. Their interpretation also depends on the voting module used.\"}},\"kind\":\"dev\",\"methods\":{\"CLOCK_MODE()\":{\"details\":\"Machine-readable description of the clock as specified in ERC-6372.\"},\"COUNTING_MODE()\":{\"details\":\"See {IGovernor-COUNTING_MODE}.\"},\"cancel(address[],uint256[],bytes[],bytes32)\":{\"details\":\"See {IGovernor-cancel}.\"},\"castVote(uint256,uint8)\":{\"details\":\"See {IGovernor-castVote}.\"},\"castVoteBySig(uint256,uint8,address,bytes)\":{\"details\":\"See {IGovernor-castVoteBySig}.\"},\"castVoteWithReason(uint256,uint8,string)\":{\"details\":\"See {IGovernor-castVoteWithReason}.\"},\"castVoteWithReasonAndParams(uint256,uint8,string,bytes)\":{\"details\":\"See {IGovernor-castVoteWithReasonAndParams}.\"},\"castVoteWithReasonAndParamsBySig(uint256,uint8,address,string,bytes,bytes)\":{\"details\":\"See {IGovernor-castVoteWithReasonAndParamsBySig}.\"},\"claimParameterUpdate(bytes)\":{\"params\":{\"proof\":\"Proof generated by home chain\"}},\"clock()\":{\"details\":\"Clock (as specified in ERC-6372) is set to match the token's clock. Fallback to block numbers if the token does not implement ERC-6372.\"},\"constructor\":{\"details\":\"Sets up initial governance parameters and manifesto\",\"params\":{\"_home\":\"Chain ID where this contract is considered home\",\"_manifestoCid\":\"Initial manifesto CID\",\"_name\":\"Name of the governance contract\",\"_proposalThreshold\":\"Minimum votes needed to create a proposal\",\"_quorum\":\"Minimum participation percentage required\",\"_token\":\"The voting token contract address\",\"_votingDelay\":\"Time before voting begins\",\"_votingPeriod\":\"Duration of voting period\"}},\"eip712Domain()\":{\"details\":\"See {IERC-5267}.\"},\"execute(address[],uint256[],bytes[],bytes32)\":{\"details\":\"See {IGovernor-execute}.\"},\"generateParameterProof(uint8,bytes)\":{\"params\":{\"operationType\":\"Type of parameter being updated\",\"value\":\"Encoded parameter value\"},\"returns\":{\"proof\":\"Encoded proof data\"}},\"getVotes(address,uint256)\":{\"details\":\"See {IGovernor-getVotes}.\"},\"getVotesWithParams(address,uint256,bytes)\":{\"details\":\"See {IGovernor-getVotesWithParams}.\"},\"hasVoted(uint256,address)\":{\"details\":\"See {IGovernor-hasVoted}.\"},\"hashProposal(address[],uint256[],bytes[],bytes32)\":{\"details\":\"See {IGovernor-hashProposal}. The proposal id is produced by hashing the ABI encoded `targets` array, the `values` array, the `calldatas` array and the descriptionHash (bytes32 which itself is the keccak256 hash of the description string). This proposal id can be produced from the proposal data which is part of the {ProposalCreated} event. It can even be computed in advance, before the proposal is submitted. Note that the chainId and the governor address are not part of the proposal id computation. Consequently, the same proposal (with same operation and same description) will have the same id if submitted on multiple governors across multiple networks. This also means that in order to execute the same operation twice (on the same governor) the proposer will have to change the description in order to avoid proposal id conflicts.\"},\"name()\":{\"details\":\"See {IGovernor-name}.\"},\"nonces(address)\":{\"details\":\"Returns the next unused nonce for an address.\"},\"onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)\":{\"details\":\"See {IERC1155Receiver-onERC1155BatchReceived}. Receiving tokens is disabled if the governance executor is other than the governor itself (eg. when using with a timelock).\"},\"onERC1155Received(address,address,uint256,uint256,bytes)\":{\"details\":\"See {IERC1155Receiver-onERC1155Received}. Receiving tokens is disabled if the governance executor is other than the governor itself (eg. when using with a timelock).\"},\"onERC721Received(address,address,uint256,bytes)\":{\"details\":\"See {IERC721Receiver-onERC721Received}. Receiving tokens is disabled if the governance executor is other than the governor itself (eg. when using with a timelock).\"},\"proposalDeadline(uint256)\":{\"details\":\"See {IGovernor-proposalDeadline}.\"},\"proposalEta(uint256)\":{\"details\":\"See {IGovernor-proposalEta}.\"},\"proposalNeedsQueuing(uint256)\":{\"details\":\"See {IGovernor-proposalNeedsQueuing}.\"},\"proposalProposer(uint256)\":{\"details\":\"See {IGovernor-proposalProposer}.\"},\"proposalSnapshot(uint256)\":{\"details\":\"See {IGovernor-proposalSnapshot}.\"},\"proposalVotes(uint256)\":{\"details\":\"Accessor to the internal vote counts.\"},\"propose(address[],uint256[],bytes[],string)\":{\"details\":\"See {IGovernor-propose}. This function has opt-in frontrunning protection, described in {_isValidDescriptionForProposer}.\"},\"queue(address[],uint256[],bytes[],bytes32)\":{\"details\":\"See {IGovernor-queue}.\"},\"quorumDenominator()\":{\"details\":\"Returns the quorum denominator. Defaults to 100, but may be overridden.\"},\"quorumNumerator()\":{\"details\":\"Returns the current quorum numerator. See {quorumDenominator}.\"},\"quorumNumerator(uint256)\":{\"details\":\"Returns the quorum numerator at a specific timepoint. See {quorumDenominator}.\"},\"relay(address,uint256,bytes)\":{\"details\":\"Relays a transaction or function call to an arbitrary target. In cases where the governance executor is some contract other than the governor itself, like when using a timelock, this function can be invoked in a governance proposal to recover tokens or Ether that was sent to the governor contract by mistake. Note that if the executor is simply the governor itself, use of `relay` is redundant.\"},\"setManifesto(string)\":{\"params\":{\"newManifesto\":\"New manifesto CID\"}},\"setProposalThreshold(uint256)\":{\"params\":{\"newProposalThreshold\":\"New proposal threshold value\"}},\"setVotingDelay(uint48)\":{\"params\":{\"newVotingDelay\":\"New voting delay value\"}},\"setVotingPeriod(uint32)\":{\"params\":{\"newVotingPeriod\":\"New voting period value\"}},\"state(uint256)\":{\"details\":\"See {IGovernor-state}.\"},\"supportsInterface(bytes4)\":{\"details\":\"See {IERC165-supportsInterface}.\"},\"token()\":{\"details\":\"The token that voting power is sourced from.\"},\"updateQuorumNumerator(uint256)\":{\"params\":{\"newQuorumNumerator\":\"New quorum numerator value\"}},\"version()\":{\"details\":\"See {IGovernor-version}.\"}},\"title\":\"Cross-chain Governance Contract\",\"version\":1},\"userdoc\":{\"events\":{\"GovernanceParameterUpdated(uint8,uint256,uint256,uint256)\":{\"notice\":\"Emitted when a governance parameter is updated\"},\"ManifestoUpdated(string,string,uint256)\":{\"notice\":\"Emitted when the manifesto is updated\"}},\"kind\":\"user\",\"methods\":{\"claimParameterUpdate(bytes)\":{\"notice\":\"Claims a parameter update on a foreign chain\"},\"constructor\":{\"notice\":\"Initializes the governance contract\"},\"generateParameterProof(uint8,bytes)\":{\"notice\":\"Generates proof for parameter updates\"},\"home()\":{\"notice\":\"Chain ID where this contract was originally deployed\"},\"manifesto()\":{\"notice\":\"IPFS CID of the DAO's manifesto\"},\"setManifesto(string)\":{\"notice\":\"Updates the DAO's manifesto on the home chain\"},\"setProposalThreshold(uint256)\":{\"notice\":\"Updates the proposal threshold parameter on the home chain\"},\"setVotingDelay(uint48)\":{\"notice\":\"Updates the voting delay parameter on the home chain\"},\"setVotingPeriod(uint32)\":{\"notice\":\"Updates the voting period parameter on the home chain\"},\"updateQuorumNumerator(uint256)\":{\"notice\":\"Updates the quorum numerator on the home chain\"}},\"notice\":\"Implementation of a DAO with cross-chain synchronization capabilities\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/variants/crosschain/Gov.sol\":\"Gov\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/governance/Governor.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (governance/Governor.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {IERC721Receiver} from \\\"../token/ERC721/IERC721Receiver.sol\\\";\\nimport {IERC1155Receiver} from \\\"../token/ERC1155/IERC1155Receiver.sol\\\";\\nimport {EIP712} from \\\"../utils/cryptography/EIP712.sol\\\";\\nimport {SignatureChecker} from \\\"../utils/cryptography/SignatureChecker.sol\\\";\\nimport {IERC165, ERC165} from \\\"../utils/introspection/ERC165.sol\\\";\\nimport {SafeCast} from \\\"../utils/math/SafeCast.sol\\\";\\nimport {DoubleEndedQueue} from \\\"../utils/structs/DoubleEndedQueue.sol\\\";\\nimport {Address} from \\\"../utils/Address.sol\\\";\\nimport {Context} from \\\"../utils/Context.sol\\\";\\nimport {Nonces} from \\\"../utils/Nonces.sol\\\";\\nimport {IGovernor, IERC6372} from \\\"./IGovernor.sol\\\";\\n\\n/**\\n * @dev Core of the governance system, designed to be extended through various modules.\\n *\\n * This contract is abstract and requires several functions to be implemented in various modules:\\n *\\n * - A counting module must implement {quorum}, {_quorumReached}, {_voteSucceeded} and {_countVote}\\n * - A voting module must implement {_getVotes}\\n * - Additionally, {votingPeriod} must also be implemented\\n */\\nabstract contract Governor is Context, ERC165, EIP712, Nonces, IGovernor, IERC721Receiver, IERC1155Receiver {\\n using DoubleEndedQueue for DoubleEndedQueue.Bytes32Deque;\\n\\n bytes32 public constant BALLOT_TYPEHASH =\\n keccak256(\\\"Ballot(uint256 proposalId,uint8 support,address voter,uint256 nonce)\\\");\\n bytes32 public constant EXTENDED_BALLOT_TYPEHASH =\\n keccak256(\\n \\\"ExtendedBallot(uint256 proposalId,uint8 support,address voter,uint256 nonce,string reason,bytes params)\\\"\\n );\\n\\n struct ProposalCore {\\n address proposer;\\n uint48 voteStart;\\n uint32 voteDuration;\\n bool executed;\\n bool canceled;\\n uint48 etaSeconds;\\n }\\n\\n bytes32 private constant ALL_PROPOSAL_STATES_BITMAP = bytes32((2 ** (uint8(type(ProposalState).max) + 1)) - 1);\\n string private _name;\\n\\n mapping(uint256 proposalId => ProposalCore) private _proposals;\\n\\n // This queue keeps track of the governor operating on itself. Calls to functions protected by the {onlyGovernance}\\n // modifier needs to be whitelisted in this queue. Whitelisting is set in {execute}, consumed by the\\n // {onlyGovernance} modifier and eventually reset after {_executeOperations} completes. This ensures that the\\n // execution of {onlyGovernance} protected calls can only be achieved through successful proposals.\\n DoubleEndedQueue.Bytes32Deque private _governanceCall;\\n\\n /**\\n * @dev Restricts a function so it can only be executed through governance proposals. For example, governance\\n * parameter setters in {GovernorSettings} are protected using this modifier.\\n *\\n * The governance executing address may be different from the Governor's own address, for example it could be a\\n * timelock. This can be customized by modules by overriding {_executor}. The executor is only able to invoke these\\n * functions during the execution of the governor's {execute} function, and not under any other circumstances. Thus,\\n * for example, additional timelock proposers are not able to change governance parameters without going through the\\n * governance protocol (since v4.6).\\n */\\n modifier onlyGovernance() {\\n _checkGovernance();\\n _;\\n }\\n\\n /**\\n * @dev Sets the value for {name} and {version}\\n */\\n constructor(string memory name_) EIP712(name_, version()) {\\n _name = name_;\\n }\\n\\n /**\\n * @dev Function to receive ETH that will be handled by the governor (disabled if executor is a third party contract)\\n */\\n receive() external payable virtual {\\n if (_executor() != address(this)) {\\n revert GovernorDisabledDeposit();\\n }\\n }\\n\\n /**\\n * @dev See {IERC165-supportsInterface}.\\n */\\n function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165, ERC165) returns (bool) {\\n return\\n interfaceId == type(IGovernor).interfaceId ||\\n interfaceId == type(IERC1155Receiver).interfaceId ||\\n super.supportsInterface(interfaceId);\\n }\\n\\n /**\\n * @dev See {IGovernor-name}.\\n */\\n function name() public view virtual returns (string memory) {\\n return _name;\\n }\\n\\n /**\\n * @dev See {IGovernor-version}.\\n */\\n function version() public view virtual returns (string memory) {\\n return \\\"1\\\";\\n }\\n\\n /**\\n * @dev See {IGovernor-hashProposal}.\\n *\\n * The proposal id is produced by hashing the ABI encoded `targets` array, the `values` array, the `calldatas` array\\n * and the descriptionHash (bytes32 which itself is the keccak256 hash of the description string). This proposal id\\n * can be produced from the proposal data which is part of the {ProposalCreated} event. It can even be computed in\\n * advance, before the proposal is submitted.\\n *\\n * Note that the chainId and the governor address are not part of the proposal id computation. Consequently, the\\n * same proposal (with same operation and same description) will have the same id if submitted on multiple governors\\n * across multiple networks. This also means that in order to execute the same operation twice (on the same\\n * governor) the proposer will have to change the description in order to avoid proposal id conflicts.\\n */\\n function hashProposal(\\n address[] memory targets,\\n uint256[] memory values,\\n bytes[] memory calldatas,\\n bytes32 descriptionHash\\n ) public pure virtual returns (uint256) {\\n return uint256(keccak256(abi.encode(targets, values, calldatas, descriptionHash)));\\n }\\n\\n /**\\n * @dev See {IGovernor-state}.\\n */\\n function state(uint256 proposalId) public view virtual returns (ProposalState) {\\n // We read the struct fields into the stack at once so Solidity emits a single SLOAD\\n ProposalCore storage proposal = _proposals[proposalId];\\n bool proposalExecuted = proposal.executed;\\n bool proposalCanceled = proposal.canceled;\\n\\n if (proposalExecuted) {\\n return ProposalState.Executed;\\n }\\n\\n if (proposalCanceled) {\\n return ProposalState.Canceled;\\n }\\n\\n uint256 snapshot = proposalSnapshot(proposalId);\\n\\n if (snapshot == 0) {\\n revert GovernorNonexistentProposal(proposalId);\\n }\\n\\n uint256 currentTimepoint = clock();\\n\\n if (snapshot >= currentTimepoint) {\\n return ProposalState.Pending;\\n }\\n\\n uint256 deadline = proposalDeadline(proposalId);\\n\\n if (deadline >= currentTimepoint) {\\n return ProposalState.Active;\\n } else if (!_quorumReached(proposalId) || !_voteSucceeded(proposalId)) {\\n return ProposalState.Defeated;\\n } else if (proposalEta(proposalId) == 0) {\\n return ProposalState.Succeeded;\\n } else {\\n return ProposalState.Queued;\\n }\\n }\\n\\n /**\\n * @dev See {IGovernor-proposalThreshold}.\\n */\\n function proposalThreshold() public view virtual returns (uint256) {\\n return 0;\\n }\\n\\n /**\\n * @dev See {IGovernor-proposalSnapshot}.\\n */\\n function proposalSnapshot(uint256 proposalId) public view virtual returns (uint256) {\\n return _proposals[proposalId].voteStart;\\n }\\n\\n /**\\n * @dev See {IGovernor-proposalDeadline}.\\n */\\n function proposalDeadline(uint256 proposalId) public view virtual returns (uint256) {\\n return _proposals[proposalId].voteStart + _proposals[proposalId].voteDuration;\\n }\\n\\n /**\\n * @dev See {IGovernor-proposalProposer}.\\n */\\n function proposalProposer(uint256 proposalId) public view virtual returns (address) {\\n return _proposals[proposalId].proposer;\\n }\\n\\n /**\\n * @dev See {IGovernor-proposalEta}.\\n */\\n function proposalEta(uint256 proposalId) public view virtual returns (uint256) {\\n return _proposals[proposalId].etaSeconds;\\n }\\n\\n /**\\n * @dev See {IGovernor-proposalNeedsQueuing}.\\n */\\n function proposalNeedsQueuing(uint256) public view virtual returns (bool) {\\n return false;\\n }\\n\\n /**\\n * @dev Reverts if the `msg.sender` is not the executor. In case the executor is not this contract\\n * itself, the function reverts if `msg.data` is not whitelisted as a result of an {execute}\\n * operation. See {onlyGovernance}.\\n */\\n function _checkGovernance() internal virtual {\\n if (_executor() != _msgSender()) {\\n revert GovernorOnlyExecutor(_msgSender());\\n }\\n if (_executor() != address(this)) {\\n bytes32 msgDataHash = keccak256(_msgData());\\n // loop until popping the expected operation - throw if deque is empty (operation not authorized)\\n while (_governanceCall.popFront() != msgDataHash) {}\\n }\\n }\\n\\n /**\\n * @dev Amount of votes already cast passes the threshold limit.\\n */\\n function _quorumReached(uint256 proposalId) internal view virtual returns (bool);\\n\\n /**\\n * @dev Is the proposal successful or not.\\n */\\n function _voteSucceeded(uint256 proposalId) internal view virtual returns (bool);\\n\\n /**\\n * @dev Get the voting weight of `account` at a specific `timepoint`, for a vote as described by `params`.\\n */\\n function _getVotes(address account, uint256 timepoint, bytes memory params) internal view virtual returns (uint256);\\n\\n /**\\n * @dev Register a vote for `proposalId` by `account` with a given `support`, voting `weight` and voting `params`.\\n *\\n * Note: Support is generic and can represent various things depending on the voting system used.\\n */\\n function _countVote(\\n uint256 proposalId,\\n address account,\\n uint8 support,\\n uint256 totalWeight,\\n bytes memory params\\n ) internal virtual returns (uint256);\\n\\n /**\\n * @dev Default additional encoded parameters used by castVote methods that don't include them\\n *\\n * Note: Should be overridden by specific implementations to use an appropriate value, the\\n * meaning of the additional params, in the context of that implementation\\n */\\n function _defaultParams() internal view virtual returns (bytes memory) {\\n return \\\"\\\";\\n }\\n\\n /**\\n * @dev See {IGovernor-propose}. This function has opt-in frontrunning protection, described in {_isValidDescriptionForProposer}.\\n */\\n function propose(\\n address[] memory targets,\\n uint256[] memory values,\\n bytes[] memory calldatas,\\n string memory description\\n ) public virtual returns (uint256) {\\n address proposer = _msgSender();\\n\\n // check description restriction\\n if (!_isValidDescriptionForProposer(proposer, description)) {\\n revert GovernorRestrictedProposer(proposer);\\n }\\n\\n // check proposal threshold\\n uint256 votesThreshold = proposalThreshold();\\n if (votesThreshold > 0) {\\n uint256 proposerVotes = getVotes(proposer, clock() - 1);\\n if (proposerVotes < votesThreshold) {\\n revert GovernorInsufficientProposerVotes(proposer, proposerVotes, votesThreshold);\\n }\\n }\\n\\n return _propose(targets, values, calldatas, description, proposer);\\n }\\n\\n /**\\n * @dev Internal propose mechanism. Can be overridden to add more logic on proposal creation.\\n *\\n * Emits a {IGovernor-ProposalCreated} event.\\n */\\n function _propose(\\n address[] memory targets,\\n uint256[] memory values,\\n bytes[] memory calldatas,\\n string memory description,\\n address proposer\\n ) internal virtual returns (uint256 proposalId) {\\n proposalId = hashProposal(targets, values, calldatas, keccak256(bytes(description)));\\n\\n if (targets.length != values.length || targets.length != calldatas.length || targets.length == 0) {\\n revert GovernorInvalidProposalLength(targets.length, calldatas.length, values.length);\\n }\\n if (_proposals[proposalId].voteStart != 0) {\\n revert GovernorUnexpectedProposalState(proposalId, state(proposalId), bytes32(0));\\n }\\n\\n uint256 snapshot = clock() + votingDelay();\\n uint256 duration = votingPeriod();\\n\\n ProposalCore storage proposal = _proposals[proposalId];\\n proposal.proposer = proposer;\\n proposal.voteStart = SafeCast.toUint48(snapshot);\\n proposal.voteDuration = SafeCast.toUint32(duration);\\n\\n emit ProposalCreated(\\n proposalId,\\n proposer,\\n targets,\\n values,\\n new string[](targets.length),\\n calldatas,\\n snapshot,\\n snapshot + duration,\\n description\\n );\\n\\n // Using a named return variable to avoid stack too deep errors\\n }\\n\\n /**\\n * @dev See {IGovernor-queue}.\\n */\\n function queue(\\n address[] memory targets,\\n uint256[] memory values,\\n bytes[] memory calldatas,\\n bytes32 descriptionHash\\n ) public virtual returns (uint256) {\\n uint256 proposalId = hashProposal(targets, values, calldatas, descriptionHash);\\n\\n _validateStateBitmap(proposalId, _encodeStateBitmap(ProposalState.Succeeded));\\n\\n uint48 etaSeconds = _queueOperations(proposalId, targets, values, calldatas, descriptionHash);\\n\\n if (etaSeconds != 0) {\\n _proposals[proposalId].etaSeconds = etaSeconds;\\n emit ProposalQueued(proposalId, etaSeconds);\\n } else {\\n revert GovernorQueueNotImplemented();\\n }\\n\\n return proposalId;\\n }\\n\\n /**\\n * @dev Internal queuing mechanism. Can be overridden (without a super call) to modify the way queuing is\\n * performed (for example adding a vault/timelock).\\n *\\n * This is empty by default, and must be overridden to implement queuing.\\n *\\n * This function returns a timestamp that describes the expected ETA for execution. If the returned value is 0\\n * (which is the default value), the core will consider queueing did not succeed, and the public {queue} function\\n * will revert.\\n *\\n * NOTE: Calling this function directly will NOT check the current state of the proposal, or emit the\\n * `ProposalQueued` event. Queuing a proposal should be done using {queue}.\\n */\\n function _queueOperations(\\n uint256 /*proposalId*/,\\n address[] memory /*targets*/,\\n uint256[] memory /*values*/,\\n bytes[] memory /*calldatas*/,\\n bytes32 /*descriptionHash*/\\n ) internal virtual returns (uint48) {\\n return 0;\\n }\\n\\n /**\\n * @dev See {IGovernor-execute}.\\n */\\n function execute(\\n address[] memory targets,\\n uint256[] memory values,\\n bytes[] memory calldatas,\\n bytes32 descriptionHash\\n ) public payable virtual returns (uint256) {\\n uint256 proposalId = hashProposal(targets, values, calldatas, descriptionHash);\\n\\n _validateStateBitmap(\\n proposalId,\\n _encodeStateBitmap(ProposalState.Succeeded) | _encodeStateBitmap(ProposalState.Queued)\\n );\\n\\n // mark as executed before calls to avoid reentrancy\\n _proposals[proposalId].executed = true;\\n\\n // before execute: register governance call in queue.\\n if (_executor() != address(this)) {\\n for (uint256 i = 0; i < targets.length; ++i) {\\n if (targets[i] == address(this)) {\\n _governanceCall.pushBack(keccak256(calldatas[i]));\\n }\\n }\\n }\\n\\n _executeOperations(proposalId, targets, values, calldatas, descriptionHash);\\n\\n // after execute: cleanup governance call queue.\\n if (_executor() != address(this) && !_governanceCall.empty()) {\\n _governanceCall.clear();\\n }\\n\\n emit ProposalExecuted(proposalId);\\n\\n return proposalId;\\n }\\n\\n /**\\n * @dev Internal execution mechanism. Can be overridden (without a super call) to modify the way execution is\\n * performed (for example adding a vault/timelock).\\n *\\n * NOTE: Calling this function directly will NOT check the current state of the proposal, set the executed flag to\\n * true or emit the `ProposalExecuted` event. Executing a proposal should be done using {execute} or {_execute}.\\n */\\n function _executeOperations(\\n uint256 /* proposalId */,\\n address[] memory targets,\\n uint256[] memory values,\\n bytes[] memory calldatas,\\n bytes32 /*descriptionHash*/\\n ) internal virtual {\\n for (uint256 i = 0; i < targets.length; ++i) {\\n (bool success, bytes memory returndata) = targets[i].call{value: values[i]}(calldatas[i]);\\n Address.verifyCallResult(success, returndata);\\n }\\n }\\n\\n /**\\n * @dev See {IGovernor-cancel}.\\n */\\n function cancel(\\n address[] memory targets,\\n uint256[] memory values,\\n bytes[] memory calldatas,\\n bytes32 descriptionHash\\n ) public virtual returns (uint256) {\\n // The proposalId will be recomputed in the `_cancel` call further down. However we need the value before we\\n // do the internal call, because we need to check the proposal state BEFORE the internal `_cancel` call\\n // changes it. The `hashProposal` duplication has a cost that is limited, and that we accept.\\n uint256 proposalId = hashProposal(targets, values, calldatas, descriptionHash);\\n\\n // public cancel restrictions (on top of existing _cancel restrictions).\\n _validateStateBitmap(proposalId, _encodeStateBitmap(ProposalState.Pending));\\n if (_msgSender() != proposalProposer(proposalId)) {\\n revert GovernorOnlyProposer(_msgSender());\\n }\\n\\n return _cancel(targets, values, calldatas, descriptionHash);\\n }\\n\\n /**\\n * @dev Internal cancel mechanism with minimal restrictions. A proposal can be cancelled in any state other than\\n * Canceled, Expired, or Executed. Once cancelled a proposal can't be re-submitted.\\n *\\n * Emits a {IGovernor-ProposalCanceled} event.\\n */\\n function _cancel(\\n address[] memory targets,\\n uint256[] memory values,\\n bytes[] memory calldatas,\\n bytes32 descriptionHash\\n ) internal virtual returns (uint256) {\\n uint256 proposalId = hashProposal(targets, values, calldatas, descriptionHash);\\n\\n _validateStateBitmap(\\n proposalId,\\n ALL_PROPOSAL_STATES_BITMAP ^\\n _encodeStateBitmap(ProposalState.Canceled) ^\\n _encodeStateBitmap(ProposalState.Expired) ^\\n _encodeStateBitmap(ProposalState.Executed)\\n );\\n\\n _proposals[proposalId].canceled = true;\\n emit ProposalCanceled(proposalId);\\n\\n return proposalId;\\n }\\n\\n /**\\n * @dev See {IGovernor-getVotes}.\\n */\\n function getVotes(address account, uint256 timepoint) public view virtual returns (uint256) {\\n return _getVotes(account, timepoint, _defaultParams());\\n }\\n\\n /**\\n * @dev See {IGovernor-getVotesWithParams}.\\n */\\n function getVotesWithParams(\\n address account,\\n uint256 timepoint,\\n bytes memory params\\n ) public view virtual returns (uint256) {\\n return _getVotes(account, timepoint, params);\\n }\\n\\n /**\\n * @dev See {IGovernor-castVote}.\\n */\\n function castVote(uint256 proposalId, uint8 support) public virtual returns (uint256) {\\n address voter = _msgSender();\\n return _castVote(proposalId, voter, support, \\\"\\\");\\n }\\n\\n /**\\n * @dev See {IGovernor-castVoteWithReason}.\\n */\\n function castVoteWithReason(\\n uint256 proposalId,\\n uint8 support,\\n string calldata reason\\n ) public virtual returns (uint256) {\\n address voter = _msgSender();\\n return _castVote(proposalId, voter, support, reason);\\n }\\n\\n /**\\n * @dev See {IGovernor-castVoteWithReasonAndParams}.\\n */\\n function castVoteWithReasonAndParams(\\n uint256 proposalId,\\n uint8 support,\\n string calldata reason,\\n bytes memory params\\n ) public virtual returns (uint256) {\\n address voter = _msgSender();\\n return _castVote(proposalId, voter, support, reason, params);\\n }\\n\\n /**\\n * @dev See {IGovernor-castVoteBySig}.\\n */\\n function castVoteBySig(\\n uint256 proposalId,\\n uint8 support,\\n address voter,\\n bytes memory signature\\n ) public virtual returns (uint256) {\\n bool valid = SignatureChecker.isValidSignatureNow(\\n voter,\\n _hashTypedDataV4(keccak256(abi.encode(BALLOT_TYPEHASH, proposalId, support, voter, _useNonce(voter)))),\\n signature\\n );\\n\\n if (!valid) {\\n revert GovernorInvalidSignature(voter);\\n }\\n\\n return _castVote(proposalId, voter, support, \\\"\\\");\\n }\\n\\n /**\\n * @dev See {IGovernor-castVoteWithReasonAndParamsBySig}.\\n */\\n function castVoteWithReasonAndParamsBySig(\\n uint256 proposalId,\\n uint8 support,\\n address voter,\\n string calldata reason,\\n bytes memory params,\\n bytes memory signature\\n ) public virtual returns (uint256) {\\n bool valid = SignatureChecker.isValidSignatureNow(\\n voter,\\n _hashTypedDataV4(\\n keccak256(\\n abi.encode(\\n EXTENDED_BALLOT_TYPEHASH,\\n proposalId,\\n support,\\n voter,\\n _useNonce(voter),\\n keccak256(bytes(reason)),\\n keccak256(params)\\n )\\n )\\n ),\\n signature\\n );\\n\\n if (!valid) {\\n revert GovernorInvalidSignature(voter);\\n }\\n\\n return _castVote(proposalId, voter, support, reason, params);\\n }\\n\\n /**\\n * @dev Internal vote casting mechanism: Check that the vote is pending, that it has not been cast yet, retrieve\\n * voting weight using {IGovernor-getVotes} and call the {_countVote} internal function. Uses the _defaultParams().\\n *\\n * Emits a {IGovernor-VoteCast} event.\\n */\\n function _castVote(\\n uint256 proposalId,\\n address account,\\n uint8 support,\\n string memory reason\\n ) internal virtual returns (uint256) {\\n return _castVote(proposalId, account, support, reason, _defaultParams());\\n }\\n\\n /**\\n * @dev Internal vote casting mechanism: Check that the vote is pending, that it has not been cast yet, retrieve\\n * voting weight using {IGovernor-getVotes} and call the {_countVote} internal function.\\n *\\n * Emits a {IGovernor-VoteCast} event.\\n */\\n function _castVote(\\n uint256 proposalId,\\n address account,\\n uint8 support,\\n string memory reason,\\n bytes memory params\\n ) internal virtual returns (uint256) {\\n _validateStateBitmap(proposalId, _encodeStateBitmap(ProposalState.Active));\\n\\n uint256 totalWeight = _getVotes(account, proposalSnapshot(proposalId), params);\\n uint256 votedWeight = _countVote(proposalId, account, support, totalWeight, params);\\n\\n if (params.length == 0) {\\n emit VoteCast(account, proposalId, support, votedWeight, reason);\\n } else {\\n emit VoteCastWithParams(account, proposalId, support, votedWeight, reason, params);\\n }\\n\\n return votedWeight;\\n }\\n\\n /**\\n * @dev Relays a transaction or function call to an arbitrary target. In cases where the governance executor\\n * is some contract other than the governor itself, like when using a timelock, this function can be invoked\\n * in a governance proposal to recover tokens or Ether that was sent to the governor contract by mistake.\\n * Note that if the executor is simply the governor itself, use of `relay` is redundant.\\n */\\n function relay(address target, uint256 value, bytes calldata data) external payable virtual onlyGovernance {\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n Address.verifyCallResult(success, returndata);\\n }\\n\\n /**\\n * @dev Address through which the governor executes action. Will be overloaded by module that execute actions\\n * through another contract such as a timelock.\\n */\\n function _executor() internal view virtual returns (address) {\\n return address(this);\\n }\\n\\n /**\\n * @dev See {IERC721Receiver-onERC721Received}.\\n * Receiving tokens is disabled if the governance executor is other than the governor itself (eg. when using with a timelock).\\n */\\n function onERC721Received(address, address, uint256, bytes memory) public virtual returns (bytes4) {\\n if (_executor() != address(this)) {\\n revert GovernorDisabledDeposit();\\n }\\n return this.onERC721Received.selector;\\n }\\n\\n /**\\n * @dev See {IERC1155Receiver-onERC1155Received}.\\n * Receiving tokens is disabled if the governance executor is other than the governor itself (eg. when using with a timelock).\\n */\\n function onERC1155Received(address, address, uint256, uint256, bytes memory) public virtual returns (bytes4) {\\n if (_executor() != address(this)) {\\n revert GovernorDisabledDeposit();\\n }\\n return this.onERC1155Received.selector;\\n }\\n\\n /**\\n * @dev See {IERC1155Receiver-onERC1155BatchReceived}.\\n * Receiving tokens is disabled if the governance executor is other than the governor itself (eg. when using with a timelock).\\n */\\n function onERC1155BatchReceived(\\n address,\\n address,\\n uint256[] memory,\\n uint256[] memory,\\n bytes memory\\n ) public virtual returns (bytes4) {\\n if (_executor() != address(this)) {\\n revert GovernorDisabledDeposit();\\n }\\n return this.onERC1155BatchReceived.selector;\\n }\\n\\n /**\\n * @dev Encodes a `ProposalState` into a `bytes32` representation where each bit enabled corresponds to\\n * the underlying position in the `ProposalState` enum. For example:\\n *\\n * 0x000...10000\\n * ^^^^^^------ ...\\n * ^----- Succeeded\\n * ^---- Defeated\\n * ^--- Canceled\\n * ^-- Active\\n * ^- Pending\\n */\\n function _encodeStateBitmap(ProposalState proposalState) internal pure returns (bytes32) {\\n return bytes32(1 << uint8(proposalState));\\n }\\n\\n /**\\n * @dev Check that the current state of a proposal matches the requirements described by the `allowedStates` bitmap.\\n * This bitmap should be built using `_encodeStateBitmap`.\\n *\\n * If requirements are not met, reverts with a {GovernorUnexpectedProposalState} error.\\n */\\n function _validateStateBitmap(uint256 proposalId, bytes32 allowedStates) private view returns (ProposalState) {\\n ProposalState currentState = state(proposalId);\\n if (_encodeStateBitmap(currentState) & allowedStates == bytes32(0)) {\\n revert GovernorUnexpectedProposalState(proposalId, currentState, allowedStates);\\n }\\n return currentState;\\n }\\n\\n /*\\n * @dev Check if the proposer is authorized to submit a proposal with the given description.\\n *\\n * If the proposal description ends with `#proposer=0x???`, where `0x???` is an address written as a hex string\\n * (case insensitive), then the submission of this proposal will only be authorized to said address.\\n *\\n * This is used for frontrunning protection. By adding this pattern at the end of their proposal, one can ensure\\n * that no other address can submit the same proposal. An attacker would have to either remove or change that part,\\n * which would result in a different proposal id.\\n *\\n * If the description does not match this pattern, it is unrestricted and anyone can submit it. This includes:\\n * - If the `0x???` part is not a valid hex string.\\n * - If the `0x???` part is a valid hex string, but does not contain exactly 40 hex digits.\\n * - If it ends with the expected suffix followed by newlines or other whitespace.\\n * - If it ends with some other similar suffix, e.g. `#other=abc`.\\n * - If it does not end with any such suffix.\\n */\\n function _isValidDescriptionForProposer(\\n address proposer,\\n string memory description\\n ) internal view virtual returns (bool) {\\n uint256 len = bytes(description).length;\\n\\n // Length is too short to contain a valid proposer suffix\\n if (len < 52) {\\n return true;\\n }\\n\\n // Extract what would be the `#proposer=0x` marker beginning the suffix\\n bytes12 marker;\\n assembly (\\\"memory-safe\\\") {\\n // - Start of the string contents in memory = description + 32\\n // - First character of the marker = len - 52\\n // - Length of \\\"#proposer=0x0000000000000000000000000000000000000000\\\" = 52\\n // - We read the memory word starting at the first character of the marker:\\n // - (description + 32) + (len - 52) = description + (len - 20)\\n // - Note: Solidity will ignore anything past the first 12 bytes\\n marker := mload(add(description, sub(len, 20)))\\n }\\n\\n // If the marker is not found, there is no proposer suffix to check\\n if (marker != bytes12(\\\"#proposer=0x\\\")) {\\n return true;\\n }\\n\\n // Parse the 40 characters following the marker as uint160\\n uint160 recovered = 0;\\n for (uint256 i = len - 40; i < len; ++i) {\\n (bool isHex, uint8 value) = _tryHexToUint(bytes(description)[i]);\\n // If any of the characters is not a hex digit, ignore the suffix entirely\\n if (!isHex) {\\n return true;\\n }\\n recovered = (recovered << 4) | value;\\n }\\n\\n return recovered == uint160(proposer);\\n }\\n\\n /**\\n * @dev Try to parse a character from a string as a hex value. Returns `(true, value)` if the char is in\\n * `[0-9a-fA-F]` and `(false, 0)` otherwise. Value is guaranteed to be in the range `0 <= value < 16`\\n */\\n function _tryHexToUint(bytes1 char) private pure returns (bool isHex, uint8 value) {\\n uint8 c = uint8(char);\\n unchecked {\\n // Case 0-9\\n if (47 < c && c < 58) {\\n return (true, c - 48);\\n }\\n // Case A-F\\n else if (64 < c && c < 71) {\\n return (true, c - 55);\\n }\\n // Case a-f\\n else if (96 < c && c < 103) {\\n return (true, c - 87);\\n }\\n // Else: not a hex char\\n else {\\n return (false, 0);\\n }\\n }\\n }\\n\\n /**\\n * @inheritdoc IERC6372\\n */\\n function clock() public view virtual returns (uint48);\\n\\n /**\\n * @inheritdoc IERC6372\\n */\\n // solhint-disable-next-line func-name-mixedcase\\n function CLOCK_MODE() public view virtual returns (string memory);\\n\\n /**\\n * @inheritdoc IGovernor\\n */\\n function votingDelay() public view virtual returns (uint256);\\n\\n /**\\n * @inheritdoc IGovernor\\n */\\n function votingPeriod() public view virtual returns (uint256);\\n\\n /**\\n * @inheritdoc IGovernor\\n */\\n function quorum(uint256 timepoint) public view virtual returns (uint256);\\n}\\n\",\"keccak256\":\"0xe0f387e99c7dfcb1d3e7d2f36e408ab59a851a5e0502d21889568466a2a491bc\",\"license\":\"MIT\"},\"@openzeppelin/contracts/governance/IGovernor.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (governance/IGovernor.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {IERC165} from \\\"../interfaces/IERC165.sol\\\";\\nimport {IERC6372} from \\\"../interfaces/IERC6372.sol\\\";\\n\\n/**\\n * @dev Interface of the {Governor} core.\\n *\\n * NOTE: Event parameters lack the `indexed` keyword for compatibility with GovernorBravo events.\\n * Making event parameters `indexed` affects how events are decoded, potentially breaking existing indexers.\\n */\\ninterface IGovernor is IERC165, IERC6372 {\\n enum ProposalState {\\n Pending,\\n Active,\\n Canceled,\\n Defeated,\\n Succeeded,\\n Queued,\\n Expired,\\n Executed\\n }\\n\\n /**\\n * @dev Empty proposal or a mismatch between the parameters length for a proposal call.\\n */\\n error GovernorInvalidProposalLength(uint256 targets, uint256 calldatas, uint256 values);\\n\\n /**\\n * @dev The vote was already cast.\\n */\\n error GovernorAlreadyCastVote(address voter);\\n\\n /**\\n * @dev Token deposits are disabled in this contract.\\n */\\n error GovernorDisabledDeposit();\\n\\n /**\\n * @dev The `account` is not a proposer.\\n */\\n error GovernorOnlyProposer(address account);\\n\\n /**\\n * @dev The `account` is not the governance executor.\\n */\\n error GovernorOnlyExecutor(address account);\\n\\n /**\\n * @dev The `proposalId` doesn't exist.\\n */\\n error GovernorNonexistentProposal(uint256 proposalId);\\n\\n /**\\n * @dev The current state of a proposal is not the required for performing an operation.\\n * The `expectedStates` is a bitmap with the bits enabled for each ProposalState enum position\\n * counting from right to left.\\n *\\n * NOTE: If `expectedState` is `bytes32(0)`, the proposal is expected to not be in any state (i.e. not exist).\\n * This is the case when a proposal that is expected to be unset is already initiated (the proposal is duplicated).\\n *\\n * See {Governor-_encodeStateBitmap}.\\n */\\n error GovernorUnexpectedProposalState(uint256 proposalId, ProposalState current, bytes32 expectedStates);\\n\\n /**\\n * @dev The voting period set is not a valid period.\\n */\\n error GovernorInvalidVotingPeriod(uint256 votingPeriod);\\n\\n /**\\n * @dev The `proposer` does not have the required votes to create a proposal.\\n */\\n error GovernorInsufficientProposerVotes(address proposer, uint256 votes, uint256 threshold);\\n\\n /**\\n * @dev The `proposer` is not allowed to create a proposal.\\n */\\n error GovernorRestrictedProposer(address proposer);\\n\\n /**\\n * @dev The vote type used is not valid for the corresponding counting module.\\n */\\n error GovernorInvalidVoteType();\\n\\n /**\\n * @dev The provided params buffer is not supported by the counting module.\\n */\\n error GovernorInvalidVoteParams();\\n\\n /**\\n * @dev Queue operation is not implemented for this governor. Execute should be called directly.\\n */\\n error GovernorQueueNotImplemented();\\n\\n /**\\n * @dev The proposal hasn't been queued yet.\\n */\\n error GovernorNotQueuedProposal(uint256 proposalId);\\n\\n /**\\n * @dev The proposal has already been queued.\\n */\\n error GovernorAlreadyQueuedProposal(uint256 proposalId);\\n\\n /**\\n * @dev The provided signature is not valid for the expected `voter`.\\n * If the `voter` is a contract, the signature is not valid using {IERC1271-isValidSignature}.\\n */\\n error GovernorInvalidSignature(address voter);\\n\\n /**\\n * @dev Emitted when a proposal is created.\\n */\\n event ProposalCreated(\\n uint256 proposalId,\\n address proposer,\\n address[] targets,\\n uint256[] values,\\n string[] signatures,\\n bytes[] calldatas,\\n uint256 voteStart,\\n uint256 voteEnd,\\n string description\\n );\\n\\n /**\\n * @dev Emitted when a proposal is queued.\\n */\\n event ProposalQueued(uint256 proposalId, uint256 etaSeconds);\\n\\n /**\\n * @dev Emitted when a proposal is executed.\\n */\\n event ProposalExecuted(uint256 proposalId);\\n\\n /**\\n * @dev Emitted when a proposal is canceled.\\n */\\n event ProposalCanceled(uint256 proposalId);\\n\\n /**\\n * @dev Emitted when a vote is cast without params.\\n *\\n * Note: `support` values should be seen as buckets. Their interpretation depends on the voting module used.\\n */\\n event VoteCast(address indexed voter, uint256 proposalId, uint8 support, uint256 weight, string reason);\\n\\n /**\\n * @dev Emitted when a vote is cast with params.\\n *\\n * Note: `support` values should be seen as buckets. Their interpretation depends on the voting module used.\\n * `params` are additional encoded parameters. Their interpretation also depends on the voting module used.\\n */\\n event VoteCastWithParams(\\n address indexed voter,\\n uint256 proposalId,\\n uint8 support,\\n uint256 weight,\\n string reason,\\n bytes params\\n );\\n\\n /**\\n * @notice module:core\\n * @dev Name of the governor instance (used in building the EIP-712 domain separator).\\n */\\n function name() external view returns (string memory);\\n\\n /**\\n * @notice module:core\\n * @dev Version of the governor instance (used in building the EIP-712 domain separator). Default: \\\"1\\\"\\n */\\n function version() external view returns (string memory);\\n\\n /**\\n * @notice module:voting\\n * @dev A description of the possible `support` values for {castVote} and the way these votes are counted, meant to\\n * be consumed by UIs to show correct vote options and interpret the results. The string is a URL-encoded sequence of\\n * key-value pairs that each describe one aspect, for example `support=bravo&quorum=for,abstain`.\\n *\\n * There are 2 standard keys: `support` and `quorum`.\\n *\\n * - `support=bravo` refers to the vote options 0 = Against, 1 = For, 2 = Abstain, as in `GovernorBravo`.\\n * - `quorum=bravo` means that only For votes are counted towards quorum.\\n * - `quorum=for,abstain` means that both For and Abstain votes are counted towards quorum.\\n *\\n * If a counting module makes use of encoded `params`, it should include this under a `params` key with a unique\\n * name that describes the behavior. For example:\\n *\\n * - `params=fractional` might refer to a scheme where votes are divided fractionally between for/against/abstain.\\n * - `params=erc721` might refer to a scheme where specific NFTs are delegated to vote.\\n *\\n * NOTE: The string can be decoded by the standard\\n * https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams[`URLSearchParams`]\\n * JavaScript class.\\n */\\n // solhint-disable-next-line func-name-mixedcase\\n function COUNTING_MODE() external view returns (string memory);\\n\\n /**\\n * @notice module:core\\n * @dev Hashing function used to (re)build the proposal id from the proposal details..\\n */\\n function hashProposal(\\n address[] memory targets,\\n uint256[] memory values,\\n bytes[] memory calldatas,\\n bytes32 descriptionHash\\n ) external pure returns (uint256);\\n\\n /**\\n * @notice module:core\\n * @dev Current state of a proposal, following Compound's convention\\n */\\n function state(uint256 proposalId) external view returns (ProposalState);\\n\\n /**\\n * @notice module:core\\n * @dev The number of votes required in order for a voter to become a proposer.\\n */\\n function proposalThreshold() external view returns (uint256);\\n\\n /**\\n * @notice module:core\\n * @dev Timepoint used to retrieve user's votes and quorum. If using block number (as per Compound's Comp), the\\n * snapshot is performed at the end of this block. Hence, voting for this proposal starts at the beginning of the\\n * following block.\\n */\\n function proposalSnapshot(uint256 proposalId) external view returns (uint256);\\n\\n /**\\n * @notice module:core\\n * @dev Timepoint at which votes close. If using block number, votes close at the end of this block, so it is\\n * possible to cast a vote during this block.\\n */\\n function proposalDeadline(uint256 proposalId) external view returns (uint256);\\n\\n /**\\n * @notice module:core\\n * @dev The account that created a proposal.\\n */\\n function proposalProposer(uint256 proposalId) external view returns (address);\\n\\n /**\\n * @notice module:core\\n * @dev The time when a queued proposal becomes executable (\\\"ETA\\\"). Unlike {proposalSnapshot} and\\n * {proposalDeadline}, this doesn't use the governor clock, and instead relies on the executor's clock which may be\\n * different. In most cases this will be a timestamp.\\n */\\n function proposalEta(uint256 proposalId) external view returns (uint256);\\n\\n /**\\n * @notice module:core\\n * @dev Whether a proposal needs to be queued before execution.\\n */\\n function proposalNeedsQueuing(uint256 proposalId) external view returns (bool);\\n\\n /**\\n * @notice module:user-config\\n * @dev Delay, between the proposal is created and the vote starts. The unit this duration is expressed in depends\\n * on the clock (see ERC-6372) this contract uses.\\n *\\n * This can be increased to leave time for users to buy voting power, or delegate it, before the voting of a\\n * proposal starts.\\n *\\n * NOTE: While this interface returns a uint256, timepoints are stored as uint48 following the ERC-6372 clock type.\\n * Consequently this value must fit in a uint48 (when added to the current clock). See {IERC6372-clock}.\\n */\\n function votingDelay() external view returns (uint256);\\n\\n /**\\n * @notice module:user-config\\n * @dev Delay between the vote start and vote end. The unit this duration is expressed in depends on the clock\\n * (see ERC-6372) this contract uses.\\n *\\n * NOTE: The {votingDelay} can delay the start of the vote. This must be considered when setting the voting\\n * duration compared to the voting delay.\\n *\\n * NOTE: This value is stored when the proposal is submitted so that possible changes to the value do not affect\\n * proposals that have already been submitted. The type used to save it is a uint32. Consequently, while this\\n * interface returns a uint256, the value it returns should fit in a uint32.\\n */\\n function votingPeriod() external view returns (uint256);\\n\\n /**\\n * @notice module:user-config\\n * @dev Minimum number of cast voted required for a proposal to be successful.\\n *\\n * NOTE: The `timepoint` parameter corresponds to the snapshot used for counting vote. This allows to scale the\\n * quorum depending on values such as the totalSupply of a token at this timepoint (see {ERC20Votes}).\\n */\\n function quorum(uint256 timepoint) external view returns (uint256);\\n\\n /**\\n * @notice module:reputation\\n * @dev Voting power of an `account` at a specific `timepoint`.\\n *\\n * Note: this can be implemented in a number of ways, for example by reading the delegated balance from one (or\\n * multiple), {ERC20Votes} tokens.\\n */\\n function getVotes(address account, uint256 timepoint) external view returns (uint256);\\n\\n /**\\n * @notice module:reputation\\n * @dev Voting power of an `account` at a specific `timepoint` given additional encoded parameters.\\n */\\n function getVotesWithParams(\\n address account,\\n uint256 timepoint,\\n bytes memory params\\n ) external view returns (uint256);\\n\\n /**\\n * @notice module:voting\\n * @dev Returns whether `account` has cast a vote on `proposalId`.\\n */\\n function hasVoted(uint256 proposalId, address account) external view returns (bool);\\n\\n /**\\n * @dev Create a new proposal. Vote start after a delay specified by {IGovernor-votingDelay} and lasts for a\\n * duration specified by {IGovernor-votingPeriod}.\\n *\\n * Emits a {ProposalCreated} event.\\n *\\n * NOTE: The state of the Governor and `targets` may change between the proposal creation and its execution.\\n * This may be the result of third party actions on the targeted contracts, or other governor proposals.\\n * For example, the balance of this contract could be updated or its access control permissions may be modified,\\n * possibly compromising the proposal's ability to execute successfully (e.g. the governor doesn't have enough\\n * value to cover a proposal with multiple transfers).\\n */\\n function propose(\\n address[] memory targets,\\n uint256[] memory values,\\n bytes[] memory calldatas,\\n string memory description\\n ) external returns (uint256 proposalId);\\n\\n /**\\n * @dev Queue a proposal. Some governors require this step to be performed before execution can happen. If queuing\\n * is not necessary, this function may revert.\\n * Queuing a proposal requires the quorum to be reached, the vote to be successful, and the deadline to be reached.\\n *\\n * Emits a {ProposalQueued} event.\\n */\\n function queue(\\n address[] memory targets,\\n uint256[] memory values,\\n bytes[] memory calldatas,\\n bytes32 descriptionHash\\n ) external returns (uint256 proposalId);\\n\\n /**\\n * @dev Execute a successful proposal. This requires the quorum to be reached, the vote to be successful, and the\\n * deadline to be reached. Depending on the governor it might also be required that the proposal was queued and\\n * that some delay passed.\\n *\\n * Emits a {ProposalExecuted} event.\\n *\\n * NOTE: Some modules can modify the requirements for execution, for example by adding an additional timelock.\\n */\\n function execute(\\n address[] memory targets,\\n uint256[] memory values,\\n bytes[] memory calldatas,\\n bytes32 descriptionHash\\n ) external payable returns (uint256 proposalId);\\n\\n /**\\n * @dev Cancel a proposal. A proposal is cancellable by the proposer, but only while it is Pending state, i.e.\\n * before the vote starts.\\n *\\n * Emits a {ProposalCanceled} event.\\n */\\n function cancel(\\n address[] memory targets,\\n uint256[] memory values,\\n bytes[] memory calldatas,\\n bytes32 descriptionHash\\n ) external returns (uint256 proposalId);\\n\\n /**\\n * @dev Cast a vote\\n *\\n * Emits a {VoteCast} event.\\n */\\n function castVote(uint256 proposalId, uint8 support) external returns (uint256 balance);\\n\\n /**\\n * @dev Cast a vote with a reason\\n *\\n * Emits a {VoteCast} event.\\n */\\n function castVoteWithReason(\\n uint256 proposalId,\\n uint8 support,\\n string calldata reason\\n ) external returns (uint256 balance);\\n\\n /**\\n * @dev Cast a vote with a reason and additional encoded parameters\\n *\\n * Emits a {VoteCast} or {VoteCastWithParams} event depending on the length of params.\\n */\\n function castVoteWithReasonAndParams(\\n uint256 proposalId,\\n uint8 support,\\n string calldata reason,\\n bytes memory params\\n ) external returns (uint256 balance);\\n\\n /**\\n * @dev Cast a vote using the voter's signature, including ERC-1271 signature support.\\n *\\n * Emits a {VoteCast} event.\\n */\\n function castVoteBySig(\\n uint256 proposalId,\\n uint8 support,\\n address voter,\\n bytes memory signature\\n ) external returns (uint256 balance);\\n\\n /**\\n * @dev Cast a vote with a reason and additional encoded parameters using the voter's signature,\\n * including ERC-1271 signature support.\\n *\\n * Emits a {VoteCast} or {VoteCastWithParams} event depending on the length of params.\\n */\\n function castVoteWithReasonAndParamsBySig(\\n uint256 proposalId,\\n uint8 support,\\n address voter,\\n string calldata reason,\\n bytes memory params,\\n bytes memory signature\\n ) external returns (uint256 balance);\\n}\\n\",\"keccak256\":\"0x9406604436e6925413ab70149fec16f3b28cc9e492b2baaa09c0acefd315b2a7\",\"license\":\"MIT\"},\"@openzeppelin/contracts/governance/extensions/GovernorCountingSimple.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (governance/extensions/GovernorCountingSimple.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {Governor} from \\\"../Governor.sol\\\";\\n\\n/**\\n * @dev Extension of {Governor} for simple, 3 options, vote counting.\\n */\\nabstract contract GovernorCountingSimple is Governor {\\n /**\\n * @dev Supported vote types. Matches Governor Bravo ordering.\\n */\\n enum VoteType {\\n Against,\\n For,\\n Abstain\\n }\\n\\n struct ProposalVote {\\n uint256 againstVotes;\\n uint256 forVotes;\\n uint256 abstainVotes;\\n mapping(address voter => bool) hasVoted;\\n }\\n\\n mapping(uint256 proposalId => ProposalVote) private _proposalVotes;\\n\\n /**\\n * @dev See {IGovernor-COUNTING_MODE}.\\n */\\n // solhint-disable-next-line func-name-mixedcase\\n function COUNTING_MODE() public pure virtual override returns (string memory) {\\n return \\\"support=bravo&quorum=for,abstain\\\";\\n }\\n\\n /**\\n * @dev See {IGovernor-hasVoted}.\\n */\\n function hasVoted(uint256 proposalId, address account) public view virtual override returns (bool) {\\n return _proposalVotes[proposalId].hasVoted[account];\\n }\\n\\n /**\\n * @dev Accessor to the internal vote counts.\\n */\\n function proposalVotes(\\n uint256 proposalId\\n ) public view virtual returns (uint256 againstVotes, uint256 forVotes, uint256 abstainVotes) {\\n ProposalVote storage proposalVote = _proposalVotes[proposalId];\\n return (proposalVote.againstVotes, proposalVote.forVotes, proposalVote.abstainVotes);\\n }\\n\\n /**\\n * @dev See {Governor-_quorumReached}.\\n */\\n function _quorumReached(uint256 proposalId) internal view virtual override returns (bool) {\\n ProposalVote storage proposalVote = _proposalVotes[proposalId];\\n\\n return quorum(proposalSnapshot(proposalId)) <= proposalVote.forVotes + proposalVote.abstainVotes;\\n }\\n\\n /**\\n * @dev See {Governor-_voteSucceeded}. In this module, the forVotes must be strictly over the againstVotes.\\n */\\n function _voteSucceeded(uint256 proposalId) internal view virtual override returns (bool) {\\n ProposalVote storage proposalVote = _proposalVotes[proposalId];\\n\\n return proposalVote.forVotes > proposalVote.againstVotes;\\n }\\n\\n /**\\n * @dev See {Governor-_countVote}. In this module, the support follows the `VoteType` enum (from Governor Bravo).\\n */\\n function _countVote(\\n uint256 proposalId,\\n address account,\\n uint8 support,\\n uint256 totalWeight,\\n bytes memory // params\\n ) internal virtual override returns (uint256) {\\n ProposalVote storage proposalVote = _proposalVotes[proposalId];\\n\\n if (proposalVote.hasVoted[account]) {\\n revert GovernorAlreadyCastVote(account);\\n }\\n proposalVote.hasVoted[account] = true;\\n\\n if (support == uint8(VoteType.Against)) {\\n proposalVote.againstVotes += totalWeight;\\n } else if (support == uint8(VoteType.For)) {\\n proposalVote.forVotes += totalWeight;\\n } else if (support == uint8(VoteType.Abstain)) {\\n proposalVote.abstainVotes += totalWeight;\\n } else {\\n revert GovernorInvalidVoteType();\\n }\\n\\n return totalWeight;\\n }\\n}\\n\",\"keccak256\":\"0xdc21c15a8582ca58529bf4b63209718a86fd944cbb206a492687333fe8cce0ff\",\"license\":\"MIT\"},\"@openzeppelin/contracts/governance/extensions/GovernorSettings.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (governance/extensions/GovernorSettings.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {Governor} from \\\"../Governor.sol\\\";\\n\\n/**\\n * @dev Extension of {Governor} for settings updatable through governance.\\n */\\nabstract contract GovernorSettings is Governor {\\n // amount of token\\n uint256 private _proposalThreshold;\\n // timepoint: limited to uint48 in core (same as clock() type)\\n uint48 private _votingDelay;\\n // duration: limited to uint32 in core\\n uint32 private _votingPeriod;\\n\\n event VotingDelaySet(uint256 oldVotingDelay, uint256 newVotingDelay);\\n event VotingPeriodSet(uint256 oldVotingPeriod, uint256 newVotingPeriod);\\n event ProposalThresholdSet(uint256 oldProposalThreshold, uint256 newProposalThreshold);\\n\\n /**\\n * @dev Initialize the governance parameters.\\n */\\n constructor(uint48 initialVotingDelay, uint32 initialVotingPeriod, uint256 initialProposalThreshold) {\\n _setVotingDelay(initialVotingDelay);\\n _setVotingPeriod(initialVotingPeriod);\\n _setProposalThreshold(initialProposalThreshold);\\n }\\n\\n /**\\n * @dev See {IGovernor-votingDelay}.\\n */\\n function votingDelay() public view virtual override returns (uint256) {\\n return _votingDelay;\\n }\\n\\n /**\\n * @dev See {IGovernor-votingPeriod}.\\n */\\n function votingPeriod() public view virtual override returns (uint256) {\\n return _votingPeriod;\\n }\\n\\n /**\\n * @dev See {Governor-proposalThreshold}.\\n */\\n function proposalThreshold() public view virtual override returns (uint256) {\\n return _proposalThreshold;\\n }\\n\\n /**\\n * @dev Update the voting delay. This operation can only be performed through a governance proposal.\\n *\\n * Emits a {VotingDelaySet} event.\\n */\\n function setVotingDelay(uint48 newVotingDelay) public virtual onlyGovernance {\\n _setVotingDelay(newVotingDelay);\\n }\\n\\n /**\\n * @dev Update the voting period. This operation can only be performed through a governance proposal.\\n *\\n * Emits a {VotingPeriodSet} event.\\n */\\n function setVotingPeriod(uint32 newVotingPeriod) public virtual onlyGovernance {\\n _setVotingPeriod(newVotingPeriod);\\n }\\n\\n /**\\n * @dev Update the proposal threshold. This operation can only be performed through a governance proposal.\\n *\\n * Emits a {ProposalThresholdSet} event.\\n */\\n function setProposalThreshold(uint256 newProposalThreshold) public virtual onlyGovernance {\\n _setProposalThreshold(newProposalThreshold);\\n }\\n\\n /**\\n * @dev Internal setter for the voting delay.\\n *\\n * Emits a {VotingDelaySet} event.\\n */\\n function _setVotingDelay(uint48 newVotingDelay) internal virtual {\\n emit VotingDelaySet(_votingDelay, newVotingDelay);\\n _votingDelay = newVotingDelay;\\n }\\n\\n /**\\n * @dev Internal setter for the voting period.\\n *\\n * Emits a {VotingPeriodSet} event.\\n */\\n function _setVotingPeriod(uint32 newVotingPeriod) internal virtual {\\n if (newVotingPeriod == 0) {\\n revert GovernorInvalidVotingPeriod(0);\\n }\\n emit VotingPeriodSet(_votingPeriod, newVotingPeriod);\\n _votingPeriod = newVotingPeriod;\\n }\\n\\n /**\\n * @dev Internal setter for the proposal threshold.\\n *\\n * Emits a {ProposalThresholdSet} event.\\n */\\n function _setProposalThreshold(uint256 newProposalThreshold) internal virtual {\\n emit ProposalThresholdSet(_proposalThreshold, newProposalThreshold);\\n _proposalThreshold = newProposalThreshold;\\n }\\n}\\n\",\"keccak256\":\"0x1e0810708b8f5de8d3db73240ccee2d36a305cb904aa5acd4588834ebce6acce\",\"license\":\"MIT\"},\"@openzeppelin/contracts/governance/extensions/GovernorVotes.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (governance/extensions/GovernorVotes.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {Governor} from \\\"../Governor.sol\\\";\\nimport {IVotes} from \\\"../utils/IVotes.sol\\\";\\nimport {IERC5805} from \\\"../../interfaces/IERC5805.sol\\\";\\nimport {SafeCast} from \\\"../../utils/math/SafeCast.sol\\\";\\nimport {Time} from \\\"../../utils/types/Time.sol\\\";\\n\\n/**\\n * @dev Extension of {Governor} for voting weight extraction from an {ERC20Votes} token, or since v4.5 an {ERC721Votes}\\n * token.\\n */\\nabstract contract GovernorVotes is Governor {\\n IERC5805 private immutable _token;\\n\\n constructor(IVotes tokenAddress) {\\n _token = IERC5805(address(tokenAddress));\\n }\\n\\n /**\\n * @dev The token that voting power is sourced from.\\n */\\n function token() public view virtual returns (IERC5805) {\\n return _token;\\n }\\n\\n /**\\n * @dev Clock (as specified in ERC-6372) is set to match the token's clock. Fallback to block numbers if the token\\n * does not implement ERC-6372.\\n */\\n function clock() public view virtual override returns (uint48) {\\n try token().clock() returns (uint48 timepoint) {\\n return timepoint;\\n } catch {\\n return Time.blockNumber();\\n }\\n }\\n\\n /**\\n * @dev Machine-readable description of the clock as specified in ERC-6372.\\n */\\n // solhint-disable-next-line func-name-mixedcase\\n function CLOCK_MODE() public view virtual override returns (string memory) {\\n try token().CLOCK_MODE() returns (string memory clockmode) {\\n return clockmode;\\n } catch {\\n return \\\"mode=blocknumber&from=default\\\";\\n }\\n }\\n\\n /**\\n * Read the voting weight from the token's built in snapshot mechanism (see {Governor-_getVotes}).\\n */\\n function _getVotes(\\n address account,\\n uint256 timepoint,\\n bytes memory /*params*/\\n ) internal view virtual override returns (uint256) {\\n return token().getPastVotes(account, timepoint);\\n }\\n}\\n\",\"keccak256\":\"0x6fc0e9e0c3ed137dc2281a120cdc01b92010a26e6fd5fc4e6af08fc0f28bdb9e\",\"license\":\"MIT\"},\"@openzeppelin/contracts/governance/extensions/GovernorVotesQuorumFraction.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (governance/extensions/GovernorVotesQuorumFraction.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {GovernorVotes} from \\\"./GovernorVotes.sol\\\";\\nimport {SafeCast} from \\\"../../utils/math/SafeCast.sol\\\";\\nimport {Checkpoints} from \\\"../../utils/structs/Checkpoints.sol\\\";\\n\\n/**\\n * @dev Extension of {Governor} for voting weight extraction from an {ERC20Votes} token and a quorum expressed as a\\n * fraction of the total supply.\\n */\\nabstract contract GovernorVotesQuorumFraction is GovernorVotes {\\n using Checkpoints for Checkpoints.Trace208;\\n\\n Checkpoints.Trace208 private _quorumNumeratorHistory;\\n\\n event QuorumNumeratorUpdated(uint256 oldQuorumNumerator, uint256 newQuorumNumerator);\\n\\n /**\\n * @dev The quorum set is not a valid fraction.\\n */\\n error GovernorInvalidQuorumFraction(uint256 quorumNumerator, uint256 quorumDenominator);\\n\\n /**\\n * @dev Initialize quorum as a fraction of the token's total supply.\\n *\\n * The fraction is specified as `numerator / denominator`. By default the denominator is 100, so quorum is\\n * specified as a percent: a numerator of 10 corresponds to quorum being 10% of total supply. The denominator can be\\n * customized by overriding {quorumDenominator}.\\n */\\n constructor(uint256 quorumNumeratorValue) {\\n _updateQuorumNumerator(quorumNumeratorValue);\\n }\\n\\n /**\\n * @dev Returns the current quorum numerator. See {quorumDenominator}.\\n */\\n function quorumNumerator() public view virtual returns (uint256) {\\n return _quorumNumeratorHistory.latest();\\n }\\n\\n /**\\n * @dev Returns the quorum numerator at a specific timepoint. See {quorumDenominator}.\\n */\\n function quorumNumerator(uint256 timepoint) public view virtual returns (uint256) {\\n uint256 length = _quorumNumeratorHistory._checkpoints.length;\\n\\n // Optimistic search, check the latest checkpoint\\n Checkpoints.Checkpoint208 storage latest = _quorumNumeratorHistory._checkpoints[length - 1];\\n uint48 latestKey = latest._key;\\n uint208 latestValue = latest._value;\\n if (latestKey <= timepoint) {\\n return latestValue;\\n }\\n\\n // Otherwise, do the binary search\\n return _quorumNumeratorHistory.upperLookupRecent(SafeCast.toUint48(timepoint));\\n }\\n\\n /**\\n * @dev Returns the quorum denominator. Defaults to 100, but may be overridden.\\n */\\n function quorumDenominator() public view virtual returns (uint256) {\\n return 100;\\n }\\n\\n /**\\n * @dev Returns the quorum for a timepoint, in terms of number of votes: `supply * numerator / denominator`.\\n */\\n function quorum(uint256 timepoint) public view virtual override returns (uint256) {\\n return (token().getPastTotalSupply(timepoint) * quorumNumerator(timepoint)) / quorumDenominator();\\n }\\n\\n /**\\n * @dev Changes the quorum numerator.\\n *\\n * Emits a {QuorumNumeratorUpdated} event.\\n *\\n * Requirements:\\n *\\n * - Must be called through a governance proposal.\\n * - New numerator must be smaller or equal to the denominator.\\n */\\n function updateQuorumNumerator(uint256 newQuorumNumerator) external virtual onlyGovernance {\\n _updateQuorumNumerator(newQuorumNumerator);\\n }\\n\\n /**\\n * @dev Changes the quorum numerator.\\n *\\n * Emits a {QuorumNumeratorUpdated} event.\\n *\\n * Requirements:\\n *\\n * - New numerator must be smaller or equal to the denominator.\\n */\\n function _updateQuorumNumerator(uint256 newQuorumNumerator) internal virtual {\\n uint256 denominator = quorumDenominator();\\n if (newQuorumNumerator > denominator) {\\n revert GovernorInvalidQuorumFraction(newQuorumNumerator, denominator);\\n }\\n\\n uint256 oldQuorumNumerator = quorumNumerator();\\n _quorumNumeratorHistory.push(clock(), SafeCast.toUint208(newQuorumNumerator));\\n\\n emit QuorumNumeratorUpdated(oldQuorumNumerator, newQuorumNumerator);\\n }\\n}\\n\",\"keccak256\":\"0x5b5cdb361ed018c0162942d673c17e187c1a52ded2ce4f41e8a3f3f5d1656e00\",\"license\":\"MIT\"},\"@openzeppelin/contracts/governance/utils/IVotes.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (governance/utils/IVotes.sol)\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Common interface for {ERC20Votes}, {ERC721Votes}, and other {Votes}-enabled contracts.\\n */\\ninterface IVotes {\\n /**\\n * @dev The signature used has expired.\\n */\\n error VotesExpiredSignature(uint256 expiry);\\n\\n /**\\n * @dev Emitted when an account changes their delegate.\\n */\\n event DelegateChanged(address indexed delegator, address indexed fromDelegate, address indexed toDelegate);\\n\\n /**\\n * @dev Emitted when a token transfer or delegate change results in changes to a delegate's number of voting units.\\n */\\n event DelegateVotesChanged(address indexed delegate, uint256 previousVotes, uint256 newVotes);\\n\\n /**\\n * @dev Returns the current amount of votes that `account` has.\\n */\\n function getVotes(address account) external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of votes that `account` had at a specific moment in the past. If the `clock()` is\\n * configured to use block numbers, this will return the value at the end of the corresponding block.\\n */\\n function getPastVotes(address account, uint256 timepoint) external view returns (uint256);\\n\\n /**\\n * @dev Returns the total supply of votes available at a specific moment in the past. If the `clock()` is\\n * configured to use block numbers, this will return the value at the end of the corresponding block.\\n *\\n * NOTE: This value is the sum of all available votes, which is not necessarily the sum of all delegated votes.\\n * Votes that have not been delegated are still part of total supply, even though they would not participate in a\\n * vote.\\n */\\n function getPastTotalSupply(uint256 timepoint) external view returns (uint256);\\n\\n /**\\n * @dev Returns the delegate that `account` has chosen.\\n */\\n function delegates(address account) external view returns (address);\\n\\n /**\\n * @dev Delegates votes from the sender to `delegatee`.\\n */\\n function delegate(address delegatee) external;\\n\\n /**\\n * @dev Delegates votes from signer to `delegatee`.\\n */\\n function delegateBySig(address delegatee, uint256 nonce, uint256 expiry, uint8 v, bytes32 r, bytes32 s) external;\\n}\\n\",\"keccak256\":\"0x5e2b397ae88fd5c68e4f6762eb9f65f65c36702eb57796495f471d024ce70947\",\"license\":\"MIT\"},\"@openzeppelin/contracts/interfaces/IERC1271.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (interfaces/IERC1271.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Interface of the ERC-1271 standard signature validation method for\\n * contracts as defined in https://eips.ethereum.org/EIPS/eip-1271[ERC-1271].\\n */\\ninterface IERC1271 {\\n /**\\n * @dev Should return whether the signature provided is valid for the provided data\\n * @param hash Hash of the data to be signed\\n * @param signature Signature byte array associated with _data\\n */\\n function isValidSignature(bytes32 hash, bytes memory signature) external view returns (bytes4 magicValue);\\n}\\n\",\"keccak256\":\"0x4aaaf1c0737dd16e81f0d2b9833c549747a5ede6873bf1444bc72aa572d03e98\",\"license\":\"MIT\"},\"@openzeppelin/contracts/interfaces/IERC165.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC165.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {IERC165} from \\\"../utils/introspection/IERC165.sol\\\";\\n\",\"keccak256\":\"0xde7e9fd9aee8d4f40772f96bb3b58836cbc6dfc0227014a061947f8821ea9724\",\"license\":\"MIT\"},\"@openzeppelin/contracts/interfaces/IERC5267.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC5267.sol)\\n\\npragma solidity ^0.8.20;\\n\\ninterface IERC5267 {\\n /**\\n * @dev MAY be emitted to signal that the domain could have changed.\\n */\\n event EIP712DomainChanged();\\n\\n /**\\n * @dev returns the fields and values that describe the domain separator used by this contract for EIP-712\\n * signature.\\n */\\n function eip712Domain()\\n external\\n view\\n returns (\\n bytes1 fields,\\n string memory name,\\n string memory version,\\n uint256 chainId,\\n address verifyingContract,\\n bytes32 salt,\\n uint256[] memory extensions\\n );\\n}\\n\",\"keccak256\":\"0x92aa1df62dc3d33f1656d63bede0923e0df0b706ad4137c8b10b0a8fe549fd92\",\"license\":\"MIT\"},\"@openzeppelin/contracts/interfaces/IERC5805.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC5805.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {IVotes} from \\\"../governance/utils/IVotes.sol\\\";\\nimport {IERC6372} from \\\"./IERC6372.sol\\\";\\n\\ninterface IERC5805 is IERC6372, IVotes {}\\n\",\"keccak256\":\"0x4b9b89f91adbb7d3574f85394754cfb08c5b4eafca8a7061e2094a019ab8f818\",\"license\":\"MIT\"},\"@openzeppelin/contracts/interfaces/IERC6372.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC6372.sol)\\n\\npragma solidity ^0.8.20;\\n\\ninterface IERC6372 {\\n /**\\n * @dev Clock used for flagging checkpoints. Can be overridden to implement timestamp based checkpoints (and voting).\\n */\\n function clock() external view returns (uint48);\\n\\n /**\\n * @dev Description of the clock\\n */\\n // solhint-disable-next-line func-name-mixedcase\\n function CLOCK_MODE() external view returns (string memory);\\n}\\n\",\"keccak256\":\"0xeb2857b7dafb7e0d8526dbfe794e6c047df2851c9e6ee91dc4a55f3c34af5d33\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC1155/IERC1155Receiver.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC1155/IERC1155Receiver.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {IERC165} from \\\"../../utils/introspection/IERC165.sol\\\";\\n\\n/**\\n * @dev Interface that must be implemented by smart contracts in order to receive\\n * ERC-1155 token transfers.\\n */\\ninterface IERC1155Receiver is IERC165 {\\n /**\\n * @dev Handles the receipt of a single ERC-1155 token type. This function is\\n * called at the end of a `safeTransferFrom` after the balance has been updated.\\n *\\n * NOTE: To accept the transfer, this must return\\n * `bytes4(keccak256(\\\"onERC1155Received(address,address,uint256,uint256,bytes)\\\"))`\\n * (i.e. 0xf23a6e61, or its own function selector).\\n *\\n * @param operator The address which initiated the transfer (i.e. msg.sender)\\n * @param from The address which previously owned the token\\n * @param id The ID of the token being transferred\\n * @param value The amount of tokens being transferred\\n * @param data Additional data with no specified format\\n * @return `bytes4(keccak256(\\\"onERC1155Received(address,address,uint256,uint256,bytes)\\\"))` if transfer is allowed\\n */\\n function onERC1155Received(\\n address operator,\\n address from,\\n uint256 id,\\n uint256 value,\\n bytes calldata data\\n ) external returns (bytes4);\\n\\n /**\\n * @dev Handles the receipt of a multiple ERC-1155 token types. This function\\n * is called at the end of a `safeBatchTransferFrom` after the balances have\\n * been updated.\\n *\\n * NOTE: To accept the transfer(s), this must return\\n * `bytes4(keccak256(\\\"onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)\\\"))`\\n * (i.e. 0xbc197c81, or its own function selector).\\n *\\n * @param operator The address which initiated the batch transfer (i.e. msg.sender)\\n * @param from The address which previously owned the token\\n * @param ids An array containing ids of each token being transferred (order and length must match values array)\\n * @param values An array containing amounts of each token being transferred (order and length must match ids array)\\n * @param data Additional data with no specified format\\n * @return `bytes4(keccak256(\\\"onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)\\\"))` if transfer is allowed\\n */\\n function onERC1155BatchReceived(\\n address operator,\\n address from,\\n uint256[] calldata ids,\\n uint256[] calldata values,\\n bytes calldata data\\n ) external returns (bytes4);\\n}\\n\",\"keccak256\":\"0x61a23d601c2ab69dd726ac55058604cbda98e1d728ba31a51c379a3f9eeea715\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC721/IERC721Receiver.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @title ERC-721 token receiver interface\\n * @dev Interface for any contract that wants to support safeTransfers\\n * from ERC-721 asset contracts.\\n */\\ninterface IERC721Receiver {\\n /**\\n * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom}\\n * by `operator` from `from`, this function is called.\\n *\\n * It must return its Solidity selector to confirm the token transfer.\\n * If any other value is returned or the interface is not implemented by the recipient, the transfer will be\\n * reverted.\\n *\\n * The selector can be obtained in Solidity with `IERC721Receiver.onERC721Received.selector`.\\n */\\n function onERC721Received(\\n address operator,\\n address from,\\n uint256 tokenId,\\n bytes calldata data\\n ) external returns (bytes4);\\n}\\n\",\"keccak256\":\"0xb5afb8e8eebc4d1c6404df2f5e1e6d2c3d24fd01e5dfc855314951ecfaae462d\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {Errors} from \\\"./Errors.sol\\\";\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev There's no code at `target` (it is not a contract).\\n */\\n error AddressEmptyCode(address target);\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.8.20/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n if (address(this).balance < amount) {\\n revert Errors.InsufficientBalance(address(this).balance, amount);\\n }\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n if (!success) {\\n revert Errors.FailedCall();\\n }\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason or custom error, it is bubbled\\n * up by this function (like regular Solidity function calls). However, if\\n * the call reverted with no returned reason, this function reverts with a\\n * {Errors.FailedCall} error.\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n */\\n function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {\\n if (address(this).balance < value) {\\n revert Errors.InsufficientBalance(address(this).balance, value);\\n }\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResultFromTarget(target, success, returndata);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResultFromTarget(target, success, returndata);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResultFromTarget(target, success, returndata);\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call to smart-contract was successful, and reverts if the target\\n * was not a contract or bubbling up the revert reason (falling back to {Errors.FailedCall}) in case\\n * of an unsuccessful call.\\n */\\n function verifyCallResultFromTarget(\\n address target,\\n bool success,\\n bytes memory returndata\\n ) internal view returns (bytes memory) {\\n if (!success) {\\n _revert(returndata);\\n } else {\\n // only check if target is a contract if the call was successful and the return data is empty\\n // otherwise we already know that it was a contract\\n if (returndata.length == 0 && target.code.length == 0) {\\n revert AddressEmptyCode(target);\\n }\\n return returndata;\\n }\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call was successful, and reverts if it wasn't, either by bubbling the\\n * revert reason or with a default {Errors.FailedCall} error.\\n */\\n function verifyCallResult(bool success, bytes memory returndata) internal pure returns (bytes memory) {\\n if (!success) {\\n _revert(returndata);\\n } else {\\n return returndata;\\n }\\n }\\n\\n /**\\n * @dev Reverts with returndata if present. Otherwise reverts with {Errors.FailedCall}.\\n */\\n function _revert(bytes memory returndata) private pure {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n assembly (\\\"memory-safe\\\") {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert Errors.FailedCall();\\n }\\n }\\n}\\n\",\"keccak256\":\"0x9d8da059267bac779a2dbbb9a26c2acf00ca83085e105d62d5d4ef96054a47f5\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)\\n\\npragma solidity ^0.8.20;\\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\":\"0x493033a8d1b176a037b2cc6a04dad01a5c157722049bbecf632ca876224dd4b2\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Errors.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/Errors.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Collection of common custom errors used in multiple contracts\\n *\\n * IMPORTANT: Backwards compatibility is not guaranteed in future versions of the library.\\n * It is recommended to avoid relying on the error API for critical functionality.\\n *\\n * _Available since v5.1._\\n */\\nlibrary Errors {\\n /**\\n * @dev The ETH balance of the account is not enough to perform the operation.\\n */\\n error InsufficientBalance(uint256 balance, uint256 needed);\\n\\n /**\\n * @dev A call to an address target failed. The target may have reverted.\\n */\\n error FailedCall();\\n\\n /**\\n * @dev The deployment failed.\\n */\\n error FailedDeployment();\\n\\n /**\\n * @dev A necessary precompile is missing.\\n */\\n error MissingPrecompile(address);\\n}\\n\",\"keccak256\":\"0x6afa713bfd42cf0f7656efa91201007ac465e42049d7de1d50753a373648c123\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Nonces.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/Nonces.sol)\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Provides tracking nonces for addresses. Nonces will only increment.\\n */\\nabstract contract Nonces {\\n /**\\n * @dev The nonce used for an `account` is not the expected current nonce.\\n */\\n error InvalidAccountNonce(address account, uint256 currentNonce);\\n\\n mapping(address account => uint256) private _nonces;\\n\\n /**\\n * @dev Returns the next unused nonce for an address.\\n */\\n function nonces(address owner) public view virtual returns (uint256) {\\n return _nonces[owner];\\n }\\n\\n /**\\n * @dev Consumes a nonce.\\n *\\n * Returns the current value and increments nonce.\\n */\\n function _useNonce(address owner) internal virtual returns (uint256) {\\n // For each account, the nonce has an initial value of 0, can only be incremented by one, and cannot be\\n // decremented or reset. This guarantees that the nonce never overflows.\\n unchecked {\\n // It is important to do x++ and not ++x here.\\n return _nonces[owner]++;\\n }\\n }\\n\\n /**\\n * @dev Same as {_useNonce} but checking that `nonce` is the next valid for `owner`.\\n */\\n function _useCheckedNonce(address owner, uint256 nonce) internal virtual {\\n uint256 current = _useNonce(owner);\\n if (nonce != current) {\\n revert InvalidAccountNonce(owner, current);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x0082767004fca261c332e9ad100868327a863a88ef724e844857128845ab350f\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Panic.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/Panic.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Helper library for emitting standardized panic codes.\\n *\\n * ```solidity\\n * contract Example {\\n * using Panic for uint256;\\n *\\n * // Use any of the declared internal constants\\n * function foo() { Panic.GENERIC.panic(); }\\n *\\n * // Alternatively\\n * function foo() { Panic.panic(Panic.GENERIC); }\\n * }\\n * ```\\n *\\n * Follows the list from https://github.com/ethereum/solidity/blob/v0.8.24/libsolutil/ErrorCodes.h[libsolutil].\\n *\\n * _Available since v5.1._\\n */\\n// slither-disable-next-line unused-state\\nlibrary Panic {\\n /// @dev generic / unspecified error\\n uint256 internal constant GENERIC = 0x00;\\n /// @dev used by the assert() builtin\\n uint256 internal constant ASSERT = 0x01;\\n /// @dev arithmetic underflow or overflow\\n uint256 internal constant UNDER_OVERFLOW = 0x11;\\n /// @dev division or modulo by zero\\n uint256 internal constant DIVISION_BY_ZERO = 0x12;\\n /// @dev enum conversion error\\n uint256 internal constant ENUM_CONVERSION_ERROR = 0x21;\\n /// @dev invalid encoding in storage\\n uint256 internal constant STORAGE_ENCODING_ERROR = 0x22;\\n /// @dev empty array pop\\n uint256 internal constant EMPTY_ARRAY_POP = 0x31;\\n /// @dev array out of bounds access\\n uint256 internal constant ARRAY_OUT_OF_BOUNDS = 0x32;\\n /// @dev resource error (too large allocation or too large array)\\n uint256 internal constant RESOURCE_ERROR = 0x41;\\n /// @dev calling invalid internal function\\n uint256 internal constant INVALID_INTERNAL_FUNCTION = 0x51;\\n\\n /// @dev Reverts with a panic code. Recommended to use with\\n /// the internal constants with predefined codes.\\n function panic(uint256 code) internal pure {\\n assembly (\\\"memory-safe\\\") {\\n mstore(0x00, 0x4e487b71)\\n mstore(0x20, code)\\n revert(0x1c, 0x24)\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf7fe324703a64fc51702311dc51562d5cb1497734f074e4f483bfb6717572d7a\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/ShortStrings.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/ShortStrings.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {StorageSlot} from \\\"./StorageSlot.sol\\\";\\n\\n// | string | 0xAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA |\\n// | length | 0x BB |\\ntype ShortString is bytes32;\\n\\n/**\\n * @dev This library provides functions to convert short memory strings\\n * into a `ShortString` type that can be used as an immutable variable.\\n *\\n * Strings of arbitrary length can be optimized using this library if\\n * they are short enough (up to 31 bytes) by packing them with their\\n * length (1 byte) in a single EVM word (32 bytes). Additionally, a\\n * fallback mechanism can be used for every other case.\\n *\\n * Usage example:\\n *\\n * ```solidity\\n * contract Named {\\n * using ShortStrings for *;\\n *\\n * ShortString private immutable _name;\\n * string private _nameFallback;\\n *\\n * constructor(string memory contractName) {\\n * _name = contractName.toShortStringWithFallback(_nameFallback);\\n * }\\n *\\n * function name() external view returns (string memory) {\\n * return _name.toStringWithFallback(_nameFallback);\\n * }\\n * }\\n * ```\\n */\\nlibrary ShortStrings {\\n // Used as an identifier for strings longer than 31 bytes.\\n bytes32 private constant FALLBACK_SENTINEL = 0x00000000000000000000000000000000000000000000000000000000000000FF;\\n\\n error StringTooLong(string str);\\n error InvalidShortString();\\n\\n /**\\n * @dev Encode a string of at most 31 chars into a `ShortString`.\\n *\\n * This will trigger a `StringTooLong` error is the input string is too long.\\n */\\n function toShortString(string memory str) internal pure returns (ShortString) {\\n bytes memory bstr = bytes(str);\\n if (bstr.length > 31) {\\n revert StringTooLong(str);\\n }\\n return ShortString.wrap(bytes32(uint256(bytes32(bstr)) | bstr.length));\\n }\\n\\n /**\\n * @dev Decode a `ShortString` back to a \\\"normal\\\" string.\\n */\\n function toString(ShortString sstr) internal pure returns (string memory) {\\n uint256 len = byteLength(sstr);\\n // using `new string(len)` would work locally but is not memory safe.\\n string memory str = new string(32);\\n assembly (\\\"memory-safe\\\") {\\n mstore(str, len)\\n mstore(add(str, 0x20), sstr)\\n }\\n return str;\\n }\\n\\n /**\\n * @dev Return the length of a `ShortString`.\\n */\\n function byteLength(ShortString sstr) internal pure returns (uint256) {\\n uint256 result = uint256(ShortString.unwrap(sstr)) & 0xFF;\\n if (result > 31) {\\n revert InvalidShortString();\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Encode a string into a `ShortString`, or write it to storage if it is too long.\\n */\\n function toShortStringWithFallback(string memory value, string storage store) internal returns (ShortString) {\\n if (bytes(value).length < 32) {\\n return toShortString(value);\\n } else {\\n StorageSlot.getStringSlot(store).value = value;\\n return ShortString.wrap(FALLBACK_SENTINEL);\\n }\\n }\\n\\n /**\\n * @dev Decode a string that was encoded to `ShortString` or written to storage using {setWithFallback}.\\n */\\n function toStringWithFallback(ShortString value, string storage store) internal pure returns (string memory) {\\n if (ShortString.unwrap(value) != FALLBACK_SENTINEL) {\\n return toString(value);\\n } else {\\n return store;\\n }\\n }\\n\\n /**\\n * @dev Return the length of a string that was encoded to `ShortString` or written to storage using\\n * {setWithFallback}.\\n *\\n * WARNING: This will return the \\\"byte length\\\" of the string. This may not reflect the actual length in terms of\\n * actual characters as the UTF-8 encoding of a single character can span over multiple bytes.\\n */\\n function byteLengthWithFallback(ShortString value, string storage store) internal view returns (uint256) {\\n if (ShortString.unwrap(value) != FALLBACK_SENTINEL) {\\n return byteLength(value);\\n } else {\\n return bytes(store).length;\\n }\\n }\\n}\\n\",\"keccak256\":\"0x7d94fa0af099a2172eb01f9c8a8a443cbe7e0e43654841563e4e09968efdb549\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/StorageSlot.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/StorageSlot.sol)\\n// This file was procedurally generated from scripts/generate/templates/StorageSlot.js.\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Library for reading and writing primitive types to specific storage slots.\\n *\\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\\n * This library helps with reading and writing to such slots without the need for inline assembly.\\n *\\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\\n *\\n * Example usage to set ERC-1967 implementation slot:\\n * ```solidity\\n * contract ERC1967 {\\n * // Define the slot. Alternatively, use the SlotDerivation library to derive the slot.\\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n *\\n * function _getImplementation() internal view returns (address) {\\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n * }\\n *\\n * function _setImplementation(address newImplementation) internal {\\n * require(newImplementation.code.length > 0);\\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n * }\\n * }\\n * ```\\n *\\n * TIP: Consider using this library along with {SlotDerivation}.\\n */\\nlibrary StorageSlot {\\n struct AddressSlot {\\n address value;\\n }\\n\\n struct BooleanSlot {\\n bool value;\\n }\\n\\n struct Bytes32Slot {\\n bytes32 value;\\n }\\n\\n struct Uint256Slot {\\n uint256 value;\\n }\\n\\n struct Int256Slot {\\n int256 value;\\n }\\n\\n struct StringSlot {\\n string value;\\n }\\n\\n struct BytesSlot {\\n bytes value;\\n }\\n\\n /**\\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\\n */\\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\\n assembly (\\\"memory-safe\\\") {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns a `BooleanSlot` with member `value` located at `slot`.\\n */\\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\\n assembly (\\\"memory-safe\\\") {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns a `Bytes32Slot` with member `value` located at `slot`.\\n */\\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\\n assembly (\\\"memory-safe\\\") {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns a `Uint256Slot` with member `value` located at `slot`.\\n */\\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\\n assembly (\\\"memory-safe\\\") {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns a `Int256Slot` with member `value` located at `slot`.\\n */\\n function getInt256Slot(bytes32 slot) internal pure returns (Int256Slot storage r) {\\n assembly (\\\"memory-safe\\\") {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns a `StringSlot` with member `value` located at `slot`.\\n */\\n function getStringSlot(bytes32 slot) internal pure returns (StringSlot storage r) {\\n assembly (\\\"memory-safe\\\") {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `StringSlot` representation of the string storage pointer `store`.\\n */\\n function getStringSlot(string storage store) internal pure returns (StringSlot storage r) {\\n assembly (\\\"memory-safe\\\") {\\n r.slot := store.slot\\n }\\n }\\n\\n /**\\n * @dev Returns a `BytesSlot` with member `value` located at `slot`.\\n */\\n function getBytesSlot(bytes32 slot) internal pure returns (BytesSlot storage r) {\\n assembly (\\\"memory-safe\\\") {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `BytesSlot` representation of the bytes storage pointer `store`.\\n */\\n function getBytesSlot(bytes storage store) internal pure returns (BytesSlot storage r) {\\n assembly (\\\"memory-safe\\\") {\\n r.slot := store.slot\\n }\\n }\\n}\\n\",\"keccak256\":\"0xcf74f855663ce2ae00ed8352666b7935f6cddea2932fdf2c3ecd30a9b1cd0e97\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Strings.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/Strings.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {Math} from \\\"./math/Math.sol\\\";\\nimport {SignedMath} from \\\"./math/SignedMath.sol\\\";\\n\\n/**\\n * @dev String operations.\\n */\\nlibrary Strings {\\n bytes16 private constant HEX_DIGITS = \\\"0123456789abcdef\\\";\\n uint8 private constant ADDRESS_LENGTH = 20;\\n\\n /**\\n * @dev The `value` string doesn't fit in the specified `length`.\\n */\\n error StringsInsufficientHexLength(uint256 value, uint256 length);\\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 assembly (\\\"memory-safe\\\") {\\n ptr := add(buffer, add(32, length))\\n }\\n while (true) {\\n ptr--;\\n assembly (\\\"memory-safe\\\") {\\n mstore8(ptr, byte(mod(value, 10), HEX_DIGITS))\\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 toStringSigned(int256 value) internal pure returns (string memory) {\\n return string.concat(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 uint256 localValue = value;\\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] = HEX_DIGITS[localValue & 0xf];\\n localValue >>= 4;\\n }\\n if (localValue != 0) {\\n revert StringsInsufficientHexLength(value, length);\\n }\\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\\n * 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 Converts an `address` with fixed length of 20 bytes to its checksummed ASCII `string` hexadecimal\\n * representation, according to EIP-55.\\n */\\n function toChecksumHexString(address addr) internal pure returns (string memory) {\\n bytes memory buffer = bytes(toHexString(addr));\\n\\n // hash the hex part of buffer (skip length + 2 bytes, length 40)\\n uint256 hashValue;\\n assembly (\\\"memory-safe\\\") {\\n hashValue := shr(96, keccak256(add(buffer, 0x22), 40))\\n }\\n\\n for (uint256 i = 41; i > 1; --i) {\\n // possible values for buffer[i] are 48 (0) to 57 (9) and 97 (a) to 102 (f)\\n if (hashValue & 0xf > 7 && uint8(buffer[i]) > 96) {\\n // case shift by xoring with 0x20\\n buffer[i] ^= 0x20;\\n }\\n hashValue >>= 4;\\n }\\n return string(buffer);\\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 bytes(a).length == bytes(b).length && keccak256(bytes(a)) == keccak256(bytes(b));\\n }\\n}\\n\",\"keccak256\":\"0x725209b582291bb83058e3078624b53d15a133f7401c30295e7f3704181d2aed\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/cryptography/ECDSA.sol)\\n\\npragma solidity ^0.8.20;\\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 }\\n\\n /**\\n * @dev The signature derives the `address(0)`.\\n */\\n error ECDSAInvalidSignature();\\n\\n /**\\n * @dev The signature has an invalid length.\\n */\\n error ECDSAInvalidSignatureLength(uint256 length);\\n\\n /**\\n * @dev The signature has an S value that is in the upper half order.\\n */\\n error ECDSAInvalidSignatureS(bytes32 s);\\n\\n /**\\n * @dev Returns the address that signed a hashed message (`hash`) with `signature` or an error. This will not\\n * return address(0) without also returning an error description. Errors are documented using an enum (error type)\\n * and a bytes32 providing additional information about the error.\\n *\\n * If no error is returned, then the address can be used for verification purposes.\\n *\\n * The `ecrecover` EVM precompile 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 {MessageHashUtils-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 function tryRecover(\\n bytes32 hash,\\n bytes memory signature\\n ) internal pure returns (address recovered, RecoverError err, bytes32 errArg) {\\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 assembly (\\\"memory-safe\\\") {\\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, bytes32(signature.length));\\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 precompile 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 {MessageHashUtils-toEthSignedMessageHash} on it.\\n */\\n function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {\\n (address recovered, RecoverError error, bytes32 errorArg) = tryRecover(hash, signature);\\n _throwError(error, errorArg);\\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[ERC-2098 short signatures]\\n */\\n function tryRecover(\\n bytes32 hash,\\n bytes32 r,\\n bytes32 vs\\n ) internal pure returns (address recovered, RecoverError err, bytes32 errArg) {\\n unchecked {\\n bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff);\\n // We do not check for an overflow here since the shift operation results in 0 or 1.\\n uint8 v = uint8((uint256(vs) >> 255) + 27);\\n return tryRecover(hash, v, r, s);\\n }\\n }\\n\\n /**\\n * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately.\\n */\\n function recover(bytes32 hash, bytes32 r, bytes32 vs) internal pure returns (address) {\\n (address recovered, RecoverError error, bytes32 errorArg) = tryRecover(hash, r, vs);\\n _throwError(error, errorArg);\\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 function tryRecover(\\n bytes32 hash,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) internal pure returns (address recovered, RecoverError err, bytes32 errArg) {\\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, s);\\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, bytes32(0));\\n }\\n\\n return (signer, RecoverError.NoError, bytes32(0));\\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, bytes32 errorArg) = tryRecover(hash, v, r, s);\\n _throwError(error, errorArg);\\n return recovered;\\n }\\n\\n /**\\n * @dev Optionally reverts with the corresponding custom error according to the `error` argument provided.\\n */\\n function _throwError(RecoverError error, bytes32 errorArg) private pure {\\n if (error == RecoverError.NoError) {\\n return; // no error: do nothing\\n } else if (error == RecoverError.InvalidSignature) {\\n revert ECDSAInvalidSignature();\\n } else if (error == RecoverError.InvalidSignatureLength) {\\n revert ECDSAInvalidSignatureLength(uint256(errorArg));\\n } else if (error == RecoverError.InvalidSignatureS) {\\n revert ECDSAInvalidSignatureS(errorArg);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x69f54c02b7d81d505910ec198c11ed4c6a728418a868b906b4a0cf29946fda84\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/cryptography/EIP712.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/cryptography/EIP712.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {MessageHashUtils} from \\\"./MessageHashUtils.sol\\\";\\nimport {ShortStrings, ShortString} from \\\"../ShortStrings.sol\\\";\\nimport {IERC5267} from \\\"../../interfaces/IERC5267.sol\\\";\\n\\n/**\\n * @dev https://eips.ethereum.org/EIPS/eip-712[EIP-712] is a standard for hashing and signing of typed structured data.\\n *\\n * The encoding scheme specified in the EIP requires a domain separator and a hash of the typed structured data, whose\\n * encoding is very generic and therefore its implementation in Solidity is not feasible, thus this contract\\n * does not implement the encoding itself. Protocols need to implement the type-specific encoding they need in order to\\n * produce the hash of their typed data using a combination of `abi.encode` and `keccak256`.\\n *\\n * This contract implements the EIP-712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding\\n * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA\\n * ({_hashTypedDataV4}).\\n *\\n * The implementation of the domain separator was designed to be as efficient as possible while still properly updating\\n * the chain id to protect against replay attacks on an eventual fork of the chain.\\n *\\n * NOTE: This contract implements the version of the encoding known as \\\"v4\\\", as implemented by the JSON RPC method\\n * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask].\\n *\\n * NOTE: In the upgradeable version of this contract, the cached values will correspond to the address, and the domain\\n * separator of the implementation contract. This will cause the {_domainSeparatorV4} function to always rebuild the\\n * separator from the immutable values, which is cheaper than accessing a cached version in cold storage.\\n *\\n * @custom:oz-upgrades-unsafe-allow state-variable-immutable\\n */\\nabstract contract EIP712 is IERC5267 {\\n using ShortStrings for *;\\n\\n bytes32 private constant TYPE_HASH =\\n keccak256(\\\"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)\\\");\\n\\n // Cache the domain separator as an immutable value, but also store the chain id that it corresponds to, in order to\\n // invalidate the cached domain separator if the chain id changes.\\n bytes32 private immutable _cachedDomainSeparator;\\n uint256 private immutable _cachedChainId;\\n address private immutable _cachedThis;\\n\\n bytes32 private immutable _hashedName;\\n bytes32 private immutable _hashedVersion;\\n\\n ShortString private immutable _name;\\n ShortString private immutable _version;\\n string private _nameFallback;\\n string private _versionFallback;\\n\\n /**\\n * @dev Initializes the domain separator and parameter caches.\\n *\\n * The meaning of `name` and `version` is specified in\\n * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP-712]:\\n *\\n * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol.\\n * - `version`: the current major version of the signing domain.\\n *\\n * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart\\n * contract upgrade].\\n */\\n constructor(string memory name, string memory version) {\\n _name = name.toShortStringWithFallback(_nameFallback);\\n _version = version.toShortStringWithFallback(_versionFallback);\\n _hashedName = keccak256(bytes(name));\\n _hashedVersion = keccak256(bytes(version));\\n\\n _cachedChainId = block.chainid;\\n _cachedDomainSeparator = _buildDomainSeparator();\\n _cachedThis = address(this);\\n }\\n\\n /**\\n * @dev Returns the domain separator for the current chain.\\n */\\n function _domainSeparatorV4() internal view returns (bytes32) {\\n if (address(this) == _cachedThis && block.chainid == _cachedChainId) {\\n return _cachedDomainSeparator;\\n } else {\\n return _buildDomainSeparator();\\n }\\n }\\n\\n function _buildDomainSeparator() private view returns (bytes32) {\\n return keccak256(abi.encode(TYPE_HASH, _hashedName, _hashedVersion, block.chainid, address(this)));\\n }\\n\\n /**\\n * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this\\n * function returns the hash of the fully encoded EIP712 message for this domain.\\n *\\n * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example:\\n *\\n * ```solidity\\n * bytes32 digest = _hashTypedDataV4(keccak256(abi.encode(\\n * keccak256(\\\"Mail(address to,string contents)\\\"),\\n * mailTo,\\n * keccak256(bytes(mailContents))\\n * )));\\n * address signer = ECDSA.recover(digest, signature);\\n * ```\\n */\\n function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) {\\n return MessageHashUtils.toTypedDataHash(_domainSeparatorV4(), structHash);\\n }\\n\\n /**\\n * @dev See {IERC-5267}.\\n */\\n function eip712Domain()\\n public\\n view\\n virtual\\n returns (\\n bytes1 fields,\\n string memory name,\\n string memory version,\\n uint256 chainId,\\n address verifyingContract,\\n bytes32 salt,\\n uint256[] memory extensions\\n )\\n {\\n return (\\n hex\\\"0f\\\", // 01111\\n _EIP712Name(),\\n _EIP712Version(),\\n block.chainid,\\n address(this),\\n bytes32(0),\\n new uint256[](0)\\n );\\n }\\n\\n /**\\n * @dev The name parameter for the EIP712 domain.\\n *\\n * NOTE: By default this function reads _name which is an immutable value.\\n * It only reads from storage if necessary (in case the value is too large to fit in a ShortString).\\n */\\n // solhint-disable-next-line func-name-mixedcase\\n function _EIP712Name() internal view returns (string memory) {\\n return _name.toStringWithFallback(_nameFallback);\\n }\\n\\n /**\\n * @dev The version parameter for the EIP712 domain.\\n *\\n * NOTE: By default this function reads _version which is an immutable value.\\n * It only reads from storage if necessary (in case the value is too large to fit in a ShortString).\\n */\\n // solhint-disable-next-line func-name-mixedcase\\n function _EIP712Version() internal view returns (string memory) {\\n return _version.toStringWithFallback(_versionFallback);\\n }\\n}\\n\",\"keccak256\":\"0x10eb97d047f8d84fe263a02bb4a656ac6674f6679d74532cc37546289e073a9d\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/cryptography/MessageHashUtils.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/cryptography/MessageHashUtils.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {Strings} from \\\"../Strings.sol\\\";\\n\\n/**\\n * @dev Signature message hash utilities for producing digests to be consumed by {ECDSA} recovery or signing.\\n *\\n * The library provides methods for generating a hash of a message that conforms to the\\n * https://eips.ethereum.org/EIPS/eip-191[ERC-191] and https://eips.ethereum.org/EIPS/eip-712[EIP 712]\\n * specifications.\\n */\\nlibrary MessageHashUtils {\\n /**\\n * @dev Returns the keccak256 digest of an ERC-191 signed data with version\\n * `0x45` (`personal_sign` messages).\\n *\\n * The digest is calculated by prefixing a bytes32 `messageHash` with\\n * `\\\"\\\\x19Ethereum Signed Message:\\\\n32\\\"` and hashing the result. It corresponds with the\\n * hash signed when using the https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] JSON-RPC method.\\n *\\n * NOTE: The `messageHash` parameter is intended to be the result of hashing a raw message with\\n * keccak256, although any bytes32 value can be safely used because the final digest will\\n * be re-hashed.\\n *\\n * See {ECDSA-recover}.\\n */\\n function toEthSignedMessageHash(bytes32 messageHash) internal pure returns (bytes32 digest) {\\n assembly (\\\"memory-safe\\\") {\\n mstore(0x00, \\\"\\\\x19Ethereum Signed Message:\\\\n32\\\") // 32 is the bytes-length of messageHash\\n mstore(0x1c, messageHash) // 0x1c (28) is the length of the prefix\\n digest := keccak256(0x00, 0x3c) // 0x3c is the length of the prefix (0x1c) + messageHash (0x20)\\n }\\n }\\n\\n /**\\n * @dev Returns the keccak256 digest of an ERC-191 signed data with version\\n * `0x45` (`personal_sign` messages).\\n *\\n * The digest is calculated by prefixing an arbitrary `message` with\\n * `\\\"\\\\x19Ethereum Signed Message:\\\\n\\\" + len(message)` and hashing the result. It corresponds with the\\n * hash signed when using the https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] JSON-RPC method.\\n *\\n * See {ECDSA-recover}.\\n */\\n function toEthSignedMessageHash(bytes memory message) internal pure returns (bytes32) {\\n return\\n keccak256(bytes.concat(\\\"\\\\x19Ethereum Signed Message:\\\\n\\\", bytes(Strings.toString(message.length)), message));\\n }\\n\\n /**\\n * @dev Returns the keccak256 digest of an ERC-191 signed data with version\\n * `0x00` (data with intended validator).\\n *\\n * The digest is calculated by prefixing an arbitrary `data` with `\\\"\\\\x19\\\\x00\\\"` and the intended\\n * `validator` address. Then hashing the result.\\n *\\n * See {ECDSA-recover}.\\n */\\n function toDataWithIntendedValidatorHash(address validator, bytes memory data) internal pure returns (bytes32) {\\n return keccak256(abi.encodePacked(hex\\\"19_00\\\", validator, data));\\n }\\n\\n /**\\n * @dev Returns the keccak256 digest of an EIP-712 typed data (ERC-191 version `0x01`).\\n *\\n * The digest is calculated from a `domainSeparator` and a `structHash`, by prefixing them with\\n * `\\\\x19\\\\x01` and hashing the result. It corresponds to the hash signed by the\\n * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`] JSON-RPC method as part of EIP-712.\\n *\\n * See {ECDSA-recover}.\\n */\\n function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32 digest) {\\n assembly (\\\"memory-safe\\\") {\\n let ptr := mload(0x40)\\n mstore(ptr, hex\\\"19_01\\\")\\n mstore(add(ptr, 0x02), domainSeparator)\\n mstore(add(ptr, 0x22), structHash)\\n digest := keccak256(ptr, 0x42)\\n }\\n }\\n}\\n\",\"keccak256\":\"0x4515543bc4c78561f6bea83ecfdfc3dead55bd59858287d682045b11de1ae575\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/cryptography/SignatureChecker.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/cryptography/SignatureChecker.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {ECDSA} from \\\"./ECDSA.sol\\\";\\nimport {IERC1271} from \\\"../../interfaces/IERC1271.sol\\\";\\n\\n/**\\n * @dev Signature verification helper that can be used instead of `ECDSA.recover` to seamlessly support both ECDSA\\n * signatures from externally owned accounts (EOAs) as well as ERC-1271 signatures from smart contract wallets like\\n * Argent and Safe Wallet (previously Gnosis Safe).\\n */\\nlibrary SignatureChecker {\\n /**\\n * @dev Checks if a signature is valid for a given signer and data hash. If the signer is a smart contract, the\\n * signature is validated against that smart contract using ERC-1271, otherwise it's validated using `ECDSA.recover`.\\n *\\n * NOTE: Unlike ECDSA signatures, contract signatures are revocable, and the outcome of this function can thus\\n * change through time. It could return true at block N and false at block N+1 (or the opposite).\\n */\\n function isValidSignatureNow(address signer, bytes32 hash, bytes memory signature) internal view returns (bool) {\\n if (signer.code.length == 0) {\\n (address recovered, ECDSA.RecoverError err, ) = ECDSA.tryRecover(hash, signature);\\n return err == ECDSA.RecoverError.NoError && recovered == signer;\\n } else {\\n return isValidERC1271SignatureNow(signer, hash, signature);\\n }\\n }\\n\\n /**\\n * @dev Checks if a signature is valid for a given signer and data hash. The signature is validated\\n * against the signer smart contract using ERC-1271.\\n *\\n * NOTE: Unlike ECDSA signatures, contract signatures are revocable, and the outcome of this function can thus\\n * change through time. It could return true at block N and false at block N+1 (or the opposite).\\n */\\n function isValidERC1271SignatureNow(\\n address signer,\\n bytes32 hash,\\n bytes memory signature\\n ) internal view returns (bool) {\\n (bool success, bytes memory result) = signer.staticcall(\\n abi.encodeCall(IERC1271.isValidSignature, (hash, signature))\\n );\\n return (success &&\\n result.length >= 32 &&\\n abi.decode(result, (bytes32)) == bytes32(IERC1271.isValidSignature.selector));\\n }\\n}\\n\",\"keccak256\":\"0xbdc3bb48ccedb818cd75a6d74a16df55a822e9f6d3cc54c59f576f10aab67b5f\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/introspection/ERC165.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/introspection/ERC165.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {IERC165} from \\\"./IERC165.sol\\\";\\n\\n/**\\n * @dev Implementation of the {IERC165} interface.\\n *\\n * Contracts that want to implement ERC-165 should inherit from this contract and override {supportsInterface} to check\\n * for the additional interface id that will be supported. For example:\\n *\\n * ```solidity\\n * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\\n * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);\\n * }\\n * ```\\n */\\nabstract contract ERC165 is IERC165 {\\n /**\\n * @dev See {IERC165-supportsInterface}.\\n */\\n function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) {\\n return interfaceId == type(IERC165).interfaceId;\\n }\\n}\\n\",\"keccak256\":\"0xddce8e17e3d3f9ed818b4f4c4478a8262aab8b11ed322f1bf5ed705bb4bd97fa\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/introspection/IERC165.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/introspection/IERC165.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Interface of the ERC-165 standard, as defined in the\\n * https://eips.ethereum.org/EIPS/eip-165[ERC].\\n *\\n * Implementers can declare support of contract interfaces, which can then be\\n * queried by others ({ERC165Checker}).\\n *\\n * For an implementation, see {ERC165}.\\n */\\ninterface IERC165 {\\n /**\\n * @dev Returns true if this contract implements the interface defined by\\n * `interfaceId`. See the corresponding\\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[ERC section]\\n * to learn more about how these ids are created.\\n *\\n * This function call must use less than 30 000 gas.\\n */\\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x79796192ec90263f21b464d5bc90b777a525971d3de8232be80d9c4f9fb353b8\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/math/Math.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/math/Math.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {Panic} from \\\"../Panic.sol\\\";\\nimport {SafeCast} from \\\"./SafeCast.sol\\\";\\n\\n/**\\n * @dev Standard math utilities missing in the Solidity language.\\n */\\nlibrary Math {\\n enum Rounding {\\n Floor, // Toward negative infinity\\n Ceil, // Toward positive infinity\\n Trunc, // Toward zero\\n Expand // Away from zero\\n }\\n\\n /**\\n * @dev Returns the addition of two unsigned integers, with an success flag (no overflow).\\n */\\n function tryAdd(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\\n unchecked {\\n uint256 c = a + b;\\n if (c < a) return (false, 0);\\n return (true, c);\\n }\\n }\\n\\n /**\\n * @dev Returns the subtraction of two unsigned integers, with an success flag (no overflow).\\n */\\n function trySub(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\\n unchecked {\\n if (b > a) return (false, 0);\\n return (true, a - b);\\n }\\n }\\n\\n /**\\n * @dev Returns the multiplication of two unsigned integers, with an success flag (no overflow).\\n */\\n function tryMul(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\\n unchecked {\\n // Gas optimization: this is cheaper than requiring 'a' not being zero, but the\\n // benefit is lost if 'b' is also tested.\\n // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522\\n if (a == 0) return (true, 0);\\n uint256 c = a * b;\\n if (c / a != b) return (false, 0);\\n return (true, c);\\n }\\n }\\n\\n /**\\n * @dev Returns the division of two unsigned integers, with a success flag (no division by zero).\\n */\\n function tryDiv(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\\n unchecked {\\n if (b == 0) return (false, 0);\\n return (true, a / b);\\n }\\n }\\n\\n /**\\n * @dev Returns the remainder of dividing two unsigned integers, with a success flag (no division by zero).\\n */\\n function tryMod(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\\n unchecked {\\n if (b == 0) return (false, 0);\\n return (true, a % b);\\n }\\n }\\n\\n /**\\n * @dev Branchless ternary evaluation for `a ? b : c`. Gas costs are constant.\\n *\\n * IMPORTANT: This function may reduce bytecode size and consume less gas when used standalone.\\n * However, the compiler may optimize Solidity ternary operations (i.e. `a ? b : c`) to only compute\\n * one branch when needed, making this function more expensive.\\n */\\n function ternary(bool condition, uint256 a, uint256 b) internal pure returns (uint256) {\\n unchecked {\\n // branchless ternary works because:\\n // b ^ (a ^ b) == a\\n // b ^ 0 == b\\n return b ^ ((a ^ b) * SafeCast.toUint(condition));\\n }\\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 ternary(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 ternary(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 towards infinity instead\\n * of rounding towards zero.\\n */\\n function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {\\n if (b == 0) {\\n // Guarantee the same behavior as in a regular Solidity division.\\n Panic.panic(Panic.DIVISION_BY_ZERO);\\n }\\n\\n // The following calculation ensures accurate ceiling division without overflow.\\n // Since a is non-zero, (a - 1) / b will not overflow.\\n // The largest possible result occurs when (a - 1) / b is type(uint256).max,\\n // but the largest value we can obtain is type(uint256).max - 1, which happens\\n // when a = type(uint256).max and b = 1.\\n unchecked {\\n return SafeCast.toUint(a > 0) * ((a - 1) / b + 1);\\n }\\n }\\n\\n /**\\n * @dev Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or\\n * denominator == 0.\\n *\\n * Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv) with further edits by\\n * 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\\u00b2\\u2075\\u2076 and mod 2\\u00b2\\u2075\\u2076 - 1, then use\\n // the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256\\n // variables such that product = prod1 * 2\\u00b2\\u2075\\u2076 + prod0.\\n uint256 prod0 = x * y; // 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 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\\u00b2\\u2075\\u2076. Also prevents denominator == 0.\\n if (denominator <= prod1) {\\n Panic.panic(ternary(denominator == 0, Panic.DIVISION_BY_ZERO, Panic.UNDER_OVERFLOW));\\n }\\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.\\n // Always >= 1. See https://cs.stackexchange.com/q/138556/92363.\\n\\n uint256 twos = denominator & (0 - denominator);\\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\\u00b2\\u2075\\u2076 / 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\\u00b2\\u2075\\u2076. Now that denominator is an odd number, it has an inverse modulo 2\\u00b2\\u2075\\u2076 such\\n // that denominator * inv \\u2261 1 mod 2\\u00b2\\u2075\\u2076. Compute the inverse by starting with a seed that is correct for\\n // four bits. That is, denominator * inv \\u2261 1 mod 2\\u2074.\\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\\n // works in modular arithmetic, doubling the correct bits in each step.\\n inverse *= 2 - denominator * inverse; // inverse mod 2\\u2078\\n inverse *= 2 - denominator * inverse; // inverse mod 2\\u00b9\\u2076\\n inverse *= 2 - denominator * inverse; // inverse mod 2\\u00b3\\u00b2\\n inverse *= 2 - denominator * inverse; // inverse mod 2\\u2076\\u2074\\n inverse *= 2 - denominator * inverse; // inverse mod 2\\u00b9\\u00b2\\u2078\\n inverse *= 2 - denominator * inverse; // inverse mod 2\\u00b2\\u2075\\u2076\\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\\u00b2\\u2075\\u2076. Since the preconditions guarantee that the outcome is\\n // less than 2\\u00b2\\u2075\\u2076, 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 * @dev 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 return mulDiv(x, y, denominator) + SafeCast.toUint(unsignedRoundsUp(rounding) && mulmod(x, y, denominator) > 0);\\n }\\n\\n /**\\n * @dev Calculate the modular multiplicative inverse of a number in Z/nZ.\\n *\\n * If n is a prime, then Z/nZ is a field. In that case all elements are inversible, except 0.\\n * If n is not a prime, then Z/nZ is not a field, and some elements might not be inversible.\\n *\\n * If the input value is not inversible, 0 is returned.\\n *\\n * NOTE: If you know for sure that n is (big) a prime, it may be cheaper to use Fermat's little theorem and get the\\n * inverse using `Math.modExp(a, n - 2, n)`. See {invModPrime}.\\n */\\n function invMod(uint256 a, uint256 n) internal pure returns (uint256) {\\n unchecked {\\n if (n == 0) return 0;\\n\\n // The inverse modulo is calculated using the Extended Euclidean Algorithm (iterative version)\\n // Used to compute integers x and y such that: ax + ny = gcd(a, n).\\n // When the gcd is 1, then the inverse of a modulo n exists and it's x.\\n // ax + ny = 1\\n // ax = 1 + (-y)n\\n // ax \\u2261 1 (mod n) # x is the inverse of a modulo n\\n\\n // If the remainder is 0 the gcd is n right away.\\n uint256 remainder = a % n;\\n uint256 gcd = n;\\n\\n // Therefore the initial coefficients are:\\n // ax + ny = gcd(a, n) = n\\n // 0a + 1n = n\\n int256 x = 0;\\n int256 y = 1;\\n\\n while (remainder != 0) {\\n uint256 quotient = gcd / remainder;\\n\\n (gcd, remainder) = (\\n // The old remainder is the next gcd to try.\\n remainder,\\n // Compute the next remainder.\\n // Can't overflow given that (a % gcd) * (gcd // (a % gcd)) <= gcd\\n // where gcd is at most n (capped to type(uint256).max)\\n gcd - remainder * quotient\\n );\\n\\n (x, y) = (\\n // Increment the coefficient of a.\\n y,\\n // Decrement the coefficient of n.\\n // Can overflow, but the result is casted to uint256 so that the\\n // next value of y is \\\"wrapped around\\\" to a value between 0 and n - 1.\\n x - y * int256(quotient)\\n );\\n }\\n\\n if (gcd != 1) return 0; // No inverse exists.\\n return ternary(x < 0, n - uint256(-x), uint256(x)); // Wrap the result if it's negative.\\n }\\n }\\n\\n /**\\n * @dev Variant of {invMod}. More efficient, but only works if `p` is known to be a prime greater than `2`.\\n *\\n * From https://en.wikipedia.org/wiki/Fermat%27s_little_theorem[Fermat's little theorem], we know that if p is\\n * prime, then `a**(p-1) \\u2261 1 mod p`. As a consequence, we have `a * a**(p-2) \\u2261 1 mod p`, which means that\\n * `a**(p-2)` is the modular multiplicative inverse of a in Fp.\\n *\\n * NOTE: this function does NOT check that `p` is a prime greater than `2`.\\n */\\n function invModPrime(uint256 a, uint256 p) internal view returns (uint256) {\\n unchecked {\\n return Math.modExp(a, p - 2, p);\\n }\\n }\\n\\n /**\\n * @dev Returns the modular exponentiation of the specified base, exponent and modulus (b ** e % m)\\n *\\n * Requirements:\\n * - modulus can't be zero\\n * - underlying staticcall to precompile must succeed\\n *\\n * IMPORTANT: The result is only valid if the underlying call succeeds. When using this function, make\\n * sure the chain you're using it on supports the precompiled contract for modular exponentiation\\n * at address 0x05 as specified in https://eips.ethereum.org/EIPS/eip-198[EIP-198]. Otherwise,\\n * the underlying function will succeed given the lack of a revert, but the result may be incorrectly\\n * interpreted as 0.\\n */\\n function modExp(uint256 b, uint256 e, uint256 m) internal view returns (uint256) {\\n (bool success, uint256 result) = tryModExp(b, e, m);\\n if (!success) {\\n Panic.panic(Panic.DIVISION_BY_ZERO);\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Returns the modular exponentiation of the specified base, exponent and modulus (b ** e % m).\\n * It includes a success flag indicating if the operation succeeded. Operation will be marked as failed if trying\\n * to operate modulo 0 or if the underlying precompile reverted.\\n *\\n * IMPORTANT: The result is only valid if the success flag is true. When using this function, make sure the chain\\n * you're using it on supports the precompiled contract for modular exponentiation at address 0x05 as specified in\\n * https://eips.ethereum.org/EIPS/eip-198[EIP-198]. Otherwise, the underlying function will succeed given the lack\\n * of a revert, but the result may be incorrectly interpreted as 0.\\n */\\n function tryModExp(uint256 b, uint256 e, uint256 m) internal view returns (bool success, uint256 result) {\\n if (m == 0) return (false, 0);\\n assembly (\\\"memory-safe\\\") {\\n let ptr := mload(0x40)\\n // | Offset | Content | Content (Hex) |\\n // |-----------|------------|--------------------------------------------------------------------|\\n // | 0x00:0x1f | size of b | 0x0000000000000000000000000000000000000000000000000000000000000020 |\\n // | 0x20:0x3f | size of e | 0x0000000000000000000000000000000000000000000000000000000000000020 |\\n // | 0x40:0x5f | size of m | 0x0000000000000000000000000000000000000000000000000000000000000020 |\\n // | 0x60:0x7f | value of b | 0x<.............................................................b> |\\n // | 0x80:0x9f | value of e | 0x<.............................................................e> |\\n // | 0xa0:0xbf | value of m | 0x<.............................................................m> |\\n mstore(ptr, 0x20)\\n mstore(add(ptr, 0x20), 0x20)\\n mstore(add(ptr, 0x40), 0x20)\\n mstore(add(ptr, 0x60), b)\\n mstore(add(ptr, 0x80), e)\\n mstore(add(ptr, 0xa0), m)\\n\\n // Given the result < m, it's guaranteed to fit in 32 bytes,\\n // so we can use the memory scratch space located at offset 0.\\n success := staticcall(gas(), 0x05, ptr, 0xc0, 0x00, 0x20)\\n result := mload(0x00)\\n }\\n }\\n\\n /**\\n * @dev Variant of {modExp} that supports inputs of arbitrary length.\\n */\\n function modExp(bytes memory b, bytes memory e, bytes memory m) internal view returns (bytes memory) {\\n (bool success, bytes memory result) = tryModExp(b, e, m);\\n if (!success) {\\n Panic.panic(Panic.DIVISION_BY_ZERO);\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Variant of {tryModExp} that supports inputs of arbitrary length.\\n */\\n function tryModExp(\\n bytes memory b,\\n bytes memory e,\\n bytes memory m\\n ) internal view returns (bool success, bytes memory result) {\\n if (_zeroBytes(m)) return (false, new bytes(0));\\n\\n uint256 mLen = m.length;\\n\\n // Encode call args in result and move the free memory pointer\\n result = abi.encodePacked(b.length, e.length, mLen, b, e, m);\\n\\n assembly (\\\"memory-safe\\\") {\\n let dataPtr := add(result, 0x20)\\n // Write result on top of args to avoid allocating extra memory.\\n success := staticcall(gas(), 0x05, dataPtr, mload(result), dataPtr, mLen)\\n // Overwrite the length.\\n // result.length > returndatasize() is guaranteed because returndatasize() == m.length\\n mstore(result, mLen)\\n // Set the memory pointer after the returned data.\\n mstore(0x40, add(dataPtr, mLen))\\n }\\n }\\n\\n /**\\n * @dev Returns whether the provided byte array is zero.\\n */\\n function _zeroBytes(bytes memory byteArray) private pure returns (bool) {\\n for (uint256 i = 0; i < byteArray.length; ++i) {\\n if (byteArray[i] != 0) {\\n return false;\\n }\\n }\\n return true;\\n }\\n\\n /**\\n * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded\\n * towards zero.\\n *\\n * This method is based on Newton's method for computing square roots; the algorithm is restricted to only\\n * using integer operations.\\n */\\n function sqrt(uint256 a) internal pure returns (uint256) {\\n unchecked {\\n // Take care of easy edge cases when a == 0 or a == 1\\n if (a <= 1) {\\n return a;\\n }\\n\\n // In this function, we use Newton's method to get a root of `f(x) := x\\u00b2 - a`. It involves building a\\n // sequence x_n that converges toward sqrt(a). For each iteration x_n, we also define the error between\\n // the current value as `\\u03b5_n = | x_n - sqrt(a) |`.\\n //\\n // For our first estimation, we consider `e` the smallest power of 2 which is bigger than the square root\\n // of the target. (i.e. `2**(e-1) \\u2264 sqrt(a) < 2**e`). We know that `e \\u2264 128` because `(2\\u00b9\\u00b2\\u2078)\\u00b2 = 2\\u00b2\\u2075\\u2076` is\\n // bigger than any uint256.\\n //\\n // By noticing that\\n // `2**(e-1) \\u2264 sqrt(a) < 2**e \\u2192 (2**(e-1))\\u00b2 \\u2264 a < (2**e)\\u00b2 \\u2192 2**(2*e-2) \\u2264 a < 2**(2*e)`\\n // we can deduce that `e - 1` is `log2(a) / 2`. We can thus compute `x_n = 2**(e-1)` using a method similar\\n // to the msb function.\\n uint256 aa = a;\\n uint256 xn = 1;\\n\\n if (aa >= (1 << 128)) {\\n aa >>= 128;\\n xn <<= 64;\\n }\\n if (aa >= (1 << 64)) {\\n aa >>= 64;\\n xn <<= 32;\\n }\\n if (aa >= (1 << 32)) {\\n aa >>= 32;\\n xn <<= 16;\\n }\\n if (aa >= (1 << 16)) {\\n aa >>= 16;\\n xn <<= 8;\\n }\\n if (aa >= (1 << 8)) {\\n aa >>= 8;\\n xn <<= 4;\\n }\\n if (aa >= (1 << 4)) {\\n aa >>= 4;\\n xn <<= 2;\\n }\\n if (aa >= (1 << 2)) {\\n xn <<= 1;\\n }\\n\\n // We now have x_n such that `x_n = 2**(e-1) \\u2264 sqrt(a) < 2**e = 2 * x_n`. This implies \\u03b5_n \\u2264 2**(e-1).\\n //\\n // We can refine our estimation by noticing that the middle of that interval minimizes the error.\\n // If we move x_n to equal 2**(e-1) + 2**(e-2), then we reduce the error to \\u03b5_n \\u2264 2**(e-2).\\n // This is going to be our x_0 (and \\u03b5_0)\\n xn = (3 * xn) >> 1; // \\u03b5_0 := | x_0 - sqrt(a) | \\u2264 2**(e-2)\\n\\n // From here, Newton's method give us:\\n // x_{n+1} = (x_n + a / x_n) / 2\\n //\\n // One should note that:\\n // x_{n+1}\\u00b2 - a = ((x_n + a / x_n) / 2)\\u00b2 - a\\n // = ((x_n\\u00b2 + a) / (2 * x_n))\\u00b2 - a\\n // = (x_n\\u2074 + 2 * a * x_n\\u00b2 + a\\u00b2) / (4 * x_n\\u00b2) - a\\n // = (x_n\\u2074 + 2 * a * x_n\\u00b2 + a\\u00b2 - 4 * a * x_n\\u00b2) / (4 * x_n\\u00b2)\\n // = (x_n\\u2074 - 2 * a * x_n\\u00b2 + a\\u00b2) / (4 * x_n\\u00b2)\\n // = (x_n\\u00b2 - a)\\u00b2 / (2 * x_n)\\u00b2\\n // = ((x_n\\u00b2 - a) / (2 * x_n))\\u00b2\\n // \\u2265 0\\n // Which proves that for all n \\u2265 1, sqrt(a) \\u2264 x_n\\n //\\n // This gives us the proof of quadratic convergence of the sequence:\\n // \\u03b5_{n+1} = | x_{n+1} - sqrt(a) |\\n // = | (x_n + a / x_n) / 2 - sqrt(a) |\\n // = | (x_n\\u00b2 + a - 2*x_n*sqrt(a)) / (2 * x_n) |\\n // = | (x_n - sqrt(a))\\u00b2 / (2 * x_n) |\\n // = | \\u03b5_n\\u00b2 / (2 * x_n) |\\n // = \\u03b5_n\\u00b2 / | (2 * x_n) |\\n //\\n // For the first iteration, we have a special case where x_0 is known:\\n // \\u03b5_1 = \\u03b5_0\\u00b2 / | (2 * x_0) |\\n // \\u2264 (2**(e-2))\\u00b2 / (2 * (2**(e-1) + 2**(e-2)))\\n // \\u2264 2**(2*e-4) / (3 * 2**(e-1))\\n // \\u2264 2**(e-3) / 3\\n // \\u2264 2**(e-3-log2(3))\\n // \\u2264 2**(e-4.5)\\n //\\n // For the following iterations, we use the fact that, 2**(e-1) \\u2264 sqrt(a) \\u2264 x_n:\\n // \\u03b5_{n+1} = \\u03b5_n\\u00b2 / | (2 * x_n) |\\n // \\u2264 (2**(e-k))\\u00b2 / (2 * 2**(e-1))\\n // \\u2264 2**(2*e-2*k) / 2**e\\n // \\u2264 2**(e-2*k)\\n xn = (xn + a / xn) >> 1; // \\u03b5_1 := | x_1 - sqrt(a) | \\u2264 2**(e-4.5) -- special case, see above\\n xn = (xn + a / xn) >> 1; // \\u03b5_2 := | x_2 - sqrt(a) | \\u2264 2**(e-9) -- general case with k = 4.5\\n xn = (xn + a / xn) >> 1; // \\u03b5_3 := | x_3 - sqrt(a) | \\u2264 2**(e-18) -- general case with k = 9\\n xn = (xn + a / xn) >> 1; // \\u03b5_4 := | x_4 - sqrt(a) | \\u2264 2**(e-36) -- general case with k = 18\\n xn = (xn + a / xn) >> 1; // \\u03b5_5 := | x_5 - sqrt(a) | \\u2264 2**(e-72) -- general case with k = 36\\n xn = (xn + a / xn) >> 1; // \\u03b5_6 := | x_6 - sqrt(a) | \\u2264 2**(e-144) -- general case with k = 72\\n\\n // Because e \\u2264 128 (as discussed during the first estimation phase), we know have reached a precision\\n // \\u03b5_6 \\u2264 2**(e-144) < 1. Given we're operating on integers, then we can ensure that xn is now either\\n // sqrt(a) or sqrt(a) + 1.\\n return xn - SafeCast.toUint(xn > a / xn);\\n }\\n }\\n\\n /**\\n * @dev 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 + SafeCast.toUint(unsignedRoundsUp(rounding) && result * result < a);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 2 of a positive value rounded towards zero.\\n * Returns 0 if given 0.\\n */\\n function log2(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n uint256 exp;\\n unchecked {\\n exp = 128 * SafeCast.toUint(value > (1 << 128) - 1);\\n value >>= exp;\\n result += exp;\\n\\n exp = 64 * SafeCast.toUint(value > (1 << 64) - 1);\\n value >>= exp;\\n result += exp;\\n\\n exp = 32 * SafeCast.toUint(value > (1 << 32) - 1);\\n value >>= exp;\\n result += exp;\\n\\n exp = 16 * SafeCast.toUint(value > (1 << 16) - 1);\\n value >>= exp;\\n result += exp;\\n\\n exp = 8 * SafeCast.toUint(value > (1 << 8) - 1);\\n value >>= exp;\\n result += exp;\\n\\n exp = 4 * SafeCast.toUint(value > (1 << 4) - 1);\\n value >>= exp;\\n result += exp;\\n\\n exp = 2 * SafeCast.toUint(value > (1 << 2) - 1);\\n value >>= exp;\\n result += exp;\\n\\n result += SafeCast.toUint(value > 1);\\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 + SafeCast.toUint(unsignedRoundsUp(rounding) && 1 << result < value);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 10 of a positive value rounded towards zero.\\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 + SafeCast.toUint(unsignedRoundsUp(rounding) && 10 ** result < value);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 256 of a positive value rounded towards zero.\\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 uint256 isGt;\\n unchecked {\\n isGt = SafeCast.toUint(value > (1 << 128) - 1);\\n value >>= isGt * 128;\\n result += isGt * 16;\\n\\n isGt = SafeCast.toUint(value > (1 << 64) - 1);\\n value >>= isGt * 64;\\n result += isGt * 8;\\n\\n isGt = SafeCast.toUint(value > (1 << 32) - 1);\\n value >>= isGt * 32;\\n result += isGt * 4;\\n\\n isGt = SafeCast.toUint(value > (1 << 16) - 1);\\n value >>= isGt * 16;\\n result += isGt * 2;\\n\\n result += SafeCast.toUint(value > (1 << 8) - 1);\\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 + SafeCast.toUint(unsignedRoundsUp(rounding) && 1 << (result << 3) < value);\\n }\\n }\\n\\n /**\\n * @dev Returns whether a provided rounding mode is considered rounding up for unsigned integers.\\n */\\n function unsignedRoundsUp(Rounding rounding) internal pure returns (bool) {\\n return uint8(rounding) % 2 == 1;\\n }\\n}\\n\",\"keccak256\":\"0xa00be322d7db5786750ce0ac7e2f5b633ac30a5ed5fa1ced1e74acfc19acecea\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/math/SafeCast.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/math/SafeCast.sol)\\n// This file was procedurally generated from scripts/generate/templates/SafeCast.js.\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Wrappers over Solidity's uintXX/intXX/bool casting operators with added overflow\\n * checks.\\n *\\n * Downcasting from uint256/int256 in Solidity does not revert on overflow. This can\\n * easily result in undesired exploitation or bugs, since developers usually\\n * assume that overflows raise errors. `SafeCast` restores this intuition by\\n * reverting the transaction when such an operation overflows.\\n *\\n * Using this library instead of the unchecked operations eliminates an entire\\n * class of bugs, so it's recommended to use it always.\\n */\\nlibrary SafeCast {\\n /**\\n * @dev Value doesn't fit in an uint of `bits` size.\\n */\\n error SafeCastOverflowedUintDowncast(uint8 bits, uint256 value);\\n\\n /**\\n * @dev An int value doesn't fit in an uint of `bits` size.\\n */\\n error SafeCastOverflowedIntToUint(int256 value);\\n\\n /**\\n * @dev Value doesn't fit in an int of `bits` size.\\n */\\n error SafeCastOverflowedIntDowncast(uint8 bits, int256 value);\\n\\n /**\\n * @dev An uint value doesn't fit in an int of `bits` size.\\n */\\n error SafeCastOverflowedUintToInt(uint256 value);\\n\\n /**\\n * @dev Returns the downcasted uint248 from uint256, reverting on\\n * overflow (when the input is greater than largest uint248).\\n *\\n * Counterpart to Solidity's `uint248` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 248 bits\\n */\\n function toUint248(uint256 value) internal pure returns (uint248) {\\n if (value > type(uint248).max) {\\n revert SafeCastOverflowedUintDowncast(248, value);\\n }\\n return uint248(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint240 from uint256, reverting on\\n * overflow (when the input is greater than largest uint240).\\n *\\n * Counterpart to Solidity's `uint240` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 240 bits\\n */\\n function toUint240(uint256 value) internal pure returns (uint240) {\\n if (value > type(uint240).max) {\\n revert SafeCastOverflowedUintDowncast(240, value);\\n }\\n return uint240(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint232 from uint256, reverting on\\n * overflow (when the input is greater than largest uint232).\\n *\\n * Counterpart to Solidity's `uint232` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 232 bits\\n */\\n function toUint232(uint256 value) internal pure returns (uint232) {\\n if (value > type(uint232).max) {\\n revert SafeCastOverflowedUintDowncast(232, value);\\n }\\n return uint232(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint224 from uint256, reverting on\\n * overflow (when the input is greater than largest uint224).\\n *\\n * Counterpart to Solidity's `uint224` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 224 bits\\n */\\n function toUint224(uint256 value) internal pure returns (uint224) {\\n if (value > type(uint224).max) {\\n revert SafeCastOverflowedUintDowncast(224, value);\\n }\\n return uint224(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint216 from uint256, reverting on\\n * overflow (when the input is greater than largest uint216).\\n *\\n * Counterpart to Solidity's `uint216` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 216 bits\\n */\\n function toUint216(uint256 value) internal pure returns (uint216) {\\n if (value > type(uint216).max) {\\n revert SafeCastOverflowedUintDowncast(216, value);\\n }\\n return uint216(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint208 from uint256, reverting on\\n * overflow (when the input is greater than largest uint208).\\n *\\n * Counterpart to Solidity's `uint208` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 208 bits\\n */\\n function toUint208(uint256 value) internal pure returns (uint208) {\\n if (value > type(uint208).max) {\\n revert SafeCastOverflowedUintDowncast(208, value);\\n }\\n return uint208(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint200 from uint256, reverting on\\n * overflow (when the input is greater than largest uint200).\\n *\\n * Counterpart to Solidity's `uint200` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 200 bits\\n */\\n function toUint200(uint256 value) internal pure returns (uint200) {\\n if (value > type(uint200).max) {\\n revert SafeCastOverflowedUintDowncast(200, value);\\n }\\n return uint200(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint192 from uint256, reverting on\\n * overflow (when the input is greater than largest uint192).\\n *\\n * Counterpart to Solidity's `uint192` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 192 bits\\n */\\n function toUint192(uint256 value) internal pure returns (uint192) {\\n if (value > type(uint192).max) {\\n revert SafeCastOverflowedUintDowncast(192, value);\\n }\\n return uint192(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint184 from uint256, reverting on\\n * overflow (when the input is greater than largest uint184).\\n *\\n * Counterpart to Solidity's `uint184` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 184 bits\\n */\\n function toUint184(uint256 value) internal pure returns (uint184) {\\n if (value > type(uint184).max) {\\n revert SafeCastOverflowedUintDowncast(184, value);\\n }\\n return uint184(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint176 from uint256, reverting on\\n * overflow (when the input is greater than largest uint176).\\n *\\n * Counterpart to Solidity's `uint176` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 176 bits\\n */\\n function toUint176(uint256 value) internal pure returns (uint176) {\\n if (value > type(uint176).max) {\\n revert SafeCastOverflowedUintDowncast(176, value);\\n }\\n return uint176(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint168 from uint256, reverting on\\n * overflow (when the input is greater than largest uint168).\\n *\\n * Counterpart to Solidity's `uint168` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 168 bits\\n */\\n function toUint168(uint256 value) internal pure returns (uint168) {\\n if (value > type(uint168).max) {\\n revert SafeCastOverflowedUintDowncast(168, value);\\n }\\n return uint168(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint160 from uint256, reverting on\\n * overflow (when the input is greater than largest uint160).\\n *\\n * Counterpart to Solidity's `uint160` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 160 bits\\n */\\n function toUint160(uint256 value) internal pure returns (uint160) {\\n if (value > type(uint160).max) {\\n revert SafeCastOverflowedUintDowncast(160, value);\\n }\\n return uint160(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint152 from uint256, reverting on\\n * overflow (when the input is greater than largest uint152).\\n *\\n * Counterpart to Solidity's `uint152` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 152 bits\\n */\\n function toUint152(uint256 value) internal pure returns (uint152) {\\n if (value > type(uint152).max) {\\n revert SafeCastOverflowedUintDowncast(152, value);\\n }\\n return uint152(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint144 from uint256, reverting on\\n * overflow (when the input is greater than largest uint144).\\n *\\n * Counterpart to Solidity's `uint144` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 144 bits\\n */\\n function toUint144(uint256 value) internal pure returns (uint144) {\\n if (value > type(uint144).max) {\\n revert SafeCastOverflowedUintDowncast(144, value);\\n }\\n return uint144(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint136 from uint256, reverting on\\n * overflow (when the input is greater than largest uint136).\\n *\\n * Counterpart to Solidity's `uint136` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 136 bits\\n */\\n function toUint136(uint256 value) internal pure returns (uint136) {\\n if (value > type(uint136).max) {\\n revert SafeCastOverflowedUintDowncast(136, value);\\n }\\n return uint136(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint128 from uint256, reverting on\\n * overflow (when the input is greater than largest uint128).\\n *\\n * Counterpart to Solidity's `uint128` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 128 bits\\n */\\n function toUint128(uint256 value) internal pure returns (uint128) {\\n if (value > type(uint128).max) {\\n revert SafeCastOverflowedUintDowncast(128, value);\\n }\\n return uint128(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint120 from uint256, reverting on\\n * overflow (when the input is greater than largest uint120).\\n *\\n * Counterpart to Solidity's `uint120` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 120 bits\\n */\\n function toUint120(uint256 value) internal pure returns (uint120) {\\n if (value > type(uint120).max) {\\n revert SafeCastOverflowedUintDowncast(120, value);\\n }\\n return uint120(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint112 from uint256, reverting on\\n * overflow (when the input is greater than largest uint112).\\n *\\n * Counterpart to Solidity's `uint112` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 112 bits\\n */\\n function toUint112(uint256 value) internal pure returns (uint112) {\\n if (value > type(uint112).max) {\\n revert SafeCastOverflowedUintDowncast(112, value);\\n }\\n return uint112(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint104 from uint256, reverting on\\n * overflow (when the input is greater than largest uint104).\\n *\\n * Counterpart to Solidity's `uint104` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 104 bits\\n */\\n function toUint104(uint256 value) internal pure returns (uint104) {\\n if (value > type(uint104).max) {\\n revert SafeCastOverflowedUintDowncast(104, value);\\n }\\n return uint104(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint96 from uint256, reverting on\\n * overflow (when the input is greater than largest uint96).\\n *\\n * Counterpart to Solidity's `uint96` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 96 bits\\n */\\n function toUint96(uint256 value) internal pure returns (uint96) {\\n if (value > type(uint96).max) {\\n revert SafeCastOverflowedUintDowncast(96, value);\\n }\\n return uint96(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint88 from uint256, reverting on\\n * overflow (when the input is greater than largest uint88).\\n *\\n * Counterpart to Solidity's `uint88` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 88 bits\\n */\\n function toUint88(uint256 value) internal pure returns (uint88) {\\n if (value > type(uint88).max) {\\n revert SafeCastOverflowedUintDowncast(88, value);\\n }\\n return uint88(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint80 from uint256, reverting on\\n * overflow (when the input is greater than largest uint80).\\n *\\n * Counterpart to Solidity's `uint80` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 80 bits\\n */\\n function toUint80(uint256 value) internal pure returns (uint80) {\\n if (value > type(uint80).max) {\\n revert SafeCastOverflowedUintDowncast(80, value);\\n }\\n return uint80(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint72 from uint256, reverting on\\n * overflow (when the input is greater than largest uint72).\\n *\\n * Counterpart to Solidity's `uint72` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 72 bits\\n */\\n function toUint72(uint256 value) internal pure returns (uint72) {\\n if (value > type(uint72).max) {\\n revert SafeCastOverflowedUintDowncast(72, value);\\n }\\n return uint72(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint64 from uint256, reverting on\\n * overflow (when the input is greater than largest uint64).\\n *\\n * Counterpart to Solidity's `uint64` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 64 bits\\n */\\n function toUint64(uint256 value) internal pure returns (uint64) {\\n if (value > type(uint64).max) {\\n revert SafeCastOverflowedUintDowncast(64, value);\\n }\\n return uint64(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint56 from uint256, reverting on\\n * overflow (when the input is greater than largest uint56).\\n *\\n * Counterpart to Solidity's `uint56` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 56 bits\\n */\\n function toUint56(uint256 value) internal pure returns (uint56) {\\n if (value > type(uint56).max) {\\n revert SafeCastOverflowedUintDowncast(56, value);\\n }\\n return uint56(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint48 from uint256, reverting on\\n * overflow (when the input is greater than largest uint48).\\n *\\n * Counterpart to Solidity's `uint48` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 48 bits\\n */\\n function toUint48(uint256 value) internal pure returns (uint48) {\\n if (value > type(uint48).max) {\\n revert SafeCastOverflowedUintDowncast(48, value);\\n }\\n return uint48(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint40 from uint256, reverting on\\n * overflow (when the input is greater than largest uint40).\\n *\\n * Counterpart to Solidity's `uint40` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 40 bits\\n */\\n function toUint40(uint256 value) internal pure returns (uint40) {\\n if (value > type(uint40).max) {\\n revert SafeCastOverflowedUintDowncast(40, value);\\n }\\n return uint40(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint32 from uint256, reverting on\\n * overflow (when the input is greater than largest uint32).\\n *\\n * Counterpart to Solidity's `uint32` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 32 bits\\n */\\n function toUint32(uint256 value) internal pure returns (uint32) {\\n if (value > type(uint32).max) {\\n revert SafeCastOverflowedUintDowncast(32, value);\\n }\\n return uint32(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint24 from uint256, reverting on\\n * overflow (when the input is greater than largest uint24).\\n *\\n * Counterpart to Solidity's `uint24` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 24 bits\\n */\\n function toUint24(uint256 value) internal pure returns (uint24) {\\n if (value > type(uint24).max) {\\n revert SafeCastOverflowedUintDowncast(24, value);\\n }\\n return uint24(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint16 from uint256, reverting on\\n * overflow (when the input is greater than largest uint16).\\n *\\n * Counterpart to Solidity's `uint16` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 16 bits\\n */\\n function toUint16(uint256 value) internal pure returns (uint16) {\\n if (value > type(uint16).max) {\\n revert SafeCastOverflowedUintDowncast(16, value);\\n }\\n return uint16(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint8 from uint256, reverting on\\n * overflow (when the input is greater than largest uint8).\\n *\\n * Counterpart to Solidity's `uint8` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 8 bits\\n */\\n function toUint8(uint256 value) internal pure returns (uint8) {\\n if (value > type(uint8).max) {\\n revert SafeCastOverflowedUintDowncast(8, value);\\n }\\n return uint8(value);\\n }\\n\\n /**\\n * @dev Converts a signed int256 into an unsigned uint256.\\n *\\n * Requirements:\\n *\\n * - input must be greater than or equal to 0.\\n */\\n function toUint256(int256 value) internal pure returns (uint256) {\\n if (value < 0) {\\n revert SafeCastOverflowedIntToUint(value);\\n }\\n return uint256(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted int248 from int256, reverting on\\n * overflow (when the input is less than smallest int248 or\\n * greater than largest int248).\\n *\\n * Counterpart to Solidity's `int248` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 248 bits\\n */\\n function toInt248(int256 value) internal pure returns (int248 downcasted) {\\n downcasted = int248(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(248, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int240 from int256, reverting on\\n * overflow (when the input is less than smallest int240 or\\n * greater than largest int240).\\n *\\n * Counterpart to Solidity's `int240` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 240 bits\\n */\\n function toInt240(int256 value) internal pure returns (int240 downcasted) {\\n downcasted = int240(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(240, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int232 from int256, reverting on\\n * overflow (when the input is less than smallest int232 or\\n * greater than largest int232).\\n *\\n * Counterpart to Solidity's `int232` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 232 bits\\n */\\n function toInt232(int256 value) internal pure returns (int232 downcasted) {\\n downcasted = int232(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(232, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int224 from int256, reverting on\\n * overflow (when the input is less than smallest int224 or\\n * greater than largest int224).\\n *\\n * Counterpart to Solidity's `int224` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 224 bits\\n */\\n function toInt224(int256 value) internal pure returns (int224 downcasted) {\\n downcasted = int224(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(224, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int216 from int256, reverting on\\n * overflow (when the input is less than smallest int216 or\\n * greater than largest int216).\\n *\\n * Counterpart to Solidity's `int216` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 216 bits\\n */\\n function toInt216(int256 value) internal pure returns (int216 downcasted) {\\n downcasted = int216(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(216, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int208 from int256, reverting on\\n * overflow (when the input is less than smallest int208 or\\n * greater than largest int208).\\n *\\n * Counterpart to Solidity's `int208` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 208 bits\\n */\\n function toInt208(int256 value) internal pure returns (int208 downcasted) {\\n downcasted = int208(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(208, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int200 from int256, reverting on\\n * overflow (when the input is less than smallest int200 or\\n * greater than largest int200).\\n *\\n * Counterpart to Solidity's `int200` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 200 bits\\n */\\n function toInt200(int256 value) internal pure returns (int200 downcasted) {\\n downcasted = int200(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(200, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int192 from int256, reverting on\\n * overflow (when the input is less than smallest int192 or\\n * greater than largest int192).\\n *\\n * Counterpart to Solidity's `int192` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 192 bits\\n */\\n function toInt192(int256 value) internal pure returns (int192 downcasted) {\\n downcasted = int192(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(192, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int184 from int256, reverting on\\n * overflow (when the input is less than smallest int184 or\\n * greater than largest int184).\\n *\\n * Counterpart to Solidity's `int184` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 184 bits\\n */\\n function toInt184(int256 value) internal pure returns (int184 downcasted) {\\n downcasted = int184(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(184, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int176 from int256, reverting on\\n * overflow (when the input is less than smallest int176 or\\n * greater than largest int176).\\n *\\n * Counterpart to Solidity's `int176` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 176 bits\\n */\\n function toInt176(int256 value) internal pure returns (int176 downcasted) {\\n downcasted = int176(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(176, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int168 from int256, reverting on\\n * overflow (when the input is less than smallest int168 or\\n * greater than largest int168).\\n *\\n * Counterpart to Solidity's `int168` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 168 bits\\n */\\n function toInt168(int256 value) internal pure returns (int168 downcasted) {\\n downcasted = int168(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(168, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int160 from int256, reverting on\\n * overflow (when the input is less than smallest int160 or\\n * greater than largest int160).\\n *\\n * Counterpart to Solidity's `int160` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 160 bits\\n */\\n function toInt160(int256 value) internal pure returns (int160 downcasted) {\\n downcasted = int160(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(160, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int152 from int256, reverting on\\n * overflow (when the input is less than smallest int152 or\\n * greater than largest int152).\\n *\\n * Counterpart to Solidity's `int152` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 152 bits\\n */\\n function toInt152(int256 value) internal pure returns (int152 downcasted) {\\n downcasted = int152(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(152, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int144 from int256, reverting on\\n * overflow (when the input is less than smallest int144 or\\n * greater than largest int144).\\n *\\n * Counterpart to Solidity's `int144` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 144 bits\\n */\\n function toInt144(int256 value) internal pure returns (int144 downcasted) {\\n downcasted = int144(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(144, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int136 from int256, reverting on\\n * overflow (when the input is less than smallest int136 or\\n * greater than largest int136).\\n *\\n * Counterpart to Solidity's `int136` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 136 bits\\n */\\n function toInt136(int256 value) internal pure returns (int136 downcasted) {\\n downcasted = int136(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(136, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int128 from int256, reverting on\\n * overflow (when the input is less than smallest int128 or\\n * greater than largest int128).\\n *\\n * Counterpart to Solidity's `int128` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 128 bits\\n */\\n function toInt128(int256 value) internal pure returns (int128 downcasted) {\\n downcasted = int128(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(128, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int120 from int256, reverting on\\n * overflow (when the input is less than smallest int120 or\\n * greater than largest int120).\\n *\\n * Counterpart to Solidity's `int120` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 120 bits\\n */\\n function toInt120(int256 value) internal pure returns (int120 downcasted) {\\n downcasted = int120(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(120, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int112 from int256, reverting on\\n * overflow (when the input is less than smallest int112 or\\n * greater than largest int112).\\n *\\n * Counterpart to Solidity's `int112` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 112 bits\\n */\\n function toInt112(int256 value) internal pure returns (int112 downcasted) {\\n downcasted = int112(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(112, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int104 from int256, reverting on\\n * overflow (when the input is less than smallest int104 or\\n * greater than largest int104).\\n *\\n * Counterpart to Solidity's `int104` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 104 bits\\n */\\n function toInt104(int256 value) internal pure returns (int104 downcasted) {\\n downcasted = int104(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(104, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int96 from int256, reverting on\\n * overflow (when the input is less than smallest int96 or\\n * greater than largest int96).\\n *\\n * Counterpart to Solidity's `int96` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 96 bits\\n */\\n function toInt96(int256 value) internal pure returns (int96 downcasted) {\\n downcasted = int96(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(96, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int88 from int256, reverting on\\n * overflow (when the input is less than smallest int88 or\\n * greater than largest int88).\\n *\\n * Counterpart to Solidity's `int88` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 88 bits\\n */\\n function toInt88(int256 value) internal pure returns (int88 downcasted) {\\n downcasted = int88(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(88, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int80 from int256, reverting on\\n * overflow (when the input is less than smallest int80 or\\n * greater than largest int80).\\n *\\n * Counterpart to Solidity's `int80` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 80 bits\\n */\\n function toInt80(int256 value) internal pure returns (int80 downcasted) {\\n downcasted = int80(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(80, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int72 from int256, reverting on\\n * overflow (when the input is less than smallest int72 or\\n * greater than largest int72).\\n *\\n * Counterpart to Solidity's `int72` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 72 bits\\n */\\n function toInt72(int256 value) internal pure returns (int72 downcasted) {\\n downcasted = int72(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(72, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int64 from int256, reverting on\\n * overflow (when the input is less than smallest int64 or\\n * greater than largest int64).\\n *\\n * Counterpart to Solidity's `int64` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 64 bits\\n */\\n function toInt64(int256 value) internal pure returns (int64 downcasted) {\\n downcasted = int64(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(64, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int56 from int256, reverting on\\n * overflow (when the input is less than smallest int56 or\\n * greater than largest int56).\\n *\\n * Counterpart to Solidity's `int56` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 56 bits\\n */\\n function toInt56(int256 value) internal pure returns (int56 downcasted) {\\n downcasted = int56(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(56, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int48 from int256, reverting on\\n * overflow (when the input is less than smallest int48 or\\n * greater than largest int48).\\n *\\n * Counterpart to Solidity's `int48` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 48 bits\\n */\\n function toInt48(int256 value) internal pure returns (int48 downcasted) {\\n downcasted = int48(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(48, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int40 from int256, reverting on\\n * overflow (when the input is less than smallest int40 or\\n * greater than largest int40).\\n *\\n * Counterpart to Solidity's `int40` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 40 bits\\n */\\n function toInt40(int256 value) internal pure returns (int40 downcasted) {\\n downcasted = int40(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(40, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int32 from int256, reverting on\\n * overflow (when the input is less than smallest int32 or\\n * greater than largest int32).\\n *\\n * Counterpart to Solidity's `int32` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 32 bits\\n */\\n function toInt32(int256 value) internal pure returns (int32 downcasted) {\\n downcasted = int32(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(32, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int24 from int256, reverting on\\n * overflow (when the input is less than smallest int24 or\\n * greater than largest int24).\\n *\\n * Counterpart to Solidity's `int24` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 24 bits\\n */\\n function toInt24(int256 value) internal pure returns (int24 downcasted) {\\n downcasted = int24(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(24, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int16 from int256, reverting on\\n * overflow (when the input is less than smallest int16 or\\n * greater than largest int16).\\n *\\n * Counterpart to Solidity's `int16` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 16 bits\\n */\\n function toInt16(int256 value) internal pure returns (int16 downcasted) {\\n downcasted = int16(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(16, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int8 from int256, reverting on\\n * overflow (when the input is less than smallest int8 or\\n * greater than largest int8).\\n *\\n * Counterpart to Solidity's `int8` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 8 bits\\n */\\n function toInt8(int256 value) internal pure returns (int8 downcasted) {\\n downcasted = int8(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(8, value);\\n }\\n }\\n\\n /**\\n * @dev Converts an unsigned uint256 into a signed int256.\\n *\\n * Requirements:\\n *\\n * - input must be less than or equal to maxInt256.\\n */\\n function toInt256(uint256 value) internal pure returns (int256) {\\n // Note: Unsafe cast below is okay because `type(int256).max` is guaranteed to be positive\\n if (value > uint256(type(int256).max)) {\\n revert SafeCastOverflowedUintToInt(value);\\n }\\n return int256(value);\\n }\\n\\n /**\\n * @dev Cast a boolean (false or true) to a uint256 (0 or 1) with no jump.\\n */\\n function toUint(bool b) internal pure returns (uint256 u) {\\n assembly (\\\"memory-safe\\\") {\\n u := iszero(iszero(b))\\n }\\n }\\n}\\n\",\"keccak256\":\"0x195533c86d0ef72bcc06456a4f66a9b941f38eb403739b00f21fd7c1abd1ae54\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/math/SignedMath.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/math/SignedMath.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {SafeCast} from \\\"./SafeCast.sol\\\";\\n\\n/**\\n * @dev Standard signed math utilities missing in the Solidity language.\\n */\\nlibrary SignedMath {\\n /**\\n * @dev Branchless ternary evaluation for `a ? b : c`. Gas costs are constant.\\n *\\n * IMPORTANT: This function may reduce bytecode size and consume less gas when used standalone.\\n * However, the compiler may optimize Solidity ternary operations (i.e. `a ? b : c`) to only compute\\n * one branch when needed, making this function more expensive.\\n */\\n function ternary(bool condition, int256 a, int256 b) internal pure returns (int256) {\\n unchecked {\\n // branchless ternary works because:\\n // b ^ (a ^ b) == a\\n // b ^ 0 == b\\n return b ^ ((a ^ b) * int256(SafeCast.toUint(condition)));\\n }\\n }\\n\\n /**\\n * @dev Returns the largest of two signed numbers.\\n */\\n function max(int256 a, int256 b) internal pure returns (int256) {\\n return ternary(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 ternary(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 // Formula from the \\\"Bit Twiddling Hacks\\\" by Sean Eron Anderson.\\n // Since `n` is a signed integer, the generated bytecode will use the SAR opcode to perform the right shift,\\n // taking advantage of the most significant (or \\\"sign\\\" bit) in two's complement representation.\\n // This opcode adds new most significant bits set to the value of the previous most significant bit. As a result,\\n // the mask will either be `bytes32(0)` (if n is positive) or `~bytes32(0)` (if n is negative).\\n int256 mask = n >> 255;\\n\\n // A `bytes32(0)` mask leaves the input unchanged, while a `~bytes32(0)` mask complements it.\\n return uint256((n + mask) ^ mask);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xb1970fac7b64e6c09611e6691791e848d5e3fe410fa5899e7df2e0afd77a99e3\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/structs/Checkpoints.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/structs/Checkpoints.sol)\\n// This file was procedurally generated from scripts/generate/templates/Checkpoints.js.\\n\\npragma solidity ^0.8.20;\\n\\nimport {Math} from \\\"../math/Math.sol\\\";\\n\\n/**\\n * @dev This library defines the `Trace*` struct, for checkpointing values as they change at different points in\\n * time, and later looking up past values by block number. See {Votes} as an example.\\n *\\n * To create a history of checkpoints define a variable type `Checkpoints.Trace*` in your contract, and store a new\\n * checkpoint for the current transaction block using the {push} function.\\n */\\nlibrary Checkpoints {\\n /**\\n * @dev A value was attempted to be inserted on a past checkpoint.\\n */\\n error CheckpointUnorderedInsertion();\\n\\n struct Trace224 {\\n Checkpoint224[] _checkpoints;\\n }\\n\\n struct Checkpoint224 {\\n uint32 _key;\\n uint224 _value;\\n }\\n\\n /**\\n * @dev Pushes a (`key`, `value`) pair into a Trace224 so that it is stored as the checkpoint.\\n *\\n * Returns previous value and new value.\\n *\\n * IMPORTANT: Never accept `key` as a user input, since an arbitrary `type(uint32).max` key set will disable the\\n * library.\\n */\\n function push(\\n Trace224 storage self,\\n uint32 key,\\n uint224 value\\n ) internal returns (uint224 oldValue, uint224 newValue) {\\n return _insert(self._checkpoints, key, value);\\n }\\n\\n /**\\n * @dev Returns the value in the first (oldest) checkpoint with key greater or equal than the search key, or zero if\\n * there is none.\\n */\\n function lowerLookup(Trace224 storage self, uint32 key) internal view returns (uint224) {\\n uint256 len = self._checkpoints.length;\\n uint256 pos = _lowerBinaryLookup(self._checkpoints, key, 0, len);\\n return pos == len ? 0 : _unsafeAccess(self._checkpoints, pos)._value;\\n }\\n\\n /**\\n * @dev Returns the value in the last (most recent) checkpoint with key lower or equal than the search key, or zero\\n * if there is none.\\n */\\n function upperLookup(Trace224 storage self, uint32 key) internal view returns (uint224) {\\n uint256 len = self._checkpoints.length;\\n uint256 pos = _upperBinaryLookup(self._checkpoints, key, 0, len);\\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\\n }\\n\\n /**\\n * @dev Returns the value in the last (most recent) checkpoint with key lower or equal than the search key, or zero\\n * if there is none.\\n *\\n * NOTE: This is a variant of {upperLookup} that is optimised to find \\\"recent\\\" checkpoint (checkpoints with high\\n * keys).\\n */\\n function upperLookupRecent(Trace224 storage self, uint32 key) internal view returns (uint224) {\\n uint256 len = self._checkpoints.length;\\n\\n uint256 low = 0;\\n uint256 high = len;\\n\\n if (len > 5) {\\n uint256 mid = len - Math.sqrt(len);\\n if (key < _unsafeAccess(self._checkpoints, mid)._key) {\\n high = mid;\\n } else {\\n low = mid + 1;\\n }\\n }\\n\\n uint256 pos = _upperBinaryLookup(self._checkpoints, key, low, high);\\n\\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\\n }\\n\\n /**\\n * @dev Returns the value in the most recent checkpoint, or zero if there are no checkpoints.\\n */\\n function latest(Trace224 storage self) internal view returns (uint224) {\\n uint256 pos = self._checkpoints.length;\\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\\n }\\n\\n /**\\n * @dev Returns whether there is a checkpoint in the structure (i.e. it is not empty), and if so the key and value\\n * in the most recent checkpoint.\\n */\\n function latestCheckpoint(Trace224 storage self) internal view returns (bool exists, uint32 _key, uint224 _value) {\\n uint256 pos = self._checkpoints.length;\\n if (pos == 0) {\\n return (false, 0, 0);\\n } else {\\n Checkpoint224 storage ckpt = _unsafeAccess(self._checkpoints, pos - 1);\\n return (true, ckpt._key, ckpt._value);\\n }\\n }\\n\\n /**\\n * @dev Returns the number of checkpoint.\\n */\\n function length(Trace224 storage self) internal view returns (uint256) {\\n return self._checkpoints.length;\\n }\\n\\n /**\\n * @dev Returns checkpoint at given position.\\n */\\n function at(Trace224 storage self, uint32 pos) internal view returns (Checkpoint224 memory) {\\n return self._checkpoints[pos];\\n }\\n\\n /**\\n * @dev Pushes a (`key`, `value`) pair into an ordered list of checkpoints, either by inserting a new checkpoint,\\n * or by updating the last one.\\n */\\n function _insert(\\n Checkpoint224[] storage self,\\n uint32 key,\\n uint224 value\\n ) private returns (uint224 oldValue, uint224 newValue) {\\n uint256 pos = self.length;\\n\\n if (pos > 0) {\\n Checkpoint224 storage last = _unsafeAccess(self, pos - 1);\\n uint32 lastKey = last._key;\\n uint224 lastValue = last._value;\\n\\n // Checkpoint keys must be non-decreasing.\\n if (lastKey > key) {\\n revert CheckpointUnorderedInsertion();\\n }\\n\\n // Update or push new checkpoint\\n if (lastKey == key) {\\n last._value = value;\\n } else {\\n self.push(Checkpoint224({_key: key, _value: value}));\\n }\\n return (lastValue, value);\\n } else {\\n self.push(Checkpoint224({_key: key, _value: value}));\\n return (0, value);\\n }\\n }\\n\\n /**\\n * @dev Return the index of the first (oldest) checkpoint with key strictly bigger than the search key, or `high`\\n * if there is none. `low` and `high` define a section where to do the search, with inclusive `low` and exclusive\\n * `high`.\\n *\\n * WARNING: `high` should not be greater than the array's length.\\n */\\n function _upperBinaryLookup(\\n Checkpoint224[] storage self,\\n uint32 key,\\n uint256 low,\\n uint256 high\\n ) private view returns (uint256) {\\n while (low < high) {\\n uint256 mid = Math.average(low, high);\\n if (_unsafeAccess(self, mid)._key > key) {\\n high = mid;\\n } else {\\n low = mid + 1;\\n }\\n }\\n return high;\\n }\\n\\n /**\\n * @dev Return the index of the first (oldest) checkpoint with key greater or equal than the search key, or `high`\\n * if there is none. `low` and `high` define a section where to do the search, with inclusive `low` and exclusive\\n * `high`.\\n *\\n * WARNING: `high` should not be greater than the array's length.\\n */\\n function _lowerBinaryLookup(\\n Checkpoint224[] storage self,\\n uint32 key,\\n uint256 low,\\n uint256 high\\n ) private view returns (uint256) {\\n while (low < high) {\\n uint256 mid = Math.average(low, high);\\n if (_unsafeAccess(self, mid)._key < key) {\\n low = mid + 1;\\n } else {\\n high = mid;\\n }\\n }\\n return high;\\n }\\n\\n /**\\n * @dev Access an element of the array without performing bounds check. The position is assumed to be within bounds.\\n */\\n function _unsafeAccess(\\n Checkpoint224[] storage self,\\n uint256 pos\\n ) private pure returns (Checkpoint224 storage result) {\\n assembly {\\n mstore(0, self.slot)\\n result.slot := add(keccak256(0, 0x20), pos)\\n }\\n }\\n\\n struct Trace208 {\\n Checkpoint208[] _checkpoints;\\n }\\n\\n struct Checkpoint208 {\\n uint48 _key;\\n uint208 _value;\\n }\\n\\n /**\\n * @dev Pushes a (`key`, `value`) pair into a Trace208 so that it is stored as the checkpoint.\\n *\\n * Returns previous value and new value.\\n *\\n * IMPORTANT: Never accept `key` as a user input, since an arbitrary `type(uint48).max` key set will disable the\\n * library.\\n */\\n function push(\\n Trace208 storage self,\\n uint48 key,\\n uint208 value\\n ) internal returns (uint208 oldValue, uint208 newValue) {\\n return _insert(self._checkpoints, key, value);\\n }\\n\\n /**\\n * @dev Returns the value in the first (oldest) checkpoint with key greater or equal than the search key, or zero if\\n * there is none.\\n */\\n function lowerLookup(Trace208 storage self, uint48 key) internal view returns (uint208) {\\n uint256 len = self._checkpoints.length;\\n uint256 pos = _lowerBinaryLookup(self._checkpoints, key, 0, len);\\n return pos == len ? 0 : _unsafeAccess(self._checkpoints, pos)._value;\\n }\\n\\n /**\\n * @dev Returns the value in the last (most recent) checkpoint with key lower or equal than the search key, or zero\\n * if there is none.\\n */\\n function upperLookup(Trace208 storage self, uint48 key) internal view returns (uint208) {\\n uint256 len = self._checkpoints.length;\\n uint256 pos = _upperBinaryLookup(self._checkpoints, key, 0, len);\\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\\n }\\n\\n /**\\n * @dev Returns the value in the last (most recent) checkpoint with key lower or equal than the search key, or zero\\n * if there is none.\\n *\\n * NOTE: This is a variant of {upperLookup} that is optimised to find \\\"recent\\\" checkpoint (checkpoints with high\\n * keys).\\n */\\n function upperLookupRecent(Trace208 storage self, uint48 key) internal view returns (uint208) {\\n uint256 len = self._checkpoints.length;\\n\\n uint256 low = 0;\\n uint256 high = len;\\n\\n if (len > 5) {\\n uint256 mid = len - Math.sqrt(len);\\n if (key < _unsafeAccess(self._checkpoints, mid)._key) {\\n high = mid;\\n } else {\\n low = mid + 1;\\n }\\n }\\n\\n uint256 pos = _upperBinaryLookup(self._checkpoints, key, low, high);\\n\\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\\n }\\n\\n /**\\n * @dev Returns the value in the most recent checkpoint, or zero if there are no checkpoints.\\n */\\n function latest(Trace208 storage self) internal view returns (uint208) {\\n uint256 pos = self._checkpoints.length;\\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\\n }\\n\\n /**\\n * @dev Returns whether there is a checkpoint in the structure (i.e. it is not empty), and if so the key and value\\n * in the most recent checkpoint.\\n */\\n function latestCheckpoint(Trace208 storage self) internal view returns (bool exists, uint48 _key, uint208 _value) {\\n uint256 pos = self._checkpoints.length;\\n if (pos == 0) {\\n return (false, 0, 0);\\n } else {\\n Checkpoint208 storage ckpt = _unsafeAccess(self._checkpoints, pos - 1);\\n return (true, ckpt._key, ckpt._value);\\n }\\n }\\n\\n /**\\n * @dev Returns the number of checkpoint.\\n */\\n function length(Trace208 storage self) internal view returns (uint256) {\\n return self._checkpoints.length;\\n }\\n\\n /**\\n * @dev Returns checkpoint at given position.\\n */\\n function at(Trace208 storage self, uint32 pos) internal view returns (Checkpoint208 memory) {\\n return self._checkpoints[pos];\\n }\\n\\n /**\\n * @dev Pushes a (`key`, `value`) pair into an ordered list of checkpoints, either by inserting a new checkpoint,\\n * or by updating the last one.\\n */\\n function _insert(\\n Checkpoint208[] storage self,\\n uint48 key,\\n uint208 value\\n ) private returns (uint208 oldValue, uint208 newValue) {\\n uint256 pos = self.length;\\n\\n if (pos > 0) {\\n Checkpoint208 storage last = _unsafeAccess(self, pos - 1);\\n uint48 lastKey = last._key;\\n uint208 lastValue = last._value;\\n\\n // Checkpoint keys must be non-decreasing.\\n if (lastKey > key) {\\n revert CheckpointUnorderedInsertion();\\n }\\n\\n // Update or push new checkpoint\\n if (lastKey == key) {\\n last._value = value;\\n } else {\\n self.push(Checkpoint208({_key: key, _value: value}));\\n }\\n return (lastValue, value);\\n } else {\\n self.push(Checkpoint208({_key: key, _value: value}));\\n return (0, value);\\n }\\n }\\n\\n /**\\n * @dev Return the index of the first (oldest) checkpoint with key strictly bigger than the search key, or `high`\\n * if there is none. `low` and `high` define a section where to do the search, with inclusive `low` and exclusive\\n * `high`.\\n *\\n * WARNING: `high` should not be greater than the array's length.\\n */\\n function _upperBinaryLookup(\\n Checkpoint208[] storage self,\\n uint48 key,\\n uint256 low,\\n uint256 high\\n ) private view returns (uint256) {\\n while (low < high) {\\n uint256 mid = Math.average(low, high);\\n if (_unsafeAccess(self, mid)._key > key) {\\n high = mid;\\n } else {\\n low = mid + 1;\\n }\\n }\\n return high;\\n }\\n\\n /**\\n * @dev Return the index of the first (oldest) checkpoint with key greater or equal than the search key, or `high`\\n * if there is none. `low` and `high` define a section where to do the search, with inclusive `low` and exclusive\\n * `high`.\\n *\\n * WARNING: `high` should not be greater than the array's length.\\n */\\n function _lowerBinaryLookup(\\n Checkpoint208[] storage self,\\n uint48 key,\\n uint256 low,\\n uint256 high\\n ) private view returns (uint256) {\\n while (low < high) {\\n uint256 mid = Math.average(low, high);\\n if (_unsafeAccess(self, mid)._key < key) {\\n low = mid + 1;\\n } else {\\n high = mid;\\n }\\n }\\n return high;\\n }\\n\\n /**\\n * @dev Access an element of the array without performing bounds check. The position is assumed to be within bounds.\\n */\\n function _unsafeAccess(\\n Checkpoint208[] storage self,\\n uint256 pos\\n ) private pure returns (Checkpoint208 storage result) {\\n assembly {\\n mstore(0, self.slot)\\n result.slot := add(keccak256(0, 0x20), pos)\\n }\\n }\\n\\n struct Trace160 {\\n Checkpoint160[] _checkpoints;\\n }\\n\\n struct Checkpoint160 {\\n uint96 _key;\\n uint160 _value;\\n }\\n\\n /**\\n * @dev Pushes a (`key`, `value`) pair into a Trace160 so that it is stored as the checkpoint.\\n *\\n * Returns previous value and new value.\\n *\\n * IMPORTANT: Never accept `key` as a user input, since an arbitrary `type(uint96).max` key set will disable the\\n * library.\\n */\\n function push(\\n Trace160 storage self,\\n uint96 key,\\n uint160 value\\n ) internal returns (uint160 oldValue, uint160 newValue) {\\n return _insert(self._checkpoints, key, value);\\n }\\n\\n /**\\n * @dev Returns the value in the first (oldest) checkpoint with key greater or equal than the search key, or zero if\\n * there is none.\\n */\\n function lowerLookup(Trace160 storage self, uint96 key) internal view returns (uint160) {\\n uint256 len = self._checkpoints.length;\\n uint256 pos = _lowerBinaryLookup(self._checkpoints, key, 0, len);\\n return pos == len ? 0 : _unsafeAccess(self._checkpoints, pos)._value;\\n }\\n\\n /**\\n * @dev Returns the value in the last (most recent) checkpoint with key lower or equal than the search key, or zero\\n * if there is none.\\n */\\n function upperLookup(Trace160 storage self, uint96 key) internal view returns (uint160) {\\n uint256 len = self._checkpoints.length;\\n uint256 pos = _upperBinaryLookup(self._checkpoints, key, 0, len);\\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\\n }\\n\\n /**\\n * @dev Returns the value in the last (most recent) checkpoint with key lower or equal than the search key, or zero\\n * if there is none.\\n *\\n * NOTE: This is a variant of {upperLookup} that is optimised to find \\\"recent\\\" checkpoint (checkpoints with high\\n * keys).\\n */\\n function upperLookupRecent(Trace160 storage self, uint96 key) internal view returns (uint160) {\\n uint256 len = self._checkpoints.length;\\n\\n uint256 low = 0;\\n uint256 high = len;\\n\\n if (len > 5) {\\n uint256 mid = len - Math.sqrt(len);\\n if (key < _unsafeAccess(self._checkpoints, mid)._key) {\\n high = mid;\\n } else {\\n low = mid + 1;\\n }\\n }\\n\\n uint256 pos = _upperBinaryLookup(self._checkpoints, key, low, high);\\n\\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\\n }\\n\\n /**\\n * @dev Returns the value in the most recent checkpoint, or zero if there are no checkpoints.\\n */\\n function latest(Trace160 storage self) internal view returns (uint160) {\\n uint256 pos = self._checkpoints.length;\\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\\n }\\n\\n /**\\n * @dev Returns whether there is a checkpoint in the structure (i.e. it is not empty), and if so the key and value\\n * in the most recent checkpoint.\\n */\\n function latestCheckpoint(Trace160 storage self) internal view returns (bool exists, uint96 _key, uint160 _value) {\\n uint256 pos = self._checkpoints.length;\\n if (pos == 0) {\\n return (false, 0, 0);\\n } else {\\n Checkpoint160 storage ckpt = _unsafeAccess(self._checkpoints, pos - 1);\\n return (true, ckpt._key, ckpt._value);\\n }\\n }\\n\\n /**\\n * @dev Returns the number of checkpoint.\\n */\\n function length(Trace160 storage self) internal view returns (uint256) {\\n return self._checkpoints.length;\\n }\\n\\n /**\\n * @dev Returns checkpoint at given position.\\n */\\n function at(Trace160 storage self, uint32 pos) internal view returns (Checkpoint160 memory) {\\n return self._checkpoints[pos];\\n }\\n\\n /**\\n * @dev Pushes a (`key`, `value`) pair into an ordered list of checkpoints, either by inserting a new checkpoint,\\n * or by updating the last one.\\n */\\n function _insert(\\n Checkpoint160[] storage self,\\n uint96 key,\\n uint160 value\\n ) private returns (uint160 oldValue, uint160 newValue) {\\n uint256 pos = self.length;\\n\\n if (pos > 0) {\\n Checkpoint160 storage last = _unsafeAccess(self, pos - 1);\\n uint96 lastKey = last._key;\\n uint160 lastValue = last._value;\\n\\n // Checkpoint keys must be non-decreasing.\\n if (lastKey > key) {\\n revert CheckpointUnorderedInsertion();\\n }\\n\\n // Update or push new checkpoint\\n if (lastKey == key) {\\n last._value = value;\\n } else {\\n self.push(Checkpoint160({_key: key, _value: value}));\\n }\\n return (lastValue, value);\\n } else {\\n self.push(Checkpoint160({_key: key, _value: value}));\\n return (0, value);\\n }\\n }\\n\\n /**\\n * @dev Return the index of the first (oldest) checkpoint with key strictly bigger than the search key, or `high`\\n * if there is none. `low` and `high` define a section where to do the search, with inclusive `low` and exclusive\\n * `high`.\\n *\\n * WARNING: `high` should not be greater than the array's length.\\n */\\n function _upperBinaryLookup(\\n Checkpoint160[] storage self,\\n uint96 key,\\n uint256 low,\\n uint256 high\\n ) private view returns (uint256) {\\n while (low < high) {\\n uint256 mid = Math.average(low, high);\\n if (_unsafeAccess(self, mid)._key > key) {\\n high = mid;\\n } else {\\n low = mid + 1;\\n }\\n }\\n return high;\\n }\\n\\n /**\\n * @dev Return the index of the first (oldest) checkpoint with key greater or equal than the search key, or `high`\\n * if there is none. `low` and `high` define a section where to do the search, with inclusive `low` and exclusive\\n * `high`.\\n *\\n * WARNING: `high` should not be greater than the array's length.\\n */\\n function _lowerBinaryLookup(\\n Checkpoint160[] storage self,\\n uint96 key,\\n uint256 low,\\n uint256 high\\n ) private view returns (uint256) {\\n while (low < high) {\\n uint256 mid = Math.average(low, high);\\n if (_unsafeAccess(self, mid)._key < key) {\\n low = mid + 1;\\n } else {\\n high = mid;\\n }\\n }\\n return high;\\n }\\n\\n /**\\n * @dev Access an element of the array without performing bounds check. The position is assumed to be within bounds.\\n */\\n function _unsafeAccess(\\n Checkpoint160[] storage self,\\n uint256 pos\\n ) private pure returns (Checkpoint160 storage result) {\\n assembly {\\n mstore(0, self.slot)\\n result.slot := add(keccak256(0, 0x20), pos)\\n }\\n }\\n}\\n\",\"keccak256\":\"0x66364cd3247ea71cdb58f080f5d5ed6732433a8001413139661841535494692f\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/structs/DoubleEndedQueue.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/structs/DoubleEndedQueue.sol)\\npragma solidity ^0.8.20;\\n\\nimport {Panic} from \\\"../Panic.sol\\\";\\n\\n/**\\n * @dev A sequence of items with the ability to efficiently push and pop items (i.e. insert and remove) on both ends of\\n * the sequence (called front and back). Among other access patterns, it can be used to implement efficient LIFO and\\n * FIFO queues. Storage use is optimized, and all operations are O(1) constant time. This includes {clear}, given that\\n * the existing queue contents are left in storage.\\n *\\n * The struct is called `Bytes32Deque`. Other types can be cast to and from `bytes32`. This data structure can only be\\n * used in storage, and not in memory.\\n * ```solidity\\n * DoubleEndedQueue.Bytes32Deque queue;\\n * ```\\n */\\nlibrary DoubleEndedQueue {\\n /**\\n * @dev Indices are 128 bits so begin and end are packed in a single storage slot for efficient access.\\n *\\n * Struct members have an underscore prefix indicating that they are \\\"private\\\" and should not be read or written to\\n * directly. Use the functions provided below instead. Modifying the struct manually may violate assumptions and\\n * lead to unexpected behavior.\\n *\\n * The first item is at data[begin] and the last item is at data[end - 1]. This range can wrap around.\\n */\\n struct Bytes32Deque {\\n uint128 _begin;\\n uint128 _end;\\n mapping(uint128 index => bytes32) _data;\\n }\\n\\n /**\\n * @dev Inserts an item at the end of the queue.\\n *\\n * Reverts with {Panic-RESOURCE_ERROR} if the queue is full.\\n */\\n function pushBack(Bytes32Deque storage deque, bytes32 value) internal {\\n unchecked {\\n uint128 backIndex = deque._end;\\n if (backIndex + 1 == deque._begin) Panic.panic(Panic.RESOURCE_ERROR);\\n deque._data[backIndex] = value;\\n deque._end = backIndex + 1;\\n }\\n }\\n\\n /**\\n * @dev Removes the item at the end of the queue and returns it.\\n *\\n * Reverts with {Panic-EMPTY_ARRAY_POP} if the queue is empty.\\n */\\n function popBack(Bytes32Deque storage deque) internal returns (bytes32 value) {\\n unchecked {\\n uint128 backIndex = deque._end;\\n if (backIndex == deque._begin) Panic.panic(Panic.EMPTY_ARRAY_POP);\\n --backIndex;\\n value = deque._data[backIndex];\\n delete deque._data[backIndex];\\n deque._end = backIndex;\\n }\\n }\\n\\n /**\\n * @dev Inserts an item at the beginning of the queue.\\n *\\n * Reverts with {Panic-RESOURCE_ERROR} if the queue is full.\\n */\\n function pushFront(Bytes32Deque storage deque, bytes32 value) internal {\\n unchecked {\\n uint128 frontIndex = deque._begin - 1;\\n if (frontIndex == deque._end) Panic.panic(Panic.RESOURCE_ERROR);\\n deque._data[frontIndex] = value;\\n deque._begin = frontIndex;\\n }\\n }\\n\\n /**\\n * @dev Removes the item at the beginning of the queue and returns it.\\n *\\n * Reverts with {Panic-EMPTY_ARRAY_POP} if the queue is empty.\\n */\\n function popFront(Bytes32Deque storage deque) internal returns (bytes32 value) {\\n unchecked {\\n uint128 frontIndex = deque._begin;\\n if (frontIndex == deque._end) Panic.panic(Panic.EMPTY_ARRAY_POP);\\n value = deque._data[frontIndex];\\n delete deque._data[frontIndex];\\n deque._begin = frontIndex + 1;\\n }\\n }\\n\\n /**\\n * @dev Returns the item at the beginning of the queue.\\n *\\n * Reverts with {Panic-ARRAY_OUT_OF_BOUNDS} if the queue is empty.\\n */\\n function front(Bytes32Deque storage deque) internal view returns (bytes32 value) {\\n if (empty(deque)) Panic.panic(Panic.ARRAY_OUT_OF_BOUNDS);\\n return deque._data[deque._begin];\\n }\\n\\n /**\\n * @dev Returns the item at the end of the queue.\\n *\\n * Reverts with {Panic-ARRAY_OUT_OF_BOUNDS} if the queue is empty.\\n */\\n function back(Bytes32Deque storage deque) internal view returns (bytes32 value) {\\n if (empty(deque)) Panic.panic(Panic.ARRAY_OUT_OF_BOUNDS);\\n unchecked {\\n return deque._data[deque._end - 1];\\n }\\n }\\n\\n /**\\n * @dev Return the item at a position in the queue given by `index`, with the first item at 0 and last item at\\n * `length(deque) - 1`.\\n *\\n * Reverts with {Panic-ARRAY_OUT_OF_BOUNDS} if the index is out of bounds.\\n */\\n function at(Bytes32Deque storage deque, uint256 index) internal view returns (bytes32 value) {\\n if (index >= length(deque)) Panic.panic(Panic.ARRAY_OUT_OF_BOUNDS);\\n // By construction, length is a uint128, so the check above ensures that index can be safely downcast to uint128\\n unchecked {\\n return deque._data[deque._begin + uint128(index)];\\n }\\n }\\n\\n /**\\n * @dev Resets the queue back to being empty.\\n *\\n * NOTE: The current items are left behind in storage. This does not affect the functioning of the queue, but misses\\n * out on potential gas refunds.\\n */\\n function clear(Bytes32Deque storage deque) internal {\\n deque._begin = 0;\\n deque._end = 0;\\n }\\n\\n /**\\n * @dev Returns the number of items in the queue.\\n */\\n function length(Bytes32Deque storage deque) internal view returns (uint256) {\\n unchecked {\\n return uint256(deque._end - deque._begin);\\n }\\n }\\n\\n /**\\n * @dev Returns true if the queue is empty.\\n */\\n function empty(Bytes32Deque storage deque) internal view returns (bool) {\\n return deque._end == deque._begin;\\n }\\n}\\n\",\"keccak256\":\"0x1e1d74658d7f4eab3d4f8fb0c6c5953bc5f629d9425e978d557dabff7b58b217\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/types/Time.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/types/Time.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {Math} from \\\"../math/Math.sol\\\";\\nimport {SafeCast} from \\\"../math/SafeCast.sol\\\";\\n\\n/**\\n * @dev This library provides helpers for manipulating time-related objects.\\n *\\n * It uses the following types:\\n * - `uint48` for timepoints\\n * - `uint32` for durations\\n *\\n * While the library doesn't provide specific types for timepoints and duration, it does provide:\\n * - a `Delay` type to represent duration that can be programmed to change value automatically at a given point\\n * - additional helper functions\\n */\\nlibrary Time {\\n using Time for *;\\n\\n /**\\n * @dev Get the block timestamp as a Timepoint.\\n */\\n function timestamp() internal view returns (uint48) {\\n return SafeCast.toUint48(block.timestamp);\\n }\\n\\n /**\\n * @dev Get the block number as a Timepoint.\\n */\\n function blockNumber() internal view returns (uint48) {\\n return SafeCast.toUint48(block.number);\\n }\\n\\n // ==================================================== Delay =====================================================\\n /**\\n * @dev A `Delay` is a uint32 duration that can be programmed to change value automatically at a given point in the\\n * future. The \\\"effect\\\" timepoint describes when the transitions happens from the \\\"old\\\" value to the \\\"new\\\" value.\\n * This allows updating the delay applied to some operation while keeping some guarantees.\\n *\\n * In particular, the {update} function guarantees that if the delay is reduced, the old delay still applies for\\n * some time. For example if the delay is currently 7 days to do an upgrade, the admin should not be able to set\\n * the delay to 0 and upgrade immediately. If the admin wants to reduce the delay, the old delay (7 days) should\\n * still apply for some time.\\n *\\n *\\n * The `Delay` type is 112 bits long, and packs the following:\\n *\\n * ```\\n * | [uint48]: effect date (timepoint)\\n * | | [uint32]: value before (duration)\\n * \\u2193 \\u2193 \\u2193 [uint32]: value after (duration)\\n * 0xAAAAAAAAAAAABBBBBBBBCCCCCCCC\\n * ```\\n *\\n * NOTE: The {get} and {withUpdate} functions operate using timestamps. Block number based delays are not currently\\n * supported.\\n */\\n type Delay is uint112;\\n\\n /**\\n * @dev Wrap a duration into a Delay to add the one-step \\\"update in the future\\\" feature\\n */\\n function toDelay(uint32 duration) internal pure returns (Delay) {\\n return Delay.wrap(duration);\\n }\\n\\n /**\\n * @dev Get the value at a given timepoint plus the pending value and effect timepoint if there is a scheduled\\n * change after this timepoint. If the effect timepoint is 0, then the pending value should not be considered.\\n */\\n function _getFullAt(\\n Delay self,\\n uint48 timepoint\\n ) private pure returns (uint32 valueBefore, uint32 valueAfter, uint48 effect) {\\n (valueBefore, valueAfter, effect) = self.unpack();\\n return effect <= timepoint ? (valueAfter, 0, 0) : (valueBefore, valueAfter, effect);\\n }\\n\\n /**\\n * @dev Get the current value plus the pending value and effect timepoint if there is a scheduled change. If the\\n * effect timepoint is 0, then the pending value should not be considered.\\n */\\n function getFull(Delay self) internal view returns (uint32 valueBefore, uint32 valueAfter, uint48 effect) {\\n return _getFullAt(self, timestamp());\\n }\\n\\n /**\\n * @dev Get the current value.\\n */\\n function get(Delay self) internal view returns (uint32) {\\n (uint32 delay, , ) = self.getFull();\\n return delay;\\n }\\n\\n /**\\n * @dev Update a Delay object so that it takes a new duration after a timepoint that is automatically computed to\\n * enforce the old delay at the moment of the update. Returns the updated Delay object and the timestamp when the\\n * new delay becomes effective.\\n */\\n function withUpdate(\\n Delay self,\\n uint32 newValue,\\n uint32 minSetback\\n ) internal view returns (Delay updatedDelay, uint48 effect) {\\n uint32 value = self.get();\\n uint32 setback = uint32(Math.max(minSetback, value > newValue ? value - newValue : 0));\\n effect = timestamp() + setback;\\n return (pack(value, newValue, effect), effect);\\n }\\n\\n /**\\n * @dev Split a delay into its components: valueBefore, valueAfter and effect (transition timepoint).\\n */\\n function unpack(Delay self) internal pure returns (uint32 valueBefore, uint32 valueAfter, uint48 effect) {\\n uint112 raw = Delay.unwrap(self);\\n\\n valueAfter = uint32(raw);\\n valueBefore = uint32(raw >> 32);\\n effect = uint48(raw >> 64);\\n\\n return (valueBefore, valueAfter, effect);\\n }\\n\\n /**\\n * @dev pack the components into a Delay object.\\n */\\n function pack(uint32 valueBefore, uint32 valueAfter, uint48 effect) internal pure returns (Delay) {\\n return Delay.wrap((uint112(effect) << 64) | (uint112(valueBefore) << 32) | uint112(valueAfter));\\n }\\n}\\n\",\"keccak256\":\"0x36776530f012618bc7526ceb28e77b85e582cb12d9b9466a71d4bd6bf952e4cc\",\"license\":\"MIT\"},\"contracts/variants/crosschain/Gov.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity ^0.8.20;\\n\\nimport \\\"@openzeppelin/contracts/governance/Governor.sol\\\";\\nimport \\\"@openzeppelin/contracts/governance/extensions/GovernorSettings.sol\\\";\\nimport \\\"@openzeppelin/contracts/governance/extensions/GovernorCountingSimple.sol\\\";\\nimport \\\"@openzeppelin/contracts/governance/extensions/GovernorVotes.sol\\\";\\nimport \\\"@openzeppelin/contracts/governance/extensions/GovernorVotesQuorumFraction.sol\\\";\\nimport \\\"./ProofHandler.sol\\\";\\n\\n/**\\n * @title Cross-chain Governance Contract\\n * @author Web3 Hackers Collective\\n * @notice Implementation of a DAO with cross-chain synchronization capabilities\\n * @dev Extends OpenZeppelin's Governor contract with cross-chain parameter updates\\n * @custom:security-contact julien@strat.cc\\n */\\ncontract Gov is\\n Governor,\\n GovernorSettings,\\n GovernorCountingSimple,\\n GovernorVotes,\\n GovernorVotesQuorumFraction\\n{\\n /// @notice Chain ID where this contract was originally deployed\\n uint256 public immutable home;\\n\\n /// @notice IPFS CID of the DAO's manifesto\\n string public manifesto;\\n\\n /// @notice Storage for proof handling\\n ProofHandler.ProofStorage private _proofStorage;\\n\\n /// @notice Types of operations that can be synchronized across chains\\n enum OperationType {\\n SET_MANIFESTO,\\n UPDATE_VOTING_DELAY,\\n UPDATE_VOTING_PERIOD,\\n UPDATE_PROPOSAL_THRESHOLD,\\n UPDATE_QUORUM\\n }\\n\\n /// @notice Emitted when the manifesto is updated\\n /// @param oldManifesto Previous manifesto CID\\n /// @param newManifesto New manifesto CID\\n /// @param nonce Update sequence number\\n event ManifestoUpdated(string oldManifesto, string newManifesto, uint256 nonce);\\n\\n /// @notice Emitted when a governance parameter is updated\\n /// @param operationType Type of parameter updated\\n /// @param oldValue Previous value\\n /// @param newValue New value\\n /// @param nonce Update sequence number\\n event GovernanceParameterUpdated(\\n OperationType indexed operationType,\\n uint256 oldValue,\\n uint256 newValue,\\n uint256 nonce\\n );\\n\\n /// @notice Restricts functions to be called only on the home chain\\n modifier onlyHomeChain() {\\n require(block.chainid == home, \\\"Operation only allowed on home chain\\\");\\n _;\\n }\\n\\n /**\\n * @notice Initializes the governance contract\\n * @dev Sets up initial governance parameters and manifesto\\n * @param _home Chain ID where this contract is considered home\\n * @param _token The voting token contract address\\n * @param _manifestoCid Initial manifesto CID\\n * @param _name Name of the governance contract\\n * @param _votingDelay Time before voting begins\\n * @param _votingPeriod Duration of voting period\\n * @param _proposalThreshold Minimum votes needed to create a proposal\\n * @param _quorum Minimum participation percentage required\\n */\\n constructor(\\n uint256 _home,\\n IVotes _token,\\n string memory _manifestoCid,\\n string memory _name,\\n uint48 _votingDelay,\\n uint32 _votingPeriod,\\n uint256 _proposalThreshold,\\n uint256 _quorum\\n )\\n Governor(_name)\\n GovernorSettings(_votingDelay, _votingPeriod, _proposalThreshold)\\n GovernorVotes(_token)\\n GovernorVotesQuorumFraction(_quorum)\\n {\\n home = _home;\\n manifesto = _manifestoCid;\\n }\\n\\n /**\\n * @notice Updates the DAO's manifesto on the home chain\\n * @param newManifesto New manifesto CID\\n */\\n function setManifesto(string memory newManifesto) public onlyGovernance onlyHomeChain {\\n uint256 nonce = ProofHandler.incrementNonce(\\n _proofStorage,\\n uint8(OperationType.SET_MANIFESTO)\\n );\\n string memory oldManifesto = manifesto;\\n manifesto = newManifesto;\\n emit ManifestoUpdated(oldManifesto, newManifesto, nonce);\\n }\\n\\n /**\\n * @notice Updates the voting delay parameter on the home chain\\n * @param newVotingDelay New voting delay value\\n */\\n function setVotingDelay(\\n uint48 newVotingDelay\\n ) public virtual override onlyGovernance onlyHomeChain {\\n uint256 nonce = ProofHandler.incrementNonce(\\n _proofStorage,\\n uint8(OperationType.UPDATE_VOTING_DELAY)\\n );\\n uint256 oldValue = votingDelay();\\n _setVotingDelay(newVotingDelay);\\n emit GovernanceParameterUpdated(\\n OperationType.UPDATE_VOTING_DELAY,\\n oldValue,\\n newVotingDelay,\\n nonce\\n );\\n }\\n\\n /**\\n * @notice Updates the voting period parameter on the home chain\\n * @param newVotingPeriod New voting period value\\n */\\n function setVotingPeriod(\\n uint32 newVotingPeriod\\n ) public virtual override onlyGovernance onlyHomeChain {\\n uint256 nonce = ProofHandler.incrementNonce(\\n _proofStorage,\\n uint8(OperationType.UPDATE_VOTING_PERIOD)\\n );\\n uint256 oldValue = votingPeriod();\\n _setVotingPeriod(newVotingPeriod);\\n emit GovernanceParameterUpdated(\\n OperationType.UPDATE_VOTING_PERIOD,\\n oldValue,\\n newVotingPeriod,\\n nonce\\n );\\n }\\n\\n /**\\n * @notice Updates the proposal threshold parameter on the home chain\\n * @param newProposalThreshold New proposal threshold value\\n */\\n function setProposalThreshold(\\n uint256 newProposalThreshold\\n ) public virtual override onlyGovernance onlyHomeChain {\\n uint256 nonce = ProofHandler.incrementNonce(\\n _proofStorage,\\n uint8(OperationType.UPDATE_PROPOSAL_THRESHOLD)\\n );\\n uint256 oldValue = proposalThreshold();\\n _setProposalThreshold(newProposalThreshold);\\n emit GovernanceParameterUpdated(\\n OperationType.UPDATE_PROPOSAL_THRESHOLD,\\n oldValue,\\n newProposalThreshold,\\n nonce\\n );\\n }\\n\\n /**\\n * @notice Updates the quorum numerator on the home chain\\n * @param newQuorumNumerator New quorum numerator value\\n */\\n function updateQuorumNumerator(\\n uint256 newQuorumNumerator\\n ) public virtual override onlyGovernance onlyHomeChain {\\n uint256 nonce = ProofHandler.incrementNonce(\\n _proofStorage,\\n uint8(OperationType.UPDATE_QUORUM)\\n );\\n uint256 oldValue = quorumNumerator();\\n _updateQuorumNumerator(newQuorumNumerator);\\n emit GovernanceParameterUpdated(\\n OperationType.UPDATE_QUORUM,\\n oldValue,\\n newQuorumNumerator,\\n nonce\\n );\\n }\\n\\n /**\\n * @notice Generates proof for parameter updates\\n * @param operationType Type of parameter being updated\\n * @param value Encoded parameter value\\n * @return proof Encoded proof data\\n */\\n function generateParameterProof(\\n uint8 operationType,\\n bytes memory value\\n ) external view returns (bytes memory proof) {\\n require(block.chainid == home, \\\"Proofs only generated on home chain\\\");\\n uint256 nextNonce = ProofHandler.getNextNonce(_proofStorage, operationType);\\n return ProofHandler.generateProof(address(this), operationType, value, nextNonce);\\n }\\n\\n /**\\n * @notice Claims a parameter update on a foreign chain\\n * @param proof Proof generated by home chain\\n */\\n function claimParameterUpdate(bytes memory proof) external {\\n (uint8 operationType, bytes memory value, uint256 nonce) = ProofHandler.verifyAndClaimProof(\\n proof,\\n address(this),\\n _proofStorage\\n );\\n\\n if (operationType == uint8(OperationType.SET_MANIFESTO)) {\\n string memory newManifesto = abi.decode(value, (string));\\n string memory oldManifesto = manifesto;\\n manifesto = newManifesto;\\n emit ManifestoUpdated(oldManifesto, newManifesto, nonce);\\n } else if (operationType == uint8(OperationType.UPDATE_VOTING_DELAY)) {\\n uint48 newValue = uint48(bytes6(value));\\n uint256 oldValue = votingDelay();\\n _setVotingDelay(newValue);\\n emit GovernanceParameterUpdated(\\n OperationType.UPDATE_VOTING_DELAY,\\n oldValue,\\n newValue,\\n nonce\\n );\\n } else if (operationType == uint8(OperationType.UPDATE_VOTING_PERIOD)) {\\n uint32 newValue = uint32(bytes4(value));\\n uint256 oldValue = votingPeriod();\\n _setVotingPeriod(newValue);\\n emit GovernanceParameterUpdated(\\n OperationType.UPDATE_VOTING_PERIOD,\\n oldValue,\\n newValue,\\n nonce\\n );\\n } else if (operationType == uint8(OperationType.UPDATE_PROPOSAL_THRESHOLD)) {\\n uint256 newValue = abi.decode(value, (uint256));\\n uint256 oldValue = proposalThreshold();\\n _setProposalThreshold(newValue);\\n emit GovernanceParameterUpdated(\\n OperationType.UPDATE_PROPOSAL_THRESHOLD,\\n oldValue,\\n newValue,\\n nonce\\n );\\n } else if (operationType == uint8(OperationType.UPDATE_QUORUM)) {\\n uint256 newValue = abi.decode(value, (uint256));\\n uint256 oldValue = quorumNumerator();\\n _updateQuorumNumerator(newValue);\\n emit GovernanceParameterUpdated(OperationType.UPDATE_QUORUM, oldValue, newValue, nonce);\\n }\\n }\\n\\n // Required overrides\\n\\n function votingDelay() public view override(Governor, GovernorSettings) returns (uint256) {\\n return super.votingDelay();\\n }\\n\\n function votingPeriod() public view override(Governor, GovernorSettings) returns (uint256) {\\n return super.votingPeriod();\\n }\\n\\n function quorum(\\n uint256 blockNumber\\n ) public view override(Governor, GovernorVotesQuorumFraction) returns (uint256) {\\n return super.quorum(blockNumber);\\n }\\n\\n function proposalThreshold()\\n public\\n view\\n override(Governor, GovernorSettings)\\n returns (uint256)\\n {\\n return super.proposalThreshold();\\n }\\n}\\n\",\"keccak256\":\"0x9c3d392f452d79e03804790803c0f295a48390537eba2be45250a71219800bcc\",\"license\":\"GPL-3.0\"},\"contracts/variants/crosschain/ProofHandler.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity ^0.8.20;\\n\\n/**\\n * @title Proof Handler Library\\n * @author Web3 Hackers Collective\\n * @notice Library for standardized cross-chain proof generation and verification\\n * @dev Handles proof generation, verification, and tracking for cross-chain operations\\n * @custom:security-contact julien@strat.cc\\n */\\nlibrary ProofHandler {\\n /// @notice Tracks which proofs have been applied on each chain\\n struct ProofStorage {\\n mapping(bytes32 => bool) updateAppliedOnChain;\\n mapping(uint8 => uint256) currentNonce;\\n }\\n\\n /// @dev Emitted when a proof is claimed\\n event ProofClaimed(uint8 indexed operationType, bytes params, uint256 nonce);\\n\\n /**\\n * @notice Generates a proof for cross-chain operations\\n * @param contractAddress Address of contract generating the proof\\n * @param operationType Type of operation being performed\\n * @param params Operation parameters\\n * @param nonce Current nonce for this operation type\\n * @return proof Encoded proof data\\n */\\n function generateProof(\\n address contractAddress,\\n uint8 operationType,\\n bytes memory params,\\n uint256 nonce\\n ) public pure returns (bytes memory proof) {\\n bytes32 message = keccak256(\\n abi.encodePacked(contractAddress, operationType, params, nonce)\\n );\\n bytes32 digest = keccak256(abi.encodePacked(\\\"\\\\x19Ethereum Signed Message:\\\\n32\\\", message));\\n\\n return abi.encode(operationType, params, nonce, digest);\\n }\\n\\n /**\\n * @notice Verifies and claims a proof\\n * @param proof Proof to verify and claim\\n * @param contractAddress Address of contract claiming the proof\\n * @param storage_ Proof storage struct\\n * @return operationType The type of operation being performed\\n * @return params The operation parameters\\n * @return nonce The operation sequence number\\n */\\n function verifyAndClaimProof(\\n bytes memory proof,\\n address contractAddress,\\n ProofStorage storage storage_\\n ) public returns (uint8 operationType, bytes memory params, uint256 nonce) {\\n bytes32 digest;\\n (operationType, params, nonce, digest) = abi.decode(\\n proof,\\n (uint8, bytes, uint256, bytes32)\\n );\\n\\n bytes32 proofHash = keccak256(proof);\\n require(!storage_.updateAppliedOnChain[proofHash], \\\"Proof already claimed\\\");\\n require(nonce == storage_.currentNonce[operationType] + 1, \\\"Invalid nonce\\\");\\n\\n bytes32 message = keccak256(\\n abi.encodePacked(contractAddress, operationType, params, nonce)\\n );\\n bytes32 expectedDigest = keccak256(\\n abi.encodePacked(\\\"\\\\x19Ethereum Signed Message:\\\\n32\\\", message)\\n );\\n require(digest == expectedDigest, \\\"Invalid proof\\\");\\n\\n storage_.updateAppliedOnChain[proofHash] = true;\\n storage_.currentNonce[operationType] = nonce;\\n\\n emit ProofClaimed(operationType, params, nonce);\\n\\n return (operationType, params, nonce);\\n }\\n\\n /**\\n * @notice Gets the next nonce for an operation type\\n * @param storage_ Proof storage struct\\n * @param operationType Type of operation\\n * @return nonce Next nonce value\\n */\\n function getNextNonce(\\n ProofStorage storage storage_,\\n uint8 operationType\\n ) public view returns (uint256 nonce) {\\n return storage_.currentNonce[operationType] + 1;\\n }\\n\\n /**\\n * @notice Increments the nonce for an operation type\\n * @param storage_ Proof storage struct\\n * @param operationType Type of operation\\n * @return nonce New nonce value\\n */\\n function incrementNonce(\\n ProofStorage storage storage_,\\n uint8 operationType\\n ) public returns (uint256 nonce) {\\n storage_.currentNonce[operationType]++;\\n return storage_.currentNonce[operationType];\\n }\\n}\\n\",\"keccak256\":\"0x3719e47c508f29977d48842c5c1d27cce7cb289cbb592526f170f98135ff41a7\",\"license\":\"GPL-3.0\"}},\"version\":1}", + "bytecode": "0x6101a06040523480156200001257600080fd5b5060405162005684380380620056848339810160408190526200003591620007d4565b808785858589806200005b6040805180820190915260018152603160f81b602082015290565b6200006882600062000181565b610120526200007981600162000181565b61014052815160208084019190912060e052815190820120610100524660a0526200010760e05161010051604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f60208201529081019290925260608201524660808201523060a082015260009060c00160405160208183030381529060405280519060200120905090565b60805250503060c05260036200011e828262000930565b506200012c905083620001ba565b620001378262000220565b6200014281620002c7565b5050506001600160a01b0316610160526200015d8162000308565b50610180889052600b62000172878262000930565b50505050505050505062000a96565b6000602083511015620001a1576200019983620003a8565b9050620001b4565b81620001ae848262000930565b5060ff90505b92915050565b6008546040805165ffffffffffff928316815291831660208301527fc565b045403dc03c2eea82b81a0465edad9e2e7fc4d97e11421c209da93d7a93910160405180910390a16008805465ffffffffffff191665ffffffffffff92909216919091179055565b8063ffffffff16600003620002505760405163f1cfbf0560e01b8152600060048201526024015b60405180910390fd5b6008546040805163ffffffff66010000000000009093048316815291831660208301527f7e3f7f0708a84de9203036abaa450dccc85ad5ff52f78c170f3edb55cf5e8828910160405180910390a16008805463ffffffff90921666010000000000000263ffffffff60301b19909216919091179055565b60075460408051918252602082018390527fccb45da8d5717e6c4544694297c4ba5cf151d455c9bb0ed4fc7a38411bc05461910160405180910390a1600755565b606480821115620003375760405163243e544560e01b8152600481018390526024810182905260440162000247565b600062000343620003eb565b9050620003686200035362000407565b6200035e8562000489565b600a9190620004c3565b505060408051828152602081018590527f0553476bf02ef2726e8ce5ced78d63e26e602e4a2257b1f559418e24b4633997910160405180910390a1505050565b600080829050601f81511115620003d6578260405163305a27a960e01b8152600401620002479190620009fc565b8051620003e38262000a31565b179392505050565b6000620003f9600a620004e0565b6001600160d01b0316905090565b6000620004146101605190565b6001600160a01b03166391ddadf46040518163ffffffff1660e01b8152600401602060405180830381865afa92505050801562000470575060408051601f3d908101601f191682019092526200046d9181019062000a56565b60015b62000484576200047f62000530565b905090565b919050565b60006001600160d01b03821115620004bf576040516306dfcc6560e41b815260d060048201526024810183905260440162000247565b5090565b600080620004d38585856200053d565b915091505b935093915050565b8054600090801562000526576200050c83620004fe60018462000a74565b600091825260209091200190565b54660100000000000090046001600160d01b031662000529565b60005b9392505050565b60006200047f43620006a6565b825460009081908015620006475760006200055f87620004fe60018562000a74565b805490915065ffffffffffff80821691660100000000000090046001600160d01b0316908816821115620005a657604051632520601d60e01b815260040160405180910390fd5b8765ffffffffffff168265ffffffffffff1603620005e457825465ffffffffffff1666010000000000006001600160d01b0389160217835562000638565b6040805180820190915265ffffffffffff808a1682526001600160d01b03808a1660208085019182528d54600181018f5560008f815291909120945191519092166601000000000000029216919091179101555b9450859350620004d892505050565b50506040805180820190915265ffffffffffff80851682526001600160d01b0380851660208085019182528854600181018a5560008a8152918220955192519093166601000000000000029190931617920191909155905081620004d8565b600065ffffffffffff821115620004bf576040516306dfcc6560e41b8152603060048201526024810183905260440162000247565b634e487b7160e01b600052604160045260246000fd5b60005b838110156200070e578181015183820152602001620006f4565b50506000910152565b600082601f8301126200072957600080fd5b81516001600160401b0380821115620007465762000746620006db565b604051601f8301601f19908116603f01168101908282118183101715620007715762000771620006db565b816040528381528660208588010111156200078b57600080fd5b6200079e846020830160208901620006f1565b9695505050505050565b805165ffffffffffff811681146200048457600080fd5b805163ffffffff811681146200048457600080fd5b600080600080600080600080610100898b031215620007f257600080fd5b885160208a01519098506001600160a01b03811681146200081257600080fd5b60408a01519097506001600160401b03808211156200083057600080fd5b6200083e8c838d0162000717565b975060608b01519150808211156200085557600080fd5b50620008648b828c0162000717565b9550506200087560808a01620007a8565b93506200088560a08a01620007bf565b60c08a015160e0909a0151989b979a5095989497939692505050565b600181811c90821680620008b657607f821691505b602082108103620008d757634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200092b57600081815260208120601f850160051c81016020861015620009065750805b601f850160051c820191505b81811015620009275782815560010162000912565b5050505b505050565b81516001600160401b038111156200094c576200094c620006db565b62000964816200095d8454620008a1565b84620008dd565b602080601f8311600181146200099c5760008415620009835750858301515b600019600386901b1c1916600185901b17855562000927565b600085815260208120601f198616915b82811015620009cd57888601518255948401946001909101908401620009ac565b5085821015620009ec5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b602081526000825180602084015262000a1d816040850160208701620006f1565b601f01601f19169190910160400192915050565b80516020808301519190811015620008d75760001960209190910360031b1b16919050565b60006020828403121562000a6957600080fd5b6200052982620007a8565b81810381811115620001b457634e487b7160e01b600052601160045260246000fd5b60805160a05160c05160e0516101005161012051610140516101605161018051614b3762000b4d600039600081816107e201528181610b1501528181610d06015281816114e901528181611d1a01528181611f30015261206f015260008181610a90015281816111b60152818161180d01528181612b200152612d1101526000612aeb01526000612abe01526000612f3a01526000612f1201526000612e6d01526000612e9701526000612ec10152614b376000f3fe6080604052600436106102e85760003560e01c80637ecebe0011610190578063c01f9e37116100dc578063e2f3dce011610095578063ece40cc11161006f578063ece40cc114610a15578063f23a6e6114610a35578063f8ce560a14610a61578063fc0c546a14610a8157600080fd5b8063e2f3dce0146109c0578063e540d01d146109d5578063eb9019d4146109f557600080fd5b8063c01f9e37146108d3578063c28bc2fa146108f3578063c59057e414610906578063cc31491c14610926578063dd4e2ba514610946578063deaaa7cc1461098c57600080fd5b80639fa92f9d11610149578063ab58fb8e11610123578063ab58fb8e1461083a578063b47a321814610872578063b58131b014610892578063bc197c81146108a757600080fd5b80639fa92f9d146107d0578063a7713a7014610804578063a9a952941461081957600080fd5b80637ecebe00146106f257806384b0196e146107285780638ff262e31461075057806391ddadf41461077057806397c3d3341461079c5780639a802a6d146107b057600080fd5b80633e4f49e61161024f578063567813881161020857806360c4247f116101e257806360c4247f1461067257806379051887146106925780637b3c71d3146106b25780637d5e81e2146106d257600080fd5b806356781388146106125780635b8d0e0d146106325780635f398a141461065257600080fd5b80633e4f49e6146104e75780634385963214610514578063452115d61461055e5780634bf5d7e91461057e578063544ffc9c1461059357806354fd4d50146105e857600080fd5b8063160cbed7116102a1578063160cbed71461042b5780631985ba761461044b5780632656227d1461046b5780632d63f6931461047e5780632fe3e2611461049e5780633932abb1146104d257600080fd5b806301ffc9a7146102f657806302a251a31461032b57806306f3f9e61461035757806306fdde0314610377578063143489d014610399578063150b7a02146103e757600080fd5b366102f157005b005b600080fd5b34801561030257600080fd5b506103166103113660046137ad565b610ab4565b60405190151581526020015b60405180910390f35b34801561033757600080fd5b50600854600160301b900463ffffffff165b604051908152602001610322565b34801561036357600080fd5b506102ef6103723660046137d7565b610b0b565b34801561038357600080fd5b5061038c610c2a565b6040516103229190613840565b3480156103a557600080fd5b506103cf6103b43660046137d7565b6000908152600460205260409020546001600160a01b031690565b6040516001600160a01b039091168152602001610322565b3480156103f357600080fd5b5061041261040236600461392d565b630a85bd0160e11b949350505050565b6040516001600160e01b03199091168152602001610322565b34801561043757600080fd5b50610349610446366004613afe565b610cbc565b34801561045757600080fd5b506102ef610466366004613b8d565b610cfc565b610349610479366004613afe565b610ea2565b34801561048a57600080fd5b506103496104993660046137d7565b610fd5565b3480156104aa57600080fd5b506103497f3e83946653575f9a39005e1545185629e92736b7528ab20ca3816f315424a81181565b3480156104de57600080fd5b50610349610ff6565b3480156104f357600080fd5b506105076105023660046137d7565b611009565b6040516103229190613bf9565b34801561052057600080fd5b5061031661052f366004613c07565b60008281526009602090815260408083206001600160a01b038516845260030190915290205460ff1692915050565b34801561056a57600080fd5b50610349610579366004613afe565b611143565b34801561058a57600080fd5b5061038c6111b2565b34801561059f57600080fd5b506105cd6105ae3660046137d7565b6000908152600960205260409020805460018201546002909201549092565b60408051938452602084019290925290820152606001610322565b3480156105f457600080fd5b506040805180820190915260018152603160f81b602082015261038c565b34801561061e57600080fd5b5061034961062d366004613c42565b611274565b34801561063e57600080fd5b5061034961064d366004613cba565b61129d565b34801561065e57600080fd5b5061034961066d366004613d74565b6113fc565b34801561067e57600080fd5b5061034961068d3660046137d7565b611451565b34801561069e57600080fd5b506102ef6106ad366004613e0d565b6114df565b3480156106be57600080fd5b506103496106cd366004613e2a565b6115f0565b3480156106de57600080fd5b506103496106ed366004613e85565b611638565b3480156106fe57600080fd5b5061034961070d366004613f25565b6001600160a01b031660009081526002602052604090205490565b34801561073457600080fd5b5061073d6116f1565b6040516103229796959493929190613f7b565b34801561075c57600080fd5b5061034961076b366004613feb565b611737565b34801561077c57600080fd5b50610785611809565b60405165ffffffffffff9091168152602001610322565b3480156107a857600080fd5b506064610349565b3480156107bc57600080fd5b506103496107cb36600461403c565b611891565b3480156107dc57600080fd5b506103497f000000000000000000000000000000000000000000000000000000000000000081565b34801561081057600080fd5b506103496118a8565b34801561082557600080fd5b506103166108343660046137d7565b50600090565b34801561084657600080fd5b506103496108553660046137d7565b60009081526004602052604090206001015465ffffffffffff1690565b34801561087e57600080fd5b506102ef61088d366004613b8d565b6118c2565b34801561089e57600080fd5b50610349611c0e565b3480156108b357600080fd5b506104126108c2366004614092565b63bc197c8160e01b95945050505050565b3480156108df57600080fd5b506103496108ee3660046137d7565b611c19565b6102ef610901366004614121565b611c5c565b34801561091257600080fd5b50610349610921366004613afe565b611cdc565b34801561093257600080fd5b5061038c610941366004614162565b611d16565b34801561095257600080fd5b506040805180820190915260208082527f737570706f72743d627261766f2671756f72756d3d666f722c6162737461696e9082015261038c565b34801561099857600080fd5b506103497ff2aad550cf55f045cb27e9c559f9889fdfb6e6cdaa032301d6ea397784ae51d781565b3480156109cc57600080fd5b5061038c611e98565b3480156109e157600080fd5b506102ef6109f03660046141b1565b611f26565b348015610a0157600080fd5b50610349610a103660046141d7565b612044565b348015610a2157600080fd5b506102ef610a303660046137d7565b612065565b348015610a4157600080fd5b50610412610a50366004614201565b63f23a6e6160e01b95945050505050565b348015610a6d57600080fd5b50610349610a7c3660046137d7565b612148565b348015610a8d57600080fd5b507f00000000000000000000000000000000000000000000000000000000000000006103cf565b60006001600160e01b031982166332a2ad4360e11b1480610ae557506001600160e01b03198216630271189760e51b145b80610b0057506301ffc9a760e01b6001600160e01b03198316145b92915050565b905090565b610b13612153565b7f00000000000000000000000000000000000000000000000000000000000000004614610b5b5760405162461bcd60e51b8152600401610b5290614265565b60405180910390fd5b604051633b0d4dd760e01b8152600c600482810191909152602482015260009073__$b1c1335e68417b4234016f4aa58fdfac77$__90633b0d4dd790604401602060405180830381865af4158015610bb7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bdb91906142a9565b90506000610be76118a8565b9050610bf28361218b565b60045b6040805183815260208101869052908101849052600080516020614ae2833981519152906060015b60405180910390a2505050565b606060038054610c39906142c2565b80601f0160208091040260200160405190810160405280929190818152602001828054610c65906142c2565b8015610cb25780601f10610c8757610100808354040283529160200191610cb2565b820191906000526020600020905b815481529060010190602001808311610c9557829003601f168201915b5050505050905090565b600080610ccb86868686611cdc565b9050610ce081610cdb6004612219565b61223c565b506000604051634844252360e11b815260040160405180910390fd5b610d04612153565b7f00000000000000000000000000000000000000000000000000000000000000004614610d435760405162461bcd60e51b8152600401610b5290614265565b604051633b0d4dd760e01b8152600c60048201526000602482018190529073__$b1c1335e68417b4234016f4aa58fdfac77$__90633b0d4dd790604401602060405180830381865af4158015610d9d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dc191906142a9565b90506000600b8054610dd2906142c2565b80601f0160208091040260200160405190810160405280929190818152602001828054610dfe906142c2565b8015610e4b5780601f10610e2057610100808354040283529160200191610e4b565b820191906000526020600020905b815481529060010190602001808311610e2e57829003601f168201915b5050505050905082600b9081610e619190614347565b507f67c6aa39e9b4a701119ddc2f40a18145fff9b6f4fa224d5f29c28755f719ffb2818484604051610e9593929190614406565b60405180910390a1505050565b600080610eb186868686611cdc565b9050610ed181610ec16005612219565b610ecb6004612219565b1761223c565b506000818152600460205260409020805460ff60f01b1916600160f01b17905530610ef93090565b6001600160a01b031614610f8b5760005b8651811015610f8957306001600160a01b0316878281518110610f2f57610f2f61443c565b60200260200101516001600160a01b031603610f7957610f79858281518110610f5a57610f5a61443c565b602002602001015180519060200120600561227b90919063ffffffff16565b610f8281614468565b9050610f0a565b505b610f9881878787876122dd565b6040518181527f712ae1383f79ac853f8d882153778e0260ef8f03b504e2866e0593e04d2b291f906020015b60405180910390a195945050505050565b600090815260046020526040902054600160a01b900465ffffffffffff1690565b6000610b0660085465ffffffffffff1690565b6000818152600460205260408120805460ff600160f01b8204811691600160f81b900416811561103e57506007949350505050565b801561104f57506002949350505050565b600061105a86610fd5565b90508060000361108057604051636ad0607560e01b815260048101879052602401610b52565b600061108a611809565b65ffffffffffff1690508082106110a8575060009695505050505050565b60006110b388611c19565b90508181106110ca57506001979650505050505050565b6110d3886123bd565b15806110f357506000888152600960205260409020805460019091015411155b1561110657506003979650505050505050565b60008881526004602052604090206001015465ffffffffffff1660000361113557506004979650505050505050565b506005979650505050505050565b60008061115286868686611cdc565b905061116281610cdb6000612219565b506000818152600460205260409020546001600160a01b0316331461119c5760405163233d98e360e01b8152336004820152602401610b52565b6111a8868686866123f4565b9695505050505050565b60607f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316634bf5d7e96040518163ffffffff1660e01b8152600401600060405180830381865afa92505050801561123357506040513d6000823e601f3d908101601f1916820160405261123091908101906144b1565b60015b61126f575060408051808201909152601d81527f6d6f64653d626c6f636b6e756d6265722666726f6d3d64656661756c74000000602082015290565b919050565b600080339050611295848285604051806020016040528060008152506124a5565b949350505050565b6000806113808761137a7f3e83946653575f9a39005e1545185629e92736b7528ab20ca3816f315424a8118c8c8c6112f28e6001600160a01b0316600090815260026020526040902080546001810190915590565b8d8d6040516113029291906144f9565b60405180910390208c8051906020012060405160200161135f9796959493929190968752602087019590955260ff9390931660408601526001600160a01b03919091166060850152608084015260a083015260c082015260e00190565b604051602081830303815290604052805190602001206124d1565b856124fe565b9050806113ab576040516394ab6c0760e01b81526001600160a01b0388166004820152602401610b52565b6113ef89888a89898080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508b9250612572915050565b9998505050505050505050565b60008033905061144687828888888080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508a9250612572915050565b979650505050505050565b600a80546000918290611465600184614509565b815481106114755761147561443c565b6000918252602090912001805490915065ffffffffffff811690600160301b90046001600160d01b03168582116114b8576001600160d01b031695945050505050565b6114cc6114c487612654565b600a9061268b565b6001600160d01b03169695505050505050565b6114e7612153565b7f000000000000000000000000000000000000000000000000000000000000000046146115265760405162461bcd60e51b8152600401610b5290614265565b604051633b0d4dd760e01b8152600c60048201526001602482015260009073__$b1c1335e68417b4234016f4aa58fdfac77$__90633b0d4dd790604401602060405180830381865af4158015611580573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115a491906142a9565b905060006115b0610ff6565b90506115bb83612740565b60016040805183815265ffffffffffff86166020820152908101849052600080516020614ae283398151915290606001610c1d565b6000803390506111a886828787878080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506124a592505050565b60003361164581846127a6565b61166d5760405163d9b3955760e01b81526001600160a01b0382166004820152602401610b52565b6000611677611c0e565b905080156116e45760006116a683600161168f611809565b611699919061451c565b65ffffffffffff16612044565b9050818110156116e257604051636121770b60e11b81526001600160a01b03841660048201526024810182905260448101839052606401610b52565b505b6114468787878786612897565b600060608060008060006060611705612ab7565b61170d612ae4565b60408051600080825260208201909252600f60f81b9b939a50919850469750309650945092509050565b6000806117c38461137a7ff2aad550cf55f045cb27e9c559f9889fdfb6e6cdaa032301d6ea397784ae51d789898961178c8b6001600160a01b0316600090815260026020526040902080546001810190915590565b60408051602081019690965285019390935260ff90911660608401526001600160a01b0316608083015260a082015260c00161135f565b9050806117ee576040516394ab6c0760e01b81526001600160a01b0385166004820152602401610b52565b6111a8868587604051806020016040528060008152506124a5565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166391ddadf46040518163ffffffff1660e01b8152600401602060405180830381865afa925050508015611885575060408051601f3d908101601f1916820190925261188291810190614542565b60015b61126f57610b06612b11565b600061189e848484612b1c565b90505b9392505050565b60006118b4600a612bb2565b6001600160d01b0316905090565b600080600073__$b1c1335e68417b4234016f4aa58fdfac77$__63c0af65918530600c6040518463ffffffff1660e01b81526004016119039392919061455f565b600060405180830381865af4158015611920573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261194891908101906145ad565b9194509250905060ff8316611a505760008280602001905181019061196d91906144b1565b90506000600b805461197e906142c2565b80601f01602080910402602001604051908101604052809291908181526020018280546119aa906142c2565b80156119f75780601f106119cc576101008083540402835291602001916119f7565b820191906000526020600020905b8154815290600101906020018083116119da57829003601f168201915b5050505050905081600b9081611a0d9190614347565b507f67c6aa39e9b4a701119ddc2f40a18145fff9b6f4fa224d5f29c28755f719ffb2818385604051611a4193929190614406565b60405180910390a15050611c08565b60001960ff841601611ac1576000611a6783614606565b60d01c90506000611a76610ff6565b9050611a8182612740565b60016040805183815265ffffffffffff85166020820152908101859052600080516020614ae2833981519152906060015b60405180910390a25050611c08565b60011960ff841601611b34576000611ad88361463d565b60e01c90506000611af660085463ffffffff600160301b9091041690565b9050611b0182612beb565b60026040805183815263ffffffff85166020820152908101859052600080516020614ae283398151915290606001611ab2565b60021960ff841601611b9b57600082806020019051810190611b5691906142a9565b90506000611b62611c0e565b9050611b6d82612c89565b60036040805183815260208101859052908101859052600080516020614ae283398151915290606001611ab2565b60031960ff841601611c0857600082806020019051810190611bbd91906142a9565b90506000611bc96118a8565b9050611bd48261218b565b60046040805183815260208101859052908101859052600080516020614ae28339815191529060600160405180910390a250505b50505050565b6000610b0660075490565b600081815260046020526040812054611c4e90600160d01b810463ffffffff1690600160a01b900465ffffffffffff16614670565b65ffffffffffff1692915050565b611c64612153565b600080856001600160a01b0316858585604051611c829291906144f9565b60006040518083038185875af1925050503d8060008114611cbf576040519150601f19603f3d011682016040523d82523d6000602084013e611cc4565b606091505b5091509150611cd38282612cca565b50505050505050565b600084848484604051602001611cf5949392919061471a565b60408051601f19818403018152919052805160209091012095945050505050565b60607f00000000000000000000000000000000000000000000000000000000000000004614611d935760405162461bcd60e51b815260206004820152602360248201527f50726f6f6673206f6e6c792067656e657261746564206f6e20686f6d6520636860448201526230b4b760e91b6064820152608401610b52565b604051630564edeb60e31b8152600c600482015260ff8416602482015260009073__$b1c1335e68417b4234016f4aa58fdfac77$__90632b276f5890604401602060405180830381865af4158015611def573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e1391906142a9565b604051637352178160e01b815290915073__$b1c1335e68417b4234016f4aa58fdfac77$__90637352178190611e53903090889088908790600401614765565b600060405180830381865af4158015611e70573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261129591908101906147a3565b600b8054611ea5906142c2565b80601f0160208091040260200160405190810160405280929190818152602001828054611ed1906142c2565b8015611f1e5780601f10611ef357610100808354040283529160200191611f1e565b820191906000526020600020905b815481529060010190602001808311611f0157829003601f168201915b505050505081565b611f2e612153565b7f00000000000000000000000000000000000000000000000000000000000000004614611f6d5760405162461bcd60e51b8152600401610b5290614265565b604051633b0d4dd760e01b8152600c60048201526002602482015260009073__$b1c1335e68417b4234016f4aa58fdfac77$__90633b0d4dd790604401602060405180830381865af4158015611fc7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611feb91906142a9565b9050600061200660085463ffffffff600160301b9091041690565b905061201183612beb565b60026040805183815263ffffffff86166020820152908101849052600080516020614ae283398151915290606001610c1d565b60006118a1838361206060408051602081019091526000815290565b612b1c565b61206d612153565b7f000000000000000000000000000000000000000000000000000000000000000046146120ac5760405162461bcd60e51b8152600401610b5290614265565b604051633b0d4dd760e01b8152600c60048201526003602482015260009073__$b1c1335e68417b4234016f4aa58fdfac77$__90633b0d4dd790604401602060405180830381865af4158015612106573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061212a91906142a9565b90506000612136611c0e565b905061214183612c89565b6003610bf5565b6000610b0082612ce6565b303314612175576040516347096e4760e01b8152336004820152602401610b52565b565b806121826005612d90565b03612177575b50565b6064808211156121b85760405163243e544560e01b81526004810183905260248101829052604401610b52565b60006121c26118a8565b90506121e16121cf611809565b6121d885612dff565b600a9190612e33565b505060408051828152602081018590527f0553476bf02ef2726e8ce5ced78d63e26e602e4a2257b1f559418e24b46339979101610e95565b600081600781111561222d5761222d613bc1565b600160ff919091161b92915050565b60008061224884611009565b905060008361225683612219565b16036118a1578381846040516331b75e4d60e01b8152600401610b52939291906147d7565b81546001600160801b03600160801b8204811691811660018301909116036122a7576122a76041612e4e565b6001600160801b03808216600090815260018086016020526040909120939093558354919092018216600160801b029116179055565b60005b84518110156123b5576000808683815181106122fe576122fe61443c565b60200260200101516001600160a01b03168684815181106123215761232161443c565b602002602001015186858151811061233b5761233b61443c565b602002602001015160405161235091906147f9565b60006040518083038185875af1925050503d806000811461238d576040519150601f19603f3d011682016040523d82523d6000602084013e612392565b606091505b50915091506123a18282612cca565b505050806123ae90614468565b90506122e0565b505050505050565b6000818152600960205260408120600281015460018201546123df9190614815565b6123eb610a7c85610fd5565b11159392505050565b60008061240386868686611cdc565b9050612451816124136007612219565b61241d6006612219565b6124276002612219565b6001612434600782614828565b61243f906002614925565b6124499190614509565b18181861223c565b506000818152600460205260409081902080546001600160f81b0316600160f81b179055517f789cf55be980739dad1d0699b93b58e806b51c9d96619bfa8fe0a28abaa7b30c90610fc49083815260200190565b60006124c8858585856124c360408051602081019091526000815290565b612572565b95945050505050565b6000610b006124de612e60565b8360405161190160f01b8152600281019290925260228201526042902090565b6000836001600160a01b03163b6000036125605760008061251f8585612f8b565b509092509050600081600381111561253957612539613bc1565b1480156125575750856001600160a01b0316826001600160a01b0316145b925050506118a1565b61256b848484612fd8565b90506118a1565b600061258286610cdb6001612219565b5060006125988661259289610fd5565b85612b1c565b905060006125a988888885886130b3565b9050835160000361260057866001600160a01b03167fb8e138887d0aa13bab447e82de9d5c1777041ecd21ca36ba824ff1e6c07ddda4898884896040516125f39493929190614934565b60405180910390a2611446565b866001600160a01b03167fe2babfbac5889a709b63bb7f598b324e08bc5a4fb9ec647fb3cbc9ec07eb8712898884898960405161264195949392919061495c565b60405180910390a2979650505050505050565b600065ffffffffffff821115612687576040516306dfcc6560e41b81526030600482015260248101839052604401610b52565b5090565b8154600090818160058111156126ea5760006126a6846131b6565b6126b09085614509565b60008881526020902090915081015465ffffffffffff90811690871610156126da578091506126e8565b6126e5816001614815565b92505b505b60006126f88787858561330f565b905080156127335761271d8761270f600184614509565b600091825260209091200190565b54600160301b90046001600160d01b0316611446565b6000979650505050505050565b6008546040805165ffffffffffff928316815291831660208301527fc565b045403dc03c2eea82b81a0465edad9e2e7fc4d97e11421c209da93d7a93910160405180910390a16008805465ffffffffffff191665ffffffffffff92909216919091179055565b805160009060348110156127be576001915050610b00565b82810160131901516001600160a01b031981166b046e0e4dee0dee6cae47a60f60a31b146127f157600192505050610b00565b6000806127ff602885614509565b90505b83811015612876576000806128368884815181106128225761282261443c565b01602001516001600160f81b031916613371565b915091508161284e5760019650505050505050610b00565b8060ff166004856001600160a01b0316901b17935050508061286f90614468565b9050612802565b50856001600160a01b0316816001600160a01b031614935050505092915050565b60006128ac8686868680519060200120611cdc565b9050845186511415806128c157508351865114155b806128cb57508551155b1561290057855184518651604051630447b05d60e41b8152600481019390935260248301919091526044820152606401610b52565b600081815260046020526040902054600160a01b900465ffffffffffff161561294b578061292d82611009565b6040516331b75e4d60e01b8152610b529291906000906004016147d7565b6000612955610ff6565b61295d611809565b65ffffffffffff1661296f9190614815565b9050600061298a60085463ffffffff600160301b9091041690565b600084815260046020526040902080546001600160a01b0319166001600160a01b0387161781559091506129bd83612654565b815465ffffffffffff91909116600160a01b0265ffffffffffff60a01b199091161781556129ea82613403565b815463ffffffff91909116600160d01b0263ffffffff60d01b1990911617815588517f7d84a6263ae0d98d3329bd7b46bb4e8d6f98cd35a7adb45c274c8b7fd5ebd5e090859087908c908c906001600160401b03811115612a4d57612a4d61386a565b604051908082528060200260200182016040528015612a8057816020015b6060815260200190600190039081612a6b5790505b508c89612a8d8a82614815565b8e604051612aa3999897969594939291906149a2565b60405180910390a150505095945050505050565b6060610b067f00000000000000000000000000000000000000000000000000000000000000006000613434565b6060610b067f00000000000000000000000000000000000000000000000000000000000000006001613434565b6000610b0643612654565b60007f0000000000000000000000000000000000000000000000000000000000000000604051630748d63560e31b81526001600160a01b038681166004830152602482018690529190911690633a46b1a890604401602060405180830381865afa158015612b8e573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061189e91906142a9565b80546000908015612be257612bcc8361270f600184614509565b54600160301b90046001600160d01b03166118a1565b60009392505050565b8063ffffffff16600003612c155760405163f1cfbf0560e01b815260006004820152602401610b52565b6008546040805163ffffffff600160301b9093048316815291831660208301527f7e3f7f0708a84de9203036abaa450dccc85ad5ff52f78c170f3edb55cf5e8828910160405180910390a16008805463ffffffff909216600160301b0269ffffffff00000000000019909216919091179055565b60075460408051918252602082018390527fccb45da8d5717e6c4544694297c4ba5cf151d455c9bb0ed4fc7a38411bc05461910160405180910390a1600755565b606082612cdf57612cda826134df565b610b00565b5080610b00565b60006064612cf383611451565b604051632394e7a360e21b8152600481018590526001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001690638e539e8c90602401602060405180830381865afa158015612d58573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612d7c91906142a9565b612d869190614a79565b610b009190614aa6565b80546000906001600160801b0380821691600160801b9004168103612db957612db96031612e4e565b6001600160801b038181166000908152600185810160205260408220805492905585546fffffffffffffffffffffffffffffffff19169301909116919091179092555090565b60006001600160d01b03821115612687576040516306dfcc6560e41b815260d0600482015260248101839052604401610b52565b600080612e41858585613508565b915091505b935093915050565b634e487b71600052806020526024601cfd5b6000306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016148015612eb957507f000000000000000000000000000000000000000000000000000000000000000046145b15612ee357507f000000000000000000000000000000000000000000000000000000000000000090565b610b06604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f60208201527f0000000000000000000000000000000000000000000000000000000000000000918101919091527f000000000000000000000000000000000000000000000000000000000000000060608201524660808201523060a082015260009060c00160405160208183030381529060405280519060200120905090565b60008060008351604103612fc55760208401516040850151606086015160001a612fb78882858561365c565b955095509550505050612fd1565b50508151600091506002905b9250925092565b6000806000856001600160a01b03168585604051602401612ffa929190614ac8565b60408051601f198184030181529181526020820180516001600160e01b0316630b135d3f60e11b1790525161302f91906147f9565b600060405180830381855afa9150503d806000811461306a576040519150601f19603f3d011682016040523d82523d6000602084013e61306f565b606091505b509150915081801561308357506020815110155b80156111a857508051630b135d3f60e11b906130a890830160209081019084016142a9565b149695505050505050565b60008581526009602090815260408083206001600160a01b03881684526003810190925282205460ff1615613106576040516371c6af4960e01b81526001600160a01b0387166004820152602401610b52565b6001600160a01b03861660009081526003820160205260409020805460ff1916600117905560ff851661315257838160000160008282546131479190614815565b909155506131ab9050565b60001960ff86160161317257838160010160008282546131479190614815565b60011960ff86160161319257838160020160008282546131479190614815565b6040516303599be160e11b815260040160405180910390fd5b509195945050505050565b6000600182116131c4575090565b816001600160801b82106131dd5760809190911c9060401b5b6801000000000000000082106131f85760409190911c9060201b5b640100000000821061320f5760209190911c9060101b5b6201000082106132245760109190911c9060081b5b61010082106132385760089190911c9060041b5b6010821061324b5760049190911c9060021b5b600482106132575760011b5b600302600190811c9081858161326f5761326f614a90565b048201901c9050600181858161328757613287614a90565b048201901c9050600181858161329f5761329f614a90565b048201901c905060018185816132b7576132b7614a90565b048201901c905060018185816132cf576132cf614a90565b048201901c905060018185816132e7576132e7614a90565b048201901c905061330681858161330057613300614a90565b04821190565b90039392505050565b60005b81831015613369576000613326848461372b565b60008781526020902090915065ffffffffffff86169082015465ffffffffffff16111561335557809250613363565b613360816001614815565b93505b50613312565b509392505050565b60008060f883901c602f8111801561338c5750603a8160ff16105b156133a157600194602f199091019350915050565b8060ff1660401080156133b7575060478160ff16105b156133cc576001946036199091019350915050565b8060ff1660601080156133e2575060678160ff16105b156133f7576001946056199091019350915050565b50600093849350915050565b600063ffffffff821115612687576040516306dfcc6560e41b81526020600482015260248101839052604401610b52565b606060ff831461344e5761344783613746565b9050610b00565b81805461345a906142c2565b80601f0160208091040260200160405190810160405280929190818152602001828054613486906142c2565b80156134d35780601f106134a8576101008083540402835291602001916134d3565b820191906000526020600020905b8154815290600101906020018083116134b657829003601f168201915b50505050509050610b00565b8051156134ef5780518082602001fd5b60405163d6bda27560e01b815260040160405180910390fd5b8254600090819080156136015760006135268761270f600185614509565b805490915065ffffffffffff80821691600160301b90046001600160d01b031690881682111561356957604051632520601d60e01b815260040160405180910390fd5b8765ffffffffffff168265ffffffffffff16036135a257825465ffffffffffff16600160301b6001600160d01b038916021783556135f3565b6040805180820190915265ffffffffffff808a1682526001600160d01b03808a1660208085019182528d54600181018f5560008f81529190912094519151909216600160301b029216919091179101555b9450859350612e4692505050565b50506040805180820190915265ffffffffffff80851682526001600160d01b0380851660208085019182528854600181018a5560008a815291822095519251909316600160301b029190931617920191909155905081612e46565b600080807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08411156136975750600091506003905082613721565b604080516000808252602082018084528a905260ff891692820192909252606081018790526080810186905260019060a0016020604051602081039080840390855afa1580156136eb573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b03811661371757506000925060019150829050613721565b9250600091508190505b9450945094915050565b600061373a6002848418614aa6565b6118a190848416614815565b6060600061375383613785565b604080516020808252818301909252919250600091906020820181803683375050509182525060208101929092525090565b600060ff8216601f811115610b0057604051632cd44ac360e21b815260040160405180910390fd5b6000602082840312156137bf57600080fd5b81356001600160e01b0319811681146118a157600080fd5b6000602082840312156137e957600080fd5b5035919050565b60005b8381101561380b5781810151838201526020016137f3565b50506000910152565b6000815180845261382c8160208601602086016137f0565b601f01601f19169290920160200192915050565b6020815260006118a16020830184613814565b80356001600160a01b038116811461126f57600080fd5b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b03811182821017156138a8576138a861386a565b604052919050565b60006001600160401b038211156138c9576138c961386a565b50601f01601f191660200190565b600082601f8301126138e857600080fd5b81356138fb6138f6826138b0565b613880565b81815284602083860101111561391057600080fd5b816020850160208301376000918101602001919091529392505050565b6000806000806080858703121561394357600080fd5b61394c85613853565b935061395a60208601613853565b92506040850135915060608501356001600160401b0381111561397c57600080fd5b613988878288016138d7565b91505092959194509250565b60006001600160401b038211156139ad576139ad61386a565b5060051b60200190565b600082601f8301126139c857600080fd5b813560206139d86138f683613994565b82815260059290921b840181019181810190868411156139f757600080fd5b8286015b84811015613a1957613a0c81613853565b83529183019183016139fb565b509695505050505050565b600082601f830112613a3557600080fd5b81356020613a456138f683613994565b82815260059290921b84018101918181019086841115613a6457600080fd5b8286015b84811015613a195780358352918301918301613a68565b600082601f830112613a9057600080fd5b81356020613aa06138f683613994565b82815260059290921b84018101918181019086841115613abf57600080fd5b8286015b84811015613a195780356001600160401b03811115613ae25760008081fd5b613af08986838b01016138d7565b845250918301918301613ac3565b60008060008060808587031215613b1457600080fd5b84356001600160401b0380821115613b2b57600080fd5b613b37888389016139b7565b95506020870135915080821115613b4d57600080fd5b613b5988838901613a24565b94506040870135915080821115613b6f57600080fd5b50613b7c87828801613a7f565b949793965093946060013593505050565b600060208284031215613b9f57600080fd5b81356001600160401b03811115613bb557600080fd5b611295848285016138d7565b634e487b7160e01b600052602160045260246000fd5b60088110613bf557634e487b7160e01b600052602160045260246000fd5b9052565b60208101610b008284613bd7565b60008060408385031215613c1a57600080fd5b82359150613c2a60208401613853565b90509250929050565b60ff8116811461218857600080fd5b60008060408385031215613c5557600080fd5b823591506020830135613c6781613c33565b809150509250929050565b60008083601f840112613c8457600080fd5b5081356001600160401b03811115613c9b57600080fd5b602083019150836020828501011115613cb357600080fd5b9250929050565b600080600080600080600060c0888a031215613cd557600080fd5b873596506020880135613ce781613c33565b9550613cf560408901613853565b945060608801356001600160401b0380821115613d1157600080fd5b613d1d8b838c01613c72565b909650945060808a0135915080821115613d3657600080fd5b613d428b838c016138d7565b935060a08a0135915080821115613d5857600080fd5b50613d658a828b016138d7565b91505092959891949750929550565b600080600080600060808688031215613d8c57600080fd5b853594506020860135613d9e81613c33565b935060408601356001600160401b0380821115613dba57600080fd5b613dc689838a01613c72565b90955093506060880135915080821115613ddf57600080fd5b50613dec888289016138d7565b9150509295509295909350565b65ffffffffffff8116811461218857600080fd5b600060208284031215613e1f57600080fd5b81356118a181613df9565b60008060008060608587031215613e4057600080fd5b843593506020850135613e5281613c33565b925060408501356001600160401b03811115613e6d57600080fd5b613e7987828801613c72565b95989497509550505050565b60008060008060808587031215613e9b57600080fd5b84356001600160401b0380821115613eb257600080fd5b613ebe888389016139b7565b95506020870135915080821115613ed457600080fd5b613ee088838901613a24565b94506040870135915080821115613ef657600080fd5b613f0288838901613a7f565b93506060870135915080821115613f1857600080fd5b50613988878288016138d7565b600060208284031215613f3757600080fd5b6118a182613853565b600081518084526020808501945080840160005b83811015613f7057815187529582019590820190600101613f54565b509495945050505050565b60ff60f81b8816815260e060208201526000613f9a60e0830189613814565b8281036040840152613fac8189613814565b606084018890526001600160a01b038716608085015260a0840186905283810360c08501529050613fdd8185613f40565b9a9950505050505050505050565b6000806000806080858703121561400157600080fd5b84359350602085013561401381613c33565b925061402160408601613853565b915060608501356001600160401b0381111561397c57600080fd5b60008060006060848603121561405157600080fd5b61405a84613853565b92506020840135915060408401356001600160401b0381111561407c57600080fd5b614088868287016138d7565b9150509250925092565b600080600080600060a086880312156140aa57600080fd5b6140b386613853565b94506140c160208701613853565b935060408601356001600160401b03808211156140dd57600080fd5b6140e989838a01613a24565b945060608801359150808211156140ff57600080fd5b61410b89838a01613a24565b93506080880135915080821115613ddf57600080fd5b6000806000806060858703121561413757600080fd5b61414085613853565b93506020850135925060408501356001600160401b03811115613e6d57600080fd5b6000806040838503121561417557600080fd5b823561418081613c33565b915060208301356001600160401b0381111561419b57600080fd5b6141a7858286016138d7565b9150509250929050565b6000602082840312156141c357600080fd5b813563ffffffff811681146118a157600080fd5b600080604083850312156141ea57600080fd5b6141f383613853565b946020939093013593505050565b600080600080600060a0868803121561421957600080fd5b61422286613853565b945061423060208701613853565b9350604086013592506060860135915060808601356001600160401b0381111561425957600080fd5b613dec888289016138d7565b60208082526024908201527f4f7065726174696f6e206f6e6c7920616c6c6f776564206f6e20686f6d6520636040820152633430b4b760e11b606082015260800190565b6000602082840312156142bb57600080fd5b5051919050565b600181811c908216806142d657607f821691505b6020821081036142f657634e487b7160e01b600052602260045260246000fd5b50919050565b601f82111561434257600081815260208120601f850160051c810160208610156143235750805b601f850160051c820191505b818110156123b55782815560010161432f565b505050565b81516001600160401b038111156143605761436061386a565b6143748161436e84546142c2565b846142fc565b602080601f8311600181146143a957600084156143915750858301515b600019600386901b1c1916600185901b1785556123b5565b600085815260208120601f198616915b828110156143d8578886015182559484019460019091019084016143b9565b50858210156143f65787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6060815260006144196060830186613814565b828103602084015261442b8186613814565b915050826040830152949350505050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60006001820161447a5761447a614452565b5060010190565b600061448f6138f6846138b0565b90508281528383830111156144a357600080fd5b6118a18360208301846137f0565b6000602082840312156144c357600080fd5b81516001600160401b038111156144d957600080fd5b8201601f810184136144ea57600080fd5b61129584825160208401614481565b8183823760009101908152919050565b81810381811115610b0057610b00614452565b65ffffffffffff82811682821603908082111561453b5761453b614452565b5092915050565b60006020828403121561455457600080fd5b81516118a181613df9565b6060815260006145726060830186613814565b6001600160a01b039490941660208301525060400152919050565b600082601f83011261459e57600080fd5b6118a183835160208501614481565b6000806000606084860312156145c257600080fd5b83516145cd81613c33565b60208501519093506001600160401b038111156145e957600080fd5b6145f58682870161458d565b925050604084015190509250925092565b805160208201516001600160d01b031980821692919060068310156146355780818460060360031b1b83161693505b505050919050565b805160208201516001600160e01b031980821692919060048310156146355760049290920360031b82901b161692915050565b65ffffffffffff81811683821601908082111561453b5761453b614452565b600081518084526020808501945080840160005b83811015613f705781516001600160a01b0316875295820195908201906001016146a3565b6000815180845260208085019450848260051b860182860160005b8581101561470d5783830389526146fb838351613814565b988501989250908401906001016146e3565b5090979650505050505050565b60808152600061472d608083018761468f565b828103602084015261473f8187613f40565b9050828103604084015261475381866146c8565b91505082606083015295945050505050565b6001600160a01b038516815260ff8416602082015260806040820181905260009061479290830185613814565b905082606083015295945050505050565b6000602082840312156147b557600080fd5b81516001600160401b038111156147cb57600080fd5b6112958482850161458d565b838152606081016147eb6020830185613bd7565b826040830152949350505050565b6000825161480b8184602087016137f0565b9190910192915050565b80820180821115610b0057610b00614452565b60ff8181168382160190811115610b0057610b00614452565b600181815b8085111561487c57816000190482111561486257614862614452565b8085161561486f57918102915b93841c9390800290614846565b509250929050565b60008261489357506001610b00565b816148a057506000610b00565b81600181146148b657600281146148c0576148dc565b6001915050610b00565b60ff8411156148d1576148d1614452565b50506001821b610b00565b5060208310610133831016604e8410600b84101617156148ff575081810a610b00565b6149098383614841565b806000190482111561491d5761491d614452565b029392505050565b60006118a160ff841683614884565b84815260ff841660208201528260408201526080606082015260006111a86080830184613814565b85815260ff8516602082015283604082015260a06060820152600061498460a0830185613814565b82810360808401526149968185613814565b98975050505050505050565b60006101208b8352602060018060a01b038c16818501528160408501526149cb8285018c61468f565b915083820360608501526149df828b613f40565b915083820360808501528189518084528284019150828160051b850101838c0160005b83811015614a3057601f19878403018552614a1e838351613814565b94860194925090850190600101614a02565b505086810360a0880152614a44818c6146c8565b9450505050508560c08401528460e0840152828103610100840152614a698185613814565b9c9b505050505050505050505050565b8082028115828204841417610b0057610b00614452565b634e487b7160e01b600052601260045260246000fd5b600082614ac357634e487b7160e01b600052601260045260246000fd5b500490565b82815260406020820152600061189e604083018461381456fe80c51ad8a7db1a7a86cc355b77bd5cd7ea08f6071ea91d85a8f792734700a0eca26469706673582212205c5a83ff074db246f409ffc8bc5a5c810ce8a95783beb88564ba8a597a7cef8c64736f6c63430008140033", + "deployedBytecode": "0x6080604052600436106102e85760003560e01c80637ecebe0011610190578063c01f9e37116100dc578063e2f3dce011610095578063ece40cc11161006f578063ece40cc114610a15578063f23a6e6114610a35578063f8ce560a14610a61578063fc0c546a14610a8157600080fd5b8063e2f3dce0146109c0578063e540d01d146109d5578063eb9019d4146109f557600080fd5b8063c01f9e37146108d3578063c28bc2fa146108f3578063c59057e414610906578063cc31491c14610926578063dd4e2ba514610946578063deaaa7cc1461098c57600080fd5b80639fa92f9d11610149578063ab58fb8e11610123578063ab58fb8e1461083a578063b47a321814610872578063b58131b014610892578063bc197c81146108a757600080fd5b80639fa92f9d146107d0578063a7713a7014610804578063a9a952941461081957600080fd5b80637ecebe00146106f257806384b0196e146107285780638ff262e31461075057806391ddadf41461077057806397c3d3341461079c5780639a802a6d146107b057600080fd5b80633e4f49e61161024f578063567813881161020857806360c4247f116101e257806360c4247f1461067257806379051887146106925780637b3c71d3146106b25780637d5e81e2146106d257600080fd5b806356781388146106125780635b8d0e0d146106325780635f398a141461065257600080fd5b80633e4f49e6146104e75780634385963214610514578063452115d61461055e5780634bf5d7e91461057e578063544ffc9c1461059357806354fd4d50146105e857600080fd5b8063160cbed7116102a1578063160cbed71461042b5780631985ba761461044b5780632656227d1461046b5780632d63f6931461047e5780632fe3e2611461049e5780633932abb1146104d257600080fd5b806301ffc9a7146102f657806302a251a31461032b57806306f3f9e61461035757806306fdde0314610377578063143489d014610399578063150b7a02146103e757600080fd5b366102f157005b005b600080fd5b34801561030257600080fd5b506103166103113660046137ad565b610ab4565b60405190151581526020015b60405180910390f35b34801561033757600080fd5b50600854600160301b900463ffffffff165b604051908152602001610322565b34801561036357600080fd5b506102ef6103723660046137d7565b610b0b565b34801561038357600080fd5b5061038c610c2a565b6040516103229190613840565b3480156103a557600080fd5b506103cf6103b43660046137d7565b6000908152600460205260409020546001600160a01b031690565b6040516001600160a01b039091168152602001610322565b3480156103f357600080fd5b5061041261040236600461392d565b630a85bd0160e11b949350505050565b6040516001600160e01b03199091168152602001610322565b34801561043757600080fd5b50610349610446366004613afe565b610cbc565b34801561045757600080fd5b506102ef610466366004613b8d565b610cfc565b610349610479366004613afe565b610ea2565b34801561048a57600080fd5b506103496104993660046137d7565b610fd5565b3480156104aa57600080fd5b506103497f3e83946653575f9a39005e1545185629e92736b7528ab20ca3816f315424a81181565b3480156104de57600080fd5b50610349610ff6565b3480156104f357600080fd5b506105076105023660046137d7565b611009565b6040516103229190613bf9565b34801561052057600080fd5b5061031661052f366004613c07565b60008281526009602090815260408083206001600160a01b038516845260030190915290205460ff1692915050565b34801561056a57600080fd5b50610349610579366004613afe565b611143565b34801561058a57600080fd5b5061038c6111b2565b34801561059f57600080fd5b506105cd6105ae3660046137d7565b6000908152600960205260409020805460018201546002909201549092565b60408051938452602084019290925290820152606001610322565b3480156105f457600080fd5b506040805180820190915260018152603160f81b602082015261038c565b34801561061e57600080fd5b5061034961062d366004613c42565b611274565b34801561063e57600080fd5b5061034961064d366004613cba565b61129d565b34801561065e57600080fd5b5061034961066d366004613d74565b6113fc565b34801561067e57600080fd5b5061034961068d3660046137d7565b611451565b34801561069e57600080fd5b506102ef6106ad366004613e0d565b6114df565b3480156106be57600080fd5b506103496106cd366004613e2a565b6115f0565b3480156106de57600080fd5b506103496106ed366004613e85565b611638565b3480156106fe57600080fd5b5061034961070d366004613f25565b6001600160a01b031660009081526002602052604090205490565b34801561073457600080fd5b5061073d6116f1565b6040516103229796959493929190613f7b565b34801561075c57600080fd5b5061034961076b366004613feb565b611737565b34801561077c57600080fd5b50610785611809565b60405165ffffffffffff9091168152602001610322565b3480156107a857600080fd5b506064610349565b3480156107bc57600080fd5b506103496107cb36600461403c565b611891565b3480156107dc57600080fd5b506103497f000000000000000000000000000000000000000000000000000000000000000081565b34801561081057600080fd5b506103496118a8565b34801561082557600080fd5b506103166108343660046137d7565b50600090565b34801561084657600080fd5b506103496108553660046137d7565b60009081526004602052604090206001015465ffffffffffff1690565b34801561087e57600080fd5b506102ef61088d366004613b8d565b6118c2565b34801561089e57600080fd5b50610349611c0e565b3480156108b357600080fd5b506104126108c2366004614092565b63bc197c8160e01b95945050505050565b3480156108df57600080fd5b506103496108ee3660046137d7565b611c19565b6102ef610901366004614121565b611c5c565b34801561091257600080fd5b50610349610921366004613afe565b611cdc565b34801561093257600080fd5b5061038c610941366004614162565b611d16565b34801561095257600080fd5b506040805180820190915260208082527f737570706f72743d627261766f2671756f72756d3d666f722c6162737461696e9082015261038c565b34801561099857600080fd5b506103497ff2aad550cf55f045cb27e9c559f9889fdfb6e6cdaa032301d6ea397784ae51d781565b3480156109cc57600080fd5b5061038c611e98565b3480156109e157600080fd5b506102ef6109f03660046141b1565b611f26565b348015610a0157600080fd5b50610349610a103660046141d7565b612044565b348015610a2157600080fd5b506102ef610a303660046137d7565b612065565b348015610a4157600080fd5b50610412610a50366004614201565b63f23a6e6160e01b95945050505050565b348015610a6d57600080fd5b50610349610a7c3660046137d7565b612148565b348015610a8d57600080fd5b507f00000000000000000000000000000000000000000000000000000000000000006103cf565b60006001600160e01b031982166332a2ad4360e11b1480610ae557506001600160e01b03198216630271189760e51b145b80610b0057506301ffc9a760e01b6001600160e01b03198316145b92915050565b905090565b610b13612153565b7f00000000000000000000000000000000000000000000000000000000000000004614610b5b5760405162461bcd60e51b8152600401610b5290614265565b60405180910390fd5b604051633b0d4dd760e01b8152600c600482810191909152602482015260009073__$b1c1335e68417b4234016f4aa58fdfac77$__90633b0d4dd790604401602060405180830381865af4158015610bb7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bdb91906142a9565b90506000610be76118a8565b9050610bf28361218b565b60045b6040805183815260208101869052908101849052600080516020614ae2833981519152906060015b60405180910390a2505050565b606060038054610c39906142c2565b80601f0160208091040260200160405190810160405280929190818152602001828054610c65906142c2565b8015610cb25780601f10610c8757610100808354040283529160200191610cb2565b820191906000526020600020905b815481529060010190602001808311610c9557829003601f168201915b5050505050905090565b600080610ccb86868686611cdc565b9050610ce081610cdb6004612219565b61223c565b506000604051634844252360e11b815260040160405180910390fd5b610d04612153565b7f00000000000000000000000000000000000000000000000000000000000000004614610d435760405162461bcd60e51b8152600401610b5290614265565b604051633b0d4dd760e01b8152600c60048201526000602482018190529073__$b1c1335e68417b4234016f4aa58fdfac77$__90633b0d4dd790604401602060405180830381865af4158015610d9d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dc191906142a9565b90506000600b8054610dd2906142c2565b80601f0160208091040260200160405190810160405280929190818152602001828054610dfe906142c2565b8015610e4b5780601f10610e2057610100808354040283529160200191610e4b565b820191906000526020600020905b815481529060010190602001808311610e2e57829003601f168201915b5050505050905082600b9081610e619190614347565b507f67c6aa39e9b4a701119ddc2f40a18145fff9b6f4fa224d5f29c28755f719ffb2818484604051610e9593929190614406565b60405180910390a1505050565b600080610eb186868686611cdc565b9050610ed181610ec16005612219565b610ecb6004612219565b1761223c565b506000818152600460205260409020805460ff60f01b1916600160f01b17905530610ef93090565b6001600160a01b031614610f8b5760005b8651811015610f8957306001600160a01b0316878281518110610f2f57610f2f61443c565b60200260200101516001600160a01b031603610f7957610f79858281518110610f5a57610f5a61443c565b602002602001015180519060200120600561227b90919063ffffffff16565b610f8281614468565b9050610f0a565b505b610f9881878787876122dd565b6040518181527f712ae1383f79ac853f8d882153778e0260ef8f03b504e2866e0593e04d2b291f906020015b60405180910390a195945050505050565b600090815260046020526040902054600160a01b900465ffffffffffff1690565b6000610b0660085465ffffffffffff1690565b6000818152600460205260408120805460ff600160f01b8204811691600160f81b900416811561103e57506007949350505050565b801561104f57506002949350505050565b600061105a86610fd5565b90508060000361108057604051636ad0607560e01b815260048101879052602401610b52565b600061108a611809565b65ffffffffffff1690508082106110a8575060009695505050505050565b60006110b388611c19565b90508181106110ca57506001979650505050505050565b6110d3886123bd565b15806110f357506000888152600960205260409020805460019091015411155b1561110657506003979650505050505050565b60008881526004602052604090206001015465ffffffffffff1660000361113557506004979650505050505050565b506005979650505050505050565b60008061115286868686611cdc565b905061116281610cdb6000612219565b506000818152600460205260409020546001600160a01b0316331461119c5760405163233d98e360e01b8152336004820152602401610b52565b6111a8868686866123f4565b9695505050505050565b60607f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316634bf5d7e96040518163ffffffff1660e01b8152600401600060405180830381865afa92505050801561123357506040513d6000823e601f3d908101601f1916820160405261123091908101906144b1565b60015b61126f575060408051808201909152601d81527f6d6f64653d626c6f636b6e756d6265722666726f6d3d64656661756c74000000602082015290565b919050565b600080339050611295848285604051806020016040528060008152506124a5565b949350505050565b6000806113808761137a7f3e83946653575f9a39005e1545185629e92736b7528ab20ca3816f315424a8118c8c8c6112f28e6001600160a01b0316600090815260026020526040902080546001810190915590565b8d8d6040516113029291906144f9565b60405180910390208c8051906020012060405160200161135f9796959493929190968752602087019590955260ff9390931660408601526001600160a01b03919091166060850152608084015260a083015260c082015260e00190565b604051602081830303815290604052805190602001206124d1565b856124fe565b9050806113ab576040516394ab6c0760e01b81526001600160a01b0388166004820152602401610b52565b6113ef89888a89898080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508b9250612572915050565b9998505050505050505050565b60008033905061144687828888888080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508a9250612572915050565b979650505050505050565b600a80546000918290611465600184614509565b815481106114755761147561443c565b6000918252602090912001805490915065ffffffffffff811690600160301b90046001600160d01b03168582116114b8576001600160d01b031695945050505050565b6114cc6114c487612654565b600a9061268b565b6001600160d01b03169695505050505050565b6114e7612153565b7f000000000000000000000000000000000000000000000000000000000000000046146115265760405162461bcd60e51b8152600401610b5290614265565b604051633b0d4dd760e01b8152600c60048201526001602482015260009073__$b1c1335e68417b4234016f4aa58fdfac77$__90633b0d4dd790604401602060405180830381865af4158015611580573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115a491906142a9565b905060006115b0610ff6565b90506115bb83612740565b60016040805183815265ffffffffffff86166020820152908101849052600080516020614ae283398151915290606001610c1d565b6000803390506111a886828787878080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506124a592505050565b60003361164581846127a6565b61166d5760405163d9b3955760e01b81526001600160a01b0382166004820152602401610b52565b6000611677611c0e565b905080156116e45760006116a683600161168f611809565b611699919061451c565b65ffffffffffff16612044565b9050818110156116e257604051636121770b60e11b81526001600160a01b03841660048201526024810182905260448101839052606401610b52565b505b6114468787878786612897565b600060608060008060006060611705612ab7565b61170d612ae4565b60408051600080825260208201909252600f60f81b9b939a50919850469750309650945092509050565b6000806117c38461137a7ff2aad550cf55f045cb27e9c559f9889fdfb6e6cdaa032301d6ea397784ae51d789898961178c8b6001600160a01b0316600090815260026020526040902080546001810190915590565b60408051602081019690965285019390935260ff90911660608401526001600160a01b0316608083015260a082015260c00161135f565b9050806117ee576040516394ab6c0760e01b81526001600160a01b0385166004820152602401610b52565b6111a8868587604051806020016040528060008152506124a5565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166391ddadf46040518163ffffffff1660e01b8152600401602060405180830381865afa925050508015611885575060408051601f3d908101601f1916820190925261188291810190614542565b60015b61126f57610b06612b11565b600061189e848484612b1c565b90505b9392505050565b60006118b4600a612bb2565b6001600160d01b0316905090565b600080600073__$b1c1335e68417b4234016f4aa58fdfac77$__63c0af65918530600c6040518463ffffffff1660e01b81526004016119039392919061455f565b600060405180830381865af4158015611920573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261194891908101906145ad565b9194509250905060ff8316611a505760008280602001905181019061196d91906144b1565b90506000600b805461197e906142c2565b80601f01602080910402602001604051908101604052809291908181526020018280546119aa906142c2565b80156119f75780601f106119cc576101008083540402835291602001916119f7565b820191906000526020600020905b8154815290600101906020018083116119da57829003601f168201915b5050505050905081600b9081611a0d9190614347565b507f67c6aa39e9b4a701119ddc2f40a18145fff9b6f4fa224d5f29c28755f719ffb2818385604051611a4193929190614406565b60405180910390a15050611c08565b60001960ff841601611ac1576000611a6783614606565b60d01c90506000611a76610ff6565b9050611a8182612740565b60016040805183815265ffffffffffff85166020820152908101859052600080516020614ae2833981519152906060015b60405180910390a25050611c08565b60011960ff841601611b34576000611ad88361463d565b60e01c90506000611af660085463ffffffff600160301b9091041690565b9050611b0182612beb565b60026040805183815263ffffffff85166020820152908101859052600080516020614ae283398151915290606001611ab2565b60021960ff841601611b9b57600082806020019051810190611b5691906142a9565b90506000611b62611c0e565b9050611b6d82612c89565b60036040805183815260208101859052908101859052600080516020614ae283398151915290606001611ab2565b60031960ff841601611c0857600082806020019051810190611bbd91906142a9565b90506000611bc96118a8565b9050611bd48261218b565b60046040805183815260208101859052908101859052600080516020614ae28339815191529060600160405180910390a250505b50505050565b6000610b0660075490565b600081815260046020526040812054611c4e90600160d01b810463ffffffff1690600160a01b900465ffffffffffff16614670565b65ffffffffffff1692915050565b611c64612153565b600080856001600160a01b0316858585604051611c829291906144f9565b60006040518083038185875af1925050503d8060008114611cbf576040519150601f19603f3d011682016040523d82523d6000602084013e611cc4565b606091505b5091509150611cd38282612cca565b50505050505050565b600084848484604051602001611cf5949392919061471a565b60408051601f19818403018152919052805160209091012095945050505050565b60607f00000000000000000000000000000000000000000000000000000000000000004614611d935760405162461bcd60e51b815260206004820152602360248201527f50726f6f6673206f6e6c792067656e657261746564206f6e20686f6d6520636860448201526230b4b760e91b6064820152608401610b52565b604051630564edeb60e31b8152600c600482015260ff8416602482015260009073__$b1c1335e68417b4234016f4aa58fdfac77$__90632b276f5890604401602060405180830381865af4158015611def573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e1391906142a9565b604051637352178160e01b815290915073__$b1c1335e68417b4234016f4aa58fdfac77$__90637352178190611e53903090889088908790600401614765565b600060405180830381865af4158015611e70573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261129591908101906147a3565b600b8054611ea5906142c2565b80601f0160208091040260200160405190810160405280929190818152602001828054611ed1906142c2565b8015611f1e5780601f10611ef357610100808354040283529160200191611f1e565b820191906000526020600020905b815481529060010190602001808311611f0157829003601f168201915b505050505081565b611f2e612153565b7f00000000000000000000000000000000000000000000000000000000000000004614611f6d5760405162461bcd60e51b8152600401610b5290614265565b604051633b0d4dd760e01b8152600c60048201526002602482015260009073__$b1c1335e68417b4234016f4aa58fdfac77$__90633b0d4dd790604401602060405180830381865af4158015611fc7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611feb91906142a9565b9050600061200660085463ffffffff600160301b9091041690565b905061201183612beb565b60026040805183815263ffffffff86166020820152908101849052600080516020614ae283398151915290606001610c1d565b60006118a1838361206060408051602081019091526000815290565b612b1c565b61206d612153565b7f000000000000000000000000000000000000000000000000000000000000000046146120ac5760405162461bcd60e51b8152600401610b5290614265565b604051633b0d4dd760e01b8152600c60048201526003602482015260009073__$b1c1335e68417b4234016f4aa58fdfac77$__90633b0d4dd790604401602060405180830381865af4158015612106573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061212a91906142a9565b90506000612136611c0e565b905061214183612c89565b6003610bf5565b6000610b0082612ce6565b303314612175576040516347096e4760e01b8152336004820152602401610b52565b565b806121826005612d90565b03612177575b50565b6064808211156121b85760405163243e544560e01b81526004810183905260248101829052604401610b52565b60006121c26118a8565b90506121e16121cf611809565b6121d885612dff565b600a9190612e33565b505060408051828152602081018590527f0553476bf02ef2726e8ce5ced78d63e26e602e4a2257b1f559418e24b46339979101610e95565b600081600781111561222d5761222d613bc1565b600160ff919091161b92915050565b60008061224884611009565b905060008361225683612219565b16036118a1578381846040516331b75e4d60e01b8152600401610b52939291906147d7565b81546001600160801b03600160801b8204811691811660018301909116036122a7576122a76041612e4e565b6001600160801b03808216600090815260018086016020526040909120939093558354919092018216600160801b029116179055565b60005b84518110156123b5576000808683815181106122fe576122fe61443c565b60200260200101516001600160a01b03168684815181106123215761232161443c565b602002602001015186858151811061233b5761233b61443c565b602002602001015160405161235091906147f9565b60006040518083038185875af1925050503d806000811461238d576040519150601f19603f3d011682016040523d82523d6000602084013e612392565b606091505b50915091506123a18282612cca565b505050806123ae90614468565b90506122e0565b505050505050565b6000818152600960205260408120600281015460018201546123df9190614815565b6123eb610a7c85610fd5565b11159392505050565b60008061240386868686611cdc565b9050612451816124136007612219565b61241d6006612219565b6124276002612219565b6001612434600782614828565b61243f906002614925565b6124499190614509565b18181861223c565b506000818152600460205260409081902080546001600160f81b0316600160f81b179055517f789cf55be980739dad1d0699b93b58e806b51c9d96619bfa8fe0a28abaa7b30c90610fc49083815260200190565b60006124c8858585856124c360408051602081019091526000815290565b612572565b95945050505050565b6000610b006124de612e60565b8360405161190160f01b8152600281019290925260228201526042902090565b6000836001600160a01b03163b6000036125605760008061251f8585612f8b565b509092509050600081600381111561253957612539613bc1565b1480156125575750856001600160a01b0316826001600160a01b0316145b925050506118a1565b61256b848484612fd8565b90506118a1565b600061258286610cdb6001612219565b5060006125988661259289610fd5565b85612b1c565b905060006125a988888885886130b3565b9050835160000361260057866001600160a01b03167fb8e138887d0aa13bab447e82de9d5c1777041ecd21ca36ba824ff1e6c07ddda4898884896040516125f39493929190614934565b60405180910390a2611446565b866001600160a01b03167fe2babfbac5889a709b63bb7f598b324e08bc5a4fb9ec647fb3cbc9ec07eb8712898884898960405161264195949392919061495c565b60405180910390a2979650505050505050565b600065ffffffffffff821115612687576040516306dfcc6560e41b81526030600482015260248101839052604401610b52565b5090565b8154600090818160058111156126ea5760006126a6846131b6565b6126b09085614509565b60008881526020902090915081015465ffffffffffff90811690871610156126da578091506126e8565b6126e5816001614815565b92505b505b60006126f88787858561330f565b905080156127335761271d8761270f600184614509565b600091825260209091200190565b54600160301b90046001600160d01b0316611446565b6000979650505050505050565b6008546040805165ffffffffffff928316815291831660208301527fc565b045403dc03c2eea82b81a0465edad9e2e7fc4d97e11421c209da93d7a93910160405180910390a16008805465ffffffffffff191665ffffffffffff92909216919091179055565b805160009060348110156127be576001915050610b00565b82810160131901516001600160a01b031981166b046e0e4dee0dee6cae47a60f60a31b146127f157600192505050610b00565b6000806127ff602885614509565b90505b83811015612876576000806128368884815181106128225761282261443c565b01602001516001600160f81b031916613371565b915091508161284e5760019650505050505050610b00565b8060ff166004856001600160a01b0316901b17935050508061286f90614468565b9050612802565b50856001600160a01b0316816001600160a01b031614935050505092915050565b60006128ac8686868680519060200120611cdc565b9050845186511415806128c157508351865114155b806128cb57508551155b1561290057855184518651604051630447b05d60e41b8152600481019390935260248301919091526044820152606401610b52565b600081815260046020526040902054600160a01b900465ffffffffffff161561294b578061292d82611009565b6040516331b75e4d60e01b8152610b529291906000906004016147d7565b6000612955610ff6565b61295d611809565b65ffffffffffff1661296f9190614815565b9050600061298a60085463ffffffff600160301b9091041690565b600084815260046020526040902080546001600160a01b0319166001600160a01b0387161781559091506129bd83612654565b815465ffffffffffff91909116600160a01b0265ffffffffffff60a01b199091161781556129ea82613403565b815463ffffffff91909116600160d01b0263ffffffff60d01b1990911617815588517f7d84a6263ae0d98d3329bd7b46bb4e8d6f98cd35a7adb45c274c8b7fd5ebd5e090859087908c908c906001600160401b03811115612a4d57612a4d61386a565b604051908082528060200260200182016040528015612a8057816020015b6060815260200190600190039081612a6b5790505b508c89612a8d8a82614815565b8e604051612aa3999897969594939291906149a2565b60405180910390a150505095945050505050565b6060610b067f00000000000000000000000000000000000000000000000000000000000000006000613434565b6060610b067f00000000000000000000000000000000000000000000000000000000000000006001613434565b6000610b0643612654565b60007f0000000000000000000000000000000000000000000000000000000000000000604051630748d63560e31b81526001600160a01b038681166004830152602482018690529190911690633a46b1a890604401602060405180830381865afa158015612b8e573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061189e91906142a9565b80546000908015612be257612bcc8361270f600184614509565b54600160301b90046001600160d01b03166118a1565b60009392505050565b8063ffffffff16600003612c155760405163f1cfbf0560e01b815260006004820152602401610b52565b6008546040805163ffffffff600160301b9093048316815291831660208301527f7e3f7f0708a84de9203036abaa450dccc85ad5ff52f78c170f3edb55cf5e8828910160405180910390a16008805463ffffffff909216600160301b0269ffffffff00000000000019909216919091179055565b60075460408051918252602082018390527fccb45da8d5717e6c4544694297c4ba5cf151d455c9bb0ed4fc7a38411bc05461910160405180910390a1600755565b606082612cdf57612cda826134df565b610b00565b5080610b00565b60006064612cf383611451565b604051632394e7a360e21b8152600481018590526001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001690638e539e8c90602401602060405180830381865afa158015612d58573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612d7c91906142a9565b612d869190614a79565b610b009190614aa6565b80546000906001600160801b0380821691600160801b9004168103612db957612db96031612e4e565b6001600160801b038181166000908152600185810160205260408220805492905585546fffffffffffffffffffffffffffffffff19169301909116919091179092555090565b60006001600160d01b03821115612687576040516306dfcc6560e41b815260d0600482015260248101839052604401610b52565b600080612e41858585613508565b915091505b935093915050565b634e487b71600052806020526024601cfd5b6000306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016148015612eb957507f000000000000000000000000000000000000000000000000000000000000000046145b15612ee357507f000000000000000000000000000000000000000000000000000000000000000090565b610b06604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f60208201527f0000000000000000000000000000000000000000000000000000000000000000918101919091527f000000000000000000000000000000000000000000000000000000000000000060608201524660808201523060a082015260009060c00160405160208183030381529060405280519060200120905090565b60008060008351604103612fc55760208401516040850151606086015160001a612fb78882858561365c565b955095509550505050612fd1565b50508151600091506002905b9250925092565b6000806000856001600160a01b03168585604051602401612ffa929190614ac8565b60408051601f198184030181529181526020820180516001600160e01b0316630b135d3f60e11b1790525161302f91906147f9565b600060405180830381855afa9150503d806000811461306a576040519150601f19603f3d011682016040523d82523d6000602084013e61306f565b606091505b509150915081801561308357506020815110155b80156111a857508051630b135d3f60e11b906130a890830160209081019084016142a9565b149695505050505050565b60008581526009602090815260408083206001600160a01b03881684526003810190925282205460ff1615613106576040516371c6af4960e01b81526001600160a01b0387166004820152602401610b52565b6001600160a01b03861660009081526003820160205260409020805460ff1916600117905560ff851661315257838160000160008282546131479190614815565b909155506131ab9050565b60001960ff86160161317257838160010160008282546131479190614815565b60011960ff86160161319257838160020160008282546131479190614815565b6040516303599be160e11b815260040160405180910390fd5b509195945050505050565b6000600182116131c4575090565b816001600160801b82106131dd5760809190911c9060401b5b6801000000000000000082106131f85760409190911c9060201b5b640100000000821061320f5760209190911c9060101b5b6201000082106132245760109190911c9060081b5b61010082106132385760089190911c9060041b5b6010821061324b5760049190911c9060021b5b600482106132575760011b5b600302600190811c9081858161326f5761326f614a90565b048201901c9050600181858161328757613287614a90565b048201901c9050600181858161329f5761329f614a90565b048201901c905060018185816132b7576132b7614a90565b048201901c905060018185816132cf576132cf614a90565b048201901c905060018185816132e7576132e7614a90565b048201901c905061330681858161330057613300614a90565b04821190565b90039392505050565b60005b81831015613369576000613326848461372b565b60008781526020902090915065ffffffffffff86169082015465ffffffffffff16111561335557809250613363565b613360816001614815565b93505b50613312565b509392505050565b60008060f883901c602f8111801561338c5750603a8160ff16105b156133a157600194602f199091019350915050565b8060ff1660401080156133b7575060478160ff16105b156133cc576001946036199091019350915050565b8060ff1660601080156133e2575060678160ff16105b156133f7576001946056199091019350915050565b50600093849350915050565b600063ffffffff821115612687576040516306dfcc6560e41b81526020600482015260248101839052604401610b52565b606060ff831461344e5761344783613746565b9050610b00565b81805461345a906142c2565b80601f0160208091040260200160405190810160405280929190818152602001828054613486906142c2565b80156134d35780601f106134a8576101008083540402835291602001916134d3565b820191906000526020600020905b8154815290600101906020018083116134b657829003601f168201915b50505050509050610b00565b8051156134ef5780518082602001fd5b60405163d6bda27560e01b815260040160405180910390fd5b8254600090819080156136015760006135268761270f600185614509565b805490915065ffffffffffff80821691600160301b90046001600160d01b031690881682111561356957604051632520601d60e01b815260040160405180910390fd5b8765ffffffffffff168265ffffffffffff16036135a257825465ffffffffffff16600160301b6001600160d01b038916021783556135f3565b6040805180820190915265ffffffffffff808a1682526001600160d01b03808a1660208085019182528d54600181018f5560008f81529190912094519151909216600160301b029216919091179101555b9450859350612e4692505050565b50506040805180820190915265ffffffffffff80851682526001600160d01b0380851660208085019182528854600181018a5560008a815291822095519251909316600160301b029190931617920191909155905081612e46565b600080807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08411156136975750600091506003905082613721565b604080516000808252602082018084528a905260ff891692820192909252606081018790526080810186905260019060a0016020604051602081039080840390855afa1580156136eb573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b03811661371757506000925060019150829050613721565b9250600091508190505b9450945094915050565b600061373a6002848418614aa6565b6118a190848416614815565b6060600061375383613785565b604080516020808252818301909252919250600091906020820181803683375050509182525060208101929092525090565b600060ff8216601f811115610b0057604051632cd44ac360e21b815260040160405180910390fd5b6000602082840312156137bf57600080fd5b81356001600160e01b0319811681146118a157600080fd5b6000602082840312156137e957600080fd5b5035919050565b60005b8381101561380b5781810151838201526020016137f3565b50506000910152565b6000815180845261382c8160208601602086016137f0565b601f01601f19169290920160200192915050565b6020815260006118a16020830184613814565b80356001600160a01b038116811461126f57600080fd5b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b03811182821017156138a8576138a861386a565b604052919050565b60006001600160401b038211156138c9576138c961386a565b50601f01601f191660200190565b600082601f8301126138e857600080fd5b81356138fb6138f6826138b0565b613880565b81815284602083860101111561391057600080fd5b816020850160208301376000918101602001919091529392505050565b6000806000806080858703121561394357600080fd5b61394c85613853565b935061395a60208601613853565b92506040850135915060608501356001600160401b0381111561397c57600080fd5b613988878288016138d7565b91505092959194509250565b60006001600160401b038211156139ad576139ad61386a565b5060051b60200190565b600082601f8301126139c857600080fd5b813560206139d86138f683613994565b82815260059290921b840181019181810190868411156139f757600080fd5b8286015b84811015613a1957613a0c81613853565b83529183019183016139fb565b509695505050505050565b600082601f830112613a3557600080fd5b81356020613a456138f683613994565b82815260059290921b84018101918181019086841115613a6457600080fd5b8286015b84811015613a195780358352918301918301613a68565b600082601f830112613a9057600080fd5b81356020613aa06138f683613994565b82815260059290921b84018101918181019086841115613abf57600080fd5b8286015b84811015613a195780356001600160401b03811115613ae25760008081fd5b613af08986838b01016138d7565b845250918301918301613ac3565b60008060008060808587031215613b1457600080fd5b84356001600160401b0380821115613b2b57600080fd5b613b37888389016139b7565b95506020870135915080821115613b4d57600080fd5b613b5988838901613a24565b94506040870135915080821115613b6f57600080fd5b50613b7c87828801613a7f565b949793965093946060013593505050565b600060208284031215613b9f57600080fd5b81356001600160401b03811115613bb557600080fd5b611295848285016138d7565b634e487b7160e01b600052602160045260246000fd5b60088110613bf557634e487b7160e01b600052602160045260246000fd5b9052565b60208101610b008284613bd7565b60008060408385031215613c1a57600080fd5b82359150613c2a60208401613853565b90509250929050565b60ff8116811461218857600080fd5b60008060408385031215613c5557600080fd5b823591506020830135613c6781613c33565b809150509250929050565b60008083601f840112613c8457600080fd5b5081356001600160401b03811115613c9b57600080fd5b602083019150836020828501011115613cb357600080fd5b9250929050565b600080600080600080600060c0888a031215613cd557600080fd5b873596506020880135613ce781613c33565b9550613cf560408901613853565b945060608801356001600160401b0380821115613d1157600080fd5b613d1d8b838c01613c72565b909650945060808a0135915080821115613d3657600080fd5b613d428b838c016138d7565b935060a08a0135915080821115613d5857600080fd5b50613d658a828b016138d7565b91505092959891949750929550565b600080600080600060808688031215613d8c57600080fd5b853594506020860135613d9e81613c33565b935060408601356001600160401b0380821115613dba57600080fd5b613dc689838a01613c72565b90955093506060880135915080821115613ddf57600080fd5b50613dec888289016138d7565b9150509295509295909350565b65ffffffffffff8116811461218857600080fd5b600060208284031215613e1f57600080fd5b81356118a181613df9565b60008060008060608587031215613e4057600080fd5b843593506020850135613e5281613c33565b925060408501356001600160401b03811115613e6d57600080fd5b613e7987828801613c72565b95989497509550505050565b60008060008060808587031215613e9b57600080fd5b84356001600160401b0380821115613eb257600080fd5b613ebe888389016139b7565b95506020870135915080821115613ed457600080fd5b613ee088838901613a24565b94506040870135915080821115613ef657600080fd5b613f0288838901613a7f565b93506060870135915080821115613f1857600080fd5b50613988878288016138d7565b600060208284031215613f3757600080fd5b6118a182613853565b600081518084526020808501945080840160005b83811015613f7057815187529582019590820190600101613f54565b509495945050505050565b60ff60f81b8816815260e060208201526000613f9a60e0830189613814565b8281036040840152613fac8189613814565b606084018890526001600160a01b038716608085015260a0840186905283810360c08501529050613fdd8185613f40565b9a9950505050505050505050565b6000806000806080858703121561400157600080fd5b84359350602085013561401381613c33565b925061402160408601613853565b915060608501356001600160401b0381111561397c57600080fd5b60008060006060848603121561405157600080fd5b61405a84613853565b92506020840135915060408401356001600160401b0381111561407c57600080fd5b614088868287016138d7565b9150509250925092565b600080600080600060a086880312156140aa57600080fd5b6140b386613853565b94506140c160208701613853565b935060408601356001600160401b03808211156140dd57600080fd5b6140e989838a01613a24565b945060608801359150808211156140ff57600080fd5b61410b89838a01613a24565b93506080880135915080821115613ddf57600080fd5b6000806000806060858703121561413757600080fd5b61414085613853565b93506020850135925060408501356001600160401b03811115613e6d57600080fd5b6000806040838503121561417557600080fd5b823561418081613c33565b915060208301356001600160401b0381111561419b57600080fd5b6141a7858286016138d7565b9150509250929050565b6000602082840312156141c357600080fd5b813563ffffffff811681146118a157600080fd5b600080604083850312156141ea57600080fd5b6141f383613853565b946020939093013593505050565b600080600080600060a0868803121561421957600080fd5b61422286613853565b945061423060208701613853565b9350604086013592506060860135915060808601356001600160401b0381111561425957600080fd5b613dec888289016138d7565b60208082526024908201527f4f7065726174696f6e206f6e6c7920616c6c6f776564206f6e20686f6d6520636040820152633430b4b760e11b606082015260800190565b6000602082840312156142bb57600080fd5b5051919050565b600181811c908216806142d657607f821691505b6020821081036142f657634e487b7160e01b600052602260045260246000fd5b50919050565b601f82111561434257600081815260208120601f850160051c810160208610156143235750805b601f850160051c820191505b818110156123b55782815560010161432f565b505050565b81516001600160401b038111156143605761436061386a565b6143748161436e84546142c2565b846142fc565b602080601f8311600181146143a957600084156143915750858301515b600019600386901b1c1916600185901b1785556123b5565b600085815260208120601f198616915b828110156143d8578886015182559484019460019091019084016143b9565b50858210156143f65787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6060815260006144196060830186613814565b828103602084015261442b8186613814565b915050826040830152949350505050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60006001820161447a5761447a614452565b5060010190565b600061448f6138f6846138b0565b90508281528383830111156144a357600080fd5b6118a18360208301846137f0565b6000602082840312156144c357600080fd5b81516001600160401b038111156144d957600080fd5b8201601f810184136144ea57600080fd5b61129584825160208401614481565b8183823760009101908152919050565b81810381811115610b0057610b00614452565b65ffffffffffff82811682821603908082111561453b5761453b614452565b5092915050565b60006020828403121561455457600080fd5b81516118a181613df9565b6060815260006145726060830186613814565b6001600160a01b039490941660208301525060400152919050565b600082601f83011261459e57600080fd5b6118a183835160208501614481565b6000806000606084860312156145c257600080fd5b83516145cd81613c33565b60208501519093506001600160401b038111156145e957600080fd5b6145f58682870161458d565b925050604084015190509250925092565b805160208201516001600160d01b031980821692919060068310156146355780818460060360031b1b83161693505b505050919050565b805160208201516001600160e01b031980821692919060048310156146355760049290920360031b82901b161692915050565b65ffffffffffff81811683821601908082111561453b5761453b614452565b600081518084526020808501945080840160005b83811015613f705781516001600160a01b0316875295820195908201906001016146a3565b6000815180845260208085019450848260051b860182860160005b8581101561470d5783830389526146fb838351613814565b988501989250908401906001016146e3565b5090979650505050505050565b60808152600061472d608083018761468f565b828103602084015261473f8187613f40565b9050828103604084015261475381866146c8565b91505082606083015295945050505050565b6001600160a01b038516815260ff8416602082015260806040820181905260009061479290830185613814565b905082606083015295945050505050565b6000602082840312156147b557600080fd5b81516001600160401b038111156147cb57600080fd5b6112958482850161458d565b838152606081016147eb6020830185613bd7565b826040830152949350505050565b6000825161480b8184602087016137f0565b9190910192915050565b80820180821115610b0057610b00614452565b60ff8181168382160190811115610b0057610b00614452565b600181815b8085111561487c57816000190482111561486257614862614452565b8085161561486f57918102915b93841c9390800290614846565b509250929050565b60008261489357506001610b00565b816148a057506000610b00565b81600181146148b657600281146148c0576148dc565b6001915050610b00565b60ff8411156148d1576148d1614452565b50506001821b610b00565b5060208310610133831016604e8410600b84101617156148ff575081810a610b00565b6149098383614841565b806000190482111561491d5761491d614452565b029392505050565b60006118a160ff841683614884565b84815260ff841660208201528260408201526080606082015260006111a86080830184613814565b85815260ff8516602082015283604082015260a06060820152600061498460a0830185613814565b82810360808401526149968185613814565b98975050505050505050565b60006101208b8352602060018060a01b038c16818501528160408501526149cb8285018c61468f565b915083820360608501526149df828b613f40565b915083820360808501528189518084528284019150828160051b850101838c0160005b83811015614a3057601f19878403018552614a1e838351613814565b94860194925090850190600101614a02565b505086810360a0880152614a44818c6146c8565b9450505050508560c08401528460e0840152828103610100840152614a698185613814565b9c9b505050505050505050505050565b8082028115828204841417610b0057610b00614452565b634e487b7160e01b600052601260045260246000fd5b600082614ac357634e487b7160e01b600052601260045260246000fd5b500490565b82815260406020820152600061189e604083018461381456fe80c51ad8a7db1a7a86cc355b77bd5cd7ea08f6071ea91d85a8f792734700a0eca26469706673582212205c5a83ff074db246f409ffc8bc5a5c810ce8a95783beb88564ba8a597a7cef8c64736f6c63430008140033", + "libraries": { + "ProofHandler": "0x0152ee45780385dACCCCB128D816031CfFe5F36B" + }, + "devdoc": { + "author": "Web3 Hackers Collective", + "custom:security-contact": "julien@strat.cc", + "details": "Extends OpenZeppelin's Governor contract with cross-chain parameter updates", + "errors": { + "CheckpointUnorderedInsertion()": [ + { + "details": "A value was attempted to be inserted on a past checkpoint." + } + ], + "FailedCall()": [ + { + "details": "A call to an address target failed. The target may have reverted." + } + ], + "GovernorAlreadyCastVote(address)": [ + { + "details": "The vote was already cast." + } + ], + "GovernorAlreadyQueuedProposal(uint256)": [ + { + "details": "The proposal has already been queued." + } + ], + "GovernorDisabledDeposit()": [ + { + "details": "Token deposits are disabled in this contract." + } + ], + "GovernorInsufficientProposerVotes(address,uint256,uint256)": [ + { + "details": "The `proposer` does not have the required votes to create a proposal." + } + ], + "GovernorInvalidProposalLength(uint256,uint256,uint256)": [ + { + "details": "Empty proposal or a mismatch between the parameters length for a proposal call." + } + ], + "GovernorInvalidQuorumFraction(uint256,uint256)": [ + { + "details": "The quorum set is not a valid fraction." + } + ], + "GovernorInvalidSignature(address)": [ + { + "details": "The provided signature is not valid for the expected `voter`. If the `voter` is a contract, the signature is not valid using {IERC1271-isValidSignature}." + } + ], + "GovernorInvalidVoteParams()": [ + { + "details": "The provided params buffer is not supported by the counting module." + } + ], + "GovernorInvalidVoteType()": [ + { + "details": "The vote type used is not valid for the corresponding counting module." + } + ], + "GovernorInvalidVotingPeriod(uint256)": [ + { + "details": "The voting period set is not a valid period." + } + ], + "GovernorNonexistentProposal(uint256)": [ + { + "details": "The `proposalId` doesn't exist." + } + ], + "GovernorNotQueuedProposal(uint256)": [ + { + "details": "The proposal hasn't been queued yet." + } + ], + "GovernorOnlyExecutor(address)": [ + { + "details": "The `account` is not the governance executor." + } + ], + "GovernorOnlyProposer(address)": [ + { + "details": "The `account` is not a proposer." + } + ], + "GovernorQueueNotImplemented()": [ + { + "details": "Queue operation is not implemented for this governor. Execute should be called directly." + } + ], + "GovernorRestrictedProposer(address)": [ + { + "details": "The `proposer` is not allowed to create a proposal." + } + ], + "GovernorUnexpectedProposalState(uint256,uint8,bytes32)": [ + { + "details": "The current state of a proposal is not the required for performing an operation. The `expectedStates` is a bitmap with the bits enabled for each ProposalState enum position counting from right to left. NOTE: If `expectedState` is `bytes32(0)`, the proposal is expected to not be in any state (i.e. not exist). This is the case when a proposal that is expected to be unset is already initiated (the proposal is duplicated). See {Governor-_encodeStateBitmap}." + } + ], + "InvalidAccountNonce(address,uint256)": [ + { + "details": "The nonce used for an `account` is not the expected current nonce." + } + ], + "SafeCastOverflowedUintDowncast(uint8,uint256)": [ + { + "details": "Value doesn't fit in an uint of `bits` size." + } + ] + }, + "events": { + "EIP712DomainChanged()": { + "details": "MAY be emitted to signal that the domain could have changed." + }, + "GovernanceParameterUpdated(uint8,uint256,uint256,uint256)": { + "params": { + "newValue": "New value", + "nonce": "Update sequence number", + "oldValue": "Previous value", + "operationType": "Type of parameter updated" + } + }, + "ManifestoUpdated(string,string,uint256)": { + "params": { + "newManifesto": "New manifesto CID", + "nonce": "Update sequence number", + "oldManifesto": "Previous manifesto CID" + } + }, + "ProposalCanceled(uint256)": { + "details": "Emitted when a proposal is canceled." + }, + "ProposalCreated(uint256,address,address[],uint256[],string[],bytes[],uint256,uint256,string)": { + "details": "Emitted when a proposal is created." + }, + "ProposalExecuted(uint256)": { + "details": "Emitted when a proposal is executed." + }, + "ProposalQueued(uint256,uint256)": { + "details": "Emitted when a proposal is queued." + }, + "VoteCast(address,uint256,uint8,uint256,string)": { + "details": "Emitted when a vote is cast without params. Note: `support` values should be seen as buckets. Their interpretation depends on the voting module used." + }, + "VoteCastWithParams(address,uint256,uint8,uint256,string,bytes)": { + "details": "Emitted when a vote is cast with params. Note: `support` values should be seen as buckets. Their interpretation depends on the voting module used. `params` are additional encoded parameters. Their interpretation also depends on the voting module used." + } + }, + "kind": "dev", + "methods": { + "CLOCK_MODE()": { + "details": "Machine-readable description of the clock as specified in ERC-6372." + }, + "COUNTING_MODE()": { + "details": "See {IGovernor-COUNTING_MODE}." + }, + "cancel(address[],uint256[],bytes[],bytes32)": { + "details": "See {IGovernor-cancel}." + }, + "castVote(uint256,uint8)": { + "details": "See {IGovernor-castVote}." + }, + "castVoteBySig(uint256,uint8,address,bytes)": { + "details": "See {IGovernor-castVoteBySig}." + }, + "castVoteWithReason(uint256,uint8,string)": { + "details": "See {IGovernor-castVoteWithReason}." + }, + "castVoteWithReasonAndParams(uint256,uint8,string,bytes)": { + "details": "See {IGovernor-castVoteWithReasonAndParams}." + }, + "castVoteWithReasonAndParamsBySig(uint256,uint8,address,string,bytes,bytes)": { + "details": "See {IGovernor-castVoteWithReasonAndParamsBySig}." + }, + "claimParameterUpdate(bytes)": { + "params": { + "proof": "Proof generated by home chain" + } + }, + "clock()": { + "details": "Clock (as specified in ERC-6372) is set to match the token's clock. Fallback to block numbers if the token does not implement ERC-6372." + }, + "constructor": { + "details": "Sets up initial governance parameters and manifesto", + "params": { + "_home": "Chain ID where this contract is considered home", + "_manifestoCid": "Initial manifesto CID", + "_name": "Name of the governance contract", + "_proposalThreshold": "Minimum votes needed to create a proposal", + "_quorum": "Minimum participation percentage required", + "_token": "The voting token contract address", + "_votingDelay": "Time before voting begins", + "_votingPeriod": "Duration of voting period" + } + }, + "eip712Domain()": { + "details": "See {IERC-5267}." + }, + "execute(address[],uint256[],bytes[],bytes32)": { + "details": "See {IGovernor-execute}." + }, + "generateParameterProof(uint8,bytes)": { + "params": { + "operationType": "Type of parameter being updated", + "value": "Encoded parameter value" + }, + "returns": { + "proof": "Encoded proof data" + } + }, + "getVotes(address,uint256)": { + "details": "See {IGovernor-getVotes}." + }, + "getVotesWithParams(address,uint256,bytes)": { + "details": "See {IGovernor-getVotesWithParams}." + }, + "hasVoted(uint256,address)": { + "details": "See {IGovernor-hasVoted}." + }, + "hashProposal(address[],uint256[],bytes[],bytes32)": { + "details": "See {IGovernor-hashProposal}. The proposal id is produced by hashing the ABI encoded `targets` array, the `values` array, the `calldatas` array and the descriptionHash (bytes32 which itself is the keccak256 hash of the description string). This proposal id can be produced from the proposal data which is part of the {ProposalCreated} event. It can even be computed in advance, before the proposal is submitted. Note that the chainId and the governor address are not part of the proposal id computation. Consequently, the same proposal (with same operation and same description) will have the same id if submitted on multiple governors across multiple networks. This also means that in order to execute the same operation twice (on the same governor) the proposer will have to change the description in order to avoid proposal id conflicts." + }, + "name()": { + "details": "See {IGovernor-name}." + }, + "nonces(address)": { + "details": "Returns the next unused nonce for an address." + }, + "onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)": { + "details": "See {IERC1155Receiver-onERC1155BatchReceived}. Receiving tokens is disabled if the governance executor is other than the governor itself (eg. when using with a timelock)." + }, + "onERC1155Received(address,address,uint256,uint256,bytes)": { + "details": "See {IERC1155Receiver-onERC1155Received}. Receiving tokens is disabled if the governance executor is other than the governor itself (eg. when using with a timelock)." + }, + "onERC721Received(address,address,uint256,bytes)": { + "details": "See {IERC721Receiver-onERC721Received}. Receiving tokens is disabled if the governance executor is other than the governor itself (eg. when using with a timelock)." + }, + "proposalDeadline(uint256)": { + "details": "See {IGovernor-proposalDeadline}." + }, + "proposalEta(uint256)": { + "details": "See {IGovernor-proposalEta}." + }, + "proposalNeedsQueuing(uint256)": { + "details": "See {IGovernor-proposalNeedsQueuing}." + }, + "proposalProposer(uint256)": { + "details": "See {IGovernor-proposalProposer}." + }, + "proposalSnapshot(uint256)": { + "details": "See {IGovernor-proposalSnapshot}." + }, + "proposalVotes(uint256)": { + "details": "Accessor to the internal vote counts." + }, + "propose(address[],uint256[],bytes[],string)": { + "details": "See {IGovernor-propose}. This function has opt-in frontrunning protection, described in {_isValidDescriptionForProposer}." + }, + "queue(address[],uint256[],bytes[],bytes32)": { + "details": "See {IGovernor-queue}." + }, + "quorumDenominator()": { + "details": "Returns the quorum denominator. Defaults to 100, but may be overridden." + }, + "quorumNumerator()": { + "details": "Returns the current quorum numerator. See {quorumDenominator}." + }, + "quorumNumerator(uint256)": { + "details": "Returns the quorum numerator at a specific timepoint. See {quorumDenominator}." + }, + "relay(address,uint256,bytes)": { + "details": "Relays a transaction or function call to an arbitrary target. In cases where the governance executor is some contract other than the governor itself, like when using a timelock, this function can be invoked in a governance proposal to recover tokens or Ether that was sent to the governor contract by mistake. Note that if the executor is simply the governor itself, use of `relay` is redundant." + }, + "setManifesto(string)": { + "params": { + "newManifesto": "New manifesto CID" + } + }, + "setProposalThreshold(uint256)": { + "params": { + "newProposalThreshold": "New proposal threshold value" + } + }, + "setVotingDelay(uint48)": { + "params": { + "newVotingDelay": "New voting delay value" + } + }, + "setVotingPeriod(uint32)": { + "params": { + "newVotingPeriod": "New voting period value" + } + }, + "state(uint256)": { + "details": "See {IGovernor-state}." + }, + "supportsInterface(bytes4)": { + "details": "See {IERC165-supportsInterface}." + }, + "token()": { + "details": "The token that voting power is sourced from." + }, + "updateQuorumNumerator(uint256)": { + "params": { + "newQuorumNumerator": "New quorum numerator value" + } + }, + "version()": { + "details": "See {IGovernor-version}." + } + }, + "title": "Cross-chain Governance Contract", + "version": 1 + }, + "userdoc": { + "events": { + "GovernanceParameterUpdated(uint8,uint256,uint256,uint256)": { + "notice": "Emitted when a governance parameter is updated" + }, + "ManifestoUpdated(string,string,uint256)": { + "notice": "Emitted when the manifesto is updated" + } + }, + "kind": "user", + "methods": { + "claimParameterUpdate(bytes)": { + "notice": "Claims a parameter update on a foreign chain" + }, + "constructor": { + "notice": "Initializes the governance contract" + }, + "generateParameterProof(uint8,bytes)": { + "notice": "Generates proof for parameter updates" + }, + "home()": { + "notice": "Chain ID where this contract was originally deployed" + }, + "manifesto()": { + "notice": "IPFS CID of the DAO's manifesto" + }, + "setManifesto(string)": { + "notice": "Updates the DAO's manifesto on the home chain" + }, + "setProposalThreshold(uint256)": { + "notice": "Updates the proposal threshold parameter on the home chain" + }, + "setVotingDelay(uint48)": { + "notice": "Updates the voting delay parameter on the home chain" + }, + "setVotingPeriod(uint32)": { + "notice": "Updates the voting period parameter on the home chain" + }, + "updateQuorumNumerator(uint256)": { + "notice": "Updates the quorum numerator on the home chain" + } + }, + "notice": "Implementation of a DAO with cross-chain synchronization capabilities", + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 7382, + "contract": "contracts/variants/crosschain/Gov.sol:Gov", + "label": "_nameFallback", + "offset": 0, + "slot": "0", + "type": "t_string_storage" + }, + { + "astId": 7384, + "contract": "contracts/variants/crosschain/Gov.sol:Gov", + "label": "_versionFallback", + "offset": 0, + "slot": "1", + "type": "t_string_storage" + }, + { + "astId": 6230, + "contract": "contracts/variants/crosschain/Gov.sol:Gov", + "label": "_nonces", + "offset": 0, + "slot": "2", + "type": "t_mapping(t_address,t_uint256)" + }, + { + "astId": 237, + "contract": "contracts/variants/crosschain/Gov.sol:Gov", + "label": "_name", + "offset": 0, + "slot": "3", + "type": "t_string_storage" + }, + { + "astId": 242, + "contract": "contracts/variants/crosschain/Gov.sol:Gov", + "label": "_proposals", + "offset": 0, + "slot": "4", + "type": "t_mapping(t_uint256,t_struct(ProposalCore)215_storage)" + }, + { + "astId": 245, + "contract": "contracts/variants/crosschain/Gov.sol:Gov", + "label": "_governanceCall", + "offset": 0, + "slot": "5", + "type": "t_struct(Bytes32Deque)12901_storage" + }, + { + "astId": 2663, + "contract": "contracts/variants/crosschain/Gov.sol:Gov", + "label": "_proposalThreshold", + "offset": 0, + "slot": "7", + "type": "t_uint256" + }, + { + "astId": 2665, + "contract": "contracts/variants/crosschain/Gov.sol:Gov", + "label": "_votingDelay", + "offset": 0, + "slot": "8", + "type": "t_uint48" + }, + { + "astId": 2667, + "contract": "contracts/variants/crosschain/Gov.sol:Gov", + "label": "_votingPeriod", + "offset": 6, + "slot": "8", + "type": "t_uint32" + }, + { + "astId": 2450, + "contract": "contracts/variants/crosschain/Gov.sol:Gov", + "label": "_proposalVotes", + "offset": 0, + "slot": "9", + "type": "t_mapping(t_uint256,t_struct(ProposalVote)2445_storage)" + }, + { + "astId": 2969, + "contract": "contracts/variants/crosschain/Gov.sol:Gov", + "label": "_quorumNumeratorHistory", + "offset": 0, + "slot": "10", + "type": "t_struct(Trace208)11842_storage" + }, + { + "astId": 13540, + "contract": "contracts/variants/crosschain/Gov.sol:Gov", + "label": "manifesto", + "offset": 0, + "slot": "11", + "type": "t_string_storage" + }, + { + "astId": 13544, + "contract": "contracts/variants/crosschain/Gov.sol:Gov", + "label": "_proofStorage", + "offset": 0, + "slot": "12", + "type": "t_struct(ProofStorage)14687_storage" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + }, + "t_array(t_struct(Checkpoint208)11847_storage)dyn_storage": { + "base": "t_struct(Checkpoint208)11847_storage", + "encoding": "dynamic_array", + "label": "struct Checkpoints.Checkpoint208[]", + "numberOfBytes": "32" + }, + "t_bool": { + "encoding": "inplace", + "label": "bool", + "numberOfBytes": "1" + }, + "t_bytes32": { + "encoding": "inplace", + "label": "bytes32", + "numberOfBytes": "32" + }, + "t_mapping(t_address,t_bool)": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => bool)", + "numberOfBytes": "32", + "value": "t_bool" + }, + "t_mapping(t_address,t_uint256)": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => uint256)", + "numberOfBytes": "32", + "value": "t_uint256" + }, + "t_mapping(t_bytes32,t_bool)": { + "encoding": "mapping", + "key": "t_bytes32", + "label": "mapping(bytes32 => bool)", + "numberOfBytes": "32", + "value": "t_bool" + }, + "t_mapping(t_uint128,t_bytes32)": { + "encoding": "mapping", + "key": "t_uint128", + "label": "mapping(uint128 => bytes32)", + "numberOfBytes": "32", + "value": "t_bytes32" + }, + "t_mapping(t_uint256,t_struct(ProposalCore)215_storage)": { + "encoding": "mapping", + "key": "t_uint256", + "label": "mapping(uint256 => struct Governor.ProposalCore)", + "numberOfBytes": "32", + "value": "t_struct(ProposalCore)215_storage" + }, + "t_mapping(t_uint256,t_struct(ProposalVote)2445_storage)": { + "encoding": "mapping", + "key": "t_uint256", + "label": "mapping(uint256 => struct GovernorCountingSimple.ProposalVote)", + "numberOfBytes": "32", + "value": "t_struct(ProposalVote)2445_storage" + }, + "t_mapping(t_uint8,t_uint256)": { + "encoding": "mapping", + "key": "t_uint8", + "label": "mapping(uint8 => uint256)", + "numberOfBytes": "32", + "value": "t_uint256" + }, + "t_string_storage": { + "encoding": "bytes", + "label": "string", + "numberOfBytes": "32" + }, + "t_struct(Bytes32Deque)12901_storage": { + "encoding": "inplace", + "label": "struct DoubleEndedQueue.Bytes32Deque", + "members": [ + { + "astId": 12894, + "contract": "contracts/variants/crosschain/Gov.sol:Gov", + "label": "_begin", + "offset": 0, + "slot": "0", + "type": "t_uint128" + }, + { + "astId": 12896, + "contract": "contracts/variants/crosschain/Gov.sol:Gov", + "label": "_end", + "offset": 16, + "slot": "0", + "type": "t_uint128" + }, + { + "astId": 12900, + "contract": "contracts/variants/crosschain/Gov.sol:Gov", + "label": "_data", + "offset": 0, + "slot": "1", + "type": "t_mapping(t_uint128,t_bytes32)" + } + ], + "numberOfBytes": "64" + }, + "t_struct(Checkpoint208)11847_storage": { + "encoding": "inplace", + "label": "struct Checkpoints.Checkpoint208", + "members": [ + { + "astId": 11844, + "contract": "contracts/variants/crosschain/Gov.sol:Gov", + "label": "_key", + "offset": 0, + "slot": "0", + "type": "t_uint48" + }, + { + "astId": 11846, + "contract": "contracts/variants/crosschain/Gov.sol:Gov", + "label": "_value", + "offset": 6, + "slot": "0", + "type": "t_uint208" + } + ], + "numberOfBytes": "32" + }, + "t_struct(ProofStorage)14687_storage": { + "encoding": "inplace", + "label": "struct ProofHandler.ProofStorage", + "members": [ + { + "astId": 14682, + "contract": "contracts/variants/crosschain/Gov.sol:Gov", + "label": "updateAppliedOnChain", + "offset": 0, + "slot": "0", + "type": "t_mapping(t_bytes32,t_bool)" + }, + { + "astId": 14686, + "contract": "contracts/variants/crosschain/Gov.sol:Gov", + "label": "currentNonce", + "offset": 0, + "slot": "1", + "type": "t_mapping(t_uint8,t_uint256)" + } + ], + "numberOfBytes": "64" + }, + "t_struct(ProposalCore)215_storage": { + "encoding": "inplace", + "label": "struct Governor.ProposalCore", + "members": [ + { + "astId": 204, + "contract": "contracts/variants/crosschain/Gov.sol:Gov", + "label": "proposer", + "offset": 0, + "slot": "0", + "type": "t_address" + }, + { + "astId": 206, + "contract": "contracts/variants/crosschain/Gov.sol:Gov", + "label": "voteStart", + "offset": 20, + "slot": "0", + "type": "t_uint48" + }, + { + "astId": 208, + "contract": "contracts/variants/crosschain/Gov.sol:Gov", + "label": "voteDuration", + "offset": 26, + "slot": "0", + "type": "t_uint32" + }, + { + "astId": 210, + "contract": "contracts/variants/crosschain/Gov.sol:Gov", + "label": "executed", + "offset": 30, + "slot": "0", + "type": "t_bool" + }, + { + "astId": 212, + "contract": "contracts/variants/crosschain/Gov.sol:Gov", + "label": "canceled", + "offset": 31, + "slot": "0", + "type": "t_bool" + }, + { + "astId": 214, + "contract": "contracts/variants/crosschain/Gov.sol:Gov", + "label": "etaSeconds", + "offset": 0, + "slot": "1", + "type": "t_uint48" + } + ], + "numberOfBytes": "64" + }, + "t_struct(ProposalVote)2445_storage": { + "encoding": "inplace", + "label": "struct GovernorCountingSimple.ProposalVote", + "members": [ + { + "astId": 2436, + "contract": "contracts/variants/crosschain/Gov.sol:Gov", + "label": "againstVotes", + "offset": 0, + "slot": "0", + "type": "t_uint256" + }, + { + "astId": 2438, + "contract": "contracts/variants/crosschain/Gov.sol:Gov", + "label": "forVotes", + "offset": 0, + "slot": "1", + "type": "t_uint256" + }, + { + "astId": 2440, + "contract": "contracts/variants/crosschain/Gov.sol:Gov", + "label": "abstainVotes", + "offset": 0, + "slot": "2", + "type": "t_uint256" + }, + { + "astId": 2444, + "contract": "contracts/variants/crosschain/Gov.sol:Gov", + "label": "hasVoted", + "offset": 0, + "slot": "3", + "type": "t_mapping(t_address,t_bool)" + } + ], + "numberOfBytes": "128" + }, + "t_struct(Trace208)11842_storage": { + "encoding": "inplace", + "label": "struct Checkpoints.Trace208", + "members": [ + { + "astId": 11841, + "contract": "contracts/variants/crosschain/Gov.sol:Gov", + "label": "_checkpoints", + "offset": 0, + "slot": "0", + "type": "t_array(t_struct(Checkpoint208)11847_storage)dyn_storage" + } + ], + "numberOfBytes": "32" + }, + "t_uint128": { + "encoding": "inplace", + "label": "uint128", + "numberOfBytes": "16" + }, + "t_uint208": { + "encoding": "inplace", + "label": "uint208", + "numberOfBytes": "26" + }, + "t_uint256": { + "encoding": "inplace", + "label": "uint256", + "numberOfBytes": "32" + }, + "t_uint32": { + "encoding": "inplace", + "label": "uint32", + "numberOfBytes": "4" + }, + "t_uint48": { + "encoding": "inplace", + "label": "uint48", + "numberOfBytes": "6" + }, + "t_uint8": { + "encoding": "inplace", + "label": "uint8", + "numberOfBytes": "1" + } + } + } +} \ No newline at end of file diff --git a/deployments/baseSepolia/CrosschainNFT.json b/deployments/baseSepolia/CrosschainNFT.json new file mode 100644 index 0000000..4ead327 --- /dev/null +++ b/deployments/baseSepolia/CrosschainNFT.json @@ -0,0 +1,2098 @@ +{ + "address": "0x8583CEbA0d2C5cAe1a1BCff975Faa97063D14953", + "abi": [ + { + "inputs": [ + { + "internalType": "uint256", + "name": "_home", + "type": "uint256" + }, + { + "internalType": "address", + "name": "initialOwner", + "type": "address" + }, + { + "internalType": "address[]", + "name": "_firstMembers", + "type": "address[]" + }, + { + "internalType": "string", + "name": "_uri", + "type": "string" + }, + { + "internalType": "string", + "name": "_name", + "type": "string" + }, + { + "internalType": "string", + "name": "_symbol", + "type": "string" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [], + "name": "CheckpointUnorderedInsertion", + "type": "error" + }, + { + "inputs": [], + "name": "ECDSAInvalidSignature", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "length", + "type": "uint256" + } + ], + "name": "ECDSAInvalidSignatureLength", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + } + ], + "name": "ECDSAInvalidSignatureS", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "timepoint", + "type": "uint256" + }, + { + "internalType": "uint48", + "name": "clock", + "type": "uint48" + } + ], + "name": "ERC5805FutureLookup", + "type": "error" + }, + { + "inputs": [], + "name": "ERC6372InconsistentClock", + "type": "error" + }, + { + "inputs": [], + "name": "ERC721EnumerableForbiddenBatchMint", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + }, + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "ERC721IncorrectOwner", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "operator", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } + ], + "name": "ERC721InsufficientApproval", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "approver", + "type": "address" + } + ], + "name": "ERC721InvalidApprover", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "operator", + "type": "address" + } + ], + "name": "ERC721InvalidOperator", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "ERC721InvalidOwner", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "receiver", + "type": "address" + } + ], + "name": "ERC721InvalidReceiver", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "name": "ERC721InvalidSender", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } + ], + "name": "ERC721NonexistentToken", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "uint256", + "name": "index", + "type": "uint256" + } + ], + "name": "ERC721OutOfBoundsIndex", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "currentNonce", + "type": "uint256" + } + ], + "name": "InvalidAccountNonce", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidShortString", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "OwnableInvalidOwner", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "OwnableUnauthorizedAccount", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint8", + "name": "bits", + "type": "uint8" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "SafeCastOverflowedUintDowncast", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "str", + "type": "string" + } + ], + "name": "StringTooLong", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "expiry", + "type": "uint256" + } + ], + "name": "VotesExpiredSignature", + "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": [ + { + "indexed": false, + "internalType": "uint256", + "name": "_fromTokenId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_toTokenId", + "type": "uint256" + } + ], + "name": "BatchMetadataUpdate", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "delegator", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "fromDelegate", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "toDelegate", + "type": "address" + } + ], + "name": "DelegateChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "delegate", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "previousVotes", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newVotes", + "type": "uint256" + } + ], + "name": "DelegateVotesChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "delegator", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "delegatee", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + } + ], + "name": "DelegationSynced", + "type": "event" + }, + { + "anonymous": false, + "inputs": [], + "name": "EIP712DomainChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "address", + "name": "member", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + } + ], + "name": "MembershipClaimed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "address", + "name": "member", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + } + ], + "name": "MembershipRevoked", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "_tokenId", + "type": "uint256" + } + ], + "name": "MetadataUpdate", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "string", + "name": "newUri", + "type": "string" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + } + ], + "name": "MetadataUpdated", + "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": 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": "CLOCK_MODE", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "pure", + "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": [ + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } + ], + "name": "burn", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "proof", + "type": "bytes" + } + ], + "name": "claimDelegation", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "proof", + "type": "bytes" + } + ], + "name": "claimOperation", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "clock", + "outputs": [ + { + "internalType": "uint48", + "name": "", + "type": "uint48" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "delegatee", + "type": "address" + } + ], + "name": "delegate", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "delegatee", + "type": "address" + }, + { + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "expiry", + "type": "uint256" + }, + { + "internalType": "uint8", + "name": "v", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "r", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + } + ], + "name": "delegateBySig", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "delegates", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "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": [ + { + "internalType": "address", + "name": "delegator", + "type": "address" + }, + { + "internalType": "address", + "name": "delegatee", + "type": "address" + } + ], + "name": "generateDelegationProof", + "outputs": [ + { + "internalType": "bytes", + "name": "", + "type": "bytes" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint8", + "name": "operationType", + "type": "uint8" + }, + { + "internalType": "bytes", + "name": "params", + "type": "bytes" + } + ], + "name": "generateOperationProof", + "outputs": [ + { + "internalType": "bytes", + "name": "", + "type": "bytes" + } + ], + "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": "uint256", + "name": "timepoint", + "type": "uint256" + } + ], + "name": "getPastTotalSupply", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "timepoint", + "type": "uint256" + } + ], + "name": "getPastVotes", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "getVotes", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } + ], + "name": "govBurn", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "home", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "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": [], + "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": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "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": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "string", + "name": "uri", + "type": "string" + } + ], + "name": "safeMint", + "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": [ + { + "internalType": "address", + "name": "operator", + "type": "address" + }, + { + "internalType": "bool", + "name": "approved", + "type": "bool" + } + ], + "name": "setApprovalForAll", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + }, + { + "internalType": "string", + "name": "uri", + "type": "string" + } + ], + "name": "setMetadata", + "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": "index", + "type": "uint256" + } + ], + "name": "tokenByIndex", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "uint256", + "name": "index", + "type": "uint256" + } + ], + "name": "tokenOfOwnerByIndex", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "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" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "args": [ + 11155111, + "0x27292E1a901E3E0bE7d144aDba4CAD07da2d8a42", + [ + "0xD8a394e7d7894bDF2C57139fF17e5CBAa29Dd977", + "0xe61A1a5278290B6520f0CEf3F2c71Ba70CF5cf4C" + ], + "https://bafkreicj62l5xu6pk2xx7x7n6b7rpunxb4ehlh7fevyjapid3556smuz4y.ipfs.w3s.link/", + "Membership NFT", + "MEMBER" + ], + "numDeployments": 1, + "solcInputHash": "c27a34cff02617821c386fb97b476bc1", + "metadata": "{\"compiler\":{\"version\":\"0.8.20+commit.a1b79de6\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_home\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"initialOwner\",\"type\":\"address\"},{\"internalType\":\"address[]\",\"name\":\"_firstMembers\",\"type\":\"address[]\"},{\"internalType\":\"string\",\"name\":\"_uri\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"_name\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"_symbol\",\"type\":\"string\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"CheckpointUnorderedInsertion\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ECDSAInvalidSignature\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"length\",\"type\":\"uint256\"}],\"name\":\"ECDSAInvalidSignatureLength\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"name\":\"ECDSAInvalidSignatureS\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"timepoint\",\"type\":\"uint256\"},{\"internalType\":\"uint48\",\"name\":\"clock\",\"type\":\"uint48\"}],\"name\":\"ERC5805FutureLookup\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ERC6372InconsistentClock\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ERC721EnumerableForbiddenBatchMint\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"ERC721IncorrectOwner\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"ERC721InsufficientApproval\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"approver\",\"type\":\"address\"}],\"name\":\"ERC721InvalidApprover\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"}],\"name\":\"ERC721InvalidOperator\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"ERC721InvalidOwner\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"}],\"name\":\"ERC721InvalidReceiver\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"ERC721InvalidSender\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"ERC721NonexistentToken\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"index\",\"type\":\"uint256\"}],\"name\":\"ERC721OutOfBoundsIndex\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"currentNonce\",\"type\":\"uint256\"}],\"name\":\"InvalidAccountNonce\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidShortString\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"OwnableInvalidOwner\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"OwnableUnauthorizedAccount\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint8\",\"name\":\"bits\",\"type\":\"uint8\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"SafeCastOverflowedUintDowncast\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"str\",\"type\":\"string\"}],\"name\":\"StringTooLong\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expiry\",\"type\":\"uint256\"}],\"name\":\"VotesExpiredSignature\",\"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\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_fromTokenId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_toTokenId\",\"type\":\"uint256\"}],\"name\":\"BatchMetadataUpdate\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"delegator\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"fromDelegate\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"toDelegate\",\"type\":\"address\"}],\"name\":\"DelegateChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"delegate\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"previousVotes\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newVotes\",\"type\":\"uint256\"}],\"name\":\"DelegateVotesChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"delegator\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"delegatee\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"}],\"name\":\"DelegationSynced\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[],\"name\":\"EIP712DomainChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"member\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"}],\"name\":\"MembershipClaimed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"member\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"}],\"name\":\"MembershipRevoked\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_tokenId\",\"type\":\"uint256\"}],\"name\":\"MetadataUpdate\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"newUri\",\"type\":\"string\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"}],\"name\":\"MetadataUpdated\",\"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\":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\":\"CLOCK_MODE\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"pure\",\"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\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"burn\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"proof\",\"type\":\"bytes\"}],\"name\":\"claimDelegation\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"proof\",\"type\":\"bytes\"}],\"name\":\"claimOperation\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"clock\",\"outputs\":[{\"internalType\":\"uint48\",\"name\":\"\",\"type\":\"uint48\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"delegatee\",\"type\":\"address\"}],\"name\":\"delegate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"delegatee\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expiry\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"name\":\"delegateBySig\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"delegates\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"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\":[{\"internalType\":\"address\",\"name\":\"delegator\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"delegatee\",\"type\":\"address\"}],\"name\":\"generateDelegationProof\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint8\",\"name\":\"operationType\",\"type\":\"uint8\"},{\"internalType\":\"bytes\",\"name\":\"params\",\"type\":\"bytes\"}],\"name\":\"generateOperationProof\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"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\":\"uint256\",\"name\":\"timepoint\",\"type\":\"uint256\"}],\"name\":\"getPastTotalSupply\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"timepoint\",\"type\":\"uint256\"}],\"name\":\"getPastVotes\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"getVotes\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"govBurn\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"home\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"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\":[],\"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\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"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\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"uri\",\"type\":\"string\"}],\"name\":\"safeMint\",\"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\":[{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"approved\",\"type\":\"bool\"}],\"name\":\"setApprovalForAll\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"string\",\"name\":\"uri\",\"type\":\"string\"}],\"name\":\"setMetadata\",\"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\":\"index\",\"type\":\"uint256\"}],\"name\":\"tokenByIndex\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"index\",\"type\":\"uint256\"}],\"name\":\"tokenOfOwnerByIndex\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"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\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"author\":\"Web3 Hackers Collective\",\"custom:security-contact\":\"julien@strat.cc\",\"details\":\"Extends OpenZeppelin's NFT standards with cross-chain operation support and delegation\",\"errors\":{\"CheckpointUnorderedInsertion()\":[{\"details\":\"A value was attempted to be inserted on a past checkpoint.\"}],\"ECDSAInvalidSignature()\":[{\"details\":\"The signature derives the `address(0)`.\"}],\"ECDSAInvalidSignatureLength(uint256)\":[{\"details\":\"The signature has an invalid length.\"}],\"ECDSAInvalidSignatureS(bytes32)\":[{\"details\":\"The signature has an S value that is in the upper half order.\"}],\"ERC5805FutureLookup(uint256,uint48)\":[{\"details\":\"Lookup to future votes is not available.\"}],\"ERC6372InconsistentClock()\":[{\"details\":\"The clock was incorrectly modified.\"}],\"ERC721EnumerableForbiddenBatchMint()\":[{\"details\":\"Batch mint is not allowed.\"}],\"ERC721IncorrectOwner(address,uint256,address)\":[{\"details\":\"Indicates an error related to the ownership over a particular token. Used in transfers.\",\"params\":{\"owner\":\"Address of the current owner of a token.\",\"sender\":\"Address whose tokens are being transferred.\",\"tokenId\":\"Identifier number of a token.\"}}],\"ERC721InsufficientApproval(address,uint256)\":[{\"details\":\"Indicates a failure with the `operator`\\u2019s approval. Used in transfers.\",\"params\":{\"operator\":\"Address that may be allowed to operate on tokens without being their owner.\",\"tokenId\":\"Identifier number of a token.\"}}],\"ERC721InvalidApprover(address)\":[{\"details\":\"Indicates a failure with the `approver` of a token to be approved. Used in approvals.\",\"params\":{\"approver\":\"Address initiating an approval operation.\"}}],\"ERC721InvalidOperator(address)\":[{\"details\":\"Indicates a failure with the `operator` to be approved. Used in approvals.\",\"params\":{\"operator\":\"Address that may be allowed to operate on tokens without being their owner.\"}}],\"ERC721InvalidOwner(address)\":[{\"details\":\"Indicates that an address can't be an owner. For example, `address(0)` is a forbidden owner in ERC-20. Used in balance queries.\",\"params\":{\"owner\":\"Address of the current owner of a token.\"}}],\"ERC721InvalidReceiver(address)\":[{\"details\":\"Indicates a failure with the token `receiver`. Used in transfers.\",\"params\":{\"receiver\":\"Address to which tokens are being transferred.\"}}],\"ERC721InvalidSender(address)\":[{\"details\":\"Indicates a failure with the token `sender`. Used in transfers.\",\"params\":{\"sender\":\"Address whose tokens are being transferred.\"}}],\"ERC721NonexistentToken(uint256)\":[{\"details\":\"Indicates a `tokenId` whose `owner` is the zero address.\",\"params\":{\"tokenId\":\"Identifier number of a token.\"}}],\"ERC721OutOfBoundsIndex(address,uint256)\":[{\"details\":\"An `owner`'s token query was out of bounds for `index`. NOTE: The owner being `address(0)` indicates a global out of bounds index.\"}],\"InvalidAccountNonce(address,uint256)\":[{\"details\":\"The nonce used for an `account` is not the expected current nonce.\"}],\"OwnableInvalidOwner(address)\":[{\"details\":\"The owner is not a valid owner account. (eg. `address(0)`)\"}],\"OwnableUnauthorizedAccount(address)\":[{\"details\":\"The caller account is not authorized to perform an operation.\"}],\"SafeCastOverflowedUintDowncast(uint8,uint256)\":[{\"details\":\"Value doesn't fit in an uint of `bits` size.\"}],\"VotesExpiredSignature(uint256)\":[{\"details\":\"The signature used has expired.\"}]},\"events\":{\"Approval(address,address,uint256)\":{\"details\":\"Emitted when `owner` enables `approved` to manage the `tokenId` token.\"},\"ApprovalForAll(address,address,bool)\":{\"details\":\"Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.\"},\"BatchMetadataUpdate(uint256,uint256)\":{\"details\":\"This event emits when the metadata of a range of tokens is changed. So that the third-party platforms such as NFT market could timely update the images and related attributes of the NFTs.\"},\"DelegateChanged(address,address,address)\":{\"details\":\"Emitted when an account changes their delegate.\"},\"DelegateVotesChanged(address,uint256,uint256)\":{\"details\":\"Emitted when a token transfer or delegate change results in changes to a delegate's number of voting units.\"},\"DelegationSynced(address,address,uint256)\":{\"params\":{\"delegatee\":\"The address receiving the delegation\",\"delegator\":\"The address delegating their voting power\",\"nonce\":\"Operation sequence number\"}},\"EIP712DomainChanged()\":{\"details\":\"MAY be emitted to signal that the domain could have changed.\"},\"MembershipClaimed(uint256,address,uint256)\":{\"params\":{\"member\":\"The address receiving the membership\",\"nonce\":\"Operation sequence number\",\"tokenId\":\"The ID of the claimed token\"}},\"MembershipRevoked(uint256,address,uint256)\":{\"params\":{\"member\":\"The address losing membership\",\"nonce\":\"Operation sequence number\",\"tokenId\":\"The ID of the revoked token\"}},\"MetadataUpdate(uint256)\":{\"details\":\"This event emits when the metadata of a token is changed. So that the third-party platforms such as NFT market could timely update the images and related attributes of the NFT.\"},\"MetadataUpdated(uint256,string,uint256)\":{\"params\":{\"newUri\":\"The new metadata URI\",\"nonce\":\"Operation sequence number\",\"tokenId\":\"The ID of the updated token\"}},\"Transfer(address,address,uint256)\":{\"details\":\"Emitted when `tokenId` token is transferred from `from` to `to`.\"}},\"kind\":\"dev\",\"methods\":{\"CLOCK_MODE()\":{\"returns\":{\"_0\":\"String indicating timestamp-based voting\"}},\"approve(address,uint256)\":{\"details\":\"See {IERC721-approve}.\"},\"balanceOf(address)\":{\"details\":\"See {IERC721-balanceOf}.\"},\"burn(uint256)\":{\"details\":\"Burns `tokenId`. See {ERC721-_burn}. Requirements: - The caller must own `tokenId` or be an approved operator.\"},\"claimDelegation(bytes)\":{\"params\":{\"proof\":\"Proof generated by home chain\"}},\"claimOperation(bytes)\":{\"params\":{\"proof\":\"Proof generated by home chain\"}},\"clock()\":{\"details\":\"Used for voting snapshots\",\"returns\":{\"_0\":\"Current block timestamp\"}},\"constructor\":{\"params\":{\"_firstMembers\":\"Array of initial member addresses\",\"_home\":\"Chain ID where contract is considered home\",\"_name\":\"Token collection name\",\"_symbol\":\"Token collection symbol\",\"_uri\":\"Initial token URI\",\"initialOwner\":\"Initial contract owner\"}},\"delegate(address)\":{\"details\":\"Overrides ERC721Votes delegate function to add cross-chain functionality\",\"params\":{\"delegatee\":\"Address to delegate voting power to\"}},\"delegateBySig(address,uint256,uint256,uint8,bytes32,bytes32)\":{\"details\":\"Delegates votes from signer to `delegatee`.\"},\"delegates(address)\":{\"details\":\"Returns the delegate that `account` has chosen.\"},\"eip712Domain()\":{\"details\":\"See {IERC-5267}.\"},\"generateDelegationProof(address,address)\":{\"details\":\"Only callable on home chain\",\"params\":{\"delegatee\":\"Address receiving delegation\",\"delegator\":\"Address delegating voting power\"},\"returns\":{\"_0\":\"Encoded proof data\"}},\"generateOperationProof(uint8,bytes)\":{\"details\":\"Only callable on home chain\",\"params\":{\"operationType\":\"Type of operation\",\"params\":\"Operation parameters\"},\"returns\":{\"_0\":\"Encoded proof data\"}},\"getApproved(uint256)\":{\"details\":\"See {IERC721-getApproved}.\"},\"getPastTotalSupply(uint256)\":{\"details\":\"Returns the total supply of votes available at a specific moment in the past. If the `clock()` is configured to use block numbers, this will return the value at the end of the corresponding block. NOTE: This value is the sum of all available votes, which is not necessarily the sum of all delegated votes. Votes that have not been delegated are still part of total supply, even though they would not participate in a vote. Requirements: - `timepoint` must be in the past. If operating using block numbers, the block must be already mined.\"},\"getPastVotes(address,uint256)\":{\"details\":\"Returns the amount of votes that `account` had at a specific moment in the past. If the `clock()` is configured to use block numbers, this will return the value at the end of the corresponding block. Requirements: - `timepoint` must be in the past. If operating using block numbers, the block must be already mined.\"},\"getVotes(address)\":{\"details\":\"Returns the current amount of votes that `account` has.\"},\"govBurn(uint256)\":{\"details\":\"Only callable by owner (governance) on home chain\",\"params\":{\"tokenId\":\"ID of token to burn\"}},\"isApprovedForAll(address,address)\":{\"details\":\"See {IERC721-isApprovedForAll}.\"},\"name()\":{\"details\":\"See {IERC721Metadata-name}.\"},\"nonces(address)\":{\"details\":\"Returns the next unused nonce for an address.\"},\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"ownerOf(uint256)\":{\"details\":\"See {IERC721-ownerOf}.\"},\"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.\"},\"safeMint(address,string)\":{\"details\":\"Only callable by owner (governance) on home chain\",\"params\":{\"to\":\"Address to mint token to\",\"uri\":\"Token metadata URI\"}},\"safeTransferFrom(address,address,uint256)\":{\"details\":\"See {IERC721-safeTransferFrom}.\"},\"safeTransferFrom(address,address,uint256,bytes)\":{\"details\":\"See {IERC721-safeTransferFrom}.\"},\"setApprovalForAll(address,bool)\":{\"details\":\"See {IERC721-setApprovalForAll}.\"},\"setMetadata(uint256,string)\":{\"details\":\"Only callable by owner (governance) on home chain\",\"params\":{\"tokenId\":\"ID of token to update\",\"uri\":\"New metadata URI\"}},\"supportsInterface(bytes4)\":{\"params\":{\"interfaceId\":\"Interface identifier to check\"},\"returns\":{\"_0\":\"bool True if interface is supported\"}},\"symbol()\":{\"details\":\"See {IERC721Metadata-symbol}.\"},\"tokenByIndex(uint256)\":{\"details\":\"See {IERC721Enumerable-tokenByIndex}.\"},\"tokenOfOwnerByIndex(address,uint256)\":{\"details\":\"See {IERC721Enumerable-tokenOfOwnerByIndex}.\"},\"tokenURI(uint256)\":{\"params\":{\"tokenId\":\"Token ID to query\"},\"returns\":{\"_0\":\"URI string\"}},\"totalSupply()\":{\"details\":\"See {IERC721Enumerable-totalSupply}.\"},\"transferFrom(address,address,uint256)\":{\"details\":\"See {IERC721-transferFrom}.\"},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.\"}},\"title\":\"Cross-chain Membership NFT Contract\",\"version\":1},\"userdoc\":{\"events\":{\"DelegationSynced(address,address,uint256)\":{\"notice\":\"Emitted when delegation is synchronized across chains\"},\"MembershipClaimed(uint256,address,uint256)\":{\"notice\":\"Emitted when a membership is claimed\"},\"MembershipRevoked(uint256,address,uint256)\":{\"notice\":\"Emitted when a membership is revoked\"},\"MetadataUpdated(uint256,string,uint256)\":{\"notice\":\"Emitted when metadata is updated\"}},\"kind\":\"user\",\"methods\":{\"CLOCK_MODE()\":{\"notice\":\"Gets clock mode description\"},\"claimDelegation(bytes)\":{\"notice\":\"Claims a delegation operation on a foreign chain\"},\"claimOperation(bytes)\":{\"notice\":\"Claims an NFT operation on a foreign chain\"},\"clock()\":{\"notice\":\"Gets current timestamp\"},\"constructor\":{\"notice\":\"Initializes the NFT contract\"},\"delegate(address)\":{\"notice\":\"Delegates voting power to another address on home chain\"},\"generateDelegationProof(address,address)\":{\"notice\":\"Generates proof for delegation\"},\"generateOperationProof(uint8,bytes)\":{\"notice\":\"Generates proof for NFT operations\"},\"govBurn(uint256)\":{\"notice\":\"Burns token on home chain\"},\"home()\":{\"notice\":\"Chain ID where contract was originally deployed\"},\"safeMint(address,string)\":{\"notice\":\"Adds a new member on home chain\"},\"setMetadata(uint256,string)\":{\"notice\":\"Updates token metadata on home chain\"},\"supportsInterface(bytes4)\":{\"notice\":\"Checks interface support\"},\"tokenURI(uint256)\":{\"notice\":\"Gets token URI\"}},\"notice\":\"Non-transferable NFT implementation for DAO membership with cross-chain capabilities\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/variants/crosschain/NFT.sol\":\"NFT\"},\"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 v5.0.0) (access/Ownable.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {Context} from \\\"../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 * The initial owner is set to the address provided by the deployer. This can\\n * 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 /**\\n * @dev The caller account is not authorized to perform an operation.\\n */\\n error OwnableUnauthorizedAccount(address account);\\n\\n /**\\n * @dev The owner is not a valid owner account. (eg. `address(0)`)\\n */\\n error OwnableInvalidOwner(address owner);\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the address provided by the deployer as the initial owner.\\n */\\n constructor(address initialOwner) {\\n if (initialOwner == address(0)) {\\n revert OwnableInvalidOwner(address(0));\\n }\\n _transferOwnership(initialOwner);\\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 if (owner() != _msgSender()) {\\n revert OwnableUnauthorizedAccount(_msgSender());\\n }\\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 if (newOwner == address(0)) {\\n revert OwnableInvalidOwner(address(0));\\n }\\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\":\"0xff6d0bb2e285473e5311d9d3caacb525ae3538a80758c10649a4d61029b017bb\",\"license\":\"MIT\"},\"@openzeppelin/contracts/governance/utils/IVotes.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (governance/utils/IVotes.sol)\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Common interface for {ERC20Votes}, {ERC721Votes}, and other {Votes}-enabled contracts.\\n */\\ninterface IVotes {\\n /**\\n * @dev The signature used has expired.\\n */\\n error VotesExpiredSignature(uint256 expiry);\\n\\n /**\\n * @dev Emitted when an account changes their delegate.\\n */\\n event DelegateChanged(address indexed delegator, address indexed fromDelegate, address indexed toDelegate);\\n\\n /**\\n * @dev Emitted when a token transfer or delegate change results in changes to a delegate's number of voting units.\\n */\\n event DelegateVotesChanged(address indexed delegate, uint256 previousVotes, uint256 newVotes);\\n\\n /**\\n * @dev Returns the current amount of votes that `account` has.\\n */\\n function getVotes(address account) external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of votes that `account` had at a specific moment in the past. If the `clock()` is\\n * configured to use block numbers, this will return the value at the end of the corresponding block.\\n */\\n function getPastVotes(address account, uint256 timepoint) external view returns (uint256);\\n\\n /**\\n * @dev Returns the total supply of votes available at a specific moment in the past. If the `clock()` is\\n * configured to use block numbers, this will return the value at the end of the corresponding block.\\n *\\n * NOTE: This value is the sum of all available votes, which is not necessarily the sum of all delegated votes.\\n * Votes that have not been delegated are still part of total supply, even though they would not participate in a\\n * vote.\\n */\\n function getPastTotalSupply(uint256 timepoint) external view returns (uint256);\\n\\n /**\\n * @dev Returns the delegate that `account` has chosen.\\n */\\n function delegates(address account) external view returns (address);\\n\\n /**\\n * @dev Delegates votes from the sender to `delegatee`.\\n */\\n function delegate(address delegatee) external;\\n\\n /**\\n * @dev Delegates votes from signer to `delegatee`.\\n */\\n function delegateBySig(address delegatee, uint256 nonce, uint256 expiry, uint8 v, bytes32 r, bytes32 s) external;\\n}\\n\",\"keccak256\":\"0x5e2b397ae88fd5c68e4f6762eb9f65f65c36702eb57796495f471d024ce70947\",\"license\":\"MIT\"},\"@openzeppelin/contracts/governance/utils/Votes.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (governance/utils/Votes.sol)\\npragma solidity ^0.8.20;\\n\\nimport {IERC5805} from \\\"../../interfaces/IERC5805.sol\\\";\\nimport {Context} from \\\"../../utils/Context.sol\\\";\\nimport {Nonces} from \\\"../../utils/Nonces.sol\\\";\\nimport {EIP712} from \\\"../../utils/cryptography/EIP712.sol\\\";\\nimport {Checkpoints} from \\\"../../utils/structs/Checkpoints.sol\\\";\\nimport {SafeCast} from \\\"../../utils/math/SafeCast.sol\\\";\\nimport {ECDSA} from \\\"../../utils/cryptography/ECDSA.sol\\\";\\nimport {Time} from \\\"../../utils/types/Time.sol\\\";\\n\\n/**\\n * @dev This is a base abstract contract that tracks voting units, which are a measure of voting power that can be\\n * transferred, and provides a system of vote delegation, where an account can delegate its voting units to a sort of\\n * \\\"representative\\\" that will pool delegated voting units from different accounts and can then use it to vote in\\n * decisions. In fact, voting units _must_ be delegated in order to count as actual votes, and an account has to\\n * delegate those votes to itself if it wishes to participate in decisions and does not have a trusted representative.\\n *\\n * This contract is often combined with a token contract such that voting units correspond to token units. For an\\n * example, see {ERC721Votes}.\\n *\\n * The full history of delegate votes is tracked on-chain so that governance protocols can consider votes as distributed\\n * at a particular block number to protect against flash loans and double voting. The opt-in delegate system makes the\\n * cost of this history tracking optional.\\n *\\n * When using this module the derived contract must implement {_getVotingUnits} (for example, make it return\\n * {ERC721-balanceOf}), and can use {_transferVotingUnits} to track a change in the distribution of those units (in the\\n * previous example, it would be included in {ERC721-_update}).\\n */\\nabstract contract Votes is Context, EIP712, Nonces, IERC5805 {\\n using Checkpoints for Checkpoints.Trace208;\\n\\n bytes32 private constant DELEGATION_TYPEHASH =\\n keccak256(\\\"Delegation(address delegatee,uint256 nonce,uint256 expiry)\\\");\\n\\n mapping(address account => address) private _delegatee;\\n\\n mapping(address delegatee => Checkpoints.Trace208) private _delegateCheckpoints;\\n\\n Checkpoints.Trace208 private _totalCheckpoints;\\n\\n /**\\n * @dev The clock was incorrectly modified.\\n */\\n error ERC6372InconsistentClock();\\n\\n /**\\n * @dev Lookup to future votes is not available.\\n */\\n error ERC5805FutureLookup(uint256 timepoint, uint48 clock);\\n\\n /**\\n * @dev Clock used for flagging checkpoints. Can be overridden to implement timestamp based\\n * checkpoints (and voting), in which case {CLOCK_MODE} should be overridden as well to match.\\n */\\n function clock() public view virtual returns (uint48) {\\n return Time.blockNumber();\\n }\\n\\n /**\\n * @dev Machine-readable description of the clock as specified in ERC-6372.\\n */\\n // solhint-disable-next-line func-name-mixedcase\\n function CLOCK_MODE() public view virtual returns (string memory) {\\n // Check that the clock was not modified\\n if (clock() != Time.blockNumber()) {\\n revert ERC6372InconsistentClock();\\n }\\n return \\\"mode=blocknumber&from=default\\\";\\n }\\n\\n /**\\n * @dev Returns the current amount of votes that `account` has.\\n */\\n function getVotes(address account) public view virtual returns (uint256) {\\n return _delegateCheckpoints[account].latest();\\n }\\n\\n /**\\n * @dev Returns the amount of votes that `account` had at a specific moment in the past. If the `clock()` is\\n * configured to use block numbers, this will return the value at the end of the corresponding block.\\n *\\n * Requirements:\\n *\\n * - `timepoint` must be in the past. If operating using block numbers, the block must be already mined.\\n */\\n function getPastVotes(address account, uint256 timepoint) public view virtual returns (uint256) {\\n uint48 currentTimepoint = clock();\\n if (timepoint >= currentTimepoint) {\\n revert ERC5805FutureLookup(timepoint, currentTimepoint);\\n }\\n return _delegateCheckpoints[account].upperLookupRecent(SafeCast.toUint48(timepoint));\\n }\\n\\n /**\\n * @dev Returns the total supply of votes available at a specific moment in the past. If the `clock()` is\\n * configured to use block numbers, this will return the value at the end of the corresponding block.\\n *\\n * NOTE: This value is the sum of all available votes, which is not necessarily the sum of all delegated votes.\\n * Votes that have not been delegated are still part of total supply, even though they would not participate in a\\n * vote.\\n *\\n * Requirements:\\n *\\n * - `timepoint` must be in the past. If operating using block numbers, the block must be already mined.\\n */\\n function getPastTotalSupply(uint256 timepoint) public view virtual returns (uint256) {\\n uint48 currentTimepoint = clock();\\n if (timepoint >= currentTimepoint) {\\n revert ERC5805FutureLookup(timepoint, currentTimepoint);\\n }\\n return _totalCheckpoints.upperLookupRecent(SafeCast.toUint48(timepoint));\\n }\\n\\n /**\\n * @dev Returns the current total supply of votes.\\n */\\n function _getTotalSupply() internal view virtual returns (uint256) {\\n return _totalCheckpoints.latest();\\n }\\n\\n /**\\n * @dev Returns the delegate that `account` has chosen.\\n */\\n function delegates(address account) public view virtual returns (address) {\\n return _delegatee[account];\\n }\\n\\n /**\\n * @dev Delegates votes from the sender to `delegatee`.\\n */\\n function delegate(address delegatee) public virtual {\\n address account = _msgSender();\\n _delegate(account, delegatee);\\n }\\n\\n /**\\n * @dev Delegates votes from signer to `delegatee`.\\n */\\n function delegateBySig(\\n address delegatee,\\n uint256 nonce,\\n uint256 expiry,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) public virtual {\\n if (block.timestamp > expiry) {\\n revert VotesExpiredSignature(expiry);\\n }\\n address signer = ECDSA.recover(\\n _hashTypedDataV4(keccak256(abi.encode(DELEGATION_TYPEHASH, delegatee, nonce, expiry))),\\n v,\\n r,\\n s\\n );\\n _useCheckedNonce(signer, nonce);\\n _delegate(signer, delegatee);\\n }\\n\\n /**\\n * @dev Delegate all of `account`'s voting units to `delegatee`.\\n *\\n * Emits events {IVotes-DelegateChanged} and {IVotes-DelegateVotesChanged}.\\n */\\n function _delegate(address account, address delegatee) internal virtual {\\n address oldDelegate = delegates(account);\\n _delegatee[account] = delegatee;\\n\\n emit DelegateChanged(account, oldDelegate, delegatee);\\n _moveDelegateVotes(oldDelegate, delegatee, _getVotingUnits(account));\\n }\\n\\n /**\\n * @dev Transfers, mints, or burns voting units. To register a mint, `from` should be zero. To register a burn, `to`\\n * should be zero. Total supply of voting units will be adjusted with mints and burns.\\n */\\n function _transferVotingUnits(address from, address to, uint256 amount) internal virtual {\\n if (from == address(0)) {\\n _push(_totalCheckpoints, _add, SafeCast.toUint208(amount));\\n }\\n if (to == address(0)) {\\n _push(_totalCheckpoints, _subtract, SafeCast.toUint208(amount));\\n }\\n _moveDelegateVotes(delegates(from), delegates(to), amount);\\n }\\n\\n /**\\n * @dev Moves delegated votes from one delegate to another.\\n */\\n function _moveDelegateVotes(address from, address to, uint256 amount) internal virtual {\\n if (from != to && amount > 0) {\\n if (from != address(0)) {\\n (uint256 oldValue, uint256 newValue) = _push(\\n _delegateCheckpoints[from],\\n _subtract,\\n SafeCast.toUint208(amount)\\n );\\n emit DelegateVotesChanged(from, oldValue, newValue);\\n }\\n if (to != address(0)) {\\n (uint256 oldValue, uint256 newValue) = _push(\\n _delegateCheckpoints[to],\\n _add,\\n SafeCast.toUint208(amount)\\n );\\n emit DelegateVotesChanged(to, oldValue, newValue);\\n }\\n }\\n }\\n\\n /**\\n * @dev Get number of checkpoints for `account`.\\n */\\n function _numCheckpoints(address account) internal view virtual returns (uint32) {\\n return SafeCast.toUint32(_delegateCheckpoints[account].length());\\n }\\n\\n /**\\n * @dev Get the `pos`-th checkpoint for `account`.\\n */\\n function _checkpoints(\\n address account,\\n uint32 pos\\n ) internal view virtual returns (Checkpoints.Checkpoint208 memory) {\\n return _delegateCheckpoints[account].at(pos);\\n }\\n\\n function _push(\\n Checkpoints.Trace208 storage store,\\n function(uint208, uint208) view returns (uint208) op,\\n uint208 delta\\n ) private returns (uint208 oldValue, uint208 newValue) {\\n return store.push(clock(), op(store.latest(), delta));\\n }\\n\\n function _add(uint208 a, uint208 b) private pure returns (uint208) {\\n return a + b;\\n }\\n\\n function _subtract(uint208 a, uint208 b) private pure returns (uint208) {\\n return a - b;\\n }\\n\\n /**\\n * @dev Must return the voting units held by an account.\\n */\\n function _getVotingUnits(address) internal view virtual returns (uint256);\\n}\\n\",\"keccak256\":\"0x9128a324d265044430e5fa4a6a2853e92d6a62a2a5a69c2fc623f5b7b8cf3f34\",\"license\":\"MIT\"},\"@openzeppelin/contracts/interfaces/IERC165.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC165.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {IERC165} from \\\"../utils/introspection/IERC165.sol\\\";\\n\",\"keccak256\":\"0xde7e9fd9aee8d4f40772f96bb3b58836cbc6dfc0227014a061947f8821ea9724\",\"license\":\"MIT\"},\"@openzeppelin/contracts/interfaces/IERC4906.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (interfaces/IERC4906.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {IERC165} from \\\"./IERC165.sol\\\";\\nimport {IERC721} from \\\"./IERC721.sol\\\";\\n\\n/// @title ERC-721 Metadata Update Extension\\ninterface IERC4906 is IERC165, IERC721 {\\n /// @dev This event emits when the metadata of a token is changed.\\n /// So that the third-party platforms such as NFT market could\\n /// timely update the images and related attributes of the NFT.\\n event MetadataUpdate(uint256 _tokenId);\\n\\n /// @dev This event emits when the metadata of a range of tokens is changed.\\n /// So that the third-party platforms such as NFT market could\\n /// timely update the images and related attributes of the NFTs.\\n event BatchMetadataUpdate(uint256 _fromTokenId, uint256 _toTokenId);\\n}\\n\",\"keccak256\":\"0x1b8691e244f6e11d987459993671db0af33e6a29f7805eac6a9925cc6b601957\",\"license\":\"MIT\"},\"@openzeppelin/contracts/interfaces/IERC5267.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC5267.sol)\\n\\npragma solidity ^0.8.20;\\n\\ninterface IERC5267 {\\n /**\\n * @dev MAY be emitted to signal that the domain could have changed.\\n */\\n event EIP712DomainChanged();\\n\\n /**\\n * @dev returns the fields and values that describe the domain separator used by this contract for EIP-712\\n * signature.\\n */\\n function eip712Domain()\\n external\\n view\\n returns (\\n bytes1 fields,\\n string memory name,\\n string memory version,\\n uint256 chainId,\\n address verifyingContract,\\n bytes32 salt,\\n uint256[] memory extensions\\n );\\n}\\n\",\"keccak256\":\"0x92aa1df62dc3d33f1656d63bede0923e0df0b706ad4137c8b10b0a8fe549fd92\",\"license\":\"MIT\"},\"@openzeppelin/contracts/interfaces/IERC5805.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC5805.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {IVotes} from \\\"../governance/utils/IVotes.sol\\\";\\nimport {IERC6372} from \\\"./IERC6372.sol\\\";\\n\\ninterface IERC5805 is IERC6372, IVotes {}\\n\",\"keccak256\":\"0x4b9b89f91adbb7d3574f85394754cfb08c5b4eafca8a7061e2094a019ab8f818\",\"license\":\"MIT\"},\"@openzeppelin/contracts/interfaces/IERC6372.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC6372.sol)\\n\\npragma solidity ^0.8.20;\\n\\ninterface IERC6372 {\\n /**\\n * @dev Clock used for flagging checkpoints. Can be overridden to implement timestamp based checkpoints (and voting).\\n */\\n function clock() external view returns (uint48);\\n\\n /**\\n * @dev Description of the clock\\n */\\n // solhint-disable-next-line func-name-mixedcase\\n function CLOCK_MODE() external view returns (string memory);\\n}\\n\",\"keccak256\":\"0xeb2857b7dafb7e0d8526dbfe794e6c047df2851c9e6ee91dc4a55f3c34af5d33\",\"license\":\"MIT\"},\"@openzeppelin/contracts/interfaces/IERC721.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC721.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {IERC721} from \\\"../token/ERC721/IERC721.sol\\\";\\n\",\"keccak256\":\"0xc4d7ebf63eb2f6bf3fee1b6c0ee775efa9f31b4843a5511d07eea147e212932d\",\"license\":\"MIT\"},\"@openzeppelin/contracts/interfaces/draft-IERC6093.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (interfaces/draft-IERC6093.sol)\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Standard ERC-20 Errors\\n * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC-20 tokens.\\n */\\ninterface IERC20Errors {\\n /**\\n * @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers.\\n * @param sender Address whose tokens are being transferred.\\n * @param balance Current balance for the interacting account.\\n * @param needed Minimum amount required to perform a transfer.\\n */\\n error ERC20InsufficientBalance(address sender, uint256 balance, uint256 needed);\\n\\n /**\\n * @dev Indicates a failure with the token `sender`. Used in transfers.\\n * @param sender Address whose tokens are being transferred.\\n */\\n error ERC20InvalidSender(address sender);\\n\\n /**\\n * @dev Indicates a failure with the token `receiver`. Used in transfers.\\n * @param receiver Address to which tokens are being transferred.\\n */\\n error ERC20InvalidReceiver(address receiver);\\n\\n /**\\n * @dev Indicates a failure with the `spender`\\u2019s `allowance`. Used in transfers.\\n * @param spender Address that may be allowed to operate on tokens without being their owner.\\n * @param allowance Amount of tokens a `spender` is allowed to operate with.\\n * @param needed Minimum amount required to perform a transfer.\\n */\\n error ERC20InsufficientAllowance(address spender, uint256 allowance, uint256 needed);\\n\\n /**\\n * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.\\n * @param approver Address initiating an approval operation.\\n */\\n error ERC20InvalidApprover(address approver);\\n\\n /**\\n * @dev Indicates a failure with the `spender` to be approved. Used in approvals.\\n * @param spender Address that may be allowed to operate on tokens without being their owner.\\n */\\n error ERC20InvalidSpender(address spender);\\n}\\n\\n/**\\n * @dev Standard ERC-721 Errors\\n * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC-721 tokens.\\n */\\ninterface IERC721Errors {\\n /**\\n * @dev Indicates that an address can't be an owner. For example, `address(0)` is a forbidden owner in ERC-20.\\n * Used in balance queries.\\n * @param owner Address of the current owner of a token.\\n */\\n error ERC721InvalidOwner(address owner);\\n\\n /**\\n * @dev Indicates a `tokenId` whose `owner` is the zero address.\\n * @param tokenId Identifier number of a token.\\n */\\n error ERC721NonexistentToken(uint256 tokenId);\\n\\n /**\\n * @dev Indicates an error related to the ownership over a particular token. Used in transfers.\\n * @param sender Address whose tokens are being transferred.\\n * @param tokenId Identifier number of a token.\\n * @param owner Address of the current owner of a token.\\n */\\n error ERC721IncorrectOwner(address sender, uint256 tokenId, address owner);\\n\\n /**\\n * @dev Indicates a failure with the token `sender`. Used in transfers.\\n * @param sender Address whose tokens are being transferred.\\n */\\n error ERC721InvalidSender(address sender);\\n\\n /**\\n * @dev Indicates a failure with the token `receiver`. Used in transfers.\\n * @param receiver Address to which tokens are being transferred.\\n */\\n error ERC721InvalidReceiver(address receiver);\\n\\n /**\\n * @dev Indicates a failure with the `operator`\\u2019s approval. Used in transfers.\\n * @param operator Address that may be allowed to operate on tokens without being their owner.\\n * @param tokenId Identifier number of a token.\\n */\\n error ERC721InsufficientApproval(address operator, uint256 tokenId);\\n\\n /**\\n * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.\\n * @param approver Address initiating an approval operation.\\n */\\n error ERC721InvalidApprover(address approver);\\n\\n /**\\n * @dev Indicates a failure with the `operator` to be approved. Used in approvals.\\n * @param operator Address that may be allowed to operate on tokens without being their owner.\\n */\\n error ERC721InvalidOperator(address operator);\\n}\\n\\n/**\\n * @dev Standard ERC-1155 Errors\\n * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC-1155 tokens.\\n */\\ninterface IERC1155Errors {\\n /**\\n * @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers.\\n * @param sender Address whose tokens are being transferred.\\n * @param balance Current balance for the interacting account.\\n * @param needed Minimum amount required to perform a transfer.\\n * @param tokenId Identifier number of a token.\\n */\\n error ERC1155InsufficientBalance(address sender, uint256 balance, uint256 needed, uint256 tokenId);\\n\\n /**\\n * @dev Indicates a failure with the token `sender`. Used in transfers.\\n * @param sender Address whose tokens are being transferred.\\n */\\n error ERC1155InvalidSender(address sender);\\n\\n /**\\n * @dev Indicates a failure with the token `receiver`. Used in transfers.\\n * @param receiver Address to which tokens are being transferred.\\n */\\n error ERC1155InvalidReceiver(address receiver);\\n\\n /**\\n * @dev Indicates a failure with the `operator`\\u2019s approval. Used in transfers.\\n * @param operator Address that may be allowed to operate on tokens without being their owner.\\n * @param owner Address of the current owner of a token.\\n */\\n error ERC1155MissingApprovalForAll(address operator, address owner);\\n\\n /**\\n * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.\\n * @param approver Address initiating an approval operation.\\n */\\n error ERC1155InvalidApprover(address approver);\\n\\n /**\\n * @dev Indicates a failure with the `operator` to be approved. Used in approvals.\\n * @param operator Address that may be allowed to operate on tokens without being their owner.\\n */\\n error ERC1155InvalidOperator(address operator);\\n\\n /**\\n * @dev Indicates an array length mismatch between ids and values in a safeBatchTransferFrom operation.\\n * Used in batch transfers.\\n * @param idsLength Length of the array of token identifiers\\n * @param valuesLength Length of the array of token amounts\\n */\\n error ERC1155InvalidArrayLength(uint256 idsLength, uint256 valuesLength);\\n}\\n\",\"keccak256\":\"0x880da465c203cec76b10d72dbd87c80f387df4102274f23eea1f9c9b0918792b\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC721/ERC721.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC721/ERC721.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {IERC721} from \\\"./IERC721.sol\\\";\\nimport {IERC721Metadata} from \\\"./extensions/IERC721Metadata.sol\\\";\\nimport {ERC721Utils} from \\\"./utils/ERC721Utils.sol\\\";\\nimport {Context} from \\\"../../utils/Context.sol\\\";\\nimport {Strings} from \\\"../../utils/Strings.sol\\\";\\nimport {IERC165, ERC165} from \\\"../../utils/introspection/ERC165.sol\\\";\\nimport {IERC721Errors} from \\\"../../interfaces/draft-IERC6093.sol\\\";\\n\\n/**\\n * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC-721] Non-Fungible Token Standard, including\\n * the Metadata extension, but not including the Enumerable extension, which is available separately as\\n * {ERC721Enumerable}.\\n */\\nabstract contract ERC721 is Context, ERC165, IERC721, IERC721Metadata, IERC721Errors {\\n using Strings for uint256;\\n\\n // Token name\\n string private _name;\\n\\n // Token symbol\\n string private _symbol;\\n\\n mapping(uint256 tokenId => address) private _owners;\\n\\n mapping(address owner => uint256) private _balances;\\n\\n mapping(uint256 tokenId => address) private _tokenApprovals;\\n\\n mapping(address owner => mapping(address operator => bool)) private _operatorApprovals;\\n\\n /**\\n * @dev Initializes the contract by setting a `name` and a `symbol` to the token collection.\\n */\\n constructor(string memory name_, string memory symbol_) {\\n _name = name_;\\n _symbol = symbol_;\\n }\\n\\n /**\\n * @dev See {IERC165-supportsInterface}.\\n */\\n function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {\\n return\\n interfaceId == type(IERC721).interfaceId ||\\n interfaceId == type(IERC721Metadata).interfaceId ||\\n super.supportsInterface(interfaceId);\\n }\\n\\n /**\\n * @dev See {IERC721-balanceOf}.\\n */\\n function balanceOf(address owner) public view virtual returns (uint256) {\\n if (owner == address(0)) {\\n revert ERC721InvalidOwner(address(0));\\n }\\n return _balances[owner];\\n }\\n\\n /**\\n * @dev See {IERC721-ownerOf}.\\n */\\n function ownerOf(uint256 tokenId) public view virtual returns (address) {\\n return _requireOwned(tokenId);\\n }\\n\\n /**\\n * @dev See {IERC721Metadata-name}.\\n */\\n function name() public view virtual returns (string memory) {\\n return _name;\\n }\\n\\n /**\\n * @dev See {IERC721Metadata-symbol}.\\n */\\n function symbol() public view virtual returns (string memory) {\\n return _symbol;\\n }\\n\\n /**\\n * @dev See {IERC721Metadata-tokenURI}.\\n */\\n function tokenURI(uint256 tokenId) public view virtual returns (string memory) {\\n _requireOwned(tokenId);\\n\\n string memory baseURI = _baseURI();\\n return bytes(baseURI).length > 0 ? string.concat(baseURI, tokenId.toString()) : \\\"\\\";\\n }\\n\\n /**\\n * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each\\n * token will be the concatenation of the `baseURI` and the `tokenId`. Empty\\n * by default, can be overridden in child contracts.\\n */\\n function _baseURI() internal view virtual returns (string memory) {\\n return \\\"\\\";\\n }\\n\\n /**\\n * @dev See {IERC721-approve}.\\n */\\n function approve(address to, uint256 tokenId) public virtual {\\n _approve(to, tokenId, _msgSender());\\n }\\n\\n /**\\n * @dev See {IERC721-getApproved}.\\n */\\n function getApproved(uint256 tokenId) public view virtual returns (address) {\\n _requireOwned(tokenId);\\n\\n return _getApproved(tokenId);\\n }\\n\\n /**\\n * @dev See {IERC721-setApprovalForAll}.\\n */\\n function setApprovalForAll(address operator, bool approved) public virtual {\\n _setApprovalForAll(_msgSender(), operator, approved);\\n }\\n\\n /**\\n * @dev See {IERC721-isApprovedForAll}.\\n */\\n function isApprovedForAll(address owner, address operator) public view virtual returns (bool) {\\n return _operatorApprovals[owner][operator];\\n }\\n\\n /**\\n * @dev See {IERC721-transferFrom}.\\n */\\n function transferFrom(address from, address to, uint256 tokenId) public virtual {\\n if (to == address(0)) {\\n revert ERC721InvalidReceiver(address(0));\\n }\\n // Setting an \\\"auth\\\" arguments enables the `_isAuthorized` check which verifies that the token exists\\n // (from != 0). Therefore, it is not needed to verify that the return value is not 0 here.\\n address previousOwner = _update(to, tokenId, _msgSender());\\n if (previousOwner != from) {\\n revert ERC721IncorrectOwner(from, tokenId, previousOwner);\\n }\\n }\\n\\n /**\\n * @dev See {IERC721-safeTransferFrom}.\\n */\\n function safeTransferFrom(address from, address to, uint256 tokenId) public {\\n safeTransferFrom(from, to, tokenId, \\\"\\\");\\n }\\n\\n /**\\n * @dev See {IERC721-safeTransferFrom}.\\n */\\n function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory data) public virtual {\\n transferFrom(from, to, tokenId);\\n ERC721Utils.checkOnERC721Received(_msgSender(), from, to, tokenId, data);\\n }\\n\\n /**\\n * @dev Returns the owner of the `tokenId`. Does NOT revert if token doesn't exist\\n *\\n * IMPORTANT: Any overrides to this function that add ownership of tokens not tracked by the\\n * core ERC-721 logic MUST be matched with the use of {_increaseBalance} to keep balances\\n * consistent with ownership. The invariant to preserve is that for any address `a` the value returned by\\n * `balanceOf(a)` must be equal to the number of tokens such that `_ownerOf(tokenId)` is `a`.\\n */\\n function _ownerOf(uint256 tokenId) internal view virtual returns (address) {\\n return _owners[tokenId];\\n }\\n\\n /**\\n * @dev Returns the approved address for `tokenId`. Returns 0 if `tokenId` is not minted.\\n */\\n function _getApproved(uint256 tokenId) internal view virtual returns (address) {\\n return _tokenApprovals[tokenId];\\n }\\n\\n /**\\n * @dev Returns whether `spender` is allowed to manage `owner`'s tokens, or `tokenId` in\\n * particular (ignoring whether it is owned by `owner`).\\n *\\n * WARNING: This function assumes that `owner` is the actual owner of `tokenId` and does not verify this\\n * assumption.\\n */\\n function _isAuthorized(address owner, address spender, uint256 tokenId) internal view virtual returns (bool) {\\n return\\n spender != address(0) &&\\n (owner == spender || isApprovedForAll(owner, spender) || _getApproved(tokenId) == spender);\\n }\\n\\n /**\\n * @dev Checks if `spender` can operate on `tokenId`, assuming the provided `owner` is the actual owner.\\n * Reverts if:\\n * - `spender` does not have approval from `owner` for `tokenId`.\\n * - `spender` does not have approval to manage all of `owner`'s assets.\\n *\\n * WARNING: This function assumes that `owner` is the actual owner of `tokenId` and does not verify this\\n * assumption.\\n */\\n function _checkAuthorized(address owner, address spender, uint256 tokenId) internal view virtual {\\n if (!_isAuthorized(owner, spender, tokenId)) {\\n if (owner == address(0)) {\\n revert ERC721NonexistentToken(tokenId);\\n } else {\\n revert ERC721InsufficientApproval(spender, tokenId);\\n }\\n }\\n }\\n\\n /**\\n * @dev Unsafe write access to the balances, used by extensions that \\\"mint\\\" tokens using an {ownerOf} override.\\n *\\n * NOTE: the value is limited to type(uint128).max. This protect against _balance overflow. It is unrealistic that\\n * a uint256 would ever overflow from increments when these increments are bounded to uint128 values.\\n *\\n * WARNING: Increasing an account's balance using this function tends to be paired with an override of the\\n * {_ownerOf} function to resolve the ownership of the corresponding tokens so that balances and ownership\\n * remain consistent with one another.\\n */\\n function _increaseBalance(address account, uint128 value) internal virtual {\\n unchecked {\\n _balances[account] += value;\\n }\\n }\\n\\n /**\\n * @dev Transfers `tokenId` from its current owner to `to`, or alternatively mints (or burns) if the current owner\\n * (or `to`) is the zero address. Returns the owner of the `tokenId` before the update.\\n *\\n * The `auth` argument is optional. If the value passed is non 0, then this function will check that\\n * `auth` is either the owner of the token, or approved to operate on the token (by the owner).\\n *\\n * Emits a {Transfer} event.\\n *\\n * NOTE: If overriding this function in a way that tracks balances, see also {_increaseBalance}.\\n */\\n function _update(address to, uint256 tokenId, address auth) internal virtual returns (address) {\\n address from = _ownerOf(tokenId);\\n\\n // Perform (optional) operator check\\n if (auth != address(0)) {\\n _checkAuthorized(from, auth, tokenId);\\n }\\n\\n // Execute the update\\n if (from != address(0)) {\\n // Clear approval. No need to re-authorize or emit the Approval event\\n _approve(address(0), tokenId, address(0), false);\\n\\n unchecked {\\n _balances[from] -= 1;\\n }\\n }\\n\\n if (to != address(0)) {\\n unchecked {\\n _balances[to] += 1;\\n }\\n }\\n\\n _owners[tokenId] = to;\\n\\n emit Transfer(from, to, tokenId);\\n\\n return from;\\n }\\n\\n /**\\n * @dev Mints `tokenId` and transfers it to `to`.\\n *\\n * WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible\\n *\\n * Requirements:\\n *\\n * - `tokenId` must not exist.\\n * - `to` cannot be the zero address.\\n *\\n * Emits a {Transfer} event.\\n */\\n function _mint(address to, uint256 tokenId) internal {\\n if (to == address(0)) {\\n revert ERC721InvalidReceiver(address(0));\\n }\\n address previousOwner = _update(to, tokenId, address(0));\\n if (previousOwner != address(0)) {\\n revert ERC721InvalidSender(address(0));\\n }\\n }\\n\\n /**\\n * @dev Mints `tokenId`, transfers it to `to` and checks for `to` acceptance.\\n *\\n * Requirements:\\n *\\n * - `tokenId` must not exist.\\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\\n *\\n * Emits a {Transfer} event.\\n */\\n function _safeMint(address to, uint256 tokenId) internal {\\n _safeMint(to, tokenId, \\\"\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is\\n * forwarded in {IERC721Receiver-onERC721Received} to contract recipients.\\n */\\n function _safeMint(address to, uint256 tokenId, bytes memory data) internal virtual {\\n _mint(to, tokenId);\\n ERC721Utils.checkOnERC721Received(_msgSender(), address(0), to, tokenId, data);\\n }\\n\\n /**\\n * @dev Destroys `tokenId`.\\n * The approval is cleared when the token is burned.\\n * This is an internal function that does not check if the sender is authorized to operate on the token.\\n *\\n * Requirements:\\n *\\n * - `tokenId` must exist.\\n *\\n * Emits a {Transfer} event.\\n */\\n function _burn(uint256 tokenId) internal {\\n address previousOwner = _update(address(0), tokenId, address(0));\\n if (previousOwner == address(0)) {\\n revert ERC721NonexistentToken(tokenId);\\n }\\n }\\n\\n /**\\n * @dev Transfers `tokenId` from `from` to `to`.\\n * As opposed to {transferFrom}, this imposes no restrictions on msg.sender.\\n *\\n * Requirements:\\n *\\n * - `to` cannot be the zero address.\\n * - `tokenId` token must be owned by `from`.\\n *\\n * Emits a {Transfer} event.\\n */\\n function _transfer(address from, address to, uint256 tokenId) internal {\\n if (to == address(0)) {\\n revert ERC721InvalidReceiver(address(0));\\n }\\n address previousOwner = _update(to, tokenId, address(0));\\n if (previousOwner == address(0)) {\\n revert ERC721NonexistentToken(tokenId);\\n } else if (previousOwner != from) {\\n revert ERC721IncorrectOwner(from, tokenId, previousOwner);\\n }\\n }\\n\\n /**\\n * @dev Safely transfers `tokenId` token from `from` to `to`, checking that contract recipients\\n * are aware of the ERC-721 standard to prevent tokens from being forever locked.\\n *\\n * `data` is additional data, it has no specified format and it is sent in call to `to`.\\n *\\n * This internal function is like {safeTransferFrom} in the sense that it invokes\\n * {IERC721Receiver-onERC721Received} on the receiver, and can be used to e.g.\\n * implement alternative mechanisms to perform token transfer, such as signature-based.\\n *\\n * Requirements:\\n *\\n * - `tokenId` token must exist and be owned by `from`.\\n * - `to` cannot be the zero address.\\n * - `from` cannot be the zero address.\\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\\n *\\n * Emits a {Transfer} event.\\n */\\n function _safeTransfer(address from, address to, uint256 tokenId) internal {\\n _safeTransfer(from, to, tokenId, \\\"\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-ERC721-_safeTransfer-address-address-uint256-}[`_safeTransfer`], with an additional `data` parameter which is\\n * forwarded in {IERC721Receiver-onERC721Received} to contract recipients.\\n */\\n function _safeTransfer(address from, address to, uint256 tokenId, bytes memory data) internal virtual {\\n _transfer(from, to, tokenId);\\n ERC721Utils.checkOnERC721Received(_msgSender(), from, to, tokenId, data);\\n }\\n\\n /**\\n * @dev Approve `to` to operate on `tokenId`\\n *\\n * The `auth` argument is optional. If the value passed is non 0, then this function will check that `auth` is\\n * either the owner of the token, or approved to operate on all tokens held by this owner.\\n *\\n * Emits an {Approval} event.\\n *\\n * Overrides to this logic should be done to the variant with an additional `bool emitEvent` argument.\\n */\\n function _approve(address to, uint256 tokenId, address auth) internal {\\n _approve(to, tokenId, auth, true);\\n }\\n\\n /**\\n * @dev Variant of `_approve` with an optional flag to enable or disable the {Approval} event. The event is not\\n * emitted in the context of transfers.\\n */\\n function _approve(address to, uint256 tokenId, address auth, bool emitEvent) internal virtual {\\n // Avoid reading the owner unless necessary\\n if (emitEvent || auth != address(0)) {\\n address owner = _requireOwned(tokenId);\\n\\n // We do not use _isAuthorized because single-token approvals should not be able to call approve\\n if (auth != address(0) && owner != auth && !isApprovedForAll(owner, auth)) {\\n revert ERC721InvalidApprover(auth);\\n }\\n\\n if (emitEvent) {\\n emit Approval(owner, to, tokenId);\\n }\\n }\\n\\n _tokenApprovals[tokenId] = to;\\n }\\n\\n /**\\n * @dev Approve `operator` to operate on all of `owner` tokens\\n *\\n * Requirements:\\n * - operator can't be the address zero.\\n *\\n * Emits an {ApprovalForAll} event.\\n */\\n function _setApprovalForAll(address owner, address operator, bool approved) internal virtual {\\n if (operator == address(0)) {\\n revert ERC721InvalidOperator(operator);\\n }\\n _operatorApprovals[owner][operator] = approved;\\n emit ApprovalForAll(owner, operator, approved);\\n }\\n\\n /**\\n * @dev Reverts if the `tokenId` doesn't have a current owner (it hasn't been minted, or it has been burned).\\n * Returns the owner.\\n *\\n * Overrides to ownership logic should be done to {_ownerOf}.\\n */\\n function _requireOwned(uint256 tokenId) internal view returns (address) {\\n address owner = _ownerOf(tokenId);\\n if (owner == address(0)) {\\n revert ERC721NonexistentToken(tokenId);\\n }\\n return owner;\\n }\\n}\\n\",\"keccak256\":\"0x39ed367e54765186281efcfe83e47cf0ad62cc879f10e191360712507125f29a\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC721/IERC721.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC721/IERC721.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {IERC165} from \\\"../../utils/introspection/IERC165.sol\\\";\\n\\n/**\\n * @dev Required interface of an ERC-721 compliant contract.\\n */\\ninterface IERC721 is IERC165 {\\n /**\\n * @dev Emitted when `tokenId` token is transferred from `from` to `to`.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);\\n\\n /**\\n * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.\\n */\\n event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);\\n\\n /**\\n * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.\\n */\\n event ApprovalForAll(address indexed owner, address indexed operator, bool approved);\\n\\n /**\\n * @dev Returns the number of tokens in ``owner``'s account.\\n */\\n function balanceOf(address owner) external view returns (uint256 balance);\\n\\n /**\\n * @dev Returns the owner of the `tokenId` token.\\n *\\n * Requirements:\\n *\\n * - `tokenId` must exist.\\n */\\n function ownerOf(uint256 tokenId) external view returns (address owner);\\n\\n /**\\n * @dev Safely transfers `tokenId` token from `from` to `to`.\\n *\\n * Requirements:\\n *\\n * - `from` cannot be the zero address.\\n * - `to` cannot be the zero address.\\n * - `tokenId` token must exist and be owned by `from`.\\n * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.\\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon\\n * a safe transfer.\\n *\\n * Emits a {Transfer} event.\\n */\\n function safeTransferFrom(address from, address to, uint256 tokenId, bytes calldata data) external;\\n\\n /**\\n * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients\\n * are aware of the ERC-721 protocol to prevent tokens from being forever locked.\\n *\\n * Requirements:\\n *\\n * - `from` cannot be the zero address.\\n * - `to` cannot be the zero address.\\n * - `tokenId` token must exist and be owned by `from`.\\n * - If the caller is not `from`, it must have been allowed to move this token by either {approve} or\\n * {setApprovalForAll}.\\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon\\n * a safe transfer.\\n *\\n * Emits a {Transfer} event.\\n */\\n function safeTransferFrom(address from, address to, uint256 tokenId) external;\\n\\n /**\\n * @dev Transfers `tokenId` token from `from` to `to`.\\n *\\n * WARNING: Note that the caller is responsible to confirm that the recipient is capable of receiving ERC-721\\n * or else they may be permanently lost. Usage of {safeTransferFrom} prevents loss, though the caller must\\n * understand this adds an external call which potentially creates a reentrancy vulnerability.\\n *\\n * Requirements:\\n *\\n * - `from` cannot be the zero address.\\n * - `to` cannot be the zero address.\\n * - `tokenId` token must be owned by `from`.\\n * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(address from, address to, uint256 tokenId) external;\\n\\n /**\\n * @dev Gives permission to `to` to transfer `tokenId` token to another account.\\n * The approval is cleared when the token is transferred.\\n *\\n * Only a single account can be approved at a time, so approving the zero address clears previous approvals.\\n *\\n * Requirements:\\n *\\n * - The caller must own the token or be an approved operator.\\n * - `tokenId` must exist.\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address to, uint256 tokenId) external;\\n\\n /**\\n * @dev Approve or remove `operator` as an operator for the caller.\\n * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.\\n *\\n * Requirements:\\n *\\n * - The `operator` cannot be the address zero.\\n *\\n * Emits an {ApprovalForAll} event.\\n */\\n function setApprovalForAll(address operator, bool approved) external;\\n\\n /**\\n * @dev Returns the account approved for `tokenId` token.\\n *\\n * Requirements:\\n *\\n * - `tokenId` must exist.\\n */\\n function getApproved(uint256 tokenId) external view returns (address operator);\\n\\n /**\\n * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.\\n *\\n * See {setApprovalForAll}\\n */\\n function isApprovedForAll(address owner, address operator) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x5dc63d1c6a12fe1b17793e1745877b2fcbe1964c3edfd0a482fac21ca8f18261\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC721/IERC721Receiver.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @title ERC-721 token receiver interface\\n * @dev Interface for any contract that wants to support safeTransfers\\n * from ERC-721 asset contracts.\\n */\\ninterface IERC721Receiver {\\n /**\\n * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom}\\n * by `operator` from `from`, this function is called.\\n *\\n * It must return its Solidity selector to confirm the token transfer.\\n * If any other value is returned or the interface is not implemented by the recipient, the transfer will be\\n * reverted.\\n *\\n * The selector can be obtained in Solidity with `IERC721Receiver.onERC721Received.selector`.\\n */\\n function onERC721Received(\\n address operator,\\n address from,\\n uint256 tokenId,\\n bytes calldata data\\n ) external returns (bytes4);\\n}\\n\",\"keccak256\":\"0xb5afb8e8eebc4d1c6404df2f5e1e6d2c3d24fd01e5dfc855314951ecfaae462d\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC721/extensions/ERC721Burnable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC721/extensions/ERC721Burnable.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {ERC721} from \\\"../ERC721.sol\\\";\\nimport {Context} from \\\"../../../utils/Context.sol\\\";\\n\\n/**\\n * @title ERC-721 Burnable Token\\n * @dev ERC-721 Token that can be burned (destroyed).\\n */\\nabstract contract ERC721Burnable is Context, ERC721 {\\n /**\\n * @dev Burns `tokenId`. See {ERC721-_burn}.\\n *\\n * Requirements:\\n *\\n * - The caller must own `tokenId` or be an approved operator.\\n */\\n function burn(uint256 tokenId) public virtual {\\n // Setting an \\\"auth\\\" arguments enables the `_isAuthorized` check which verifies that the token exists\\n // (from != 0). Therefore, it is not needed to verify that the return value is not 0 here.\\n _update(address(0), tokenId, _msgSender());\\n }\\n}\\n\",\"keccak256\":\"0xdee1ff07172e443c6600581fc4f11e7830a6d33e4e551752935b835d52a09404\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC721/extensions/ERC721Enumerable.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {ERC721} from \\\"../ERC721.sol\\\";\\nimport {IERC721Enumerable} from \\\"./IERC721Enumerable.sol\\\";\\nimport {IERC165} from \\\"../../../utils/introspection/ERC165.sol\\\";\\n\\n/**\\n * @dev This implements an optional extension of {ERC721} defined in the ERC that adds enumerability\\n * of all the token ids in the contract as well as all token ids owned by each account.\\n *\\n * CAUTION: {ERC721} extensions that implement custom `balanceOf` logic, such as {ERC721Consecutive},\\n * interfere with enumerability and should not be used together with {ERC721Enumerable}.\\n */\\nabstract contract ERC721Enumerable is ERC721, IERC721Enumerable {\\n mapping(address owner => mapping(uint256 index => uint256)) private _ownedTokens;\\n mapping(uint256 tokenId => uint256) private _ownedTokensIndex;\\n\\n uint256[] private _allTokens;\\n mapping(uint256 tokenId => uint256) private _allTokensIndex;\\n\\n /**\\n * @dev An `owner`'s token query was out of bounds for `index`.\\n *\\n * NOTE: The owner being `address(0)` indicates a global out of bounds index.\\n */\\n error ERC721OutOfBoundsIndex(address owner, uint256 index);\\n\\n /**\\n * @dev Batch mint is not allowed.\\n */\\n error ERC721EnumerableForbiddenBatchMint();\\n\\n /**\\n * @dev See {IERC165-supportsInterface}.\\n */\\n function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165, ERC721) returns (bool) {\\n return interfaceId == type(IERC721Enumerable).interfaceId || super.supportsInterface(interfaceId);\\n }\\n\\n /**\\n * @dev See {IERC721Enumerable-tokenOfOwnerByIndex}.\\n */\\n function tokenOfOwnerByIndex(address owner, uint256 index) public view virtual returns (uint256) {\\n if (index >= balanceOf(owner)) {\\n revert ERC721OutOfBoundsIndex(owner, index);\\n }\\n return _ownedTokens[owner][index];\\n }\\n\\n /**\\n * @dev See {IERC721Enumerable-totalSupply}.\\n */\\n function totalSupply() public view virtual returns (uint256) {\\n return _allTokens.length;\\n }\\n\\n /**\\n * @dev See {IERC721Enumerable-tokenByIndex}.\\n */\\n function tokenByIndex(uint256 index) public view virtual returns (uint256) {\\n if (index >= totalSupply()) {\\n revert ERC721OutOfBoundsIndex(address(0), index);\\n }\\n return _allTokens[index];\\n }\\n\\n /**\\n * @dev See {ERC721-_update}.\\n */\\n function _update(address to, uint256 tokenId, address auth) internal virtual override returns (address) {\\n address previousOwner = super._update(to, tokenId, auth);\\n\\n if (previousOwner == address(0)) {\\n _addTokenToAllTokensEnumeration(tokenId);\\n } else if (previousOwner != to) {\\n _removeTokenFromOwnerEnumeration(previousOwner, tokenId);\\n }\\n if (to == address(0)) {\\n _removeTokenFromAllTokensEnumeration(tokenId);\\n } else if (previousOwner != to) {\\n _addTokenToOwnerEnumeration(to, tokenId);\\n }\\n\\n return previousOwner;\\n }\\n\\n /**\\n * @dev Private function to add a token to this extension's ownership-tracking data structures.\\n * @param to address representing the new owner of the given token ID\\n * @param tokenId uint256 ID of the token to be added to the tokens list of the given address\\n */\\n function _addTokenToOwnerEnumeration(address to, uint256 tokenId) private {\\n uint256 length = balanceOf(to) - 1;\\n _ownedTokens[to][length] = tokenId;\\n _ownedTokensIndex[tokenId] = length;\\n }\\n\\n /**\\n * @dev Private function to add a token to this extension's token tracking data structures.\\n * @param tokenId uint256 ID of the token to be added to the tokens list\\n */\\n function _addTokenToAllTokensEnumeration(uint256 tokenId) private {\\n _allTokensIndex[tokenId] = _allTokens.length;\\n _allTokens.push(tokenId);\\n }\\n\\n /**\\n * @dev Private function to remove a token from this extension's ownership-tracking data structures. Note that\\n * while the token is not assigned a new owner, the `_ownedTokensIndex` mapping is _not_ updated: this allows for\\n * gas optimizations e.g. when performing a transfer operation (avoiding double writes).\\n * This has O(1) time complexity, but alters the order of the _ownedTokens array.\\n * @param from address representing the previous owner of the given token ID\\n * @param tokenId uint256 ID of the token to be removed from the tokens list of the given address\\n */\\n function _removeTokenFromOwnerEnumeration(address from, uint256 tokenId) private {\\n // To prevent a gap in from's tokens array, we store the last token in the index of the token to delete, and\\n // then delete the last slot (swap and pop).\\n\\n uint256 lastTokenIndex = balanceOf(from);\\n uint256 tokenIndex = _ownedTokensIndex[tokenId];\\n\\n mapping(uint256 index => uint256) storage _ownedTokensByOwner = _ownedTokens[from];\\n\\n // When the token to delete is the last token, the swap operation is unnecessary\\n if (tokenIndex != lastTokenIndex) {\\n uint256 lastTokenId = _ownedTokensByOwner[lastTokenIndex];\\n\\n _ownedTokensByOwner[tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token\\n _ownedTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index\\n }\\n\\n // This also deletes the contents at the last position of the array\\n delete _ownedTokensIndex[tokenId];\\n delete _ownedTokensByOwner[lastTokenIndex];\\n }\\n\\n /**\\n * @dev Private function to remove a token from this extension's token tracking data structures.\\n * This has O(1) time complexity, but alters the order of the _allTokens array.\\n * @param tokenId uint256 ID of the token to be removed from the tokens list\\n */\\n function _removeTokenFromAllTokensEnumeration(uint256 tokenId) private {\\n // To prevent a gap in the tokens array, we store the last token in the index of the token to delete, and\\n // then delete the last slot (swap and pop).\\n\\n uint256 lastTokenIndex = _allTokens.length - 1;\\n uint256 tokenIndex = _allTokensIndex[tokenId];\\n\\n // When the token to delete is the last token, the swap operation is unnecessary. However, since this occurs so\\n // rarely (when the last minted token is burnt) that we still do the swap here to avoid the gas cost of adding\\n // an 'if' statement (like in _removeTokenFromOwnerEnumeration)\\n uint256 lastTokenId = _allTokens[lastTokenIndex];\\n\\n _allTokens[tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token\\n _allTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index\\n\\n // This also deletes the contents at the last position of the array\\n delete _allTokensIndex[tokenId];\\n _allTokens.pop();\\n }\\n\\n /**\\n * See {ERC721-_increaseBalance}. We need that to account tokens that were minted in batch\\n */\\n function _increaseBalance(address account, uint128 amount) internal virtual override {\\n if (amount > 0) {\\n revert ERC721EnumerableForbiddenBatchMint();\\n }\\n super._increaseBalance(account, amount);\\n }\\n}\\n\",\"keccak256\":\"0x5191f783af281c75b7de0f1e3e36cdc6ac5cb2358d929584c4953fd02fa2b5eb\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC721/extensions/ERC721URIStorage.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {ERC721} from \\\"../ERC721.sol\\\";\\nimport {Strings} from \\\"../../../utils/Strings.sol\\\";\\nimport {IERC4906} from \\\"../../../interfaces/IERC4906.sol\\\";\\nimport {IERC165} from \\\"../../../interfaces/IERC165.sol\\\";\\n\\n/**\\n * @dev ERC-721 token with storage based token URI management.\\n */\\nabstract contract ERC721URIStorage is IERC4906, ERC721 {\\n using Strings for uint256;\\n\\n // Interface ID as defined in ERC-4906. This does not correspond to a traditional interface ID as ERC-4906 only\\n // defines events and does not include any external function.\\n bytes4 private constant ERC4906_INTERFACE_ID = bytes4(0x49064906);\\n\\n // Optional mapping for token URIs\\n mapping(uint256 tokenId => string) private _tokenURIs;\\n\\n /**\\n * @dev See {IERC165-supportsInterface}\\n */\\n function supportsInterface(bytes4 interfaceId) public view virtual override(ERC721, IERC165) returns (bool) {\\n return interfaceId == ERC4906_INTERFACE_ID || super.supportsInterface(interfaceId);\\n }\\n\\n /**\\n * @dev See {IERC721Metadata-tokenURI}.\\n */\\n function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {\\n _requireOwned(tokenId);\\n\\n string memory _tokenURI = _tokenURIs[tokenId];\\n string memory base = _baseURI();\\n\\n // If there is no base URI, return the token URI.\\n if (bytes(base).length == 0) {\\n return _tokenURI;\\n }\\n // If both are set, concatenate the baseURI and tokenURI (via string.concat).\\n if (bytes(_tokenURI).length > 0) {\\n return string.concat(base, _tokenURI);\\n }\\n\\n return super.tokenURI(tokenId);\\n }\\n\\n /**\\n * @dev Sets `_tokenURI` as the tokenURI of `tokenId`.\\n *\\n * Emits {MetadataUpdate}.\\n */\\n function _setTokenURI(uint256 tokenId, string memory _tokenURI) internal virtual {\\n _tokenURIs[tokenId] = _tokenURI;\\n emit MetadataUpdate(tokenId);\\n }\\n}\\n\",\"keccak256\":\"0xe52813067c6d5838eeb34e1da8beb2514371a7d778266013b04ca3be1dda7100\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC721/extensions/ERC721Votes.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC721/extensions/ERC721Votes.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {ERC721} from \\\"../ERC721.sol\\\";\\nimport {Votes} from \\\"../../../governance/utils/Votes.sol\\\";\\n\\n/**\\n * @dev Extension of ERC-721 to support voting and delegation as implemented by {Votes}, where each individual NFT counts\\n * as 1 vote unit.\\n *\\n * Tokens do not count as votes until they are delegated, because votes must be tracked which incurs an additional cost\\n * on every transfer. Token holders can either delegate to a trusted representative who will decide how to make use of\\n * the votes in governance decisions, or they can delegate to themselves to be their own representative.\\n */\\nabstract contract ERC721Votes is ERC721, Votes {\\n /**\\n * @dev See {ERC721-_update}. Adjusts votes when tokens are transferred.\\n *\\n * Emits a {IVotes-DelegateVotesChanged} event.\\n */\\n function _update(address to, uint256 tokenId, address auth) internal virtual override returns (address) {\\n address previousOwner = super._update(to, tokenId, auth);\\n\\n _transferVotingUnits(previousOwner, to, 1);\\n\\n return previousOwner;\\n }\\n\\n /**\\n * @dev Returns the balance of `account`.\\n *\\n * WARNING: Overriding this function will likely result in incorrect vote tracking.\\n */\\n function _getVotingUnits(address account) internal view virtual override returns (uint256) {\\n return balanceOf(account);\\n }\\n\\n /**\\n * @dev See {ERC721-_increaseBalance}. We need that to account tokens that were minted in batch.\\n */\\n function _increaseBalance(address account, uint128 amount) internal virtual override {\\n super._increaseBalance(account, amount);\\n _transferVotingUnits(address(0), account, amount);\\n }\\n}\\n\",\"keccak256\":\"0x8b245d62f3ce9596d3a52c7b6c738cd95a40fe8dba898e90fcce18bb7a2d8239\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC721/extensions/IERC721Enumerable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC721/extensions/IERC721Enumerable.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {IERC721} from \\\"../IERC721.sol\\\";\\n\\n/**\\n * @title ERC-721 Non-Fungible Token Standard, optional enumeration extension\\n * @dev See https://eips.ethereum.org/EIPS/eip-721\\n */\\ninterface IERC721Enumerable is IERC721 {\\n /**\\n * @dev Returns the total amount of tokens stored by the contract.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns a token ID owned by `owner` at a given `index` of its token list.\\n * Use along with {balanceOf} to enumerate all of ``owner``'s tokens.\\n */\\n function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256);\\n\\n /**\\n * @dev Returns a token ID at a given `index` of all the tokens stored by the contract.\\n * Use along with {totalSupply} to enumerate all tokens.\\n */\\n function tokenByIndex(uint256 index) external view returns (uint256);\\n}\\n\",\"keccak256\":\"0x3d6954a93ac198a2ffa384fa58ccf18e7e235263e051a394328002eff4e073de\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC721/extensions/IERC721Metadata.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {IERC721} from \\\"../IERC721.sol\\\";\\n\\n/**\\n * @title ERC-721 Non-Fungible Token Standard, optional metadata extension\\n * @dev See https://eips.ethereum.org/EIPS/eip-721\\n */\\ninterface IERC721Metadata is IERC721 {\\n /**\\n * @dev Returns the token collection name.\\n */\\n function name() external view returns (string memory);\\n\\n /**\\n * @dev Returns the token collection symbol.\\n */\\n function symbol() external view returns (string memory);\\n\\n /**\\n * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token.\\n */\\n function tokenURI(uint256 tokenId) external view returns (string memory);\\n}\\n\",\"keccak256\":\"0x37d1aaaa5a2908a09e9dcf56a26ddf762ecf295afb5964695937344fc6802ce1\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC721/utils/ERC721Utils.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC721/utils/ERC721Utils.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {IERC721Receiver} from \\\"../IERC721Receiver.sol\\\";\\nimport {IERC721Errors} from \\\"../../../interfaces/draft-IERC6093.sol\\\";\\n\\n/**\\n * @dev Library that provide common ERC-721 utility functions.\\n *\\n * See https://eips.ethereum.org/EIPS/eip-721[ERC-721].\\n *\\n * _Available since v5.1._\\n */\\nlibrary ERC721Utils {\\n /**\\n * @dev Performs an acceptance check for the provided `operator` by calling {IERC721-onERC721Received}\\n * on the `to` address. The `operator` is generally the address that initiated the token transfer (i.e. `msg.sender`).\\n *\\n * The acceptance call is not executed and treated as a no-op if the target address doesn't contain code (i.e. an EOA).\\n * Otherwise, the recipient must implement {IERC721Receiver-onERC721Received} and return the acceptance magic value to accept\\n * the transfer.\\n */\\n function checkOnERC721Received(\\n address operator,\\n address from,\\n address to,\\n uint256 tokenId,\\n bytes memory data\\n ) internal {\\n if (to.code.length > 0) {\\n try IERC721Receiver(to).onERC721Received(operator, from, tokenId, data) returns (bytes4 retval) {\\n if (retval != IERC721Receiver.onERC721Received.selector) {\\n // Token rejected\\n revert IERC721Errors.ERC721InvalidReceiver(to);\\n }\\n } catch (bytes memory reason) {\\n if (reason.length == 0) {\\n // non-IERC721Receiver implementer\\n revert IERC721Errors.ERC721InvalidReceiver(to);\\n } else {\\n assembly (\\\"memory-safe\\\") {\\n revert(add(32, reason), mload(reason))\\n }\\n }\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x40399695922383778f9f540a620bec475a2f8e0f08d41f0005682842e28a9855\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)\\n\\npragma solidity ^0.8.20;\\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\":\"0x493033a8d1b176a037b2cc6a04dad01a5c157722049bbecf632ca876224dd4b2\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Nonces.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/Nonces.sol)\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Provides tracking nonces for addresses. Nonces will only increment.\\n */\\nabstract contract Nonces {\\n /**\\n * @dev The nonce used for an `account` is not the expected current nonce.\\n */\\n error InvalidAccountNonce(address account, uint256 currentNonce);\\n\\n mapping(address account => uint256) private _nonces;\\n\\n /**\\n * @dev Returns the next unused nonce for an address.\\n */\\n function nonces(address owner) public view virtual returns (uint256) {\\n return _nonces[owner];\\n }\\n\\n /**\\n * @dev Consumes a nonce.\\n *\\n * Returns the current value and increments nonce.\\n */\\n function _useNonce(address owner) internal virtual returns (uint256) {\\n // For each account, the nonce has an initial value of 0, can only be incremented by one, and cannot be\\n // decremented or reset. This guarantees that the nonce never overflows.\\n unchecked {\\n // It is important to do x++ and not ++x here.\\n return _nonces[owner]++;\\n }\\n }\\n\\n /**\\n * @dev Same as {_useNonce} but checking that `nonce` is the next valid for `owner`.\\n */\\n function _useCheckedNonce(address owner, uint256 nonce) internal virtual {\\n uint256 current = _useNonce(owner);\\n if (nonce != current) {\\n revert InvalidAccountNonce(owner, current);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x0082767004fca261c332e9ad100868327a863a88ef724e844857128845ab350f\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Panic.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/Panic.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Helper library for emitting standardized panic codes.\\n *\\n * ```solidity\\n * contract Example {\\n * using Panic for uint256;\\n *\\n * // Use any of the declared internal constants\\n * function foo() { Panic.GENERIC.panic(); }\\n *\\n * // Alternatively\\n * function foo() { Panic.panic(Panic.GENERIC); }\\n * }\\n * ```\\n *\\n * Follows the list from https://github.com/ethereum/solidity/blob/v0.8.24/libsolutil/ErrorCodes.h[libsolutil].\\n *\\n * _Available since v5.1._\\n */\\n// slither-disable-next-line unused-state\\nlibrary Panic {\\n /// @dev generic / unspecified error\\n uint256 internal constant GENERIC = 0x00;\\n /// @dev used by the assert() builtin\\n uint256 internal constant ASSERT = 0x01;\\n /// @dev arithmetic underflow or overflow\\n uint256 internal constant UNDER_OVERFLOW = 0x11;\\n /// @dev division or modulo by zero\\n uint256 internal constant DIVISION_BY_ZERO = 0x12;\\n /// @dev enum conversion error\\n uint256 internal constant ENUM_CONVERSION_ERROR = 0x21;\\n /// @dev invalid encoding in storage\\n uint256 internal constant STORAGE_ENCODING_ERROR = 0x22;\\n /// @dev empty array pop\\n uint256 internal constant EMPTY_ARRAY_POP = 0x31;\\n /// @dev array out of bounds access\\n uint256 internal constant ARRAY_OUT_OF_BOUNDS = 0x32;\\n /// @dev resource error (too large allocation or too large array)\\n uint256 internal constant RESOURCE_ERROR = 0x41;\\n /// @dev calling invalid internal function\\n uint256 internal constant INVALID_INTERNAL_FUNCTION = 0x51;\\n\\n /// @dev Reverts with a panic code. Recommended to use with\\n /// the internal constants with predefined codes.\\n function panic(uint256 code) internal pure {\\n assembly (\\\"memory-safe\\\") {\\n mstore(0x00, 0x4e487b71)\\n mstore(0x20, code)\\n revert(0x1c, 0x24)\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf7fe324703a64fc51702311dc51562d5cb1497734f074e4f483bfb6717572d7a\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/ShortStrings.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/ShortStrings.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {StorageSlot} from \\\"./StorageSlot.sol\\\";\\n\\n// | string | 0xAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA |\\n// | length | 0x BB |\\ntype ShortString is bytes32;\\n\\n/**\\n * @dev This library provides functions to convert short memory strings\\n * into a `ShortString` type that can be used as an immutable variable.\\n *\\n * Strings of arbitrary length can be optimized using this library if\\n * they are short enough (up to 31 bytes) by packing them with their\\n * length (1 byte) in a single EVM word (32 bytes). Additionally, a\\n * fallback mechanism can be used for every other case.\\n *\\n * Usage example:\\n *\\n * ```solidity\\n * contract Named {\\n * using ShortStrings for *;\\n *\\n * ShortString private immutable _name;\\n * string private _nameFallback;\\n *\\n * constructor(string memory contractName) {\\n * _name = contractName.toShortStringWithFallback(_nameFallback);\\n * }\\n *\\n * function name() external view returns (string memory) {\\n * return _name.toStringWithFallback(_nameFallback);\\n * }\\n * }\\n * ```\\n */\\nlibrary ShortStrings {\\n // Used as an identifier for strings longer than 31 bytes.\\n bytes32 private constant FALLBACK_SENTINEL = 0x00000000000000000000000000000000000000000000000000000000000000FF;\\n\\n error StringTooLong(string str);\\n error InvalidShortString();\\n\\n /**\\n * @dev Encode a string of at most 31 chars into a `ShortString`.\\n *\\n * This will trigger a `StringTooLong` error is the input string is too long.\\n */\\n function toShortString(string memory str) internal pure returns (ShortString) {\\n bytes memory bstr = bytes(str);\\n if (bstr.length > 31) {\\n revert StringTooLong(str);\\n }\\n return ShortString.wrap(bytes32(uint256(bytes32(bstr)) | bstr.length));\\n }\\n\\n /**\\n * @dev Decode a `ShortString` back to a \\\"normal\\\" string.\\n */\\n function toString(ShortString sstr) internal pure returns (string memory) {\\n uint256 len = byteLength(sstr);\\n // using `new string(len)` would work locally but is not memory safe.\\n string memory str = new string(32);\\n assembly (\\\"memory-safe\\\") {\\n mstore(str, len)\\n mstore(add(str, 0x20), sstr)\\n }\\n return str;\\n }\\n\\n /**\\n * @dev Return the length of a `ShortString`.\\n */\\n function byteLength(ShortString sstr) internal pure returns (uint256) {\\n uint256 result = uint256(ShortString.unwrap(sstr)) & 0xFF;\\n if (result > 31) {\\n revert InvalidShortString();\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Encode a string into a `ShortString`, or write it to storage if it is too long.\\n */\\n function toShortStringWithFallback(string memory value, string storage store) internal returns (ShortString) {\\n if (bytes(value).length < 32) {\\n return toShortString(value);\\n } else {\\n StorageSlot.getStringSlot(store).value = value;\\n return ShortString.wrap(FALLBACK_SENTINEL);\\n }\\n }\\n\\n /**\\n * @dev Decode a string that was encoded to `ShortString` or written to storage using {setWithFallback}.\\n */\\n function toStringWithFallback(ShortString value, string storage store) internal pure returns (string memory) {\\n if (ShortString.unwrap(value) != FALLBACK_SENTINEL) {\\n return toString(value);\\n } else {\\n return store;\\n }\\n }\\n\\n /**\\n * @dev Return the length of a string that was encoded to `ShortString` or written to storage using\\n * {setWithFallback}.\\n *\\n * WARNING: This will return the \\\"byte length\\\" of the string. This may not reflect the actual length in terms of\\n * actual characters as the UTF-8 encoding of a single character can span over multiple bytes.\\n */\\n function byteLengthWithFallback(ShortString value, string storage store) internal view returns (uint256) {\\n if (ShortString.unwrap(value) != FALLBACK_SENTINEL) {\\n return byteLength(value);\\n } else {\\n return bytes(store).length;\\n }\\n }\\n}\\n\",\"keccak256\":\"0x7d94fa0af099a2172eb01f9c8a8a443cbe7e0e43654841563e4e09968efdb549\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/StorageSlot.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/StorageSlot.sol)\\n// This file was procedurally generated from scripts/generate/templates/StorageSlot.js.\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Library for reading and writing primitive types to specific storage slots.\\n *\\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\\n * This library helps with reading and writing to such slots without the need for inline assembly.\\n *\\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\\n *\\n * Example usage to set ERC-1967 implementation slot:\\n * ```solidity\\n * contract ERC1967 {\\n * // Define the slot. Alternatively, use the SlotDerivation library to derive the slot.\\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n *\\n * function _getImplementation() internal view returns (address) {\\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n * }\\n *\\n * function _setImplementation(address newImplementation) internal {\\n * require(newImplementation.code.length > 0);\\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n * }\\n * }\\n * ```\\n *\\n * TIP: Consider using this library along with {SlotDerivation}.\\n */\\nlibrary StorageSlot {\\n struct AddressSlot {\\n address value;\\n }\\n\\n struct BooleanSlot {\\n bool value;\\n }\\n\\n struct Bytes32Slot {\\n bytes32 value;\\n }\\n\\n struct Uint256Slot {\\n uint256 value;\\n }\\n\\n struct Int256Slot {\\n int256 value;\\n }\\n\\n struct StringSlot {\\n string value;\\n }\\n\\n struct BytesSlot {\\n bytes value;\\n }\\n\\n /**\\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\\n */\\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\\n assembly (\\\"memory-safe\\\") {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns a `BooleanSlot` with member `value` located at `slot`.\\n */\\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\\n assembly (\\\"memory-safe\\\") {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns a `Bytes32Slot` with member `value` located at `slot`.\\n */\\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\\n assembly (\\\"memory-safe\\\") {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns a `Uint256Slot` with member `value` located at `slot`.\\n */\\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\\n assembly (\\\"memory-safe\\\") {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns a `Int256Slot` with member `value` located at `slot`.\\n */\\n function getInt256Slot(bytes32 slot) internal pure returns (Int256Slot storage r) {\\n assembly (\\\"memory-safe\\\") {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns a `StringSlot` with member `value` located at `slot`.\\n */\\n function getStringSlot(bytes32 slot) internal pure returns (StringSlot storage r) {\\n assembly (\\\"memory-safe\\\") {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `StringSlot` representation of the string storage pointer `store`.\\n */\\n function getStringSlot(string storage store) internal pure returns (StringSlot storage r) {\\n assembly (\\\"memory-safe\\\") {\\n r.slot := store.slot\\n }\\n }\\n\\n /**\\n * @dev Returns a `BytesSlot` with member `value` located at `slot`.\\n */\\n function getBytesSlot(bytes32 slot) internal pure returns (BytesSlot storage r) {\\n assembly (\\\"memory-safe\\\") {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `BytesSlot` representation of the bytes storage pointer `store`.\\n */\\n function getBytesSlot(bytes storage store) internal pure returns (BytesSlot storage r) {\\n assembly (\\\"memory-safe\\\") {\\n r.slot := store.slot\\n }\\n }\\n}\\n\",\"keccak256\":\"0xcf74f855663ce2ae00ed8352666b7935f6cddea2932fdf2c3ecd30a9b1cd0e97\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Strings.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/Strings.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {Math} from \\\"./math/Math.sol\\\";\\nimport {SignedMath} from \\\"./math/SignedMath.sol\\\";\\n\\n/**\\n * @dev String operations.\\n */\\nlibrary Strings {\\n bytes16 private constant HEX_DIGITS = \\\"0123456789abcdef\\\";\\n uint8 private constant ADDRESS_LENGTH = 20;\\n\\n /**\\n * @dev The `value` string doesn't fit in the specified `length`.\\n */\\n error StringsInsufficientHexLength(uint256 value, uint256 length);\\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 assembly (\\\"memory-safe\\\") {\\n ptr := add(buffer, add(32, length))\\n }\\n while (true) {\\n ptr--;\\n assembly (\\\"memory-safe\\\") {\\n mstore8(ptr, byte(mod(value, 10), HEX_DIGITS))\\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 toStringSigned(int256 value) internal pure returns (string memory) {\\n return string.concat(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 uint256 localValue = value;\\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] = HEX_DIGITS[localValue & 0xf];\\n localValue >>= 4;\\n }\\n if (localValue != 0) {\\n revert StringsInsufficientHexLength(value, length);\\n }\\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\\n * 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 Converts an `address` with fixed length of 20 bytes to its checksummed ASCII `string` hexadecimal\\n * representation, according to EIP-55.\\n */\\n function toChecksumHexString(address addr) internal pure returns (string memory) {\\n bytes memory buffer = bytes(toHexString(addr));\\n\\n // hash the hex part of buffer (skip length + 2 bytes, length 40)\\n uint256 hashValue;\\n assembly (\\\"memory-safe\\\") {\\n hashValue := shr(96, keccak256(add(buffer, 0x22), 40))\\n }\\n\\n for (uint256 i = 41; i > 1; --i) {\\n // possible values for buffer[i] are 48 (0) to 57 (9) and 97 (a) to 102 (f)\\n if (hashValue & 0xf > 7 && uint8(buffer[i]) > 96) {\\n // case shift by xoring with 0x20\\n buffer[i] ^= 0x20;\\n }\\n hashValue >>= 4;\\n }\\n return string(buffer);\\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 bytes(a).length == bytes(b).length && keccak256(bytes(a)) == keccak256(bytes(b));\\n }\\n}\\n\",\"keccak256\":\"0x725209b582291bb83058e3078624b53d15a133f7401c30295e7f3704181d2aed\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/cryptography/ECDSA.sol)\\n\\npragma solidity ^0.8.20;\\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 }\\n\\n /**\\n * @dev The signature derives the `address(0)`.\\n */\\n error ECDSAInvalidSignature();\\n\\n /**\\n * @dev The signature has an invalid length.\\n */\\n error ECDSAInvalidSignatureLength(uint256 length);\\n\\n /**\\n * @dev The signature has an S value that is in the upper half order.\\n */\\n error ECDSAInvalidSignatureS(bytes32 s);\\n\\n /**\\n * @dev Returns the address that signed a hashed message (`hash`) with `signature` or an error. This will not\\n * return address(0) without also returning an error description. Errors are documented using an enum (error type)\\n * and a bytes32 providing additional information about the error.\\n *\\n * If no error is returned, then the address can be used for verification purposes.\\n *\\n * The `ecrecover` EVM precompile 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 {MessageHashUtils-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 function tryRecover(\\n bytes32 hash,\\n bytes memory signature\\n ) internal pure returns (address recovered, RecoverError err, bytes32 errArg) {\\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 assembly (\\\"memory-safe\\\") {\\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, bytes32(signature.length));\\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 precompile 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 {MessageHashUtils-toEthSignedMessageHash} on it.\\n */\\n function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {\\n (address recovered, RecoverError error, bytes32 errorArg) = tryRecover(hash, signature);\\n _throwError(error, errorArg);\\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[ERC-2098 short signatures]\\n */\\n function tryRecover(\\n bytes32 hash,\\n bytes32 r,\\n bytes32 vs\\n ) internal pure returns (address recovered, RecoverError err, bytes32 errArg) {\\n unchecked {\\n bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff);\\n // We do not check for an overflow here since the shift operation results in 0 or 1.\\n uint8 v = uint8((uint256(vs) >> 255) + 27);\\n return tryRecover(hash, v, r, s);\\n }\\n }\\n\\n /**\\n * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately.\\n */\\n function recover(bytes32 hash, bytes32 r, bytes32 vs) internal pure returns (address) {\\n (address recovered, RecoverError error, bytes32 errorArg) = tryRecover(hash, r, vs);\\n _throwError(error, errorArg);\\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 function tryRecover(\\n bytes32 hash,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) internal pure returns (address recovered, RecoverError err, bytes32 errArg) {\\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, s);\\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, bytes32(0));\\n }\\n\\n return (signer, RecoverError.NoError, bytes32(0));\\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, bytes32 errorArg) = tryRecover(hash, v, r, s);\\n _throwError(error, errorArg);\\n return recovered;\\n }\\n\\n /**\\n * @dev Optionally reverts with the corresponding custom error according to the `error` argument provided.\\n */\\n function _throwError(RecoverError error, bytes32 errorArg) private pure {\\n if (error == RecoverError.NoError) {\\n return; // no error: do nothing\\n } else if (error == RecoverError.InvalidSignature) {\\n revert ECDSAInvalidSignature();\\n } else if (error == RecoverError.InvalidSignatureLength) {\\n revert ECDSAInvalidSignatureLength(uint256(errorArg));\\n } else if (error == RecoverError.InvalidSignatureS) {\\n revert ECDSAInvalidSignatureS(errorArg);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x69f54c02b7d81d505910ec198c11ed4c6a728418a868b906b4a0cf29946fda84\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/cryptography/EIP712.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/cryptography/EIP712.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {MessageHashUtils} from \\\"./MessageHashUtils.sol\\\";\\nimport {ShortStrings, ShortString} from \\\"../ShortStrings.sol\\\";\\nimport {IERC5267} from \\\"../../interfaces/IERC5267.sol\\\";\\n\\n/**\\n * @dev https://eips.ethereum.org/EIPS/eip-712[EIP-712] is a standard for hashing and signing of typed structured data.\\n *\\n * The encoding scheme specified in the EIP requires a domain separator and a hash of the typed structured data, whose\\n * encoding is very generic and therefore its implementation in Solidity is not feasible, thus this contract\\n * does not implement the encoding itself. Protocols need to implement the type-specific encoding they need in order to\\n * produce the hash of their typed data using a combination of `abi.encode` and `keccak256`.\\n *\\n * This contract implements the EIP-712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding\\n * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA\\n * ({_hashTypedDataV4}).\\n *\\n * The implementation of the domain separator was designed to be as efficient as possible while still properly updating\\n * the chain id to protect against replay attacks on an eventual fork of the chain.\\n *\\n * NOTE: This contract implements the version of the encoding known as \\\"v4\\\", as implemented by the JSON RPC method\\n * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask].\\n *\\n * NOTE: In the upgradeable version of this contract, the cached values will correspond to the address, and the domain\\n * separator of the implementation contract. This will cause the {_domainSeparatorV4} function to always rebuild the\\n * separator from the immutable values, which is cheaper than accessing a cached version in cold storage.\\n *\\n * @custom:oz-upgrades-unsafe-allow state-variable-immutable\\n */\\nabstract contract EIP712 is IERC5267 {\\n using ShortStrings for *;\\n\\n bytes32 private constant TYPE_HASH =\\n keccak256(\\\"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)\\\");\\n\\n // Cache the domain separator as an immutable value, but also store the chain id that it corresponds to, in order to\\n // invalidate the cached domain separator if the chain id changes.\\n bytes32 private immutable _cachedDomainSeparator;\\n uint256 private immutable _cachedChainId;\\n address private immutable _cachedThis;\\n\\n bytes32 private immutable _hashedName;\\n bytes32 private immutable _hashedVersion;\\n\\n ShortString private immutable _name;\\n ShortString private immutable _version;\\n string private _nameFallback;\\n string private _versionFallback;\\n\\n /**\\n * @dev Initializes the domain separator and parameter caches.\\n *\\n * The meaning of `name` and `version` is specified in\\n * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP-712]:\\n *\\n * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol.\\n * - `version`: the current major version of the signing domain.\\n *\\n * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart\\n * contract upgrade].\\n */\\n constructor(string memory name, string memory version) {\\n _name = name.toShortStringWithFallback(_nameFallback);\\n _version = version.toShortStringWithFallback(_versionFallback);\\n _hashedName = keccak256(bytes(name));\\n _hashedVersion = keccak256(bytes(version));\\n\\n _cachedChainId = block.chainid;\\n _cachedDomainSeparator = _buildDomainSeparator();\\n _cachedThis = address(this);\\n }\\n\\n /**\\n * @dev Returns the domain separator for the current chain.\\n */\\n function _domainSeparatorV4() internal view returns (bytes32) {\\n if (address(this) == _cachedThis && block.chainid == _cachedChainId) {\\n return _cachedDomainSeparator;\\n } else {\\n return _buildDomainSeparator();\\n }\\n }\\n\\n function _buildDomainSeparator() private view returns (bytes32) {\\n return keccak256(abi.encode(TYPE_HASH, _hashedName, _hashedVersion, block.chainid, address(this)));\\n }\\n\\n /**\\n * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this\\n * function returns the hash of the fully encoded EIP712 message for this domain.\\n *\\n * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example:\\n *\\n * ```solidity\\n * bytes32 digest = _hashTypedDataV4(keccak256(abi.encode(\\n * keccak256(\\\"Mail(address to,string contents)\\\"),\\n * mailTo,\\n * keccak256(bytes(mailContents))\\n * )));\\n * address signer = ECDSA.recover(digest, signature);\\n * ```\\n */\\n function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) {\\n return MessageHashUtils.toTypedDataHash(_domainSeparatorV4(), structHash);\\n }\\n\\n /**\\n * @dev See {IERC-5267}.\\n */\\n function eip712Domain()\\n public\\n view\\n virtual\\n returns (\\n bytes1 fields,\\n string memory name,\\n string memory version,\\n uint256 chainId,\\n address verifyingContract,\\n bytes32 salt,\\n uint256[] memory extensions\\n )\\n {\\n return (\\n hex\\\"0f\\\", // 01111\\n _EIP712Name(),\\n _EIP712Version(),\\n block.chainid,\\n address(this),\\n bytes32(0),\\n new uint256[](0)\\n );\\n }\\n\\n /**\\n * @dev The name parameter for the EIP712 domain.\\n *\\n * NOTE: By default this function reads _name which is an immutable value.\\n * It only reads from storage if necessary (in case the value is too large to fit in a ShortString).\\n */\\n // solhint-disable-next-line func-name-mixedcase\\n function _EIP712Name() internal view returns (string memory) {\\n return _name.toStringWithFallback(_nameFallback);\\n }\\n\\n /**\\n * @dev The version parameter for the EIP712 domain.\\n *\\n * NOTE: By default this function reads _version which is an immutable value.\\n * It only reads from storage if necessary (in case the value is too large to fit in a ShortString).\\n */\\n // solhint-disable-next-line func-name-mixedcase\\n function _EIP712Version() internal view returns (string memory) {\\n return _version.toStringWithFallback(_versionFallback);\\n }\\n}\\n\",\"keccak256\":\"0x10eb97d047f8d84fe263a02bb4a656ac6674f6679d74532cc37546289e073a9d\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/cryptography/MessageHashUtils.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/cryptography/MessageHashUtils.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {Strings} from \\\"../Strings.sol\\\";\\n\\n/**\\n * @dev Signature message hash utilities for producing digests to be consumed by {ECDSA} recovery or signing.\\n *\\n * The library provides methods for generating a hash of a message that conforms to the\\n * https://eips.ethereum.org/EIPS/eip-191[ERC-191] and https://eips.ethereum.org/EIPS/eip-712[EIP 712]\\n * specifications.\\n */\\nlibrary MessageHashUtils {\\n /**\\n * @dev Returns the keccak256 digest of an ERC-191 signed data with version\\n * `0x45` (`personal_sign` messages).\\n *\\n * The digest is calculated by prefixing a bytes32 `messageHash` with\\n * `\\\"\\\\x19Ethereum Signed Message:\\\\n32\\\"` and hashing the result. It corresponds with the\\n * hash signed when using the https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] JSON-RPC method.\\n *\\n * NOTE: The `messageHash` parameter is intended to be the result of hashing a raw message with\\n * keccak256, although any bytes32 value can be safely used because the final digest will\\n * be re-hashed.\\n *\\n * See {ECDSA-recover}.\\n */\\n function toEthSignedMessageHash(bytes32 messageHash) internal pure returns (bytes32 digest) {\\n assembly (\\\"memory-safe\\\") {\\n mstore(0x00, \\\"\\\\x19Ethereum Signed Message:\\\\n32\\\") // 32 is the bytes-length of messageHash\\n mstore(0x1c, messageHash) // 0x1c (28) is the length of the prefix\\n digest := keccak256(0x00, 0x3c) // 0x3c is the length of the prefix (0x1c) + messageHash (0x20)\\n }\\n }\\n\\n /**\\n * @dev Returns the keccak256 digest of an ERC-191 signed data with version\\n * `0x45` (`personal_sign` messages).\\n *\\n * The digest is calculated by prefixing an arbitrary `message` with\\n * `\\\"\\\\x19Ethereum Signed Message:\\\\n\\\" + len(message)` and hashing the result. It corresponds with the\\n * hash signed when using the https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] JSON-RPC method.\\n *\\n * See {ECDSA-recover}.\\n */\\n function toEthSignedMessageHash(bytes memory message) internal pure returns (bytes32) {\\n return\\n keccak256(bytes.concat(\\\"\\\\x19Ethereum Signed Message:\\\\n\\\", bytes(Strings.toString(message.length)), message));\\n }\\n\\n /**\\n * @dev Returns the keccak256 digest of an ERC-191 signed data with version\\n * `0x00` (data with intended validator).\\n *\\n * The digest is calculated by prefixing an arbitrary `data` with `\\\"\\\\x19\\\\x00\\\"` and the intended\\n * `validator` address. Then hashing the result.\\n *\\n * See {ECDSA-recover}.\\n */\\n function toDataWithIntendedValidatorHash(address validator, bytes memory data) internal pure returns (bytes32) {\\n return keccak256(abi.encodePacked(hex\\\"19_00\\\", validator, data));\\n }\\n\\n /**\\n * @dev Returns the keccak256 digest of an EIP-712 typed data (ERC-191 version `0x01`).\\n *\\n * The digest is calculated from a `domainSeparator` and a `structHash`, by prefixing them with\\n * `\\\\x19\\\\x01` and hashing the result. It corresponds to the hash signed by the\\n * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`] JSON-RPC method as part of EIP-712.\\n *\\n * See {ECDSA-recover}.\\n */\\n function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32 digest) {\\n assembly (\\\"memory-safe\\\") {\\n let ptr := mload(0x40)\\n mstore(ptr, hex\\\"19_01\\\")\\n mstore(add(ptr, 0x02), domainSeparator)\\n mstore(add(ptr, 0x22), structHash)\\n digest := keccak256(ptr, 0x42)\\n }\\n }\\n}\\n\",\"keccak256\":\"0x4515543bc4c78561f6bea83ecfdfc3dead55bd59858287d682045b11de1ae575\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/introspection/ERC165.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/introspection/ERC165.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {IERC165} from \\\"./IERC165.sol\\\";\\n\\n/**\\n * @dev Implementation of the {IERC165} interface.\\n *\\n * Contracts that want to implement ERC-165 should inherit from this contract and override {supportsInterface} to check\\n * for the additional interface id that will be supported. For example:\\n *\\n * ```solidity\\n * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\\n * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);\\n * }\\n * ```\\n */\\nabstract contract ERC165 is IERC165 {\\n /**\\n * @dev See {IERC165-supportsInterface}.\\n */\\n function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) {\\n return interfaceId == type(IERC165).interfaceId;\\n }\\n}\\n\",\"keccak256\":\"0xddce8e17e3d3f9ed818b4f4c4478a8262aab8b11ed322f1bf5ed705bb4bd97fa\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/introspection/IERC165.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/introspection/IERC165.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Interface of the ERC-165 standard, as defined in the\\n * https://eips.ethereum.org/EIPS/eip-165[ERC].\\n *\\n * Implementers can declare support of contract interfaces, which can then be\\n * queried by others ({ERC165Checker}).\\n *\\n * For an implementation, see {ERC165}.\\n */\\ninterface IERC165 {\\n /**\\n * @dev Returns true if this contract implements the interface defined by\\n * `interfaceId`. See the corresponding\\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[ERC section]\\n * to learn more about how these ids are created.\\n *\\n * This function call must use less than 30 000 gas.\\n */\\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x79796192ec90263f21b464d5bc90b777a525971d3de8232be80d9c4f9fb353b8\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/math/Math.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/math/Math.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {Panic} from \\\"../Panic.sol\\\";\\nimport {SafeCast} from \\\"./SafeCast.sol\\\";\\n\\n/**\\n * @dev Standard math utilities missing in the Solidity language.\\n */\\nlibrary Math {\\n enum Rounding {\\n Floor, // Toward negative infinity\\n Ceil, // Toward positive infinity\\n Trunc, // Toward zero\\n Expand // Away from zero\\n }\\n\\n /**\\n * @dev Returns the addition of two unsigned integers, with an success flag (no overflow).\\n */\\n function tryAdd(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\\n unchecked {\\n uint256 c = a + b;\\n if (c < a) return (false, 0);\\n return (true, c);\\n }\\n }\\n\\n /**\\n * @dev Returns the subtraction of two unsigned integers, with an success flag (no overflow).\\n */\\n function trySub(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\\n unchecked {\\n if (b > a) return (false, 0);\\n return (true, a - b);\\n }\\n }\\n\\n /**\\n * @dev Returns the multiplication of two unsigned integers, with an success flag (no overflow).\\n */\\n function tryMul(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\\n unchecked {\\n // Gas optimization: this is cheaper than requiring 'a' not being zero, but the\\n // benefit is lost if 'b' is also tested.\\n // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522\\n if (a == 0) return (true, 0);\\n uint256 c = a * b;\\n if (c / a != b) return (false, 0);\\n return (true, c);\\n }\\n }\\n\\n /**\\n * @dev Returns the division of two unsigned integers, with a success flag (no division by zero).\\n */\\n function tryDiv(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\\n unchecked {\\n if (b == 0) return (false, 0);\\n return (true, a / b);\\n }\\n }\\n\\n /**\\n * @dev Returns the remainder of dividing two unsigned integers, with a success flag (no division by zero).\\n */\\n function tryMod(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\\n unchecked {\\n if (b == 0) return (false, 0);\\n return (true, a % b);\\n }\\n }\\n\\n /**\\n * @dev Branchless ternary evaluation for `a ? b : c`. Gas costs are constant.\\n *\\n * IMPORTANT: This function may reduce bytecode size and consume less gas when used standalone.\\n * However, the compiler may optimize Solidity ternary operations (i.e. `a ? b : c`) to only compute\\n * one branch when needed, making this function more expensive.\\n */\\n function ternary(bool condition, uint256 a, uint256 b) internal pure returns (uint256) {\\n unchecked {\\n // branchless ternary works because:\\n // b ^ (a ^ b) == a\\n // b ^ 0 == b\\n return b ^ ((a ^ b) * SafeCast.toUint(condition));\\n }\\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 ternary(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 ternary(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 towards infinity instead\\n * of rounding towards zero.\\n */\\n function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {\\n if (b == 0) {\\n // Guarantee the same behavior as in a regular Solidity division.\\n Panic.panic(Panic.DIVISION_BY_ZERO);\\n }\\n\\n // The following calculation ensures accurate ceiling division without overflow.\\n // Since a is non-zero, (a - 1) / b will not overflow.\\n // The largest possible result occurs when (a - 1) / b is type(uint256).max,\\n // but the largest value we can obtain is type(uint256).max - 1, which happens\\n // when a = type(uint256).max and b = 1.\\n unchecked {\\n return SafeCast.toUint(a > 0) * ((a - 1) / b + 1);\\n }\\n }\\n\\n /**\\n * @dev Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or\\n * denominator == 0.\\n *\\n * Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv) with further edits by\\n * 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\\u00b2\\u2075\\u2076 and mod 2\\u00b2\\u2075\\u2076 - 1, then use\\n // the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256\\n // variables such that product = prod1 * 2\\u00b2\\u2075\\u2076 + prod0.\\n uint256 prod0 = x * y; // 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 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\\u00b2\\u2075\\u2076. Also prevents denominator == 0.\\n if (denominator <= prod1) {\\n Panic.panic(ternary(denominator == 0, Panic.DIVISION_BY_ZERO, Panic.UNDER_OVERFLOW));\\n }\\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.\\n // Always >= 1. See https://cs.stackexchange.com/q/138556/92363.\\n\\n uint256 twos = denominator & (0 - denominator);\\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\\u00b2\\u2075\\u2076 / 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\\u00b2\\u2075\\u2076. Now that denominator is an odd number, it has an inverse modulo 2\\u00b2\\u2075\\u2076 such\\n // that denominator * inv \\u2261 1 mod 2\\u00b2\\u2075\\u2076. Compute the inverse by starting with a seed that is correct for\\n // four bits. That is, denominator * inv \\u2261 1 mod 2\\u2074.\\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\\n // works in modular arithmetic, doubling the correct bits in each step.\\n inverse *= 2 - denominator * inverse; // inverse mod 2\\u2078\\n inverse *= 2 - denominator * inverse; // inverse mod 2\\u00b9\\u2076\\n inverse *= 2 - denominator * inverse; // inverse mod 2\\u00b3\\u00b2\\n inverse *= 2 - denominator * inverse; // inverse mod 2\\u2076\\u2074\\n inverse *= 2 - denominator * inverse; // inverse mod 2\\u00b9\\u00b2\\u2078\\n inverse *= 2 - denominator * inverse; // inverse mod 2\\u00b2\\u2075\\u2076\\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\\u00b2\\u2075\\u2076. Since the preconditions guarantee that the outcome is\\n // less than 2\\u00b2\\u2075\\u2076, 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 * @dev 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 return mulDiv(x, y, denominator) + SafeCast.toUint(unsignedRoundsUp(rounding) && mulmod(x, y, denominator) > 0);\\n }\\n\\n /**\\n * @dev Calculate the modular multiplicative inverse of a number in Z/nZ.\\n *\\n * If n is a prime, then Z/nZ is a field. In that case all elements are inversible, except 0.\\n * If n is not a prime, then Z/nZ is not a field, and some elements might not be inversible.\\n *\\n * If the input value is not inversible, 0 is returned.\\n *\\n * NOTE: If you know for sure that n is (big) a prime, it may be cheaper to use Fermat's little theorem and get the\\n * inverse using `Math.modExp(a, n - 2, n)`. See {invModPrime}.\\n */\\n function invMod(uint256 a, uint256 n) internal pure returns (uint256) {\\n unchecked {\\n if (n == 0) return 0;\\n\\n // The inverse modulo is calculated using the Extended Euclidean Algorithm (iterative version)\\n // Used to compute integers x and y such that: ax + ny = gcd(a, n).\\n // When the gcd is 1, then the inverse of a modulo n exists and it's x.\\n // ax + ny = 1\\n // ax = 1 + (-y)n\\n // ax \\u2261 1 (mod n) # x is the inverse of a modulo n\\n\\n // If the remainder is 0 the gcd is n right away.\\n uint256 remainder = a % n;\\n uint256 gcd = n;\\n\\n // Therefore the initial coefficients are:\\n // ax + ny = gcd(a, n) = n\\n // 0a + 1n = n\\n int256 x = 0;\\n int256 y = 1;\\n\\n while (remainder != 0) {\\n uint256 quotient = gcd / remainder;\\n\\n (gcd, remainder) = (\\n // The old remainder is the next gcd to try.\\n remainder,\\n // Compute the next remainder.\\n // Can't overflow given that (a % gcd) * (gcd // (a % gcd)) <= gcd\\n // where gcd is at most n (capped to type(uint256).max)\\n gcd - remainder * quotient\\n );\\n\\n (x, y) = (\\n // Increment the coefficient of a.\\n y,\\n // Decrement the coefficient of n.\\n // Can overflow, but the result is casted to uint256 so that the\\n // next value of y is \\\"wrapped around\\\" to a value between 0 and n - 1.\\n x - y * int256(quotient)\\n );\\n }\\n\\n if (gcd != 1) return 0; // No inverse exists.\\n return ternary(x < 0, n - uint256(-x), uint256(x)); // Wrap the result if it's negative.\\n }\\n }\\n\\n /**\\n * @dev Variant of {invMod}. More efficient, but only works if `p` is known to be a prime greater than `2`.\\n *\\n * From https://en.wikipedia.org/wiki/Fermat%27s_little_theorem[Fermat's little theorem], we know that if p is\\n * prime, then `a**(p-1) \\u2261 1 mod p`. As a consequence, we have `a * a**(p-2) \\u2261 1 mod p`, which means that\\n * `a**(p-2)` is the modular multiplicative inverse of a in Fp.\\n *\\n * NOTE: this function does NOT check that `p` is a prime greater than `2`.\\n */\\n function invModPrime(uint256 a, uint256 p) internal view returns (uint256) {\\n unchecked {\\n return Math.modExp(a, p - 2, p);\\n }\\n }\\n\\n /**\\n * @dev Returns the modular exponentiation of the specified base, exponent and modulus (b ** e % m)\\n *\\n * Requirements:\\n * - modulus can't be zero\\n * - underlying staticcall to precompile must succeed\\n *\\n * IMPORTANT: The result is only valid if the underlying call succeeds. When using this function, make\\n * sure the chain you're using it on supports the precompiled contract for modular exponentiation\\n * at address 0x05 as specified in https://eips.ethereum.org/EIPS/eip-198[EIP-198]. Otherwise,\\n * the underlying function will succeed given the lack of a revert, but the result may be incorrectly\\n * interpreted as 0.\\n */\\n function modExp(uint256 b, uint256 e, uint256 m) internal view returns (uint256) {\\n (bool success, uint256 result) = tryModExp(b, e, m);\\n if (!success) {\\n Panic.panic(Panic.DIVISION_BY_ZERO);\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Returns the modular exponentiation of the specified base, exponent and modulus (b ** e % m).\\n * It includes a success flag indicating if the operation succeeded. Operation will be marked as failed if trying\\n * to operate modulo 0 or if the underlying precompile reverted.\\n *\\n * IMPORTANT: The result is only valid if the success flag is true. When using this function, make sure the chain\\n * you're using it on supports the precompiled contract for modular exponentiation at address 0x05 as specified in\\n * https://eips.ethereum.org/EIPS/eip-198[EIP-198]. Otherwise, the underlying function will succeed given the lack\\n * of a revert, but the result may be incorrectly interpreted as 0.\\n */\\n function tryModExp(uint256 b, uint256 e, uint256 m) internal view returns (bool success, uint256 result) {\\n if (m == 0) return (false, 0);\\n assembly (\\\"memory-safe\\\") {\\n let ptr := mload(0x40)\\n // | Offset | Content | Content (Hex) |\\n // |-----------|------------|--------------------------------------------------------------------|\\n // | 0x00:0x1f | size of b | 0x0000000000000000000000000000000000000000000000000000000000000020 |\\n // | 0x20:0x3f | size of e | 0x0000000000000000000000000000000000000000000000000000000000000020 |\\n // | 0x40:0x5f | size of m | 0x0000000000000000000000000000000000000000000000000000000000000020 |\\n // | 0x60:0x7f | value of b | 0x<.............................................................b> |\\n // | 0x80:0x9f | value of e | 0x<.............................................................e> |\\n // | 0xa0:0xbf | value of m | 0x<.............................................................m> |\\n mstore(ptr, 0x20)\\n mstore(add(ptr, 0x20), 0x20)\\n mstore(add(ptr, 0x40), 0x20)\\n mstore(add(ptr, 0x60), b)\\n mstore(add(ptr, 0x80), e)\\n mstore(add(ptr, 0xa0), m)\\n\\n // Given the result < m, it's guaranteed to fit in 32 bytes,\\n // so we can use the memory scratch space located at offset 0.\\n success := staticcall(gas(), 0x05, ptr, 0xc0, 0x00, 0x20)\\n result := mload(0x00)\\n }\\n }\\n\\n /**\\n * @dev Variant of {modExp} that supports inputs of arbitrary length.\\n */\\n function modExp(bytes memory b, bytes memory e, bytes memory m) internal view returns (bytes memory) {\\n (bool success, bytes memory result) = tryModExp(b, e, m);\\n if (!success) {\\n Panic.panic(Panic.DIVISION_BY_ZERO);\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Variant of {tryModExp} that supports inputs of arbitrary length.\\n */\\n function tryModExp(\\n bytes memory b,\\n bytes memory e,\\n bytes memory m\\n ) internal view returns (bool success, bytes memory result) {\\n if (_zeroBytes(m)) return (false, new bytes(0));\\n\\n uint256 mLen = m.length;\\n\\n // Encode call args in result and move the free memory pointer\\n result = abi.encodePacked(b.length, e.length, mLen, b, e, m);\\n\\n assembly (\\\"memory-safe\\\") {\\n let dataPtr := add(result, 0x20)\\n // Write result on top of args to avoid allocating extra memory.\\n success := staticcall(gas(), 0x05, dataPtr, mload(result), dataPtr, mLen)\\n // Overwrite the length.\\n // result.length > returndatasize() is guaranteed because returndatasize() == m.length\\n mstore(result, mLen)\\n // Set the memory pointer after the returned data.\\n mstore(0x40, add(dataPtr, mLen))\\n }\\n }\\n\\n /**\\n * @dev Returns whether the provided byte array is zero.\\n */\\n function _zeroBytes(bytes memory byteArray) private pure returns (bool) {\\n for (uint256 i = 0; i < byteArray.length; ++i) {\\n if (byteArray[i] != 0) {\\n return false;\\n }\\n }\\n return true;\\n }\\n\\n /**\\n * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded\\n * towards zero.\\n *\\n * This method is based on Newton's method for computing square roots; the algorithm is restricted to only\\n * using integer operations.\\n */\\n function sqrt(uint256 a) internal pure returns (uint256) {\\n unchecked {\\n // Take care of easy edge cases when a == 0 or a == 1\\n if (a <= 1) {\\n return a;\\n }\\n\\n // In this function, we use Newton's method to get a root of `f(x) := x\\u00b2 - a`. It involves building a\\n // sequence x_n that converges toward sqrt(a). For each iteration x_n, we also define the error between\\n // the current value as `\\u03b5_n = | x_n - sqrt(a) |`.\\n //\\n // For our first estimation, we consider `e` the smallest power of 2 which is bigger than the square root\\n // of the target. (i.e. `2**(e-1) \\u2264 sqrt(a) < 2**e`). We know that `e \\u2264 128` because `(2\\u00b9\\u00b2\\u2078)\\u00b2 = 2\\u00b2\\u2075\\u2076` is\\n // bigger than any uint256.\\n //\\n // By noticing that\\n // `2**(e-1) \\u2264 sqrt(a) < 2**e \\u2192 (2**(e-1))\\u00b2 \\u2264 a < (2**e)\\u00b2 \\u2192 2**(2*e-2) \\u2264 a < 2**(2*e)`\\n // we can deduce that `e - 1` is `log2(a) / 2`. We can thus compute `x_n = 2**(e-1)` using a method similar\\n // to the msb function.\\n uint256 aa = a;\\n uint256 xn = 1;\\n\\n if (aa >= (1 << 128)) {\\n aa >>= 128;\\n xn <<= 64;\\n }\\n if (aa >= (1 << 64)) {\\n aa >>= 64;\\n xn <<= 32;\\n }\\n if (aa >= (1 << 32)) {\\n aa >>= 32;\\n xn <<= 16;\\n }\\n if (aa >= (1 << 16)) {\\n aa >>= 16;\\n xn <<= 8;\\n }\\n if (aa >= (1 << 8)) {\\n aa >>= 8;\\n xn <<= 4;\\n }\\n if (aa >= (1 << 4)) {\\n aa >>= 4;\\n xn <<= 2;\\n }\\n if (aa >= (1 << 2)) {\\n xn <<= 1;\\n }\\n\\n // We now have x_n such that `x_n = 2**(e-1) \\u2264 sqrt(a) < 2**e = 2 * x_n`. This implies \\u03b5_n \\u2264 2**(e-1).\\n //\\n // We can refine our estimation by noticing that the middle of that interval minimizes the error.\\n // If we move x_n to equal 2**(e-1) + 2**(e-2), then we reduce the error to \\u03b5_n \\u2264 2**(e-2).\\n // This is going to be our x_0 (and \\u03b5_0)\\n xn = (3 * xn) >> 1; // \\u03b5_0 := | x_0 - sqrt(a) | \\u2264 2**(e-2)\\n\\n // From here, Newton's method give us:\\n // x_{n+1} = (x_n + a / x_n) / 2\\n //\\n // One should note that:\\n // x_{n+1}\\u00b2 - a = ((x_n + a / x_n) / 2)\\u00b2 - a\\n // = ((x_n\\u00b2 + a) / (2 * x_n))\\u00b2 - a\\n // = (x_n\\u2074 + 2 * a * x_n\\u00b2 + a\\u00b2) / (4 * x_n\\u00b2) - a\\n // = (x_n\\u2074 + 2 * a * x_n\\u00b2 + a\\u00b2 - 4 * a * x_n\\u00b2) / (4 * x_n\\u00b2)\\n // = (x_n\\u2074 - 2 * a * x_n\\u00b2 + a\\u00b2) / (4 * x_n\\u00b2)\\n // = (x_n\\u00b2 - a)\\u00b2 / (2 * x_n)\\u00b2\\n // = ((x_n\\u00b2 - a) / (2 * x_n))\\u00b2\\n // \\u2265 0\\n // Which proves that for all n \\u2265 1, sqrt(a) \\u2264 x_n\\n //\\n // This gives us the proof of quadratic convergence of the sequence:\\n // \\u03b5_{n+1} = | x_{n+1} - sqrt(a) |\\n // = | (x_n + a / x_n) / 2 - sqrt(a) |\\n // = | (x_n\\u00b2 + a - 2*x_n*sqrt(a)) / (2 * x_n) |\\n // = | (x_n - sqrt(a))\\u00b2 / (2 * x_n) |\\n // = | \\u03b5_n\\u00b2 / (2 * x_n) |\\n // = \\u03b5_n\\u00b2 / | (2 * x_n) |\\n //\\n // For the first iteration, we have a special case where x_0 is known:\\n // \\u03b5_1 = \\u03b5_0\\u00b2 / | (2 * x_0) |\\n // \\u2264 (2**(e-2))\\u00b2 / (2 * (2**(e-1) + 2**(e-2)))\\n // \\u2264 2**(2*e-4) / (3 * 2**(e-1))\\n // \\u2264 2**(e-3) / 3\\n // \\u2264 2**(e-3-log2(3))\\n // \\u2264 2**(e-4.5)\\n //\\n // For the following iterations, we use the fact that, 2**(e-1) \\u2264 sqrt(a) \\u2264 x_n:\\n // \\u03b5_{n+1} = \\u03b5_n\\u00b2 / | (2 * x_n) |\\n // \\u2264 (2**(e-k))\\u00b2 / (2 * 2**(e-1))\\n // \\u2264 2**(2*e-2*k) / 2**e\\n // \\u2264 2**(e-2*k)\\n xn = (xn + a / xn) >> 1; // \\u03b5_1 := | x_1 - sqrt(a) | \\u2264 2**(e-4.5) -- special case, see above\\n xn = (xn + a / xn) >> 1; // \\u03b5_2 := | x_2 - sqrt(a) | \\u2264 2**(e-9) -- general case with k = 4.5\\n xn = (xn + a / xn) >> 1; // \\u03b5_3 := | x_3 - sqrt(a) | \\u2264 2**(e-18) -- general case with k = 9\\n xn = (xn + a / xn) >> 1; // \\u03b5_4 := | x_4 - sqrt(a) | \\u2264 2**(e-36) -- general case with k = 18\\n xn = (xn + a / xn) >> 1; // \\u03b5_5 := | x_5 - sqrt(a) | \\u2264 2**(e-72) -- general case with k = 36\\n xn = (xn + a / xn) >> 1; // \\u03b5_6 := | x_6 - sqrt(a) | \\u2264 2**(e-144) -- general case with k = 72\\n\\n // Because e \\u2264 128 (as discussed during the first estimation phase), we know have reached a precision\\n // \\u03b5_6 \\u2264 2**(e-144) < 1. Given we're operating on integers, then we can ensure that xn is now either\\n // sqrt(a) or sqrt(a) + 1.\\n return xn - SafeCast.toUint(xn > a / xn);\\n }\\n }\\n\\n /**\\n * @dev 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 + SafeCast.toUint(unsignedRoundsUp(rounding) && result * result < a);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 2 of a positive value rounded towards zero.\\n * Returns 0 if given 0.\\n */\\n function log2(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n uint256 exp;\\n unchecked {\\n exp = 128 * SafeCast.toUint(value > (1 << 128) - 1);\\n value >>= exp;\\n result += exp;\\n\\n exp = 64 * SafeCast.toUint(value > (1 << 64) - 1);\\n value >>= exp;\\n result += exp;\\n\\n exp = 32 * SafeCast.toUint(value > (1 << 32) - 1);\\n value >>= exp;\\n result += exp;\\n\\n exp = 16 * SafeCast.toUint(value > (1 << 16) - 1);\\n value >>= exp;\\n result += exp;\\n\\n exp = 8 * SafeCast.toUint(value > (1 << 8) - 1);\\n value >>= exp;\\n result += exp;\\n\\n exp = 4 * SafeCast.toUint(value > (1 << 4) - 1);\\n value >>= exp;\\n result += exp;\\n\\n exp = 2 * SafeCast.toUint(value > (1 << 2) - 1);\\n value >>= exp;\\n result += exp;\\n\\n result += SafeCast.toUint(value > 1);\\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 + SafeCast.toUint(unsignedRoundsUp(rounding) && 1 << result < value);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 10 of a positive value rounded towards zero.\\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 + SafeCast.toUint(unsignedRoundsUp(rounding) && 10 ** result < value);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 256 of a positive value rounded towards zero.\\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 uint256 isGt;\\n unchecked {\\n isGt = SafeCast.toUint(value > (1 << 128) - 1);\\n value >>= isGt * 128;\\n result += isGt * 16;\\n\\n isGt = SafeCast.toUint(value > (1 << 64) - 1);\\n value >>= isGt * 64;\\n result += isGt * 8;\\n\\n isGt = SafeCast.toUint(value > (1 << 32) - 1);\\n value >>= isGt * 32;\\n result += isGt * 4;\\n\\n isGt = SafeCast.toUint(value > (1 << 16) - 1);\\n value >>= isGt * 16;\\n result += isGt * 2;\\n\\n result += SafeCast.toUint(value > (1 << 8) - 1);\\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 + SafeCast.toUint(unsignedRoundsUp(rounding) && 1 << (result << 3) < value);\\n }\\n }\\n\\n /**\\n * @dev Returns whether a provided rounding mode is considered rounding up for unsigned integers.\\n */\\n function unsignedRoundsUp(Rounding rounding) internal pure returns (bool) {\\n return uint8(rounding) % 2 == 1;\\n }\\n}\\n\",\"keccak256\":\"0xa00be322d7db5786750ce0ac7e2f5b633ac30a5ed5fa1ced1e74acfc19acecea\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/math/SafeCast.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/math/SafeCast.sol)\\n// This file was procedurally generated from scripts/generate/templates/SafeCast.js.\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Wrappers over Solidity's uintXX/intXX/bool casting operators with added overflow\\n * checks.\\n *\\n * Downcasting from uint256/int256 in Solidity does not revert on overflow. This can\\n * easily result in undesired exploitation or bugs, since developers usually\\n * assume that overflows raise errors. `SafeCast` restores this intuition by\\n * reverting the transaction when such an operation overflows.\\n *\\n * Using this library instead of the unchecked operations eliminates an entire\\n * class of bugs, so it's recommended to use it always.\\n */\\nlibrary SafeCast {\\n /**\\n * @dev Value doesn't fit in an uint of `bits` size.\\n */\\n error SafeCastOverflowedUintDowncast(uint8 bits, uint256 value);\\n\\n /**\\n * @dev An int value doesn't fit in an uint of `bits` size.\\n */\\n error SafeCastOverflowedIntToUint(int256 value);\\n\\n /**\\n * @dev Value doesn't fit in an int of `bits` size.\\n */\\n error SafeCastOverflowedIntDowncast(uint8 bits, int256 value);\\n\\n /**\\n * @dev An uint value doesn't fit in an int of `bits` size.\\n */\\n error SafeCastOverflowedUintToInt(uint256 value);\\n\\n /**\\n * @dev Returns the downcasted uint248 from uint256, reverting on\\n * overflow (when the input is greater than largest uint248).\\n *\\n * Counterpart to Solidity's `uint248` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 248 bits\\n */\\n function toUint248(uint256 value) internal pure returns (uint248) {\\n if (value > type(uint248).max) {\\n revert SafeCastOverflowedUintDowncast(248, value);\\n }\\n return uint248(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint240 from uint256, reverting on\\n * overflow (when the input is greater than largest uint240).\\n *\\n * Counterpart to Solidity's `uint240` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 240 bits\\n */\\n function toUint240(uint256 value) internal pure returns (uint240) {\\n if (value > type(uint240).max) {\\n revert SafeCastOverflowedUintDowncast(240, value);\\n }\\n return uint240(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint232 from uint256, reverting on\\n * overflow (when the input is greater than largest uint232).\\n *\\n * Counterpart to Solidity's `uint232` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 232 bits\\n */\\n function toUint232(uint256 value) internal pure returns (uint232) {\\n if (value > type(uint232).max) {\\n revert SafeCastOverflowedUintDowncast(232, value);\\n }\\n return uint232(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint224 from uint256, reverting on\\n * overflow (when the input is greater than largest uint224).\\n *\\n * Counterpart to Solidity's `uint224` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 224 bits\\n */\\n function toUint224(uint256 value) internal pure returns (uint224) {\\n if (value > type(uint224).max) {\\n revert SafeCastOverflowedUintDowncast(224, value);\\n }\\n return uint224(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint216 from uint256, reverting on\\n * overflow (when the input is greater than largest uint216).\\n *\\n * Counterpart to Solidity's `uint216` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 216 bits\\n */\\n function toUint216(uint256 value) internal pure returns (uint216) {\\n if (value > type(uint216).max) {\\n revert SafeCastOverflowedUintDowncast(216, value);\\n }\\n return uint216(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint208 from uint256, reverting on\\n * overflow (when the input is greater than largest uint208).\\n *\\n * Counterpart to Solidity's `uint208` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 208 bits\\n */\\n function toUint208(uint256 value) internal pure returns (uint208) {\\n if (value > type(uint208).max) {\\n revert SafeCastOverflowedUintDowncast(208, value);\\n }\\n return uint208(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint200 from uint256, reverting on\\n * overflow (when the input is greater than largest uint200).\\n *\\n * Counterpart to Solidity's `uint200` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 200 bits\\n */\\n function toUint200(uint256 value) internal pure returns (uint200) {\\n if (value > type(uint200).max) {\\n revert SafeCastOverflowedUintDowncast(200, value);\\n }\\n return uint200(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint192 from uint256, reverting on\\n * overflow (when the input is greater than largest uint192).\\n *\\n * Counterpart to Solidity's `uint192` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 192 bits\\n */\\n function toUint192(uint256 value) internal pure returns (uint192) {\\n if (value > type(uint192).max) {\\n revert SafeCastOverflowedUintDowncast(192, value);\\n }\\n return uint192(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint184 from uint256, reverting on\\n * overflow (when the input is greater than largest uint184).\\n *\\n * Counterpart to Solidity's `uint184` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 184 bits\\n */\\n function toUint184(uint256 value) internal pure returns (uint184) {\\n if (value > type(uint184).max) {\\n revert SafeCastOverflowedUintDowncast(184, value);\\n }\\n return uint184(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint176 from uint256, reverting on\\n * overflow (when the input is greater than largest uint176).\\n *\\n * Counterpart to Solidity's `uint176` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 176 bits\\n */\\n function toUint176(uint256 value) internal pure returns (uint176) {\\n if (value > type(uint176).max) {\\n revert SafeCastOverflowedUintDowncast(176, value);\\n }\\n return uint176(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint168 from uint256, reverting on\\n * overflow (when the input is greater than largest uint168).\\n *\\n * Counterpart to Solidity's `uint168` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 168 bits\\n */\\n function toUint168(uint256 value) internal pure returns (uint168) {\\n if (value > type(uint168).max) {\\n revert SafeCastOverflowedUintDowncast(168, value);\\n }\\n return uint168(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint160 from uint256, reverting on\\n * overflow (when the input is greater than largest uint160).\\n *\\n * Counterpart to Solidity's `uint160` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 160 bits\\n */\\n function toUint160(uint256 value) internal pure returns (uint160) {\\n if (value > type(uint160).max) {\\n revert SafeCastOverflowedUintDowncast(160, value);\\n }\\n return uint160(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint152 from uint256, reverting on\\n * overflow (when the input is greater than largest uint152).\\n *\\n * Counterpart to Solidity's `uint152` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 152 bits\\n */\\n function toUint152(uint256 value) internal pure returns (uint152) {\\n if (value > type(uint152).max) {\\n revert SafeCastOverflowedUintDowncast(152, value);\\n }\\n return uint152(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint144 from uint256, reverting on\\n * overflow (when the input is greater than largest uint144).\\n *\\n * Counterpart to Solidity's `uint144` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 144 bits\\n */\\n function toUint144(uint256 value) internal pure returns (uint144) {\\n if (value > type(uint144).max) {\\n revert SafeCastOverflowedUintDowncast(144, value);\\n }\\n return uint144(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint136 from uint256, reverting on\\n * overflow (when the input is greater than largest uint136).\\n *\\n * Counterpart to Solidity's `uint136` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 136 bits\\n */\\n function toUint136(uint256 value) internal pure returns (uint136) {\\n if (value > type(uint136).max) {\\n revert SafeCastOverflowedUintDowncast(136, value);\\n }\\n return uint136(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint128 from uint256, reverting on\\n * overflow (when the input is greater than largest uint128).\\n *\\n * Counterpart to Solidity's `uint128` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 128 bits\\n */\\n function toUint128(uint256 value) internal pure returns (uint128) {\\n if (value > type(uint128).max) {\\n revert SafeCastOverflowedUintDowncast(128, value);\\n }\\n return uint128(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint120 from uint256, reverting on\\n * overflow (when the input is greater than largest uint120).\\n *\\n * Counterpart to Solidity's `uint120` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 120 bits\\n */\\n function toUint120(uint256 value) internal pure returns (uint120) {\\n if (value > type(uint120).max) {\\n revert SafeCastOverflowedUintDowncast(120, value);\\n }\\n return uint120(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint112 from uint256, reverting on\\n * overflow (when the input is greater than largest uint112).\\n *\\n * Counterpart to Solidity's `uint112` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 112 bits\\n */\\n function toUint112(uint256 value) internal pure returns (uint112) {\\n if (value > type(uint112).max) {\\n revert SafeCastOverflowedUintDowncast(112, value);\\n }\\n return uint112(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint104 from uint256, reverting on\\n * overflow (when the input is greater than largest uint104).\\n *\\n * Counterpart to Solidity's `uint104` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 104 bits\\n */\\n function toUint104(uint256 value) internal pure returns (uint104) {\\n if (value > type(uint104).max) {\\n revert SafeCastOverflowedUintDowncast(104, value);\\n }\\n return uint104(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint96 from uint256, reverting on\\n * overflow (when the input is greater than largest uint96).\\n *\\n * Counterpart to Solidity's `uint96` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 96 bits\\n */\\n function toUint96(uint256 value) internal pure returns (uint96) {\\n if (value > type(uint96).max) {\\n revert SafeCastOverflowedUintDowncast(96, value);\\n }\\n return uint96(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint88 from uint256, reverting on\\n * overflow (when the input is greater than largest uint88).\\n *\\n * Counterpart to Solidity's `uint88` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 88 bits\\n */\\n function toUint88(uint256 value) internal pure returns (uint88) {\\n if (value > type(uint88).max) {\\n revert SafeCastOverflowedUintDowncast(88, value);\\n }\\n return uint88(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint80 from uint256, reverting on\\n * overflow (when the input is greater than largest uint80).\\n *\\n * Counterpart to Solidity's `uint80` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 80 bits\\n */\\n function toUint80(uint256 value) internal pure returns (uint80) {\\n if (value > type(uint80).max) {\\n revert SafeCastOverflowedUintDowncast(80, value);\\n }\\n return uint80(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint72 from uint256, reverting on\\n * overflow (when the input is greater than largest uint72).\\n *\\n * Counterpart to Solidity's `uint72` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 72 bits\\n */\\n function toUint72(uint256 value) internal pure returns (uint72) {\\n if (value > type(uint72).max) {\\n revert SafeCastOverflowedUintDowncast(72, value);\\n }\\n return uint72(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint64 from uint256, reverting on\\n * overflow (when the input is greater than largest uint64).\\n *\\n * Counterpart to Solidity's `uint64` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 64 bits\\n */\\n function toUint64(uint256 value) internal pure returns (uint64) {\\n if (value > type(uint64).max) {\\n revert SafeCastOverflowedUintDowncast(64, value);\\n }\\n return uint64(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint56 from uint256, reverting on\\n * overflow (when the input is greater than largest uint56).\\n *\\n * Counterpart to Solidity's `uint56` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 56 bits\\n */\\n function toUint56(uint256 value) internal pure returns (uint56) {\\n if (value > type(uint56).max) {\\n revert SafeCastOverflowedUintDowncast(56, value);\\n }\\n return uint56(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint48 from uint256, reverting on\\n * overflow (when the input is greater than largest uint48).\\n *\\n * Counterpart to Solidity's `uint48` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 48 bits\\n */\\n function toUint48(uint256 value) internal pure returns (uint48) {\\n if (value > type(uint48).max) {\\n revert SafeCastOverflowedUintDowncast(48, value);\\n }\\n return uint48(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint40 from uint256, reverting on\\n * overflow (when the input is greater than largest uint40).\\n *\\n * Counterpart to Solidity's `uint40` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 40 bits\\n */\\n function toUint40(uint256 value) internal pure returns (uint40) {\\n if (value > type(uint40).max) {\\n revert SafeCastOverflowedUintDowncast(40, value);\\n }\\n return uint40(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint32 from uint256, reverting on\\n * overflow (when the input is greater than largest uint32).\\n *\\n * Counterpart to Solidity's `uint32` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 32 bits\\n */\\n function toUint32(uint256 value) internal pure returns (uint32) {\\n if (value > type(uint32).max) {\\n revert SafeCastOverflowedUintDowncast(32, value);\\n }\\n return uint32(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint24 from uint256, reverting on\\n * overflow (when the input is greater than largest uint24).\\n *\\n * Counterpart to Solidity's `uint24` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 24 bits\\n */\\n function toUint24(uint256 value) internal pure returns (uint24) {\\n if (value > type(uint24).max) {\\n revert SafeCastOverflowedUintDowncast(24, value);\\n }\\n return uint24(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint16 from uint256, reverting on\\n * overflow (when the input is greater than largest uint16).\\n *\\n * Counterpart to Solidity's `uint16` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 16 bits\\n */\\n function toUint16(uint256 value) internal pure returns (uint16) {\\n if (value > type(uint16).max) {\\n revert SafeCastOverflowedUintDowncast(16, value);\\n }\\n return uint16(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint8 from uint256, reverting on\\n * overflow (when the input is greater than largest uint8).\\n *\\n * Counterpart to Solidity's `uint8` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 8 bits\\n */\\n function toUint8(uint256 value) internal pure returns (uint8) {\\n if (value > type(uint8).max) {\\n revert SafeCastOverflowedUintDowncast(8, value);\\n }\\n return uint8(value);\\n }\\n\\n /**\\n * @dev Converts a signed int256 into an unsigned uint256.\\n *\\n * Requirements:\\n *\\n * - input must be greater than or equal to 0.\\n */\\n function toUint256(int256 value) internal pure returns (uint256) {\\n if (value < 0) {\\n revert SafeCastOverflowedIntToUint(value);\\n }\\n return uint256(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted int248 from int256, reverting on\\n * overflow (when the input is less than smallest int248 or\\n * greater than largest int248).\\n *\\n * Counterpart to Solidity's `int248` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 248 bits\\n */\\n function toInt248(int256 value) internal pure returns (int248 downcasted) {\\n downcasted = int248(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(248, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int240 from int256, reverting on\\n * overflow (when the input is less than smallest int240 or\\n * greater than largest int240).\\n *\\n * Counterpart to Solidity's `int240` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 240 bits\\n */\\n function toInt240(int256 value) internal pure returns (int240 downcasted) {\\n downcasted = int240(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(240, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int232 from int256, reverting on\\n * overflow (when the input is less than smallest int232 or\\n * greater than largest int232).\\n *\\n * Counterpart to Solidity's `int232` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 232 bits\\n */\\n function toInt232(int256 value) internal pure returns (int232 downcasted) {\\n downcasted = int232(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(232, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int224 from int256, reverting on\\n * overflow (when the input is less than smallest int224 or\\n * greater than largest int224).\\n *\\n * Counterpart to Solidity's `int224` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 224 bits\\n */\\n function toInt224(int256 value) internal pure returns (int224 downcasted) {\\n downcasted = int224(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(224, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int216 from int256, reverting on\\n * overflow (when the input is less than smallest int216 or\\n * greater than largest int216).\\n *\\n * Counterpart to Solidity's `int216` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 216 bits\\n */\\n function toInt216(int256 value) internal pure returns (int216 downcasted) {\\n downcasted = int216(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(216, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int208 from int256, reverting on\\n * overflow (when the input is less than smallest int208 or\\n * greater than largest int208).\\n *\\n * Counterpart to Solidity's `int208` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 208 bits\\n */\\n function toInt208(int256 value) internal pure returns (int208 downcasted) {\\n downcasted = int208(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(208, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int200 from int256, reverting on\\n * overflow (when the input is less than smallest int200 or\\n * greater than largest int200).\\n *\\n * Counterpart to Solidity's `int200` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 200 bits\\n */\\n function toInt200(int256 value) internal pure returns (int200 downcasted) {\\n downcasted = int200(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(200, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int192 from int256, reverting on\\n * overflow (when the input is less than smallest int192 or\\n * greater than largest int192).\\n *\\n * Counterpart to Solidity's `int192` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 192 bits\\n */\\n function toInt192(int256 value) internal pure returns (int192 downcasted) {\\n downcasted = int192(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(192, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int184 from int256, reverting on\\n * overflow (when the input is less than smallest int184 or\\n * greater than largest int184).\\n *\\n * Counterpart to Solidity's `int184` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 184 bits\\n */\\n function toInt184(int256 value) internal pure returns (int184 downcasted) {\\n downcasted = int184(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(184, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int176 from int256, reverting on\\n * overflow (when the input is less than smallest int176 or\\n * greater than largest int176).\\n *\\n * Counterpart to Solidity's `int176` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 176 bits\\n */\\n function toInt176(int256 value) internal pure returns (int176 downcasted) {\\n downcasted = int176(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(176, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int168 from int256, reverting on\\n * overflow (when the input is less than smallest int168 or\\n * greater than largest int168).\\n *\\n * Counterpart to Solidity's `int168` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 168 bits\\n */\\n function toInt168(int256 value) internal pure returns (int168 downcasted) {\\n downcasted = int168(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(168, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int160 from int256, reverting on\\n * overflow (when the input is less than smallest int160 or\\n * greater than largest int160).\\n *\\n * Counterpart to Solidity's `int160` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 160 bits\\n */\\n function toInt160(int256 value) internal pure returns (int160 downcasted) {\\n downcasted = int160(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(160, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int152 from int256, reverting on\\n * overflow (when the input is less than smallest int152 or\\n * greater than largest int152).\\n *\\n * Counterpart to Solidity's `int152` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 152 bits\\n */\\n function toInt152(int256 value) internal pure returns (int152 downcasted) {\\n downcasted = int152(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(152, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int144 from int256, reverting on\\n * overflow (when the input is less than smallest int144 or\\n * greater than largest int144).\\n *\\n * Counterpart to Solidity's `int144` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 144 bits\\n */\\n function toInt144(int256 value) internal pure returns (int144 downcasted) {\\n downcasted = int144(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(144, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int136 from int256, reverting on\\n * overflow (when the input is less than smallest int136 or\\n * greater than largest int136).\\n *\\n * Counterpart to Solidity's `int136` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 136 bits\\n */\\n function toInt136(int256 value) internal pure returns (int136 downcasted) {\\n downcasted = int136(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(136, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int128 from int256, reverting on\\n * overflow (when the input is less than smallest int128 or\\n * greater than largest int128).\\n *\\n * Counterpart to Solidity's `int128` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 128 bits\\n */\\n function toInt128(int256 value) internal pure returns (int128 downcasted) {\\n downcasted = int128(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(128, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int120 from int256, reverting on\\n * overflow (when the input is less than smallest int120 or\\n * greater than largest int120).\\n *\\n * Counterpart to Solidity's `int120` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 120 bits\\n */\\n function toInt120(int256 value) internal pure returns (int120 downcasted) {\\n downcasted = int120(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(120, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int112 from int256, reverting on\\n * overflow (when the input is less than smallest int112 or\\n * greater than largest int112).\\n *\\n * Counterpart to Solidity's `int112` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 112 bits\\n */\\n function toInt112(int256 value) internal pure returns (int112 downcasted) {\\n downcasted = int112(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(112, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int104 from int256, reverting on\\n * overflow (when the input is less than smallest int104 or\\n * greater than largest int104).\\n *\\n * Counterpart to Solidity's `int104` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 104 bits\\n */\\n function toInt104(int256 value) internal pure returns (int104 downcasted) {\\n downcasted = int104(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(104, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int96 from int256, reverting on\\n * overflow (when the input is less than smallest int96 or\\n * greater than largest int96).\\n *\\n * Counterpart to Solidity's `int96` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 96 bits\\n */\\n function toInt96(int256 value) internal pure returns (int96 downcasted) {\\n downcasted = int96(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(96, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int88 from int256, reverting on\\n * overflow (when the input is less than smallest int88 or\\n * greater than largest int88).\\n *\\n * Counterpart to Solidity's `int88` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 88 bits\\n */\\n function toInt88(int256 value) internal pure returns (int88 downcasted) {\\n downcasted = int88(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(88, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int80 from int256, reverting on\\n * overflow (when the input is less than smallest int80 or\\n * greater than largest int80).\\n *\\n * Counterpart to Solidity's `int80` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 80 bits\\n */\\n function toInt80(int256 value) internal pure returns (int80 downcasted) {\\n downcasted = int80(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(80, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int72 from int256, reverting on\\n * overflow (when the input is less than smallest int72 or\\n * greater than largest int72).\\n *\\n * Counterpart to Solidity's `int72` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 72 bits\\n */\\n function toInt72(int256 value) internal pure returns (int72 downcasted) {\\n downcasted = int72(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(72, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int64 from int256, reverting on\\n * overflow (when the input is less than smallest int64 or\\n * greater than largest int64).\\n *\\n * Counterpart to Solidity's `int64` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 64 bits\\n */\\n function toInt64(int256 value) internal pure returns (int64 downcasted) {\\n downcasted = int64(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(64, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int56 from int256, reverting on\\n * overflow (when the input is less than smallest int56 or\\n * greater than largest int56).\\n *\\n * Counterpart to Solidity's `int56` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 56 bits\\n */\\n function toInt56(int256 value) internal pure returns (int56 downcasted) {\\n downcasted = int56(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(56, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int48 from int256, reverting on\\n * overflow (when the input is less than smallest int48 or\\n * greater than largest int48).\\n *\\n * Counterpart to Solidity's `int48` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 48 bits\\n */\\n function toInt48(int256 value) internal pure returns (int48 downcasted) {\\n downcasted = int48(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(48, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int40 from int256, reverting on\\n * overflow (when the input is less than smallest int40 or\\n * greater than largest int40).\\n *\\n * Counterpart to Solidity's `int40` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 40 bits\\n */\\n function toInt40(int256 value) internal pure returns (int40 downcasted) {\\n downcasted = int40(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(40, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int32 from int256, reverting on\\n * overflow (when the input is less than smallest int32 or\\n * greater than largest int32).\\n *\\n * Counterpart to Solidity's `int32` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 32 bits\\n */\\n function toInt32(int256 value) internal pure returns (int32 downcasted) {\\n downcasted = int32(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(32, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int24 from int256, reverting on\\n * overflow (when the input is less than smallest int24 or\\n * greater than largest int24).\\n *\\n * Counterpart to Solidity's `int24` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 24 bits\\n */\\n function toInt24(int256 value) internal pure returns (int24 downcasted) {\\n downcasted = int24(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(24, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int16 from int256, reverting on\\n * overflow (when the input is less than smallest int16 or\\n * greater than largest int16).\\n *\\n * Counterpart to Solidity's `int16` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 16 bits\\n */\\n function toInt16(int256 value) internal pure returns (int16 downcasted) {\\n downcasted = int16(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(16, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int8 from int256, reverting on\\n * overflow (when the input is less than smallest int8 or\\n * greater than largest int8).\\n *\\n * Counterpart to Solidity's `int8` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 8 bits\\n */\\n function toInt8(int256 value) internal pure returns (int8 downcasted) {\\n downcasted = int8(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(8, value);\\n }\\n }\\n\\n /**\\n * @dev Converts an unsigned uint256 into a signed int256.\\n *\\n * Requirements:\\n *\\n * - input must be less than or equal to maxInt256.\\n */\\n function toInt256(uint256 value) internal pure returns (int256) {\\n // Note: Unsafe cast below is okay because `type(int256).max` is guaranteed to be positive\\n if (value > uint256(type(int256).max)) {\\n revert SafeCastOverflowedUintToInt(value);\\n }\\n return int256(value);\\n }\\n\\n /**\\n * @dev Cast a boolean (false or true) to a uint256 (0 or 1) with no jump.\\n */\\n function toUint(bool b) internal pure returns (uint256 u) {\\n assembly (\\\"memory-safe\\\") {\\n u := iszero(iszero(b))\\n }\\n }\\n}\\n\",\"keccak256\":\"0x195533c86d0ef72bcc06456a4f66a9b941f38eb403739b00f21fd7c1abd1ae54\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/math/SignedMath.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/math/SignedMath.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {SafeCast} from \\\"./SafeCast.sol\\\";\\n\\n/**\\n * @dev Standard signed math utilities missing in the Solidity language.\\n */\\nlibrary SignedMath {\\n /**\\n * @dev Branchless ternary evaluation for `a ? b : c`. Gas costs are constant.\\n *\\n * IMPORTANT: This function may reduce bytecode size and consume less gas when used standalone.\\n * However, the compiler may optimize Solidity ternary operations (i.e. `a ? b : c`) to only compute\\n * one branch when needed, making this function more expensive.\\n */\\n function ternary(bool condition, int256 a, int256 b) internal pure returns (int256) {\\n unchecked {\\n // branchless ternary works because:\\n // b ^ (a ^ b) == a\\n // b ^ 0 == b\\n return b ^ ((a ^ b) * int256(SafeCast.toUint(condition)));\\n }\\n }\\n\\n /**\\n * @dev Returns the largest of two signed numbers.\\n */\\n function max(int256 a, int256 b) internal pure returns (int256) {\\n return ternary(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 ternary(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 // Formula from the \\\"Bit Twiddling Hacks\\\" by Sean Eron Anderson.\\n // Since `n` is a signed integer, the generated bytecode will use the SAR opcode to perform the right shift,\\n // taking advantage of the most significant (or \\\"sign\\\" bit) in two's complement representation.\\n // This opcode adds new most significant bits set to the value of the previous most significant bit. As a result,\\n // the mask will either be `bytes32(0)` (if n is positive) or `~bytes32(0)` (if n is negative).\\n int256 mask = n >> 255;\\n\\n // A `bytes32(0)` mask leaves the input unchanged, while a `~bytes32(0)` mask complements it.\\n return uint256((n + mask) ^ mask);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xb1970fac7b64e6c09611e6691791e848d5e3fe410fa5899e7df2e0afd77a99e3\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/structs/Checkpoints.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/structs/Checkpoints.sol)\\n// This file was procedurally generated from scripts/generate/templates/Checkpoints.js.\\n\\npragma solidity ^0.8.20;\\n\\nimport {Math} from \\\"../math/Math.sol\\\";\\n\\n/**\\n * @dev This library defines the `Trace*` struct, for checkpointing values as they change at different points in\\n * time, and later looking up past values by block number. See {Votes} as an example.\\n *\\n * To create a history of checkpoints define a variable type `Checkpoints.Trace*` in your contract, and store a new\\n * checkpoint for the current transaction block using the {push} function.\\n */\\nlibrary Checkpoints {\\n /**\\n * @dev A value was attempted to be inserted on a past checkpoint.\\n */\\n error CheckpointUnorderedInsertion();\\n\\n struct Trace224 {\\n Checkpoint224[] _checkpoints;\\n }\\n\\n struct Checkpoint224 {\\n uint32 _key;\\n uint224 _value;\\n }\\n\\n /**\\n * @dev Pushes a (`key`, `value`) pair into a Trace224 so that it is stored as the checkpoint.\\n *\\n * Returns previous value and new value.\\n *\\n * IMPORTANT: Never accept `key` as a user input, since an arbitrary `type(uint32).max` key set will disable the\\n * library.\\n */\\n function push(\\n Trace224 storage self,\\n uint32 key,\\n uint224 value\\n ) internal returns (uint224 oldValue, uint224 newValue) {\\n return _insert(self._checkpoints, key, value);\\n }\\n\\n /**\\n * @dev Returns the value in the first (oldest) checkpoint with key greater or equal than the search key, or zero if\\n * there is none.\\n */\\n function lowerLookup(Trace224 storage self, uint32 key) internal view returns (uint224) {\\n uint256 len = self._checkpoints.length;\\n uint256 pos = _lowerBinaryLookup(self._checkpoints, key, 0, len);\\n return pos == len ? 0 : _unsafeAccess(self._checkpoints, pos)._value;\\n }\\n\\n /**\\n * @dev Returns the value in the last (most recent) checkpoint with key lower or equal than the search key, or zero\\n * if there is none.\\n */\\n function upperLookup(Trace224 storage self, uint32 key) internal view returns (uint224) {\\n uint256 len = self._checkpoints.length;\\n uint256 pos = _upperBinaryLookup(self._checkpoints, key, 0, len);\\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\\n }\\n\\n /**\\n * @dev Returns the value in the last (most recent) checkpoint with key lower or equal than the search key, or zero\\n * if there is none.\\n *\\n * NOTE: This is a variant of {upperLookup} that is optimised to find \\\"recent\\\" checkpoint (checkpoints with high\\n * keys).\\n */\\n function upperLookupRecent(Trace224 storage self, uint32 key) internal view returns (uint224) {\\n uint256 len = self._checkpoints.length;\\n\\n uint256 low = 0;\\n uint256 high = len;\\n\\n if (len > 5) {\\n uint256 mid = len - Math.sqrt(len);\\n if (key < _unsafeAccess(self._checkpoints, mid)._key) {\\n high = mid;\\n } else {\\n low = mid + 1;\\n }\\n }\\n\\n uint256 pos = _upperBinaryLookup(self._checkpoints, key, low, high);\\n\\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\\n }\\n\\n /**\\n * @dev Returns the value in the most recent checkpoint, or zero if there are no checkpoints.\\n */\\n function latest(Trace224 storage self) internal view returns (uint224) {\\n uint256 pos = self._checkpoints.length;\\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\\n }\\n\\n /**\\n * @dev Returns whether there is a checkpoint in the structure (i.e. it is not empty), and if so the key and value\\n * in the most recent checkpoint.\\n */\\n function latestCheckpoint(Trace224 storage self) internal view returns (bool exists, uint32 _key, uint224 _value) {\\n uint256 pos = self._checkpoints.length;\\n if (pos == 0) {\\n return (false, 0, 0);\\n } else {\\n Checkpoint224 storage ckpt = _unsafeAccess(self._checkpoints, pos - 1);\\n return (true, ckpt._key, ckpt._value);\\n }\\n }\\n\\n /**\\n * @dev Returns the number of checkpoint.\\n */\\n function length(Trace224 storage self) internal view returns (uint256) {\\n return self._checkpoints.length;\\n }\\n\\n /**\\n * @dev Returns checkpoint at given position.\\n */\\n function at(Trace224 storage self, uint32 pos) internal view returns (Checkpoint224 memory) {\\n return self._checkpoints[pos];\\n }\\n\\n /**\\n * @dev Pushes a (`key`, `value`) pair into an ordered list of checkpoints, either by inserting a new checkpoint,\\n * or by updating the last one.\\n */\\n function _insert(\\n Checkpoint224[] storage self,\\n uint32 key,\\n uint224 value\\n ) private returns (uint224 oldValue, uint224 newValue) {\\n uint256 pos = self.length;\\n\\n if (pos > 0) {\\n Checkpoint224 storage last = _unsafeAccess(self, pos - 1);\\n uint32 lastKey = last._key;\\n uint224 lastValue = last._value;\\n\\n // Checkpoint keys must be non-decreasing.\\n if (lastKey > key) {\\n revert CheckpointUnorderedInsertion();\\n }\\n\\n // Update or push new checkpoint\\n if (lastKey == key) {\\n last._value = value;\\n } else {\\n self.push(Checkpoint224({_key: key, _value: value}));\\n }\\n return (lastValue, value);\\n } else {\\n self.push(Checkpoint224({_key: key, _value: value}));\\n return (0, value);\\n }\\n }\\n\\n /**\\n * @dev Return the index of the first (oldest) checkpoint with key strictly bigger than the search key, or `high`\\n * if there is none. `low` and `high` define a section where to do the search, with inclusive `low` and exclusive\\n * `high`.\\n *\\n * WARNING: `high` should not be greater than the array's length.\\n */\\n function _upperBinaryLookup(\\n Checkpoint224[] storage self,\\n uint32 key,\\n uint256 low,\\n uint256 high\\n ) private view returns (uint256) {\\n while (low < high) {\\n uint256 mid = Math.average(low, high);\\n if (_unsafeAccess(self, mid)._key > key) {\\n high = mid;\\n } else {\\n low = mid + 1;\\n }\\n }\\n return high;\\n }\\n\\n /**\\n * @dev Return the index of the first (oldest) checkpoint with key greater or equal than the search key, or `high`\\n * if there is none. `low` and `high` define a section where to do the search, with inclusive `low` and exclusive\\n * `high`.\\n *\\n * WARNING: `high` should not be greater than the array's length.\\n */\\n function _lowerBinaryLookup(\\n Checkpoint224[] storage self,\\n uint32 key,\\n uint256 low,\\n uint256 high\\n ) private view returns (uint256) {\\n while (low < high) {\\n uint256 mid = Math.average(low, high);\\n if (_unsafeAccess(self, mid)._key < key) {\\n low = mid + 1;\\n } else {\\n high = mid;\\n }\\n }\\n return high;\\n }\\n\\n /**\\n * @dev Access an element of the array without performing bounds check. The position is assumed to be within bounds.\\n */\\n function _unsafeAccess(\\n Checkpoint224[] storage self,\\n uint256 pos\\n ) private pure returns (Checkpoint224 storage result) {\\n assembly {\\n mstore(0, self.slot)\\n result.slot := add(keccak256(0, 0x20), pos)\\n }\\n }\\n\\n struct Trace208 {\\n Checkpoint208[] _checkpoints;\\n }\\n\\n struct Checkpoint208 {\\n uint48 _key;\\n uint208 _value;\\n }\\n\\n /**\\n * @dev Pushes a (`key`, `value`) pair into a Trace208 so that it is stored as the checkpoint.\\n *\\n * Returns previous value and new value.\\n *\\n * IMPORTANT: Never accept `key` as a user input, since an arbitrary `type(uint48).max` key set will disable the\\n * library.\\n */\\n function push(\\n Trace208 storage self,\\n uint48 key,\\n uint208 value\\n ) internal returns (uint208 oldValue, uint208 newValue) {\\n return _insert(self._checkpoints, key, value);\\n }\\n\\n /**\\n * @dev Returns the value in the first (oldest) checkpoint with key greater or equal than the search key, or zero if\\n * there is none.\\n */\\n function lowerLookup(Trace208 storage self, uint48 key) internal view returns (uint208) {\\n uint256 len = self._checkpoints.length;\\n uint256 pos = _lowerBinaryLookup(self._checkpoints, key, 0, len);\\n return pos == len ? 0 : _unsafeAccess(self._checkpoints, pos)._value;\\n }\\n\\n /**\\n * @dev Returns the value in the last (most recent) checkpoint with key lower or equal than the search key, or zero\\n * if there is none.\\n */\\n function upperLookup(Trace208 storage self, uint48 key) internal view returns (uint208) {\\n uint256 len = self._checkpoints.length;\\n uint256 pos = _upperBinaryLookup(self._checkpoints, key, 0, len);\\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\\n }\\n\\n /**\\n * @dev Returns the value in the last (most recent) checkpoint with key lower or equal than the search key, or zero\\n * if there is none.\\n *\\n * NOTE: This is a variant of {upperLookup} that is optimised to find \\\"recent\\\" checkpoint (checkpoints with high\\n * keys).\\n */\\n function upperLookupRecent(Trace208 storage self, uint48 key) internal view returns (uint208) {\\n uint256 len = self._checkpoints.length;\\n\\n uint256 low = 0;\\n uint256 high = len;\\n\\n if (len > 5) {\\n uint256 mid = len - Math.sqrt(len);\\n if (key < _unsafeAccess(self._checkpoints, mid)._key) {\\n high = mid;\\n } else {\\n low = mid + 1;\\n }\\n }\\n\\n uint256 pos = _upperBinaryLookup(self._checkpoints, key, low, high);\\n\\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\\n }\\n\\n /**\\n * @dev Returns the value in the most recent checkpoint, or zero if there are no checkpoints.\\n */\\n function latest(Trace208 storage self) internal view returns (uint208) {\\n uint256 pos = self._checkpoints.length;\\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\\n }\\n\\n /**\\n * @dev Returns whether there is a checkpoint in the structure (i.e. it is not empty), and if so the key and value\\n * in the most recent checkpoint.\\n */\\n function latestCheckpoint(Trace208 storage self) internal view returns (bool exists, uint48 _key, uint208 _value) {\\n uint256 pos = self._checkpoints.length;\\n if (pos == 0) {\\n return (false, 0, 0);\\n } else {\\n Checkpoint208 storage ckpt = _unsafeAccess(self._checkpoints, pos - 1);\\n return (true, ckpt._key, ckpt._value);\\n }\\n }\\n\\n /**\\n * @dev Returns the number of checkpoint.\\n */\\n function length(Trace208 storage self) internal view returns (uint256) {\\n return self._checkpoints.length;\\n }\\n\\n /**\\n * @dev Returns checkpoint at given position.\\n */\\n function at(Trace208 storage self, uint32 pos) internal view returns (Checkpoint208 memory) {\\n return self._checkpoints[pos];\\n }\\n\\n /**\\n * @dev Pushes a (`key`, `value`) pair into an ordered list of checkpoints, either by inserting a new checkpoint,\\n * or by updating the last one.\\n */\\n function _insert(\\n Checkpoint208[] storage self,\\n uint48 key,\\n uint208 value\\n ) private returns (uint208 oldValue, uint208 newValue) {\\n uint256 pos = self.length;\\n\\n if (pos > 0) {\\n Checkpoint208 storage last = _unsafeAccess(self, pos - 1);\\n uint48 lastKey = last._key;\\n uint208 lastValue = last._value;\\n\\n // Checkpoint keys must be non-decreasing.\\n if (lastKey > key) {\\n revert CheckpointUnorderedInsertion();\\n }\\n\\n // Update or push new checkpoint\\n if (lastKey == key) {\\n last._value = value;\\n } else {\\n self.push(Checkpoint208({_key: key, _value: value}));\\n }\\n return (lastValue, value);\\n } else {\\n self.push(Checkpoint208({_key: key, _value: value}));\\n return (0, value);\\n }\\n }\\n\\n /**\\n * @dev Return the index of the first (oldest) checkpoint with key strictly bigger than the search key, or `high`\\n * if there is none. `low` and `high` define a section where to do the search, with inclusive `low` and exclusive\\n * `high`.\\n *\\n * WARNING: `high` should not be greater than the array's length.\\n */\\n function _upperBinaryLookup(\\n Checkpoint208[] storage self,\\n uint48 key,\\n uint256 low,\\n uint256 high\\n ) private view returns (uint256) {\\n while (low < high) {\\n uint256 mid = Math.average(low, high);\\n if (_unsafeAccess(self, mid)._key > key) {\\n high = mid;\\n } else {\\n low = mid + 1;\\n }\\n }\\n return high;\\n }\\n\\n /**\\n * @dev Return the index of the first (oldest) checkpoint with key greater or equal than the search key, or `high`\\n * if there is none. `low` and `high` define a section where to do the search, with inclusive `low` and exclusive\\n * `high`.\\n *\\n * WARNING: `high` should not be greater than the array's length.\\n */\\n function _lowerBinaryLookup(\\n Checkpoint208[] storage self,\\n uint48 key,\\n uint256 low,\\n uint256 high\\n ) private view returns (uint256) {\\n while (low < high) {\\n uint256 mid = Math.average(low, high);\\n if (_unsafeAccess(self, mid)._key < key) {\\n low = mid + 1;\\n } else {\\n high = mid;\\n }\\n }\\n return high;\\n }\\n\\n /**\\n * @dev Access an element of the array without performing bounds check. The position is assumed to be within bounds.\\n */\\n function _unsafeAccess(\\n Checkpoint208[] storage self,\\n uint256 pos\\n ) private pure returns (Checkpoint208 storage result) {\\n assembly {\\n mstore(0, self.slot)\\n result.slot := add(keccak256(0, 0x20), pos)\\n }\\n }\\n\\n struct Trace160 {\\n Checkpoint160[] _checkpoints;\\n }\\n\\n struct Checkpoint160 {\\n uint96 _key;\\n uint160 _value;\\n }\\n\\n /**\\n * @dev Pushes a (`key`, `value`) pair into a Trace160 so that it is stored as the checkpoint.\\n *\\n * Returns previous value and new value.\\n *\\n * IMPORTANT: Never accept `key` as a user input, since an arbitrary `type(uint96).max` key set will disable the\\n * library.\\n */\\n function push(\\n Trace160 storage self,\\n uint96 key,\\n uint160 value\\n ) internal returns (uint160 oldValue, uint160 newValue) {\\n return _insert(self._checkpoints, key, value);\\n }\\n\\n /**\\n * @dev Returns the value in the first (oldest) checkpoint with key greater or equal than the search key, or zero if\\n * there is none.\\n */\\n function lowerLookup(Trace160 storage self, uint96 key) internal view returns (uint160) {\\n uint256 len = self._checkpoints.length;\\n uint256 pos = _lowerBinaryLookup(self._checkpoints, key, 0, len);\\n return pos == len ? 0 : _unsafeAccess(self._checkpoints, pos)._value;\\n }\\n\\n /**\\n * @dev Returns the value in the last (most recent) checkpoint with key lower or equal than the search key, or zero\\n * if there is none.\\n */\\n function upperLookup(Trace160 storage self, uint96 key) internal view returns (uint160) {\\n uint256 len = self._checkpoints.length;\\n uint256 pos = _upperBinaryLookup(self._checkpoints, key, 0, len);\\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\\n }\\n\\n /**\\n * @dev Returns the value in the last (most recent) checkpoint with key lower or equal than the search key, or zero\\n * if there is none.\\n *\\n * NOTE: This is a variant of {upperLookup} that is optimised to find \\\"recent\\\" checkpoint (checkpoints with high\\n * keys).\\n */\\n function upperLookupRecent(Trace160 storage self, uint96 key) internal view returns (uint160) {\\n uint256 len = self._checkpoints.length;\\n\\n uint256 low = 0;\\n uint256 high = len;\\n\\n if (len > 5) {\\n uint256 mid = len - Math.sqrt(len);\\n if (key < _unsafeAccess(self._checkpoints, mid)._key) {\\n high = mid;\\n } else {\\n low = mid + 1;\\n }\\n }\\n\\n uint256 pos = _upperBinaryLookup(self._checkpoints, key, low, high);\\n\\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\\n }\\n\\n /**\\n * @dev Returns the value in the most recent checkpoint, or zero if there are no checkpoints.\\n */\\n function latest(Trace160 storage self) internal view returns (uint160) {\\n uint256 pos = self._checkpoints.length;\\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\\n }\\n\\n /**\\n * @dev Returns whether there is a checkpoint in the structure (i.e. it is not empty), and if so the key and value\\n * in the most recent checkpoint.\\n */\\n function latestCheckpoint(Trace160 storage self) internal view returns (bool exists, uint96 _key, uint160 _value) {\\n uint256 pos = self._checkpoints.length;\\n if (pos == 0) {\\n return (false, 0, 0);\\n } else {\\n Checkpoint160 storage ckpt = _unsafeAccess(self._checkpoints, pos - 1);\\n return (true, ckpt._key, ckpt._value);\\n }\\n }\\n\\n /**\\n * @dev Returns the number of checkpoint.\\n */\\n function length(Trace160 storage self) internal view returns (uint256) {\\n return self._checkpoints.length;\\n }\\n\\n /**\\n * @dev Returns checkpoint at given position.\\n */\\n function at(Trace160 storage self, uint32 pos) internal view returns (Checkpoint160 memory) {\\n return self._checkpoints[pos];\\n }\\n\\n /**\\n * @dev Pushes a (`key`, `value`) pair into an ordered list of checkpoints, either by inserting a new checkpoint,\\n * or by updating the last one.\\n */\\n function _insert(\\n Checkpoint160[] storage self,\\n uint96 key,\\n uint160 value\\n ) private returns (uint160 oldValue, uint160 newValue) {\\n uint256 pos = self.length;\\n\\n if (pos > 0) {\\n Checkpoint160 storage last = _unsafeAccess(self, pos - 1);\\n uint96 lastKey = last._key;\\n uint160 lastValue = last._value;\\n\\n // Checkpoint keys must be non-decreasing.\\n if (lastKey > key) {\\n revert CheckpointUnorderedInsertion();\\n }\\n\\n // Update or push new checkpoint\\n if (lastKey == key) {\\n last._value = value;\\n } else {\\n self.push(Checkpoint160({_key: key, _value: value}));\\n }\\n return (lastValue, value);\\n } else {\\n self.push(Checkpoint160({_key: key, _value: value}));\\n return (0, value);\\n }\\n }\\n\\n /**\\n * @dev Return the index of the first (oldest) checkpoint with key strictly bigger than the search key, or `high`\\n * if there is none. `low` and `high` define a section where to do the search, with inclusive `low` and exclusive\\n * `high`.\\n *\\n * WARNING: `high` should not be greater than the array's length.\\n */\\n function _upperBinaryLookup(\\n Checkpoint160[] storage self,\\n uint96 key,\\n uint256 low,\\n uint256 high\\n ) private view returns (uint256) {\\n while (low < high) {\\n uint256 mid = Math.average(low, high);\\n if (_unsafeAccess(self, mid)._key > key) {\\n high = mid;\\n } else {\\n low = mid + 1;\\n }\\n }\\n return high;\\n }\\n\\n /**\\n * @dev Return the index of the first (oldest) checkpoint with key greater or equal than the search key, or `high`\\n * if there is none. `low` and `high` define a section where to do the search, with inclusive `low` and exclusive\\n * `high`.\\n *\\n * WARNING: `high` should not be greater than the array's length.\\n */\\n function _lowerBinaryLookup(\\n Checkpoint160[] storage self,\\n uint96 key,\\n uint256 low,\\n uint256 high\\n ) private view returns (uint256) {\\n while (low < high) {\\n uint256 mid = Math.average(low, high);\\n if (_unsafeAccess(self, mid)._key < key) {\\n low = mid + 1;\\n } else {\\n high = mid;\\n }\\n }\\n return high;\\n }\\n\\n /**\\n * @dev Access an element of the array without performing bounds check. The position is assumed to be within bounds.\\n */\\n function _unsafeAccess(\\n Checkpoint160[] storage self,\\n uint256 pos\\n ) private pure returns (Checkpoint160 storage result) {\\n assembly {\\n mstore(0, self.slot)\\n result.slot := add(keccak256(0, 0x20), pos)\\n }\\n }\\n}\\n\",\"keccak256\":\"0x66364cd3247ea71cdb58f080f5d5ed6732433a8001413139661841535494692f\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/types/Time.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/types/Time.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {Math} from \\\"../math/Math.sol\\\";\\nimport {SafeCast} from \\\"../math/SafeCast.sol\\\";\\n\\n/**\\n * @dev This library provides helpers for manipulating time-related objects.\\n *\\n * It uses the following types:\\n * - `uint48` for timepoints\\n * - `uint32` for durations\\n *\\n * While the library doesn't provide specific types for timepoints and duration, it does provide:\\n * - a `Delay` type to represent duration that can be programmed to change value automatically at a given point\\n * - additional helper functions\\n */\\nlibrary Time {\\n using Time for *;\\n\\n /**\\n * @dev Get the block timestamp as a Timepoint.\\n */\\n function timestamp() internal view returns (uint48) {\\n return SafeCast.toUint48(block.timestamp);\\n }\\n\\n /**\\n * @dev Get the block number as a Timepoint.\\n */\\n function blockNumber() internal view returns (uint48) {\\n return SafeCast.toUint48(block.number);\\n }\\n\\n // ==================================================== Delay =====================================================\\n /**\\n * @dev A `Delay` is a uint32 duration that can be programmed to change value automatically at a given point in the\\n * future. The \\\"effect\\\" timepoint describes when the transitions happens from the \\\"old\\\" value to the \\\"new\\\" value.\\n * This allows updating the delay applied to some operation while keeping some guarantees.\\n *\\n * In particular, the {update} function guarantees that if the delay is reduced, the old delay still applies for\\n * some time. For example if the delay is currently 7 days to do an upgrade, the admin should not be able to set\\n * the delay to 0 and upgrade immediately. If the admin wants to reduce the delay, the old delay (7 days) should\\n * still apply for some time.\\n *\\n *\\n * The `Delay` type is 112 bits long, and packs the following:\\n *\\n * ```\\n * | [uint48]: effect date (timepoint)\\n * | | [uint32]: value before (duration)\\n * \\u2193 \\u2193 \\u2193 [uint32]: value after (duration)\\n * 0xAAAAAAAAAAAABBBBBBBBCCCCCCCC\\n * ```\\n *\\n * NOTE: The {get} and {withUpdate} functions operate using timestamps. Block number based delays are not currently\\n * supported.\\n */\\n type Delay is uint112;\\n\\n /**\\n * @dev Wrap a duration into a Delay to add the one-step \\\"update in the future\\\" feature\\n */\\n function toDelay(uint32 duration) internal pure returns (Delay) {\\n return Delay.wrap(duration);\\n }\\n\\n /**\\n * @dev Get the value at a given timepoint plus the pending value and effect timepoint if there is a scheduled\\n * change after this timepoint. If the effect timepoint is 0, then the pending value should not be considered.\\n */\\n function _getFullAt(\\n Delay self,\\n uint48 timepoint\\n ) private pure returns (uint32 valueBefore, uint32 valueAfter, uint48 effect) {\\n (valueBefore, valueAfter, effect) = self.unpack();\\n return effect <= timepoint ? (valueAfter, 0, 0) : (valueBefore, valueAfter, effect);\\n }\\n\\n /**\\n * @dev Get the current value plus the pending value and effect timepoint if there is a scheduled change. If the\\n * effect timepoint is 0, then the pending value should not be considered.\\n */\\n function getFull(Delay self) internal view returns (uint32 valueBefore, uint32 valueAfter, uint48 effect) {\\n return _getFullAt(self, timestamp());\\n }\\n\\n /**\\n * @dev Get the current value.\\n */\\n function get(Delay self) internal view returns (uint32) {\\n (uint32 delay, , ) = self.getFull();\\n return delay;\\n }\\n\\n /**\\n * @dev Update a Delay object so that it takes a new duration after a timepoint that is automatically computed to\\n * enforce the old delay at the moment of the update. Returns the updated Delay object and the timestamp when the\\n * new delay becomes effective.\\n */\\n function withUpdate(\\n Delay self,\\n uint32 newValue,\\n uint32 minSetback\\n ) internal view returns (Delay updatedDelay, uint48 effect) {\\n uint32 value = self.get();\\n uint32 setback = uint32(Math.max(minSetback, value > newValue ? value - newValue : 0));\\n effect = timestamp() + setback;\\n return (pack(value, newValue, effect), effect);\\n }\\n\\n /**\\n * @dev Split a delay into its components: valueBefore, valueAfter and effect (transition timepoint).\\n */\\n function unpack(Delay self) internal pure returns (uint32 valueBefore, uint32 valueAfter, uint48 effect) {\\n uint112 raw = Delay.unwrap(self);\\n\\n valueAfter = uint32(raw);\\n valueBefore = uint32(raw >> 32);\\n effect = uint48(raw >> 64);\\n\\n return (valueBefore, valueAfter, effect);\\n }\\n\\n /**\\n * @dev pack the components into a Delay object.\\n */\\n function pack(uint32 valueBefore, uint32 valueAfter, uint48 effect) internal pure returns (Delay) {\\n return Delay.wrap((uint112(effect) << 64) | (uint112(valueBefore) << 32) | uint112(valueAfter));\\n }\\n}\\n\",\"keccak256\":\"0x36776530f012618bc7526ceb28e77b85e582cb12d9b9466a71d4bd6bf952e4cc\",\"license\":\"MIT\"},\"contracts/variants/crosschain/NFT.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity ^0.8.20;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC721/ERC721.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC721/extensions/ERC721Burnable.sol\\\";\\nimport \\\"@openzeppelin/contracts/access/Ownable.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/cryptography/EIP712.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC721/extensions/ERC721Votes.sol\\\";\\nimport \\\"./ProofHandler.sol\\\";\\n\\n/**\\n * @title Cross-chain Membership NFT Contract\\n * @author Web3 Hackers Collective\\n * @notice Non-transferable NFT implementation for DAO membership with cross-chain capabilities\\n * @dev Extends OpenZeppelin's NFT standards with cross-chain operation support and delegation\\n * @custom:security-contact julien@strat.cc\\n */\\ncontract NFT is\\n ERC721,\\n ERC721Enumerable,\\n ERC721URIStorage,\\n ERC721Burnable,\\n Ownable,\\n EIP712,\\n ERC721Votes\\n{\\n using ProofHandler for ProofHandler.ProofStorage;\\n\\n /// @notice Chain ID where contract was originally deployed\\n uint256 public immutable home;\\n\\n /// @notice Next token ID to be minted\\n uint256 private _nextTokenId;\\n\\n /// @notice Storage for proof handling\\n ProofHandler.ProofStorage private _proofStorage;\\n\\n /// @notice Types of operations that can be synchronized across chains\\n enum OperationType {\\n MINT,\\n BURN,\\n SET_METADATA,\\n DELEGATE\\n }\\n\\n /// @notice Emitted when a membership is claimed\\n /// @param tokenId The ID of the claimed token\\n /// @param member The address receiving the membership\\n /// @param nonce Operation sequence number\\n event MembershipClaimed(uint256 indexed tokenId, address indexed member, uint256 nonce);\\n\\n /// @notice Emitted when a membership is revoked\\n /// @param tokenId The ID of the revoked token\\n /// @param member The address losing membership\\n /// @param nonce Operation sequence number\\n event MembershipRevoked(uint256 indexed tokenId, address indexed member, uint256 nonce);\\n\\n /// @notice Emitted when metadata is updated\\n /// @param tokenId The ID of the updated token\\n /// @param newUri The new metadata URI\\n /// @param nonce Operation sequence number\\n event MetadataUpdated(uint256 indexed tokenId, string newUri, uint256 nonce);\\n\\n /// @notice Emitted when delegation is synchronized across chains\\n /// @param delegator The address delegating their voting power\\n /// @param delegatee The address receiving the delegation\\n /// @param nonce Operation sequence number\\n event DelegationSynced(address indexed delegator, address indexed delegatee, uint256 nonce);\\n\\n /// @notice Restricts functions to home chain\\n modifier onlyHomeChain() {\\n require(block.chainid == home, \\\"Operation only allowed on home chain\\\");\\n _;\\n }\\n\\n /**\\n * @notice Initializes the NFT contract\\n * @param _home Chain ID where contract is considered home\\n * @param initialOwner Initial contract owner\\n * @param _firstMembers Array of initial member addresses\\n * @param _uri Initial token URI\\n * @param _name Token collection name\\n * @param _symbol Token collection symbol\\n */\\n constructor(\\n uint256 _home,\\n address initialOwner,\\n address[] memory _firstMembers,\\n string memory _uri,\\n string memory _name,\\n string memory _symbol\\n ) ERC721(_name, _symbol) Ownable(initialOwner) EIP712(_name, \\\"1\\\") {\\n home = _home;\\n for (uint i; i < _firstMembers.length; i++) {\\n _govMint(_firstMembers[i], _uri);\\n _delegate(_firstMembers[i], _firstMembers[i]);\\n }\\n }\\n\\n /**\\n * @notice Adds a new member on home chain\\n * @dev Only callable by owner (governance) on home chain\\n * @param to Address to mint token to\\n * @param uri Token metadata URI\\n */\\n function safeMint(address to, string memory uri) public onlyOwner onlyHomeChain {\\n uint256 nonce = _proofStorage.incrementNonce(uint8(OperationType.MINT));\\n _govMint(to, uri);\\n emit MembershipClaimed(_nextTokenId - 1, to, nonce);\\n }\\n\\n /**\\n * @notice Burns token on home chain\\n * @dev Only callable by owner (governance) on home chain\\n * @param tokenId ID of token to burn\\n */\\n function govBurn(uint256 tokenId) public onlyOwner onlyHomeChain {\\n uint256 nonce = _proofStorage.incrementNonce(uint8(OperationType.BURN));\\n address owner = ownerOf(tokenId);\\n _burn(tokenId);\\n emit MembershipRevoked(tokenId, owner, nonce);\\n }\\n\\n /**\\n * @notice Updates token metadata on home chain\\n * @dev Only callable by owner (governance) on home chain\\n * @param tokenId ID of token to update\\n * @param uri New metadata URI\\n */\\n function setMetadata(uint256 tokenId, string memory uri) public onlyOwner onlyHomeChain {\\n uint256 nonce = _proofStorage.incrementNonce(uint8(OperationType.SET_METADATA));\\n _setTokenURI(tokenId, uri);\\n emit MetadataUpdated(tokenId, uri, nonce);\\n }\\n\\n /**\\n * @notice Delegates voting power to another address on home chain\\n * @dev Overrides ERC721Votes delegate function to add cross-chain functionality\\n * @param delegatee Address to delegate voting power to\\n */\\n function delegate(address delegatee) public virtual override onlyHomeChain {\\n uint256 nonce = _proofStorage.incrementNonce(uint8(OperationType.DELEGATE));\\n _delegate(_msgSender(), delegatee);\\n emit DelegationSynced(_msgSender(), delegatee, nonce);\\n }\\n\\n /**\\n * @notice Generates proof for NFT operations\\n * @dev Only callable on home chain\\n * @param operationType Type of operation\\n * @param params Operation parameters\\n * @return Encoded proof data\\n */\\n function generateOperationProof(\\n uint8 operationType,\\n bytes memory params\\n ) external view returns (bytes memory) {\\n require(block.chainid == home, \\\"Proofs only generated on home chain\\\");\\n uint256 nextNonce = _proofStorage.getNextNonce(operationType);\\n return ProofHandler.generateProof(address(this), operationType, params, nextNonce);\\n }\\n\\n /**\\n * @notice Generates proof for delegation\\n * @dev Only callable on home chain\\n * @param delegator Address delegating voting power\\n * @param delegatee Address receiving delegation\\n * @return Encoded proof data\\n */\\n function generateDelegationProof(\\n address delegator,\\n address delegatee\\n ) external view returns (bytes memory) {\\n require(block.chainid == home, \\\"Proofs only generated on home chain\\\");\\n uint256 nextNonce = _proofStorage.getNextNonce(uint8(OperationType.DELEGATE));\\n bytes memory params = abi.encode(delegator, delegatee);\\n return\\n ProofHandler.generateProof(\\n address(this),\\n uint8(OperationType.DELEGATE),\\n params,\\n nextNonce\\n );\\n }\\n\\n // Claim operations\\n\\n /**\\n * @notice Claims an NFT operation on a foreign chain\\n * @param proof Proof generated by home chain\\n */\\n function claimOperation(bytes memory proof) external {\\n (uint8 operationType, bytes memory params, uint256 nonce) = ProofHandler\\n .verifyAndClaimProof(proof, address(this), _proofStorage);\\n\\n if (operationType == uint8(OperationType.MINT)) {\\n (address to, string memory uri) = abi.decode(params, (address, string));\\n _govMint(to, uri);\\n emit MembershipClaimed(_nextTokenId - 1, to, nonce);\\n } else if (operationType == uint8(OperationType.BURN)) {\\n uint256 tokenId = abi.decode(params, (uint256));\\n address owner = ownerOf(tokenId);\\n _burn(tokenId);\\n emit MembershipRevoked(tokenId, owner, nonce);\\n } else if (operationType == uint8(OperationType.SET_METADATA)) {\\n (uint256 tokenId, string memory uri) = abi.decode(params, (uint256, string));\\n _setTokenURI(tokenId, uri);\\n emit MetadataUpdated(tokenId, uri, nonce);\\n } else if (operationType == uint8(OperationType.DELEGATE)) {\\n (address delegator, address delegatee) = abi.decode(params, (address, address));\\n _delegate(delegator, delegatee);\\n emit DelegationSynced(delegator, delegatee, nonce);\\n }\\n }\\n\\n /**\\n * @notice Claims a delegation operation on a foreign chain\\n * @param proof Proof generated by home chain\\n */\\n function claimDelegation(bytes memory proof) external {\\n (uint8 operationType, bytes memory params, uint256 nonce) = ProofHandler\\n .verifyAndClaimProof(proof, address(this), _proofStorage);\\n\\n require(operationType == uint8(OperationType.DELEGATE), \\\"Invalid operation type\\\");\\n (address delegator, address delegatee) = abi.decode(params, (address, address));\\n\\n _delegate(delegator, delegatee);\\n emit DelegationSynced(delegator, delegatee, nonce);\\n }\\n\\n /**\\n * @notice Internal function for minting without proof verification\\n * @param to Address to receive token\\n * @param uri Token metadata URI\\n */\\n function _govMint(address to, string memory uri) internal {\\n uint256 tokenId = _nextTokenId++;\\n _safeMint(to, tokenId);\\n _setTokenURI(tokenId, uri);\\n _delegate(to, to);\\n }\\n\\n // Required overrides\\n\\n /**\\n * @notice Updates token data\\n * @dev Overrides ERC721 _update to make NFTs non-transferable\\n * @param to Recipient address\\n * @param tokenId Token ID\\n * @param auth Address authorized for transfer\\n * @return Previous owner address\\n */\\n function _update(\\n address to,\\n uint256 tokenId,\\n address auth\\n ) internal override(ERC721, ERC721Enumerable, ERC721Votes) returns (address) {\\n require(auth == address(0) || to == address(0), \\\"NFT is not transferable\\\");\\n return super._update(to, tokenId, auth);\\n }\\n\\n /**\\n * @notice Increments account balance\\n * @dev Internal override to maintain compatibility\\n * @param account Account to update\\n * @param value Amount to increase by\\n */\\n function _increaseBalance(\\n address account,\\n uint128 value\\n ) internal override(ERC721, ERC721Enumerable, ERC721Votes) {\\n super._increaseBalance(account, value);\\n }\\n\\n /**\\n * @notice Gets token URI\\n * @param tokenId Token ID to query\\n * @return URI string\\n */\\n function tokenURI(\\n uint256 tokenId\\n ) public view override(ERC721, ERC721URIStorage) returns (string memory) {\\n return super.tokenURI(tokenId);\\n }\\n\\n /**\\n * @notice Checks interface support\\n * @param interfaceId Interface identifier to check\\n * @return bool True if interface is supported\\n */\\n function supportsInterface(\\n bytes4 interfaceId\\n ) public view override(ERC721, ERC721Enumerable, ERC721URIStorage) returns (bool) {\\n return super.supportsInterface(interfaceId);\\n }\\n\\n /**\\n * @notice Gets current timestamp\\n * @dev Used for voting snapshots\\n * @return Current block timestamp\\n */\\n function clock() public view override returns (uint48) {\\n return uint48(block.timestamp);\\n }\\n\\n /**\\n * @notice Gets clock mode description\\n * @return String indicating timestamp-based voting\\n */\\n function CLOCK_MODE() public pure override returns (string memory) {\\n return \\\"mode=timestamp\\\";\\n }\\n}\\n\",\"keccak256\":\"0x3d703da3e4617f28dc5b0b763ff0485c49bcb162e4eb33d90f7384c7a1f5aed5\",\"license\":\"GPL-3.0\"},\"contracts/variants/crosschain/ProofHandler.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity ^0.8.20;\\n\\n/**\\n * @title Proof Handler Library\\n * @author Web3 Hackers Collective\\n * @notice Library for standardized cross-chain proof generation and verification\\n * @dev Handles proof generation, verification, and tracking for cross-chain operations\\n * @custom:security-contact julien@strat.cc\\n */\\nlibrary ProofHandler {\\n /// @notice Tracks which proofs have been applied on each chain\\n struct ProofStorage {\\n mapping(bytes32 => bool) updateAppliedOnChain;\\n mapping(uint8 => uint256) currentNonce;\\n }\\n\\n /// @dev Emitted when a proof is claimed\\n event ProofClaimed(uint8 indexed operationType, bytes params, uint256 nonce);\\n\\n /**\\n * @notice Generates a proof for cross-chain operations\\n * @param contractAddress Address of contract generating the proof\\n * @param operationType Type of operation being performed\\n * @param params Operation parameters\\n * @param nonce Current nonce for this operation type\\n * @return proof Encoded proof data\\n */\\n function generateProof(\\n address contractAddress,\\n uint8 operationType,\\n bytes memory params,\\n uint256 nonce\\n ) public pure returns (bytes memory proof) {\\n bytes32 message = keccak256(\\n abi.encodePacked(contractAddress, operationType, params, nonce)\\n );\\n bytes32 digest = keccak256(abi.encodePacked(\\\"\\\\x19Ethereum Signed Message:\\\\n32\\\", message));\\n\\n return abi.encode(operationType, params, nonce, digest);\\n }\\n\\n /**\\n * @notice Verifies and claims a proof\\n * @param proof Proof to verify and claim\\n * @param contractAddress Address of contract claiming the proof\\n * @param storage_ Proof storage struct\\n * @return operationType The type of operation being performed\\n * @return params The operation parameters\\n * @return nonce The operation sequence number\\n */\\n function verifyAndClaimProof(\\n bytes memory proof,\\n address contractAddress,\\n ProofStorage storage storage_\\n ) public returns (uint8 operationType, bytes memory params, uint256 nonce) {\\n bytes32 digest;\\n (operationType, params, nonce, digest) = abi.decode(\\n proof,\\n (uint8, bytes, uint256, bytes32)\\n );\\n\\n bytes32 proofHash = keccak256(proof);\\n require(!storage_.updateAppliedOnChain[proofHash], \\\"Proof already claimed\\\");\\n require(nonce == storage_.currentNonce[operationType] + 1, \\\"Invalid nonce\\\");\\n\\n bytes32 message = keccak256(\\n abi.encodePacked(contractAddress, operationType, params, nonce)\\n );\\n bytes32 expectedDigest = keccak256(\\n abi.encodePacked(\\\"\\\\x19Ethereum Signed Message:\\\\n32\\\", message)\\n );\\n require(digest == expectedDigest, \\\"Invalid proof\\\");\\n\\n storage_.updateAppliedOnChain[proofHash] = true;\\n storage_.currentNonce[operationType] = nonce;\\n\\n emit ProofClaimed(operationType, params, nonce);\\n\\n return (operationType, params, nonce);\\n }\\n\\n /**\\n * @notice Gets the next nonce for an operation type\\n * @param storage_ Proof storage struct\\n * @param operationType Type of operation\\n * @return nonce Next nonce value\\n */\\n function getNextNonce(\\n ProofStorage storage storage_,\\n uint8 operationType\\n ) public view returns (uint256 nonce) {\\n return storage_.currentNonce[operationType] + 1;\\n }\\n\\n /**\\n * @notice Increments the nonce for an operation type\\n * @param storage_ Proof storage struct\\n * @param operationType Type of operation\\n * @return nonce New nonce value\\n */\\n function incrementNonce(\\n ProofStorage storage storage_,\\n uint8 operationType\\n ) public returns (uint256 nonce) {\\n storage_.currentNonce[operationType]++;\\n return storage_.currentNonce[operationType];\\n }\\n}\\n\",\"keccak256\":\"0x3719e47c508f29977d48842c5c1d27cce7cb289cbb592526f170f98135ff41a7\",\"license\":\"GPL-3.0\"}},\"version\":1}", + "bytecode": "0x6101806040523480156200001257600080fd5b50604051620050023803806200500283398101604081905262000035916200126d565b6040805180820190915260018152603160f81b602082015282908682846000620000608382620013c8565b5060016200006f8282620013c8565b5050506001600160a01b038116620000a257604051631e4fbdf760e01b8152600060048201526024015b60405180910390fd5b620000ad8162000210565b50620000bb82600c62000262565b61012052620000cc81600d62000262565b61014052815160208084019190912060e052815190820120610100524660a0526200015a60e05161010051604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f60208201529081019290925260608201524660808201523060a082015260009060c00160405160208183030381529060405280519060200120905090565b60805250503060c05261016086905260005b84518110156200020357620001a48582815181106200018f576200018f62001494565b6020026020010151856200029b60201b60201c565b620001ee858281518110620001bd57620001bd62001494565b6020026020010151868381518110620001da57620001da62001494565b6020026020010151620002dd60201b60201c565b80620001fa81620014c0565b9150506200016c565b5050505050505062001628565b600b80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600060208351101562000282576200027a8362000353565b905062000295565b816200028f8482620013c8565b5060ff90505b92915050565b6012805460009182620002ae83620014c0565b909155509050620002c0838262000396565b620002cc8183620003bc565b620002d88380620002dd565b505050565b6001600160a01b038281166000818152600f602052604080822080548686166001600160a01b0319821681179092559151919094169392849290917f3134e8a2e6d97e929a7e54011ea5485d7d196dd5f0ba4d4ef95803e8e3fc257f9190a4620002d881836200034d866200040e565b6200041b565b600080829050601f8151111562000381578260405163305a27a960e01b81526004016200009991906200150a565b80516200038e826200151f565b179392505050565b620003b88282604051806020016040528060008152506200058860201b60201c565b5050565b6000828152600a60205260409020620003d68282620013c8565b506040518281527ff8e1a15aba9398e019f0b49df1a4fde98ee17ae345cb5f6b5e2c27f5033e8ce79060200160405180910390a15050565b60006200029582620005a4565b816001600160a01b0316836001600160a01b0316141580156200043e5750600081115b15620002d8576001600160a01b03831615620004e7576001600160a01b038316600090815260106020908152604082208291620004929190620005ee901b62001593176200048c8662000603565b6200063d565b6001600160d01b031691506001600160d01b03169150846001600160a01b031660008051602062004fe28339815191528383604051620004dc929190918252602082015260400190565b60405180910390a250505b6001600160a01b03821615620002d8576001600160a01b0382166000908152601060209081526040822082916200052f919062000671901b620015a6176200048c8662000603565b6001600160d01b031691506001600160d01b03169150836001600160a01b031660008051602062004fe2833981519152838360405162000579929190918252602082015260400190565b60405180910390a25050505050565b6200059483836200067f565b620002d8336000858585620006e9565b60006001600160a01b038216620005d2576040516322718ad960e21b81526000600482015260240162000099565b506001600160a01b031660009081526003602052604090205490565b6000620005fc828462001544565b9392505050565b60006001600160d01b0382111562000639576040516306dfcc6560e41b815260d060048201526024810183905260440162000099565b5090565b60008062000664426200065b620006548862000821565b868860201c565b87919062000870565b915091505b935093915050565b6000620005fc82846200156e565b6001600160a01b038216620006ab57604051633250574960e11b81526000600482015260240162000099565b6000620006ba83838362000880565b90506001600160a01b03811615620002d8576040516339e3563760e11b81526000600482015260240162000099565b6001600160a01b0383163b156200081a57604051630a85bd0160e11b81526001600160a01b0384169063150b7a02906200072e90889088908790879060040162001591565b6020604051808303816000875af19250505080156200076c575060408051601f3d908101601f191682019092526200076991810190620015d0565b60015b620007da573d8080156200079d576040519150601f19603f3d011682016040523d82523d6000602084013e620007a2565b606091505b508051600003620007d257604051633250574960e11b81526001600160a01b038516600482015260240162000099565b805181602001fd5b6001600160e01b03198116630a85bd0160e11b146200081857604051633250574960e11b81526001600160a01b038516600482015260240162000099565b505b5050505050565b8054600090801562000867576200084d836200083f600184620015fc565b600091825260209091200190565b54660100000000000090046001600160d01b0316620005fc565b60009392505050565b6000806200066485858562000903565b60006001600160a01b0382161580620008a057506001600160a01b038416155b620008ee5760405162461bcd60e51b815260206004820152601760248201527f4e4654206973206e6f74207472616e7366657261626c65000000000000000000604482015260640162000099565b620008fb84848462000a6c565b949350505050565b82546000908190801562000a0d57600062000925876200083f600185620015fc565b805490915065ffffffffffff80821691660100000000000090046001600160d01b03169088168211156200096c57604051632520601d60e01b815260040160405180910390fd5b8765ffffffffffff168265ffffffffffff1603620009aa57825465ffffffffffff1666010000000000006001600160d01b03891602178355620009fe565b6040805180820190915265ffffffffffff808a1682526001600160d01b03808a1660208085019182528d54600181018f5560008f815291909120945191519092166601000000000000029216919091179101555b94508593506200066992505050565b50506040805180820190915265ffffffffffff80851682526001600160d01b0380851660208085019182528854600181018a5560008a815291822095519251909316660100000000000002919093161792019190915590508162000669565b60008062000a7c85858562000a8c565b9050620008fb8186600162000b68565b60008062000a9c85858562000bfa565b90506001600160a01b03811662000afc5762000af684600880546000838152600960205260408120829055600182018355919091527ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee30155565b62000b22565b846001600160a01b0316816001600160a01b03161462000b225762000b22818562000cf9565b6001600160a01b03851662000b425762000b3c8462000d7d565b620008fb565b846001600160a01b0316816001600160a01b031614620008fb57620008fb858562000e37565b6001600160a01b03831662000b975762000b946011620015a66200067160201b176200048c8462000603565b50505b6001600160a01b03821662000bc65762000bc3601162001593620005ee60201b176200048c8462000603565b50505b6001600160a01b038381166000908152600f6020526040808220548584168352912054620002d8929182169116836200041b565b6000828152600260205260408120546001600160a01b039081169083161562000c2a5762000c2a81848662000e8b565b6001600160a01b0381161562000c6a5762000c49600085818062000ef5565b6001600160a01b038116600090815260036020526040902080546000190190555b6001600160a01b0385161562000c9a576001600160a01b0385166000908152600360205260409020805460010190555b60008481526002602052604080822080546001600160a01b0319166001600160a01b0389811691821790925591518793918516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4949350505050565b600062000d0683620005a4565b6000838152600760209081526040808320546001600160a01b038816845260069092529091209192509081831462000d5e57600083815260208281526040808320548584528184208190558352600790915290208290555b6000938452600760209081526040808620869055938552525081205550565b60085460009062000d9190600190620015fc565b6000838152600960205260408120546008805493945090928490811062000dbc5762000dbc62001494565b90600052602060002001549050806008838154811062000de05762000de062001494565b600091825260208083209091019290925582815260099091526040808220849055858252812055600880548062000e1b5762000e1b62001612565b6001900381819060005260206000200160009055905550505050565b6000600162000e4684620005a4565b62000e529190620015fc565b6001600160a01b039093166000908152600660209081526040808320868452825280832085905593825260079052919091209190915550565b62000e9883838362001023565b620002d8576001600160a01b03831662000ec957604051637e27328960e01b81526004810182905260240162000099565b60405163177e802f60e01b81526001600160a01b03831660048201526024810182905260440162000099565b808062000f0a57506001600160a01b03821615155b1562000ff357600062000f1d84620010a9565b90506001600160a01b0383161580159062000f4a5750826001600160a01b0316816001600160a01b031614155b801562000f7d57506001600160a01b0380821660009081526005602090815260408083209387168352929052205460ff16155b1562000fa85760405163a9fbf51f60e01b81526001600160a01b038416600482015260240162000099565b811562000ff15783856001600160a01b0316826001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45b505b5050600090815260046020526040902080546001600160a01b0319166001600160a01b0392909216919091179055565b60006001600160a01b03831615801590620008fb5750826001600160a01b0316846001600160a01b031614806200107f57506001600160a01b0380851660009081526005602090815260408083209387168352929052205460ff165b80620008fb5750506000908152600460205260409020546001600160a01b03908116911614919050565b6000818152600260205260408120546001600160a01b0316806200029557604051637e27328960e01b81526004810184905260240162000099565b80516001600160a01b0381168114620010fc57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b038111828210171562001142576200114262001101565b604052919050565b600082601f8301126200115c57600080fd5b815160206001600160401b038211156200117a576200117a62001101565b8160051b6200118b82820162001117565b9283528481018201928281019087851115620011a657600080fd5b83870192505b84831015620011d057620011c083620010e4565b82529183019190830190620011ac565b979650505050505050565b60005b83811015620011f8578181015183820152602001620011de565b50506000910152565b600082601f8301126200121357600080fd5b81516001600160401b038111156200122f576200122f62001101565b62001244601f8201601f191660200162001117565b8181528460208386010111156200125a57600080fd5b620008fb826020830160208701620011db565b60008060008060008060c087890312156200128757600080fd5b865195506200129960208801620010e4565b60408801519095506001600160401b0380821115620012b757600080fd5b620012c58a838b016200114a565b95506060890151915080821115620012dc57600080fd5b620012ea8a838b0162001201565b945060808901519150808211156200130157600080fd5b6200130f8a838b0162001201565b935060a08901519150808211156200132657600080fd5b506200133589828a0162001201565b9150509295509295509295565b600181811c908216806200135757607f821691505b6020821081036200137857634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115620002d857600081815260208120601f850160051c81016020861015620013a75750805b601f850160051c820191505b818110156200081857828155600101620013b3565b81516001600160401b03811115620013e457620013e462001101565b620013fc81620013f5845462001342565b846200137e565b602080601f8311600181146200143457600084156200141b5750858301515b600019600386901b1c1916600185901b17855562000818565b600085815260208120601f198616915b82811015620014655788860151825594840194600190910190840162001444565b5085821015620014845787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060018201620014d557620014d5620014aa565b5060010190565b60008151808452620014f6816020860160208601620011db565b601f01601f19169290920160200192915050565b602081526000620005fc6020830184620014dc565b80516020808301519190811015620013785760001960209190910360031b1b16919050565b6001600160d01b03828116828216039080821115620015675762001567620014aa565b5092915050565b6001600160d01b03818116838216019080821115620015675762001567620014aa565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090620015c690830184620014dc565b9695505050505050565b600060208284031215620015e357600080fd5b81516001600160e01b031981168114620005fc57600080fd5b81810381811115620002955762000295620014aa565b634e487b7160e01b600052603160045260246000fd5b60805160a05160c05160e0516101005161012051610140516101605161392a620016b8600039600081816104df015281816106fb0152818161092301528181610ad001528181610bd801528181610ea101526114170152600061196a015260006119380152600061235a015260006123320152600061228d015260006122b7015260006122e1015261392a6000f3fe608060405234801561001057600080fd5b50600436106102325760003560e01c8063711864781161013057806395d89b41116100b8578063c3cda5201161007c578063c3cda52014610527578063c87b56dd1461053a578063d204c45e1461054d578063e985e9c514610560578063f2fde38b1461057357600080fd5b806395d89b41146104bf5780639ab24eb0146104c75780639fa92f9d146104da578063a22cb46514610501578063b88d4fde1461051457600080fd5b806381b62086116100ff57806381b620861461045757806384b0196e1461046a5780638da5cb5b146104855780638e539e8c1461049657806391ddadf4146104a957600080fd5b80637118647814610400578063715018a6146104135780637610248e1461041b5780637ecebe001461042e57600080fd5b806342842e0e116101be578063587cde1e11610182578063587cde1e14610388578063593aa283146103b45780635c19a95c146103c75780636352211e146103da57806370a08231146103ed57600080fd5b806342842e0e1461031257806342966c6814610325578063482ffa5e146103385780634bf5d7e91461034b5780634f6ccce71461037557600080fd5b806318160ddd1161020557806318160ddd146102b457806323b872dd146102c657806326926d46146102d95780632f745c59146102ec5780633a46b1a8146102ff57600080fd5b806301ffc9a71461023757806306fdde031461025f578063081812fc14610274578063095ea7b31461029f575b600080fd5b61024a610245366004612ec2565b610586565b60405190151581526020015b60405180910390f35b610267610597565b6040516102569190612f2f565b610287610282366004612f42565b610629565b6040516001600160a01b039091168152602001610256565b6102b26102ad366004612f70565b610652565b005b6008545b604051908152602001610256565b6102b26102d4366004612f9c565b610661565b6102b26102e7366004612f42565b6106f1565b6102b86102fa366004612f70565b610817565b6102b861030d366004612f70565b61087c565b6102b2610320366004612f9c565b6108f3565b6102b2610333366004612f42565b610913565b6102676103463660046130b1565b61091f565b60408051808201909152600e81526d06d6f64653d74696d657374616d760941b6020820152610267565b6102b8610383366004612f42565b610a6d565b610287610396366004613101565b6001600160a01b039081166000908152600f60205260409020541690565b6102b26103c236600461311e565b610ac6565b6102b26103d5366004613101565b610bd6565b6102876103e8366004612f42565b610ce3565b6102b86103fb366004613101565b610cee565b6102b261040e36600461314f565b610d36565b6102b2610e89565b610267610429366004613184565b610e9d565b6102b861043c366004613101565b6001600160a01b03166000908152600e602052604090205490565b6102b261046536600461314f565b611024565b61047261123d565b60405161025697969594939291906131bd565b600b546001600160a01b0316610287565b6102b86104a4366004612f42565b611283565b60405165ffffffffffff42168152602001610256565b6102676112e3565b6102b86104d5366004613101565b6112f2565b6102b87f000000000000000000000000000000000000000000000000000000000000000081565b6102b261050f366004613253565b611322565b6102b2610522366004613286565b61132d565b6102b26105353660046132f2565b611345565b610267610548366004612f42565b611402565b6102b261055b36600461334e565b61140d565b61024a61056e366004613184565b611527565b6102b2610581366004613101565b611555565b6000610591826115b2565b92915050565b6060600080546105a69061336c565b80601f01602080910402602001604051908101604052809291908181526020018280546105d29061336c565b801561061f5780601f106105f45761010080835404028352916020019161061f565b820191906000526020600020905b81548152906001019060200180831161060257829003601f168201915b5050505050905090565b6000610634826115d7565b506000828152600460205260409020546001600160a01b0316610591565b61065d828233611610565b5050565b6001600160a01b03821661069057604051633250574960e11b8152600060048201526024015b60405180910390fd5b600061069d83833361161d565b9050836001600160a01b0316816001600160a01b0316146106eb576040516364283d7b60e01b81526001600160a01b0380861660048301526024820184905282166044820152606401610687565b50505050565b6106f9611693565b7f000000000000000000000000000000000000000000000000000000000000000046146107385760405162461bcd60e51b8152600401610687906133a6565b604051633b0d4dd760e01b8152601360048201526001602482015260009073__$b1c1335e68417b4234016f4aa58fdfac77$__90633b0d4dd790604401602060405180830381865af4158015610792573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107b69190613400565b905060006107c383610ce3565b90506107ce836116c0565b806001600160a01b0316837f81c00ee14a307a39bcddd8f17801cf3101f1c49c8dea9ee90ec0c04a61b5a0078460405161080a91815260200190565b60405180910390a3505050565b600061082283610cee565b82106108535760405163295f44f760e21b81526001600160a01b038416600482015260248101839052604401610687565b506001600160a01b03919091166000908152600660209081526040808320938352929052205490565b60004265ffffffffffff811683106108b857604051637669fc0f60e11b81526004810184905265ffffffffffff82166024820152604401610687565b6108e26108c4846116fb565b6001600160a01b038616600090815260106020526040902090611732565b6001600160d01b0316949350505050565b61090e8383836040518060200160405280600081525061132d565b505050565b61065d6000823361161d565b60607f000000000000000000000000000000000000000000000000000000000000000046146109605760405162461bcd60e51b815260040161068790613419565b604051630564edeb60e31b81526013600482015260ff8416602482015260009073__$b1c1335e68417b4234016f4aa58fdfac77$__90632b276f5890604401602060405180830381865af41580156109bc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109e09190613400565b604051637352178160e01b815290915073__$b1c1335e68417b4234016f4aa58fdfac77$__90637352178190610a2090309088908890879060040161345c565b600060405180830381865af4158015610a3d573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610a6591908101906134df565b949350505050565b6000610a7860085490565b8210610aa15760405163295f44f760e21b81526000600482015260248101839052604401610687565b60088281548110610ab457610ab4613514565b90600052602060002001549050919050565b610ace611693565b7f00000000000000000000000000000000000000000000000000000000000000004614610b0d5760405162461bcd60e51b8152600401610687906133a6565b604051633b0d4dd760e01b8152601360048201526002602482015260009073__$b1c1335e68417b4234016f4aa58fdfac77$__90633b0d4dd790604401602060405180830381865af4158015610b67573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b8b9190613400565b9050610b9783836117e8565b827faef83f88d7b64742932e336e35ec4ebdbf35e2824c4cc154007911e95b72367e8383604051610bc992919061352a565b60405180910390a2505050565b7f00000000000000000000000000000000000000000000000000000000000000004614610c155760405162461bcd60e51b8152600401610687906133a6565b604051633b0d4dd760e01b8152601360048201526003602482015260009073__$b1c1335e68417b4234016f4aa58fdfac77$__90633b0d4dd790604401602060405180830381865af4158015610c6f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c939190613400565b9050610c9f3383611838565b6040518181526001600160a01b0383169033907fa2527a1c304fba1df9beb0da8db977345b95154faa8004c7b3485f52e34dcd0a9060200160405180910390a35050565b6000610591826115d7565b60006001600160a01b038216610d1a576040516322718ad960e21b815260006004820152602401610687565b506001600160a01b031660009081526003602052604090205490565b600080600073__$b1c1335e68417b4234016f4aa58fdfac77$__63c0af6591853060136040518463ffffffff1660e01b8152600401610d779392919061354c565b600060405180830381865af4158015610d94573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610dbc919081019061357a565b9194509250905060ff8316600314610e0f5760405162461bcd60e51b8152602060048201526016602482015275496e76616c6964206f7065726174696f6e207479706560501b6044820152606401610687565b60008083806020019051810190610e2691906135d4565b91509150610e348282611838565b806001600160a01b0316826001600160a01b03167fa2527a1c304fba1df9beb0da8db977345b95154faa8004c7b3485f52e34dcd0a85604051610e7991815260200190565b60405180910390a3505050505050565b610e91611693565b610e9b60006118aa565b565b60607f00000000000000000000000000000000000000000000000000000000000000004614610ede5760405162461bcd60e51b815260040161068790613419565b604051630564edeb60e31b8152601360048201526003602482015260009073__$b1c1335e68417b4234016f4aa58fdfac77$__90632b276f5890604401602060405180830381865af4158015610f38573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f5c9190613400565b905060008484604051602001610f889291906001600160a01b0392831681529116602082015260400190565b60408051808303601f1901815290829052637352178160e01b8252915073__$b1c1335e68417b4234016f4aa58fdfac77$__90637352178190610fd69030906003908690889060040161345c565b600060405180830381865af4158015610ff3573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261101b91908101906134df565b95945050505050565b600080600073__$b1c1335e68417b4234016f4aa58fdfac77$__63c0af6591853060136040518463ffffffff1660e01b81526004016110659392919061354c565b600060405180830381865af4158015611082573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526110aa919081019061357a565b9194509250905060ff831661113257600080838060200190518101906110d09190613603565b915091506110de82826118fc565b816001600160a01b031660016012546110f79190613660565b6040518581527f22ef8ac73166382773e470f8f887ac4c54dcf377f397431fe0ac6f60261fabaf906020015b60405180910390a350506106eb565b60001960ff8416016111a8576000828060200190518101906111549190613400565b9050600061116182610ce3565b905061116c826116c0565b806001600160a01b0316827f81c00ee14a307a39bcddd8f17801cf3101f1c49c8dea9ee90ec0c04a61b5a0078560405161112391815260200190565b60011960ff84160161121a57600080838060200190518101906111cb9190613673565b915091506111d982826117e8565b817faef83f88d7b64742932e336e35ec4ebdbf35e2824c4cc154007911e95b72367e828560405161120b92919061352a565b60405180910390a250506106eb565b60021960ff8416016106eb5760008083806020019051810190610e2691906135d4565b600060608060008060006060611251611931565b611259611963565b60408051600080825260208201909252600f60f81b9b939a50919850469750309650945092509050565b60004265ffffffffffff811683106112bf57604051637669fc0f60e11b81526004810184905265ffffffffffff82166024820152604401610687565b6112d36112cb846116fb565b601190611732565b6001600160d01b03169392505050565b6060600180546105a69061336c565b6001600160a01b038116600090815260106020526040812061131390611990565b6001600160d01b031692915050565b61065d3383836119c9565b611338848484610661565b6106eb3385858585611a60565b8342111561136957604051632341d78760e11b815260048101859052602401610687565b604080517fe48329057bfd03d55e49b547132e39cffd9c1820ad7b9d4c5307691425d15adf60208201526001600160a01b0388169181019190915260608101869052608081018590526000906113e3906113db9060a00160405160208183030381529060405280519060200120611b8b565b858585611bb8565b90506113ef8187611be6565b6113f98188611838565b50505050505050565b606061059182611c39565b611415611693565b7f000000000000000000000000000000000000000000000000000000000000000046146114545760405162461bcd60e51b8152600401610687906133a6565b604051633b0d4dd760e01b8152601360048201526000602482018190529073__$b1c1335e68417b4234016f4aa58fdfac77$__90633b0d4dd790604401602060405180830381865af41580156114ae573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114d29190613400565b90506114de83836118fc565b826001600160a01b031660016012546114f79190613660565b6040518381527f22ef8ac73166382773e470f8f887ac4c54dcf377f397431fe0ac6f60261fabaf9060200161080a565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205460ff1690565b61155d611693565b6001600160a01b03811661158757604051631e4fbdf760e01b815260006004820152602401610687565b611590816118aa565b50565b600061159f82846136a4565b9392505050565b600061159f82846136cb565b60006001600160e01b03198216632483248360e11b1480610591575061059182611d42565b6000818152600260205260408120546001600160a01b03168061059157604051637e27328960e01b815260048101849052602401610687565b61090e8383836001611d67565b60006001600160a01b038216158061163c57506001600160a01b038416155b6116885760405162461bcd60e51b815260206004820152601760248201527f4e4654206973206e6f74207472616e7366657261626c650000000000000000006044820152606401610687565b610a65848484611e6d565b600b546001600160a01b03163314610e9b5760405163118cdaa760e01b8152336004820152602401610687565b60006116cf600083600061161d565b90506001600160a01b03811661065d57604051637e27328960e01b815260048101839052602401610687565b600065ffffffffffff82111561172e576040516306dfcc6560e41b81526030600482015260248101839052604401610687565b5090565b81546000908181600581111561179157600061174d84611e89565b6117579085613660565b60008881526020902090915081015465ffffffffffff90811690871610156117815780915061178f565b61178c8160016136eb565b92505b505b600061179f87878585611fe2565b905080156117da576117c4876117b6600184613660565b600091825260209091200190565b54600160301b90046001600160d01b03166117dd565b60005b979650505050505050565b6000828152600a602052604090206118008282613744565b506040518281527ff8e1a15aba9398e019f0b49df1a4fde98ee17ae345cb5f6b5e2c27f5033e8ce79060200160405180910390a15050565b6001600160a01b038281166000818152600f602052604080822080548686166001600160a01b0319821681179092559151919094169392849290917f3134e8a2e6d97e929a7e54011ea5485d7d196dd5f0ba4d4ef95803e8e3fc257f9190a461090e81836118a586612044565b61204f565b600b80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b601280546000918261190d83613804565b91905055905061191d83826121bb565b61192781836117e8565b61090e8384611838565b606061195e7f0000000000000000000000000000000000000000000000000000000000000000600c6121d5565b905090565b606061195e7f0000000000000000000000000000000000000000000000000000000000000000600d6121d5565b805460009080156119c0576119aa836117b6600184613660565b54600160301b90046001600160d01b031661159f565b60009392505050565b6001600160a01b0382166119fb57604051630b61174360e31b81526001600160a01b0383166004820152602401610687565b6001600160a01b03838116600081815260056020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910161080a565b6001600160a01b0383163b15611b8457604051630a85bd0160e11b81526001600160a01b0384169063150b7a0290611aa290889088908790879060040161381d565b6020604051808303816000875af1925050508015611add575060408051601f3d908101601f19168201909252611ada9181019061385a565b60015b611b46573d808015611b0b576040519150601f19603f3d011682016040523d82523d6000602084013e611b10565b606091505b508051600003611b3e57604051633250574960e11b81526001600160a01b0385166004820152602401610687565b805181602001fd5b6001600160e01b03198116630a85bd0160e11b14611b8257604051633250574960e11b81526001600160a01b0385166004820152602401610687565b505b5050505050565b6000610591611b98612280565b8360405161190160f01b8152600281019290925260228201526042902090565b600080600080611bca888888886123ab565b925092509250611bda828261247a565b50909695505050505050565b6001600160a01b0382166000908152600e6020526040902080546001810190915581811461090e576040516301d4b62360e61b81526001600160a01b038416600482015260248101829052604401610687565b6060611c44826115d7565b506000828152600a602052604081208054611c5e9061336c565b80601f0160208091040260200160405190810160405280929190818152602001828054611c8a9061336c565b8015611cd75780601f10611cac57610100808354040283529160200191611cd7565b820191906000526020600020905b815481529060010190602001808311611cba57829003601f168201915b505050505090506000611cf560408051602081019091526000815290565b90508051600003611d07575092915050565b815115611d39578082604051602001611d21929190613877565b60405160208183030381529060405292505050919050565b610a6584612533565b60006001600160e01b0319821663780e9d6360e01b14806105915750610591826125a7565b8080611d7b57506001600160a01b03821615155b15611e3d576000611d8b846115d7565b90506001600160a01b03831615801590611db75750826001600160a01b0316816001600160a01b031614155b8015611dca5750611dc88184611527565b155b15611df35760405163a9fbf51f60e01b81526001600160a01b0384166004820152602401610687565b8115611e3b5783856001600160a01b0316826001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45b505b5050600090815260046020526040902080546001600160a01b0319166001600160a01b0392909216919091179055565b600080611e7b8585856125f7565b9050610a65818660016126c4565b600060018211611e97575090565b816001600160801b8210611eb05760809190911c9060401b5b680100000000000000008210611ecb5760409190911c9060201b5b6401000000008210611ee25760209190911c9060101b5b620100008210611ef75760109190911c9060081b5b6101008210611f0b5760089190911c9060041b5b60108210611f1e5760049190911c9060021b5b60048210611f2a5760011b5b600302600190811c90818581611f4257611f426138a6565b048201901c90506001818581611f5a57611f5a6138a6565b048201901c90506001818581611f7257611f726138a6565b048201901c90506001818581611f8a57611f8a6138a6565b048201901c90506001818581611fa257611fa26138a6565b048201901c90506001818581611fba57611fba6138a6565b048201901c9050611fd9818581611fd357611fd36138a6565b04821190565b90039392505050565b60005b8183101561203c576000611ff9848461273a565b60008781526020902090915065ffffffffffff86169082015465ffffffffffff16111561202857809250612036565b6120338160016136eb565b93505b50611fe5565b509392505050565b600061059182610cee565b816001600160a01b0316836001600160a01b0316141580156120715750600081115b1561090e576001600160a01b03831615612119576001600160a01b038316600090815260106020526040812081906120b4906115936120af86612755565b612789565b6001600160d01b031691506001600160d01b03169150846001600160a01b03167fdec2bacdd2f05b59de34da9b523dff8be42e5e38e818c82fdb0bae774387a724838360405161210e929190918252602082015260400190565b60405180910390a250505b6001600160a01b0382161561090e576001600160a01b03821660009081526010602052604081208190612152906115a66120af86612755565b6001600160d01b031691506001600160d01b03169150836001600160a01b03167fdec2bacdd2f05b59de34da9b523dff8be42e5e38e818c82fdb0bae774387a72483836040516121ac929190918252602082015260400190565b60405180910390a25050505050565b61065d8282604051806020016040528060008152506127bb565b606060ff83146121ef576121e8836127d3565b9050610591565b8180546121fb9061336c565b80601f01602080910402602001604051908101604052809291908181526020018280546122279061336c565b80156122745780601f1061224957610100808354040283529160200191612274565b820191906000526020600020905b81548152906001019060200180831161225757829003601f168201915b50505050509050610591565b6000306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480156122d957507f000000000000000000000000000000000000000000000000000000000000000046145b1561230357507f000000000000000000000000000000000000000000000000000000000000000090565b61195e604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f60208201527f0000000000000000000000000000000000000000000000000000000000000000918101919091527f000000000000000000000000000000000000000000000000000000000000000060608201524660808201523060a082015260009060c00160405160208183030381529060405280519060200120905090565b600080807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08411156123e65750600091506003905082612470565b604080516000808252602082018084528a905260ff891692820192909252606081018790526080810186905260019060a0016020604051602081039080840390855afa15801561243a573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b03811661246657506000925060019150829050612470565b9250600091508190505b9450945094915050565b600082600381111561248e5761248e6133ea565b03612497575050565b60018260038111156124ab576124ab6133ea565b036124c95760405163f645eedf60e01b815260040160405180910390fd5b60028260038111156124dd576124dd6133ea565b036124fe5760405163fce698f760e01b815260048101829052602401610687565b6003826003811115612512576125126133ea565b0361065d576040516335e2f38360e21b815260048101829052602401610687565b606061253e826115d7565b50600061255660408051602081019091526000815290565b90506000815111612576576040518060200160405280600081525061159f565b8061258084612812565b604051602001612591929190613877565b6040516020818303038152906040529392505050565b60006001600160e01b031982166380ac58cd60e01b14806125d857506001600160e01b03198216635b5e139f60e01b145b8061059157506301ffc9a760e01b6001600160e01b0319831614610591565b6000806126058585856128a5565b90506001600160a01b0381166126625761265d84600880546000838152600960205260408120829055600182018355919091527ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee30155565b612685565b846001600160a01b0316816001600160a01b03161461268557612685818561299e565b6001600160a01b0385166126a15761269c84612a1f565b610a65565b846001600160a01b0316816001600160a01b031614610a6557610a658585612ace565b6001600160a01b0383166126e6576126e360116115a66120af84612755565b50505b6001600160a01b0382166127085761270560116115936120af84612755565b50505b6001600160a01b038381166000908152600f602052604080822054858416835291205461090e9291821691168361204f565b600061274960028484186138bc565b61159f908484166136eb565b60006001600160d01b0382111561172e576040516306dfcc6560e41b815260d0600482015260248101839052604401610687565b6000806127ae426127a661279c88611990565b868863ffffffff16565b879190612b1e565b915091505b935093915050565b6127c58383612b2c565b61090e336000858585611a60565b606060006127e083612b91565b604080516020808252818301909252919250600091906020820181803683375050509182525060208101929092525090565b6060600061281f83612bb9565b600101905060008167ffffffffffffffff81111561283f5761283f612fec565b6040519080825280601f01601f191660200182016040528015612869576020820181803683370190505b5090508181016020015b600019016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a850494508461287357509392505050565b6000828152600260205260408120546001600160a01b03908116908316156128d2576128d2818486612c91565b6001600160a01b03811615612910576128ef600085600080611d67565b6001600160a01b038116600090815260036020526040902080546000190190555b6001600160a01b0385161561293f576001600160a01b0385166000908152600360205260409020805460010190555b60008481526002602052604080822080546001600160a01b0319166001600160a01b0389811691821790925591518793918516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4949350505050565b60006129a983610cee565b6000838152600760209081526040808320546001600160a01b0388168452600690925290912091925090818314612a0057600083815260208281526040808320548584528184208190558352600790915290208290555b6000938452600760209081526040808620869055938552525081205550565b600854600090612a3190600190613660565b60008381526009602052604081205460088054939450909284908110612a5957612a59613514565b906000526020600020015490508060088381548110612a7a57612a7a613514565b6000918252602080832090910192909255828152600990915260408082208490558582528120556008805480612ab257612ab26138de565b6001900381819060005260206000200160009055905550505050565b60006001612adb84610cee565b612ae59190613660565b6001600160a01b039093166000908152600660209081526040808320868452825280832085905593825260079052919091209190915550565b6000806127ae858585612cf5565b6001600160a01b038216612b5657604051633250574960e11b815260006004820152602401610687565b6000612b648383600061161d565b90506001600160a01b0381161561090e576040516339e3563760e11b815260006004820152602401610687565b600060ff8216601f81111561059157604051632cd44ac360e21b815260040160405180910390fd5b60008072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b8310612bf85772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6d04ee2d6d415b85acef81000000008310612c24576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc100008310612c4257662386f26fc10000830492506010015b6305f5e1008310612c5a576305f5e100830492506008015b6127108310612c6e57612710830492506004015b60648310612c80576064830492506002015b600a83106105915760010192915050565b612c9c838383612e49565b61090e576001600160a01b038316612cca57604051637e27328960e01b815260048101829052602401610687565b60405163177e802f60e01b81526001600160a01b038316600482015260248101829052604401610687565b825460009081908015612dee576000612d13876117b6600185613660565b805490915065ffffffffffff80821691600160301b90046001600160d01b0316908816821115612d5657604051632520601d60e01b815260040160405180910390fd5b8765ffffffffffff168265ffffffffffff1603612d8f57825465ffffffffffff16600160301b6001600160d01b03891602178355612de0565b6040805180820190915265ffffffffffff808a1682526001600160d01b03808a1660208085019182528d54600181018f5560008f81529190912094519151909216600160301b029216919091179101555b94508593506127b392505050565b50506040805180820190915265ffffffffffff80851682526001600160d01b0380851660208085019182528854600181018a5560008a815291822095519251909316600160301b0291909316179201919091559050816127b3565b60006001600160a01b03831615801590610a655750826001600160a01b0316846001600160a01b03161480612e835750612e838484611527565b80610a655750506000908152600460205260409020546001600160a01b03908116911614919050565b6001600160e01b03198116811461159057600080fd5b600060208284031215612ed457600080fd5b813561159f81612eac565b60005b83811015612efa578181015183820152602001612ee2565b50506000910152565b60008151808452612f1b816020860160208601612edf565b601f01601f19169290920160200192915050565b60208152600061159f6020830184612f03565b600060208284031215612f5457600080fd5b5035919050565b6001600160a01b038116811461159057600080fd5b60008060408385031215612f8357600080fd5b8235612f8e81612f5b565b946020939093013593505050565b600080600060608486031215612fb157600080fd5b8335612fbc81612f5b565b92506020840135612fcc81612f5b565b929592945050506040919091013590565b60ff8116811461159057600080fd5b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff8111828210171561302b5761302b612fec565b604052919050565b600067ffffffffffffffff82111561304d5761304d612fec565b50601f01601f191660200190565b600082601f83011261306c57600080fd5b813561307f61307a82613033565b613002565b81815284602083860101111561309457600080fd5b816020850160208301376000918101602001919091529392505050565b600080604083850312156130c457600080fd5b82356130cf81612fdd565b9150602083013567ffffffffffffffff8111156130eb57600080fd5b6130f78582860161305b565b9150509250929050565b60006020828403121561311357600080fd5b813561159f81612f5b565b6000806040838503121561313157600080fd5b82359150602083013567ffffffffffffffff8111156130eb57600080fd5b60006020828403121561316157600080fd5b813567ffffffffffffffff81111561317857600080fd5b610a658482850161305b565b6000806040838503121561319757600080fd5b82356131a281612f5b565b915060208301356131b281612f5b565b809150509250929050565b60ff60f81b881681526000602060e0818401526131dd60e084018a612f03565b83810360408501526131ef818a612f03565b606085018990526001600160a01b038816608086015260a0850187905284810360c0860152855180825283870192509083019060005b8181101561324157835183529284019291840191600101613225565b50909c9b505050505050505050505050565b6000806040838503121561326657600080fd5b823561327181612f5b565b9150602083013580151581146131b257600080fd5b6000806000806080858703121561329c57600080fd5b84356132a781612f5b565b935060208501356132b781612f5b565b925060408501359150606085013567ffffffffffffffff8111156132da57600080fd5b6132e68782880161305b565b91505092959194509250565b60008060008060008060c0878903121561330b57600080fd5b863561331681612f5b565b95506020870135945060408701359350606087013561333481612fdd565b9598949750929560808101359460a0909101359350915050565b6000806040838503121561336157600080fd5b82356130cf81612f5b565b600181811c9082168061338057607f821691505b6020821081036133a057634e487b7160e01b600052602260045260246000fd5b50919050565b60208082526024908201527f4f7065726174696f6e206f6e6c7920616c6c6f776564206f6e20686f6d6520636040820152633430b4b760e11b606082015260800190565b634e487b7160e01b600052602160045260246000fd5b60006020828403121561341257600080fd5b5051919050565b60208082526023908201527f50726f6f6673206f6e6c792067656e657261746564206f6e20686f6d6520636860408201526230b4b760e91b606082015260800190565b6001600160a01b038516815260ff8416602082015260806040820181905260009061348990830185612f03565b905082606083015295945050505050565b600082601f8301126134ab57600080fd5b81516134b961307a82613033565b8181528460208386010111156134ce57600080fd5b610a65826020830160208701612edf565b6000602082840312156134f157600080fd5b815167ffffffffffffffff81111561350857600080fd5b610a658482850161349a565b634e487b7160e01b600052603260045260246000fd5b60408152600061353d6040830185612f03565b90508260208301529392505050565b60608152600061355f6060830186612f03565b6001600160a01b039490941660208301525060400152919050565b60008060006060848603121561358f57600080fd5b835161359a81612fdd565b602085015190935067ffffffffffffffff8111156135b757600080fd5b6135c38682870161349a565b925050604084015190509250925092565b600080604083850312156135e757600080fd5b82516135f281612f5b565b60208401519092506131b281612f5b565b6000806040838503121561361657600080fd5b825161362181612f5b565b602084015190925067ffffffffffffffff81111561363e57600080fd5b6130f78582860161349a565b634e487b7160e01b600052601160045260246000fd5b818103818111156105915761059161364a565b6000806040838503121561368657600080fd5b82519150602083015167ffffffffffffffff81111561363e57600080fd5b6001600160d01b038281168282160390808211156136c4576136c461364a565b5092915050565b6001600160d01b038181168382160190808211156136c4576136c461364a565b808201808211156105915761059161364a565b601f82111561090e57600081815260208120601f850160051c810160208610156137255750805b601f850160051c820191505b81811015611b8257828155600101613731565b815167ffffffffffffffff81111561375e5761375e612fec565b6137728161376c845461336c565b846136fe565b602080601f8311600181146137a7576000841561378f5750858301515b600019600386901b1c1916600185901b178555611b82565b600085815260208120601f198616915b828110156137d6578886015182559484019460019091019084016137b7565b50858210156137f45787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6000600182016138165761381661364a565b5060010190565b6001600160a01b038581168252841660208201526040810183905260806060820181905260009061385090830184612f03565b9695505050505050565b60006020828403121561386c57600080fd5b815161159f81612eac565b60008351613889818460208801612edf565b83519083019061389d818360208801612edf565b01949350505050565b634e487b7160e01b600052601260045260246000fd5b6000826138d957634e487b7160e01b600052601260045260246000fd5b500490565b634e487b7160e01b600052603160045260246000fdfea26469706673582212200861948c00ac12a29e05900592c5ed3f68c88227f729b466bf3d29f5a5208d1064736f6c63430008140033dec2bacdd2f05b59de34da9b523dff8be42e5e38e818c82fdb0bae774387a724", + "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106102325760003560e01c8063711864781161013057806395d89b41116100b8578063c3cda5201161007c578063c3cda52014610527578063c87b56dd1461053a578063d204c45e1461054d578063e985e9c514610560578063f2fde38b1461057357600080fd5b806395d89b41146104bf5780639ab24eb0146104c75780639fa92f9d146104da578063a22cb46514610501578063b88d4fde1461051457600080fd5b806381b62086116100ff57806381b620861461045757806384b0196e1461046a5780638da5cb5b146104855780638e539e8c1461049657806391ddadf4146104a957600080fd5b80637118647814610400578063715018a6146104135780637610248e1461041b5780637ecebe001461042e57600080fd5b806342842e0e116101be578063587cde1e11610182578063587cde1e14610388578063593aa283146103b45780635c19a95c146103c75780636352211e146103da57806370a08231146103ed57600080fd5b806342842e0e1461031257806342966c6814610325578063482ffa5e146103385780634bf5d7e91461034b5780634f6ccce71461037557600080fd5b806318160ddd1161020557806318160ddd146102b457806323b872dd146102c657806326926d46146102d95780632f745c59146102ec5780633a46b1a8146102ff57600080fd5b806301ffc9a71461023757806306fdde031461025f578063081812fc14610274578063095ea7b31461029f575b600080fd5b61024a610245366004612ec2565b610586565b60405190151581526020015b60405180910390f35b610267610597565b6040516102569190612f2f565b610287610282366004612f42565b610629565b6040516001600160a01b039091168152602001610256565b6102b26102ad366004612f70565b610652565b005b6008545b604051908152602001610256565b6102b26102d4366004612f9c565b610661565b6102b26102e7366004612f42565b6106f1565b6102b86102fa366004612f70565b610817565b6102b861030d366004612f70565b61087c565b6102b2610320366004612f9c565b6108f3565b6102b2610333366004612f42565b610913565b6102676103463660046130b1565b61091f565b60408051808201909152600e81526d06d6f64653d74696d657374616d760941b6020820152610267565b6102b8610383366004612f42565b610a6d565b610287610396366004613101565b6001600160a01b039081166000908152600f60205260409020541690565b6102b26103c236600461311e565b610ac6565b6102b26103d5366004613101565b610bd6565b6102876103e8366004612f42565b610ce3565b6102b86103fb366004613101565b610cee565b6102b261040e36600461314f565b610d36565b6102b2610e89565b610267610429366004613184565b610e9d565b6102b861043c366004613101565b6001600160a01b03166000908152600e602052604090205490565b6102b261046536600461314f565b611024565b61047261123d565b60405161025697969594939291906131bd565b600b546001600160a01b0316610287565b6102b86104a4366004612f42565b611283565b60405165ffffffffffff42168152602001610256565b6102676112e3565b6102b86104d5366004613101565b6112f2565b6102b87f000000000000000000000000000000000000000000000000000000000000000081565b6102b261050f366004613253565b611322565b6102b2610522366004613286565b61132d565b6102b26105353660046132f2565b611345565b610267610548366004612f42565b611402565b6102b261055b36600461334e565b61140d565b61024a61056e366004613184565b611527565b6102b2610581366004613101565b611555565b6000610591826115b2565b92915050565b6060600080546105a69061336c565b80601f01602080910402602001604051908101604052809291908181526020018280546105d29061336c565b801561061f5780601f106105f45761010080835404028352916020019161061f565b820191906000526020600020905b81548152906001019060200180831161060257829003601f168201915b5050505050905090565b6000610634826115d7565b506000828152600460205260409020546001600160a01b0316610591565b61065d828233611610565b5050565b6001600160a01b03821661069057604051633250574960e11b8152600060048201526024015b60405180910390fd5b600061069d83833361161d565b9050836001600160a01b0316816001600160a01b0316146106eb576040516364283d7b60e01b81526001600160a01b0380861660048301526024820184905282166044820152606401610687565b50505050565b6106f9611693565b7f000000000000000000000000000000000000000000000000000000000000000046146107385760405162461bcd60e51b8152600401610687906133a6565b604051633b0d4dd760e01b8152601360048201526001602482015260009073__$b1c1335e68417b4234016f4aa58fdfac77$__90633b0d4dd790604401602060405180830381865af4158015610792573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107b69190613400565b905060006107c383610ce3565b90506107ce836116c0565b806001600160a01b0316837f81c00ee14a307a39bcddd8f17801cf3101f1c49c8dea9ee90ec0c04a61b5a0078460405161080a91815260200190565b60405180910390a3505050565b600061082283610cee565b82106108535760405163295f44f760e21b81526001600160a01b038416600482015260248101839052604401610687565b506001600160a01b03919091166000908152600660209081526040808320938352929052205490565b60004265ffffffffffff811683106108b857604051637669fc0f60e11b81526004810184905265ffffffffffff82166024820152604401610687565b6108e26108c4846116fb565b6001600160a01b038616600090815260106020526040902090611732565b6001600160d01b0316949350505050565b61090e8383836040518060200160405280600081525061132d565b505050565b61065d6000823361161d565b60607f000000000000000000000000000000000000000000000000000000000000000046146109605760405162461bcd60e51b815260040161068790613419565b604051630564edeb60e31b81526013600482015260ff8416602482015260009073__$b1c1335e68417b4234016f4aa58fdfac77$__90632b276f5890604401602060405180830381865af41580156109bc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109e09190613400565b604051637352178160e01b815290915073__$b1c1335e68417b4234016f4aa58fdfac77$__90637352178190610a2090309088908890879060040161345c565b600060405180830381865af4158015610a3d573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610a6591908101906134df565b949350505050565b6000610a7860085490565b8210610aa15760405163295f44f760e21b81526000600482015260248101839052604401610687565b60088281548110610ab457610ab4613514565b90600052602060002001549050919050565b610ace611693565b7f00000000000000000000000000000000000000000000000000000000000000004614610b0d5760405162461bcd60e51b8152600401610687906133a6565b604051633b0d4dd760e01b8152601360048201526002602482015260009073__$b1c1335e68417b4234016f4aa58fdfac77$__90633b0d4dd790604401602060405180830381865af4158015610b67573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b8b9190613400565b9050610b9783836117e8565b827faef83f88d7b64742932e336e35ec4ebdbf35e2824c4cc154007911e95b72367e8383604051610bc992919061352a565b60405180910390a2505050565b7f00000000000000000000000000000000000000000000000000000000000000004614610c155760405162461bcd60e51b8152600401610687906133a6565b604051633b0d4dd760e01b8152601360048201526003602482015260009073__$b1c1335e68417b4234016f4aa58fdfac77$__90633b0d4dd790604401602060405180830381865af4158015610c6f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c939190613400565b9050610c9f3383611838565b6040518181526001600160a01b0383169033907fa2527a1c304fba1df9beb0da8db977345b95154faa8004c7b3485f52e34dcd0a9060200160405180910390a35050565b6000610591826115d7565b60006001600160a01b038216610d1a576040516322718ad960e21b815260006004820152602401610687565b506001600160a01b031660009081526003602052604090205490565b600080600073__$b1c1335e68417b4234016f4aa58fdfac77$__63c0af6591853060136040518463ffffffff1660e01b8152600401610d779392919061354c565b600060405180830381865af4158015610d94573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610dbc919081019061357a565b9194509250905060ff8316600314610e0f5760405162461bcd60e51b8152602060048201526016602482015275496e76616c6964206f7065726174696f6e207479706560501b6044820152606401610687565b60008083806020019051810190610e2691906135d4565b91509150610e348282611838565b806001600160a01b0316826001600160a01b03167fa2527a1c304fba1df9beb0da8db977345b95154faa8004c7b3485f52e34dcd0a85604051610e7991815260200190565b60405180910390a3505050505050565b610e91611693565b610e9b60006118aa565b565b60607f00000000000000000000000000000000000000000000000000000000000000004614610ede5760405162461bcd60e51b815260040161068790613419565b604051630564edeb60e31b8152601360048201526003602482015260009073__$b1c1335e68417b4234016f4aa58fdfac77$__90632b276f5890604401602060405180830381865af4158015610f38573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f5c9190613400565b905060008484604051602001610f889291906001600160a01b0392831681529116602082015260400190565b60408051808303601f1901815290829052637352178160e01b8252915073__$b1c1335e68417b4234016f4aa58fdfac77$__90637352178190610fd69030906003908690889060040161345c565b600060405180830381865af4158015610ff3573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261101b91908101906134df565b95945050505050565b600080600073__$b1c1335e68417b4234016f4aa58fdfac77$__63c0af6591853060136040518463ffffffff1660e01b81526004016110659392919061354c565b600060405180830381865af4158015611082573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526110aa919081019061357a565b9194509250905060ff831661113257600080838060200190518101906110d09190613603565b915091506110de82826118fc565b816001600160a01b031660016012546110f79190613660565b6040518581527f22ef8ac73166382773e470f8f887ac4c54dcf377f397431fe0ac6f60261fabaf906020015b60405180910390a350506106eb565b60001960ff8416016111a8576000828060200190518101906111549190613400565b9050600061116182610ce3565b905061116c826116c0565b806001600160a01b0316827f81c00ee14a307a39bcddd8f17801cf3101f1c49c8dea9ee90ec0c04a61b5a0078560405161112391815260200190565b60011960ff84160161121a57600080838060200190518101906111cb9190613673565b915091506111d982826117e8565b817faef83f88d7b64742932e336e35ec4ebdbf35e2824c4cc154007911e95b72367e828560405161120b92919061352a565b60405180910390a250506106eb565b60021960ff8416016106eb5760008083806020019051810190610e2691906135d4565b600060608060008060006060611251611931565b611259611963565b60408051600080825260208201909252600f60f81b9b939a50919850469750309650945092509050565b60004265ffffffffffff811683106112bf57604051637669fc0f60e11b81526004810184905265ffffffffffff82166024820152604401610687565b6112d36112cb846116fb565b601190611732565b6001600160d01b03169392505050565b6060600180546105a69061336c565b6001600160a01b038116600090815260106020526040812061131390611990565b6001600160d01b031692915050565b61065d3383836119c9565b611338848484610661565b6106eb3385858585611a60565b8342111561136957604051632341d78760e11b815260048101859052602401610687565b604080517fe48329057bfd03d55e49b547132e39cffd9c1820ad7b9d4c5307691425d15adf60208201526001600160a01b0388169181019190915260608101869052608081018590526000906113e3906113db9060a00160405160208183030381529060405280519060200120611b8b565b858585611bb8565b90506113ef8187611be6565b6113f98188611838565b50505050505050565b606061059182611c39565b611415611693565b7f000000000000000000000000000000000000000000000000000000000000000046146114545760405162461bcd60e51b8152600401610687906133a6565b604051633b0d4dd760e01b8152601360048201526000602482018190529073__$b1c1335e68417b4234016f4aa58fdfac77$__90633b0d4dd790604401602060405180830381865af41580156114ae573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114d29190613400565b90506114de83836118fc565b826001600160a01b031660016012546114f79190613660565b6040518381527f22ef8ac73166382773e470f8f887ac4c54dcf377f397431fe0ac6f60261fabaf9060200161080a565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205460ff1690565b61155d611693565b6001600160a01b03811661158757604051631e4fbdf760e01b815260006004820152602401610687565b611590816118aa565b50565b600061159f82846136a4565b9392505050565b600061159f82846136cb565b60006001600160e01b03198216632483248360e11b1480610591575061059182611d42565b6000818152600260205260408120546001600160a01b03168061059157604051637e27328960e01b815260048101849052602401610687565b61090e8383836001611d67565b60006001600160a01b038216158061163c57506001600160a01b038416155b6116885760405162461bcd60e51b815260206004820152601760248201527f4e4654206973206e6f74207472616e7366657261626c650000000000000000006044820152606401610687565b610a65848484611e6d565b600b546001600160a01b03163314610e9b5760405163118cdaa760e01b8152336004820152602401610687565b60006116cf600083600061161d565b90506001600160a01b03811661065d57604051637e27328960e01b815260048101839052602401610687565b600065ffffffffffff82111561172e576040516306dfcc6560e41b81526030600482015260248101839052604401610687565b5090565b81546000908181600581111561179157600061174d84611e89565b6117579085613660565b60008881526020902090915081015465ffffffffffff90811690871610156117815780915061178f565b61178c8160016136eb565b92505b505b600061179f87878585611fe2565b905080156117da576117c4876117b6600184613660565b600091825260209091200190565b54600160301b90046001600160d01b03166117dd565b60005b979650505050505050565b6000828152600a602052604090206118008282613744565b506040518281527ff8e1a15aba9398e019f0b49df1a4fde98ee17ae345cb5f6b5e2c27f5033e8ce79060200160405180910390a15050565b6001600160a01b038281166000818152600f602052604080822080548686166001600160a01b0319821681179092559151919094169392849290917f3134e8a2e6d97e929a7e54011ea5485d7d196dd5f0ba4d4ef95803e8e3fc257f9190a461090e81836118a586612044565b61204f565b600b80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b601280546000918261190d83613804565b91905055905061191d83826121bb565b61192781836117e8565b61090e8384611838565b606061195e7f0000000000000000000000000000000000000000000000000000000000000000600c6121d5565b905090565b606061195e7f0000000000000000000000000000000000000000000000000000000000000000600d6121d5565b805460009080156119c0576119aa836117b6600184613660565b54600160301b90046001600160d01b031661159f565b60009392505050565b6001600160a01b0382166119fb57604051630b61174360e31b81526001600160a01b0383166004820152602401610687565b6001600160a01b03838116600081815260056020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910161080a565b6001600160a01b0383163b15611b8457604051630a85bd0160e11b81526001600160a01b0384169063150b7a0290611aa290889088908790879060040161381d565b6020604051808303816000875af1925050508015611add575060408051601f3d908101601f19168201909252611ada9181019061385a565b60015b611b46573d808015611b0b576040519150601f19603f3d011682016040523d82523d6000602084013e611b10565b606091505b508051600003611b3e57604051633250574960e11b81526001600160a01b0385166004820152602401610687565b805181602001fd5b6001600160e01b03198116630a85bd0160e11b14611b8257604051633250574960e11b81526001600160a01b0385166004820152602401610687565b505b5050505050565b6000610591611b98612280565b8360405161190160f01b8152600281019290925260228201526042902090565b600080600080611bca888888886123ab565b925092509250611bda828261247a565b50909695505050505050565b6001600160a01b0382166000908152600e6020526040902080546001810190915581811461090e576040516301d4b62360e61b81526001600160a01b038416600482015260248101829052604401610687565b6060611c44826115d7565b506000828152600a602052604081208054611c5e9061336c565b80601f0160208091040260200160405190810160405280929190818152602001828054611c8a9061336c565b8015611cd75780601f10611cac57610100808354040283529160200191611cd7565b820191906000526020600020905b815481529060010190602001808311611cba57829003601f168201915b505050505090506000611cf560408051602081019091526000815290565b90508051600003611d07575092915050565b815115611d39578082604051602001611d21929190613877565b60405160208183030381529060405292505050919050565b610a6584612533565b60006001600160e01b0319821663780e9d6360e01b14806105915750610591826125a7565b8080611d7b57506001600160a01b03821615155b15611e3d576000611d8b846115d7565b90506001600160a01b03831615801590611db75750826001600160a01b0316816001600160a01b031614155b8015611dca5750611dc88184611527565b155b15611df35760405163a9fbf51f60e01b81526001600160a01b0384166004820152602401610687565b8115611e3b5783856001600160a01b0316826001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45b505b5050600090815260046020526040902080546001600160a01b0319166001600160a01b0392909216919091179055565b600080611e7b8585856125f7565b9050610a65818660016126c4565b600060018211611e97575090565b816001600160801b8210611eb05760809190911c9060401b5b680100000000000000008210611ecb5760409190911c9060201b5b6401000000008210611ee25760209190911c9060101b5b620100008210611ef75760109190911c9060081b5b6101008210611f0b5760089190911c9060041b5b60108210611f1e5760049190911c9060021b5b60048210611f2a5760011b5b600302600190811c90818581611f4257611f426138a6565b048201901c90506001818581611f5a57611f5a6138a6565b048201901c90506001818581611f7257611f726138a6565b048201901c90506001818581611f8a57611f8a6138a6565b048201901c90506001818581611fa257611fa26138a6565b048201901c90506001818581611fba57611fba6138a6565b048201901c9050611fd9818581611fd357611fd36138a6565b04821190565b90039392505050565b60005b8183101561203c576000611ff9848461273a565b60008781526020902090915065ffffffffffff86169082015465ffffffffffff16111561202857809250612036565b6120338160016136eb565b93505b50611fe5565b509392505050565b600061059182610cee565b816001600160a01b0316836001600160a01b0316141580156120715750600081115b1561090e576001600160a01b03831615612119576001600160a01b038316600090815260106020526040812081906120b4906115936120af86612755565b612789565b6001600160d01b031691506001600160d01b03169150846001600160a01b03167fdec2bacdd2f05b59de34da9b523dff8be42e5e38e818c82fdb0bae774387a724838360405161210e929190918252602082015260400190565b60405180910390a250505b6001600160a01b0382161561090e576001600160a01b03821660009081526010602052604081208190612152906115a66120af86612755565b6001600160d01b031691506001600160d01b03169150836001600160a01b03167fdec2bacdd2f05b59de34da9b523dff8be42e5e38e818c82fdb0bae774387a72483836040516121ac929190918252602082015260400190565b60405180910390a25050505050565b61065d8282604051806020016040528060008152506127bb565b606060ff83146121ef576121e8836127d3565b9050610591565b8180546121fb9061336c565b80601f01602080910402602001604051908101604052809291908181526020018280546122279061336c565b80156122745780601f1061224957610100808354040283529160200191612274565b820191906000526020600020905b81548152906001019060200180831161225757829003601f168201915b50505050509050610591565b6000306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480156122d957507f000000000000000000000000000000000000000000000000000000000000000046145b1561230357507f000000000000000000000000000000000000000000000000000000000000000090565b61195e604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f60208201527f0000000000000000000000000000000000000000000000000000000000000000918101919091527f000000000000000000000000000000000000000000000000000000000000000060608201524660808201523060a082015260009060c00160405160208183030381529060405280519060200120905090565b600080807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08411156123e65750600091506003905082612470565b604080516000808252602082018084528a905260ff891692820192909252606081018790526080810186905260019060a0016020604051602081039080840390855afa15801561243a573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b03811661246657506000925060019150829050612470565b9250600091508190505b9450945094915050565b600082600381111561248e5761248e6133ea565b03612497575050565b60018260038111156124ab576124ab6133ea565b036124c95760405163f645eedf60e01b815260040160405180910390fd5b60028260038111156124dd576124dd6133ea565b036124fe5760405163fce698f760e01b815260048101829052602401610687565b6003826003811115612512576125126133ea565b0361065d576040516335e2f38360e21b815260048101829052602401610687565b606061253e826115d7565b50600061255660408051602081019091526000815290565b90506000815111612576576040518060200160405280600081525061159f565b8061258084612812565b604051602001612591929190613877565b6040516020818303038152906040529392505050565b60006001600160e01b031982166380ac58cd60e01b14806125d857506001600160e01b03198216635b5e139f60e01b145b8061059157506301ffc9a760e01b6001600160e01b0319831614610591565b6000806126058585856128a5565b90506001600160a01b0381166126625761265d84600880546000838152600960205260408120829055600182018355919091527ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee30155565b612685565b846001600160a01b0316816001600160a01b03161461268557612685818561299e565b6001600160a01b0385166126a15761269c84612a1f565b610a65565b846001600160a01b0316816001600160a01b031614610a6557610a658585612ace565b6001600160a01b0383166126e6576126e360116115a66120af84612755565b50505b6001600160a01b0382166127085761270560116115936120af84612755565b50505b6001600160a01b038381166000908152600f602052604080822054858416835291205461090e9291821691168361204f565b600061274960028484186138bc565b61159f908484166136eb565b60006001600160d01b0382111561172e576040516306dfcc6560e41b815260d0600482015260248101839052604401610687565b6000806127ae426127a661279c88611990565b868863ffffffff16565b879190612b1e565b915091505b935093915050565b6127c58383612b2c565b61090e336000858585611a60565b606060006127e083612b91565b604080516020808252818301909252919250600091906020820181803683375050509182525060208101929092525090565b6060600061281f83612bb9565b600101905060008167ffffffffffffffff81111561283f5761283f612fec565b6040519080825280601f01601f191660200182016040528015612869576020820181803683370190505b5090508181016020015b600019016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a850494508461287357509392505050565b6000828152600260205260408120546001600160a01b03908116908316156128d2576128d2818486612c91565b6001600160a01b03811615612910576128ef600085600080611d67565b6001600160a01b038116600090815260036020526040902080546000190190555b6001600160a01b0385161561293f576001600160a01b0385166000908152600360205260409020805460010190555b60008481526002602052604080822080546001600160a01b0319166001600160a01b0389811691821790925591518793918516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4949350505050565b60006129a983610cee565b6000838152600760209081526040808320546001600160a01b0388168452600690925290912091925090818314612a0057600083815260208281526040808320548584528184208190558352600790915290208290555b6000938452600760209081526040808620869055938552525081205550565b600854600090612a3190600190613660565b60008381526009602052604081205460088054939450909284908110612a5957612a59613514565b906000526020600020015490508060088381548110612a7a57612a7a613514565b6000918252602080832090910192909255828152600990915260408082208490558582528120556008805480612ab257612ab26138de565b6001900381819060005260206000200160009055905550505050565b60006001612adb84610cee565b612ae59190613660565b6001600160a01b039093166000908152600660209081526040808320868452825280832085905593825260079052919091209190915550565b6000806127ae858585612cf5565b6001600160a01b038216612b5657604051633250574960e11b815260006004820152602401610687565b6000612b648383600061161d565b90506001600160a01b0381161561090e576040516339e3563760e11b815260006004820152602401610687565b600060ff8216601f81111561059157604051632cd44ac360e21b815260040160405180910390fd5b60008072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b8310612bf85772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6d04ee2d6d415b85acef81000000008310612c24576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc100008310612c4257662386f26fc10000830492506010015b6305f5e1008310612c5a576305f5e100830492506008015b6127108310612c6e57612710830492506004015b60648310612c80576064830492506002015b600a83106105915760010192915050565b612c9c838383612e49565b61090e576001600160a01b038316612cca57604051637e27328960e01b815260048101829052602401610687565b60405163177e802f60e01b81526001600160a01b038316600482015260248101829052604401610687565b825460009081908015612dee576000612d13876117b6600185613660565b805490915065ffffffffffff80821691600160301b90046001600160d01b0316908816821115612d5657604051632520601d60e01b815260040160405180910390fd5b8765ffffffffffff168265ffffffffffff1603612d8f57825465ffffffffffff16600160301b6001600160d01b03891602178355612de0565b6040805180820190915265ffffffffffff808a1682526001600160d01b03808a1660208085019182528d54600181018f5560008f81529190912094519151909216600160301b029216919091179101555b94508593506127b392505050565b50506040805180820190915265ffffffffffff80851682526001600160d01b0380851660208085019182528854600181018a5560008a815291822095519251909316600160301b0291909316179201919091559050816127b3565b60006001600160a01b03831615801590610a655750826001600160a01b0316846001600160a01b03161480612e835750612e838484611527565b80610a655750506000908152600460205260409020546001600160a01b03908116911614919050565b6001600160e01b03198116811461159057600080fd5b600060208284031215612ed457600080fd5b813561159f81612eac565b60005b83811015612efa578181015183820152602001612ee2565b50506000910152565b60008151808452612f1b816020860160208601612edf565b601f01601f19169290920160200192915050565b60208152600061159f6020830184612f03565b600060208284031215612f5457600080fd5b5035919050565b6001600160a01b038116811461159057600080fd5b60008060408385031215612f8357600080fd5b8235612f8e81612f5b565b946020939093013593505050565b600080600060608486031215612fb157600080fd5b8335612fbc81612f5b565b92506020840135612fcc81612f5b565b929592945050506040919091013590565b60ff8116811461159057600080fd5b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff8111828210171561302b5761302b612fec565b604052919050565b600067ffffffffffffffff82111561304d5761304d612fec565b50601f01601f191660200190565b600082601f83011261306c57600080fd5b813561307f61307a82613033565b613002565b81815284602083860101111561309457600080fd5b816020850160208301376000918101602001919091529392505050565b600080604083850312156130c457600080fd5b82356130cf81612fdd565b9150602083013567ffffffffffffffff8111156130eb57600080fd5b6130f78582860161305b565b9150509250929050565b60006020828403121561311357600080fd5b813561159f81612f5b565b6000806040838503121561313157600080fd5b82359150602083013567ffffffffffffffff8111156130eb57600080fd5b60006020828403121561316157600080fd5b813567ffffffffffffffff81111561317857600080fd5b610a658482850161305b565b6000806040838503121561319757600080fd5b82356131a281612f5b565b915060208301356131b281612f5b565b809150509250929050565b60ff60f81b881681526000602060e0818401526131dd60e084018a612f03565b83810360408501526131ef818a612f03565b606085018990526001600160a01b038816608086015260a0850187905284810360c0860152855180825283870192509083019060005b8181101561324157835183529284019291840191600101613225565b50909c9b505050505050505050505050565b6000806040838503121561326657600080fd5b823561327181612f5b565b9150602083013580151581146131b257600080fd5b6000806000806080858703121561329c57600080fd5b84356132a781612f5b565b935060208501356132b781612f5b565b925060408501359150606085013567ffffffffffffffff8111156132da57600080fd5b6132e68782880161305b565b91505092959194509250565b60008060008060008060c0878903121561330b57600080fd5b863561331681612f5b565b95506020870135945060408701359350606087013561333481612fdd565b9598949750929560808101359460a0909101359350915050565b6000806040838503121561336157600080fd5b82356130cf81612f5b565b600181811c9082168061338057607f821691505b6020821081036133a057634e487b7160e01b600052602260045260246000fd5b50919050565b60208082526024908201527f4f7065726174696f6e206f6e6c7920616c6c6f776564206f6e20686f6d6520636040820152633430b4b760e11b606082015260800190565b634e487b7160e01b600052602160045260246000fd5b60006020828403121561341257600080fd5b5051919050565b60208082526023908201527f50726f6f6673206f6e6c792067656e657261746564206f6e20686f6d6520636860408201526230b4b760e91b606082015260800190565b6001600160a01b038516815260ff8416602082015260806040820181905260009061348990830185612f03565b905082606083015295945050505050565b600082601f8301126134ab57600080fd5b81516134b961307a82613033565b8181528460208386010111156134ce57600080fd5b610a65826020830160208701612edf565b6000602082840312156134f157600080fd5b815167ffffffffffffffff81111561350857600080fd5b610a658482850161349a565b634e487b7160e01b600052603260045260246000fd5b60408152600061353d6040830185612f03565b90508260208301529392505050565b60608152600061355f6060830186612f03565b6001600160a01b039490941660208301525060400152919050565b60008060006060848603121561358f57600080fd5b835161359a81612fdd565b602085015190935067ffffffffffffffff8111156135b757600080fd5b6135c38682870161349a565b925050604084015190509250925092565b600080604083850312156135e757600080fd5b82516135f281612f5b565b60208401519092506131b281612f5b565b6000806040838503121561361657600080fd5b825161362181612f5b565b602084015190925067ffffffffffffffff81111561363e57600080fd5b6130f78582860161349a565b634e487b7160e01b600052601160045260246000fd5b818103818111156105915761059161364a565b6000806040838503121561368657600080fd5b82519150602083015167ffffffffffffffff81111561363e57600080fd5b6001600160d01b038281168282160390808211156136c4576136c461364a565b5092915050565b6001600160d01b038181168382160190808211156136c4576136c461364a565b808201808211156105915761059161364a565b601f82111561090e57600081815260208120601f850160051c810160208610156137255750805b601f850160051c820191505b81811015611b8257828155600101613731565b815167ffffffffffffffff81111561375e5761375e612fec565b6137728161376c845461336c565b846136fe565b602080601f8311600181146137a7576000841561378f5750858301515b600019600386901b1c1916600185901b178555611b82565b600085815260208120601f198616915b828110156137d6578886015182559484019460019091019084016137b7565b50858210156137f45787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6000600182016138165761381661364a565b5060010190565b6001600160a01b038581168252841660208201526040810183905260806060820181905260009061385090830184612f03565b9695505050505050565b60006020828403121561386c57600080fd5b815161159f81612eac565b60008351613889818460208801612edf565b83519083019061389d818360208801612edf565b01949350505050565b634e487b7160e01b600052601260045260246000fd5b6000826138d957634e487b7160e01b600052601260045260246000fd5b500490565b634e487b7160e01b600052603160045260246000fdfea26469706673582212200861948c00ac12a29e05900592c5ed3f68c88227f729b466bf3d29f5a5208d1064736f6c63430008140033", + "libraries": { + "ProofHandler": "0x0152ee45780385dACCCCB128D816031CfFe5F36B" + }, + "devdoc": { + "author": "Web3 Hackers Collective", + "custom:security-contact": "julien@strat.cc", + "details": "Extends OpenZeppelin's NFT standards with cross-chain operation support and delegation", + "errors": { + "CheckpointUnorderedInsertion()": [ + { + "details": "A value was attempted to be inserted on a past checkpoint." + } + ], + "ECDSAInvalidSignature()": [ + { + "details": "The signature derives the `address(0)`." + } + ], + "ECDSAInvalidSignatureLength(uint256)": [ + { + "details": "The signature has an invalid length." + } + ], + "ECDSAInvalidSignatureS(bytes32)": [ + { + "details": "The signature has an S value that is in the upper half order." + } + ], + "ERC5805FutureLookup(uint256,uint48)": [ + { + "details": "Lookup to future votes is not available." + } + ], + "ERC6372InconsistentClock()": [ + { + "details": "The clock was incorrectly modified." + } + ], + "ERC721EnumerableForbiddenBatchMint()": [ + { + "details": "Batch mint is not allowed." + } + ], + "ERC721IncorrectOwner(address,uint256,address)": [ + { + "details": "Indicates an error related to the ownership over a particular token. Used in transfers.", + "params": { + "owner": "Address of the current owner of a token.", + "sender": "Address whose tokens are being transferred.", + "tokenId": "Identifier number of a token." + } + } + ], + "ERC721InsufficientApproval(address,uint256)": [ + { + "details": "Indicates a failure with the `operator`’s approval. Used in transfers.", + "params": { + "operator": "Address that may be allowed to operate on tokens without being their owner.", + "tokenId": "Identifier number of a token." + } + } + ], + "ERC721InvalidApprover(address)": [ + { + "details": "Indicates a failure with the `approver` of a token to be approved. Used in approvals.", + "params": { + "approver": "Address initiating an approval operation." + } + } + ], + "ERC721InvalidOperator(address)": [ + { + "details": "Indicates a failure with the `operator` to be approved. Used in approvals.", + "params": { + "operator": "Address that may be allowed to operate on tokens without being their owner." + } + } + ], + "ERC721InvalidOwner(address)": [ + { + "details": "Indicates that an address can't be an owner. For example, `address(0)` is a forbidden owner in ERC-20. Used in balance queries.", + "params": { + "owner": "Address of the current owner of a token." + } + } + ], + "ERC721InvalidReceiver(address)": [ + { + "details": "Indicates a failure with the token `receiver`. Used in transfers.", + "params": { + "receiver": "Address to which tokens are being transferred." + } + } + ], + "ERC721InvalidSender(address)": [ + { + "details": "Indicates a failure with the token `sender`. Used in transfers.", + "params": { + "sender": "Address whose tokens are being transferred." + } + } + ], + "ERC721NonexistentToken(uint256)": [ + { + "details": "Indicates a `tokenId` whose `owner` is the zero address.", + "params": { + "tokenId": "Identifier number of a token." + } + } + ], + "ERC721OutOfBoundsIndex(address,uint256)": [ + { + "details": "An `owner`'s token query was out of bounds for `index`. NOTE: The owner being `address(0)` indicates a global out of bounds index." + } + ], + "InvalidAccountNonce(address,uint256)": [ + { + "details": "The nonce used for an `account` is not the expected current nonce." + } + ], + "OwnableInvalidOwner(address)": [ + { + "details": "The owner is not a valid owner account. (eg. `address(0)`)" + } + ], + "OwnableUnauthorizedAccount(address)": [ + { + "details": "The caller account is not authorized to perform an operation." + } + ], + "SafeCastOverflowedUintDowncast(uint8,uint256)": [ + { + "details": "Value doesn't fit in an uint of `bits` size." + } + ], + "VotesExpiredSignature(uint256)": [ + { + "details": "The signature used has expired." + } + ] + }, + "events": { + "Approval(address,address,uint256)": { + "details": "Emitted when `owner` enables `approved` to manage the `tokenId` token." + }, + "ApprovalForAll(address,address,bool)": { + "details": "Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets." + }, + "BatchMetadataUpdate(uint256,uint256)": { + "details": "This event emits when the metadata of a range of tokens is changed. So that the third-party platforms such as NFT market could timely update the images and related attributes of the NFTs." + }, + "DelegateChanged(address,address,address)": { + "details": "Emitted when an account changes their delegate." + }, + "DelegateVotesChanged(address,uint256,uint256)": { + "details": "Emitted when a token transfer or delegate change results in changes to a delegate's number of voting units." + }, + "DelegationSynced(address,address,uint256)": { + "params": { + "delegatee": "The address receiving the delegation", + "delegator": "The address delegating their voting power", + "nonce": "Operation sequence number" + } + }, + "EIP712DomainChanged()": { + "details": "MAY be emitted to signal that the domain could have changed." + }, + "MembershipClaimed(uint256,address,uint256)": { + "params": { + "member": "The address receiving the membership", + "nonce": "Operation sequence number", + "tokenId": "The ID of the claimed token" + } + }, + "MembershipRevoked(uint256,address,uint256)": { + "params": { + "member": "The address losing membership", + "nonce": "Operation sequence number", + "tokenId": "The ID of the revoked token" + } + }, + "MetadataUpdate(uint256)": { + "details": "This event emits when the metadata of a token is changed. So that the third-party platforms such as NFT market could timely update the images and related attributes of the NFT." + }, + "MetadataUpdated(uint256,string,uint256)": { + "params": { + "newUri": "The new metadata URI", + "nonce": "Operation sequence number", + "tokenId": "The ID of the updated token" + } + }, + "Transfer(address,address,uint256)": { + "details": "Emitted when `tokenId` token is transferred from `from` to `to`." + } + }, + "kind": "dev", + "methods": { + "CLOCK_MODE()": { + "returns": { + "_0": "String indicating timestamp-based voting" + } + }, + "approve(address,uint256)": { + "details": "See {IERC721-approve}." + }, + "balanceOf(address)": { + "details": "See {IERC721-balanceOf}." + }, + "burn(uint256)": { + "details": "Burns `tokenId`. See {ERC721-_burn}. Requirements: - The caller must own `tokenId` or be an approved operator." + }, + "claimDelegation(bytes)": { + "params": { + "proof": "Proof generated by home chain" + } + }, + "claimOperation(bytes)": { + "params": { + "proof": "Proof generated by home chain" + } + }, + "clock()": { + "details": "Used for voting snapshots", + "returns": { + "_0": "Current block timestamp" + } + }, + "constructor": { + "params": { + "_firstMembers": "Array of initial member addresses", + "_home": "Chain ID where contract is considered home", + "_name": "Token collection name", + "_symbol": "Token collection symbol", + "_uri": "Initial token URI", + "initialOwner": "Initial contract owner" + } + }, + "delegate(address)": { + "details": "Overrides ERC721Votes delegate function to add cross-chain functionality", + "params": { + "delegatee": "Address to delegate voting power to" + } + }, + "delegateBySig(address,uint256,uint256,uint8,bytes32,bytes32)": { + "details": "Delegates votes from signer to `delegatee`." + }, + "delegates(address)": { + "details": "Returns the delegate that `account` has chosen." + }, + "eip712Domain()": { + "details": "See {IERC-5267}." + }, + "generateDelegationProof(address,address)": { + "details": "Only callable on home chain", + "params": { + "delegatee": "Address receiving delegation", + "delegator": "Address delegating voting power" + }, + "returns": { + "_0": "Encoded proof data" + } + }, + "generateOperationProof(uint8,bytes)": { + "details": "Only callable on home chain", + "params": { + "operationType": "Type of operation", + "params": "Operation parameters" + }, + "returns": { + "_0": "Encoded proof data" + } + }, + "getApproved(uint256)": { + "details": "See {IERC721-getApproved}." + }, + "getPastTotalSupply(uint256)": { + "details": "Returns the total supply of votes available at a specific moment in the past. If the `clock()` is configured to use block numbers, this will return the value at the end of the corresponding block. NOTE: This value is the sum of all available votes, which is not necessarily the sum of all delegated votes. Votes that have not been delegated are still part of total supply, even though they would not participate in a vote. Requirements: - `timepoint` must be in the past. If operating using block numbers, the block must be already mined." + }, + "getPastVotes(address,uint256)": { + "details": "Returns the amount of votes that `account` had at a specific moment in the past. If the `clock()` is configured to use block numbers, this will return the value at the end of the corresponding block. Requirements: - `timepoint` must be in the past. If operating using block numbers, the block must be already mined." + }, + "getVotes(address)": { + "details": "Returns the current amount of votes that `account` has." + }, + "govBurn(uint256)": { + "details": "Only callable by owner (governance) on home chain", + "params": { + "tokenId": "ID of token to burn" + } + }, + "isApprovedForAll(address,address)": { + "details": "See {IERC721-isApprovedForAll}." + }, + "name()": { + "details": "See {IERC721Metadata-name}." + }, + "nonces(address)": { + "details": "Returns the next unused nonce for an address." + }, + "owner()": { + "details": "Returns the address of the current owner." + }, + "ownerOf(uint256)": { + "details": "See {IERC721-ownerOf}." + }, + "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." + }, + "safeMint(address,string)": { + "details": "Only callable by owner (governance) on home chain", + "params": { + "to": "Address to mint token to", + "uri": "Token metadata URI" + } + }, + "safeTransferFrom(address,address,uint256)": { + "details": "See {IERC721-safeTransferFrom}." + }, + "safeTransferFrom(address,address,uint256,bytes)": { + "details": "See {IERC721-safeTransferFrom}." + }, + "setApprovalForAll(address,bool)": { + "details": "See {IERC721-setApprovalForAll}." + }, + "setMetadata(uint256,string)": { + "details": "Only callable by owner (governance) on home chain", + "params": { + "tokenId": "ID of token to update", + "uri": "New metadata URI" + } + }, + "supportsInterface(bytes4)": { + "params": { + "interfaceId": "Interface identifier to check" + }, + "returns": { + "_0": "bool True if interface is supported" + } + }, + "symbol()": { + "details": "See {IERC721Metadata-symbol}." + }, + "tokenByIndex(uint256)": { + "details": "See {IERC721Enumerable-tokenByIndex}." + }, + "tokenOfOwnerByIndex(address,uint256)": { + "details": "See {IERC721Enumerable-tokenOfOwnerByIndex}." + }, + "tokenURI(uint256)": { + "params": { + "tokenId": "Token ID to query" + }, + "returns": { + "_0": "URI string" + } + }, + "totalSupply()": { + "details": "See {IERC721Enumerable-totalSupply}." + }, + "transferFrom(address,address,uint256)": { + "details": "See {IERC721-transferFrom}." + }, + "transferOwnership(address)": { + "details": "Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner." + } + }, + "title": "Cross-chain Membership NFT Contract", + "version": 1 + }, + "userdoc": { + "events": { + "DelegationSynced(address,address,uint256)": { + "notice": "Emitted when delegation is synchronized across chains" + }, + "MembershipClaimed(uint256,address,uint256)": { + "notice": "Emitted when a membership is claimed" + }, + "MembershipRevoked(uint256,address,uint256)": { + "notice": "Emitted when a membership is revoked" + }, + "MetadataUpdated(uint256,string,uint256)": { + "notice": "Emitted when metadata is updated" + } + }, + "kind": "user", + "methods": { + "CLOCK_MODE()": { + "notice": "Gets clock mode description" + }, + "claimDelegation(bytes)": { + "notice": "Claims a delegation operation on a foreign chain" + }, + "claimOperation(bytes)": { + "notice": "Claims an NFT operation on a foreign chain" + }, + "clock()": { + "notice": "Gets current timestamp" + }, + "constructor": { + "notice": "Initializes the NFT contract" + }, + "delegate(address)": { + "notice": "Delegates voting power to another address on home chain" + }, + "generateDelegationProof(address,address)": { + "notice": "Generates proof for delegation" + }, + "generateOperationProof(uint8,bytes)": { + "notice": "Generates proof for NFT operations" + }, + "govBurn(uint256)": { + "notice": "Burns token on home chain" + }, + "home()": { + "notice": "Chain ID where contract was originally deployed" + }, + "safeMint(address,string)": { + "notice": "Adds a new member on home chain" + }, + "setMetadata(uint256,string)": { + "notice": "Updates token metadata on home chain" + }, + "supportsInterface(bytes4)": { + "notice": "Checks interface support" + }, + "tokenURI(uint256)": { + "notice": "Gets token URI" + } + }, + "notice": "Non-transferable NFT implementation for DAO membership with cross-chain capabilities", + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 1030, + "contract": "contracts/variants/crosschain/NFT.sol:NFT", + "label": "_name", + "offset": 0, + "slot": "0", + "type": "t_string_storage" + }, + { + "astId": 1032, + "contract": "contracts/variants/crosschain/NFT.sol:NFT", + "label": "_symbol", + "offset": 0, + "slot": "1", + "type": "t_string_storage" + }, + { + "astId": 1036, + "contract": "contracts/variants/crosschain/NFT.sol:NFT", + "label": "_owners", + "offset": 0, + "slot": "2", + "type": "t_mapping(t_uint256,t_address)" + }, + { + "astId": 1040, + "contract": "contracts/variants/crosschain/NFT.sol:NFT", + "label": "_balances", + "offset": 0, + "slot": "3", + "type": "t_mapping(t_address,t_uint256)" + }, + { + "astId": 1044, + "contract": "contracts/variants/crosschain/NFT.sol:NFT", + "label": "_tokenApprovals", + "offset": 0, + "slot": "4", + "type": "t_mapping(t_uint256,t_address)" + }, + { + "astId": 1050, + "contract": "contracts/variants/crosschain/NFT.sol:NFT", + "label": "_operatorApprovals", + "offset": 0, + "slot": "5", + "type": "t_mapping(t_address,t_mapping(t_address,t_bool))" + }, + { + "astId": 2137, + "contract": "contracts/variants/crosschain/NFT.sol:NFT", + "label": "_ownedTokens", + "offset": 0, + "slot": "6", + "type": "t_mapping(t_address,t_mapping(t_uint256,t_uint256))" + }, + { + "astId": 2141, + "contract": "contracts/variants/crosschain/NFT.sol:NFT", + "label": "_ownedTokensIndex", + "offset": 0, + "slot": "7", + "type": "t_mapping(t_uint256,t_uint256)" + }, + { + "astId": 2144, + "contract": "contracts/variants/crosschain/NFT.sol:NFT", + "label": "_allTokens", + "offset": 0, + "slot": "8", + "type": "t_array(t_uint256)dyn_storage" + }, + { + "astId": 2148, + "contract": "contracts/variants/crosschain/NFT.sol:NFT", + "label": "_allTokensIndex", + "offset": 0, + "slot": "9", + "type": "t_mapping(t_uint256,t_uint256)" + }, + { + "astId": 2532, + "contract": "contracts/variants/crosschain/NFT.sol:NFT", + "label": "_tokenURIs", + "offset": 0, + "slot": "10", + "type": "t_mapping(t_uint256,t_string_storage)" + }, + { + "astId": 8, + "contract": "contracts/variants/crosschain/NFT.sol:NFT", + "label": "_owner", + "offset": 0, + "slot": "11", + "type": "t_address" + }, + { + "astId": 4046, + "contract": "contracts/variants/crosschain/NFT.sol:NFT", + "label": "_nameFallback", + "offset": 0, + "slot": "12", + "type": "t_string_storage" + }, + { + "astId": 4048, + "contract": "contracts/variants/crosschain/NFT.sol:NFT", + "label": "_versionFallback", + "offset": 0, + "slot": "13", + "type": "t_string_storage" + }, + { + "astId": 2894, + "contract": "contracts/variants/crosschain/NFT.sol:NFT", + "label": "_nonces", + "offset": 0, + "slot": "14", + "type": "t_mapping(t_address,t_uint256)" + }, + { + "astId": 270, + "contract": "contracts/variants/crosschain/NFT.sol:NFT", + "label": "_delegatee", + "offset": 0, + "slot": "15", + "type": "t_mapping(t_address,t_address)" + }, + { + "astId": 275, + "contract": "contracts/variants/crosschain/NFT.sol:NFT", + "label": "_delegateCheckpoints", + "offset": 0, + "slot": "16", + "type": "t_mapping(t_address,t_struct(Trace208)8398_storage)" + }, + { + "astId": 278, + "contract": "contracts/variants/crosschain/NFT.sol:NFT", + "label": "_totalCheckpoints", + "offset": 0, + "slot": "17", + "type": "t_struct(Trace208)8398_storage" + }, + { + "astId": 9751, + "contract": "contracts/variants/crosschain/NFT.sol:NFT", + "label": "_nextTokenId", + "offset": 0, + "slot": "18", + "type": "t_uint256" + }, + { + "astId": 9755, + "contract": "contracts/variants/crosschain/NFT.sol:NFT", + "label": "_proofStorage", + "offset": 0, + "slot": "19", + "type": "t_struct(ProofStorage)10489_storage" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + }, + "t_array(t_struct(Checkpoint208)8403_storage)dyn_storage": { + "base": "t_struct(Checkpoint208)8403_storage", + "encoding": "dynamic_array", + "label": "struct Checkpoints.Checkpoint208[]", + "numberOfBytes": "32" + }, + "t_array(t_uint256)dyn_storage": { + "base": "t_uint256", + "encoding": "dynamic_array", + "label": "uint256[]", + "numberOfBytes": "32" + }, + "t_bool": { + "encoding": "inplace", + "label": "bool", + "numberOfBytes": "1" + }, + "t_bytes32": { + "encoding": "inplace", + "label": "bytes32", + "numberOfBytes": "32" + }, + "t_mapping(t_address,t_address)": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => address)", + "numberOfBytes": "32", + "value": "t_address" + }, + "t_mapping(t_address,t_bool)": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => bool)", + "numberOfBytes": "32", + "value": "t_bool" + }, + "t_mapping(t_address,t_mapping(t_address,t_bool))": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => mapping(address => bool))", + "numberOfBytes": "32", + "value": "t_mapping(t_address,t_bool)" + }, + "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_address,t_struct(Trace208)8398_storage)": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => struct Checkpoints.Trace208)", + "numberOfBytes": "32", + "value": "t_struct(Trace208)8398_storage" + }, + "t_mapping(t_address,t_uint256)": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => uint256)", + "numberOfBytes": "32", + "value": "t_uint256" + }, + "t_mapping(t_bytes32,t_bool)": { + "encoding": "mapping", + "key": "t_bytes32", + "label": "mapping(bytes32 => bool)", + "numberOfBytes": "32", + "value": "t_bool" + }, + "t_mapping(t_uint256,t_address)": { + "encoding": "mapping", + "key": "t_uint256", + "label": "mapping(uint256 => address)", + "numberOfBytes": "32", + "value": "t_address" + }, + "t_mapping(t_uint256,t_string_storage)": { + "encoding": "mapping", + "key": "t_uint256", + "label": "mapping(uint256 => string)", + "numberOfBytes": "32", + "value": "t_string_storage" + }, + "t_mapping(t_uint256,t_uint256)": { + "encoding": "mapping", + "key": "t_uint256", + "label": "mapping(uint256 => uint256)", + "numberOfBytes": "32", + "value": "t_uint256" + }, + "t_mapping(t_uint8,t_uint256)": { + "encoding": "mapping", + "key": "t_uint8", + "label": "mapping(uint8 => uint256)", + "numberOfBytes": "32", + "value": "t_uint256" + }, + "t_string_storage": { + "encoding": "bytes", + "label": "string", + "numberOfBytes": "32" + }, + "t_struct(Checkpoint208)8403_storage": { + "encoding": "inplace", + "label": "struct Checkpoints.Checkpoint208", + "members": [ + { + "astId": 8400, + "contract": "contracts/variants/crosschain/NFT.sol:NFT", + "label": "_key", + "offset": 0, + "slot": "0", + "type": "t_uint48" + }, + { + "astId": 8402, + "contract": "contracts/variants/crosschain/NFT.sol:NFT", + "label": "_value", + "offset": 6, + "slot": "0", + "type": "t_uint208" + } + ], + "numberOfBytes": "32" + }, + "t_struct(ProofStorage)10489_storage": { + "encoding": "inplace", + "label": "struct ProofHandler.ProofStorage", + "members": [ + { + "astId": 10484, + "contract": "contracts/variants/crosschain/NFT.sol:NFT", + "label": "updateAppliedOnChain", + "offset": 0, + "slot": "0", + "type": "t_mapping(t_bytes32,t_bool)" + }, + { + "astId": 10488, + "contract": "contracts/variants/crosschain/NFT.sol:NFT", + "label": "currentNonce", + "offset": 0, + "slot": "1", + "type": "t_mapping(t_uint8,t_uint256)" + } + ], + "numberOfBytes": "64" + }, + "t_struct(Trace208)8398_storage": { + "encoding": "inplace", + "label": "struct Checkpoints.Trace208", + "members": [ + { + "astId": 8397, + "contract": "contracts/variants/crosschain/NFT.sol:NFT", + "label": "_checkpoints", + "offset": 0, + "slot": "0", + "type": "t_array(t_struct(Checkpoint208)8403_storage)dyn_storage" + } + ], + "numberOfBytes": "32" + }, + "t_uint208": { + "encoding": "inplace", + "label": "uint208", + "numberOfBytes": "26" + }, + "t_uint256": { + "encoding": "inplace", + "label": "uint256", + "numberOfBytes": "32" + }, + "t_uint48": { + "encoding": "inplace", + "label": "uint48", + "numberOfBytes": "6" + }, + "t_uint8": { + "encoding": "inplace", + "label": "uint8", + "numberOfBytes": "1" + } + } + } +} \ No newline at end of file diff --git a/deployments/baseSepolia/ProofHandler.json b/deployments/baseSepolia/ProofHandler.json new file mode 100644 index 0000000..3ec826e --- /dev/null +++ b/deployments/baseSepolia/ProofHandler.json @@ -0,0 +1,149 @@ +{ + "address": "0x0152ee45780385dACCCCB128D816031CfFe5F36B", + "abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint8", + "name": "operationType", + "type": "uint8" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "params", + "type": "bytes" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + } + ], + "name": "ProofClaimed", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "contractAddress", + "type": "address" + }, + { + "internalType": "uint8", + "name": "operationType", + "type": "uint8" + }, + { + "internalType": "bytes", + "name": "params", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + } + ], + "name": "generateProof", + "outputs": [ + { + "internalType": "bytes", + "name": "proof", + "type": "bytes" + } + ], + "stateMutability": "pure", + "type": "function" + } + ], + "args": [], + "numDeployments": 1, + "solcInputHash": "96a9008abeaccbd30a9b75989ce7f0fd", + "metadata": "{\"compiler\":{\"version\":\"0.8.20+commit.a1b79de6\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint8\",\"name\":\"operationType\",\"type\":\"uint8\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"params\",\"type\":\"bytes\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"}],\"name\":\"ProofClaimed\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"contractAddress\",\"type\":\"address\"},{\"internalType\":\"uint8\",\"name\":\"operationType\",\"type\":\"uint8\"},{\"internalType\":\"bytes\",\"name\":\"params\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"}],\"name\":\"generateProof\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"proof\",\"type\":\"bytes\"}],\"stateMutability\":\"pure\",\"type\":\"function\"}],\"devdoc\":{\"author\":\"Web3 Hackers Collective\",\"custom:security-contact\":\"julien@strat.cc\",\"details\":\"Handles proof generation, verification, and tracking for cross-chain operations\",\"events\":{\"ProofClaimed(uint8,bytes,uint256)\":{\"details\":\"Emitted when a proof is claimed\"}},\"kind\":\"dev\",\"methods\":{\"generateProof(address,uint8,bytes,uint256)\":{\"params\":{\"contractAddress\":\"Address of contract generating the proof\",\"nonce\":\"Current nonce for this operation type\",\"operationType\":\"Type of operation being performed\",\"params\":\"Operation parameters\"},\"returns\":{\"proof\":\"Encoded proof data\"}},\"getNextNonce(ProofHandler.ProofStorage storage,uint8)\":{\"params\":{\"operationType\":\"Type of operation\",\"storage_\":\"Proof storage struct\"},\"returns\":{\"nonce\":\"Next nonce value\"}},\"incrementNonce(ProofHandler.ProofStorage storage,uint8)\":{\"params\":{\"operationType\":\"Type of operation\",\"storage_\":\"Proof storage struct\"},\"returns\":{\"nonce\":\"New nonce value\"}},\"verifyAndClaimProof(bytes,address,ProofHandler.ProofStorage storage)\":{\"params\":{\"contractAddress\":\"Address of contract claiming the proof\",\"proof\":\"Proof to verify and claim\",\"storage_\":\"Proof storage struct\"},\"returns\":{\"nonce\":\"The operation sequence number\",\"operationType\":\"The type of operation being performed\",\"params\":\"The operation parameters\"}}},\"title\":\"Proof Handler Library\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"generateProof(address,uint8,bytes,uint256)\":{\"notice\":\"Generates a proof for cross-chain operations\"},\"getNextNonce(ProofHandler.ProofStorage storage,uint8)\":{\"notice\":\"Gets the next nonce for an operation type\"},\"incrementNonce(ProofHandler.ProofStorage storage,uint8)\":{\"notice\":\"Increments the nonce for an operation type\"},\"verifyAndClaimProof(bytes,address,ProofHandler.ProofStorage storage)\":{\"notice\":\"Verifies and claims a proof\"}},\"notice\":\"Library for standardized cross-chain proof generation and verification\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/variants/crosschain/ProofHandler.sol\":\"ProofHandler\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"contracts/variants/crosschain/ProofHandler.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity ^0.8.20;\\n\\n/**\\n * @title Proof Handler Library\\n * @author Web3 Hackers Collective\\n * @notice Library for standardized cross-chain proof generation and verification\\n * @dev Handles proof generation, verification, and tracking for cross-chain operations\\n * @custom:security-contact julien@strat.cc\\n */\\nlibrary ProofHandler {\\n /// @notice Tracks which proofs have been applied on each chain\\n struct ProofStorage {\\n mapping(bytes32 => bool) updateAppliedOnChain;\\n mapping(uint8 => uint256) currentNonce;\\n }\\n\\n /// @dev Emitted when a proof is claimed\\n event ProofClaimed(uint8 indexed operationType, bytes params, uint256 nonce);\\n\\n /**\\n * @notice Generates a proof for cross-chain operations\\n * @param contractAddress Address of contract generating the proof\\n * @param operationType Type of operation being performed\\n * @param params Operation parameters\\n * @param nonce Current nonce for this operation type\\n * @return proof Encoded proof data\\n */\\n function generateProof(\\n address contractAddress,\\n uint8 operationType,\\n bytes memory params,\\n uint256 nonce\\n ) public pure returns (bytes memory proof) {\\n bytes32 message = keccak256(\\n abi.encodePacked(contractAddress, operationType, params, nonce)\\n );\\n bytes32 digest = keccak256(abi.encodePacked(\\\"\\\\x19Ethereum Signed Message:\\\\n32\\\", message));\\n\\n return abi.encode(operationType, params, nonce, digest);\\n }\\n\\n /**\\n * @notice Verifies and claims a proof\\n * @param proof Proof to verify and claim\\n * @param contractAddress Address of contract claiming the proof\\n * @param storage_ Proof storage struct\\n * @return operationType The type of operation being performed\\n * @return params The operation parameters\\n * @return nonce The operation sequence number\\n */\\n function verifyAndClaimProof(\\n bytes memory proof,\\n address contractAddress,\\n ProofStorage storage storage_\\n ) public returns (uint8 operationType, bytes memory params, uint256 nonce) {\\n bytes32 digest;\\n (operationType, params, nonce, digest) = abi.decode(\\n proof,\\n (uint8, bytes, uint256, bytes32)\\n );\\n\\n bytes32 proofHash = keccak256(proof);\\n require(!storage_.updateAppliedOnChain[proofHash], \\\"Proof already claimed\\\");\\n require(nonce == storage_.currentNonce[operationType] + 1, \\\"Invalid nonce\\\");\\n\\n bytes32 message = keccak256(\\n abi.encodePacked(contractAddress, operationType, params, nonce)\\n );\\n bytes32 expectedDigest = keccak256(\\n abi.encodePacked(\\\"\\\\x19Ethereum Signed Message:\\\\n32\\\", message)\\n );\\n require(digest == expectedDigest, \\\"Invalid proof\\\");\\n\\n storage_.updateAppliedOnChain[proofHash] = true;\\n storage_.currentNonce[operationType] = nonce;\\n\\n emit ProofClaimed(operationType, params, nonce);\\n\\n return (operationType, params, nonce);\\n }\\n\\n /**\\n * @notice Gets the next nonce for an operation type\\n * @param storage_ Proof storage struct\\n * @param operationType Type of operation\\n * @return nonce Next nonce value\\n */\\n function getNextNonce(\\n ProofStorage storage storage_,\\n uint8 operationType\\n ) public view returns (uint256 nonce) {\\n return storage_.currentNonce[operationType] + 1;\\n }\\n\\n /**\\n * @notice Increments the nonce for an operation type\\n * @param storage_ Proof storage struct\\n * @param operationType Type of operation\\n * @return nonce New nonce value\\n */\\n function incrementNonce(\\n ProofStorage storage storage_,\\n uint8 operationType\\n ) public returns (uint256 nonce) {\\n storage_.currentNonce[operationType]++;\\n return storage_.currentNonce[operationType];\\n }\\n}\\n\",\"keccak256\":\"0x3719e47c508f29977d48842c5c1d27cce7cb289cbb592526f170f98135ff41a7\",\"license\":\"GPL-3.0\"}},\"version\":1}", + "bytecode": "0x61086261003a600b82828239805160001a60731461002d57634e487b7160e01b600052600060045260246000fd5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600436106100565760003560e01c80632b276f581461005b5780633b0d4dd71461008157806373521781146100a1578063c0af6591146100c1575b600080fd5b61006e610069366004610450565b6100f0565b6040519081526020015b60405180910390f35b81801561008d57600080fd5b5061006e61009c366004610450565b610118565b6100b46100af366004610561565b610158565b6040516100789190610619565b8180156100cd57600080fd5b506100e16100dc36600461062c565b610214565b60405161007893929190610683565b60ff811660009081526001808401602052604082205461010f916106c5565b90505b92915050565b60ff81166000908152600183016020526040812080549082610139836106d8565b90915550505060ff166000908152600191909101602052604090205490565b606060008585858560405160200161017394939291906106f1565b6040516020818303038152906040528051906020012090506000816040516020016101ca91907f19457468657265756d205369676e6564204d6573736167653a0a3332000000008152601c810191909152603c0190565b604051602081830303815290604052805190602001209050858585836040516020016101f99493929190610740565b60405160208183030381529060405292505050949350505050565b600060606000808680602001905181019061022f919061076f565b8a516020808d01919091206000818152918b905260409091205494985092965090945092509060ff16156102a25760405162461bcd60e51b8152602060048201526015602482015274141c9bdbd988185b1c9958591e4818db185a5b5959605a1b60448201526064015b60405180910390fd5b60ff8516600090815260018088016020526040909120546102c2916106c5565b83146103005760405162461bcd60e51b815260206004820152600d60248201526c496e76616c6964206e6f6e636560981b6044820152606401610299565b60008786868660405160200161031994939291906106f1565b60405160208183030381529060405280519060200120905060008160405160200161037091907f19457468657265756d205369676e6564204d6573736167653a0a3332000000008152601c810191909152603c0190565b6040516020818303038152906040528051906020012090508084146103c75760405162461bcd60e51b815260206004820152600d60248201526c24b73b30b634b210383937b7b360991b6044820152606401610299565b600083815260208981526040808320805460ff1916600190811790915560ff8b16808552908c019092529182902087905590517f9d572fd94428aa262dfbc3962dbfc27e1c732588d2f37703185192eb7d39a7cc90610429908990899061080a565b60405180910390a25050505093509350939050565b60ff8116811461044d57600080fd5b50565b6000806040838503121561046357600080fd5b8235915060208301356104758161043e565b809150509250929050565b80356001600160a01b038116811461049757600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff811182821017156104db576104db61049c565b604052919050565b600067ffffffffffffffff8211156104fd576104fd61049c565b50601f01601f191660200190565b600082601f83011261051c57600080fd5b813561052f61052a826104e3565b6104b2565b81815284602083860101111561054457600080fd5b816020850160208301376000918101602001919091529392505050565b6000806000806080858703121561057757600080fd5b61058085610480565b935060208501356105908161043e565b9250604085013567ffffffffffffffff8111156105ac57600080fd5b6105b88782880161050b565b949793965093946060013593505050565b60005b838110156105e45781810151838201526020016105cc565b50506000910152565b600081518084526106058160208601602086016105c9565b601f01601f19169290920160200192915050565b60208152600061010f60208301846105ed565b60008060006060848603121561064157600080fd5b833567ffffffffffffffff81111561065857600080fd5b6106648682870161050b565b93505061067360208501610480565b9150604084013590509250925092565b60ff8416815260606020820152600061069f60608301856105ed565b9050826040830152949350505050565b634e487b7160e01b600052601160045260246000fd5b80820180821115610112576101126106af565b6000600182016106ea576106ea6106af565b5060010190565b6bffffffffffffffffffffffff198560601b16815260ff60f81b8460f81b1660148201526000835161072a8160158501602088016105c9565b6015920191820192909252603501949350505050565b60ff8516815260806020820152600061075c60808301866105ed565b6040830194909452506060015292915050565b6000806000806080858703121561078557600080fd5b84516107908161043e565b602086015190945067ffffffffffffffff8111156107ad57600080fd5b8501601f810187136107be57600080fd5b80516107cc61052a826104e3565b8181528860208385010111156107e157600080fd5b6107f28260208301602086016105c9565b60408801516060909801519699909850945050505050565b60408152600061081d60408301856105ed565b9050826020830152939250505056fea26469706673582212203dae3b101192a9db985457cad109d67a3cd7e229e3e6792a1b933b258581f0e664736f6c63430008140033", + "deployedBytecode": "0x73000000000000000000000000000000000000000030146080604052600436106100565760003560e01c80632b276f581461005b5780633b0d4dd71461008157806373521781146100a1578063c0af6591146100c1575b600080fd5b61006e610069366004610450565b6100f0565b6040519081526020015b60405180910390f35b81801561008d57600080fd5b5061006e61009c366004610450565b610118565b6100b46100af366004610561565b610158565b6040516100789190610619565b8180156100cd57600080fd5b506100e16100dc36600461062c565b610214565b60405161007893929190610683565b60ff811660009081526001808401602052604082205461010f916106c5565b90505b92915050565b60ff81166000908152600183016020526040812080549082610139836106d8565b90915550505060ff166000908152600191909101602052604090205490565b606060008585858560405160200161017394939291906106f1565b6040516020818303038152906040528051906020012090506000816040516020016101ca91907f19457468657265756d205369676e6564204d6573736167653a0a3332000000008152601c810191909152603c0190565b604051602081830303815290604052805190602001209050858585836040516020016101f99493929190610740565b60405160208183030381529060405292505050949350505050565b600060606000808680602001905181019061022f919061076f565b8a516020808d01919091206000818152918b905260409091205494985092965090945092509060ff16156102a25760405162461bcd60e51b8152602060048201526015602482015274141c9bdbd988185b1c9958591e4818db185a5b5959605a1b60448201526064015b60405180910390fd5b60ff8516600090815260018088016020526040909120546102c2916106c5565b83146103005760405162461bcd60e51b815260206004820152600d60248201526c496e76616c6964206e6f6e636560981b6044820152606401610299565b60008786868660405160200161031994939291906106f1565b60405160208183030381529060405280519060200120905060008160405160200161037091907f19457468657265756d205369676e6564204d6573736167653a0a3332000000008152601c810191909152603c0190565b6040516020818303038152906040528051906020012090508084146103c75760405162461bcd60e51b815260206004820152600d60248201526c24b73b30b634b210383937b7b360991b6044820152606401610299565b600083815260208981526040808320805460ff1916600190811790915560ff8b16808552908c019092529182902087905590517f9d572fd94428aa262dfbc3962dbfc27e1c732588d2f37703185192eb7d39a7cc90610429908990899061080a565b60405180910390a25050505093509350939050565b60ff8116811461044d57600080fd5b50565b6000806040838503121561046357600080fd5b8235915060208301356104758161043e565b809150509250929050565b80356001600160a01b038116811461049757600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff811182821017156104db576104db61049c565b604052919050565b600067ffffffffffffffff8211156104fd576104fd61049c565b50601f01601f191660200190565b600082601f83011261051c57600080fd5b813561052f61052a826104e3565b6104b2565b81815284602083860101111561054457600080fd5b816020850160208301376000918101602001919091529392505050565b6000806000806080858703121561057757600080fd5b61058085610480565b935060208501356105908161043e565b9250604085013567ffffffffffffffff8111156105ac57600080fd5b6105b88782880161050b565b949793965093946060013593505050565b60005b838110156105e45781810151838201526020016105cc565b50506000910152565b600081518084526106058160208601602086016105c9565b601f01601f19169290920160200192915050565b60208152600061010f60208301846105ed565b60008060006060848603121561064157600080fd5b833567ffffffffffffffff81111561065857600080fd5b6106648682870161050b565b93505061067360208501610480565b9150604084013590509250925092565b60ff8416815260606020820152600061069f60608301856105ed565b9050826040830152949350505050565b634e487b7160e01b600052601160045260246000fd5b80820180821115610112576101126106af565b6000600182016106ea576106ea6106af565b5060010190565b6bffffffffffffffffffffffff198560601b16815260ff60f81b8460f81b1660148201526000835161072a8160158501602088016105c9565b6015920191820192909252603501949350505050565b60ff8516815260806020820152600061075c60808301866105ed565b6040830194909452506060015292915050565b6000806000806080858703121561078557600080fd5b84516107908161043e565b602086015190945067ffffffffffffffff8111156107ad57600080fd5b8501601f810187136107be57600080fd5b80516107cc61052a826104e3565b8181528860208385010111156107e157600080fd5b6107f28260208301602086016105c9565b60408801516060909801519699909850945050505050565b60408152600061081d60408301856105ed565b9050826020830152939250505056fea26469706673582212203dae3b101192a9db985457cad109d67a3cd7e229e3e6792a1b933b258581f0e664736f6c63430008140033", + "devdoc": { + "author": "Web3 Hackers Collective", + "custom:security-contact": "julien@strat.cc", + "details": "Handles proof generation, verification, and tracking for cross-chain operations", + "events": { + "ProofClaimed(uint8,bytes,uint256)": { + "details": "Emitted when a proof is claimed" + } + }, + "kind": "dev", + "methods": { + "generateProof(address,uint8,bytes,uint256)": { + "params": { + "contractAddress": "Address of contract generating the proof", + "nonce": "Current nonce for this operation type", + "operationType": "Type of operation being performed", + "params": "Operation parameters" + }, + "returns": { + "proof": "Encoded proof data" + } + }, + "getNextNonce(ProofHandler.ProofStorage storage,uint8)": { + "params": { + "operationType": "Type of operation", + "storage_": "Proof storage struct" + }, + "returns": { + "nonce": "Next nonce value" + } + }, + "incrementNonce(ProofHandler.ProofStorage storage,uint8)": { + "params": { + "operationType": "Type of operation", + "storage_": "Proof storage struct" + }, + "returns": { + "nonce": "New nonce value" + } + }, + "verifyAndClaimProof(bytes,address,ProofHandler.ProofStorage storage)": { + "params": { + "contractAddress": "Address of contract claiming the proof", + "proof": "Proof to verify and claim", + "storage_": "Proof storage struct" + }, + "returns": { + "nonce": "The operation sequence number", + "operationType": "The type of operation being performed", + "params": "The operation parameters" + } + } + }, + "title": "Proof Handler Library", + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": { + "generateProof(address,uint8,bytes,uint256)": { + "notice": "Generates a proof for cross-chain operations" + }, + "getNextNonce(ProofHandler.ProofStorage storage,uint8)": { + "notice": "Gets the next nonce for an operation type" + }, + "incrementNonce(ProofHandler.ProofStorage storage,uint8)": { + "notice": "Increments the nonce for an operation type" + }, + "verifyAndClaimProof(bytes,address,ProofHandler.ProofStorage storage)": { + "notice": "Verifies and claims a proof" + } + }, + "notice": "Library for standardized cross-chain proof generation and verification", + "version": 1 + }, + "storageLayout": { + "storage": [], + "types": null + } +} \ No newline at end of file diff --git a/deployments/baseSepolia/solcInputs/77ec5f062950e8c4875fd27ffb65d267.json b/deployments/baseSepolia/solcInputs/77ec5f062950e8c4875fd27ffb65d267.json new file mode 100644 index 0000000..8590478 --- /dev/null +++ b/deployments/baseSepolia/solcInputs/77ec5f062950e8c4875fd27ffb65d267.json @@ -0,0 +1,186 @@ +{ + "language": "Solidity", + "sources": { + "@openzeppelin/contracts/access/Ownable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol)\n\npragma solidity ^0.8.20;\n\nimport {Context} from \"../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 * The initial owner is set to the address provided by the deployer. This can\n * 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 /**\n * @dev The caller account is not authorized to perform an operation.\n */\n error OwnableUnauthorizedAccount(address account);\n\n /**\n * @dev The owner is not a valid owner account. (eg. `address(0)`)\n */\n error OwnableInvalidOwner(address owner);\n\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n /**\n * @dev Initializes the contract setting the address provided by the deployer as the initial owner.\n */\n constructor(address initialOwner) {\n if (initialOwner == address(0)) {\n revert OwnableInvalidOwner(address(0));\n }\n _transferOwnership(initialOwner);\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 if (owner() != _msgSender()) {\n revert OwnableUnauthorizedAccount(_msgSender());\n }\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 if (newOwner == address(0)) {\n revert OwnableInvalidOwner(address(0));\n }\n _transferOwnership(newOwner);\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Internal function without access restriction.\n */\n function _transferOwnership(address newOwner) internal virtual {\n address oldOwner = _owner;\n _owner = newOwner;\n emit OwnershipTransferred(oldOwner, newOwner);\n }\n}\n" + }, + "@openzeppelin/contracts/governance/extensions/GovernorCountingSimple.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (governance/extensions/GovernorCountingSimple.sol)\n\npragma solidity ^0.8.20;\n\nimport {Governor} from \"../Governor.sol\";\n\n/**\n * @dev Extension of {Governor} for simple, 3 options, vote counting.\n */\nabstract contract GovernorCountingSimple is Governor {\n /**\n * @dev Supported vote types. Matches Governor Bravo ordering.\n */\n enum VoteType {\n Against,\n For,\n Abstain\n }\n\n struct ProposalVote {\n uint256 againstVotes;\n uint256 forVotes;\n uint256 abstainVotes;\n mapping(address voter => bool) hasVoted;\n }\n\n mapping(uint256 proposalId => ProposalVote) private _proposalVotes;\n\n /**\n * @dev See {IGovernor-COUNTING_MODE}.\n */\n // solhint-disable-next-line func-name-mixedcase\n function COUNTING_MODE() public pure virtual override returns (string memory) {\n return \"support=bravo&quorum=for,abstain\";\n }\n\n /**\n * @dev See {IGovernor-hasVoted}.\n */\n function hasVoted(uint256 proposalId, address account) public view virtual override returns (bool) {\n return _proposalVotes[proposalId].hasVoted[account];\n }\n\n /**\n * @dev Accessor to the internal vote counts.\n */\n function proposalVotes(\n uint256 proposalId\n ) public view virtual returns (uint256 againstVotes, uint256 forVotes, uint256 abstainVotes) {\n ProposalVote storage proposalVote = _proposalVotes[proposalId];\n return (proposalVote.againstVotes, proposalVote.forVotes, proposalVote.abstainVotes);\n }\n\n /**\n * @dev See {Governor-_quorumReached}.\n */\n function _quorumReached(uint256 proposalId) internal view virtual override returns (bool) {\n ProposalVote storage proposalVote = _proposalVotes[proposalId];\n\n return quorum(proposalSnapshot(proposalId)) <= proposalVote.forVotes + proposalVote.abstainVotes;\n }\n\n /**\n * @dev See {Governor-_voteSucceeded}. In this module, the forVotes must be strictly over the againstVotes.\n */\n function _voteSucceeded(uint256 proposalId) internal view virtual override returns (bool) {\n ProposalVote storage proposalVote = _proposalVotes[proposalId];\n\n return proposalVote.forVotes > proposalVote.againstVotes;\n }\n\n /**\n * @dev See {Governor-_countVote}. In this module, the support follows the `VoteType` enum (from Governor Bravo).\n */\n function _countVote(\n uint256 proposalId,\n address account,\n uint8 support,\n uint256 totalWeight,\n bytes memory // params\n ) internal virtual override returns (uint256) {\n ProposalVote storage proposalVote = _proposalVotes[proposalId];\n\n if (proposalVote.hasVoted[account]) {\n revert GovernorAlreadyCastVote(account);\n }\n proposalVote.hasVoted[account] = true;\n\n if (support == uint8(VoteType.Against)) {\n proposalVote.againstVotes += totalWeight;\n } else if (support == uint8(VoteType.For)) {\n proposalVote.forVotes += totalWeight;\n } else if (support == uint8(VoteType.Abstain)) {\n proposalVote.abstainVotes += totalWeight;\n } else {\n revert GovernorInvalidVoteType();\n }\n\n return totalWeight;\n }\n}\n" + }, + "@openzeppelin/contracts/governance/extensions/GovernorSettings.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (governance/extensions/GovernorSettings.sol)\n\npragma solidity ^0.8.20;\n\nimport {Governor} from \"../Governor.sol\";\n\n/**\n * @dev Extension of {Governor} for settings updatable through governance.\n */\nabstract contract GovernorSettings is Governor {\n // amount of token\n uint256 private _proposalThreshold;\n // timepoint: limited to uint48 in core (same as clock() type)\n uint48 private _votingDelay;\n // duration: limited to uint32 in core\n uint32 private _votingPeriod;\n\n event VotingDelaySet(uint256 oldVotingDelay, uint256 newVotingDelay);\n event VotingPeriodSet(uint256 oldVotingPeriod, uint256 newVotingPeriod);\n event ProposalThresholdSet(uint256 oldProposalThreshold, uint256 newProposalThreshold);\n\n /**\n * @dev Initialize the governance parameters.\n */\n constructor(uint48 initialVotingDelay, uint32 initialVotingPeriod, uint256 initialProposalThreshold) {\n _setVotingDelay(initialVotingDelay);\n _setVotingPeriod(initialVotingPeriod);\n _setProposalThreshold(initialProposalThreshold);\n }\n\n /**\n * @dev See {IGovernor-votingDelay}.\n */\n function votingDelay() public view virtual override returns (uint256) {\n return _votingDelay;\n }\n\n /**\n * @dev See {IGovernor-votingPeriod}.\n */\n function votingPeriod() public view virtual override returns (uint256) {\n return _votingPeriod;\n }\n\n /**\n * @dev See {Governor-proposalThreshold}.\n */\n function proposalThreshold() public view virtual override returns (uint256) {\n return _proposalThreshold;\n }\n\n /**\n * @dev Update the voting delay. This operation can only be performed through a governance proposal.\n *\n * Emits a {VotingDelaySet} event.\n */\n function setVotingDelay(uint48 newVotingDelay) public virtual onlyGovernance {\n _setVotingDelay(newVotingDelay);\n }\n\n /**\n * @dev Update the voting period. This operation can only be performed through a governance proposal.\n *\n * Emits a {VotingPeriodSet} event.\n */\n function setVotingPeriod(uint32 newVotingPeriod) public virtual onlyGovernance {\n _setVotingPeriod(newVotingPeriod);\n }\n\n /**\n * @dev Update the proposal threshold. This operation can only be performed through a governance proposal.\n *\n * Emits a {ProposalThresholdSet} event.\n */\n function setProposalThreshold(uint256 newProposalThreshold) public virtual onlyGovernance {\n _setProposalThreshold(newProposalThreshold);\n }\n\n /**\n * @dev Internal setter for the voting delay.\n *\n * Emits a {VotingDelaySet} event.\n */\n function _setVotingDelay(uint48 newVotingDelay) internal virtual {\n emit VotingDelaySet(_votingDelay, newVotingDelay);\n _votingDelay = newVotingDelay;\n }\n\n /**\n * @dev Internal setter for the voting period.\n *\n * Emits a {VotingPeriodSet} event.\n */\n function _setVotingPeriod(uint32 newVotingPeriod) internal virtual {\n if (newVotingPeriod == 0) {\n revert GovernorInvalidVotingPeriod(0);\n }\n emit VotingPeriodSet(_votingPeriod, newVotingPeriod);\n _votingPeriod = newVotingPeriod;\n }\n\n /**\n * @dev Internal setter for the proposal threshold.\n *\n * Emits a {ProposalThresholdSet} event.\n */\n function _setProposalThreshold(uint256 newProposalThreshold) internal virtual {\n emit ProposalThresholdSet(_proposalThreshold, newProposalThreshold);\n _proposalThreshold = newProposalThreshold;\n }\n}\n" + }, + "@openzeppelin/contracts/governance/extensions/GovernorVotes.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (governance/extensions/GovernorVotes.sol)\n\npragma solidity ^0.8.20;\n\nimport {Governor} from \"../Governor.sol\";\nimport {IVotes} from \"../utils/IVotes.sol\";\nimport {IERC5805} from \"../../interfaces/IERC5805.sol\";\nimport {SafeCast} from \"../../utils/math/SafeCast.sol\";\nimport {Time} from \"../../utils/types/Time.sol\";\n\n/**\n * @dev Extension of {Governor} for voting weight extraction from an {ERC20Votes} token, or since v4.5 an {ERC721Votes}\n * token.\n */\nabstract contract GovernorVotes is Governor {\n IERC5805 private immutable _token;\n\n constructor(IVotes tokenAddress) {\n _token = IERC5805(address(tokenAddress));\n }\n\n /**\n * @dev The token that voting power is sourced from.\n */\n function token() public view virtual returns (IERC5805) {\n return _token;\n }\n\n /**\n * @dev Clock (as specified in ERC-6372) is set to match the token's clock. Fallback to block numbers if the token\n * does not implement ERC-6372.\n */\n function clock() public view virtual override returns (uint48) {\n try token().clock() returns (uint48 timepoint) {\n return timepoint;\n } catch {\n return Time.blockNumber();\n }\n }\n\n /**\n * @dev Machine-readable description of the clock as specified in ERC-6372.\n */\n // solhint-disable-next-line func-name-mixedcase\n function CLOCK_MODE() public view virtual override returns (string memory) {\n try token().CLOCK_MODE() returns (string memory clockmode) {\n return clockmode;\n } catch {\n return \"mode=blocknumber&from=default\";\n }\n }\n\n /**\n * Read the voting weight from the token's built in snapshot mechanism (see {Governor-_getVotes}).\n */\n function _getVotes(\n address account,\n uint256 timepoint,\n bytes memory /*params*/\n ) internal view virtual override returns (uint256) {\n return token().getPastVotes(account, timepoint);\n }\n}\n" + }, + "@openzeppelin/contracts/governance/extensions/GovernorVotesQuorumFraction.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (governance/extensions/GovernorVotesQuorumFraction.sol)\n\npragma solidity ^0.8.20;\n\nimport {GovernorVotes} from \"./GovernorVotes.sol\";\nimport {SafeCast} from \"../../utils/math/SafeCast.sol\";\nimport {Checkpoints} from \"../../utils/structs/Checkpoints.sol\";\n\n/**\n * @dev Extension of {Governor} for voting weight extraction from an {ERC20Votes} token and a quorum expressed as a\n * fraction of the total supply.\n */\nabstract contract GovernorVotesQuorumFraction is GovernorVotes {\n using Checkpoints for Checkpoints.Trace208;\n\n Checkpoints.Trace208 private _quorumNumeratorHistory;\n\n event QuorumNumeratorUpdated(uint256 oldQuorumNumerator, uint256 newQuorumNumerator);\n\n /**\n * @dev The quorum set is not a valid fraction.\n */\n error GovernorInvalidQuorumFraction(uint256 quorumNumerator, uint256 quorumDenominator);\n\n /**\n * @dev Initialize quorum as a fraction of the token's total supply.\n *\n * The fraction is specified as `numerator / denominator`. By default the denominator is 100, so quorum is\n * specified as a percent: a numerator of 10 corresponds to quorum being 10% of total supply. The denominator can be\n * customized by overriding {quorumDenominator}.\n */\n constructor(uint256 quorumNumeratorValue) {\n _updateQuorumNumerator(quorumNumeratorValue);\n }\n\n /**\n * @dev Returns the current quorum numerator. See {quorumDenominator}.\n */\n function quorumNumerator() public view virtual returns (uint256) {\n return _quorumNumeratorHistory.latest();\n }\n\n /**\n * @dev Returns the quorum numerator at a specific timepoint. See {quorumDenominator}.\n */\n function quorumNumerator(uint256 timepoint) public view virtual returns (uint256) {\n uint256 length = _quorumNumeratorHistory._checkpoints.length;\n\n // Optimistic search, check the latest checkpoint\n Checkpoints.Checkpoint208 storage latest = _quorumNumeratorHistory._checkpoints[length - 1];\n uint48 latestKey = latest._key;\n uint208 latestValue = latest._value;\n if (latestKey <= timepoint) {\n return latestValue;\n }\n\n // Otherwise, do the binary search\n return _quorumNumeratorHistory.upperLookupRecent(SafeCast.toUint48(timepoint));\n }\n\n /**\n * @dev Returns the quorum denominator. Defaults to 100, but may be overridden.\n */\n function quorumDenominator() public view virtual returns (uint256) {\n return 100;\n }\n\n /**\n * @dev Returns the quorum for a timepoint, in terms of number of votes: `supply * numerator / denominator`.\n */\n function quorum(uint256 timepoint) public view virtual override returns (uint256) {\n return (token().getPastTotalSupply(timepoint) * quorumNumerator(timepoint)) / quorumDenominator();\n }\n\n /**\n * @dev Changes the quorum numerator.\n *\n * Emits a {QuorumNumeratorUpdated} event.\n *\n * Requirements:\n *\n * - Must be called through a governance proposal.\n * - New numerator must be smaller or equal to the denominator.\n */\n function updateQuorumNumerator(uint256 newQuorumNumerator) external virtual onlyGovernance {\n _updateQuorumNumerator(newQuorumNumerator);\n }\n\n /**\n * @dev Changes the quorum numerator.\n *\n * Emits a {QuorumNumeratorUpdated} event.\n *\n * Requirements:\n *\n * - New numerator must be smaller or equal to the denominator.\n */\n function _updateQuorumNumerator(uint256 newQuorumNumerator) internal virtual {\n uint256 denominator = quorumDenominator();\n if (newQuorumNumerator > denominator) {\n revert GovernorInvalidQuorumFraction(newQuorumNumerator, denominator);\n }\n\n uint256 oldQuorumNumerator = quorumNumerator();\n _quorumNumeratorHistory.push(clock(), SafeCast.toUint208(newQuorumNumerator));\n\n emit QuorumNumeratorUpdated(oldQuorumNumerator, newQuorumNumerator);\n }\n}\n" + }, + "@openzeppelin/contracts/governance/Governor.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (governance/Governor.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC721Receiver} from \"../token/ERC721/IERC721Receiver.sol\";\nimport {IERC1155Receiver} from \"../token/ERC1155/IERC1155Receiver.sol\";\nimport {EIP712} from \"../utils/cryptography/EIP712.sol\";\nimport {SignatureChecker} from \"../utils/cryptography/SignatureChecker.sol\";\nimport {IERC165, ERC165} from \"../utils/introspection/ERC165.sol\";\nimport {SafeCast} from \"../utils/math/SafeCast.sol\";\nimport {DoubleEndedQueue} from \"../utils/structs/DoubleEndedQueue.sol\";\nimport {Address} from \"../utils/Address.sol\";\nimport {Context} from \"../utils/Context.sol\";\nimport {Nonces} from \"../utils/Nonces.sol\";\nimport {IGovernor, IERC6372} from \"./IGovernor.sol\";\n\n/**\n * @dev Core of the governance system, designed to be extended through various modules.\n *\n * This contract is abstract and requires several functions to be implemented in various modules:\n *\n * - A counting module must implement {quorum}, {_quorumReached}, {_voteSucceeded} and {_countVote}\n * - A voting module must implement {_getVotes}\n * - Additionally, {votingPeriod} must also be implemented\n */\nabstract contract Governor is Context, ERC165, EIP712, Nonces, IGovernor, IERC721Receiver, IERC1155Receiver {\n using DoubleEndedQueue for DoubleEndedQueue.Bytes32Deque;\n\n bytes32 public constant BALLOT_TYPEHASH =\n keccak256(\"Ballot(uint256 proposalId,uint8 support,address voter,uint256 nonce)\");\n bytes32 public constant EXTENDED_BALLOT_TYPEHASH =\n keccak256(\n \"ExtendedBallot(uint256 proposalId,uint8 support,address voter,uint256 nonce,string reason,bytes params)\"\n );\n\n struct ProposalCore {\n address proposer;\n uint48 voteStart;\n uint32 voteDuration;\n bool executed;\n bool canceled;\n uint48 etaSeconds;\n }\n\n bytes32 private constant ALL_PROPOSAL_STATES_BITMAP = bytes32((2 ** (uint8(type(ProposalState).max) + 1)) - 1);\n string private _name;\n\n mapping(uint256 proposalId => ProposalCore) private _proposals;\n\n // This queue keeps track of the governor operating on itself. Calls to functions protected by the {onlyGovernance}\n // modifier needs to be whitelisted in this queue. Whitelisting is set in {execute}, consumed by the\n // {onlyGovernance} modifier and eventually reset after {_executeOperations} completes. This ensures that the\n // execution of {onlyGovernance} protected calls can only be achieved through successful proposals.\n DoubleEndedQueue.Bytes32Deque private _governanceCall;\n\n /**\n * @dev Restricts a function so it can only be executed through governance proposals. For example, governance\n * parameter setters in {GovernorSettings} are protected using this modifier.\n *\n * The governance executing address may be different from the Governor's own address, for example it could be a\n * timelock. This can be customized by modules by overriding {_executor}. The executor is only able to invoke these\n * functions during the execution of the governor's {execute} function, and not under any other circumstances. Thus,\n * for example, additional timelock proposers are not able to change governance parameters without going through the\n * governance protocol (since v4.6).\n */\n modifier onlyGovernance() {\n _checkGovernance();\n _;\n }\n\n /**\n * @dev Sets the value for {name} and {version}\n */\n constructor(string memory name_) EIP712(name_, version()) {\n _name = name_;\n }\n\n /**\n * @dev Function to receive ETH that will be handled by the governor (disabled if executor is a third party contract)\n */\n receive() external payable virtual {\n if (_executor() != address(this)) {\n revert GovernorDisabledDeposit();\n }\n }\n\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165, ERC165) returns (bool) {\n return\n interfaceId == type(IGovernor).interfaceId ||\n interfaceId == type(IERC1155Receiver).interfaceId ||\n super.supportsInterface(interfaceId);\n }\n\n /**\n * @dev See {IGovernor-name}.\n */\n function name() public view virtual returns (string memory) {\n return _name;\n }\n\n /**\n * @dev See {IGovernor-version}.\n */\n function version() public view virtual returns (string memory) {\n return \"1\";\n }\n\n /**\n * @dev See {IGovernor-hashProposal}.\n *\n * The proposal id is produced by hashing the ABI encoded `targets` array, the `values` array, the `calldatas` array\n * and the descriptionHash (bytes32 which itself is the keccak256 hash of the description string). This proposal id\n * can be produced from the proposal data which is part of the {ProposalCreated} event. It can even be computed in\n * advance, before the proposal is submitted.\n *\n * Note that the chainId and the governor address are not part of the proposal id computation. Consequently, the\n * same proposal (with same operation and same description) will have the same id if submitted on multiple governors\n * across multiple networks. This also means that in order to execute the same operation twice (on the same\n * governor) the proposer will have to change the description in order to avoid proposal id conflicts.\n */\n function hashProposal(\n address[] memory targets,\n uint256[] memory values,\n bytes[] memory calldatas,\n bytes32 descriptionHash\n ) public pure virtual returns (uint256) {\n return uint256(keccak256(abi.encode(targets, values, calldatas, descriptionHash)));\n }\n\n /**\n * @dev See {IGovernor-state}.\n */\n function state(uint256 proposalId) public view virtual returns (ProposalState) {\n // We read the struct fields into the stack at once so Solidity emits a single SLOAD\n ProposalCore storage proposal = _proposals[proposalId];\n bool proposalExecuted = proposal.executed;\n bool proposalCanceled = proposal.canceled;\n\n if (proposalExecuted) {\n return ProposalState.Executed;\n }\n\n if (proposalCanceled) {\n return ProposalState.Canceled;\n }\n\n uint256 snapshot = proposalSnapshot(proposalId);\n\n if (snapshot == 0) {\n revert GovernorNonexistentProposal(proposalId);\n }\n\n uint256 currentTimepoint = clock();\n\n if (snapshot >= currentTimepoint) {\n return ProposalState.Pending;\n }\n\n uint256 deadline = proposalDeadline(proposalId);\n\n if (deadline >= currentTimepoint) {\n return ProposalState.Active;\n } else if (!_quorumReached(proposalId) || !_voteSucceeded(proposalId)) {\n return ProposalState.Defeated;\n } else if (proposalEta(proposalId) == 0) {\n return ProposalState.Succeeded;\n } else {\n return ProposalState.Queued;\n }\n }\n\n /**\n * @dev See {IGovernor-proposalThreshold}.\n */\n function proposalThreshold() public view virtual returns (uint256) {\n return 0;\n }\n\n /**\n * @dev See {IGovernor-proposalSnapshot}.\n */\n function proposalSnapshot(uint256 proposalId) public view virtual returns (uint256) {\n return _proposals[proposalId].voteStart;\n }\n\n /**\n * @dev See {IGovernor-proposalDeadline}.\n */\n function proposalDeadline(uint256 proposalId) public view virtual returns (uint256) {\n return _proposals[proposalId].voteStart + _proposals[proposalId].voteDuration;\n }\n\n /**\n * @dev See {IGovernor-proposalProposer}.\n */\n function proposalProposer(uint256 proposalId) public view virtual returns (address) {\n return _proposals[proposalId].proposer;\n }\n\n /**\n * @dev See {IGovernor-proposalEta}.\n */\n function proposalEta(uint256 proposalId) public view virtual returns (uint256) {\n return _proposals[proposalId].etaSeconds;\n }\n\n /**\n * @dev See {IGovernor-proposalNeedsQueuing}.\n */\n function proposalNeedsQueuing(uint256) public view virtual returns (bool) {\n return false;\n }\n\n /**\n * @dev Reverts if the `msg.sender` is not the executor. In case the executor is not this contract\n * itself, the function reverts if `msg.data` is not whitelisted as a result of an {execute}\n * operation. See {onlyGovernance}.\n */\n function _checkGovernance() internal virtual {\n if (_executor() != _msgSender()) {\n revert GovernorOnlyExecutor(_msgSender());\n }\n if (_executor() != address(this)) {\n bytes32 msgDataHash = keccak256(_msgData());\n // loop until popping the expected operation - throw if deque is empty (operation not authorized)\n while (_governanceCall.popFront() != msgDataHash) {}\n }\n }\n\n /**\n * @dev Amount of votes already cast passes the threshold limit.\n */\n function _quorumReached(uint256 proposalId) internal view virtual returns (bool);\n\n /**\n * @dev Is the proposal successful or not.\n */\n function _voteSucceeded(uint256 proposalId) internal view virtual returns (bool);\n\n /**\n * @dev Get the voting weight of `account` at a specific `timepoint`, for a vote as described by `params`.\n */\n function _getVotes(address account, uint256 timepoint, bytes memory params) internal view virtual returns (uint256);\n\n /**\n * @dev Register a vote for `proposalId` by `account` with a given `support`, voting `weight` and voting `params`.\n *\n * Note: Support is generic and can represent various things depending on the voting system used.\n */\n function _countVote(\n uint256 proposalId,\n address account,\n uint8 support,\n uint256 totalWeight,\n bytes memory params\n ) internal virtual returns (uint256);\n\n /**\n * @dev Default additional encoded parameters used by castVote methods that don't include them\n *\n * Note: Should be overridden by specific implementations to use an appropriate value, the\n * meaning of the additional params, in the context of that implementation\n */\n function _defaultParams() internal view virtual returns (bytes memory) {\n return \"\";\n }\n\n /**\n * @dev See {IGovernor-propose}. This function has opt-in frontrunning protection, described in {_isValidDescriptionForProposer}.\n */\n function propose(\n address[] memory targets,\n uint256[] memory values,\n bytes[] memory calldatas,\n string memory description\n ) public virtual returns (uint256) {\n address proposer = _msgSender();\n\n // check description restriction\n if (!_isValidDescriptionForProposer(proposer, description)) {\n revert GovernorRestrictedProposer(proposer);\n }\n\n // check proposal threshold\n uint256 votesThreshold = proposalThreshold();\n if (votesThreshold > 0) {\n uint256 proposerVotes = getVotes(proposer, clock() - 1);\n if (proposerVotes < votesThreshold) {\n revert GovernorInsufficientProposerVotes(proposer, proposerVotes, votesThreshold);\n }\n }\n\n return _propose(targets, values, calldatas, description, proposer);\n }\n\n /**\n * @dev Internal propose mechanism. Can be overridden to add more logic on proposal creation.\n *\n * Emits a {IGovernor-ProposalCreated} event.\n */\n function _propose(\n address[] memory targets,\n uint256[] memory values,\n bytes[] memory calldatas,\n string memory description,\n address proposer\n ) internal virtual returns (uint256 proposalId) {\n proposalId = hashProposal(targets, values, calldatas, keccak256(bytes(description)));\n\n if (targets.length != values.length || targets.length != calldatas.length || targets.length == 0) {\n revert GovernorInvalidProposalLength(targets.length, calldatas.length, values.length);\n }\n if (_proposals[proposalId].voteStart != 0) {\n revert GovernorUnexpectedProposalState(proposalId, state(proposalId), bytes32(0));\n }\n\n uint256 snapshot = clock() + votingDelay();\n uint256 duration = votingPeriod();\n\n ProposalCore storage proposal = _proposals[proposalId];\n proposal.proposer = proposer;\n proposal.voteStart = SafeCast.toUint48(snapshot);\n proposal.voteDuration = SafeCast.toUint32(duration);\n\n emit ProposalCreated(\n proposalId,\n proposer,\n targets,\n values,\n new string[](targets.length),\n calldatas,\n snapshot,\n snapshot + duration,\n description\n );\n\n // Using a named return variable to avoid stack too deep errors\n }\n\n /**\n * @dev See {IGovernor-queue}.\n */\n function queue(\n address[] memory targets,\n uint256[] memory values,\n bytes[] memory calldatas,\n bytes32 descriptionHash\n ) public virtual returns (uint256) {\n uint256 proposalId = hashProposal(targets, values, calldatas, descriptionHash);\n\n _validateStateBitmap(proposalId, _encodeStateBitmap(ProposalState.Succeeded));\n\n uint48 etaSeconds = _queueOperations(proposalId, targets, values, calldatas, descriptionHash);\n\n if (etaSeconds != 0) {\n _proposals[proposalId].etaSeconds = etaSeconds;\n emit ProposalQueued(proposalId, etaSeconds);\n } else {\n revert GovernorQueueNotImplemented();\n }\n\n return proposalId;\n }\n\n /**\n * @dev Internal queuing mechanism. Can be overridden (without a super call) to modify the way queuing is\n * performed (for example adding a vault/timelock).\n *\n * This is empty by default, and must be overridden to implement queuing.\n *\n * This function returns a timestamp that describes the expected ETA for execution. If the returned value is 0\n * (which is the default value), the core will consider queueing did not succeed, and the public {queue} function\n * will revert.\n *\n * NOTE: Calling this function directly will NOT check the current state of the proposal, or emit the\n * `ProposalQueued` event. Queuing a proposal should be done using {queue}.\n */\n function _queueOperations(\n uint256 /*proposalId*/,\n address[] memory /*targets*/,\n uint256[] memory /*values*/,\n bytes[] memory /*calldatas*/,\n bytes32 /*descriptionHash*/\n ) internal virtual returns (uint48) {\n return 0;\n }\n\n /**\n * @dev See {IGovernor-execute}.\n */\n function execute(\n address[] memory targets,\n uint256[] memory values,\n bytes[] memory calldatas,\n bytes32 descriptionHash\n ) public payable virtual returns (uint256) {\n uint256 proposalId = hashProposal(targets, values, calldatas, descriptionHash);\n\n _validateStateBitmap(\n proposalId,\n _encodeStateBitmap(ProposalState.Succeeded) | _encodeStateBitmap(ProposalState.Queued)\n );\n\n // mark as executed before calls to avoid reentrancy\n _proposals[proposalId].executed = true;\n\n // before execute: register governance call in queue.\n if (_executor() != address(this)) {\n for (uint256 i = 0; i < targets.length; ++i) {\n if (targets[i] == address(this)) {\n _governanceCall.pushBack(keccak256(calldatas[i]));\n }\n }\n }\n\n _executeOperations(proposalId, targets, values, calldatas, descriptionHash);\n\n // after execute: cleanup governance call queue.\n if (_executor() != address(this) && !_governanceCall.empty()) {\n _governanceCall.clear();\n }\n\n emit ProposalExecuted(proposalId);\n\n return proposalId;\n }\n\n /**\n * @dev Internal execution mechanism. Can be overridden (without a super call) to modify the way execution is\n * performed (for example adding a vault/timelock).\n *\n * NOTE: Calling this function directly will NOT check the current state of the proposal, set the executed flag to\n * true or emit the `ProposalExecuted` event. Executing a proposal should be done using {execute} or {_execute}.\n */\n function _executeOperations(\n uint256 /* proposalId */,\n address[] memory targets,\n uint256[] memory values,\n bytes[] memory calldatas,\n bytes32 /*descriptionHash*/\n ) internal virtual {\n for (uint256 i = 0; i < targets.length; ++i) {\n (bool success, bytes memory returndata) = targets[i].call{value: values[i]}(calldatas[i]);\n Address.verifyCallResult(success, returndata);\n }\n }\n\n /**\n * @dev See {IGovernor-cancel}.\n */\n function cancel(\n address[] memory targets,\n uint256[] memory values,\n bytes[] memory calldatas,\n bytes32 descriptionHash\n ) public virtual returns (uint256) {\n // The proposalId will be recomputed in the `_cancel` call further down. However we need the value before we\n // do the internal call, because we need to check the proposal state BEFORE the internal `_cancel` call\n // changes it. The `hashProposal` duplication has a cost that is limited, and that we accept.\n uint256 proposalId = hashProposal(targets, values, calldatas, descriptionHash);\n\n // public cancel restrictions (on top of existing _cancel restrictions).\n _validateStateBitmap(proposalId, _encodeStateBitmap(ProposalState.Pending));\n if (_msgSender() != proposalProposer(proposalId)) {\n revert GovernorOnlyProposer(_msgSender());\n }\n\n return _cancel(targets, values, calldatas, descriptionHash);\n }\n\n /**\n * @dev Internal cancel mechanism with minimal restrictions. A proposal can be cancelled in any state other than\n * Canceled, Expired, or Executed. Once cancelled a proposal can't be re-submitted.\n *\n * Emits a {IGovernor-ProposalCanceled} event.\n */\n function _cancel(\n address[] memory targets,\n uint256[] memory values,\n bytes[] memory calldatas,\n bytes32 descriptionHash\n ) internal virtual returns (uint256) {\n uint256 proposalId = hashProposal(targets, values, calldatas, descriptionHash);\n\n _validateStateBitmap(\n proposalId,\n ALL_PROPOSAL_STATES_BITMAP ^\n _encodeStateBitmap(ProposalState.Canceled) ^\n _encodeStateBitmap(ProposalState.Expired) ^\n _encodeStateBitmap(ProposalState.Executed)\n );\n\n _proposals[proposalId].canceled = true;\n emit ProposalCanceled(proposalId);\n\n return proposalId;\n }\n\n /**\n * @dev See {IGovernor-getVotes}.\n */\n function getVotes(address account, uint256 timepoint) public view virtual returns (uint256) {\n return _getVotes(account, timepoint, _defaultParams());\n }\n\n /**\n * @dev See {IGovernor-getVotesWithParams}.\n */\n function getVotesWithParams(\n address account,\n uint256 timepoint,\n bytes memory params\n ) public view virtual returns (uint256) {\n return _getVotes(account, timepoint, params);\n }\n\n /**\n * @dev See {IGovernor-castVote}.\n */\n function castVote(uint256 proposalId, uint8 support) public virtual returns (uint256) {\n address voter = _msgSender();\n return _castVote(proposalId, voter, support, \"\");\n }\n\n /**\n * @dev See {IGovernor-castVoteWithReason}.\n */\n function castVoteWithReason(\n uint256 proposalId,\n uint8 support,\n string calldata reason\n ) public virtual returns (uint256) {\n address voter = _msgSender();\n return _castVote(proposalId, voter, support, reason);\n }\n\n /**\n * @dev See {IGovernor-castVoteWithReasonAndParams}.\n */\n function castVoteWithReasonAndParams(\n uint256 proposalId,\n uint8 support,\n string calldata reason,\n bytes memory params\n ) public virtual returns (uint256) {\n address voter = _msgSender();\n return _castVote(proposalId, voter, support, reason, params);\n }\n\n /**\n * @dev See {IGovernor-castVoteBySig}.\n */\n function castVoteBySig(\n uint256 proposalId,\n uint8 support,\n address voter,\n bytes memory signature\n ) public virtual returns (uint256) {\n bool valid = SignatureChecker.isValidSignatureNow(\n voter,\n _hashTypedDataV4(keccak256(abi.encode(BALLOT_TYPEHASH, proposalId, support, voter, _useNonce(voter)))),\n signature\n );\n\n if (!valid) {\n revert GovernorInvalidSignature(voter);\n }\n\n return _castVote(proposalId, voter, support, \"\");\n }\n\n /**\n * @dev See {IGovernor-castVoteWithReasonAndParamsBySig}.\n */\n function castVoteWithReasonAndParamsBySig(\n uint256 proposalId,\n uint8 support,\n address voter,\n string calldata reason,\n bytes memory params,\n bytes memory signature\n ) public virtual returns (uint256) {\n bool valid = SignatureChecker.isValidSignatureNow(\n voter,\n _hashTypedDataV4(\n keccak256(\n abi.encode(\n EXTENDED_BALLOT_TYPEHASH,\n proposalId,\n support,\n voter,\n _useNonce(voter),\n keccak256(bytes(reason)),\n keccak256(params)\n )\n )\n ),\n signature\n );\n\n if (!valid) {\n revert GovernorInvalidSignature(voter);\n }\n\n return _castVote(proposalId, voter, support, reason, params);\n }\n\n /**\n * @dev Internal vote casting mechanism: Check that the vote is pending, that it has not been cast yet, retrieve\n * voting weight using {IGovernor-getVotes} and call the {_countVote} internal function. Uses the _defaultParams().\n *\n * Emits a {IGovernor-VoteCast} event.\n */\n function _castVote(\n uint256 proposalId,\n address account,\n uint8 support,\n string memory reason\n ) internal virtual returns (uint256) {\n return _castVote(proposalId, account, support, reason, _defaultParams());\n }\n\n /**\n * @dev Internal vote casting mechanism: Check that the vote is pending, that it has not been cast yet, retrieve\n * voting weight using {IGovernor-getVotes} and call the {_countVote} internal function.\n *\n * Emits a {IGovernor-VoteCast} event.\n */\n function _castVote(\n uint256 proposalId,\n address account,\n uint8 support,\n string memory reason,\n bytes memory params\n ) internal virtual returns (uint256) {\n _validateStateBitmap(proposalId, _encodeStateBitmap(ProposalState.Active));\n\n uint256 totalWeight = _getVotes(account, proposalSnapshot(proposalId), params);\n uint256 votedWeight = _countVote(proposalId, account, support, totalWeight, params);\n\n if (params.length == 0) {\n emit VoteCast(account, proposalId, support, votedWeight, reason);\n } else {\n emit VoteCastWithParams(account, proposalId, support, votedWeight, reason, params);\n }\n\n return votedWeight;\n }\n\n /**\n * @dev Relays a transaction or function call to an arbitrary target. In cases where the governance executor\n * is some contract other than the governor itself, like when using a timelock, this function can be invoked\n * in a governance proposal to recover tokens or Ether that was sent to the governor contract by mistake.\n * Note that if the executor is simply the governor itself, use of `relay` is redundant.\n */\n function relay(address target, uint256 value, bytes calldata data) external payable virtual onlyGovernance {\n (bool success, bytes memory returndata) = target.call{value: value}(data);\n Address.verifyCallResult(success, returndata);\n }\n\n /**\n * @dev Address through which the governor executes action. Will be overloaded by module that execute actions\n * through another contract such as a timelock.\n */\n function _executor() internal view virtual returns (address) {\n return address(this);\n }\n\n /**\n * @dev See {IERC721Receiver-onERC721Received}.\n * Receiving tokens is disabled if the governance executor is other than the governor itself (eg. when using with a timelock).\n */\n function onERC721Received(address, address, uint256, bytes memory) public virtual returns (bytes4) {\n if (_executor() != address(this)) {\n revert GovernorDisabledDeposit();\n }\n return this.onERC721Received.selector;\n }\n\n /**\n * @dev See {IERC1155Receiver-onERC1155Received}.\n * Receiving tokens is disabled if the governance executor is other than the governor itself (eg. when using with a timelock).\n */\n function onERC1155Received(address, address, uint256, uint256, bytes memory) public virtual returns (bytes4) {\n if (_executor() != address(this)) {\n revert GovernorDisabledDeposit();\n }\n return this.onERC1155Received.selector;\n }\n\n /**\n * @dev See {IERC1155Receiver-onERC1155BatchReceived}.\n * Receiving tokens is disabled if the governance executor is other than the governor itself (eg. when using with a timelock).\n */\n function onERC1155BatchReceived(\n address,\n address,\n uint256[] memory,\n uint256[] memory,\n bytes memory\n ) public virtual returns (bytes4) {\n if (_executor() != address(this)) {\n revert GovernorDisabledDeposit();\n }\n return this.onERC1155BatchReceived.selector;\n }\n\n /**\n * @dev Encodes a `ProposalState` into a `bytes32` representation where each bit enabled corresponds to\n * the underlying position in the `ProposalState` enum. For example:\n *\n * 0x000...10000\n * ^^^^^^------ ...\n * ^----- Succeeded\n * ^---- Defeated\n * ^--- Canceled\n * ^-- Active\n * ^- Pending\n */\n function _encodeStateBitmap(ProposalState proposalState) internal pure returns (bytes32) {\n return bytes32(1 << uint8(proposalState));\n }\n\n /**\n * @dev Check that the current state of a proposal matches the requirements described by the `allowedStates` bitmap.\n * This bitmap should be built using `_encodeStateBitmap`.\n *\n * If requirements are not met, reverts with a {GovernorUnexpectedProposalState} error.\n */\n function _validateStateBitmap(uint256 proposalId, bytes32 allowedStates) private view returns (ProposalState) {\n ProposalState currentState = state(proposalId);\n if (_encodeStateBitmap(currentState) & allowedStates == bytes32(0)) {\n revert GovernorUnexpectedProposalState(proposalId, currentState, allowedStates);\n }\n return currentState;\n }\n\n /*\n * @dev Check if the proposer is authorized to submit a proposal with the given description.\n *\n * If the proposal description ends with `#proposer=0x???`, where `0x???` is an address written as a hex string\n * (case insensitive), then the submission of this proposal will only be authorized to said address.\n *\n * This is used for frontrunning protection. By adding this pattern at the end of their proposal, one can ensure\n * that no other address can submit the same proposal. An attacker would have to either remove or change that part,\n * which would result in a different proposal id.\n *\n * If the description does not match this pattern, it is unrestricted and anyone can submit it. This includes:\n * - If the `0x???` part is not a valid hex string.\n * - If the `0x???` part is a valid hex string, but does not contain exactly 40 hex digits.\n * - If it ends with the expected suffix followed by newlines or other whitespace.\n * - If it ends with some other similar suffix, e.g. `#other=abc`.\n * - If it does not end with any such suffix.\n */\n function _isValidDescriptionForProposer(\n address proposer,\n string memory description\n ) internal view virtual returns (bool) {\n uint256 len = bytes(description).length;\n\n // Length is too short to contain a valid proposer suffix\n if (len < 52) {\n return true;\n }\n\n // Extract what would be the `#proposer=0x` marker beginning the suffix\n bytes12 marker;\n assembly (\"memory-safe\") {\n // - Start of the string contents in memory = description + 32\n // - First character of the marker = len - 52\n // - Length of \"#proposer=0x0000000000000000000000000000000000000000\" = 52\n // - We read the memory word starting at the first character of the marker:\n // - (description + 32) + (len - 52) = description + (len - 20)\n // - Note: Solidity will ignore anything past the first 12 bytes\n marker := mload(add(description, sub(len, 20)))\n }\n\n // If the marker is not found, there is no proposer suffix to check\n if (marker != bytes12(\"#proposer=0x\")) {\n return true;\n }\n\n // Parse the 40 characters following the marker as uint160\n uint160 recovered = 0;\n for (uint256 i = len - 40; i < len; ++i) {\n (bool isHex, uint8 value) = _tryHexToUint(bytes(description)[i]);\n // If any of the characters is not a hex digit, ignore the suffix entirely\n if (!isHex) {\n return true;\n }\n recovered = (recovered << 4) | value;\n }\n\n return recovered == uint160(proposer);\n }\n\n /**\n * @dev Try to parse a character from a string as a hex value. Returns `(true, value)` if the char is in\n * `[0-9a-fA-F]` and `(false, 0)` otherwise. Value is guaranteed to be in the range `0 <= value < 16`\n */\n function _tryHexToUint(bytes1 char) private pure returns (bool isHex, uint8 value) {\n uint8 c = uint8(char);\n unchecked {\n // Case 0-9\n if (47 < c && c < 58) {\n return (true, c - 48);\n }\n // Case A-F\n else if (64 < c && c < 71) {\n return (true, c - 55);\n }\n // Case a-f\n else if (96 < c && c < 103) {\n return (true, c - 87);\n }\n // Else: not a hex char\n else {\n return (false, 0);\n }\n }\n }\n\n /**\n * @inheritdoc IERC6372\n */\n function clock() public view virtual returns (uint48);\n\n /**\n * @inheritdoc IERC6372\n */\n // solhint-disable-next-line func-name-mixedcase\n function CLOCK_MODE() public view virtual returns (string memory);\n\n /**\n * @inheritdoc IGovernor\n */\n function votingDelay() public view virtual returns (uint256);\n\n /**\n * @inheritdoc IGovernor\n */\n function votingPeriod() public view virtual returns (uint256);\n\n /**\n * @inheritdoc IGovernor\n */\n function quorum(uint256 timepoint) public view virtual returns (uint256);\n}\n" + }, + "@openzeppelin/contracts/governance/IGovernor.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (governance/IGovernor.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC165} from \"../interfaces/IERC165.sol\";\nimport {IERC6372} from \"../interfaces/IERC6372.sol\";\n\n/**\n * @dev Interface of the {Governor} core.\n *\n * NOTE: Event parameters lack the `indexed` keyword for compatibility with GovernorBravo events.\n * Making event parameters `indexed` affects how events are decoded, potentially breaking existing indexers.\n */\ninterface IGovernor is IERC165, IERC6372 {\n enum ProposalState {\n Pending,\n Active,\n Canceled,\n Defeated,\n Succeeded,\n Queued,\n Expired,\n Executed\n }\n\n /**\n * @dev Empty proposal or a mismatch between the parameters length for a proposal call.\n */\n error GovernorInvalidProposalLength(uint256 targets, uint256 calldatas, uint256 values);\n\n /**\n * @dev The vote was already cast.\n */\n error GovernorAlreadyCastVote(address voter);\n\n /**\n * @dev Token deposits are disabled in this contract.\n */\n error GovernorDisabledDeposit();\n\n /**\n * @dev The `account` is not a proposer.\n */\n error GovernorOnlyProposer(address account);\n\n /**\n * @dev The `account` is not the governance executor.\n */\n error GovernorOnlyExecutor(address account);\n\n /**\n * @dev The `proposalId` doesn't exist.\n */\n error GovernorNonexistentProposal(uint256 proposalId);\n\n /**\n * @dev The current state of a proposal is not the required for performing an operation.\n * The `expectedStates` is a bitmap with the bits enabled for each ProposalState enum position\n * counting from right to left.\n *\n * NOTE: If `expectedState` is `bytes32(0)`, the proposal is expected to not be in any state (i.e. not exist).\n * This is the case when a proposal that is expected to be unset is already initiated (the proposal is duplicated).\n *\n * See {Governor-_encodeStateBitmap}.\n */\n error GovernorUnexpectedProposalState(uint256 proposalId, ProposalState current, bytes32 expectedStates);\n\n /**\n * @dev The voting period set is not a valid period.\n */\n error GovernorInvalidVotingPeriod(uint256 votingPeriod);\n\n /**\n * @dev The `proposer` does not have the required votes to create a proposal.\n */\n error GovernorInsufficientProposerVotes(address proposer, uint256 votes, uint256 threshold);\n\n /**\n * @dev The `proposer` is not allowed to create a proposal.\n */\n error GovernorRestrictedProposer(address proposer);\n\n /**\n * @dev The vote type used is not valid for the corresponding counting module.\n */\n error GovernorInvalidVoteType();\n\n /**\n * @dev The provided params buffer is not supported by the counting module.\n */\n error GovernorInvalidVoteParams();\n\n /**\n * @dev Queue operation is not implemented for this governor. Execute should be called directly.\n */\n error GovernorQueueNotImplemented();\n\n /**\n * @dev The proposal hasn't been queued yet.\n */\n error GovernorNotQueuedProposal(uint256 proposalId);\n\n /**\n * @dev The proposal has already been queued.\n */\n error GovernorAlreadyQueuedProposal(uint256 proposalId);\n\n /**\n * @dev The provided signature is not valid for the expected `voter`.\n * If the `voter` is a contract, the signature is not valid using {IERC1271-isValidSignature}.\n */\n error GovernorInvalidSignature(address voter);\n\n /**\n * @dev Emitted when a proposal is created.\n */\n event ProposalCreated(\n uint256 proposalId,\n address proposer,\n address[] targets,\n uint256[] values,\n string[] signatures,\n bytes[] calldatas,\n uint256 voteStart,\n uint256 voteEnd,\n string description\n );\n\n /**\n * @dev Emitted when a proposal is queued.\n */\n event ProposalQueued(uint256 proposalId, uint256 etaSeconds);\n\n /**\n * @dev Emitted when a proposal is executed.\n */\n event ProposalExecuted(uint256 proposalId);\n\n /**\n * @dev Emitted when a proposal is canceled.\n */\n event ProposalCanceled(uint256 proposalId);\n\n /**\n * @dev Emitted when a vote is cast without params.\n *\n * Note: `support` values should be seen as buckets. Their interpretation depends on the voting module used.\n */\n event VoteCast(address indexed voter, uint256 proposalId, uint8 support, uint256 weight, string reason);\n\n /**\n * @dev Emitted when a vote is cast with params.\n *\n * Note: `support` values should be seen as buckets. Their interpretation depends on the voting module used.\n * `params` are additional encoded parameters. Their interpretation also depends on the voting module used.\n */\n event VoteCastWithParams(\n address indexed voter,\n uint256 proposalId,\n uint8 support,\n uint256 weight,\n string reason,\n bytes params\n );\n\n /**\n * @notice module:core\n * @dev Name of the governor instance (used in building the EIP-712 domain separator).\n */\n function name() external view returns (string memory);\n\n /**\n * @notice module:core\n * @dev Version of the governor instance (used in building the EIP-712 domain separator). Default: \"1\"\n */\n function version() external view returns (string memory);\n\n /**\n * @notice module:voting\n * @dev A description of the possible `support` values for {castVote} and the way these votes are counted, meant to\n * be consumed by UIs to show correct vote options and interpret the results. The string is a URL-encoded sequence of\n * key-value pairs that each describe one aspect, for example `support=bravo&quorum=for,abstain`.\n *\n * There are 2 standard keys: `support` and `quorum`.\n *\n * - `support=bravo` refers to the vote options 0 = Against, 1 = For, 2 = Abstain, as in `GovernorBravo`.\n * - `quorum=bravo` means that only For votes are counted towards quorum.\n * - `quorum=for,abstain` means that both For and Abstain votes are counted towards quorum.\n *\n * If a counting module makes use of encoded `params`, it should include this under a `params` key with a unique\n * name that describes the behavior. For example:\n *\n * - `params=fractional` might refer to a scheme where votes are divided fractionally between for/against/abstain.\n * - `params=erc721` might refer to a scheme where specific NFTs are delegated to vote.\n *\n * NOTE: The string can be decoded by the standard\n * https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams[`URLSearchParams`]\n * JavaScript class.\n */\n // solhint-disable-next-line func-name-mixedcase\n function COUNTING_MODE() external view returns (string memory);\n\n /**\n * @notice module:core\n * @dev Hashing function used to (re)build the proposal id from the proposal details..\n */\n function hashProposal(\n address[] memory targets,\n uint256[] memory values,\n bytes[] memory calldatas,\n bytes32 descriptionHash\n ) external pure returns (uint256);\n\n /**\n * @notice module:core\n * @dev Current state of a proposal, following Compound's convention\n */\n function state(uint256 proposalId) external view returns (ProposalState);\n\n /**\n * @notice module:core\n * @dev The number of votes required in order for a voter to become a proposer.\n */\n function proposalThreshold() external view returns (uint256);\n\n /**\n * @notice module:core\n * @dev Timepoint used to retrieve user's votes and quorum. If using block number (as per Compound's Comp), the\n * snapshot is performed at the end of this block. Hence, voting for this proposal starts at the beginning of the\n * following block.\n */\n function proposalSnapshot(uint256 proposalId) external view returns (uint256);\n\n /**\n * @notice module:core\n * @dev Timepoint at which votes close. If using block number, votes close at the end of this block, so it is\n * possible to cast a vote during this block.\n */\n function proposalDeadline(uint256 proposalId) external view returns (uint256);\n\n /**\n * @notice module:core\n * @dev The account that created a proposal.\n */\n function proposalProposer(uint256 proposalId) external view returns (address);\n\n /**\n * @notice module:core\n * @dev The time when a queued proposal becomes executable (\"ETA\"). Unlike {proposalSnapshot} and\n * {proposalDeadline}, this doesn't use the governor clock, and instead relies on the executor's clock which may be\n * different. In most cases this will be a timestamp.\n */\n function proposalEta(uint256 proposalId) external view returns (uint256);\n\n /**\n * @notice module:core\n * @dev Whether a proposal needs to be queued before execution.\n */\n function proposalNeedsQueuing(uint256 proposalId) external view returns (bool);\n\n /**\n * @notice module:user-config\n * @dev Delay, between the proposal is created and the vote starts. The unit this duration is expressed in depends\n * on the clock (see ERC-6372) this contract uses.\n *\n * This can be increased to leave time for users to buy voting power, or delegate it, before the voting of a\n * proposal starts.\n *\n * NOTE: While this interface returns a uint256, timepoints are stored as uint48 following the ERC-6372 clock type.\n * Consequently this value must fit in a uint48 (when added to the current clock). See {IERC6372-clock}.\n */\n function votingDelay() external view returns (uint256);\n\n /**\n * @notice module:user-config\n * @dev Delay between the vote start and vote end. The unit this duration is expressed in depends on the clock\n * (see ERC-6372) this contract uses.\n *\n * NOTE: The {votingDelay} can delay the start of the vote. This must be considered when setting the voting\n * duration compared to the voting delay.\n *\n * NOTE: This value is stored when the proposal is submitted so that possible changes to the value do not affect\n * proposals that have already been submitted. The type used to save it is a uint32. Consequently, while this\n * interface returns a uint256, the value it returns should fit in a uint32.\n */\n function votingPeriod() external view returns (uint256);\n\n /**\n * @notice module:user-config\n * @dev Minimum number of cast voted required for a proposal to be successful.\n *\n * NOTE: The `timepoint` parameter corresponds to the snapshot used for counting vote. This allows to scale the\n * quorum depending on values such as the totalSupply of a token at this timepoint (see {ERC20Votes}).\n */\n function quorum(uint256 timepoint) external view returns (uint256);\n\n /**\n * @notice module:reputation\n * @dev Voting power of an `account` at a specific `timepoint`.\n *\n * Note: this can be implemented in a number of ways, for example by reading the delegated balance from one (or\n * multiple), {ERC20Votes} tokens.\n */\n function getVotes(address account, uint256 timepoint) external view returns (uint256);\n\n /**\n * @notice module:reputation\n * @dev Voting power of an `account` at a specific `timepoint` given additional encoded parameters.\n */\n function getVotesWithParams(\n address account,\n uint256 timepoint,\n bytes memory params\n ) external view returns (uint256);\n\n /**\n * @notice module:voting\n * @dev Returns whether `account` has cast a vote on `proposalId`.\n */\n function hasVoted(uint256 proposalId, address account) external view returns (bool);\n\n /**\n * @dev Create a new proposal. Vote start after a delay specified by {IGovernor-votingDelay} and lasts for a\n * duration specified by {IGovernor-votingPeriod}.\n *\n * Emits a {ProposalCreated} event.\n *\n * NOTE: The state of the Governor and `targets` may change between the proposal creation and its execution.\n * This may be the result of third party actions on the targeted contracts, or other governor proposals.\n * For example, the balance of this contract could be updated or its access control permissions may be modified,\n * possibly compromising the proposal's ability to execute successfully (e.g. the governor doesn't have enough\n * value to cover a proposal with multiple transfers).\n */\n function propose(\n address[] memory targets,\n uint256[] memory values,\n bytes[] memory calldatas,\n string memory description\n ) external returns (uint256 proposalId);\n\n /**\n * @dev Queue a proposal. Some governors require this step to be performed before execution can happen. If queuing\n * is not necessary, this function may revert.\n * Queuing a proposal requires the quorum to be reached, the vote to be successful, and the deadline to be reached.\n *\n * Emits a {ProposalQueued} event.\n */\n function queue(\n address[] memory targets,\n uint256[] memory values,\n bytes[] memory calldatas,\n bytes32 descriptionHash\n ) external returns (uint256 proposalId);\n\n /**\n * @dev Execute a successful proposal. This requires the quorum to be reached, the vote to be successful, and the\n * deadline to be reached. Depending on the governor it might also be required that the proposal was queued and\n * that some delay passed.\n *\n * Emits a {ProposalExecuted} event.\n *\n * NOTE: Some modules can modify the requirements for execution, for example by adding an additional timelock.\n */\n function execute(\n address[] memory targets,\n uint256[] memory values,\n bytes[] memory calldatas,\n bytes32 descriptionHash\n ) external payable returns (uint256 proposalId);\n\n /**\n * @dev Cancel a proposal. A proposal is cancellable by the proposer, but only while it is Pending state, i.e.\n * before the vote starts.\n *\n * Emits a {ProposalCanceled} event.\n */\n function cancel(\n address[] memory targets,\n uint256[] memory values,\n bytes[] memory calldatas,\n bytes32 descriptionHash\n ) external returns (uint256 proposalId);\n\n /**\n * @dev Cast a vote\n *\n * Emits a {VoteCast} event.\n */\n function castVote(uint256 proposalId, uint8 support) external returns (uint256 balance);\n\n /**\n * @dev Cast a vote with a reason\n *\n * Emits a {VoteCast} event.\n */\n function castVoteWithReason(\n uint256 proposalId,\n uint8 support,\n string calldata reason\n ) external returns (uint256 balance);\n\n /**\n * @dev Cast a vote with a reason and additional encoded parameters\n *\n * Emits a {VoteCast} or {VoteCastWithParams} event depending on the length of params.\n */\n function castVoteWithReasonAndParams(\n uint256 proposalId,\n uint8 support,\n string calldata reason,\n bytes memory params\n ) external returns (uint256 balance);\n\n /**\n * @dev Cast a vote using the voter's signature, including ERC-1271 signature support.\n *\n * Emits a {VoteCast} event.\n */\n function castVoteBySig(\n uint256 proposalId,\n uint8 support,\n address voter,\n bytes memory signature\n ) external returns (uint256 balance);\n\n /**\n * @dev Cast a vote with a reason and additional encoded parameters using the voter's signature,\n * including ERC-1271 signature support.\n *\n * Emits a {VoteCast} or {VoteCastWithParams} event depending on the length of params.\n */\n function castVoteWithReasonAndParamsBySig(\n uint256 proposalId,\n uint8 support,\n address voter,\n string calldata reason,\n bytes memory params,\n bytes memory signature\n ) external returns (uint256 balance);\n}\n" + }, + "@openzeppelin/contracts/governance/utils/IVotes.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (governance/utils/IVotes.sol)\npragma solidity ^0.8.20;\n\n/**\n * @dev Common interface for {ERC20Votes}, {ERC721Votes}, and other {Votes}-enabled contracts.\n */\ninterface IVotes {\n /**\n * @dev The signature used has expired.\n */\n error VotesExpiredSignature(uint256 expiry);\n\n /**\n * @dev Emitted when an account changes their delegate.\n */\n event DelegateChanged(address indexed delegator, address indexed fromDelegate, address indexed toDelegate);\n\n /**\n * @dev Emitted when a token transfer or delegate change results in changes to a delegate's number of voting units.\n */\n event DelegateVotesChanged(address indexed delegate, uint256 previousVotes, uint256 newVotes);\n\n /**\n * @dev Returns the current amount of votes that `account` has.\n */\n function getVotes(address account) external view returns (uint256);\n\n /**\n * @dev Returns the amount of votes that `account` had at a specific moment in the past. If the `clock()` is\n * configured to use block numbers, this will return the value at the end of the corresponding block.\n */\n function getPastVotes(address account, uint256 timepoint) external view returns (uint256);\n\n /**\n * @dev Returns the total supply of votes available at a specific moment in the past. If the `clock()` is\n * configured to use block numbers, this will return the value at the end of the corresponding block.\n *\n * NOTE: This value is the sum of all available votes, which is not necessarily the sum of all delegated votes.\n * Votes that have not been delegated are still part of total supply, even though they would not participate in a\n * vote.\n */\n function getPastTotalSupply(uint256 timepoint) external view returns (uint256);\n\n /**\n * @dev Returns the delegate that `account` has chosen.\n */\n function delegates(address account) external view returns (address);\n\n /**\n * @dev Delegates votes from the sender to `delegatee`.\n */\n function delegate(address delegatee) external;\n\n /**\n * @dev Delegates votes from signer to `delegatee`.\n */\n function delegateBySig(address delegatee, uint256 nonce, uint256 expiry, uint8 v, bytes32 r, bytes32 s) external;\n}\n" + }, + "@openzeppelin/contracts/governance/utils/Votes.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (governance/utils/Votes.sol)\npragma solidity ^0.8.20;\n\nimport {IERC5805} from \"../../interfaces/IERC5805.sol\";\nimport {Context} from \"../../utils/Context.sol\";\nimport {Nonces} from \"../../utils/Nonces.sol\";\nimport {EIP712} from \"../../utils/cryptography/EIP712.sol\";\nimport {Checkpoints} from \"../../utils/structs/Checkpoints.sol\";\nimport {SafeCast} from \"../../utils/math/SafeCast.sol\";\nimport {ECDSA} from \"../../utils/cryptography/ECDSA.sol\";\nimport {Time} from \"../../utils/types/Time.sol\";\n\n/**\n * @dev This is a base abstract contract that tracks voting units, which are a measure of voting power that can be\n * transferred, and provides a system of vote delegation, where an account can delegate its voting units to a sort of\n * \"representative\" that will pool delegated voting units from different accounts and can then use it to vote in\n * decisions. In fact, voting units _must_ be delegated in order to count as actual votes, and an account has to\n * delegate those votes to itself if it wishes to participate in decisions and does not have a trusted representative.\n *\n * This contract is often combined with a token contract such that voting units correspond to token units. For an\n * example, see {ERC721Votes}.\n *\n * The full history of delegate votes is tracked on-chain so that governance protocols can consider votes as distributed\n * at a particular block number to protect against flash loans and double voting. The opt-in delegate system makes the\n * cost of this history tracking optional.\n *\n * When using this module the derived contract must implement {_getVotingUnits} (for example, make it return\n * {ERC721-balanceOf}), and can use {_transferVotingUnits} to track a change in the distribution of those units (in the\n * previous example, it would be included in {ERC721-_update}).\n */\nabstract contract Votes is Context, EIP712, Nonces, IERC5805 {\n using Checkpoints for Checkpoints.Trace208;\n\n bytes32 private constant DELEGATION_TYPEHASH =\n keccak256(\"Delegation(address delegatee,uint256 nonce,uint256 expiry)\");\n\n mapping(address account => address) private _delegatee;\n\n mapping(address delegatee => Checkpoints.Trace208) private _delegateCheckpoints;\n\n Checkpoints.Trace208 private _totalCheckpoints;\n\n /**\n * @dev The clock was incorrectly modified.\n */\n error ERC6372InconsistentClock();\n\n /**\n * @dev Lookup to future votes is not available.\n */\n error ERC5805FutureLookup(uint256 timepoint, uint48 clock);\n\n /**\n * @dev Clock used for flagging checkpoints. Can be overridden to implement timestamp based\n * checkpoints (and voting), in which case {CLOCK_MODE} should be overridden as well to match.\n */\n function clock() public view virtual returns (uint48) {\n return Time.blockNumber();\n }\n\n /**\n * @dev Machine-readable description of the clock as specified in ERC-6372.\n */\n // solhint-disable-next-line func-name-mixedcase\n function CLOCK_MODE() public view virtual returns (string memory) {\n // Check that the clock was not modified\n if (clock() != Time.blockNumber()) {\n revert ERC6372InconsistentClock();\n }\n return \"mode=blocknumber&from=default\";\n }\n\n /**\n * @dev Returns the current amount of votes that `account` has.\n */\n function getVotes(address account) public view virtual returns (uint256) {\n return _delegateCheckpoints[account].latest();\n }\n\n /**\n * @dev Returns the amount of votes that `account` had at a specific moment in the past. If the `clock()` is\n * configured to use block numbers, this will return the value at the end of the corresponding block.\n *\n * Requirements:\n *\n * - `timepoint` must be in the past. If operating using block numbers, the block must be already mined.\n */\n function getPastVotes(address account, uint256 timepoint) public view virtual returns (uint256) {\n uint48 currentTimepoint = clock();\n if (timepoint >= currentTimepoint) {\n revert ERC5805FutureLookup(timepoint, currentTimepoint);\n }\n return _delegateCheckpoints[account].upperLookupRecent(SafeCast.toUint48(timepoint));\n }\n\n /**\n * @dev Returns the total supply of votes available at a specific moment in the past. If the `clock()` is\n * configured to use block numbers, this will return the value at the end of the corresponding block.\n *\n * NOTE: This value is the sum of all available votes, which is not necessarily the sum of all delegated votes.\n * Votes that have not been delegated are still part of total supply, even though they would not participate in a\n * vote.\n *\n * Requirements:\n *\n * - `timepoint` must be in the past. If operating using block numbers, the block must be already mined.\n */\n function getPastTotalSupply(uint256 timepoint) public view virtual returns (uint256) {\n uint48 currentTimepoint = clock();\n if (timepoint >= currentTimepoint) {\n revert ERC5805FutureLookup(timepoint, currentTimepoint);\n }\n return _totalCheckpoints.upperLookupRecent(SafeCast.toUint48(timepoint));\n }\n\n /**\n * @dev Returns the current total supply of votes.\n */\n function _getTotalSupply() internal view virtual returns (uint256) {\n return _totalCheckpoints.latest();\n }\n\n /**\n * @dev Returns the delegate that `account` has chosen.\n */\n function delegates(address account) public view virtual returns (address) {\n return _delegatee[account];\n }\n\n /**\n * @dev Delegates votes from the sender to `delegatee`.\n */\n function delegate(address delegatee) public virtual {\n address account = _msgSender();\n _delegate(account, delegatee);\n }\n\n /**\n * @dev Delegates votes from signer to `delegatee`.\n */\n function delegateBySig(\n address delegatee,\n uint256 nonce,\n uint256 expiry,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) public virtual {\n if (block.timestamp > expiry) {\n revert VotesExpiredSignature(expiry);\n }\n address signer = ECDSA.recover(\n _hashTypedDataV4(keccak256(abi.encode(DELEGATION_TYPEHASH, delegatee, nonce, expiry))),\n v,\n r,\n s\n );\n _useCheckedNonce(signer, nonce);\n _delegate(signer, delegatee);\n }\n\n /**\n * @dev Delegate all of `account`'s voting units to `delegatee`.\n *\n * Emits events {IVotes-DelegateChanged} and {IVotes-DelegateVotesChanged}.\n */\n function _delegate(address account, address delegatee) internal virtual {\n address oldDelegate = delegates(account);\n _delegatee[account] = delegatee;\n\n emit DelegateChanged(account, oldDelegate, delegatee);\n _moveDelegateVotes(oldDelegate, delegatee, _getVotingUnits(account));\n }\n\n /**\n * @dev Transfers, mints, or burns voting units. To register a mint, `from` should be zero. To register a burn, `to`\n * should be zero. Total supply of voting units will be adjusted with mints and burns.\n */\n function _transferVotingUnits(address from, address to, uint256 amount) internal virtual {\n if (from == address(0)) {\n _push(_totalCheckpoints, _add, SafeCast.toUint208(amount));\n }\n if (to == address(0)) {\n _push(_totalCheckpoints, _subtract, SafeCast.toUint208(amount));\n }\n _moveDelegateVotes(delegates(from), delegates(to), amount);\n }\n\n /**\n * @dev Moves delegated votes from one delegate to another.\n */\n function _moveDelegateVotes(address from, address to, uint256 amount) internal virtual {\n if (from != to && amount > 0) {\n if (from != address(0)) {\n (uint256 oldValue, uint256 newValue) = _push(\n _delegateCheckpoints[from],\n _subtract,\n SafeCast.toUint208(amount)\n );\n emit DelegateVotesChanged(from, oldValue, newValue);\n }\n if (to != address(0)) {\n (uint256 oldValue, uint256 newValue) = _push(\n _delegateCheckpoints[to],\n _add,\n SafeCast.toUint208(amount)\n );\n emit DelegateVotesChanged(to, oldValue, newValue);\n }\n }\n }\n\n /**\n * @dev Get number of checkpoints for `account`.\n */\n function _numCheckpoints(address account) internal view virtual returns (uint32) {\n return SafeCast.toUint32(_delegateCheckpoints[account].length());\n }\n\n /**\n * @dev Get the `pos`-th checkpoint for `account`.\n */\n function _checkpoints(\n address account,\n uint32 pos\n ) internal view virtual returns (Checkpoints.Checkpoint208 memory) {\n return _delegateCheckpoints[account].at(pos);\n }\n\n function _push(\n Checkpoints.Trace208 storage store,\n function(uint208, uint208) view returns (uint208) op,\n uint208 delta\n ) private returns (uint208 oldValue, uint208 newValue) {\n return store.push(clock(), op(store.latest(), delta));\n }\n\n function _add(uint208 a, uint208 b) private pure returns (uint208) {\n return a + b;\n }\n\n function _subtract(uint208 a, uint208 b) private pure returns (uint208) {\n return a - b;\n }\n\n /**\n * @dev Must return the voting units held by an account.\n */\n function _getVotingUnits(address) internal view virtual returns (uint256);\n}\n" + }, + "@openzeppelin/contracts/interfaces/draft-IERC6093.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (interfaces/draft-IERC6093.sol)\npragma solidity ^0.8.20;\n\n/**\n * @dev Standard ERC-20 Errors\n * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC-20 tokens.\n */\ninterface IERC20Errors {\n /**\n * @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers.\n * @param sender Address whose tokens are being transferred.\n * @param balance Current balance for the interacting account.\n * @param needed Minimum amount required to perform a transfer.\n */\n error ERC20InsufficientBalance(address sender, uint256 balance, uint256 needed);\n\n /**\n * @dev Indicates a failure with the token `sender`. Used in transfers.\n * @param sender Address whose tokens are being transferred.\n */\n error ERC20InvalidSender(address sender);\n\n /**\n * @dev Indicates a failure with the token `receiver`. Used in transfers.\n * @param receiver Address to which tokens are being transferred.\n */\n error ERC20InvalidReceiver(address receiver);\n\n /**\n * @dev Indicates a failure with the `spender`’s `allowance`. Used in transfers.\n * @param spender Address that may be allowed to operate on tokens without being their owner.\n * @param allowance Amount of tokens a `spender` is allowed to operate with.\n * @param needed Minimum amount required to perform a transfer.\n */\n error ERC20InsufficientAllowance(address spender, uint256 allowance, uint256 needed);\n\n /**\n * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.\n * @param approver Address initiating an approval operation.\n */\n error ERC20InvalidApprover(address approver);\n\n /**\n * @dev Indicates a failure with the `spender` to be approved. Used in approvals.\n * @param spender Address that may be allowed to operate on tokens without being their owner.\n */\n error ERC20InvalidSpender(address spender);\n}\n\n/**\n * @dev Standard ERC-721 Errors\n * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC-721 tokens.\n */\ninterface IERC721Errors {\n /**\n * @dev Indicates that an address can't be an owner. For example, `address(0)` is a forbidden owner in ERC-20.\n * Used in balance queries.\n * @param owner Address of the current owner of a token.\n */\n error ERC721InvalidOwner(address owner);\n\n /**\n * @dev Indicates a `tokenId` whose `owner` is the zero address.\n * @param tokenId Identifier number of a token.\n */\n error ERC721NonexistentToken(uint256 tokenId);\n\n /**\n * @dev Indicates an error related to the ownership over a particular token. Used in transfers.\n * @param sender Address whose tokens are being transferred.\n * @param tokenId Identifier number of a token.\n * @param owner Address of the current owner of a token.\n */\n error ERC721IncorrectOwner(address sender, uint256 tokenId, address owner);\n\n /**\n * @dev Indicates a failure with the token `sender`. Used in transfers.\n * @param sender Address whose tokens are being transferred.\n */\n error ERC721InvalidSender(address sender);\n\n /**\n * @dev Indicates a failure with the token `receiver`. Used in transfers.\n * @param receiver Address to which tokens are being transferred.\n */\n error ERC721InvalidReceiver(address receiver);\n\n /**\n * @dev Indicates a failure with the `operator`’s approval. Used in transfers.\n * @param operator Address that may be allowed to operate on tokens without being their owner.\n * @param tokenId Identifier number of a token.\n */\n error ERC721InsufficientApproval(address operator, uint256 tokenId);\n\n /**\n * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.\n * @param approver Address initiating an approval operation.\n */\n error ERC721InvalidApprover(address approver);\n\n /**\n * @dev Indicates a failure with the `operator` to be approved. Used in approvals.\n * @param operator Address that may be allowed to operate on tokens without being their owner.\n */\n error ERC721InvalidOperator(address operator);\n}\n\n/**\n * @dev Standard ERC-1155 Errors\n * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC-1155 tokens.\n */\ninterface IERC1155Errors {\n /**\n * @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers.\n * @param sender Address whose tokens are being transferred.\n * @param balance Current balance for the interacting account.\n * @param needed Minimum amount required to perform a transfer.\n * @param tokenId Identifier number of a token.\n */\n error ERC1155InsufficientBalance(address sender, uint256 balance, uint256 needed, uint256 tokenId);\n\n /**\n * @dev Indicates a failure with the token `sender`. Used in transfers.\n * @param sender Address whose tokens are being transferred.\n */\n error ERC1155InvalidSender(address sender);\n\n /**\n * @dev Indicates a failure with the token `receiver`. Used in transfers.\n * @param receiver Address to which tokens are being transferred.\n */\n error ERC1155InvalidReceiver(address receiver);\n\n /**\n * @dev Indicates a failure with the `operator`’s approval. Used in transfers.\n * @param operator Address that may be allowed to operate on tokens without being their owner.\n * @param owner Address of the current owner of a token.\n */\n error ERC1155MissingApprovalForAll(address operator, address owner);\n\n /**\n * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.\n * @param approver Address initiating an approval operation.\n */\n error ERC1155InvalidApprover(address approver);\n\n /**\n * @dev Indicates a failure with the `operator` to be approved. Used in approvals.\n * @param operator Address that may be allowed to operate on tokens without being their owner.\n */\n error ERC1155InvalidOperator(address operator);\n\n /**\n * @dev Indicates an array length mismatch between ids and values in a safeBatchTransferFrom operation.\n * Used in batch transfers.\n * @param idsLength Length of the array of token identifiers\n * @param valuesLength Length of the array of token amounts\n */\n error ERC1155InvalidArrayLength(uint256 idsLength, uint256 valuesLength);\n}\n" + }, + "@openzeppelin/contracts/interfaces/IERC1271.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (interfaces/IERC1271.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Interface of the ERC-1271 standard signature validation method for\n * contracts as defined in https://eips.ethereum.org/EIPS/eip-1271[ERC-1271].\n */\ninterface IERC1271 {\n /**\n * @dev Should return whether the signature provided is valid for the provided data\n * @param hash Hash of the data to be signed\n * @param signature Signature byte array associated with _data\n */\n function isValidSignature(bytes32 hash, bytes memory signature) external view returns (bytes4 magicValue);\n}\n" + }, + "@openzeppelin/contracts/interfaces/IERC165.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC165.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC165} from \"../utils/introspection/IERC165.sol\";\n" + }, + "@openzeppelin/contracts/interfaces/IERC4906.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (interfaces/IERC4906.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC165} from \"./IERC165.sol\";\nimport {IERC721} from \"./IERC721.sol\";\n\n/// @title ERC-721 Metadata Update Extension\ninterface IERC4906 is IERC165, IERC721 {\n /// @dev This event emits when the metadata of a token is changed.\n /// So that the third-party platforms such as NFT market could\n /// timely update the images and related attributes of the NFT.\n event MetadataUpdate(uint256 _tokenId);\n\n /// @dev This event emits when the metadata of a range of tokens is changed.\n /// So that the third-party platforms such as NFT market could\n /// timely update the images and related attributes of the NFTs.\n event BatchMetadataUpdate(uint256 _fromTokenId, uint256 _toTokenId);\n}\n" + }, + "@openzeppelin/contracts/interfaces/IERC5267.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC5267.sol)\n\npragma solidity ^0.8.20;\n\ninterface IERC5267 {\n /**\n * @dev MAY be emitted to signal that the domain could have changed.\n */\n event EIP712DomainChanged();\n\n /**\n * @dev returns the fields and values that describe the domain separator used by this contract for EIP-712\n * signature.\n */\n function eip712Domain()\n external\n view\n returns (\n bytes1 fields,\n string memory name,\n string memory version,\n uint256 chainId,\n address verifyingContract,\n bytes32 salt,\n uint256[] memory extensions\n );\n}\n" + }, + "@openzeppelin/contracts/interfaces/IERC5805.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC5805.sol)\n\npragma solidity ^0.8.20;\n\nimport {IVotes} from \"../governance/utils/IVotes.sol\";\nimport {IERC6372} from \"./IERC6372.sol\";\n\ninterface IERC5805 is IERC6372, IVotes {}\n" + }, + "@openzeppelin/contracts/interfaces/IERC6372.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC6372.sol)\n\npragma solidity ^0.8.20;\n\ninterface IERC6372 {\n /**\n * @dev Clock used for flagging checkpoints. Can be overridden to implement timestamp based checkpoints (and voting).\n */\n function clock() external view returns (uint48);\n\n /**\n * @dev Description of the clock\n */\n // solhint-disable-next-line func-name-mixedcase\n function CLOCK_MODE() external view returns (string memory);\n}\n" + }, + "@openzeppelin/contracts/interfaces/IERC721.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC721.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC721} from \"../token/ERC721/IERC721.sol\";\n" + }, + "@openzeppelin/contracts/token/ERC1155/IERC1155Receiver.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC1155/IERC1155Receiver.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC165} from \"../../utils/introspection/IERC165.sol\";\n\n/**\n * @dev Interface that must be implemented by smart contracts in order to receive\n * ERC-1155 token transfers.\n */\ninterface IERC1155Receiver is IERC165 {\n /**\n * @dev Handles the receipt of a single ERC-1155 token type. This function is\n * called at the end of a `safeTransferFrom` after the balance has been updated.\n *\n * NOTE: To accept the transfer, this must return\n * `bytes4(keccak256(\"onERC1155Received(address,address,uint256,uint256,bytes)\"))`\n * (i.e. 0xf23a6e61, or its own function selector).\n *\n * @param operator The address which initiated the transfer (i.e. msg.sender)\n * @param from The address which previously owned the token\n * @param id The ID of the token being transferred\n * @param value The amount of tokens being transferred\n * @param data Additional data with no specified format\n * @return `bytes4(keccak256(\"onERC1155Received(address,address,uint256,uint256,bytes)\"))` if transfer is allowed\n */\n function onERC1155Received(\n address operator,\n address from,\n uint256 id,\n uint256 value,\n bytes calldata data\n ) external returns (bytes4);\n\n /**\n * @dev Handles the receipt of a multiple ERC-1155 token types. This function\n * is called at the end of a `safeBatchTransferFrom` after the balances have\n * been updated.\n *\n * NOTE: To accept the transfer(s), this must return\n * `bytes4(keccak256(\"onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)\"))`\n * (i.e. 0xbc197c81, or its own function selector).\n *\n * @param operator The address which initiated the batch transfer (i.e. msg.sender)\n * @param from The address which previously owned the token\n * @param ids An array containing ids of each token being transferred (order and length must match values array)\n * @param values An array containing amounts of each token being transferred (order and length must match ids array)\n * @param data Additional data with no specified format\n * @return `bytes4(keccak256(\"onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)\"))` if transfer is allowed\n */\n function onERC1155BatchReceived(\n address operator,\n address from,\n uint256[] calldata ids,\n uint256[] calldata values,\n bytes calldata data\n ) external returns (bytes4);\n}\n" + }, + "@openzeppelin/contracts/token/ERC721/ERC721.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC721/ERC721.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC721} from \"./IERC721.sol\";\nimport {IERC721Metadata} from \"./extensions/IERC721Metadata.sol\";\nimport {ERC721Utils} from \"./utils/ERC721Utils.sol\";\nimport {Context} from \"../../utils/Context.sol\";\nimport {Strings} from \"../../utils/Strings.sol\";\nimport {IERC165, ERC165} from \"../../utils/introspection/ERC165.sol\";\nimport {IERC721Errors} from \"../../interfaces/draft-IERC6093.sol\";\n\n/**\n * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC-721] Non-Fungible Token Standard, including\n * the Metadata extension, but not including the Enumerable extension, which is available separately as\n * {ERC721Enumerable}.\n */\nabstract contract ERC721 is Context, ERC165, IERC721, IERC721Metadata, IERC721Errors {\n using Strings for uint256;\n\n // Token name\n string private _name;\n\n // Token symbol\n string private _symbol;\n\n mapping(uint256 tokenId => address) private _owners;\n\n mapping(address owner => uint256) private _balances;\n\n mapping(uint256 tokenId => address) private _tokenApprovals;\n\n mapping(address owner => mapping(address operator => bool)) private _operatorApprovals;\n\n /**\n * @dev Initializes the contract by setting a `name` and a `symbol` to the token collection.\n */\n constructor(string memory name_, string memory symbol_) {\n _name = name_;\n _symbol = symbol_;\n }\n\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {\n return\n interfaceId == type(IERC721).interfaceId ||\n interfaceId == type(IERC721Metadata).interfaceId ||\n super.supportsInterface(interfaceId);\n }\n\n /**\n * @dev See {IERC721-balanceOf}.\n */\n function balanceOf(address owner) public view virtual returns (uint256) {\n if (owner == address(0)) {\n revert ERC721InvalidOwner(address(0));\n }\n return _balances[owner];\n }\n\n /**\n * @dev See {IERC721-ownerOf}.\n */\n function ownerOf(uint256 tokenId) public view virtual returns (address) {\n return _requireOwned(tokenId);\n }\n\n /**\n * @dev See {IERC721Metadata-name}.\n */\n function name() public view virtual returns (string memory) {\n return _name;\n }\n\n /**\n * @dev See {IERC721Metadata-symbol}.\n */\n function symbol() public view virtual returns (string memory) {\n return _symbol;\n }\n\n /**\n * @dev See {IERC721Metadata-tokenURI}.\n */\n function tokenURI(uint256 tokenId) public view virtual returns (string memory) {\n _requireOwned(tokenId);\n\n string memory baseURI = _baseURI();\n return bytes(baseURI).length > 0 ? string.concat(baseURI, tokenId.toString()) : \"\";\n }\n\n /**\n * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each\n * token will be the concatenation of the `baseURI` and the `tokenId`. Empty\n * by default, can be overridden in child contracts.\n */\n function _baseURI() internal view virtual returns (string memory) {\n return \"\";\n }\n\n /**\n * @dev See {IERC721-approve}.\n */\n function approve(address to, uint256 tokenId) public virtual {\n _approve(to, tokenId, _msgSender());\n }\n\n /**\n * @dev See {IERC721-getApproved}.\n */\n function getApproved(uint256 tokenId) public view virtual returns (address) {\n _requireOwned(tokenId);\n\n return _getApproved(tokenId);\n }\n\n /**\n * @dev See {IERC721-setApprovalForAll}.\n */\n function setApprovalForAll(address operator, bool approved) public virtual {\n _setApprovalForAll(_msgSender(), operator, approved);\n }\n\n /**\n * @dev See {IERC721-isApprovedForAll}.\n */\n function isApprovedForAll(address owner, address operator) public view virtual returns (bool) {\n return _operatorApprovals[owner][operator];\n }\n\n /**\n * @dev See {IERC721-transferFrom}.\n */\n function transferFrom(address from, address to, uint256 tokenId) public virtual {\n if (to == address(0)) {\n revert ERC721InvalidReceiver(address(0));\n }\n // Setting an \"auth\" arguments enables the `_isAuthorized` check which verifies that the token exists\n // (from != 0). Therefore, it is not needed to verify that the return value is not 0 here.\n address previousOwner = _update(to, tokenId, _msgSender());\n if (previousOwner != from) {\n revert ERC721IncorrectOwner(from, tokenId, previousOwner);\n }\n }\n\n /**\n * @dev See {IERC721-safeTransferFrom}.\n */\n function safeTransferFrom(address from, address to, uint256 tokenId) public {\n safeTransferFrom(from, to, tokenId, \"\");\n }\n\n /**\n * @dev See {IERC721-safeTransferFrom}.\n */\n function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory data) public virtual {\n transferFrom(from, to, tokenId);\n ERC721Utils.checkOnERC721Received(_msgSender(), from, to, tokenId, data);\n }\n\n /**\n * @dev Returns the owner of the `tokenId`. Does NOT revert if token doesn't exist\n *\n * IMPORTANT: Any overrides to this function that add ownership of tokens not tracked by the\n * core ERC-721 logic MUST be matched with the use of {_increaseBalance} to keep balances\n * consistent with ownership. The invariant to preserve is that for any address `a` the value returned by\n * `balanceOf(a)` must be equal to the number of tokens such that `_ownerOf(tokenId)` is `a`.\n */\n function _ownerOf(uint256 tokenId) internal view virtual returns (address) {\n return _owners[tokenId];\n }\n\n /**\n * @dev Returns the approved address for `tokenId`. Returns 0 if `tokenId` is not minted.\n */\n function _getApproved(uint256 tokenId) internal view virtual returns (address) {\n return _tokenApprovals[tokenId];\n }\n\n /**\n * @dev Returns whether `spender` is allowed to manage `owner`'s tokens, or `tokenId` in\n * particular (ignoring whether it is owned by `owner`).\n *\n * WARNING: This function assumes that `owner` is the actual owner of `tokenId` and does not verify this\n * assumption.\n */\n function _isAuthorized(address owner, address spender, uint256 tokenId) internal view virtual returns (bool) {\n return\n spender != address(0) &&\n (owner == spender || isApprovedForAll(owner, spender) || _getApproved(tokenId) == spender);\n }\n\n /**\n * @dev Checks if `spender` can operate on `tokenId`, assuming the provided `owner` is the actual owner.\n * Reverts if:\n * - `spender` does not have approval from `owner` for `tokenId`.\n * - `spender` does not have approval to manage all of `owner`'s assets.\n *\n * WARNING: This function assumes that `owner` is the actual owner of `tokenId` and does not verify this\n * assumption.\n */\n function _checkAuthorized(address owner, address spender, uint256 tokenId) internal view virtual {\n if (!_isAuthorized(owner, spender, tokenId)) {\n if (owner == address(0)) {\n revert ERC721NonexistentToken(tokenId);\n } else {\n revert ERC721InsufficientApproval(spender, tokenId);\n }\n }\n }\n\n /**\n * @dev Unsafe write access to the balances, used by extensions that \"mint\" tokens using an {ownerOf} override.\n *\n * NOTE: the value is limited to type(uint128).max. This protect against _balance overflow. It is unrealistic that\n * a uint256 would ever overflow from increments when these increments are bounded to uint128 values.\n *\n * WARNING: Increasing an account's balance using this function tends to be paired with an override of the\n * {_ownerOf} function to resolve the ownership of the corresponding tokens so that balances and ownership\n * remain consistent with one another.\n */\n function _increaseBalance(address account, uint128 value) internal virtual {\n unchecked {\n _balances[account] += value;\n }\n }\n\n /**\n * @dev Transfers `tokenId` from its current owner to `to`, or alternatively mints (or burns) if the current owner\n * (or `to`) is the zero address. Returns the owner of the `tokenId` before the update.\n *\n * The `auth` argument is optional. If the value passed is non 0, then this function will check that\n * `auth` is either the owner of the token, or approved to operate on the token (by the owner).\n *\n * Emits a {Transfer} event.\n *\n * NOTE: If overriding this function in a way that tracks balances, see also {_increaseBalance}.\n */\n function _update(address to, uint256 tokenId, address auth) internal virtual returns (address) {\n address from = _ownerOf(tokenId);\n\n // Perform (optional) operator check\n if (auth != address(0)) {\n _checkAuthorized(from, auth, tokenId);\n }\n\n // Execute the update\n if (from != address(0)) {\n // Clear approval. No need to re-authorize or emit the Approval event\n _approve(address(0), tokenId, address(0), false);\n\n unchecked {\n _balances[from] -= 1;\n }\n }\n\n if (to != address(0)) {\n unchecked {\n _balances[to] += 1;\n }\n }\n\n _owners[tokenId] = to;\n\n emit Transfer(from, to, tokenId);\n\n return from;\n }\n\n /**\n * @dev Mints `tokenId` and transfers it to `to`.\n *\n * WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible\n *\n * Requirements:\n *\n * - `tokenId` must not exist.\n * - `to` cannot be the zero address.\n *\n * Emits a {Transfer} event.\n */\n function _mint(address to, uint256 tokenId) internal {\n if (to == address(0)) {\n revert ERC721InvalidReceiver(address(0));\n }\n address previousOwner = _update(to, tokenId, address(0));\n if (previousOwner != address(0)) {\n revert ERC721InvalidSender(address(0));\n }\n }\n\n /**\n * @dev Mints `tokenId`, transfers it to `to` and checks for `to` acceptance.\n *\n * Requirements:\n *\n * - `tokenId` must not exist.\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\n *\n * Emits a {Transfer} event.\n */\n function _safeMint(address to, uint256 tokenId) internal {\n _safeMint(to, tokenId, \"\");\n }\n\n /**\n * @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is\n * forwarded in {IERC721Receiver-onERC721Received} to contract recipients.\n */\n function _safeMint(address to, uint256 tokenId, bytes memory data) internal virtual {\n _mint(to, tokenId);\n ERC721Utils.checkOnERC721Received(_msgSender(), address(0), to, tokenId, data);\n }\n\n /**\n * @dev Destroys `tokenId`.\n * The approval is cleared when the token is burned.\n * This is an internal function that does not check if the sender is authorized to operate on the token.\n *\n * Requirements:\n *\n * - `tokenId` must exist.\n *\n * Emits a {Transfer} event.\n */\n function _burn(uint256 tokenId) internal {\n address previousOwner = _update(address(0), tokenId, address(0));\n if (previousOwner == address(0)) {\n revert ERC721NonexistentToken(tokenId);\n }\n }\n\n /**\n * @dev Transfers `tokenId` from `from` to `to`.\n * As opposed to {transferFrom}, this imposes no restrictions on msg.sender.\n *\n * Requirements:\n *\n * - `to` cannot be the zero address.\n * - `tokenId` token must be owned by `from`.\n *\n * Emits a {Transfer} event.\n */\n function _transfer(address from, address to, uint256 tokenId) internal {\n if (to == address(0)) {\n revert ERC721InvalidReceiver(address(0));\n }\n address previousOwner = _update(to, tokenId, address(0));\n if (previousOwner == address(0)) {\n revert ERC721NonexistentToken(tokenId);\n } else if (previousOwner != from) {\n revert ERC721IncorrectOwner(from, tokenId, previousOwner);\n }\n }\n\n /**\n * @dev Safely transfers `tokenId` token from `from` to `to`, checking that contract recipients\n * are aware of the ERC-721 standard to prevent tokens from being forever locked.\n *\n * `data` is additional data, it has no specified format and it is sent in call to `to`.\n *\n * This internal function is like {safeTransferFrom} in the sense that it invokes\n * {IERC721Receiver-onERC721Received} on the receiver, and can be used to e.g.\n * implement alternative mechanisms to perform token transfer, such as signature-based.\n *\n * Requirements:\n *\n * - `tokenId` token must exist and be owned by `from`.\n * - `to` cannot be the zero address.\n * - `from` cannot be the zero address.\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\n *\n * Emits a {Transfer} event.\n */\n function _safeTransfer(address from, address to, uint256 tokenId) internal {\n _safeTransfer(from, to, tokenId, \"\");\n }\n\n /**\n * @dev Same as {xref-ERC721-_safeTransfer-address-address-uint256-}[`_safeTransfer`], with an additional `data` parameter which is\n * forwarded in {IERC721Receiver-onERC721Received} to contract recipients.\n */\n function _safeTransfer(address from, address to, uint256 tokenId, bytes memory data) internal virtual {\n _transfer(from, to, tokenId);\n ERC721Utils.checkOnERC721Received(_msgSender(), from, to, tokenId, data);\n }\n\n /**\n * @dev Approve `to` to operate on `tokenId`\n *\n * The `auth` argument is optional. If the value passed is non 0, then this function will check that `auth` is\n * either the owner of the token, or approved to operate on all tokens held by this owner.\n *\n * Emits an {Approval} event.\n *\n * Overrides to this logic should be done to the variant with an additional `bool emitEvent` argument.\n */\n function _approve(address to, uint256 tokenId, address auth) internal {\n _approve(to, tokenId, auth, true);\n }\n\n /**\n * @dev Variant of `_approve` with an optional flag to enable or disable the {Approval} event. The event is not\n * emitted in the context of transfers.\n */\n function _approve(address to, uint256 tokenId, address auth, bool emitEvent) internal virtual {\n // Avoid reading the owner unless necessary\n if (emitEvent || auth != address(0)) {\n address owner = _requireOwned(tokenId);\n\n // We do not use _isAuthorized because single-token approvals should not be able to call approve\n if (auth != address(0) && owner != auth && !isApprovedForAll(owner, auth)) {\n revert ERC721InvalidApprover(auth);\n }\n\n if (emitEvent) {\n emit Approval(owner, to, tokenId);\n }\n }\n\n _tokenApprovals[tokenId] = to;\n }\n\n /**\n * @dev Approve `operator` to operate on all of `owner` tokens\n *\n * Requirements:\n * - operator can't be the address zero.\n *\n * Emits an {ApprovalForAll} event.\n */\n function _setApprovalForAll(address owner, address operator, bool approved) internal virtual {\n if (operator == address(0)) {\n revert ERC721InvalidOperator(operator);\n }\n _operatorApprovals[owner][operator] = approved;\n emit ApprovalForAll(owner, operator, approved);\n }\n\n /**\n * @dev Reverts if the `tokenId` doesn't have a current owner (it hasn't been minted, or it has been burned).\n * Returns the owner.\n *\n * Overrides to ownership logic should be done to {_ownerOf}.\n */\n function _requireOwned(uint256 tokenId) internal view returns (address) {\n address owner = _ownerOf(tokenId);\n if (owner == address(0)) {\n revert ERC721NonexistentToken(tokenId);\n }\n return owner;\n }\n}\n" + }, + "@openzeppelin/contracts/token/ERC721/extensions/ERC721Burnable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC721/extensions/ERC721Burnable.sol)\n\npragma solidity ^0.8.20;\n\nimport {ERC721} from \"../ERC721.sol\";\nimport {Context} from \"../../../utils/Context.sol\";\n\n/**\n * @title ERC-721 Burnable Token\n * @dev ERC-721 Token that can be burned (destroyed).\n */\nabstract contract ERC721Burnable is Context, ERC721 {\n /**\n * @dev Burns `tokenId`. See {ERC721-_burn}.\n *\n * Requirements:\n *\n * - The caller must own `tokenId` or be an approved operator.\n */\n function burn(uint256 tokenId) public virtual {\n // Setting an \"auth\" arguments enables the `_isAuthorized` check which verifies that the token exists\n // (from != 0). Therefore, it is not needed to verify that the return value is not 0 here.\n _update(address(0), tokenId, _msgSender());\n }\n}\n" + }, + "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC721/extensions/ERC721Enumerable.sol)\n\npragma solidity ^0.8.20;\n\nimport {ERC721} from \"../ERC721.sol\";\nimport {IERC721Enumerable} from \"./IERC721Enumerable.sol\";\nimport {IERC165} from \"../../../utils/introspection/ERC165.sol\";\n\n/**\n * @dev This implements an optional extension of {ERC721} defined in the ERC that adds enumerability\n * of all the token ids in the contract as well as all token ids owned by each account.\n *\n * CAUTION: {ERC721} extensions that implement custom `balanceOf` logic, such as {ERC721Consecutive},\n * interfere with enumerability and should not be used together with {ERC721Enumerable}.\n */\nabstract contract ERC721Enumerable is ERC721, IERC721Enumerable {\n mapping(address owner => mapping(uint256 index => uint256)) private _ownedTokens;\n mapping(uint256 tokenId => uint256) private _ownedTokensIndex;\n\n uint256[] private _allTokens;\n mapping(uint256 tokenId => uint256) private _allTokensIndex;\n\n /**\n * @dev An `owner`'s token query was out of bounds for `index`.\n *\n * NOTE: The owner being `address(0)` indicates a global out of bounds index.\n */\n error ERC721OutOfBoundsIndex(address owner, uint256 index);\n\n /**\n * @dev Batch mint is not allowed.\n */\n error ERC721EnumerableForbiddenBatchMint();\n\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165, ERC721) returns (bool) {\n return interfaceId == type(IERC721Enumerable).interfaceId || super.supportsInterface(interfaceId);\n }\n\n /**\n * @dev See {IERC721Enumerable-tokenOfOwnerByIndex}.\n */\n function tokenOfOwnerByIndex(address owner, uint256 index) public view virtual returns (uint256) {\n if (index >= balanceOf(owner)) {\n revert ERC721OutOfBoundsIndex(owner, index);\n }\n return _ownedTokens[owner][index];\n }\n\n /**\n * @dev See {IERC721Enumerable-totalSupply}.\n */\n function totalSupply() public view virtual returns (uint256) {\n return _allTokens.length;\n }\n\n /**\n * @dev See {IERC721Enumerable-tokenByIndex}.\n */\n function tokenByIndex(uint256 index) public view virtual returns (uint256) {\n if (index >= totalSupply()) {\n revert ERC721OutOfBoundsIndex(address(0), index);\n }\n return _allTokens[index];\n }\n\n /**\n * @dev See {ERC721-_update}.\n */\n function _update(address to, uint256 tokenId, address auth) internal virtual override returns (address) {\n address previousOwner = super._update(to, tokenId, auth);\n\n if (previousOwner == address(0)) {\n _addTokenToAllTokensEnumeration(tokenId);\n } else if (previousOwner != to) {\n _removeTokenFromOwnerEnumeration(previousOwner, tokenId);\n }\n if (to == address(0)) {\n _removeTokenFromAllTokensEnumeration(tokenId);\n } else if (previousOwner != to) {\n _addTokenToOwnerEnumeration(to, tokenId);\n }\n\n return previousOwner;\n }\n\n /**\n * @dev Private function to add a token to this extension's ownership-tracking data structures.\n * @param to address representing the new owner of the given token ID\n * @param tokenId uint256 ID of the token to be added to the tokens list of the given address\n */\n function _addTokenToOwnerEnumeration(address to, uint256 tokenId) private {\n uint256 length = balanceOf(to) - 1;\n _ownedTokens[to][length] = tokenId;\n _ownedTokensIndex[tokenId] = length;\n }\n\n /**\n * @dev Private function to add a token to this extension's token tracking data structures.\n * @param tokenId uint256 ID of the token to be added to the tokens list\n */\n function _addTokenToAllTokensEnumeration(uint256 tokenId) private {\n _allTokensIndex[tokenId] = _allTokens.length;\n _allTokens.push(tokenId);\n }\n\n /**\n * @dev Private function to remove a token from this extension's ownership-tracking data structures. Note that\n * while the token is not assigned a new owner, the `_ownedTokensIndex` mapping is _not_ updated: this allows for\n * gas optimizations e.g. when performing a transfer operation (avoiding double writes).\n * This has O(1) time complexity, but alters the order of the _ownedTokens array.\n * @param from address representing the previous owner of the given token ID\n * @param tokenId uint256 ID of the token to be removed from the tokens list of the given address\n */\n function _removeTokenFromOwnerEnumeration(address from, uint256 tokenId) private {\n // To prevent a gap in from's tokens array, we store the last token in the index of the token to delete, and\n // then delete the last slot (swap and pop).\n\n uint256 lastTokenIndex = balanceOf(from);\n uint256 tokenIndex = _ownedTokensIndex[tokenId];\n\n mapping(uint256 index => uint256) storage _ownedTokensByOwner = _ownedTokens[from];\n\n // When the token to delete is the last token, the swap operation is unnecessary\n if (tokenIndex != lastTokenIndex) {\n uint256 lastTokenId = _ownedTokensByOwner[lastTokenIndex];\n\n _ownedTokensByOwner[tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token\n _ownedTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index\n }\n\n // This also deletes the contents at the last position of the array\n delete _ownedTokensIndex[tokenId];\n delete _ownedTokensByOwner[lastTokenIndex];\n }\n\n /**\n * @dev Private function to remove a token from this extension's token tracking data structures.\n * This has O(1) time complexity, but alters the order of the _allTokens array.\n * @param tokenId uint256 ID of the token to be removed from the tokens list\n */\n function _removeTokenFromAllTokensEnumeration(uint256 tokenId) private {\n // To prevent a gap in the tokens array, we store the last token in the index of the token to delete, and\n // then delete the last slot (swap and pop).\n\n uint256 lastTokenIndex = _allTokens.length - 1;\n uint256 tokenIndex = _allTokensIndex[tokenId];\n\n // When the token to delete is the last token, the swap operation is unnecessary. However, since this occurs so\n // rarely (when the last minted token is burnt) that we still do the swap here to avoid the gas cost of adding\n // an 'if' statement (like in _removeTokenFromOwnerEnumeration)\n uint256 lastTokenId = _allTokens[lastTokenIndex];\n\n _allTokens[tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token\n _allTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index\n\n // This also deletes the contents at the last position of the array\n delete _allTokensIndex[tokenId];\n _allTokens.pop();\n }\n\n /**\n * See {ERC721-_increaseBalance}. We need that to account tokens that were minted in batch\n */\n function _increaseBalance(address account, uint128 amount) internal virtual override {\n if (amount > 0) {\n revert ERC721EnumerableForbiddenBatchMint();\n }\n super._increaseBalance(account, amount);\n }\n}\n" + }, + "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC721/extensions/ERC721URIStorage.sol)\n\npragma solidity ^0.8.20;\n\nimport {ERC721} from \"../ERC721.sol\";\nimport {Strings} from \"../../../utils/Strings.sol\";\nimport {IERC4906} from \"../../../interfaces/IERC4906.sol\";\nimport {IERC165} from \"../../../interfaces/IERC165.sol\";\n\n/**\n * @dev ERC-721 token with storage based token URI management.\n */\nabstract contract ERC721URIStorage is IERC4906, ERC721 {\n using Strings for uint256;\n\n // Interface ID as defined in ERC-4906. This does not correspond to a traditional interface ID as ERC-4906 only\n // defines events and does not include any external function.\n bytes4 private constant ERC4906_INTERFACE_ID = bytes4(0x49064906);\n\n // Optional mapping for token URIs\n mapping(uint256 tokenId => string) private _tokenURIs;\n\n /**\n * @dev See {IERC165-supportsInterface}\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override(ERC721, IERC165) returns (bool) {\n return interfaceId == ERC4906_INTERFACE_ID || super.supportsInterface(interfaceId);\n }\n\n /**\n * @dev See {IERC721Metadata-tokenURI}.\n */\n function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {\n _requireOwned(tokenId);\n\n string memory _tokenURI = _tokenURIs[tokenId];\n string memory base = _baseURI();\n\n // If there is no base URI, return the token URI.\n if (bytes(base).length == 0) {\n return _tokenURI;\n }\n // If both are set, concatenate the baseURI and tokenURI (via string.concat).\n if (bytes(_tokenURI).length > 0) {\n return string.concat(base, _tokenURI);\n }\n\n return super.tokenURI(tokenId);\n }\n\n /**\n * @dev Sets `_tokenURI` as the tokenURI of `tokenId`.\n *\n * Emits {MetadataUpdate}.\n */\n function _setTokenURI(uint256 tokenId, string memory _tokenURI) internal virtual {\n _tokenURIs[tokenId] = _tokenURI;\n emit MetadataUpdate(tokenId);\n }\n}\n" + }, + "@openzeppelin/contracts/token/ERC721/extensions/ERC721Votes.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC721/extensions/ERC721Votes.sol)\n\npragma solidity ^0.8.20;\n\nimport {ERC721} from \"../ERC721.sol\";\nimport {Votes} from \"../../../governance/utils/Votes.sol\";\n\n/**\n * @dev Extension of ERC-721 to support voting and delegation as implemented by {Votes}, where each individual NFT counts\n * as 1 vote unit.\n *\n * Tokens do not count as votes until they are delegated, because votes must be tracked which incurs an additional cost\n * on every transfer. Token holders can either delegate to a trusted representative who will decide how to make use of\n * the votes in governance decisions, or they can delegate to themselves to be their own representative.\n */\nabstract contract ERC721Votes is ERC721, Votes {\n /**\n * @dev See {ERC721-_update}. Adjusts votes when tokens are transferred.\n *\n * Emits a {IVotes-DelegateVotesChanged} event.\n */\n function _update(address to, uint256 tokenId, address auth) internal virtual override returns (address) {\n address previousOwner = super._update(to, tokenId, auth);\n\n _transferVotingUnits(previousOwner, to, 1);\n\n return previousOwner;\n }\n\n /**\n * @dev Returns the balance of `account`.\n *\n * WARNING: Overriding this function will likely result in incorrect vote tracking.\n */\n function _getVotingUnits(address account) internal view virtual override returns (uint256) {\n return balanceOf(account);\n }\n\n /**\n * @dev See {ERC721-_increaseBalance}. We need that to account tokens that were minted in batch.\n */\n function _increaseBalance(address account, uint128 amount) internal virtual override {\n super._increaseBalance(account, amount);\n _transferVotingUnits(address(0), account, amount);\n }\n}\n" + }, + "@openzeppelin/contracts/token/ERC721/extensions/IERC721Enumerable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC721/extensions/IERC721Enumerable.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC721} from \"../IERC721.sol\";\n\n/**\n * @title ERC-721 Non-Fungible Token Standard, optional enumeration extension\n * @dev See https://eips.ethereum.org/EIPS/eip-721\n */\ninterface IERC721Enumerable is IERC721 {\n /**\n * @dev Returns the total amount of tokens stored by the contract.\n */\n function totalSupply() external view returns (uint256);\n\n /**\n * @dev Returns a token ID owned by `owner` at a given `index` of its token list.\n * Use along with {balanceOf} to enumerate all of ``owner``'s tokens.\n */\n function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256);\n\n /**\n * @dev Returns a token ID at a given `index` of all the tokens stored by the contract.\n * Use along with {totalSupply} to enumerate all tokens.\n */\n function tokenByIndex(uint256 index) external view returns (uint256);\n}\n" + }, + "@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC721/extensions/IERC721Metadata.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC721} from \"../IERC721.sol\";\n\n/**\n * @title ERC-721 Non-Fungible Token Standard, optional metadata extension\n * @dev See https://eips.ethereum.org/EIPS/eip-721\n */\ninterface IERC721Metadata is IERC721 {\n /**\n * @dev Returns the token collection name.\n */\n function name() external view returns (string memory);\n\n /**\n * @dev Returns the token collection symbol.\n */\n function symbol() external view returns (string memory);\n\n /**\n * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token.\n */\n function tokenURI(uint256 tokenId) external view returns (string memory);\n}\n" + }, + "@openzeppelin/contracts/token/ERC721/IERC721.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC721/IERC721.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC165} from \"../../utils/introspection/IERC165.sol\";\n\n/**\n * @dev Required interface of an ERC-721 compliant contract.\n */\ninterface IERC721 is IERC165 {\n /**\n * @dev Emitted when `tokenId` token is transferred from `from` to `to`.\n */\n event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);\n\n /**\n * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.\n */\n event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);\n\n /**\n * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.\n */\n event ApprovalForAll(address indexed owner, address indexed operator, bool approved);\n\n /**\n * @dev Returns the number of tokens in ``owner``'s account.\n */\n function balanceOf(address owner) external view returns (uint256 balance);\n\n /**\n * @dev Returns the owner of the `tokenId` token.\n *\n * Requirements:\n *\n * - `tokenId` must exist.\n */\n function ownerOf(uint256 tokenId) external view returns (address owner);\n\n /**\n * @dev Safely transfers `tokenId` token from `from` to `to`.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `tokenId` token must exist and be owned by `from`.\n * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon\n * a safe transfer.\n *\n * Emits a {Transfer} event.\n */\n function safeTransferFrom(address from, address to, uint256 tokenId, bytes calldata data) external;\n\n /**\n * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients\n * are aware of the ERC-721 protocol to prevent tokens from being forever locked.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `tokenId` token must exist and be owned by `from`.\n * - If the caller is not `from`, it must have been allowed to move this token by either {approve} or\n * {setApprovalForAll}.\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon\n * a safe transfer.\n *\n * Emits a {Transfer} event.\n */\n function safeTransferFrom(address from, address to, uint256 tokenId) external;\n\n /**\n * @dev Transfers `tokenId` token from `from` to `to`.\n *\n * WARNING: Note that the caller is responsible to confirm that the recipient is capable of receiving ERC-721\n * or else they may be permanently lost. Usage of {safeTransferFrom} prevents loss, though the caller must\n * understand this adds an external call which potentially creates a reentrancy vulnerability.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `tokenId` token must be owned by `from`.\n * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(address from, address to, uint256 tokenId) external;\n\n /**\n * @dev Gives permission to `to` to transfer `tokenId` token to another account.\n * The approval is cleared when the token is transferred.\n *\n * Only a single account can be approved at a time, so approving the zero address clears previous approvals.\n *\n * Requirements:\n *\n * - The caller must own the token or be an approved operator.\n * - `tokenId` must exist.\n *\n * Emits an {Approval} event.\n */\n function approve(address to, uint256 tokenId) external;\n\n /**\n * @dev Approve or remove `operator` as an operator for the caller.\n * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.\n *\n * Requirements:\n *\n * - The `operator` cannot be the address zero.\n *\n * Emits an {ApprovalForAll} event.\n */\n function setApprovalForAll(address operator, bool approved) external;\n\n /**\n * @dev Returns the account approved for `tokenId` token.\n *\n * Requirements:\n *\n * - `tokenId` must exist.\n */\n function getApproved(uint256 tokenId) external view returns (address operator);\n\n /**\n * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.\n *\n * See {setApprovalForAll}\n */\n function isApprovedForAll(address owner, address operator) external view returns (bool);\n}\n" + }, + "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC721/IERC721Receiver.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @title ERC-721 token receiver interface\n * @dev Interface for any contract that wants to support safeTransfers\n * from ERC-721 asset contracts.\n */\ninterface IERC721Receiver {\n /**\n * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom}\n * by `operator` from `from`, this function is called.\n *\n * It must return its Solidity selector to confirm the token transfer.\n * If any other value is returned or the interface is not implemented by the recipient, the transfer will be\n * reverted.\n *\n * The selector can be obtained in Solidity with `IERC721Receiver.onERC721Received.selector`.\n */\n function onERC721Received(\n address operator,\n address from,\n uint256 tokenId,\n bytes calldata data\n ) external returns (bytes4);\n}\n" + }, + "@openzeppelin/contracts/token/ERC721/utils/ERC721Utils.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC721/utils/ERC721Utils.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC721Receiver} from \"../IERC721Receiver.sol\";\nimport {IERC721Errors} from \"../../../interfaces/draft-IERC6093.sol\";\n\n/**\n * @dev Library that provide common ERC-721 utility functions.\n *\n * See https://eips.ethereum.org/EIPS/eip-721[ERC-721].\n *\n * _Available since v5.1._\n */\nlibrary ERC721Utils {\n /**\n * @dev Performs an acceptance check for the provided `operator` by calling {IERC721-onERC721Received}\n * on the `to` address. The `operator` is generally the address that initiated the token transfer (i.e. `msg.sender`).\n *\n * The acceptance call is not executed and treated as a no-op if the target address doesn't contain code (i.e. an EOA).\n * Otherwise, the recipient must implement {IERC721Receiver-onERC721Received} and return the acceptance magic value to accept\n * the transfer.\n */\n function checkOnERC721Received(\n address operator,\n address from,\n address to,\n uint256 tokenId,\n bytes memory data\n ) internal {\n if (to.code.length > 0) {\n try IERC721Receiver(to).onERC721Received(operator, from, tokenId, data) returns (bytes4 retval) {\n if (retval != IERC721Receiver.onERC721Received.selector) {\n // Token rejected\n revert IERC721Errors.ERC721InvalidReceiver(to);\n }\n } catch (bytes memory reason) {\n if (reason.length == 0) {\n // non-IERC721Receiver implementer\n revert IERC721Errors.ERC721InvalidReceiver(to);\n } else {\n assembly (\"memory-safe\") {\n revert(add(32, reason), mload(reason))\n }\n }\n }\n }\n }\n}\n" + }, + "@openzeppelin/contracts/utils/Address.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/Address.sol)\n\npragma solidity ^0.8.20;\n\nimport {Errors} from \"./Errors.sol\";\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary Address {\n /**\n * @dev There's no code at `target` (it is not a contract).\n */\n error AddressEmptyCode(address target);\n\n /**\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\n * `recipient`, forwarding all available gas and reverting on errors.\n *\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\n * imposed by `transfer`, making them unable to receive funds via\n * `transfer`. {sendValue} removes this limitation.\n *\n * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n *\n * IMPORTANT: because control is transferred to `recipient`, care must be\n * taken to not create reentrancy vulnerabilities. Consider using\n * {ReentrancyGuard} or the\n * https://solidity.readthedocs.io/en/v0.8.20/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n */\n function sendValue(address payable recipient, uint256 amount) internal {\n if (address(this).balance < amount) {\n revert Errors.InsufficientBalance(address(this).balance, amount);\n }\n\n (bool success, ) = recipient.call{value: amount}(\"\");\n if (!success) {\n revert Errors.FailedCall();\n }\n }\n\n /**\n * @dev Performs a Solidity function call using a low level `call`. A\n * plain `call` is an unsafe replacement for a function call: use this\n * function instead.\n *\n * If `target` reverts with a revert reason or custom error, it is bubbled\n * up by this function (like regular Solidity function calls). However, if\n * the call reverted with no returned reason, this function reverts with a\n * {Errors.FailedCall} error.\n *\n * Returns the raw returned data. To convert to the expected return value,\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\n *\n * Requirements:\n *\n * - `target` must be a contract.\n * - calling `target` with `data` must not revert.\n */\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but also transferring `value` wei to `target`.\n *\n * Requirements:\n *\n * - the calling contract must have an ETH balance of at least `value`.\n * - the called Solidity function must be `payable`.\n */\n function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {\n if (address(this).balance < value) {\n revert Errors.InsufficientBalance(address(this).balance, value);\n }\n (bool success, bytes memory returndata) = target.call{value: value}(data);\n return verifyCallResultFromTarget(target, success, returndata);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a static call.\n */\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\n (bool success, bytes memory returndata) = target.staticcall(data);\n return verifyCallResultFromTarget(target, success, returndata);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a delegate call.\n */\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\n (bool success, bytes memory returndata) = target.delegatecall(data);\n return verifyCallResultFromTarget(target, success, returndata);\n }\n\n /**\n * @dev Tool to verify that a low level call to smart-contract was successful, and reverts if the target\n * was not a contract or bubbling up the revert reason (falling back to {Errors.FailedCall}) in case\n * of an unsuccessful call.\n */\n function verifyCallResultFromTarget(\n address target,\n bool success,\n bytes memory returndata\n ) internal view returns (bytes memory) {\n if (!success) {\n _revert(returndata);\n } else {\n // only check if target is a contract if the call was successful and the return data is empty\n // otherwise we already know that it was a contract\n if (returndata.length == 0 && target.code.length == 0) {\n revert AddressEmptyCode(target);\n }\n return returndata;\n }\n }\n\n /**\n * @dev Tool to verify that a low level call was successful, and reverts if it wasn't, either by bubbling the\n * revert reason or with a default {Errors.FailedCall} error.\n */\n function verifyCallResult(bool success, bytes memory returndata) internal pure returns (bytes memory) {\n if (!success) {\n _revert(returndata);\n } else {\n return returndata;\n }\n }\n\n /**\n * @dev Reverts with returndata if present. Otherwise reverts with {Errors.FailedCall}.\n */\n function _revert(bytes memory returndata) private pure {\n // Look for revert reason and bubble it up if present\n if (returndata.length > 0) {\n // The easiest way to bubble the revert reason is using memory via assembly\n assembly (\"memory-safe\") {\n let returndata_size := mload(returndata)\n revert(add(32, returndata), returndata_size)\n }\n } else {\n revert Errors.FailedCall();\n }\n }\n}\n" + }, + "@openzeppelin/contracts/utils/Context.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract Context {\n function _msgSender() internal view virtual returns (address) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual returns (bytes calldata) {\n return msg.data;\n }\n\n function _contextSuffixLength() internal view virtual returns (uint256) {\n return 0;\n }\n}\n" + }, + "@openzeppelin/contracts/utils/cryptography/ECDSA.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/cryptography/ECDSA.sol)\n\npragma solidity ^0.8.20;\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 }\n\n /**\n * @dev The signature derives the `address(0)`.\n */\n error ECDSAInvalidSignature();\n\n /**\n * @dev The signature has an invalid length.\n */\n error ECDSAInvalidSignatureLength(uint256 length);\n\n /**\n * @dev The signature has an S value that is in the upper half order.\n */\n error ECDSAInvalidSignatureS(bytes32 s);\n\n /**\n * @dev Returns the address that signed a hashed message (`hash`) with `signature` or an error. This will not\n * return address(0) without also returning an error description. Errors are documented using an enum (error type)\n * and a bytes32 providing additional information about the error.\n *\n * If no error is returned, then the address can be used for verification purposes.\n *\n * The `ecrecover` EVM precompile 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 {MessageHashUtils-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 function tryRecover(\n bytes32 hash,\n bytes memory signature\n ) internal pure returns (address recovered, RecoverError err, bytes32 errArg) {\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 assembly (\"memory-safe\") {\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, bytes32(signature.length));\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 precompile 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 {MessageHashUtils-toEthSignedMessageHash} on it.\n */\n function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {\n (address recovered, RecoverError error, bytes32 errorArg) = tryRecover(hash, signature);\n _throwError(error, errorArg);\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[ERC-2098 short signatures]\n */\n function tryRecover(\n bytes32 hash,\n bytes32 r,\n bytes32 vs\n ) internal pure returns (address recovered, RecoverError err, bytes32 errArg) {\n unchecked {\n bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff);\n // We do not check for an overflow here since the shift operation results in 0 or 1.\n uint8 v = uint8((uint256(vs) >> 255) + 27);\n return tryRecover(hash, v, r, s);\n }\n }\n\n /**\n * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately.\n */\n function recover(bytes32 hash, bytes32 r, bytes32 vs) internal pure returns (address) {\n (address recovered, RecoverError error, bytes32 errorArg) = tryRecover(hash, r, vs);\n _throwError(error, errorArg);\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 function tryRecover(\n bytes32 hash,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) internal pure returns (address recovered, RecoverError err, bytes32 errArg) {\n // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature\n // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines\n // the valid range for s in (301): 0 < s < secp256k1n ÷ 2 + 1, and for v in (302): v ∈ {27, 28}. Most\n // signatures from current libraries generate a unique signature with an s-value in the lower half order.\n //\n // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value\n // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or\n // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept\n // these malleable signatures as well.\n if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) {\n return (address(0), RecoverError.InvalidSignatureS, s);\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, bytes32(0));\n }\n\n return (signer, RecoverError.NoError, bytes32(0));\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, bytes32 errorArg) = tryRecover(hash, v, r, s);\n _throwError(error, errorArg);\n return recovered;\n }\n\n /**\n * @dev Optionally reverts with the corresponding custom error according to the `error` argument provided.\n */\n function _throwError(RecoverError error, bytes32 errorArg) private pure {\n if (error == RecoverError.NoError) {\n return; // no error: do nothing\n } else if (error == RecoverError.InvalidSignature) {\n revert ECDSAInvalidSignature();\n } else if (error == RecoverError.InvalidSignatureLength) {\n revert ECDSAInvalidSignatureLength(uint256(errorArg));\n } else if (error == RecoverError.InvalidSignatureS) {\n revert ECDSAInvalidSignatureS(errorArg);\n }\n }\n}\n" + }, + "@openzeppelin/contracts/utils/cryptography/EIP712.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/cryptography/EIP712.sol)\n\npragma solidity ^0.8.20;\n\nimport {MessageHashUtils} from \"./MessageHashUtils.sol\";\nimport {ShortStrings, ShortString} from \"../ShortStrings.sol\";\nimport {IERC5267} from \"../../interfaces/IERC5267.sol\";\n\n/**\n * @dev https://eips.ethereum.org/EIPS/eip-712[EIP-712] is a standard for hashing and signing of typed structured data.\n *\n * The encoding scheme specified in the EIP requires a domain separator and a hash of the typed structured data, whose\n * encoding is very generic and therefore its implementation in Solidity is not feasible, thus this contract\n * does not implement the encoding itself. Protocols need to implement the type-specific encoding they need in order to\n * produce the hash of their typed data using a combination of `abi.encode` and `keccak256`.\n *\n * This contract implements the EIP-712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding\n * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA\n * ({_hashTypedDataV4}).\n *\n * The implementation of the domain separator was designed to be as efficient as possible while still properly updating\n * the chain id to protect against replay attacks on an eventual fork of the chain.\n *\n * NOTE: This contract implements the version of the encoding known as \"v4\", as implemented by the JSON RPC method\n * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask].\n *\n * NOTE: In the upgradeable version of this contract, the cached values will correspond to the address, and the domain\n * separator of the implementation contract. This will cause the {_domainSeparatorV4} function to always rebuild the\n * separator from the immutable values, which is cheaper than accessing a cached version in cold storage.\n *\n * @custom:oz-upgrades-unsafe-allow state-variable-immutable\n */\nabstract contract EIP712 is IERC5267 {\n using ShortStrings for *;\n\n bytes32 private constant TYPE_HASH =\n keccak256(\"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)\");\n\n // Cache the domain separator as an immutable value, but also store the chain id that it corresponds to, in order to\n // invalidate the cached domain separator if the chain id changes.\n bytes32 private immutable _cachedDomainSeparator;\n uint256 private immutable _cachedChainId;\n address private immutable _cachedThis;\n\n bytes32 private immutable _hashedName;\n bytes32 private immutable _hashedVersion;\n\n ShortString private immutable _name;\n ShortString private immutable _version;\n string private _nameFallback;\n string private _versionFallback;\n\n /**\n * @dev Initializes the domain separator and parameter caches.\n *\n * The meaning of `name` and `version` is specified in\n * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP-712]:\n *\n * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol.\n * - `version`: the current major version of the signing domain.\n *\n * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart\n * contract upgrade].\n */\n constructor(string memory name, string memory version) {\n _name = name.toShortStringWithFallback(_nameFallback);\n _version = version.toShortStringWithFallback(_versionFallback);\n _hashedName = keccak256(bytes(name));\n _hashedVersion = keccak256(bytes(version));\n\n _cachedChainId = block.chainid;\n _cachedDomainSeparator = _buildDomainSeparator();\n _cachedThis = address(this);\n }\n\n /**\n * @dev Returns the domain separator for the current chain.\n */\n function _domainSeparatorV4() internal view returns (bytes32) {\n if (address(this) == _cachedThis && block.chainid == _cachedChainId) {\n return _cachedDomainSeparator;\n } else {\n return _buildDomainSeparator();\n }\n }\n\n function _buildDomainSeparator() private view returns (bytes32) {\n return keccak256(abi.encode(TYPE_HASH, _hashedName, _hashedVersion, block.chainid, address(this)));\n }\n\n /**\n * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this\n * function returns the hash of the fully encoded EIP712 message for this domain.\n *\n * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example:\n *\n * ```solidity\n * bytes32 digest = _hashTypedDataV4(keccak256(abi.encode(\n * keccak256(\"Mail(address to,string contents)\"),\n * mailTo,\n * keccak256(bytes(mailContents))\n * )));\n * address signer = ECDSA.recover(digest, signature);\n * ```\n */\n function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) {\n return MessageHashUtils.toTypedDataHash(_domainSeparatorV4(), structHash);\n }\n\n /**\n * @dev See {IERC-5267}.\n */\n function eip712Domain()\n public\n view\n virtual\n returns (\n bytes1 fields,\n string memory name,\n string memory version,\n uint256 chainId,\n address verifyingContract,\n bytes32 salt,\n uint256[] memory extensions\n )\n {\n return (\n hex\"0f\", // 01111\n _EIP712Name(),\n _EIP712Version(),\n block.chainid,\n address(this),\n bytes32(0),\n new uint256[](0)\n );\n }\n\n /**\n * @dev The name parameter for the EIP712 domain.\n *\n * NOTE: By default this function reads _name which is an immutable value.\n * It only reads from storage if necessary (in case the value is too large to fit in a ShortString).\n */\n // solhint-disable-next-line func-name-mixedcase\n function _EIP712Name() internal view returns (string memory) {\n return _name.toStringWithFallback(_nameFallback);\n }\n\n /**\n * @dev The version parameter for the EIP712 domain.\n *\n * NOTE: By default this function reads _version which is an immutable value.\n * It only reads from storage if necessary (in case the value is too large to fit in a ShortString).\n */\n // solhint-disable-next-line func-name-mixedcase\n function _EIP712Version() internal view returns (string memory) {\n return _version.toStringWithFallback(_versionFallback);\n }\n}\n" + }, + "@openzeppelin/contracts/utils/cryptography/MessageHashUtils.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/cryptography/MessageHashUtils.sol)\n\npragma solidity ^0.8.20;\n\nimport {Strings} from \"../Strings.sol\";\n\n/**\n * @dev Signature message hash utilities for producing digests to be consumed by {ECDSA} recovery or signing.\n *\n * The library provides methods for generating a hash of a message that conforms to the\n * https://eips.ethereum.org/EIPS/eip-191[ERC-191] and https://eips.ethereum.org/EIPS/eip-712[EIP 712]\n * specifications.\n */\nlibrary MessageHashUtils {\n /**\n * @dev Returns the keccak256 digest of an ERC-191 signed data with version\n * `0x45` (`personal_sign` messages).\n *\n * The digest is calculated by prefixing a bytes32 `messageHash` with\n * `\"\\x19Ethereum Signed Message:\\n32\"` and hashing the result. It corresponds with the\n * hash signed when using the https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] JSON-RPC method.\n *\n * NOTE: The `messageHash` parameter is intended to be the result of hashing a raw message with\n * keccak256, although any bytes32 value can be safely used because the final digest will\n * be re-hashed.\n *\n * See {ECDSA-recover}.\n */\n function toEthSignedMessageHash(bytes32 messageHash) internal pure returns (bytes32 digest) {\n assembly (\"memory-safe\") {\n mstore(0x00, \"\\x19Ethereum Signed Message:\\n32\") // 32 is the bytes-length of messageHash\n mstore(0x1c, messageHash) // 0x1c (28) is the length of the prefix\n digest := keccak256(0x00, 0x3c) // 0x3c is the length of the prefix (0x1c) + messageHash (0x20)\n }\n }\n\n /**\n * @dev Returns the keccak256 digest of an ERC-191 signed data with version\n * `0x45` (`personal_sign` messages).\n *\n * The digest is calculated by prefixing an arbitrary `message` with\n * `\"\\x19Ethereum Signed Message:\\n\" + len(message)` and hashing the result. It corresponds with the\n * hash signed when using the https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] JSON-RPC method.\n *\n * See {ECDSA-recover}.\n */\n function toEthSignedMessageHash(bytes memory message) internal pure returns (bytes32) {\n return\n keccak256(bytes.concat(\"\\x19Ethereum Signed Message:\\n\", bytes(Strings.toString(message.length)), message));\n }\n\n /**\n * @dev Returns the keccak256 digest of an ERC-191 signed data with version\n * `0x00` (data with intended validator).\n *\n * The digest is calculated by prefixing an arbitrary `data` with `\"\\x19\\x00\"` and the intended\n * `validator` address. Then hashing the result.\n *\n * See {ECDSA-recover}.\n */\n function toDataWithIntendedValidatorHash(address validator, bytes memory data) internal pure returns (bytes32) {\n return keccak256(abi.encodePacked(hex\"19_00\", validator, data));\n }\n\n /**\n * @dev Returns the keccak256 digest of an EIP-712 typed data (ERC-191 version `0x01`).\n *\n * The digest is calculated from a `domainSeparator` and a `structHash`, by prefixing them with\n * `\\x19\\x01` and hashing the result. It corresponds to the hash signed by the\n * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`] JSON-RPC method as part of EIP-712.\n *\n * See {ECDSA-recover}.\n */\n function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32 digest) {\n assembly (\"memory-safe\") {\n let ptr := mload(0x40)\n mstore(ptr, hex\"19_01\")\n mstore(add(ptr, 0x02), domainSeparator)\n mstore(add(ptr, 0x22), structHash)\n digest := keccak256(ptr, 0x42)\n }\n }\n}\n" + }, + "@openzeppelin/contracts/utils/cryptography/SignatureChecker.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/cryptography/SignatureChecker.sol)\n\npragma solidity ^0.8.20;\n\nimport {ECDSA} from \"./ECDSA.sol\";\nimport {IERC1271} from \"../../interfaces/IERC1271.sol\";\n\n/**\n * @dev Signature verification helper that can be used instead of `ECDSA.recover` to seamlessly support both ECDSA\n * signatures from externally owned accounts (EOAs) as well as ERC-1271 signatures from smart contract wallets like\n * Argent and Safe Wallet (previously Gnosis Safe).\n */\nlibrary SignatureChecker {\n /**\n * @dev Checks if a signature is valid for a given signer and data hash. If the signer is a smart contract, the\n * signature is validated against that smart contract using ERC-1271, otherwise it's validated using `ECDSA.recover`.\n *\n * NOTE: Unlike ECDSA signatures, contract signatures are revocable, and the outcome of this function can thus\n * change through time. It could return true at block N and false at block N+1 (or the opposite).\n */\n function isValidSignatureNow(address signer, bytes32 hash, bytes memory signature) internal view returns (bool) {\n if (signer.code.length == 0) {\n (address recovered, ECDSA.RecoverError err, ) = ECDSA.tryRecover(hash, signature);\n return err == ECDSA.RecoverError.NoError && recovered == signer;\n } else {\n return isValidERC1271SignatureNow(signer, hash, signature);\n }\n }\n\n /**\n * @dev Checks if a signature is valid for a given signer and data hash. The signature is validated\n * against the signer smart contract using ERC-1271.\n *\n * NOTE: Unlike ECDSA signatures, contract signatures are revocable, and the outcome of this function can thus\n * change through time. It could return true at block N and false at block N+1 (or the opposite).\n */\n function isValidERC1271SignatureNow(\n address signer,\n bytes32 hash,\n bytes memory signature\n ) internal view returns (bool) {\n (bool success, bytes memory result) = signer.staticcall(\n abi.encodeCall(IERC1271.isValidSignature, (hash, signature))\n );\n return (success &&\n result.length >= 32 &&\n abi.decode(result, (bytes32)) == bytes32(IERC1271.isValidSignature.selector));\n }\n}\n" + }, + "@openzeppelin/contracts/utils/Errors.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/Errors.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Collection of common custom errors used in multiple contracts\n *\n * IMPORTANT: Backwards compatibility is not guaranteed in future versions of the library.\n * It is recommended to avoid relying on the error API for critical functionality.\n *\n * _Available since v5.1._\n */\nlibrary Errors {\n /**\n * @dev The ETH balance of the account is not enough to perform the operation.\n */\n error InsufficientBalance(uint256 balance, uint256 needed);\n\n /**\n * @dev A call to an address target failed. The target may have reverted.\n */\n error FailedCall();\n\n /**\n * @dev The deployment failed.\n */\n error FailedDeployment();\n\n /**\n * @dev A necessary precompile is missing.\n */\n error MissingPrecompile(address);\n}\n" + }, + "@openzeppelin/contracts/utils/introspection/ERC165.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/introspection/ERC165.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC165} from \"./IERC165.sol\";\n\n/**\n * @dev Implementation of the {IERC165} interface.\n *\n * Contracts that want to implement ERC-165 should inherit from this contract and override {supportsInterface} to check\n * for the additional interface id that will be supported. For example:\n *\n * ```solidity\n * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);\n * }\n * ```\n */\nabstract contract ERC165 is IERC165 {\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) {\n return interfaceId == type(IERC165).interfaceId;\n }\n}\n" + }, + "@openzeppelin/contracts/utils/introspection/IERC165.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/introspection/IERC165.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Interface of the ERC-165 standard, as defined in the\n * https://eips.ethereum.org/EIPS/eip-165[ERC].\n *\n * Implementers can declare support of contract interfaces, which can then be\n * queried by others ({ERC165Checker}).\n *\n * For an implementation, see {ERC165}.\n */\ninterface IERC165 {\n /**\n * @dev Returns true if this contract implements the interface defined by\n * `interfaceId`. See the corresponding\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[ERC section]\n * to learn more about how these ids are created.\n *\n * This function call must use less than 30 000 gas.\n */\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\n}\n" + }, + "@openzeppelin/contracts/utils/math/Math.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/math/Math.sol)\n\npragma solidity ^0.8.20;\n\nimport {Panic} from \"../Panic.sol\";\nimport {SafeCast} from \"./SafeCast.sol\";\n\n/**\n * @dev Standard math utilities missing in the Solidity language.\n */\nlibrary Math {\n enum Rounding {\n Floor, // Toward negative infinity\n Ceil, // Toward positive infinity\n Trunc, // Toward zero\n Expand // Away from zero\n }\n\n /**\n * @dev Returns the addition of two unsigned integers, with an success flag (no overflow).\n */\n function tryAdd(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\n unchecked {\n uint256 c = a + b;\n if (c < a) return (false, 0);\n return (true, c);\n }\n }\n\n /**\n * @dev Returns the subtraction of two unsigned integers, with an success flag (no overflow).\n */\n function trySub(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\n unchecked {\n if (b > a) return (false, 0);\n return (true, a - b);\n }\n }\n\n /**\n * @dev Returns the multiplication of two unsigned integers, with an success flag (no overflow).\n */\n function tryMul(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\n unchecked {\n // Gas optimization: this is cheaper than requiring 'a' not being zero, but the\n // benefit is lost if 'b' is also tested.\n // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522\n if (a == 0) return (true, 0);\n uint256 c = a * b;\n if (c / a != b) return (false, 0);\n return (true, c);\n }\n }\n\n /**\n * @dev Returns the division of two unsigned integers, with a success flag (no division by zero).\n */\n function tryDiv(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\n unchecked {\n if (b == 0) return (false, 0);\n return (true, a / b);\n }\n }\n\n /**\n * @dev Returns the remainder of dividing two unsigned integers, with a success flag (no division by zero).\n */\n function tryMod(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\n unchecked {\n if (b == 0) return (false, 0);\n return (true, a % b);\n }\n }\n\n /**\n * @dev Branchless ternary evaluation for `a ? b : c`. Gas costs are constant.\n *\n * IMPORTANT: This function may reduce bytecode size and consume less gas when used standalone.\n * However, the compiler may optimize Solidity ternary operations (i.e. `a ? b : c`) to only compute\n * one branch when needed, making this function more expensive.\n */\n function ternary(bool condition, uint256 a, uint256 b) internal pure returns (uint256) {\n unchecked {\n // branchless ternary works because:\n // b ^ (a ^ b) == a\n // b ^ 0 == b\n return b ^ ((a ^ b) * SafeCast.toUint(condition));\n }\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 ternary(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 ternary(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 towards infinity instead\n * of rounding towards zero.\n */\n function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {\n if (b == 0) {\n // Guarantee the same behavior as in a regular Solidity division.\n Panic.panic(Panic.DIVISION_BY_ZERO);\n }\n\n // The following calculation ensures accurate ceiling division without overflow.\n // Since a is non-zero, (a - 1) / b will not overflow.\n // The largest possible result occurs when (a - 1) / b is type(uint256).max,\n // but the largest value we can obtain is type(uint256).max - 1, which happens\n // when a = type(uint256).max and b = 1.\n unchecked {\n return SafeCast.toUint(a > 0) * ((a - 1) / b + 1);\n }\n }\n\n /**\n * @dev Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or\n * denominator == 0.\n *\n * Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv) with further edits by\n * 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²⁵⁶ and mod 2²⁵⁶ - 1, then use\n // the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256\n // variables such that product = prod1 * 2²⁵⁶ + prod0.\n uint256 prod0 = x * y; // 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 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²⁵⁶. Also prevents denominator == 0.\n if (denominator <= prod1) {\n Panic.panic(ternary(denominator == 0, Panic.DIVISION_BY_ZERO, Panic.UNDER_OVERFLOW));\n }\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.\n // Always >= 1. See https://cs.stackexchange.com/q/138556/92363.\n\n uint256 twos = denominator & (0 - denominator);\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²⁵⁶ / 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²⁵⁶. Now that denominator is an odd number, it has an inverse modulo 2²⁵⁶ such\n // that denominator * inv ≡ 1 mod 2²⁵⁶. Compute the inverse by starting with a seed that is correct for\n // four bits. That is, denominator * inv ≡ 1 mod 2⁴.\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\n // works in modular arithmetic, doubling the correct bits in each step.\n inverse *= 2 - denominator * inverse; // inverse mod 2⁸\n inverse *= 2 - denominator * inverse; // inverse mod 2¹⁶\n inverse *= 2 - denominator * inverse; // inverse mod 2³²\n inverse *= 2 - denominator * inverse; // inverse mod 2⁶⁴\n inverse *= 2 - denominator * inverse; // inverse mod 2¹²⁸\n inverse *= 2 - denominator * inverse; // inverse mod 2²⁵⁶\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²⁵⁶. Since the preconditions guarantee that the outcome is\n // less than 2²⁵⁶, 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 * @dev 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 return mulDiv(x, y, denominator) + SafeCast.toUint(unsignedRoundsUp(rounding) && mulmod(x, y, denominator) > 0);\n }\n\n /**\n * @dev Calculate the modular multiplicative inverse of a number in Z/nZ.\n *\n * If n is a prime, then Z/nZ is a field. In that case all elements are inversible, except 0.\n * If n is not a prime, then Z/nZ is not a field, and some elements might not be inversible.\n *\n * If the input value is not inversible, 0 is returned.\n *\n * NOTE: If you know for sure that n is (big) a prime, it may be cheaper to use Fermat's little theorem and get the\n * inverse using `Math.modExp(a, n - 2, n)`. See {invModPrime}.\n */\n function invMod(uint256 a, uint256 n) internal pure returns (uint256) {\n unchecked {\n if (n == 0) return 0;\n\n // The inverse modulo is calculated using the Extended Euclidean Algorithm (iterative version)\n // Used to compute integers x and y such that: ax + ny = gcd(a, n).\n // When the gcd is 1, then the inverse of a modulo n exists and it's x.\n // ax + ny = 1\n // ax = 1 + (-y)n\n // ax ≡ 1 (mod n) # x is the inverse of a modulo n\n\n // If the remainder is 0 the gcd is n right away.\n uint256 remainder = a % n;\n uint256 gcd = n;\n\n // Therefore the initial coefficients are:\n // ax + ny = gcd(a, n) = n\n // 0a + 1n = n\n int256 x = 0;\n int256 y = 1;\n\n while (remainder != 0) {\n uint256 quotient = gcd / remainder;\n\n (gcd, remainder) = (\n // The old remainder is the next gcd to try.\n remainder,\n // Compute the next remainder.\n // Can't overflow given that (a % gcd) * (gcd // (a % gcd)) <= gcd\n // where gcd is at most n (capped to type(uint256).max)\n gcd - remainder * quotient\n );\n\n (x, y) = (\n // Increment the coefficient of a.\n y,\n // Decrement the coefficient of n.\n // Can overflow, but the result is casted to uint256 so that the\n // next value of y is \"wrapped around\" to a value between 0 and n - 1.\n x - y * int256(quotient)\n );\n }\n\n if (gcd != 1) return 0; // No inverse exists.\n return ternary(x < 0, n - uint256(-x), uint256(x)); // Wrap the result if it's negative.\n }\n }\n\n /**\n * @dev Variant of {invMod}. More efficient, but only works if `p` is known to be a prime greater than `2`.\n *\n * From https://en.wikipedia.org/wiki/Fermat%27s_little_theorem[Fermat's little theorem], we know that if p is\n * prime, then `a**(p-1) ≡ 1 mod p`. As a consequence, we have `a * a**(p-2) ≡ 1 mod p`, which means that\n * `a**(p-2)` is the modular multiplicative inverse of a in Fp.\n *\n * NOTE: this function does NOT check that `p` is a prime greater than `2`.\n */\n function invModPrime(uint256 a, uint256 p) internal view returns (uint256) {\n unchecked {\n return Math.modExp(a, p - 2, p);\n }\n }\n\n /**\n * @dev Returns the modular exponentiation of the specified base, exponent and modulus (b ** e % m)\n *\n * Requirements:\n * - modulus can't be zero\n * - underlying staticcall to precompile must succeed\n *\n * IMPORTANT: The result is only valid if the underlying call succeeds. When using this function, make\n * sure the chain you're using it on supports the precompiled contract for modular exponentiation\n * at address 0x05 as specified in https://eips.ethereum.org/EIPS/eip-198[EIP-198]. Otherwise,\n * the underlying function will succeed given the lack of a revert, but the result may be incorrectly\n * interpreted as 0.\n */\n function modExp(uint256 b, uint256 e, uint256 m) internal view returns (uint256) {\n (bool success, uint256 result) = tryModExp(b, e, m);\n if (!success) {\n Panic.panic(Panic.DIVISION_BY_ZERO);\n }\n return result;\n }\n\n /**\n * @dev Returns the modular exponentiation of the specified base, exponent and modulus (b ** e % m).\n * It includes a success flag indicating if the operation succeeded. Operation will be marked as failed if trying\n * to operate modulo 0 or if the underlying precompile reverted.\n *\n * IMPORTANT: The result is only valid if the success flag is true. When using this function, make sure the chain\n * you're using it on supports the precompiled contract for modular exponentiation at address 0x05 as specified in\n * https://eips.ethereum.org/EIPS/eip-198[EIP-198]. Otherwise, the underlying function will succeed given the lack\n * of a revert, but the result may be incorrectly interpreted as 0.\n */\n function tryModExp(uint256 b, uint256 e, uint256 m) internal view returns (bool success, uint256 result) {\n if (m == 0) return (false, 0);\n assembly (\"memory-safe\") {\n let ptr := mload(0x40)\n // | Offset | Content | Content (Hex) |\n // |-----------|------------|--------------------------------------------------------------------|\n // | 0x00:0x1f | size of b | 0x0000000000000000000000000000000000000000000000000000000000000020 |\n // | 0x20:0x3f | size of e | 0x0000000000000000000000000000000000000000000000000000000000000020 |\n // | 0x40:0x5f | size of m | 0x0000000000000000000000000000000000000000000000000000000000000020 |\n // | 0x60:0x7f | value of b | 0x<.............................................................b> |\n // | 0x80:0x9f | value of e | 0x<.............................................................e> |\n // | 0xa0:0xbf | value of m | 0x<.............................................................m> |\n mstore(ptr, 0x20)\n mstore(add(ptr, 0x20), 0x20)\n mstore(add(ptr, 0x40), 0x20)\n mstore(add(ptr, 0x60), b)\n mstore(add(ptr, 0x80), e)\n mstore(add(ptr, 0xa0), m)\n\n // Given the result < m, it's guaranteed to fit in 32 bytes,\n // so we can use the memory scratch space located at offset 0.\n success := staticcall(gas(), 0x05, ptr, 0xc0, 0x00, 0x20)\n result := mload(0x00)\n }\n }\n\n /**\n * @dev Variant of {modExp} that supports inputs of arbitrary length.\n */\n function modExp(bytes memory b, bytes memory e, bytes memory m) internal view returns (bytes memory) {\n (bool success, bytes memory result) = tryModExp(b, e, m);\n if (!success) {\n Panic.panic(Panic.DIVISION_BY_ZERO);\n }\n return result;\n }\n\n /**\n * @dev Variant of {tryModExp} that supports inputs of arbitrary length.\n */\n function tryModExp(\n bytes memory b,\n bytes memory e,\n bytes memory m\n ) internal view returns (bool success, bytes memory result) {\n if (_zeroBytes(m)) return (false, new bytes(0));\n\n uint256 mLen = m.length;\n\n // Encode call args in result and move the free memory pointer\n result = abi.encodePacked(b.length, e.length, mLen, b, e, m);\n\n assembly (\"memory-safe\") {\n let dataPtr := add(result, 0x20)\n // Write result on top of args to avoid allocating extra memory.\n success := staticcall(gas(), 0x05, dataPtr, mload(result), dataPtr, mLen)\n // Overwrite the length.\n // result.length > returndatasize() is guaranteed because returndatasize() == m.length\n mstore(result, mLen)\n // Set the memory pointer after the returned data.\n mstore(0x40, add(dataPtr, mLen))\n }\n }\n\n /**\n * @dev Returns whether the provided byte array is zero.\n */\n function _zeroBytes(bytes memory byteArray) private pure returns (bool) {\n for (uint256 i = 0; i < byteArray.length; ++i) {\n if (byteArray[i] != 0) {\n return false;\n }\n }\n return true;\n }\n\n /**\n * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded\n * towards zero.\n *\n * This method is based on Newton's method for computing square roots; the algorithm is restricted to only\n * using integer operations.\n */\n function sqrt(uint256 a) internal pure returns (uint256) {\n unchecked {\n // Take care of easy edge cases when a == 0 or a == 1\n if (a <= 1) {\n return a;\n }\n\n // In this function, we use Newton's method to get a root of `f(x) := x² - a`. It involves building a\n // sequence x_n that converges toward sqrt(a). For each iteration x_n, we also define the error between\n // the current value as `ε_n = | x_n - sqrt(a) |`.\n //\n // For our first estimation, we consider `e` the smallest power of 2 which is bigger than the square root\n // of the target. (i.e. `2**(e-1) ≤ sqrt(a) < 2**e`). We know that `e ≤ 128` because `(2¹²⁸)² = 2²⁵⁶` is\n // bigger than any uint256.\n //\n // By noticing that\n // `2**(e-1) ≤ sqrt(a) < 2**e → (2**(e-1))² ≤ a < (2**e)² → 2**(2*e-2) ≤ a < 2**(2*e)`\n // we can deduce that `e - 1` is `log2(a) / 2`. We can thus compute `x_n = 2**(e-1)` using a method similar\n // to the msb function.\n uint256 aa = a;\n uint256 xn = 1;\n\n if (aa >= (1 << 128)) {\n aa >>= 128;\n xn <<= 64;\n }\n if (aa >= (1 << 64)) {\n aa >>= 64;\n xn <<= 32;\n }\n if (aa >= (1 << 32)) {\n aa >>= 32;\n xn <<= 16;\n }\n if (aa >= (1 << 16)) {\n aa >>= 16;\n xn <<= 8;\n }\n if (aa >= (1 << 8)) {\n aa >>= 8;\n xn <<= 4;\n }\n if (aa >= (1 << 4)) {\n aa >>= 4;\n xn <<= 2;\n }\n if (aa >= (1 << 2)) {\n xn <<= 1;\n }\n\n // We now have x_n such that `x_n = 2**(e-1) ≤ sqrt(a) < 2**e = 2 * x_n`. This implies ε_n ≤ 2**(e-1).\n //\n // We can refine our estimation by noticing that the middle of that interval minimizes the error.\n // If we move x_n to equal 2**(e-1) + 2**(e-2), then we reduce the error to ε_n ≤ 2**(e-2).\n // This is going to be our x_0 (and ε_0)\n xn = (3 * xn) >> 1; // ε_0 := | x_0 - sqrt(a) | ≤ 2**(e-2)\n\n // From here, Newton's method give us:\n // x_{n+1} = (x_n + a / x_n) / 2\n //\n // One should note that:\n // x_{n+1}² - a = ((x_n + a / x_n) / 2)² - a\n // = ((x_n² + a) / (2 * x_n))² - a\n // = (x_n⁴ + 2 * a * x_n² + a²) / (4 * x_n²) - a\n // = (x_n⁴ + 2 * a * x_n² + a² - 4 * a * x_n²) / (4 * x_n²)\n // = (x_n⁴ - 2 * a * x_n² + a²) / (4 * x_n²)\n // = (x_n² - a)² / (2 * x_n)²\n // = ((x_n² - a) / (2 * x_n))²\n // ≥ 0\n // Which proves that for all n ≥ 1, sqrt(a) ≤ x_n\n //\n // This gives us the proof of quadratic convergence of the sequence:\n // ε_{n+1} = | x_{n+1} - sqrt(a) |\n // = | (x_n + a / x_n) / 2 - sqrt(a) |\n // = | (x_n² + a - 2*x_n*sqrt(a)) / (2 * x_n) |\n // = | (x_n - sqrt(a))² / (2 * x_n) |\n // = | ε_n² / (2 * x_n) |\n // = ε_n² / | (2 * x_n) |\n //\n // For the first iteration, we have a special case where x_0 is known:\n // ε_1 = ε_0² / | (2 * x_0) |\n // ≤ (2**(e-2))² / (2 * (2**(e-1) + 2**(e-2)))\n // ≤ 2**(2*e-4) / (3 * 2**(e-1))\n // ≤ 2**(e-3) / 3\n // ≤ 2**(e-3-log2(3))\n // ≤ 2**(e-4.5)\n //\n // For the following iterations, we use the fact that, 2**(e-1) ≤ sqrt(a) ≤ x_n:\n // ε_{n+1} = ε_n² / | (2 * x_n) |\n // ≤ (2**(e-k))² / (2 * 2**(e-1))\n // ≤ 2**(2*e-2*k) / 2**e\n // ≤ 2**(e-2*k)\n xn = (xn + a / xn) >> 1; // ε_1 := | x_1 - sqrt(a) | ≤ 2**(e-4.5) -- special case, see above\n xn = (xn + a / xn) >> 1; // ε_2 := | x_2 - sqrt(a) | ≤ 2**(e-9) -- general case with k = 4.5\n xn = (xn + a / xn) >> 1; // ε_3 := | x_3 - sqrt(a) | ≤ 2**(e-18) -- general case with k = 9\n xn = (xn + a / xn) >> 1; // ε_4 := | x_4 - sqrt(a) | ≤ 2**(e-36) -- general case with k = 18\n xn = (xn + a / xn) >> 1; // ε_5 := | x_5 - sqrt(a) | ≤ 2**(e-72) -- general case with k = 36\n xn = (xn + a / xn) >> 1; // ε_6 := | x_6 - sqrt(a) | ≤ 2**(e-144) -- general case with k = 72\n\n // Because e ≤ 128 (as discussed during the first estimation phase), we know have reached a precision\n // ε_6 ≤ 2**(e-144) < 1. Given we're operating on integers, then we can ensure that xn is now either\n // sqrt(a) or sqrt(a) + 1.\n return xn - SafeCast.toUint(xn > a / xn);\n }\n }\n\n /**\n * @dev 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 + SafeCast.toUint(unsignedRoundsUp(rounding) && result * result < a);\n }\n }\n\n /**\n * @dev Return the log in base 2 of a positive value rounded towards zero.\n * Returns 0 if given 0.\n */\n function log2(uint256 value) internal pure returns (uint256) {\n uint256 result = 0;\n uint256 exp;\n unchecked {\n exp = 128 * SafeCast.toUint(value > (1 << 128) - 1);\n value >>= exp;\n result += exp;\n\n exp = 64 * SafeCast.toUint(value > (1 << 64) - 1);\n value >>= exp;\n result += exp;\n\n exp = 32 * SafeCast.toUint(value > (1 << 32) - 1);\n value >>= exp;\n result += exp;\n\n exp = 16 * SafeCast.toUint(value > (1 << 16) - 1);\n value >>= exp;\n result += exp;\n\n exp = 8 * SafeCast.toUint(value > (1 << 8) - 1);\n value >>= exp;\n result += exp;\n\n exp = 4 * SafeCast.toUint(value > (1 << 4) - 1);\n value >>= exp;\n result += exp;\n\n exp = 2 * SafeCast.toUint(value > (1 << 2) - 1);\n value >>= exp;\n result += exp;\n\n result += SafeCast.toUint(value > 1);\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 + SafeCast.toUint(unsignedRoundsUp(rounding) && 1 << result < value);\n }\n }\n\n /**\n * @dev Return the log in base 10 of a positive value rounded towards zero.\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 + SafeCast.toUint(unsignedRoundsUp(rounding) && 10 ** result < value);\n }\n }\n\n /**\n * @dev Return the log in base 256 of a positive value rounded towards zero.\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 uint256 isGt;\n unchecked {\n isGt = SafeCast.toUint(value > (1 << 128) - 1);\n value >>= isGt * 128;\n result += isGt * 16;\n\n isGt = SafeCast.toUint(value > (1 << 64) - 1);\n value >>= isGt * 64;\n result += isGt * 8;\n\n isGt = SafeCast.toUint(value > (1 << 32) - 1);\n value >>= isGt * 32;\n result += isGt * 4;\n\n isGt = SafeCast.toUint(value > (1 << 16) - 1);\n value >>= isGt * 16;\n result += isGt * 2;\n\n result += SafeCast.toUint(value > (1 << 8) - 1);\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 + SafeCast.toUint(unsignedRoundsUp(rounding) && 1 << (result << 3) < value);\n }\n }\n\n /**\n * @dev Returns whether a provided rounding mode is considered rounding up for unsigned integers.\n */\n function unsignedRoundsUp(Rounding rounding) internal pure returns (bool) {\n return uint8(rounding) % 2 == 1;\n }\n}\n" + }, + "@openzeppelin/contracts/utils/math/SafeCast.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/math/SafeCast.sol)\n// This file was procedurally generated from scripts/generate/templates/SafeCast.js.\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Wrappers over Solidity's uintXX/intXX/bool casting operators with added overflow\n * checks.\n *\n * Downcasting from uint256/int256 in Solidity does not revert on overflow. This can\n * easily result in undesired exploitation or bugs, since developers usually\n * assume that overflows raise errors. `SafeCast` restores this intuition by\n * reverting the transaction when such an operation overflows.\n *\n * Using this library instead of the unchecked operations eliminates an entire\n * class of bugs, so it's recommended to use it always.\n */\nlibrary SafeCast {\n /**\n * @dev Value doesn't fit in an uint of `bits` size.\n */\n error SafeCastOverflowedUintDowncast(uint8 bits, uint256 value);\n\n /**\n * @dev An int value doesn't fit in an uint of `bits` size.\n */\n error SafeCastOverflowedIntToUint(int256 value);\n\n /**\n * @dev Value doesn't fit in an int of `bits` size.\n */\n error SafeCastOverflowedIntDowncast(uint8 bits, int256 value);\n\n /**\n * @dev An uint value doesn't fit in an int of `bits` size.\n */\n error SafeCastOverflowedUintToInt(uint256 value);\n\n /**\n * @dev Returns the downcasted uint248 from uint256, reverting on\n * overflow (when the input is greater than largest uint248).\n *\n * Counterpart to Solidity's `uint248` operator.\n *\n * Requirements:\n *\n * - input must fit into 248 bits\n */\n function toUint248(uint256 value) internal pure returns (uint248) {\n if (value > type(uint248).max) {\n revert SafeCastOverflowedUintDowncast(248, value);\n }\n return uint248(value);\n }\n\n /**\n * @dev Returns the downcasted uint240 from uint256, reverting on\n * overflow (when the input is greater than largest uint240).\n *\n * Counterpart to Solidity's `uint240` operator.\n *\n * Requirements:\n *\n * - input must fit into 240 bits\n */\n function toUint240(uint256 value) internal pure returns (uint240) {\n if (value > type(uint240).max) {\n revert SafeCastOverflowedUintDowncast(240, value);\n }\n return uint240(value);\n }\n\n /**\n * @dev Returns the downcasted uint232 from uint256, reverting on\n * overflow (when the input is greater than largest uint232).\n *\n * Counterpart to Solidity's `uint232` operator.\n *\n * Requirements:\n *\n * - input must fit into 232 bits\n */\n function toUint232(uint256 value) internal pure returns (uint232) {\n if (value > type(uint232).max) {\n revert SafeCastOverflowedUintDowncast(232, value);\n }\n return uint232(value);\n }\n\n /**\n * @dev Returns the downcasted uint224 from uint256, reverting on\n * overflow (when the input is greater than largest uint224).\n *\n * Counterpart to Solidity's `uint224` operator.\n *\n * Requirements:\n *\n * - input must fit into 224 bits\n */\n function toUint224(uint256 value) internal pure returns (uint224) {\n if (value > type(uint224).max) {\n revert SafeCastOverflowedUintDowncast(224, value);\n }\n return uint224(value);\n }\n\n /**\n * @dev Returns the downcasted uint216 from uint256, reverting on\n * overflow (when the input is greater than largest uint216).\n *\n * Counterpart to Solidity's `uint216` operator.\n *\n * Requirements:\n *\n * - input must fit into 216 bits\n */\n function toUint216(uint256 value) internal pure returns (uint216) {\n if (value > type(uint216).max) {\n revert SafeCastOverflowedUintDowncast(216, value);\n }\n return uint216(value);\n }\n\n /**\n * @dev Returns the downcasted uint208 from uint256, reverting on\n * overflow (when the input is greater than largest uint208).\n *\n * Counterpart to Solidity's `uint208` operator.\n *\n * Requirements:\n *\n * - input must fit into 208 bits\n */\n function toUint208(uint256 value) internal pure returns (uint208) {\n if (value > type(uint208).max) {\n revert SafeCastOverflowedUintDowncast(208, value);\n }\n return uint208(value);\n }\n\n /**\n * @dev Returns the downcasted uint200 from uint256, reverting on\n * overflow (when the input is greater than largest uint200).\n *\n * Counterpart to Solidity's `uint200` operator.\n *\n * Requirements:\n *\n * - input must fit into 200 bits\n */\n function toUint200(uint256 value) internal pure returns (uint200) {\n if (value > type(uint200).max) {\n revert SafeCastOverflowedUintDowncast(200, value);\n }\n return uint200(value);\n }\n\n /**\n * @dev Returns the downcasted uint192 from uint256, reverting on\n * overflow (when the input is greater than largest uint192).\n *\n * Counterpart to Solidity's `uint192` operator.\n *\n * Requirements:\n *\n * - input must fit into 192 bits\n */\n function toUint192(uint256 value) internal pure returns (uint192) {\n if (value > type(uint192).max) {\n revert SafeCastOverflowedUintDowncast(192, value);\n }\n return uint192(value);\n }\n\n /**\n * @dev Returns the downcasted uint184 from uint256, reverting on\n * overflow (when the input is greater than largest uint184).\n *\n * Counterpart to Solidity's `uint184` operator.\n *\n * Requirements:\n *\n * - input must fit into 184 bits\n */\n function toUint184(uint256 value) internal pure returns (uint184) {\n if (value > type(uint184).max) {\n revert SafeCastOverflowedUintDowncast(184, value);\n }\n return uint184(value);\n }\n\n /**\n * @dev Returns the downcasted uint176 from uint256, reverting on\n * overflow (when the input is greater than largest uint176).\n *\n * Counterpart to Solidity's `uint176` operator.\n *\n * Requirements:\n *\n * - input must fit into 176 bits\n */\n function toUint176(uint256 value) internal pure returns (uint176) {\n if (value > type(uint176).max) {\n revert SafeCastOverflowedUintDowncast(176, value);\n }\n return uint176(value);\n }\n\n /**\n * @dev Returns the downcasted uint168 from uint256, reverting on\n * overflow (when the input is greater than largest uint168).\n *\n * Counterpart to Solidity's `uint168` operator.\n *\n * Requirements:\n *\n * - input must fit into 168 bits\n */\n function toUint168(uint256 value) internal pure returns (uint168) {\n if (value > type(uint168).max) {\n revert SafeCastOverflowedUintDowncast(168, value);\n }\n return uint168(value);\n }\n\n /**\n * @dev Returns the downcasted uint160 from uint256, reverting on\n * overflow (when the input is greater than largest uint160).\n *\n * Counterpart to Solidity's `uint160` operator.\n *\n * Requirements:\n *\n * - input must fit into 160 bits\n */\n function toUint160(uint256 value) internal pure returns (uint160) {\n if (value > type(uint160).max) {\n revert SafeCastOverflowedUintDowncast(160, value);\n }\n return uint160(value);\n }\n\n /**\n * @dev Returns the downcasted uint152 from uint256, reverting on\n * overflow (when the input is greater than largest uint152).\n *\n * Counterpart to Solidity's `uint152` operator.\n *\n * Requirements:\n *\n * - input must fit into 152 bits\n */\n function toUint152(uint256 value) internal pure returns (uint152) {\n if (value > type(uint152).max) {\n revert SafeCastOverflowedUintDowncast(152, value);\n }\n return uint152(value);\n }\n\n /**\n * @dev Returns the downcasted uint144 from uint256, reverting on\n * overflow (when the input is greater than largest uint144).\n *\n * Counterpart to Solidity's `uint144` operator.\n *\n * Requirements:\n *\n * - input must fit into 144 bits\n */\n function toUint144(uint256 value) internal pure returns (uint144) {\n if (value > type(uint144).max) {\n revert SafeCastOverflowedUintDowncast(144, value);\n }\n return uint144(value);\n }\n\n /**\n * @dev Returns the downcasted uint136 from uint256, reverting on\n * overflow (when the input is greater than largest uint136).\n *\n * Counterpart to Solidity's `uint136` operator.\n *\n * Requirements:\n *\n * - input must fit into 136 bits\n */\n function toUint136(uint256 value) internal pure returns (uint136) {\n if (value > type(uint136).max) {\n revert SafeCastOverflowedUintDowncast(136, value);\n }\n return uint136(value);\n }\n\n /**\n * @dev Returns the downcasted uint128 from uint256, reverting on\n * overflow (when the input is greater than largest uint128).\n *\n * Counterpart to Solidity's `uint128` operator.\n *\n * Requirements:\n *\n * - input must fit into 128 bits\n */\n function toUint128(uint256 value) internal pure returns (uint128) {\n if (value > type(uint128).max) {\n revert SafeCastOverflowedUintDowncast(128, value);\n }\n return uint128(value);\n }\n\n /**\n * @dev Returns the downcasted uint120 from uint256, reverting on\n * overflow (when the input is greater than largest uint120).\n *\n * Counterpart to Solidity's `uint120` operator.\n *\n * Requirements:\n *\n * - input must fit into 120 bits\n */\n function toUint120(uint256 value) internal pure returns (uint120) {\n if (value > type(uint120).max) {\n revert SafeCastOverflowedUintDowncast(120, value);\n }\n return uint120(value);\n }\n\n /**\n * @dev Returns the downcasted uint112 from uint256, reverting on\n * overflow (when the input is greater than largest uint112).\n *\n * Counterpart to Solidity's `uint112` operator.\n *\n * Requirements:\n *\n * - input must fit into 112 bits\n */\n function toUint112(uint256 value) internal pure returns (uint112) {\n if (value > type(uint112).max) {\n revert SafeCastOverflowedUintDowncast(112, value);\n }\n return uint112(value);\n }\n\n /**\n * @dev Returns the downcasted uint104 from uint256, reverting on\n * overflow (when the input is greater than largest uint104).\n *\n * Counterpart to Solidity's `uint104` operator.\n *\n * Requirements:\n *\n * - input must fit into 104 bits\n */\n function toUint104(uint256 value) internal pure returns (uint104) {\n if (value > type(uint104).max) {\n revert SafeCastOverflowedUintDowncast(104, value);\n }\n return uint104(value);\n }\n\n /**\n * @dev Returns the downcasted uint96 from uint256, reverting on\n * overflow (when the input is greater than largest uint96).\n *\n * Counterpart to Solidity's `uint96` operator.\n *\n * Requirements:\n *\n * - input must fit into 96 bits\n */\n function toUint96(uint256 value) internal pure returns (uint96) {\n if (value > type(uint96).max) {\n revert SafeCastOverflowedUintDowncast(96, value);\n }\n return uint96(value);\n }\n\n /**\n * @dev Returns the downcasted uint88 from uint256, reverting on\n * overflow (when the input is greater than largest uint88).\n *\n * Counterpart to Solidity's `uint88` operator.\n *\n * Requirements:\n *\n * - input must fit into 88 bits\n */\n function toUint88(uint256 value) internal pure returns (uint88) {\n if (value > type(uint88).max) {\n revert SafeCastOverflowedUintDowncast(88, value);\n }\n return uint88(value);\n }\n\n /**\n * @dev Returns the downcasted uint80 from uint256, reverting on\n * overflow (when the input is greater than largest uint80).\n *\n * Counterpart to Solidity's `uint80` operator.\n *\n * Requirements:\n *\n * - input must fit into 80 bits\n */\n function toUint80(uint256 value) internal pure returns (uint80) {\n if (value > type(uint80).max) {\n revert SafeCastOverflowedUintDowncast(80, value);\n }\n return uint80(value);\n }\n\n /**\n * @dev Returns the downcasted uint72 from uint256, reverting on\n * overflow (when the input is greater than largest uint72).\n *\n * Counterpart to Solidity's `uint72` operator.\n *\n * Requirements:\n *\n * - input must fit into 72 bits\n */\n function toUint72(uint256 value) internal pure returns (uint72) {\n if (value > type(uint72).max) {\n revert SafeCastOverflowedUintDowncast(72, value);\n }\n return uint72(value);\n }\n\n /**\n * @dev Returns the downcasted uint64 from uint256, reverting on\n * overflow (when the input is greater than largest uint64).\n *\n * Counterpart to Solidity's `uint64` operator.\n *\n * Requirements:\n *\n * - input must fit into 64 bits\n */\n function toUint64(uint256 value) internal pure returns (uint64) {\n if (value > type(uint64).max) {\n revert SafeCastOverflowedUintDowncast(64, value);\n }\n return uint64(value);\n }\n\n /**\n * @dev Returns the downcasted uint56 from uint256, reverting on\n * overflow (when the input is greater than largest uint56).\n *\n * Counterpart to Solidity's `uint56` operator.\n *\n * Requirements:\n *\n * - input must fit into 56 bits\n */\n function toUint56(uint256 value) internal pure returns (uint56) {\n if (value > type(uint56).max) {\n revert SafeCastOverflowedUintDowncast(56, value);\n }\n return uint56(value);\n }\n\n /**\n * @dev Returns the downcasted uint48 from uint256, reverting on\n * overflow (when the input is greater than largest uint48).\n *\n * Counterpart to Solidity's `uint48` operator.\n *\n * Requirements:\n *\n * - input must fit into 48 bits\n */\n function toUint48(uint256 value) internal pure returns (uint48) {\n if (value > type(uint48).max) {\n revert SafeCastOverflowedUintDowncast(48, value);\n }\n return uint48(value);\n }\n\n /**\n * @dev Returns the downcasted uint40 from uint256, reverting on\n * overflow (when the input is greater than largest uint40).\n *\n * Counterpart to Solidity's `uint40` operator.\n *\n * Requirements:\n *\n * - input must fit into 40 bits\n */\n function toUint40(uint256 value) internal pure returns (uint40) {\n if (value > type(uint40).max) {\n revert SafeCastOverflowedUintDowncast(40, value);\n }\n return uint40(value);\n }\n\n /**\n * @dev Returns the downcasted uint32 from uint256, reverting on\n * overflow (when the input is greater than largest uint32).\n *\n * Counterpart to Solidity's `uint32` operator.\n *\n * Requirements:\n *\n * - input must fit into 32 bits\n */\n function toUint32(uint256 value) internal pure returns (uint32) {\n if (value > type(uint32).max) {\n revert SafeCastOverflowedUintDowncast(32, value);\n }\n return uint32(value);\n }\n\n /**\n * @dev Returns the downcasted uint24 from uint256, reverting on\n * overflow (when the input is greater than largest uint24).\n *\n * Counterpart to Solidity's `uint24` operator.\n *\n * Requirements:\n *\n * - input must fit into 24 bits\n */\n function toUint24(uint256 value) internal pure returns (uint24) {\n if (value > type(uint24).max) {\n revert SafeCastOverflowedUintDowncast(24, value);\n }\n return uint24(value);\n }\n\n /**\n * @dev Returns the downcasted uint16 from uint256, reverting on\n * overflow (when the input is greater than largest uint16).\n *\n * Counterpart to Solidity's `uint16` operator.\n *\n * Requirements:\n *\n * - input must fit into 16 bits\n */\n function toUint16(uint256 value) internal pure returns (uint16) {\n if (value > type(uint16).max) {\n revert SafeCastOverflowedUintDowncast(16, value);\n }\n return uint16(value);\n }\n\n /**\n * @dev Returns the downcasted uint8 from uint256, reverting on\n * overflow (when the input is greater than largest uint8).\n *\n * Counterpart to Solidity's `uint8` operator.\n *\n * Requirements:\n *\n * - input must fit into 8 bits\n */\n function toUint8(uint256 value) internal pure returns (uint8) {\n if (value > type(uint8).max) {\n revert SafeCastOverflowedUintDowncast(8, value);\n }\n return uint8(value);\n }\n\n /**\n * @dev Converts a signed int256 into an unsigned uint256.\n *\n * Requirements:\n *\n * - input must be greater than or equal to 0.\n */\n function toUint256(int256 value) internal pure returns (uint256) {\n if (value < 0) {\n revert SafeCastOverflowedIntToUint(value);\n }\n return uint256(value);\n }\n\n /**\n * @dev Returns the downcasted int248 from int256, reverting on\n * overflow (when the input is less than smallest int248 or\n * greater than largest int248).\n *\n * Counterpart to Solidity's `int248` operator.\n *\n * Requirements:\n *\n * - input must fit into 248 bits\n */\n function toInt248(int256 value) internal pure returns (int248 downcasted) {\n downcasted = int248(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(248, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int240 from int256, reverting on\n * overflow (when the input is less than smallest int240 or\n * greater than largest int240).\n *\n * Counterpart to Solidity's `int240` operator.\n *\n * Requirements:\n *\n * - input must fit into 240 bits\n */\n function toInt240(int256 value) internal pure returns (int240 downcasted) {\n downcasted = int240(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(240, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int232 from int256, reverting on\n * overflow (when the input is less than smallest int232 or\n * greater than largest int232).\n *\n * Counterpart to Solidity's `int232` operator.\n *\n * Requirements:\n *\n * - input must fit into 232 bits\n */\n function toInt232(int256 value) internal pure returns (int232 downcasted) {\n downcasted = int232(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(232, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int224 from int256, reverting on\n * overflow (when the input is less than smallest int224 or\n * greater than largest int224).\n *\n * Counterpart to Solidity's `int224` operator.\n *\n * Requirements:\n *\n * - input must fit into 224 bits\n */\n function toInt224(int256 value) internal pure returns (int224 downcasted) {\n downcasted = int224(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(224, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int216 from int256, reverting on\n * overflow (when the input is less than smallest int216 or\n * greater than largest int216).\n *\n * Counterpart to Solidity's `int216` operator.\n *\n * Requirements:\n *\n * - input must fit into 216 bits\n */\n function toInt216(int256 value) internal pure returns (int216 downcasted) {\n downcasted = int216(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(216, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int208 from int256, reverting on\n * overflow (when the input is less than smallest int208 or\n * greater than largest int208).\n *\n * Counterpart to Solidity's `int208` operator.\n *\n * Requirements:\n *\n * - input must fit into 208 bits\n */\n function toInt208(int256 value) internal pure returns (int208 downcasted) {\n downcasted = int208(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(208, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int200 from int256, reverting on\n * overflow (when the input is less than smallest int200 or\n * greater than largest int200).\n *\n * Counterpart to Solidity's `int200` operator.\n *\n * Requirements:\n *\n * - input must fit into 200 bits\n */\n function toInt200(int256 value) internal pure returns (int200 downcasted) {\n downcasted = int200(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(200, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int192 from int256, reverting on\n * overflow (when the input is less than smallest int192 or\n * greater than largest int192).\n *\n * Counterpart to Solidity's `int192` operator.\n *\n * Requirements:\n *\n * - input must fit into 192 bits\n */\n function toInt192(int256 value) internal pure returns (int192 downcasted) {\n downcasted = int192(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(192, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int184 from int256, reverting on\n * overflow (when the input is less than smallest int184 or\n * greater than largest int184).\n *\n * Counterpart to Solidity's `int184` operator.\n *\n * Requirements:\n *\n * - input must fit into 184 bits\n */\n function toInt184(int256 value) internal pure returns (int184 downcasted) {\n downcasted = int184(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(184, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int176 from int256, reverting on\n * overflow (when the input is less than smallest int176 or\n * greater than largest int176).\n *\n * Counterpart to Solidity's `int176` operator.\n *\n * Requirements:\n *\n * - input must fit into 176 bits\n */\n function toInt176(int256 value) internal pure returns (int176 downcasted) {\n downcasted = int176(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(176, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int168 from int256, reverting on\n * overflow (when the input is less than smallest int168 or\n * greater than largest int168).\n *\n * Counterpart to Solidity's `int168` operator.\n *\n * Requirements:\n *\n * - input must fit into 168 bits\n */\n function toInt168(int256 value) internal pure returns (int168 downcasted) {\n downcasted = int168(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(168, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int160 from int256, reverting on\n * overflow (when the input is less than smallest int160 or\n * greater than largest int160).\n *\n * Counterpart to Solidity's `int160` operator.\n *\n * Requirements:\n *\n * - input must fit into 160 bits\n */\n function toInt160(int256 value) internal pure returns (int160 downcasted) {\n downcasted = int160(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(160, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int152 from int256, reverting on\n * overflow (when the input is less than smallest int152 or\n * greater than largest int152).\n *\n * Counterpart to Solidity's `int152` operator.\n *\n * Requirements:\n *\n * - input must fit into 152 bits\n */\n function toInt152(int256 value) internal pure returns (int152 downcasted) {\n downcasted = int152(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(152, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int144 from int256, reverting on\n * overflow (when the input is less than smallest int144 or\n * greater than largest int144).\n *\n * Counterpart to Solidity's `int144` operator.\n *\n * Requirements:\n *\n * - input must fit into 144 bits\n */\n function toInt144(int256 value) internal pure returns (int144 downcasted) {\n downcasted = int144(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(144, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int136 from int256, reverting on\n * overflow (when the input is less than smallest int136 or\n * greater than largest int136).\n *\n * Counterpart to Solidity's `int136` operator.\n *\n * Requirements:\n *\n * - input must fit into 136 bits\n */\n function toInt136(int256 value) internal pure returns (int136 downcasted) {\n downcasted = int136(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(136, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int128 from int256, reverting on\n * overflow (when the input is less than smallest int128 or\n * greater than largest int128).\n *\n * Counterpart to Solidity's `int128` operator.\n *\n * Requirements:\n *\n * - input must fit into 128 bits\n */\n function toInt128(int256 value) internal pure returns (int128 downcasted) {\n downcasted = int128(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(128, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int120 from int256, reverting on\n * overflow (when the input is less than smallest int120 or\n * greater than largest int120).\n *\n * Counterpart to Solidity's `int120` operator.\n *\n * Requirements:\n *\n * - input must fit into 120 bits\n */\n function toInt120(int256 value) internal pure returns (int120 downcasted) {\n downcasted = int120(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(120, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int112 from int256, reverting on\n * overflow (when the input is less than smallest int112 or\n * greater than largest int112).\n *\n * Counterpart to Solidity's `int112` operator.\n *\n * Requirements:\n *\n * - input must fit into 112 bits\n */\n function toInt112(int256 value) internal pure returns (int112 downcasted) {\n downcasted = int112(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(112, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int104 from int256, reverting on\n * overflow (when the input is less than smallest int104 or\n * greater than largest int104).\n *\n * Counterpart to Solidity's `int104` operator.\n *\n * Requirements:\n *\n * - input must fit into 104 bits\n */\n function toInt104(int256 value) internal pure returns (int104 downcasted) {\n downcasted = int104(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(104, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int96 from int256, reverting on\n * overflow (when the input is less than smallest int96 or\n * greater than largest int96).\n *\n * Counterpart to Solidity's `int96` operator.\n *\n * Requirements:\n *\n * - input must fit into 96 bits\n */\n function toInt96(int256 value) internal pure returns (int96 downcasted) {\n downcasted = int96(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(96, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int88 from int256, reverting on\n * overflow (when the input is less than smallest int88 or\n * greater than largest int88).\n *\n * Counterpart to Solidity's `int88` operator.\n *\n * Requirements:\n *\n * - input must fit into 88 bits\n */\n function toInt88(int256 value) internal pure returns (int88 downcasted) {\n downcasted = int88(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(88, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int80 from int256, reverting on\n * overflow (when the input is less than smallest int80 or\n * greater than largest int80).\n *\n * Counterpart to Solidity's `int80` operator.\n *\n * Requirements:\n *\n * - input must fit into 80 bits\n */\n function toInt80(int256 value) internal pure returns (int80 downcasted) {\n downcasted = int80(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(80, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int72 from int256, reverting on\n * overflow (when the input is less than smallest int72 or\n * greater than largest int72).\n *\n * Counterpart to Solidity's `int72` operator.\n *\n * Requirements:\n *\n * - input must fit into 72 bits\n */\n function toInt72(int256 value) internal pure returns (int72 downcasted) {\n downcasted = int72(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(72, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int64 from int256, reverting on\n * overflow (when the input is less than smallest int64 or\n * greater than largest int64).\n *\n * Counterpart to Solidity's `int64` operator.\n *\n * Requirements:\n *\n * - input must fit into 64 bits\n */\n function toInt64(int256 value) internal pure returns (int64 downcasted) {\n downcasted = int64(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(64, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int56 from int256, reverting on\n * overflow (when the input is less than smallest int56 or\n * greater than largest int56).\n *\n * Counterpart to Solidity's `int56` operator.\n *\n * Requirements:\n *\n * - input must fit into 56 bits\n */\n function toInt56(int256 value) internal pure returns (int56 downcasted) {\n downcasted = int56(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(56, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int48 from int256, reverting on\n * overflow (when the input is less than smallest int48 or\n * greater than largest int48).\n *\n * Counterpart to Solidity's `int48` operator.\n *\n * Requirements:\n *\n * - input must fit into 48 bits\n */\n function toInt48(int256 value) internal pure returns (int48 downcasted) {\n downcasted = int48(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(48, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int40 from int256, reverting on\n * overflow (when the input is less than smallest int40 or\n * greater than largest int40).\n *\n * Counterpart to Solidity's `int40` operator.\n *\n * Requirements:\n *\n * - input must fit into 40 bits\n */\n function toInt40(int256 value) internal pure returns (int40 downcasted) {\n downcasted = int40(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(40, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int32 from int256, reverting on\n * overflow (when the input is less than smallest int32 or\n * greater than largest int32).\n *\n * Counterpart to Solidity's `int32` operator.\n *\n * Requirements:\n *\n * - input must fit into 32 bits\n */\n function toInt32(int256 value) internal pure returns (int32 downcasted) {\n downcasted = int32(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(32, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int24 from int256, reverting on\n * overflow (when the input is less than smallest int24 or\n * greater than largest int24).\n *\n * Counterpart to Solidity's `int24` operator.\n *\n * Requirements:\n *\n * - input must fit into 24 bits\n */\n function toInt24(int256 value) internal pure returns (int24 downcasted) {\n downcasted = int24(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(24, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int16 from int256, reverting on\n * overflow (when the input is less than smallest int16 or\n * greater than largest int16).\n *\n * Counterpart to Solidity's `int16` operator.\n *\n * Requirements:\n *\n * - input must fit into 16 bits\n */\n function toInt16(int256 value) internal pure returns (int16 downcasted) {\n downcasted = int16(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(16, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int8 from int256, reverting on\n * overflow (when the input is less than smallest int8 or\n * greater than largest int8).\n *\n * Counterpart to Solidity's `int8` operator.\n *\n * Requirements:\n *\n * - input must fit into 8 bits\n */\n function toInt8(int256 value) internal pure returns (int8 downcasted) {\n downcasted = int8(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(8, value);\n }\n }\n\n /**\n * @dev Converts an unsigned uint256 into a signed int256.\n *\n * Requirements:\n *\n * - input must be less than or equal to maxInt256.\n */\n function toInt256(uint256 value) internal pure returns (int256) {\n // Note: Unsafe cast below is okay because `type(int256).max` is guaranteed to be positive\n if (value > uint256(type(int256).max)) {\n revert SafeCastOverflowedUintToInt(value);\n }\n return int256(value);\n }\n\n /**\n * @dev Cast a boolean (false or true) to a uint256 (0 or 1) with no jump.\n */\n function toUint(bool b) internal pure returns (uint256 u) {\n assembly (\"memory-safe\") {\n u := iszero(iszero(b))\n }\n }\n}\n" + }, + "@openzeppelin/contracts/utils/math/SignedMath.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/math/SignedMath.sol)\n\npragma solidity ^0.8.20;\n\nimport {SafeCast} from \"./SafeCast.sol\";\n\n/**\n * @dev Standard signed math utilities missing in the Solidity language.\n */\nlibrary SignedMath {\n /**\n * @dev Branchless ternary evaluation for `a ? b : c`. Gas costs are constant.\n *\n * IMPORTANT: This function may reduce bytecode size and consume less gas when used standalone.\n * However, the compiler may optimize Solidity ternary operations (i.e. `a ? b : c`) to only compute\n * one branch when needed, making this function more expensive.\n */\n function ternary(bool condition, int256 a, int256 b) internal pure returns (int256) {\n unchecked {\n // branchless ternary works because:\n // b ^ (a ^ b) == a\n // b ^ 0 == b\n return b ^ ((a ^ b) * int256(SafeCast.toUint(condition)));\n }\n }\n\n /**\n * @dev Returns the largest of two signed numbers.\n */\n function max(int256 a, int256 b) internal pure returns (int256) {\n return ternary(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 ternary(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 // Formula from the \"Bit Twiddling Hacks\" by Sean Eron Anderson.\n // Since `n` is a signed integer, the generated bytecode will use the SAR opcode to perform the right shift,\n // taking advantage of the most significant (or \"sign\" bit) in two's complement representation.\n // This opcode adds new most significant bits set to the value of the previous most significant bit. As a result,\n // the mask will either be `bytes32(0)` (if n is positive) or `~bytes32(0)` (if n is negative).\n int256 mask = n >> 255;\n\n // A `bytes32(0)` mask leaves the input unchanged, while a `~bytes32(0)` mask complements it.\n return uint256((n + mask) ^ mask);\n }\n }\n}\n" + }, + "@openzeppelin/contracts/utils/Nonces.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/Nonces.sol)\npragma solidity ^0.8.20;\n\n/**\n * @dev Provides tracking nonces for addresses. Nonces will only increment.\n */\nabstract contract Nonces {\n /**\n * @dev The nonce used for an `account` is not the expected current nonce.\n */\n error InvalidAccountNonce(address account, uint256 currentNonce);\n\n mapping(address account => uint256) private _nonces;\n\n /**\n * @dev Returns the next unused nonce for an address.\n */\n function nonces(address owner) public view virtual returns (uint256) {\n return _nonces[owner];\n }\n\n /**\n * @dev Consumes a nonce.\n *\n * Returns the current value and increments nonce.\n */\n function _useNonce(address owner) internal virtual returns (uint256) {\n // For each account, the nonce has an initial value of 0, can only be incremented by one, and cannot be\n // decremented or reset. This guarantees that the nonce never overflows.\n unchecked {\n // It is important to do x++ and not ++x here.\n return _nonces[owner]++;\n }\n }\n\n /**\n * @dev Same as {_useNonce} but checking that `nonce` is the next valid for `owner`.\n */\n function _useCheckedNonce(address owner, uint256 nonce) internal virtual {\n uint256 current = _useNonce(owner);\n if (nonce != current) {\n revert InvalidAccountNonce(owner, current);\n }\n }\n}\n" + }, + "@openzeppelin/contracts/utils/Panic.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/Panic.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Helper library for emitting standardized panic codes.\n *\n * ```solidity\n * contract Example {\n * using Panic for uint256;\n *\n * // Use any of the declared internal constants\n * function foo() { Panic.GENERIC.panic(); }\n *\n * // Alternatively\n * function foo() { Panic.panic(Panic.GENERIC); }\n * }\n * ```\n *\n * Follows the list from https://github.com/ethereum/solidity/blob/v0.8.24/libsolutil/ErrorCodes.h[libsolutil].\n *\n * _Available since v5.1._\n */\n// slither-disable-next-line unused-state\nlibrary Panic {\n /// @dev generic / unspecified error\n uint256 internal constant GENERIC = 0x00;\n /// @dev used by the assert() builtin\n uint256 internal constant ASSERT = 0x01;\n /// @dev arithmetic underflow or overflow\n uint256 internal constant UNDER_OVERFLOW = 0x11;\n /// @dev division or modulo by zero\n uint256 internal constant DIVISION_BY_ZERO = 0x12;\n /// @dev enum conversion error\n uint256 internal constant ENUM_CONVERSION_ERROR = 0x21;\n /// @dev invalid encoding in storage\n uint256 internal constant STORAGE_ENCODING_ERROR = 0x22;\n /// @dev empty array pop\n uint256 internal constant EMPTY_ARRAY_POP = 0x31;\n /// @dev array out of bounds access\n uint256 internal constant ARRAY_OUT_OF_BOUNDS = 0x32;\n /// @dev resource error (too large allocation or too large array)\n uint256 internal constant RESOURCE_ERROR = 0x41;\n /// @dev calling invalid internal function\n uint256 internal constant INVALID_INTERNAL_FUNCTION = 0x51;\n\n /// @dev Reverts with a panic code. Recommended to use with\n /// the internal constants with predefined codes.\n function panic(uint256 code) internal pure {\n assembly (\"memory-safe\") {\n mstore(0x00, 0x4e487b71)\n mstore(0x20, code)\n revert(0x1c, 0x24)\n }\n }\n}\n" + }, + "@openzeppelin/contracts/utils/ShortStrings.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/ShortStrings.sol)\n\npragma solidity ^0.8.20;\n\nimport {StorageSlot} from \"./StorageSlot.sol\";\n\n// | string | 0xAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA |\n// | length | 0x BB |\ntype ShortString is bytes32;\n\n/**\n * @dev This library provides functions to convert short memory strings\n * into a `ShortString` type that can be used as an immutable variable.\n *\n * Strings of arbitrary length can be optimized using this library if\n * they are short enough (up to 31 bytes) by packing them with their\n * length (1 byte) in a single EVM word (32 bytes). Additionally, a\n * fallback mechanism can be used for every other case.\n *\n * Usage example:\n *\n * ```solidity\n * contract Named {\n * using ShortStrings for *;\n *\n * ShortString private immutable _name;\n * string private _nameFallback;\n *\n * constructor(string memory contractName) {\n * _name = contractName.toShortStringWithFallback(_nameFallback);\n * }\n *\n * function name() external view returns (string memory) {\n * return _name.toStringWithFallback(_nameFallback);\n * }\n * }\n * ```\n */\nlibrary ShortStrings {\n // Used as an identifier for strings longer than 31 bytes.\n bytes32 private constant FALLBACK_SENTINEL = 0x00000000000000000000000000000000000000000000000000000000000000FF;\n\n error StringTooLong(string str);\n error InvalidShortString();\n\n /**\n * @dev Encode a string of at most 31 chars into a `ShortString`.\n *\n * This will trigger a `StringTooLong` error is the input string is too long.\n */\n function toShortString(string memory str) internal pure returns (ShortString) {\n bytes memory bstr = bytes(str);\n if (bstr.length > 31) {\n revert StringTooLong(str);\n }\n return ShortString.wrap(bytes32(uint256(bytes32(bstr)) | bstr.length));\n }\n\n /**\n * @dev Decode a `ShortString` back to a \"normal\" string.\n */\n function toString(ShortString sstr) internal pure returns (string memory) {\n uint256 len = byteLength(sstr);\n // using `new string(len)` would work locally but is not memory safe.\n string memory str = new string(32);\n assembly (\"memory-safe\") {\n mstore(str, len)\n mstore(add(str, 0x20), sstr)\n }\n return str;\n }\n\n /**\n * @dev Return the length of a `ShortString`.\n */\n function byteLength(ShortString sstr) internal pure returns (uint256) {\n uint256 result = uint256(ShortString.unwrap(sstr)) & 0xFF;\n if (result > 31) {\n revert InvalidShortString();\n }\n return result;\n }\n\n /**\n * @dev Encode a string into a `ShortString`, or write it to storage if it is too long.\n */\n function toShortStringWithFallback(string memory value, string storage store) internal returns (ShortString) {\n if (bytes(value).length < 32) {\n return toShortString(value);\n } else {\n StorageSlot.getStringSlot(store).value = value;\n return ShortString.wrap(FALLBACK_SENTINEL);\n }\n }\n\n /**\n * @dev Decode a string that was encoded to `ShortString` or written to storage using {setWithFallback}.\n */\n function toStringWithFallback(ShortString value, string storage store) internal pure returns (string memory) {\n if (ShortString.unwrap(value) != FALLBACK_SENTINEL) {\n return toString(value);\n } else {\n return store;\n }\n }\n\n /**\n * @dev Return the length of a string that was encoded to `ShortString` or written to storage using\n * {setWithFallback}.\n *\n * WARNING: This will return the \"byte length\" of the string. This may not reflect the actual length in terms of\n * actual characters as the UTF-8 encoding of a single character can span over multiple bytes.\n */\n function byteLengthWithFallback(ShortString value, string storage store) internal view returns (uint256) {\n if (ShortString.unwrap(value) != FALLBACK_SENTINEL) {\n return byteLength(value);\n } else {\n return bytes(store).length;\n }\n }\n}\n" + }, + "@openzeppelin/contracts/utils/StorageSlot.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/StorageSlot.sol)\n// This file was procedurally generated from scripts/generate/templates/StorageSlot.js.\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Library for reading and writing primitive types to specific storage slots.\n *\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\n * This library helps with reading and writing to such slots without the need for inline assembly.\n *\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\n *\n * Example usage to set ERC-1967 implementation slot:\n * ```solidity\n * contract ERC1967 {\n * // Define the slot. Alternatively, use the SlotDerivation library to derive the slot.\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\n *\n * function _getImplementation() internal view returns (address) {\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\n * }\n *\n * function _setImplementation(address newImplementation) internal {\n * require(newImplementation.code.length > 0);\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\n * }\n * }\n * ```\n *\n * TIP: Consider using this library along with {SlotDerivation}.\n */\nlibrary StorageSlot {\n struct AddressSlot {\n address value;\n }\n\n struct BooleanSlot {\n bool value;\n }\n\n struct Bytes32Slot {\n bytes32 value;\n }\n\n struct Uint256Slot {\n uint256 value;\n }\n\n struct Int256Slot {\n int256 value;\n }\n\n struct StringSlot {\n string value;\n }\n\n struct BytesSlot {\n bytes value;\n }\n\n /**\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\n */\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\n assembly (\"memory-safe\") {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns a `BooleanSlot` with member `value` located at `slot`.\n */\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\n assembly (\"memory-safe\") {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns a `Bytes32Slot` with member `value` located at `slot`.\n */\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\n assembly (\"memory-safe\") {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns a `Uint256Slot` with member `value` located at `slot`.\n */\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\n assembly (\"memory-safe\") {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns a `Int256Slot` with member `value` located at `slot`.\n */\n function getInt256Slot(bytes32 slot) internal pure returns (Int256Slot storage r) {\n assembly (\"memory-safe\") {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns a `StringSlot` with member `value` located at `slot`.\n */\n function getStringSlot(bytes32 slot) internal pure returns (StringSlot storage r) {\n assembly (\"memory-safe\") {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `StringSlot` representation of the string storage pointer `store`.\n */\n function getStringSlot(string storage store) internal pure returns (StringSlot storage r) {\n assembly (\"memory-safe\") {\n r.slot := store.slot\n }\n }\n\n /**\n * @dev Returns a `BytesSlot` with member `value` located at `slot`.\n */\n function getBytesSlot(bytes32 slot) internal pure returns (BytesSlot storage r) {\n assembly (\"memory-safe\") {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `BytesSlot` representation of the bytes storage pointer `store`.\n */\n function getBytesSlot(bytes storage store) internal pure returns (BytesSlot storage r) {\n assembly (\"memory-safe\") {\n r.slot := store.slot\n }\n }\n}\n" + }, + "@openzeppelin/contracts/utils/Strings.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/Strings.sol)\n\npragma solidity ^0.8.20;\n\nimport {Math} from \"./math/Math.sol\";\nimport {SignedMath} from \"./math/SignedMath.sol\";\n\n/**\n * @dev String operations.\n */\nlibrary Strings {\n bytes16 private constant HEX_DIGITS = \"0123456789abcdef\";\n uint8 private constant ADDRESS_LENGTH = 20;\n\n /**\n * @dev The `value` string doesn't fit in the specified `length`.\n */\n error StringsInsufficientHexLength(uint256 value, uint256 length);\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 assembly (\"memory-safe\") {\n ptr := add(buffer, add(32, length))\n }\n while (true) {\n ptr--;\n assembly (\"memory-safe\") {\n mstore8(ptr, byte(mod(value, 10), HEX_DIGITS))\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 toStringSigned(int256 value) internal pure returns (string memory) {\n return string.concat(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 uint256 localValue = value;\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] = HEX_DIGITS[localValue & 0xf];\n localValue >>= 4;\n }\n if (localValue != 0) {\n revert StringsInsufficientHexLength(value, length);\n }\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\n * 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 Converts an `address` with fixed length of 20 bytes to its checksummed ASCII `string` hexadecimal\n * representation, according to EIP-55.\n */\n function toChecksumHexString(address addr) internal pure returns (string memory) {\n bytes memory buffer = bytes(toHexString(addr));\n\n // hash the hex part of buffer (skip length + 2 bytes, length 40)\n uint256 hashValue;\n assembly (\"memory-safe\") {\n hashValue := shr(96, keccak256(add(buffer, 0x22), 40))\n }\n\n for (uint256 i = 41; i > 1; --i) {\n // possible values for buffer[i] are 48 (0) to 57 (9) and 97 (a) to 102 (f)\n if (hashValue & 0xf > 7 && uint8(buffer[i]) > 96) {\n // case shift by xoring with 0x20\n buffer[i] ^= 0x20;\n }\n hashValue >>= 4;\n }\n return string(buffer);\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 bytes(a).length == bytes(b).length && keccak256(bytes(a)) == keccak256(bytes(b));\n }\n}\n" + }, + "@openzeppelin/contracts/utils/structs/Checkpoints.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/structs/Checkpoints.sol)\n// This file was procedurally generated from scripts/generate/templates/Checkpoints.js.\n\npragma solidity ^0.8.20;\n\nimport {Math} from \"../math/Math.sol\";\n\n/**\n * @dev This library defines the `Trace*` struct, for checkpointing values as they change at different points in\n * time, and later looking up past values by block number. See {Votes} as an example.\n *\n * To create a history of checkpoints define a variable type `Checkpoints.Trace*` in your contract, and store a new\n * checkpoint for the current transaction block using the {push} function.\n */\nlibrary Checkpoints {\n /**\n * @dev A value was attempted to be inserted on a past checkpoint.\n */\n error CheckpointUnorderedInsertion();\n\n struct Trace224 {\n Checkpoint224[] _checkpoints;\n }\n\n struct Checkpoint224 {\n uint32 _key;\n uint224 _value;\n }\n\n /**\n * @dev Pushes a (`key`, `value`) pair into a Trace224 so that it is stored as the checkpoint.\n *\n * Returns previous value and new value.\n *\n * IMPORTANT: Never accept `key` as a user input, since an arbitrary `type(uint32).max` key set will disable the\n * library.\n */\n function push(\n Trace224 storage self,\n uint32 key,\n uint224 value\n ) internal returns (uint224 oldValue, uint224 newValue) {\n return _insert(self._checkpoints, key, value);\n }\n\n /**\n * @dev Returns the value in the first (oldest) checkpoint with key greater or equal than the search key, or zero if\n * there is none.\n */\n function lowerLookup(Trace224 storage self, uint32 key) internal view returns (uint224) {\n uint256 len = self._checkpoints.length;\n uint256 pos = _lowerBinaryLookup(self._checkpoints, key, 0, len);\n return pos == len ? 0 : _unsafeAccess(self._checkpoints, pos)._value;\n }\n\n /**\n * @dev Returns the value in the last (most recent) checkpoint with key lower or equal than the search key, or zero\n * if there is none.\n */\n function upperLookup(Trace224 storage self, uint32 key) internal view returns (uint224) {\n uint256 len = self._checkpoints.length;\n uint256 pos = _upperBinaryLookup(self._checkpoints, key, 0, len);\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\n }\n\n /**\n * @dev Returns the value in the last (most recent) checkpoint with key lower or equal than the search key, or zero\n * if there is none.\n *\n * NOTE: This is a variant of {upperLookup} that is optimised to find \"recent\" checkpoint (checkpoints with high\n * keys).\n */\n function upperLookupRecent(Trace224 storage self, uint32 key) internal view returns (uint224) {\n uint256 len = self._checkpoints.length;\n\n uint256 low = 0;\n uint256 high = len;\n\n if (len > 5) {\n uint256 mid = len - Math.sqrt(len);\n if (key < _unsafeAccess(self._checkpoints, mid)._key) {\n high = mid;\n } else {\n low = mid + 1;\n }\n }\n\n uint256 pos = _upperBinaryLookup(self._checkpoints, key, low, high);\n\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\n }\n\n /**\n * @dev Returns the value in the most recent checkpoint, or zero if there are no checkpoints.\n */\n function latest(Trace224 storage self) internal view returns (uint224) {\n uint256 pos = self._checkpoints.length;\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\n }\n\n /**\n * @dev Returns whether there is a checkpoint in the structure (i.e. it is not empty), and if so the key and value\n * in the most recent checkpoint.\n */\n function latestCheckpoint(Trace224 storage self) internal view returns (bool exists, uint32 _key, uint224 _value) {\n uint256 pos = self._checkpoints.length;\n if (pos == 0) {\n return (false, 0, 0);\n } else {\n Checkpoint224 storage ckpt = _unsafeAccess(self._checkpoints, pos - 1);\n return (true, ckpt._key, ckpt._value);\n }\n }\n\n /**\n * @dev Returns the number of checkpoint.\n */\n function length(Trace224 storage self) internal view returns (uint256) {\n return self._checkpoints.length;\n }\n\n /**\n * @dev Returns checkpoint at given position.\n */\n function at(Trace224 storage self, uint32 pos) internal view returns (Checkpoint224 memory) {\n return self._checkpoints[pos];\n }\n\n /**\n * @dev Pushes a (`key`, `value`) pair into an ordered list of checkpoints, either by inserting a new checkpoint,\n * or by updating the last one.\n */\n function _insert(\n Checkpoint224[] storage self,\n uint32 key,\n uint224 value\n ) private returns (uint224 oldValue, uint224 newValue) {\n uint256 pos = self.length;\n\n if (pos > 0) {\n Checkpoint224 storage last = _unsafeAccess(self, pos - 1);\n uint32 lastKey = last._key;\n uint224 lastValue = last._value;\n\n // Checkpoint keys must be non-decreasing.\n if (lastKey > key) {\n revert CheckpointUnorderedInsertion();\n }\n\n // Update or push new checkpoint\n if (lastKey == key) {\n last._value = value;\n } else {\n self.push(Checkpoint224({_key: key, _value: value}));\n }\n return (lastValue, value);\n } else {\n self.push(Checkpoint224({_key: key, _value: value}));\n return (0, value);\n }\n }\n\n /**\n * @dev Return the index of the first (oldest) checkpoint with key strictly bigger than the search key, or `high`\n * if there is none. `low` and `high` define a section where to do the search, with inclusive `low` and exclusive\n * `high`.\n *\n * WARNING: `high` should not be greater than the array's length.\n */\n function _upperBinaryLookup(\n Checkpoint224[] storage self,\n uint32 key,\n uint256 low,\n uint256 high\n ) private view returns (uint256) {\n while (low < high) {\n uint256 mid = Math.average(low, high);\n if (_unsafeAccess(self, mid)._key > key) {\n high = mid;\n } else {\n low = mid + 1;\n }\n }\n return high;\n }\n\n /**\n * @dev Return the index of the first (oldest) checkpoint with key greater or equal than the search key, or `high`\n * if there is none. `low` and `high` define a section where to do the search, with inclusive `low` and exclusive\n * `high`.\n *\n * WARNING: `high` should not be greater than the array's length.\n */\n function _lowerBinaryLookup(\n Checkpoint224[] storage self,\n uint32 key,\n uint256 low,\n uint256 high\n ) private view returns (uint256) {\n while (low < high) {\n uint256 mid = Math.average(low, high);\n if (_unsafeAccess(self, mid)._key < key) {\n low = mid + 1;\n } else {\n high = mid;\n }\n }\n return high;\n }\n\n /**\n * @dev Access an element of the array without performing bounds check. The position is assumed to be within bounds.\n */\n function _unsafeAccess(\n Checkpoint224[] storage self,\n uint256 pos\n ) private pure returns (Checkpoint224 storage result) {\n assembly {\n mstore(0, self.slot)\n result.slot := add(keccak256(0, 0x20), pos)\n }\n }\n\n struct Trace208 {\n Checkpoint208[] _checkpoints;\n }\n\n struct Checkpoint208 {\n uint48 _key;\n uint208 _value;\n }\n\n /**\n * @dev Pushes a (`key`, `value`) pair into a Trace208 so that it is stored as the checkpoint.\n *\n * Returns previous value and new value.\n *\n * IMPORTANT: Never accept `key` as a user input, since an arbitrary `type(uint48).max` key set will disable the\n * library.\n */\n function push(\n Trace208 storage self,\n uint48 key,\n uint208 value\n ) internal returns (uint208 oldValue, uint208 newValue) {\n return _insert(self._checkpoints, key, value);\n }\n\n /**\n * @dev Returns the value in the first (oldest) checkpoint with key greater or equal than the search key, or zero if\n * there is none.\n */\n function lowerLookup(Trace208 storage self, uint48 key) internal view returns (uint208) {\n uint256 len = self._checkpoints.length;\n uint256 pos = _lowerBinaryLookup(self._checkpoints, key, 0, len);\n return pos == len ? 0 : _unsafeAccess(self._checkpoints, pos)._value;\n }\n\n /**\n * @dev Returns the value in the last (most recent) checkpoint with key lower or equal than the search key, or zero\n * if there is none.\n */\n function upperLookup(Trace208 storage self, uint48 key) internal view returns (uint208) {\n uint256 len = self._checkpoints.length;\n uint256 pos = _upperBinaryLookup(self._checkpoints, key, 0, len);\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\n }\n\n /**\n * @dev Returns the value in the last (most recent) checkpoint with key lower or equal than the search key, or zero\n * if there is none.\n *\n * NOTE: This is a variant of {upperLookup} that is optimised to find \"recent\" checkpoint (checkpoints with high\n * keys).\n */\n function upperLookupRecent(Trace208 storage self, uint48 key) internal view returns (uint208) {\n uint256 len = self._checkpoints.length;\n\n uint256 low = 0;\n uint256 high = len;\n\n if (len > 5) {\n uint256 mid = len - Math.sqrt(len);\n if (key < _unsafeAccess(self._checkpoints, mid)._key) {\n high = mid;\n } else {\n low = mid + 1;\n }\n }\n\n uint256 pos = _upperBinaryLookup(self._checkpoints, key, low, high);\n\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\n }\n\n /**\n * @dev Returns the value in the most recent checkpoint, or zero if there are no checkpoints.\n */\n function latest(Trace208 storage self) internal view returns (uint208) {\n uint256 pos = self._checkpoints.length;\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\n }\n\n /**\n * @dev Returns whether there is a checkpoint in the structure (i.e. it is not empty), and if so the key and value\n * in the most recent checkpoint.\n */\n function latestCheckpoint(Trace208 storage self) internal view returns (bool exists, uint48 _key, uint208 _value) {\n uint256 pos = self._checkpoints.length;\n if (pos == 0) {\n return (false, 0, 0);\n } else {\n Checkpoint208 storage ckpt = _unsafeAccess(self._checkpoints, pos - 1);\n return (true, ckpt._key, ckpt._value);\n }\n }\n\n /**\n * @dev Returns the number of checkpoint.\n */\n function length(Trace208 storage self) internal view returns (uint256) {\n return self._checkpoints.length;\n }\n\n /**\n * @dev Returns checkpoint at given position.\n */\n function at(Trace208 storage self, uint32 pos) internal view returns (Checkpoint208 memory) {\n return self._checkpoints[pos];\n }\n\n /**\n * @dev Pushes a (`key`, `value`) pair into an ordered list of checkpoints, either by inserting a new checkpoint,\n * or by updating the last one.\n */\n function _insert(\n Checkpoint208[] storage self,\n uint48 key,\n uint208 value\n ) private returns (uint208 oldValue, uint208 newValue) {\n uint256 pos = self.length;\n\n if (pos > 0) {\n Checkpoint208 storage last = _unsafeAccess(self, pos - 1);\n uint48 lastKey = last._key;\n uint208 lastValue = last._value;\n\n // Checkpoint keys must be non-decreasing.\n if (lastKey > key) {\n revert CheckpointUnorderedInsertion();\n }\n\n // Update or push new checkpoint\n if (lastKey == key) {\n last._value = value;\n } else {\n self.push(Checkpoint208({_key: key, _value: value}));\n }\n return (lastValue, value);\n } else {\n self.push(Checkpoint208({_key: key, _value: value}));\n return (0, value);\n }\n }\n\n /**\n * @dev Return the index of the first (oldest) checkpoint with key strictly bigger than the search key, or `high`\n * if there is none. `low` and `high` define a section where to do the search, with inclusive `low` and exclusive\n * `high`.\n *\n * WARNING: `high` should not be greater than the array's length.\n */\n function _upperBinaryLookup(\n Checkpoint208[] storage self,\n uint48 key,\n uint256 low,\n uint256 high\n ) private view returns (uint256) {\n while (low < high) {\n uint256 mid = Math.average(low, high);\n if (_unsafeAccess(self, mid)._key > key) {\n high = mid;\n } else {\n low = mid + 1;\n }\n }\n return high;\n }\n\n /**\n * @dev Return the index of the first (oldest) checkpoint with key greater or equal than the search key, or `high`\n * if there is none. `low` and `high` define a section where to do the search, with inclusive `low` and exclusive\n * `high`.\n *\n * WARNING: `high` should not be greater than the array's length.\n */\n function _lowerBinaryLookup(\n Checkpoint208[] storage self,\n uint48 key,\n uint256 low,\n uint256 high\n ) private view returns (uint256) {\n while (low < high) {\n uint256 mid = Math.average(low, high);\n if (_unsafeAccess(self, mid)._key < key) {\n low = mid + 1;\n } else {\n high = mid;\n }\n }\n return high;\n }\n\n /**\n * @dev Access an element of the array without performing bounds check. The position is assumed to be within bounds.\n */\n function _unsafeAccess(\n Checkpoint208[] storage self,\n uint256 pos\n ) private pure returns (Checkpoint208 storage result) {\n assembly {\n mstore(0, self.slot)\n result.slot := add(keccak256(0, 0x20), pos)\n }\n }\n\n struct Trace160 {\n Checkpoint160[] _checkpoints;\n }\n\n struct Checkpoint160 {\n uint96 _key;\n uint160 _value;\n }\n\n /**\n * @dev Pushes a (`key`, `value`) pair into a Trace160 so that it is stored as the checkpoint.\n *\n * Returns previous value and new value.\n *\n * IMPORTANT: Never accept `key` as a user input, since an arbitrary `type(uint96).max` key set will disable the\n * library.\n */\n function push(\n Trace160 storage self,\n uint96 key,\n uint160 value\n ) internal returns (uint160 oldValue, uint160 newValue) {\n return _insert(self._checkpoints, key, value);\n }\n\n /**\n * @dev Returns the value in the first (oldest) checkpoint with key greater or equal than the search key, or zero if\n * there is none.\n */\n function lowerLookup(Trace160 storage self, uint96 key) internal view returns (uint160) {\n uint256 len = self._checkpoints.length;\n uint256 pos = _lowerBinaryLookup(self._checkpoints, key, 0, len);\n return pos == len ? 0 : _unsafeAccess(self._checkpoints, pos)._value;\n }\n\n /**\n * @dev Returns the value in the last (most recent) checkpoint with key lower or equal than the search key, or zero\n * if there is none.\n */\n function upperLookup(Trace160 storage self, uint96 key) internal view returns (uint160) {\n uint256 len = self._checkpoints.length;\n uint256 pos = _upperBinaryLookup(self._checkpoints, key, 0, len);\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\n }\n\n /**\n * @dev Returns the value in the last (most recent) checkpoint with key lower or equal than the search key, or zero\n * if there is none.\n *\n * NOTE: This is a variant of {upperLookup} that is optimised to find \"recent\" checkpoint (checkpoints with high\n * keys).\n */\n function upperLookupRecent(Trace160 storage self, uint96 key) internal view returns (uint160) {\n uint256 len = self._checkpoints.length;\n\n uint256 low = 0;\n uint256 high = len;\n\n if (len > 5) {\n uint256 mid = len - Math.sqrt(len);\n if (key < _unsafeAccess(self._checkpoints, mid)._key) {\n high = mid;\n } else {\n low = mid + 1;\n }\n }\n\n uint256 pos = _upperBinaryLookup(self._checkpoints, key, low, high);\n\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\n }\n\n /**\n * @dev Returns the value in the most recent checkpoint, or zero if there are no checkpoints.\n */\n function latest(Trace160 storage self) internal view returns (uint160) {\n uint256 pos = self._checkpoints.length;\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\n }\n\n /**\n * @dev Returns whether there is a checkpoint in the structure (i.e. it is not empty), and if so the key and value\n * in the most recent checkpoint.\n */\n function latestCheckpoint(Trace160 storage self) internal view returns (bool exists, uint96 _key, uint160 _value) {\n uint256 pos = self._checkpoints.length;\n if (pos == 0) {\n return (false, 0, 0);\n } else {\n Checkpoint160 storage ckpt = _unsafeAccess(self._checkpoints, pos - 1);\n return (true, ckpt._key, ckpt._value);\n }\n }\n\n /**\n * @dev Returns the number of checkpoint.\n */\n function length(Trace160 storage self) internal view returns (uint256) {\n return self._checkpoints.length;\n }\n\n /**\n * @dev Returns checkpoint at given position.\n */\n function at(Trace160 storage self, uint32 pos) internal view returns (Checkpoint160 memory) {\n return self._checkpoints[pos];\n }\n\n /**\n * @dev Pushes a (`key`, `value`) pair into an ordered list of checkpoints, either by inserting a new checkpoint,\n * or by updating the last one.\n */\n function _insert(\n Checkpoint160[] storage self,\n uint96 key,\n uint160 value\n ) private returns (uint160 oldValue, uint160 newValue) {\n uint256 pos = self.length;\n\n if (pos > 0) {\n Checkpoint160 storage last = _unsafeAccess(self, pos - 1);\n uint96 lastKey = last._key;\n uint160 lastValue = last._value;\n\n // Checkpoint keys must be non-decreasing.\n if (lastKey > key) {\n revert CheckpointUnorderedInsertion();\n }\n\n // Update or push new checkpoint\n if (lastKey == key) {\n last._value = value;\n } else {\n self.push(Checkpoint160({_key: key, _value: value}));\n }\n return (lastValue, value);\n } else {\n self.push(Checkpoint160({_key: key, _value: value}));\n return (0, value);\n }\n }\n\n /**\n * @dev Return the index of the first (oldest) checkpoint with key strictly bigger than the search key, or `high`\n * if there is none. `low` and `high` define a section where to do the search, with inclusive `low` and exclusive\n * `high`.\n *\n * WARNING: `high` should not be greater than the array's length.\n */\n function _upperBinaryLookup(\n Checkpoint160[] storage self,\n uint96 key,\n uint256 low,\n uint256 high\n ) private view returns (uint256) {\n while (low < high) {\n uint256 mid = Math.average(low, high);\n if (_unsafeAccess(self, mid)._key > key) {\n high = mid;\n } else {\n low = mid + 1;\n }\n }\n return high;\n }\n\n /**\n * @dev Return the index of the first (oldest) checkpoint with key greater or equal than the search key, or `high`\n * if there is none. `low` and `high` define a section where to do the search, with inclusive `low` and exclusive\n * `high`.\n *\n * WARNING: `high` should not be greater than the array's length.\n */\n function _lowerBinaryLookup(\n Checkpoint160[] storage self,\n uint96 key,\n uint256 low,\n uint256 high\n ) private view returns (uint256) {\n while (low < high) {\n uint256 mid = Math.average(low, high);\n if (_unsafeAccess(self, mid)._key < key) {\n low = mid + 1;\n } else {\n high = mid;\n }\n }\n return high;\n }\n\n /**\n * @dev Access an element of the array without performing bounds check. The position is assumed to be within bounds.\n */\n function _unsafeAccess(\n Checkpoint160[] storage self,\n uint256 pos\n ) private pure returns (Checkpoint160 storage result) {\n assembly {\n mstore(0, self.slot)\n result.slot := add(keccak256(0, 0x20), pos)\n }\n }\n}\n" + }, + "@openzeppelin/contracts/utils/structs/DoubleEndedQueue.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/structs/DoubleEndedQueue.sol)\npragma solidity ^0.8.20;\n\nimport {Panic} from \"../Panic.sol\";\n\n/**\n * @dev A sequence of items with the ability to efficiently push and pop items (i.e. insert and remove) on both ends of\n * the sequence (called front and back). Among other access patterns, it can be used to implement efficient LIFO and\n * FIFO queues. Storage use is optimized, and all operations are O(1) constant time. This includes {clear}, given that\n * the existing queue contents are left in storage.\n *\n * The struct is called `Bytes32Deque`. Other types can be cast to and from `bytes32`. This data structure can only be\n * used in storage, and not in memory.\n * ```solidity\n * DoubleEndedQueue.Bytes32Deque queue;\n * ```\n */\nlibrary DoubleEndedQueue {\n /**\n * @dev Indices are 128 bits so begin and end are packed in a single storage slot for efficient access.\n *\n * Struct members have an underscore prefix indicating that they are \"private\" and should not be read or written to\n * directly. Use the functions provided below instead. Modifying the struct manually may violate assumptions and\n * lead to unexpected behavior.\n *\n * The first item is at data[begin] and the last item is at data[end - 1]. This range can wrap around.\n */\n struct Bytes32Deque {\n uint128 _begin;\n uint128 _end;\n mapping(uint128 index => bytes32) _data;\n }\n\n /**\n * @dev Inserts an item at the end of the queue.\n *\n * Reverts with {Panic-RESOURCE_ERROR} if the queue is full.\n */\n function pushBack(Bytes32Deque storage deque, bytes32 value) internal {\n unchecked {\n uint128 backIndex = deque._end;\n if (backIndex + 1 == deque._begin) Panic.panic(Panic.RESOURCE_ERROR);\n deque._data[backIndex] = value;\n deque._end = backIndex + 1;\n }\n }\n\n /**\n * @dev Removes the item at the end of the queue and returns it.\n *\n * Reverts with {Panic-EMPTY_ARRAY_POP} if the queue is empty.\n */\n function popBack(Bytes32Deque storage deque) internal returns (bytes32 value) {\n unchecked {\n uint128 backIndex = deque._end;\n if (backIndex == deque._begin) Panic.panic(Panic.EMPTY_ARRAY_POP);\n --backIndex;\n value = deque._data[backIndex];\n delete deque._data[backIndex];\n deque._end = backIndex;\n }\n }\n\n /**\n * @dev Inserts an item at the beginning of the queue.\n *\n * Reverts with {Panic-RESOURCE_ERROR} if the queue is full.\n */\n function pushFront(Bytes32Deque storage deque, bytes32 value) internal {\n unchecked {\n uint128 frontIndex = deque._begin - 1;\n if (frontIndex == deque._end) Panic.panic(Panic.RESOURCE_ERROR);\n deque._data[frontIndex] = value;\n deque._begin = frontIndex;\n }\n }\n\n /**\n * @dev Removes the item at the beginning of the queue and returns it.\n *\n * Reverts with {Panic-EMPTY_ARRAY_POP} if the queue is empty.\n */\n function popFront(Bytes32Deque storage deque) internal returns (bytes32 value) {\n unchecked {\n uint128 frontIndex = deque._begin;\n if (frontIndex == deque._end) Panic.panic(Panic.EMPTY_ARRAY_POP);\n value = deque._data[frontIndex];\n delete deque._data[frontIndex];\n deque._begin = frontIndex + 1;\n }\n }\n\n /**\n * @dev Returns the item at the beginning of the queue.\n *\n * Reverts with {Panic-ARRAY_OUT_OF_BOUNDS} if the queue is empty.\n */\n function front(Bytes32Deque storage deque) internal view returns (bytes32 value) {\n if (empty(deque)) Panic.panic(Panic.ARRAY_OUT_OF_BOUNDS);\n return deque._data[deque._begin];\n }\n\n /**\n * @dev Returns the item at the end of the queue.\n *\n * Reverts with {Panic-ARRAY_OUT_OF_BOUNDS} if the queue is empty.\n */\n function back(Bytes32Deque storage deque) internal view returns (bytes32 value) {\n if (empty(deque)) Panic.panic(Panic.ARRAY_OUT_OF_BOUNDS);\n unchecked {\n return deque._data[deque._end - 1];\n }\n }\n\n /**\n * @dev Return the item at a position in the queue given by `index`, with the first item at 0 and last item at\n * `length(deque) - 1`.\n *\n * Reverts with {Panic-ARRAY_OUT_OF_BOUNDS} if the index is out of bounds.\n */\n function at(Bytes32Deque storage deque, uint256 index) internal view returns (bytes32 value) {\n if (index >= length(deque)) Panic.panic(Panic.ARRAY_OUT_OF_BOUNDS);\n // By construction, length is a uint128, so the check above ensures that index can be safely downcast to uint128\n unchecked {\n return deque._data[deque._begin + uint128(index)];\n }\n }\n\n /**\n * @dev Resets the queue back to being empty.\n *\n * NOTE: The current items are left behind in storage. This does not affect the functioning of the queue, but misses\n * out on potential gas refunds.\n */\n function clear(Bytes32Deque storage deque) internal {\n deque._begin = 0;\n deque._end = 0;\n }\n\n /**\n * @dev Returns the number of items in the queue.\n */\n function length(Bytes32Deque storage deque) internal view returns (uint256) {\n unchecked {\n return uint256(deque._end - deque._begin);\n }\n }\n\n /**\n * @dev Returns true if the queue is empty.\n */\n function empty(Bytes32Deque storage deque) internal view returns (bool) {\n return deque._end == deque._begin;\n }\n}\n" + }, + "@openzeppelin/contracts/utils/types/Time.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/types/Time.sol)\n\npragma solidity ^0.8.20;\n\nimport {Math} from \"../math/Math.sol\";\nimport {SafeCast} from \"../math/SafeCast.sol\";\n\n/**\n * @dev This library provides helpers for manipulating time-related objects.\n *\n * It uses the following types:\n * - `uint48` for timepoints\n * - `uint32` for durations\n *\n * While the library doesn't provide specific types for timepoints and duration, it does provide:\n * - a `Delay` type to represent duration that can be programmed to change value automatically at a given point\n * - additional helper functions\n */\nlibrary Time {\n using Time for *;\n\n /**\n * @dev Get the block timestamp as a Timepoint.\n */\n function timestamp() internal view returns (uint48) {\n return SafeCast.toUint48(block.timestamp);\n }\n\n /**\n * @dev Get the block number as a Timepoint.\n */\n function blockNumber() internal view returns (uint48) {\n return SafeCast.toUint48(block.number);\n }\n\n // ==================================================== Delay =====================================================\n /**\n * @dev A `Delay` is a uint32 duration that can be programmed to change value automatically at a given point in the\n * future. The \"effect\" timepoint describes when the transitions happens from the \"old\" value to the \"new\" value.\n * This allows updating the delay applied to some operation while keeping some guarantees.\n *\n * In particular, the {update} function guarantees that if the delay is reduced, the old delay still applies for\n * some time. For example if the delay is currently 7 days to do an upgrade, the admin should not be able to set\n * the delay to 0 and upgrade immediately. If the admin wants to reduce the delay, the old delay (7 days) should\n * still apply for some time.\n *\n *\n * The `Delay` type is 112 bits long, and packs the following:\n *\n * ```\n * | [uint48]: effect date (timepoint)\n * | | [uint32]: value before (duration)\n * ↓ ↓ ↓ [uint32]: value after (duration)\n * 0xAAAAAAAAAAAABBBBBBBBCCCCCCCC\n * ```\n *\n * NOTE: The {get} and {withUpdate} functions operate using timestamps. Block number based delays are not currently\n * supported.\n */\n type Delay is uint112;\n\n /**\n * @dev Wrap a duration into a Delay to add the one-step \"update in the future\" feature\n */\n function toDelay(uint32 duration) internal pure returns (Delay) {\n return Delay.wrap(duration);\n }\n\n /**\n * @dev Get the value at a given timepoint plus the pending value and effect timepoint if there is a scheduled\n * change after this timepoint. If the effect timepoint is 0, then the pending value should not be considered.\n */\n function _getFullAt(\n Delay self,\n uint48 timepoint\n ) private pure returns (uint32 valueBefore, uint32 valueAfter, uint48 effect) {\n (valueBefore, valueAfter, effect) = self.unpack();\n return effect <= timepoint ? (valueAfter, 0, 0) : (valueBefore, valueAfter, effect);\n }\n\n /**\n * @dev Get the current value plus the pending value and effect timepoint if there is a scheduled change. If the\n * effect timepoint is 0, then the pending value should not be considered.\n */\n function getFull(Delay self) internal view returns (uint32 valueBefore, uint32 valueAfter, uint48 effect) {\n return _getFullAt(self, timestamp());\n }\n\n /**\n * @dev Get the current value.\n */\n function get(Delay self) internal view returns (uint32) {\n (uint32 delay, , ) = self.getFull();\n return delay;\n }\n\n /**\n * @dev Update a Delay object so that it takes a new duration after a timepoint that is automatically computed to\n * enforce the old delay at the moment of the update. Returns the updated Delay object and the timestamp when the\n * new delay becomes effective.\n */\n function withUpdate(\n Delay self,\n uint32 newValue,\n uint32 minSetback\n ) internal view returns (Delay updatedDelay, uint48 effect) {\n uint32 value = self.get();\n uint32 setback = uint32(Math.max(minSetback, value > newValue ? value - newValue : 0));\n effect = timestamp() + setback;\n return (pack(value, newValue, effect), effect);\n }\n\n /**\n * @dev Split a delay into its components: valueBefore, valueAfter and effect (transition timepoint).\n */\n function unpack(Delay self) internal pure returns (uint32 valueBefore, uint32 valueAfter, uint48 effect) {\n uint112 raw = Delay.unwrap(self);\n\n valueAfter = uint32(raw);\n valueBefore = uint32(raw >> 32);\n effect = uint48(raw >> 64);\n\n return (valueBefore, valueAfter, effect);\n }\n\n /**\n * @dev pack the components into a Delay object.\n */\n function pack(uint32 valueBefore, uint32 valueAfter, uint48 effect) internal pure returns (Delay) {\n return Delay.wrap((uint112(effect) << 64) | (uint112(valueBefore) << 32) | uint112(valueAfter));\n }\n}\n" + }, + "contracts/variants/crosschain/Gov.sol": { + "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity ^0.8.20;\n\nimport \"@openzeppelin/contracts/governance/Governor.sol\";\nimport \"@openzeppelin/contracts/governance/extensions/GovernorSettings.sol\";\nimport \"@openzeppelin/contracts/governance/extensions/GovernorCountingSimple.sol\";\nimport \"@openzeppelin/contracts/governance/extensions/GovernorVotes.sol\";\nimport \"@openzeppelin/contracts/governance/extensions/GovernorVotesQuorumFraction.sol\";\nimport \"./ProofHandler.sol\";\n\n/**\n * @title Cross-chain Governance Contract\n * @author Web3 Hackers Collective\n * @notice Implementation of a DAO with cross-chain synchronization capabilities\n * @dev Extends OpenZeppelin's Governor contract with cross-chain parameter updates\n * @custom:security-contact julien@strat.cc\n */\ncontract Gov is\n Governor,\n GovernorSettings,\n GovernorCountingSimple,\n GovernorVotes,\n GovernorVotesQuorumFraction\n{\n /// @notice Chain ID where this contract was originally deployed\n uint256 public immutable home;\n\n /// @notice IPFS CID of the DAO's manifesto\n string public manifesto;\n\n /// @notice Storage for proof handling\n ProofHandler.ProofStorage private _proofStorage;\n\n /// @notice Types of operations that can be synchronized across chains\n enum OperationType {\n SET_MANIFESTO,\n UPDATE_VOTING_DELAY,\n UPDATE_VOTING_PERIOD,\n UPDATE_PROPOSAL_THRESHOLD,\n UPDATE_QUORUM\n }\n\n /// @notice Emitted when the manifesto is updated\n /// @param oldManifesto Previous manifesto CID\n /// @param newManifesto New manifesto CID\n /// @param nonce Update sequence number\n event ManifestoUpdated(string oldManifesto, string newManifesto, uint256 nonce);\n\n /// @notice Emitted when a governance parameter is updated\n /// @param operationType Type of parameter updated\n /// @param oldValue Previous value\n /// @param newValue New value\n /// @param nonce Update sequence number\n event GovernanceParameterUpdated(\n OperationType indexed operationType,\n uint256 oldValue,\n uint256 newValue,\n uint256 nonce\n );\n\n /// @notice Restricts functions to be called only on the home chain\n modifier onlyHomeChain() {\n require(block.chainid == home, \"Operation only allowed on home chain\");\n _;\n }\n\n /**\n * @notice Initializes the governance contract\n * @dev Sets up initial governance parameters and manifesto\n * @param _home Chain ID where this contract is considered home\n * @param _token The voting token contract address\n * @param _manifestoCid Initial manifesto CID\n * @param _name Name of the governance contract\n * @param _votingDelay Time before voting begins\n * @param _votingPeriod Duration of voting period\n * @param _proposalThreshold Minimum votes needed to create a proposal\n * @param _quorum Minimum participation percentage required\n */\n constructor(\n uint256 _home,\n IVotes _token,\n string memory _manifestoCid,\n string memory _name,\n uint48 _votingDelay,\n uint32 _votingPeriod,\n uint256 _proposalThreshold,\n uint256 _quorum\n )\n Governor(_name)\n GovernorSettings(_votingDelay, _votingPeriod, _proposalThreshold)\n GovernorVotes(_token)\n GovernorVotesQuorumFraction(_quorum)\n {\n home = _home;\n manifesto = _manifestoCid;\n }\n\n /**\n * @notice Updates the DAO's manifesto on the home chain\n * @param newManifesto New manifesto CID\n */\n function setManifesto(string memory newManifesto) public onlyGovernance onlyHomeChain {\n uint256 nonce = ProofHandler.incrementNonce(\n _proofStorage,\n uint8(OperationType.SET_MANIFESTO)\n );\n string memory oldManifesto = manifesto;\n manifesto = newManifesto;\n emit ManifestoUpdated(oldManifesto, newManifesto, nonce);\n }\n\n /**\n * @notice Updates the voting delay parameter on the home chain\n * @param newVotingDelay New voting delay value\n */\n function setVotingDelay(\n uint48 newVotingDelay\n ) public virtual override onlyGovernance onlyHomeChain {\n uint256 nonce = ProofHandler.incrementNonce(\n _proofStorage,\n uint8(OperationType.UPDATE_VOTING_DELAY)\n );\n uint256 oldValue = votingDelay();\n _setVotingDelay(newVotingDelay);\n emit GovernanceParameterUpdated(\n OperationType.UPDATE_VOTING_DELAY,\n oldValue,\n newVotingDelay,\n nonce\n );\n }\n\n /**\n * @notice Updates the voting period parameter on the home chain\n * @param newVotingPeriod New voting period value\n */\n function setVotingPeriod(\n uint32 newVotingPeriod\n ) public virtual override onlyGovernance onlyHomeChain {\n uint256 nonce = ProofHandler.incrementNonce(\n _proofStorage,\n uint8(OperationType.UPDATE_VOTING_PERIOD)\n );\n uint256 oldValue = votingPeriod();\n _setVotingPeriod(newVotingPeriod);\n emit GovernanceParameterUpdated(\n OperationType.UPDATE_VOTING_PERIOD,\n oldValue,\n newVotingPeriod,\n nonce\n );\n }\n\n /**\n * @notice Updates the proposal threshold parameter on the home chain\n * @param newProposalThreshold New proposal threshold value\n */\n function setProposalThreshold(\n uint256 newProposalThreshold\n ) public virtual override onlyGovernance onlyHomeChain {\n uint256 nonce = ProofHandler.incrementNonce(\n _proofStorage,\n uint8(OperationType.UPDATE_PROPOSAL_THRESHOLD)\n );\n uint256 oldValue = proposalThreshold();\n _setProposalThreshold(newProposalThreshold);\n emit GovernanceParameterUpdated(\n OperationType.UPDATE_PROPOSAL_THRESHOLD,\n oldValue,\n newProposalThreshold,\n nonce\n );\n }\n\n /**\n * @notice Updates the quorum numerator on the home chain\n * @param newQuorumNumerator New quorum numerator value\n */\n function updateQuorumNumerator(\n uint256 newQuorumNumerator\n ) public virtual override onlyGovernance onlyHomeChain {\n uint256 nonce = ProofHandler.incrementNonce(\n _proofStorage,\n uint8(OperationType.UPDATE_QUORUM)\n );\n uint256 oldValue = quorumNumerator();\n _updateQuorumNumerator(newQuorumNumerator);\n emit GovernanceParameterUpdated(\n OperationType.UPDATE_QUORUM,\n oldValue,\n newQuorumNumerator,\n nonce\n );\n }\n\n /**\n * @notice Generates proof for parameter updates\n * @param operationType Type of parameter being updated\n * @param value Encoded parameter value\n * @return proof Encoded proof data\n */\n function generateParameterProof(\n uint8 operationType,\n bytes memory value\n ) external view returns (bytes memory proof) {\n require(block.chainid == home, \"Proofs only generated on home chain\");\n uint256 nextNonce = ProofHandler.getNextNonce(_proofStorage, operationType);\n return ProofHandler.generateProof(address(this), operationType, value, nextNonce);\n }\n\n /**\n * @notice Claims a parameter update on a foreign chain\n * @param proof Proof generated by home chain\n */\n function claimParameterUpdate(bytes memory proof) external {\n (uint8 operationType, bytes memory value, uint256 nonce) = ProofHandler.verifyAndClaimProof(\n proof,\n address(this),\n _proofStorage\n );\n\n if (operationType == uint8(OperationType.SET_MANIFESTO)) {\n string memory newManifesto = abi.decode(value, (string));\n string memory oldManifesto = manifesto;\n manifesto = newManifesto;\n emit ManifestoUpdated(oldManifesto, newManifesto, nonce);\n } else if (operationType == uint8(OperationType.UPDATE_VOTING_DELAY)) {\n uint48 newValue = uint48(bytes6(value));\n uint256 oldValue = votingDelay();\n _setVotingDelay(newValue);\n emit GovernanceParameterUpdated(\n OperationType.UPDATE_VOTING_DELAY,\n oldValue,\n newValue,\n nonce\n );\n } else if (operationType == uint8(OperationType.UPDATE_VOTING_PERIOD)) {\n uint32 newValue = uint32(bytes4(value));\n uint256 oldValue = votingPeriod();\n _setVotingPeriod(newValue);\n emit GovernanceParameterUpdated(\n OperationType.UPDATE_VOTING_PERIOD,\n oldValue,\n newValue,\n nonce\n );\n } else if (operationType == uint8(OperationType.UPDATE_PROPOSAL_THRESHOLD)) {\n uint256 newValue = abi.decode(value, (uint256));\n uint256 oldValue = proposalThreshold();\n _setProposalThreshold(newValue);\n emit GovernanceParameterUpdated(\n OperationType.UPDATE_PROPOSAL_THRESHOLD,\n oldValue,\n newValue,\n nonce\n );\n } else if (operationType == uint8(OperationType.UPDATE_QUORUM)) {\n uint256 newValue = abi.decode(value, (uint256));\n uint256 oldValue = quorumNumerator();\n _updateQuorumNumerator(newValue);\n emit GovernanceParameterUpdated(OperationType.UPDATE_QUORUM, oldValue, newValue, nonce);\n }\n }\n\n // Required overrides\n\n function votingDelay() public view override(Governor, GovernorSettings) returns (uint256) {\n return super.votingDelay();\n }\n\n function votingPeriod() public view override(Governor, GovernorSettings) returns (uint256) {\n return super.votingPeriod();\n }\n\n function quorum(\n uint256 blockNumber\n ) public view override(Governor, GovernorVotesQuorumFraction) returns (uint256) {\n return super.quorum(blockNumber);\n }\n\n function proposalThreshold()\n public\n view\n override(Governor, GovernorSettings)\n returns (uint256)\n {\n return super.proposalThreshold();\n }\n}\n" + }, + "contracts/variants/crosschain/NFT.sol": { + "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity ^0.8.20;\n\nimport \"@openzeppelin/contracts/token/ERC721/ERC721.sol\";\nimport \"@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol\";\nimport \"@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol\";\nimport \"@openzeppelin/contracts/token/ERC721/extensions/ERC721Burnable.sol\";\nimport \"@openzeppelin/contracts/access/Ownable.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/EIP712.sol\";\nimport \"@openzeppelin/contracts/token/ERC721/extensions/ERC721Votes.sol\";\nimport \"./ProofHandler.sol\";\n\n/**\n * @title Cross-chain Membership NFT Contract\n * @author Web3 Hackers Collective\n * @notice Non-transferable NFT implementation for DAO membership with cross-chain capabilities\n * @dev Extends OpenZeppelin's NFT standards with cross-chain operation support\n * @custom:security-contact julien@strat.cc\n */\ncontract NFT is\n ERC721,\n ERC721Enumerable,\n ERC721URIStorage,\n ERC721Burnable,\n Ownable,\n EIP712,\n ERC721Votes\n{\n using ProofHandler for ProofHandler.ProofStorage;\n\n /// @notice Chain ID where contract was originally deployed\n uint256 public immutable home;\n\n /// @notice Next token ID to be minted\n uint256 private _nextTokenId;\n\n /// @notice Storage for proof handling\n ProofHandler.ProofStorage private _proofStorage;\n\n /// @notice Types of operations that can be synchronized across chains\n enum OperationType {\n MINT,\n BURN,\n SET_METADATA\n }\n\n /// @notice Emitted when a membership is claimed\n /// @param tokenId The ID of the claimed token\n /// @param member The address receiving the membership\n /// @param nonce Operation sequence number\n event MembershipClaimed(uint256 indexed tokenId, address indexed member, uint256 nonce);\n\n /// @notice Emitted when a membership is revoked\n /// @param tokenId The ID of the revoked token\n /// @param member The address losing membership\n /// @param nonce Operation sequence number\n event MembershipRevoked(uint256 indexed tokenId, address indexed member, uint256 nonce);\n\n /// @notice Emitted when metadata is updated\n /// @param tokenId The ID of the updated token\n /// @param newUri The new metadata URI\n /// @param nonce Operation sequence number\n event MetadataUpdated(uint256 indexed tokenId, string newUri, uint256 nonce);\n\n /// @notice Restricts functions to home chain\n modifier onlyHomeChain() {\n require(block.chainid == home, \"Operation only allowed on home chain\");\n _;\n }\n\n /**\n * @notice Initializes the NFT contract\n * @param _home Chain ID where contract is considered home\n * @param initialOwner Initial contract owner\n * @param _firstMembers Array of initial member addresses\n * @param _uri Initial token URI\n * @param _name Token collection name\n * @param _symbol Token collection symbol\n */\n constructor(\n uint256 _home,\n address initialOwner,\n address[] memory _firstMembers,\n string memory _uri,\n string memory _name,\n string memory _symbol\n ) ERC721(_name, _symbol) Ownable(initialOwner) EIP712(_name, \"1\") {\n home = _home;\n for (uint i; i < _firstMembers.length; i++) {\n _govMint(_firstMembers[i], _uri);\n }\n }\n\n /**\n * @notice Adds a new member on home chain\n * @dev Only callable by owner (governance) on home chain\n * @param to Address to mint token to\n * @param uri Token metadata URI\n */\n function safeMint(address to, string memory uri) public onlyOwner onlyHomeChain {\n uint256 nonce = _proofStorage.incrementNonce(uint8(OperationType.MINT));\n _govMint(to, uri);\n emit MembershipClaimed(_nextTokenId - 1, to, nonce);\n }\n\n /**\n * @notice Burns token on home chain\n * @dev Only callable by owner (governance) on home chain\n * @param tokenId ID of token to burn\n */\n function govBurn(uint256 tokenId) public onlyOwner onlyHomeChain {\n uint256 nonce = _proofStorage.incrementNonce(uint8(OperationType.BURN));\n address owner = ownerOf(tokenId);\n _burn(tokenId);\n emit MembershipRevoked(tokenId, owner, nonce);\n }\n\n /**\n * @notice Updates token metadata on home chain\n * @dev Only callable by owner (governance) on home chain\n * @param tokenId ID of token to update\n * @param uri New metadata URI\n */\n function setMetadata(uint256 tokenId, string memory uri) public onlyOwner onlyHomeChain {\n uint256 nonce = _proofStorage.incrementNonce(uint8(OperationType.SET_METADATA));\n _setTokenURI(tokenId, uri);\n emit MetadataUpdated(tokenId, uri, nonce);\n }\n\n /**\n * @notice Generates proof for NFT operations\n * @param operationType Type of operation\n * @param params Operation parameters\n * @return Encoded proof data\n */\n function generateOperationProof(\n uint8 operationType,\n bytes memory params\n ) external view returns (bytes memory) {\n require(block.chainid == home, \"Proofs only generated on home chain\");\n uint256 nextNonce = _proofStorage.getNextNonce(operationType);\n return ProofHandler.generateProof(address(this), operationType, params, nextNonce);\n }\n\n /**\n * @notice Claims an NFT operation on a foreign chain\n * @param proof Proof generated by home chain\n */\n function claimOperation(bytes memory proof) external {\n (uint8 operationType, bytes memory params, uint256 nonce) = ProofHandler\n .verifyAndClaimProof(proof, address(this), _proofStorage);\n\n if (operationType == uint8(OperationType.MINT)) {\n (address to, string memory uri) = abi.decode(params, (address, string));\n _govMint(to, uri);\n emit MembershipClaimed(_nextTokenId - 1, to, nonce);\n } else if (operationType == uint8(OperationType.BURN)) {\n uint256 tokenId = abi.decode(params, (uint256));\n address owner = ownerOf(tokenId);\n _burn(tokenId);\n emit MembershipRevoked(tokenId, owner, nonce);\n } else if (operationType == uint8(OperationType.SET_METADATA)) {\n (uint256 tokenId, string memory uri) = abi.decode(params, (uint256, string));\n _setTokenURI(tokenId, uri);\n emit MetadataUpdated(tokenId, uri, nonce);\n }\n }\n\n /**\n * @notice Internal function for minting without proof verification\n * @param to Address to receive token\n * @param uri Token metadata URI\n */\n function _govMint(address to, string memory uri) internal {\n uint256 tokenId = _nextTokenId++;\n _safeMint(to, tokenId);\n _setTokenURI(tokenId, uri);\n }\n\n // Required overrides\n\n function _update(\n address to,\n uint256 tokenId,\n address auth\n ) internal override(ERC721, ERC721Enumerable, ERC721Votes) returns (address) {\n require(auth == address(0) || to == address(0), \"NFT is not transferable\");\n return super._update(to, tokenId, auth);\n }\n\n function _increaseBalance(\n address account,\n uint128 value\n ) internal override(ERC721, ERC721Enumerable, ERC721Votes) {\n super._increaseBalance(account, value);\n }\n\n function tokenURI(\n uint256 tokenId\n ) public view override(ERC721, ERC721URIStorage) returns (string memory) {\n return super.tokenURI(tokenId);\n }\n\n function supportsInterface(\n bytes4 interfaceId\n ) public view override(ERC721, ERC721Enumerable, ERC721URIStorage) returns (bool) {\n return super.supportsInterface(interfaceId);\n }\n\n function clock() public view override returns (uint48) {\n return uint48(block.timestamp);\n }\n\n function CLOCK_MODE() public pure override returns (string memory) {\n return \"mode=timestamp\";\n }\n}\n" + }, + "contracts/variants/crosschain/ProofHandler.sol": { + "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity ^0.8.20;\n\n/**\n * @title Proof Handler Library\n * @author Web3 Hackers Collective\n * @notice Library for standardized cross-chain proof generation and verification\n * @dev Handles proof generation, verification, and tracking for cross-chain operations\n * @custom:security-contact julien@strat.cc\n */\nlibrary ProofHandler {\n /// @notice Tracks which proofs have been applied on each chain\n struct ProofStorage {\n mapping(bytes32 => bool) updateAppliedOnChain;\n mapping(uint8 => uint256) currentNonce;\n }\n\n /// @dev Emitted when a proof is claimed\n event ProofClaimed(uint8 indexed operationType, bytes params, uint256 nonce);\n\n /**\n * @notice Generates a proof for cross-chain operations\n * @param contractAddress Address of contract generating the proof\n * @param operationType Type of operation being performed\n * @param params Operation parameters\n * @param nonce Current nonce for this operation type\n * @return proof Encoded proof data\n */\n function generateProof(\n address contractAddress,\n uint8 operationType,\n bytes memory params,\n uint256 nonce\n ) public pure returns (bytes memory proof) {\n bytes32 message = keccak256(\n abi.encodePacked(contractAddress, operationType, params, nonce)\n );\n bytes32 digest = keccak256(abi.encodePacked(\"\\x19Ethereum Signed Message:\\n32\", message));\n\n return abi.encode(operationType, params, nonce, digest);\n }\n\n /**\n * @notice Verifies and claims a proof\n * @param proof Proof to verify and claim\n * @param contractAddress Address of contract claiming the proof\n * @param storage_ Proof storage struct\n * @return operationType The type of operation being performed\n * @return params The operation parameters\n * @return nonce The operation sequence number\n */\n function verifyAndClaimProof(\n bytes memory proof,\n address contractAddress,\n ProofStorage storage storage_\n ) public returns (uint8 operationType, bytes memory params, uint256 nonce) {\n bytes32 digest;\n (operationType, params, nonce, digest) = abi.decode(\n proof,\n (uint8, bytes, uint256, bytes32)\n );\n\n bytes32 proofHash = keccak256(proof);\n require(!storage_.updateAppliedOnChain[proofHash], \"Proof already claimed\");\n require(nonce == storage_.currentNonce[operationType] + 1, \"Invalid nonce\");\n\n bytes32 message = keccak256(\n abi.encodePacked(contractAddress, operationType, params, nonce)\n );\n bytes32 expectedDigest = keccak256(\n abi.encodePacked(\"\\x19Ethereum Signed Message:\\n32\", message)\n );\n require(digest == expectedDigest, \"Invalid proof\");\n\n storage_.updateAppliedOnChain[proofHash] = true;\n storage_.currentNonce[operationType] = nonce;\n\n emit ProofClaimed(operationType, params, nonce);\n\n return (operationType, params, nonce);\n }\n\n /**\n * @notice Gets the next nonce for an operation type\n * @param storage_ Proof storage struct\n * @param operationType Type of operation\n * @return nonce Next nonce value\n */\n function getNextNonce(\n ProofStorage storage storage_,\n uint8 operationType\n ) public view returns (uint256 nonce) {\n return storage_.currentNonce[operationType] + 1;\n }\n\n /**\n * @notice Increments the nonce for an operation type\n * @param storage_ Proof storage struct\n * @param operationType Type of operation\n * @return nonce New nonce value\n */\n function incrementNonce(\n ProofStorage storage storage_,\n uint8 operationType\n ) public returns (uint256 nonce) {\n storage_.currentNonce[operationType]++;\n return storage_.currentNonce[operationType];\n }\n}\n" + } + }, + "settings": { + "optimizer": { + "enabled": true, + "runs": 200 + }, + "evmVersion": "paris", + "outputSelection": { + "*": { + "*": [ + "abi", + "evm.bytecode", + "evm.deployedBytecode", + "evm.methodIdentifiers", + "metadata", + "devdoc", + "userdoc", + "storageLayout", + "evm.gasEstimates" + ], + "": [ + "ast" + ] + } + }, + "metadata": { + "useLiteralContent": true + } + } +} \ No newline at end of file diff --git a/deployments/baseSepolia/solcInputs/96a9008abeaccbd30a9b75989ce7f0fd.json b/deployments/baseSepolia/solcInputs/96a9008abeaccbd30a9b75989ce7f0fd.json new file mode 100644 index 0000000..9f2897c --- /dev/null +++ b/deployments/baseSepolia/solcInputs/96a9008abeaccbd30a9b75989ce7f0fd.json @@ -0,0 +1,186 @@ +{ + "language": "Solidity", + "sources": { + "@openzeppelin/contracts/access/Ownable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol)\n\npragma solidity ^0.8.20;\n\nimport {Context} from \"../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 * The initial owner is set to the address provided by the deployer. This can\n * 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 /**\n * @dev The caller account is not authorized to perform an operation.\n */\n error OwnableUnauthorizedAccount(address account);\n\n /**\n * @dev The owner is not a valid owner account. (eg. `address(0)`)\n */\n error OwnableInvalidOwner(address owner);\n\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n /**\n * @dev Initializes the contract setting the address provided by the deployer as the initial owner.\n */\n constructor(address initialOwner) {\n if (initialOwner == address(0)) {\n revert OwnableInvalidOwner(address(0));\n }\n _transferOwnership(initialOwner);\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 if (owner() != _msgSender()) {\n revert OwnableUnauthorizedAccount(_msgSender());\n }\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 if (newOwner == address(0)) {\n revert OwnableInvalidOwner(address(0));\n }\n _transferOwnership(newOwner);\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Internal function without access restriction.\n */\n function _transferOwnership(address newOwner) internal virtual {\n address oldOwner = _owner;\n _owner = newOwner;\n emit OwnershipTransferred(oldOwner, newOwner);\n }\n}\n" + }, + "@openzeppelin/contracts/governance/extensions/GovernorCountingSimple.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (governance/extensions/GovernorCountingSimple.sol)\n\npragma solidity ^0.8.20;\n\nimport {Governor} from \"../Governor.sol\";\n\n/**\n * @dev Extension of {Governor} for simple, 3 options, vote counting.\n */\nabstract contract GovernorCountingSimple is Governor {\n /**\n * @dev Supported vote types. Matches Governor Bravo ordering.\n */\n enum VoteType {\n Against,\n For,\n Abstain\n }\n\n struct ProposalVote {\n uint256 againstVotes;\n uint256 forVotes;\n uint256 abstainVotes;\n mapping(address voter => bool) hasVoted;\n }\n\n mapping(uint256 proposalId => ProposalVote) private _proposalVotes;\n\n /**\n * @dev See {IGovernor-COUNTING_MODE}.\n */\n // solhint-disable-next-line func-name-mixedcase\n function COUNTING_MODE() public pure virtual override returns (string memory) {\n return \"support=bravo&quorum=for,abstain\";\n }\n\n /**\n * @dev See {IGovernor-hasVoted}.\n */\n function hasVoted(uint256 proposalId, address account) public view virtual override returns (bool) {\n return _proposalVotes[proposalId].hasVoted[account];\n }\n\n /**\n * @dev Accessor to the internal vote counts.\n */\n function proposalVotes(\n uint256 proposalId\n ) public view virtual returns (uint256 againstVotes, uint256 forVotes, uint256 abstainVotes) {\n ProposalVote storage proposalVote = _proposalVotes[proposalId];\n return (proposalVote.againstVotes, proposalVote.forVotes, proposalVote.abstainVotes);\n }\n\n /**\n * @dev See {Governor-_quorumReached}.\n */\n function _quorumReached(uint256 proposalId) internal view virtual override returns (bool) {\n ProposalVote storage proposalVote = _proposalVotes[proposalId];\n\n return quorum(proposalSnapshot(proposalId)) <= proposalVote.forVotes + proposalVote.abstainVotes;\n }\n\n /**\n * @dev See {Governor-_voteSucceeded}. In this module, the forVotes must be strictly over the againstVotes.\n */\n function _voteSucceeded(uint256 proposalId) internal view virtual override returns (bool) {\n ProposalVote storage proposalVote = _proposalVotes[proposalId];\n\n return proposalVote.forVotes > proposalVote.againstVotes;\n }\n\n /**\n * @dev See {Governor-_countVote}. In this module, the support follows the `VoteType` enum (from Governor Bravo).\n */\n function _countVote(\n uint256 proposalId,\n address account,\n uint8 support,\n uint256 totalWeight,\n bytes memory // params\n ) internal virtual override returns (uint256) {\n ProposalVote storage proposalVote = _proposalVotes[proposalId];\n\n if (proposalVote.hasVoted[account]) {\n revert GovernorAlreadyCastVote(account);\n }\n proposalVote.hasVoted[account] = true;\n\n if (support == uint8(VoteType.Against)) {\n proposalVote.againstVotes += totalWeight;\n } else if (support == uint8(VoteType.For)) {\n proposalVote.forVotes += totalWeight;\n } else if (support == uint8(VoteType.Abstain)) {\n proposalVote.abstainVotes += totalWeight;\n } else {\n revert GovernorInvalidVoteType();\n }\n\n return totalWeight;\n }\n}\n" + }, + "@openzeppelin/contracts/governance/extensions/GovernorSettings.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (governance/extensions/GovernorSettings.sol)\n\npragma solidity ^0.8.20;\n\nimport {Governor} from \"../Governor.sol\";\n\n/**\n * @dev Extension of {Governor} for settings updatable through governance.\n */\nabstract contract GovernorSettings is Governor {\n // amount of token\n uint256 private _proposalThreshold;\n // timepoint: limited to uint48 in core (same as clock() type)\n uint48 private _votingDelay;\n // duration: limited to uint32 in core\n uint32 private _votingPeriod;\n\n event VotingDelaySet(uint256 oldVotingDelay, uint256 newVotingDelay);\n event VotingPeriodSet(uint256 oldVotingPeriod, uint256 newVotingPeriod);\n event ProposalThresholdSet(uint256 oldProposalThreshold, uint256 newProposalThreshold);\n\n /**\n * @dev Initialize the governance parameters.\n */\n constructor(uint48 initialVotingDelay, uint32 initialVotingPeriod, uint256 initialProposalThreshold) {\n _setVotingDelay(initialVotingDelay);\n _setVotingPeriod(initialVotingPeriod);\n _setProposalThreshold(initialProposalThreshold);\n }\n\n /**\n * @dev See {IGovernor-votingDelay}.\n */\n function votingDelay() public view virtual override returns (uint256) {\n return _votingDelay;\n }\n\n /**\n * @dev See {IGovernor-votingPeriod}.\n */\n function votingPeriod() public view virtual override returns (uint256) {\n return _votingPeriod;\n }\n\n /**\n * @dev See {Governor-proposalThreshold}.\n */\n function proposalThreshold() public view virtual override returns (uint256) {\n return _proposalThreshold;\n }\n\n /**\n * @dev Update the voting delay. This operation can only be performed through a governance proposal.\n *\n * Emits a {VotingDelaySet} event.\n */\n function setVotingDelay(uint48 newVotingDelay) public virtual onlyGovernance {\n _setVotingDelay(newVotingDelay);\n }\n\n /**\n * @dev Update the voting period. This operation can only be performed through a governance proposal.\n *\n * Emits a {VotingPeriodSet} event.\n */\n function setVotingPeriod(uint32 newVotingPeriod) public virtual onlyGovernance {\n _setVotingPeriod(newVotingPeriod);\n }\n\n /**\n * @dev Update the proposal threshold. This operation can only be performed through a governance proposal.\n *\n * Emits a {ProposalThresholdSet} event.\n */\n function setProposalThreshold(uint256 newProposalThreshold) public virtual onlyGovernance {\n _setProposalThreshold(newProposalThreshold);\n }\n\n /**\n * @dev Internal setter for the voting delay.\n *\n * Emits a {VotingDelaySet} event.\n */\n function _setVotingDelay(uint48 newVotingDelay) internal virtual {\n emit VotingDelaySet(_votingDelay, newVotingDelay);\n _votingDelay = newVotingDelay;\n }\n\n /**\n * @dev Internal setter for the voting period.\n *\n * Emits a {VotingPeriodSet} event.\n */\n function _setVotingPeriod(uint32 newVotingPeriod) internal virtual {\n if (newVotingPeriod == 0) {\n revert GovernorInvalidVotingPeriod(0);\n }\n emit VotingPeriodSet(_votingPeriod, newVotingPeriod);\n _votingPeriod = newVotingPeriod;\n }\n\n /**\n * @dev Internal setter for the proposal threshold.\n *\n * Emits a {ProposalThresholdSet} event.\n */\n function _setProposalThreshold(uint256 newProposalThreshold) internal virtual {\n emit ProposalThresholdSet(_proposalThreshold, newProposalThreshold);\n _proposalThreshold = newProposalThreshold;\n }\n}\n" + }, + "@openzeppelin/contracts/governance/extensions/GovernorVotes.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (governance/extensions/GovernorVotes.sol)\n\npragma solidity ^0.8.20;\n\nimport {Governor} from \"../Governor.sol\";\nimport {IVotes} from \"../utils/IVotes.sol\";\nimport {IERC5805} from \"../../interfaces/IERC5805.sol\";\nimport {SafeCast} from \"../../utils/math/SafeCast.sol\";\nimport {Time} from \"../../utils/types/Time.sol\";\n\n/**\n * @dev Extension of {Governor} for voting weight extraction from an {ERC20Votes} token, or since v4.5 an {ERC721Votes}\n * token.\n */\nabstract contract GovernorVotes is Governor {\n IERC5805 private immutable _token;\n\n constructor(IVotes tokenAddress) {\n _token = IERC5805(address(tokenAddress));\n }\n\n /**\n * @dev The token that voting power is sourced from.\n */\n function token() public view virtual returns (IERC5805) {\n return _token;\n }\n\n /**\n * @dev Clock (as specified in ERC-6372) is set to match the token's clock. Fallback to block numbers if the token\n * does not implement ERC-6372.\n */\n function clock() public view virtual override returns (uint48) {\n try token().clock() returns (uint48 timepoint) {\n return timepoint;\n } catch {\n return Time.blockNumber();\n }\n }\n\n /**\n * @dev Machine-readable description of the clock as specified in ERC-6372.\n */\n // solhint-disable-next-line func-name-mixedcase\n function CLOCK_MODE() public view virtual override returns (string memory) {\n try token().CLOCK_MODE() returns (string memory clockmode) {\n return clockmode;\n } catch {\n return \"mode=blocknumber&from=default\";\n }\n }\n\n /**\n * Read the voting weight from the token's built in snapshot mechanism (see {Governor-_getVotes}).\n */\n function _getVotes(\n address account,\n uint256 timepoint,\n bytes memory /*params*/\n ) internal view virtual override returns (uint256) {\n return token().getPastVotes(account, timepoint);\n }\n}\n" + }, + "@openzeppelin/contracts/governance/extensions/GovernorVotesQuorumFraction.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (governance/extensions/GovernorVotesQuorumFraction.sol)\n\npragma solidity ^0.8.20;\n\nimport {GovernorVotes} from \"./GovernorVotes.sol\";\nimport {SafeCast} from \"../../utils/math/SafeCast.sol\";\nimport {Checkpoints} from \"../../utils/structs/Checkpoints.sol\";\n\n/**\n * @dev Extension of {Governor} for voting weight extraction from an {ERC20Votes} token and a quorum expressed as a\n * fraction of the total supply.\n */\nabstract contract GovernorVotesQuorumFraction is GovernorVotes {\n using Checkpoints for Checkpoints.Trace208;\n\n Checkpoints.Trace208 private _quorumNumeratorHistory;\n\n event QuorumNumeratorUpdated(uint256 oldQuorumNumerator, uint256 newQuorumNumerator);\n\n /**\n * @dev The quorum set is not a valid fraction.\n */\n error GovernorInvalidQuorumFraction(uint256 quorumNumerator, uint256 quorumDenominator);\n\n /**\n * @dev Initialize quorum as a fraction of the token's total supply.\n *\n * The fraction is specified as `numerator / denominator`. By default the denominator is 100, so quorum is\n * specified as a percent: a numerator of 10 corresponds to quorum being 10% of total supply. The denominator can be\n * customized by overriding {quorumDenominator}.\n */\n constructor(uint256 quorumNumeratorValue) {\n _updateQuorumNumerator(quorumNumeratorValue);\n }\n\n /**\n * @dev Returns the current quorum numerator. See {quorumDenominator}.\n */\n function quorumNumerator() public view virtual returns (uint256) {\n return _quorumNumeratorHistory.latest();\n }\n\n /**\n * @dev Returns the quorum numerator at a specific timepoint. See {quorumDenominator}.\n */\n function quorumNumerator(uint256 timepoint) public view virtual returns (uint256) {\n uint256 length = _quorumNumeratorHistory._checkpoints.length;\n\n // Optimistic search, check the latest checkpoint\n Checkpoints.Checkpoint208 storage latest = _quorumNumeratorHistory._checkpoints[length - 1];\n uint48 latestKey = latest._key;\n uint208 latestValue = latest._value;\n if (latestKey <= timepoint) {\n return latestValue;\n }\n\n // Otherwise, do the binary search\n return _quorumNumeratorHistory.upperLookupRecent(SafeCast.toUint48(timepoint));\n }\n\n /**\n * @dev Returns the quorum denominator. Defaults to 100, but may be overridden.\n */\n function quorumDenominator() public view virtual returns (uint256) {\n return 100;\n }\n\n /**\n * @dev Returns the quorum for a timepoint, in terms of number of votes: `supply * numerator / denominator`.\n */\n function quorum(uint256 timepoint) public view virtual override returns (uint256) {\n return (token().getPastTotalSupply(timepoint) * quorumNumerator(timepoint)) / quorumDenominator();\n }\n\n /**\n * @dev Changes the quorum numerator.\n *\n * Emits a {QuorumNumeratorUpdated} event.\n *\n * Requirements:\n *\n * - Must be called through a governance proposal.\n * - New numerator must be smaller or equal to the denominator.\n */\n function updateQuorumNumerator(uint256 newQuorumNumerator) external virtual onlyGovernance {\n _updateQuorumNumerator(newQuorumNumerator);\n }\n\n /**\n * @dev Changes the quorum numerator.\n *\n * Emits a {QuorumNumeratorUpdated} event.\n *\n * Requirements:\n *\n * - New numerator must be smaller or equal to the denominator.\n */\n function _updateQuorumNumerator(uint256 newQuorumNumerator) internal virtual {\n uint256 denominator = quorumDenominator();\n if (newQuorumNumerator > denominator) {\n revert GovernorInvalidQuorumFraction(newQuorumNumerator, denominator);\n }\n\n uint256 oldQuorumNumerator = quorumNumerator();\n _quorumNumeratorHistory.push(clock(), SafeCast.toUint208(newQuorumNumerator));\n\n emit QuorumNumeratorUpdated(oldQuorumNumerator, newQuorumNumerator);\n }\n}\n" + }, + "@openzeppelin/contracts/governance/Governor.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (governance/Governor.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC721Receiver} from \"../token/ERC721/IERC721Receiver.sol\";\nimport {IERC1155Receiver} from \"../token/ERC1155/IERC1155Receiver.sol\";\nimport {EIP712} from \"../utils/cryptography/EIP712.sol\";\nimport {SignatureChecker} from \"../utils/cryptography/SignatureChecker.sol\";\nimport {IERC165, ERC165} from \"../utils/introspection/ERC165.sol\";\nimport {SafeCast} from \"../utils/math/SafeCast.sol\";\nimport {DoubleEndedQueue} from \"../utils/structs/DoubleEndedQueue.sol\";\nimport {Address} from \"../utils/Address.sol\";\nimport {Context} from \"../utils/Context.sol\";\nimport {Nonces} from \"../utils/Nonces.sol\";\nimport {IGovernor, IERC6372} from \"./IGovernor.sol\";\n\n/**\n * @dev Core of the governance system, designed to be extended through various modules.\n *\n * This contract is abstract and requires several functions to be implemented in various modules:\n *\n * - A counting module must implement {quorum}, {_quorumReached}, {_voteSucceeded} and {_countVote}\n * - A voting module must implement {_getVotes}\n * - Additionally, {votingPeriod} must also be implemented\n */\nabstract contract Governor is Context, ERC165, EIP712, Nonces, IGovernor, IERC721Receiver, IERC1155Receiver {\n using DoubleEndedQueue for DoubleEndedQueue.Bytes32Deque;\n\n bytes32 public constant BALLOT_TYPEHASH =\n keccak256(\"Ballot(uint256 proposalId,uint8 support,address voter,uint256 nonce)\");\n bytes32 public constant EXTENDED_BALLOT_TYPEHASH =\n keccak256(\n \"ExtendedBallot(uint256 proposalId,uint8 support,address voter,uint256 nonce,string reason,bytes params)\"\n );\n\n struct ProposalCore {\n address proposer;\n uint48 voteStart;\n uint32 voteDuration;\n bool executed;\n bool canceled;\n uint48 etaSeconds;\n }\n\n bytes32 private constant ALL_PROPOSAL_STATES_BITMAP = bytes32((2 ** (uint8(type(ProposalState).max) + 1)) - 1);\n string private _name;\n\n mapping(uint256 proposalId => ProposalCore) private _proposals;\n\n // This queue keeps track of the governor operating on itself. Calls to functions protected by the {onlyGovernance}\n // modifier needs to be whitelisted in this queue. Whitelisting is set in {execute}, consumed by the\n // {onlyGovernance} modifier and eventually reset after {_executeOperations} completes. This ensures that the\n // execution of {onlyGovernance} protected calls can only be achieved through successful proposals.\n DoubleEndedQueue.Bytes32Deque private _governanceCall;\n\n /**\n * @dev Restricts a function so it can only be executed through governance proposals. For example, governance\n * parameter setters in {GovernorSettings} are protected using this modifier.\n *\n * The governance executing address may be different from the Governor's own address, for example it could be a\n * timelock. This can be customized by modules by overriding {_executor}. The executor is only able to invoke these\n * functions during the execution of the governor's {execute} function, and not under any other circumstances. Thus,\n * for example, additional timelock proposers are not able to change governance parameters without going through the\n * governance protocol (since v4.6).\n */\n modifier onlyGovernance() {\n _checkGovernance();\n _;\n }\n\n /**\n * @dev Sets the value for {name} and {version}\n */\n constructor(string memory name_) EIP712(name_, version()) {\n _name = name_;\n }\n\n /**\n * @dev Function to receive ETH that will be handled by the governor (disabled if executor is a third party contract)\n */\n receive() external payable virtual {\n if (_executor() != address(this)) {\n revert GovernorDisabledDeposit();\n }\n }\n\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165, ERC165) returns (bool) {\n return\n interfaceId == type(IGovernor).interfaceId ||\n interfaceId == type(IERC1155Receiver).interfaceId ||\n super.supportsInterface(interfaceId);\n }\n\n /**\n * @dev See {IGovernor-name}.\n */\n function name() public view virtual returns (string memory) {\n return _name;\n }\n\n /**\n * @dev See {IGovernor-version}.\n */\n function version() public view virtual returns (string memory) {\n return \"1\";\n }\n\n /**\n * @dev See {IGovernor-hashProposal}.\n *\n * The proposal id is produced by hashing the ABI encoded `targets` array, the `values` array, the `calldatas` array\n * and the descriptionHash (bytes32 which itself is the keccak256 hash of the description string). This proposal id\n * can be produced from the proposal data which is part of the {ProposalCreated} event. It can even be computed in\n * advance, before the proposal is submitted.\n *\n * Note that the chainId and the governor address are not part of the proposal id computation. Consequently, the\n * same proposal (with same operation and same description) will have the same id if submitted on multiple governors\n * across multiple networks. This also means that in order to execute the same operation twice (on the same\n * governor) the proposer will have to change the description in order to avoid proposal id conflicts.\n */\n function hashProposal(\n address[] memory targets,\n uint256[] memory values,\n bytes[] memory calldatas,\n bytes32 descriptionHash\n ) public pure virtual returns (uint256) {\n return uint256(keccak256(abi.encode(targets, values, calldatas, descriptionHash)));\n }\n\n /**\n * @dev See {IGovernor-state}.\n */\n function state(uint256 proposalId) public view virtual returns (ProposalState) {\n // We read the struct fields into the stack at once so Solidity emits a single SLOAD\n ProposalCore storage proposal = _proposals[proposalId];\n bool proposalExecuted = proposal.executed;\n bool proposalCanceled = proposal.canceled;\n\n if (proposalExecuted) {\n return ProposalState.Executed;\n }\n\n if (proposalCanceled) {\n return ProposalState.Canceled;\n }\n\n uint256 snapshot = proposalSnapshot(proposalId);\n\n if (snapshot == 0) {\n revert GovernorNonexistentProposal(proposalId);\n }\n\n uint256 currentTimepoint = clock();\n\n if (snapshot >= currentTimepoint) {\n return ProposalState.Pending;\n }\n\n uint256 deadline = proposalDeadline(proposalId);\n\n if (deadline >= currentTimepoint) {\n return ProposalState.Active;\n } else if (!_quorumReached(proposalId) || !_voteSucceeded(proposalId)) {\n return ProposalState.Defeated;\n } else if (proposalEta(proposalId) == 0) {\n return ProposalState.Succeeded;\n } else {\n return ProposalState.Queued;\n }\n }\n\n /**\n * @dev See {IGovernor-proposalThreshold}.\n */\n function proposalThreshold() public view virtual returns (uint256) {\n return 0;\n }\n\n /**\n * @dev See {IGovernor-proposalSnapshot}.\n */\n function proposalSnapshot(uint256 proposalId) public view virtual returns (uint256) {\n return _proposals[proposalId].voteStart;\n }\n\n /**\n * @dev See {IGovernor-proposalDeadline}.\n */\n function proposalDeadline(uint256 proposalId) public view virtual returns (uint256) {\n return _proposals[proposalId].voteStart + _proposals[proposalId].voteDuration;\n }\n\n /**\n * @dev See {IGovernor-proposalProposer}.\n */\n function proposalProposer(uint256 proposalId) public view virtual returns (address) {\n return _proposals[proposalId].proposer;\n }\n\n /**\n * @dev See {IGovernor-proposalEta}.\n */\n function proposalEta(uint256 proposalId) public view virtual returns (uint256) {\n return _proposals[proposalId].etaSeconds;\n }\n\n /**\n * @dev See {IGovernor-proposalNeedsQueuing}.\n */\n function proposalNeedsQueuing(uint256) public view virtual returns (bool) {\n return false;\n }\n\n /**\n * @dev Reverts if the `msg.sender` is not the executor. In case the executor is not this contract\n * itself, the function reverts if `msg.data` is not whitelisted as a result of an {execute}\n * operation. See {onlyGovernance}.\n */\n function _checkGovernance() internal virtual {\n if (_executor() != _msgSender()) {\n revert GovernorOnlyExecutor(_msgSender());\n }\n if (_executor() != address(this)) {\n bytes32 msgDataHash = keccak256(_msgData());\n // loop until popping the expected operation - throw if deque is empty (operation not authorized)\n while (_governanceCall.popFront() != msgDataHash) {}\n }\n }\n\n /**\n * @dev Amount of votes already cast passes the threshold limit.\n */\n function _quorumReached(uint256 proposalId) internal view virtual returns (bool);\n\n /**\n * @dev Is the proposal successful or not.\n */\n function _voteSucceeded(uint256 proposalId) internal view virtual returns (bool);\n\n /**\n * @dev Get the voting weight of `account` at a specific `timepoint`, for a vote as described by `params`.\n */\n function _getVotes(address account, uint256 timepoint, bytes memory params) internal view virtual returns (uint256);\n\n /**\n * @dev Register a vote for `proposalId` by `account` with a given `support`, voting `weight` and voting `params`.\n *\n * Note: Support is generic and can represent various things depending on the voting system used.\n */\n function _countVote(\n uint256 proposalId,\n address account,\n uint8 support,\n uint256 totalWeight,\n bytes memory params\n ) internal virtual returns (uint256);\n\n /**\n * @dev Default additional encoded parameters used by castVote methods that don't include them\n *\n * Note: Should be overridden by specific implementations to use an appropriate value, the\n * meaning of the additional params, in the context of that implementation\n */\n function _defaultParams() internal view virtual returns (bytes memory) {\n return \"\";\n }\n\n /**\n * @dev See {IGovernor-propose}. This function has opt-in frontrunning protection, described in {_isValidDescriptionForProposer}.\n */\n function propose(\n address[] memory targets,\n uint256[] memory values,\n bytes[] memory calldatas,\n string memory description\n ) public virtual returns (uint256) {\n address proposer = _msgSender();\n\n // check description restriction\n if (!_isValidDescriptionForProposer(proposer, description)) {\n revert GovernorRestrictedProposer(proposer);\n }\n\n // check proposal threshold\n uint256 votesThreshold = proposalThreshold();\n if (votesThreshold > 0) {\n uint256 proposerVotes = getVotes(proposer, clock() - 1);\n if (proposerVotes < votesThreshold) {\n revert GovernorInsufficientProposerVotes(proposer, proposerVotes, votesThreshold);\n }\n }\n\n return _propose(targets, values, calldatas, description, proposer);\n }\n\n /**\n * @dev Internal propose mechanism. Can be overridden to add more logic on proposal creation.\n *\n * Emits a {IGovernor-ProposalCreated} event.\n */\n function _propose(\n address[] memory targets,\n uint256[] memory values,\n bytes[] memory calldatas,\n string memory description,\n address proposer\n ) internal virtual returns (uint256 proposalId) {\n proposalId = hashProposal(targets, values, calldatas, keccak256(bytes(description)));\n\n if (targets.length != values.length || targets.length != calldatas.length || targets.length == 0) {\n revert GovernorInvalidProposalLength(targets.length, calldatas.length, values.length);\n }\n if (_proposals[proposalId].voteStart != 0) {\n revert GovernorUnexpectedProposalState(proposalId, state(proposalId), bytes32(0));\n }\n\n uint256 snapshot = clock() + votingDelay();\n uint256 duration = votingPeriod();\n\n ProposalCore storage proposal = _proposals[proposalId];\n proposal.proposer = proposer;\n proposal.voteStart = SafeCast.toUint48(snapshot);\n proposal.voteDuration = SafeCast.toUint32(duration);\n\n emit ProposalCreated(\n proposalId,\n proposer,\n targets,\n values,\n new string[](targets.length),\n calldatas,\n snapshot,\n snapshot + duration,\n description\n );\n\n // Using a named return variable to avoid stack too deep errors\n }\n\n /**\n * @dev See {IGovernor-queue}.\n */\n function queue(\n address[] memory targets,\n uint256[] memory values,\n bytes[] memory calldatas,\n bytes32 descriptionHash\n ) public virtual returns (uint256) {\n uint256 proposalId = hashProposal(targets, values, calldatas, descriptionHash);\n\n _validateStateBitmap(proposalId, _encodeStateBitmap(ProposalState.Succeeded));\n\n uint48 etaSeconds = _queueOperations(proposalId, targets, values, calldatas, descriptionHash);\n\n if (etaSeconds != 0) {\n _proposals[proposalId].etaSeconds = etaSeconds;\n emit ProposalQueued(proposalId, etaSeconds);\n } else {\n revert GovernorQueueNotImplemented();\n }\n\n return proposalId;\n }\n\n /**\n * @dev Internal queuing mechanism. Can be overridden (without a super call) to modify the way queuing is\n * performed (for example adding a vault/timelock).\n *\n * This is empty by default, and must be overridden to implement queuing.\n *\n * This function returns a timestamp that describes the expected ETA for execution. If the returned value is 0\n * (which is the default value), the core will consider queueing did not succeed, and the public {queue} function\n * will revert.\n *\n * NOTE: Calling this function directly will NOT check the current state of the proposal, or emit the\n * `ProposalQueued` event. Queuing a proposal should be done using {queue}.\n */\n function _queueOperations(\n uint256 /*proposalId*/,\n address[] memory /*targets*/,\n uint256[] memory /*values*/,\n bytes[] memory /*calldatas*/,\n bytes32 /*descriptionHash*/\n ) internal virtual returns (uint48) {\n return 0;\n }\n\n /**\n * @dev See {IGovernor-execute}.\n */\n function execute(\n address[] memory targets,\n uint256[] memory values,\n bytes[] memory calldatas,\n bytes32 descriptionHash\n ) public payable virtual returns (uint256) {\n uint256 proposalId = hashProposal(targets, values, calldatas, descriptionHash);\n\n _validateStateBitmap(\n proposalId,\n _encodeStateBitmap(ProposalState.Succeeded) | _encodeStateBitmap(ProposalState.Queued)\n );\n\n // mark as executed before calls to avoid reentrancy\n _proposals[proposalId].executed = true;\n\n // before execute: register governance call in queue.\n if (_executor() != address(this)) {\n for (uint256 i = 0; i < targets.length; ++i) {\n if (targets[i] == address(this)) {\n _governanceCall.pushBack(keccak256(calldatas[i]));\n }\n }\n }\n\n _executeOperations(proposalId, targets, values, calldatas, descriptionHash);\n\n // after execute: cleanup governance call queue.\n if (_executor() != address(this) && !_governanceCall.empty()) {\n _governanceCall.clear();\n }\n\n emit ProposalExecuted(proposalId);\n\n return proposalId;\n }\n\n /**\n * @dev Internal execution mechanism. Can be overridden (without a super call) to modify the way execution is\n * performed (for example adding a vault/timelock).\n *\n * NOTE: Calling this function directly will NOT check the current state of the proposal, set the executed flag to\n * true or emit the `ProposalExecuted` event. Executing a proposal should be done using {execute} or {_execute}.\n */\n function _executeOperations(\n uint256 /* proposalId */,\n address[] memory targets,\n uint256[] memory values,\n bytes[] memory calldatas,\n bytes32 /*descriptionHash*/\n ) internal virtual {\n for (uint256 i = 0; i < targets.length; ++i) {\n (bool success, bytes memory returndata) = targets[i].call{value: values[i]}(calldatas[i]);\n Address.verifyCallResult(success, returndata);\n }\n }\n\n /**\n * @dev See {IGovernor-cancel}.\n */\n function cancel(\n address[] memory targets,\n uint256[] memory values,\n bytes[] memory calldatas,\n bytes32 descriptionHash\n ) public virtual returns (uint256) {\n // The proposalId will be recomputed in the `_cancel` call further down. However we need the value before we\n // do the internal call, because we need to check the proposal state BEFORE the internal `_cancel` call\n // changes it. The `hashProposal` duplication has a cost that is limited, and that we accept.\n uint256 proposalId = hashProposal(targets, values, calldatas, descriptionHash);\n\n // public cancel restrictions (on top of existing _cancel restrictions).\n _validateStateBitmap(proposalId, _encodeStateBitmap(ProposalState.Pending));\n if (_msgSender() != proposalProposer(proposalId)) {\n revert GovernorOnlyProposer(_msgSender());\n }\n\n return _cancel(targets, values, calldatas, descriptionHash);\n }\n\n /**\n * @dev Internal cancel mechanism with minimal restrictions. A proposal can be cancelled in any state other than\n * Canceled, Expired, or Executed. Once cancelled a proposal can't be re-submitted.\n *\n * Emits a {IGovernor-ProposalCanceled} event.\n */\n function _cancel(\n address[] memory targets,\n uint256[] memory values,\n bytes[] memory calldatas,\n bytes32 descriptionHash\n ) internal virtual returns (uint256) {\n uint256 proposalId = hashProposal(targets, values, calldatas, descriptionHash);\n\n _validateStateBitmap(\n proposalId,\n ALL_PROPOSAL_STATES_BITMAP ^\n _encodeStateBitmap(ProposalState.Canceled) ^\n _encodeStateBitmap(ProposalState.Expired) ^\n _encodeStateBitmap(ProposalState.Executed)\n );\n\n _proposals[proposalId].canceled = true;\n emit ProposalCanceled(proposalId);\n\n return proposalId;\n }\n\n /**\n * @dev See {IGovernor-getVotes}.\n */\n function getVotes(address account, uint256 timepoint) public view virtual returns (uint256) {\n return _getVotes(account, timepoint, _defaultParams());\n }\n\n /**\n * @dev See {IGovernor-getVotesWithParams}.\n */\n function getVotesWithParams(\n address account,\n uint256 timepoint,\n bytes memory params\n ) public view virtual returns (uint256) {\n return _getVotes(account, timepoint, params);\n }\n\n /**\n * @dev See {IGovernor-castVote}.\n */\n function castVote(uint256 proposalId, uint8 support) public virtual returns (uint256) {\n address voter = _msgSender();\n return _castVote(proposalId, voter, support, \"\");\n }\n\n /**\n * @dev See {IGovernor-castVoteWithReason}.\n */\n function castVoteWithReason(\n uint256 proposalId,\n uint8 support,\n string calldata reason\n ) public virtual returns (uint256) {\n address voter = _msgSender();\n return _castVote(proposalId, voter, support, reason);\n }\n\n /**\n * @dev See {IGovernor-castVoteWithReasonAndParams}.\n */\n function castVoteWithReasonAndParams(\n uint256 proposalId,\n uint8 support,\n string calldata reason,\n bytes memory params\n ) public virtual returns (uint256) {\n address voter = _msgSender();\n return _castVote(proposalId, voter, support, reason, params);\n }\n\n /**\n * @dev See {IGovernor-castVoteBySig}.\n */\n function castVoteBySig(\n uint256 proposalId,\n uint8 support,\n address voter,\n bytes memory signature\n ) public virtual returns (uint256) {\n bool valid = SignatureChecker.isValidSignatureNow(\n voter,\n _hashTypedDataV4(keccak256(abi.encode(BALLOT_TYPEHASH, proposalId, support, voter, _useNonce(voter)))),\n signature\n );\n\n if (!valid) {\n revert GovernorInvalidSignature(voter);\n }\n\n return _castVote(proposalId, voter, support, \"\");\n }\n\n /**\n * @dev See {IGovernor-castVoteWithReasonAndParamsBySig}.\n */\n function castVoteWithReasonAndParamsBySig(\n uint256 proposalId,\n uint8 support,\n address voter,\n string calldata reason,\n bytes memory params,\n bytes memory signature\n ) public virtual returns (uint256) {\n bool valid = SignatureChecker.isValidSignatureNow(\n voter,\n _hashTypedDataV4(\n keccak256(\n abi.encode(\n EXTENDED_BALLOT_TYPEHASH,\n proposalId,\n support,\n voter,\n _useNonce(voter),\n keccak256(bytes(reason)),\n keccak256(params)\n )\n )\n ),\n signature\n );\n\n if (!valid) {\n revert GovernorInvalidSignature(voter);\n }\n\n return _castVote(proposalId, voter, support, reason, params);\n }\n\n /**\n * @dev Internal vote casting mechanism: Check that the vote is pending, that it has not been cast yet, retrieve\n * voting weight using {IGovernor-getVotes} and call the {_countVote} internal function. Uses the _defaultParams().\n *\n * Emits a {IGovernor-VoteCast} event.\n */\n function _castVote(\n uint256 proposalId,\n address account,\n uint8 support,\n string memory reason\n ) internal virtual returns (uint256) {\n return _castVote(proposalId, account, support, reason, _defaultParams());\n }\n\n /**\n * @dev Internal vote casting mechanism: Check that the vote is pending, that it has not been cast yet, retrieve\n * voting weight using {IGovernor-getVotes} and call the {_countVote} internal function.\n *\n * Emits a {IGovernor-VoteCast} event.\n */\n function _castVote(\n uint256 proposalId,\n address account,\n uint8 support,\n string memory reason,\n bytes memory params\n ) internal virtual returns (uint256) {\n _validateStateBitmap(proposalId, _encodeStateBitmap(ProposalState.Active));\n\n uint256 totalWeight = _getVotes(account, proposalSnapshot(proposalId), params);\n uint256 votedWeight = _countVote(proposalId, account, support, totalWeight, params);\n\n if (params.length == 0) {\n emit VoteCast(account, proposalId, support, votedWeight, reason);\n } else {\n emit VoteCastWithParams(account, proposalId, support, votedWeight, reason, params);\n }\n\n return votedWeight;\n }\n\n /**\n * @dev Relays a transaction or function call to an arbitrary target. In cases where the governance executor\n * is some contract other than the governor itself, like when using a timelock, this function can be invoked\n * in a governance proposal to recover tokens or Ether that was sent to the governor contract by mistake.\n * Note that if the executor is simply the governor itself, use of `relay` is redundant.\n */\n function relay(address target, uint256 value, bytes calldata data) external payable virtual onlyGovernance {\n (bool success, bytes memory returndata) = target.call{value: value}(data);\n Address.verifyCallResult(success, returndata);\n }\n\n /**\n * @dev Address through which the governor executes action. Will be overloaded by module that execute actions\n * through another contract such as a timelock.\n */\n function _executor() internal view virtual returns (address) {\n return address(this);\n }\n\n /**\n * @dev See {IERC721Receiver-onERC721Received}.\n * Receiving tokens is disabled if the governance executor is other than the governor itself (eg. when using with a timelock).\n */\n function onERC721Received(address, address, uint256, bytes memory) public virtual returns (bytes4) {\n if (_executor() != address(this)) {\n revert GovernorDisabledDeposit();\n }\n return this.onERC721Received.selector;\n }\n\n /**\n * @dev See {IERC1155Receiver-onERC1155Received}.\n * Receiving tokens is disabled if the governance executor is other than the governor itself (eg. when using with a timelock).\n */\n function onERC1155Received(address, address, uint256, uint256, bytes memory) public virtual returns (bytes4) {\n if (_executor() != address(this)) {\n revert GovernorDisabledDeposit();\n }\n return this.onERC1155Received.selector;\n }\n\n /**\n * @dev See {IERC1155Receiver-onERC1155BatchReceived}.\n * Receiving tokens is disabled if the governance executor is other than the governor itself (eg. when using with a timelock).\n */\n function onERC1155BatchReceived(\n address,\n address,\n uint256[] memory,\n uint256[] memory,\n bytes memory\n ) public virtual returns (bytes4) {\n if (_executor() != address(this)) {\n revert GovernorDisabledDeposit();\n }\n return this.onERC1155BatchReceived.selector;\n }\n\n /**\n * @dev Encodes a `ProposalState` into a `bytes32` representation where each bit enabled corresponds to\n * the underlying position in the `ProposalState` enum. For example:\n *\n * 0x000...10000\n * ^^^^^^------ ...\n * ^----- Succeeded\n * ^---- Defeated\n * ^--- Canceled\n * ^-- Active\n * ^- Pending\n */\n function _encodeStateBitmap(ProposalState proposalState) internal pure returns (bytes32) {\n return bytes32(1 << uint8(proposalState));\n }\n\n /**\n * @dev Check that the current state of a proposal matches the requirements described by the `allowedStates` bitmap.\n * This bitmap should be built using `_encodeStateBitmap`.\n *\n * If requirements are not met, reverts with a {GovernorUnexpectedProposalState} error.\n */\n function _validateStateBitmap(uint256 proposalId, bytes32 allowedStates) private view returns (ProposalState) {\n ProposalState currentState = state(proposalId);\n if (_encodeStateBitmap(currentState) & allowedStates == bytes32(0)) {\n revert GovernorUnexpectedProposalState(proposalId, currentState, allowedStates);\n }\n return currentState;\n }\n\n /*\n * @dev Check if the proposer is authorized to submit a proposal with the given description.\n *\n * If the proposal description ends with `#proposer=0x???`, where `0x???` is an address written as a hex string\n * (case insensitive), then the submission of this proposal will only be authorized to said address.\n *\n * This is used for frontrunning protection. By adding this pattern at the end of their proposal, one can ensure\n * that no other address can submit the same proposal. An attacker would have to either remove or change that part,\n * which would result in a different proposal id.\n *\n * If the description does not match this pattern, it is unrestricted and anyone can submit it. This includes:\n * - If the `0x???` part is not a valid hex string.\n * - If the `0x???` part is a valid hex string, but does not contain exactly 40 hex digits.\n * - If it ends with the expected suffix followed by newlines or other whitespace.\n * - If it ends with some other similar suffix, e.g. `#other=abc`.\n * - If it does not end with any such suffix.\n */\n function _isValidDescriptionForProposer(\n address proposer,\n string memory description\n ) internal view virtual returns (bool) {\n uint256 len = bytes(description).length;\n\n // Length is too short to contain a valid proposer suffix\n if (len < 52) {\n return true;\n }\n\n // Extract what would be the `#proposer=0x` marker beginning the suffix\n bytes12 marker;\n assembly (\"memory-safe\") {\n // - Start of the string contents in memory = description + 32\n // - First character of the marker = len - 52\n // - Length of \"#proposer=0x0000000000000000000000000000000000000000\" = 52\n // - We read the memory word starting at the first character of the marker:\n // - (description + 32) + (len - 52) = description + (len - 20)\n // - Note: Solidity will ignore anything past the first 12 bytes\n marker := mload(add(description, sub(len, 20)))\n }\n\n // If the marker is not found, there is no proposer suffix to check\n if (marker != bytes12(\"#proposer=0x\")) {\n return true;\n }\n\n // Parse the 40 characters following the marker as uint160\n uint160 recovered = 0;\n for (uint256 i = len - 40; i < len; ++i) {\n (bool isHex, uint8 value) = _tryHexToUint(bytes(description)[i]);\n // If any of the characters is not a hex digit, ignore the suffix entirely\n if (!isHex) {\n return true;\n }\n recovered = (recovered << 4) | value;\n }\n\n return recovered == uint160(proposer);\n }\n\n /**\n * @dev Try to parse a character from a string as a hex value. Returns `(true, value)` if the char is in\n * `[0-9a-fA-F]` and `(false, 0)` otherwise. Value is guaranteed to be in the range `0 <= value < 16`\n */\n function _tryHexToUint(bytes1 char) private pure returns (bool isHex, uint8 value) {\n uint8 c = uint8(char);\n unchecked {\n // Case 0-9\n if (47 < c && c < 58) {\n return (true, c - 48);\n }\n // Case A-F\n else if (64 < c && c < 71) {\n return (true, c - 55);\n }\n // Case a-f\n else if (96 < c && c < 103) {\n return (true, c - 87);\n }\n // Else: not a hex char\n else {\n return (false, 0);\n }\n }\n }\n\n /**\n * @inheritdoc IERC6372\n */\n function clock() public view virtual returns (uint48);\n\n /**\n * @inheritdoc IERC6372\n */\n // solhint-disable-next-line func-name-mixedcase\n function CLOCK_MODE() public view virtual returns (string memory);\n\n /**\n * @inheritdoc IGovernor\n */\n function votingDelay() public view virtual returns (uint256);\n\n /**\n * @inheritdoc IGovernor\n */\n function votingPeriod() public view virtual returns (uint256);\n\n /**\n * @inheritdoc IGovernor\n */\n function quorum(uint256 timepoint) public view virtual returns (uint256);\n}\n" + }, + "@openzeppelin/contracts/governance/IGovernor.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (governance/IGovernor.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC165} from \"../interfaces/IERC165.sol\";\nimport {IERC6372} from \"../interfaces/IERC6372.sol\";\n\n/**\n * @dev Interface of the {Governor} core.\n *\n * NOTE: Event parameters lack the `indexed` keyword for compatibility with GovernorBravo events.\n * Making event parameters `indexed` affects how events are decoded, potentially breaking existing indexers.\n */\ninterface IGovernor is IERC165, IERC6372 {\n enum ProposalState {\n Pending,\n Active,\n Canceled,\n Defeated,\n Succeeded,\n Queued,\n Expired,\n Executed\n }\n\n /**\n * @dev Empty proposal or a mismatch between the parameters length for a proposal call.\n */\n error GovernorInvalidProposalLength(uint256 targets, uint256 calldatas, uint256 values);\n\n /**\n * @dev The vote was already cast.\n */\n error GovernorAlreadyCastVote(address voter);\n\n /**\n * @dev Token deposits are disabled in this contract.\n */\n error GovernorDisabledDeposit();\n\n /**\n * @dev The `account` is not a proposer.\n */\n error GovernorOnlyProposer(address account);\n\n /**\n * @dev The `account` is not the governance executor.\n */\n error GovernorOnlyExecutor(address account);\n\n /**\n * @dev The `proposalId` doesn't exist.\n */\n error GovernorNonexistentProposal(uint256 proposalId);\n\n /**\n * @dev The current state of a proposal is not the required for performing an operation.\n * The `expectedStates` is a bitmap with the bits enabled for each ProposalState enum position\n * counting from right to left.\n *\n * NOTE: If `expectedState` is `bytes32(0)`, the proposal is expected to not be in any state (i.e. not exist).\n * This is the case when a proposal that is expected to be unset is already initiated (the proposal is duplicated).\n *\n * See {Governor-_encodeStateBitmap}.\n */\n error GovernorUnexpectedProposalState(uint256 proposalId, ProposalState current, bytes32 expectedStates);\n\n /**\n * @dev The voting period set is not a valid period.\n */\n error GovernorInvalidVotingPeriod(uint256 votingPeriod);\n\n /**\n * @dev The `proposer` does not have the required votes to create a proposal.\n */\n error GovernorInsufficientProposerVotes(address proposer, uint256 votes, uint256 threshold);\n\n /**\n * @dev The `proposer` is not allowed to create a proposal.\n */\n error GovernorRestrictedProposer(address proposer);\n\n /**\n * @dev The vote type used is not valid for the corresponding counting module.\n */\n error GovernorInvalidVoteType();\n\n /**\n * @dev The provided params buffer is not supported by the counting module.\n */\n error GovernorInvalidVoteParams();\n\n /**\n * @dev Queue operation is not implemented for this governor. Execute should be called directly.\n */\n error GovernorQueueNotImplemented();\n\n /**\n * @dev The proposal hasn't been queued yet.\n */\n error GovernorNotQueuedProposal(uint256 proposalId);\n\n /**\n * @dev The proposal has already been queued.\n */\n error GovernorAlreadyQueuedProposal(uint256 proposalId);\n\n /**\n * @dev The provided signature is not valid for the expected `voter`.\n * If the `voter` is a contract, the signature is not valid using {IERC1271-isValidSignature}.\n */\n error GovernorInvalidSignature(address voter);\n\n /**\n * @dev Emitted when a proposal is created.\n */\n event ProposalCreated(\n uint256 proposalId,\n address proposer,\n address[] targets,\n uint256[] values,\n string[] signatures,\n bytes[] calldatas,\n uint256 voteStart,\n uint256 voteEnd,\n string description\n );\n\n /**\n * @dev Emitted when a proposal is queued.\n */\n event ProposalQueued(uint256 proposalId, uint256 etaSeconds);\n\n /**\n * @dev Emitted when a proposal is executed.\n */\n event ProposalExecuted(uint256 proposalId);\n\n /**\n * @dev Emitted when a proposal is canceled.\n */\n event ProposalCanceled(uint256 proposalId);\n\n /**\n * @dev Emitted when a vote is cast without params.\n *\n * Note: `support` values should be seen as buckets. Their interpretation depends on the voting module used.\n */\n event VoteCast(address indexed voter, uint256 proposalId, uint8 support, uint256 weight, string reason);\n\n /**\n * @dev Emitted when a vote is cast with params.\n *\n * Note: `support` values should be seen as buckets. Their interpretation depends on the voting module used.\n * `params` are additional encoded parameters. Their interpretation also depends on the voting module used.\n */\n event VoteCastWithParams(\n address indexed voter,\n uint256 proposalId,\n uint8 support,\n uint256 weight,\n string reason,\n bytes params\n );\n\n /**\n * @notice module:core\n * @dev Name of the governor instance (used in building the EIP-712 domain separator).\n */\n function name() external view returns (string memory);\n\n /**\n * @notice module:core\n * @dev Version of the governor instance (used in building the EIP-712 domain separator). Default: \"1\"\n */\n function version() external view returns (string memory);\n\n /**\n * @notice module:voting\n * @dev A description of the possible `support` values for {castVote} and the way these votes are counted, meant to\n * be consumed by UIs to show correct vote options and interpret the results. The string is a URL-encoded sequence of\n * key-value pairs that each describe one aspect, for example `support=bravo&quorum=for,abstain`.\n *\n * There are 2 standard keys: `support` and `quorum`.\n *\n * - `support=bravo` refers to the vote options 0 = Against, 1 = For, 2 = Abstain, as in `GovernorBravo`.\n * - `quorum=bravo` means that only For votes are counted towards quorum.\n * - `quorum=for,abstain` means that both For and Abstain votes are counted towards quorum.\n *\n * If a counting module makes use of encoded `params`, it should include this under a `params` key with a unique\n * name that describes the behavior. For example:\n *\n * - `params=fractional` might refer to a scheme where votes are divided fractionally between for/against/abstain.\n * - `params=erc721` might refer to a scheme where specific NFTs are delegated to vote.\n *\n * NOTE: The string can be decoded by the standard\n * https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams[`URLSearchParams`]\n * JavaScript class.\n */\n // solhint-disable-next-line func-name-mixedcase\n function COUNTING_MODE() external view returns (string memory);\n\n /**\n * @notice module:core\n * @dev Hashing function used to (re)build the proposal id from the proposal details..\n */\n function hashProposal(\n address[] memory targets,\n uint256[] memory values,\n bytes[] memory calldatas,\n bytes32 descriptionHash\n ) external pure returns (uint256);\n\n /**\n * @notice module:core\n * @dev Current state of a proposal, following Compound's convention\n */\n function state(uint256 proposalId) external view returns (ProposalState);\n\n /**\n * @notice module:core\n * @dev The number of votes required in order for a voter to become a proposer.\n */\n function proposalThreshold() external view returns (uint256);\n\n /**\n * @notice module:core\n * @dev Timepoint used to retrieve user's votes and quorum. If using block number (as per Compound's Comp), the\n * snapshot is performed at the end of this block. Hence, voting for this proposal starts at the beginning of the\n * following block.\n */\n function proposalSnapshot(uint256 proposalId) external view returns (uint256);\n\n /**\n * @notice module:core\n * @dev Timepoint at which votes close. If using block number, votes close at the end of this block, so it is\n * possible to cast a vote during this block.\n */\n function proposalDeadline(uint256 proposalId) external view returns (uint256);\n\n /**\n * @notice module:core\n * @dev The account that created a proposal.\n */\n function proposalProposer(uint256 proposalId) external view returns (address);\n\n /**\n * @notice module:core\n * @dev The time when a queued proposal becomes executable (\"ETA\"). Unlike {proposalSnapshot} and\n * {proposalDeadline}, this doesn't use the governor clock, and instead relies on the executor's clock which may be\n * different. In most cases this will be a timestamp.\n */\n function proposalEta(uint256 proposalId) external view returns (uint256);\n\n /**\n * @notice module:core\n * @dev Whether a proposal needs to be queued before execution.\n */\n function proposalNeedsQueuing(uint256 proposalId) external view returns (bool);\n\n /**\n * @notice module:user-config\n * @dev Delay, between the proposal is created and the vote starts. The unit this duration is expressed in depends\n * on the clock (see ERC-6372) this contract uses.\n *\n * This can be increased to leave time for users to buy voting power, or delegate it, before the voting of a\n * proposal starts.\n *\n * NOTE: While this interface returns a uint256, timepoints are stored as uint48 following the ERC-6372 clock type.\n * Consequently this value must fit in a uint48 (when added to the current clock). See {IERC6372-clock}.\n */\n function votingDelay() external view returns (uint256);\n\n /**\n * @notice module:user-config\n * @dev Delay between the vote start and vote end. The unit this duration is expressed in depends on the clock\n * (see ERC-6372) this contract uses.\n *\n * NOTE: The {votingDelay} can delay the start of the vote. This must be considered when setting the voting\n * duration compared to the voting delay.\n *\n * NOTE: This value is stored when the proposal is submitted so that possible changes to the value do not affect\n * proposals that have already been submitted. The type used to save it is a uint32. Consequently, while this\n * interface returns a uint256, the value it returns should fit in a uint32.\n */\n function votingPeriod() external view returns (uint256);\n\n /**\n * @notice module:user-config\n * @dev Minimum number of cast voted required for a proposal to be successful.\n *\n * NOTE: The `timepoint` parameter corresponds to the snapshot used for counting vote. This allows to scale the\n * quorum depending on values such as the totalSupply of a token at this timepoint (see {ERC20Votes}).\n */\n function quorum(uint256 timepoint) external view returns (uint256);\n\n /**\n * @notice module:reputation\n * @dev Voting power of an `account` at a specific `timepoint`.\n *\n * Note: this can be implemented in a number of ways, for example by reading the delegated balance from one (or\n * multiple), {ERC20Votes} tokens.\n */\n function getVotes(address account, uint256 timepoint) external view returns (uint256);\n\n /**\n * @notice module:reputation\n * @dev Voting power of an `account` at a specific `timepoint` given additional encoded parameters.\n */\n function getVotesWithParams(\n address account,\n uint256 timepoint,\n bytes memory params\n ) external view returns (uint256);\n\n /**\n * @notice module:voting\n * @dev Returns whether `account` has cast a vote on `proposalId`.\n */\n function hasVoted(uint256 proposalId, address account) external view returns (bool);\n\n /**\n * @dev Create a new proposal. Vote start after a delay specified by {IGovernor-votingDelay} and lasts for a\n * duration specified by {IGovernor-votingPeriod}.\n *\n * Emits a {ProposalCreated} event.\n *\n * NOTE: The state of the Governor and `targets` may change between the proposal creation and its execution.\n * This may be the result of third party actions on the targeted contracts, or other governor proposals.\n * For example, the balance of this contract could be updated or its access control permissions may be modified,\n * possibly compromising the proposal's ability to execute successfully (e.g. the governor doesn't have enough\n * value to cover a proposal with multiple transfers).\n */\n function propose(\n address[] memory targets,\n uint256[] memory values,\n bytes[] memory calldatas,\n string memory description\n ) external returns (uint256 proposalId);\n\n /**\n * @dev Queue a proposal. Some governors require this step to be performed before execution can happen. If queuing\n * is not necessary, this function may revert.\n * Queuing a proposal requires the quorum to be reached, the vote to be successful, and the deadline to be reached.\n *\n * Emits a {ProposalQueued} event.\n */\n function queue(\n address[] memory targets,\n uint256[] memory values,\n bytes[] memory calldatas,\n bytes32 descriptionHash\n ) external returns (uint256 proposalId);\n\n /**\n * @dev Execute a successful proposal. This requires the quorum to be reached, the vote to be successful, and the\n * deadline to be reached. Depending on the governor it might also be required that the proposal was queued and\n * that some delay passed.\n *\n * Emits a {ProposalExecuted} event.\n *\n * NOTE: Some modules can modify the requirements for execution, for example by adding an additional timelock.\n */\n function execute(\n address[] memory targets,\n uint256[] memory values,\n bytes[] memory calldatas,\n bytes32 descriptionHash\n ) external payable returns (uint256 proposalId);\n\n /**\n * @dev Cancel a proposal. A proposal is cancellable by the proposer, but only while it is Pending state, i.e.\n * before the vote starts.\n *\n * Emits a {ProposalCanceled} event.\n */\n function cancel(\n address[] memory targets,\n uint256[] memory values,\n bytes[] memory calldatas,\n bytes32 descriptionHash\n ) external returns (uint256 proposalId);\n\n /**\n * @dev Cast a vote\n *\n * Emits a {VoteCast} event.\n */\n function castVote(uint256 proposalId, uint8 support) external returns (uint256 balance);\n\n /**\n * @dev Cast a vote with a reason\n *\n * Emits a {VoteCast} event.\n */\n function castVoteWithReason(\n uint256 proposalId,\n uint8 support,\n string calldata reason\n ) external returns (uint256 balance);\n\n /**\n * @dev Cast a vote with a reason and additional encoded parameters\n *\n * Emits a {VoteCast} or {VoteCastWithParams} event depending on the length of params.\n */\n function castVoteWithReasonAndParams(\n uint256 proposalId,\n uint8 support,\n string calldata reason,\n bytes memory params\n ) external returns (uint256 balance);\n\n /**\n * @dev Cast a vote using the voter's signature, including ERC-1271 signature support.\n *\n * Emits a {VoteCast} event.\n */\n function castVoteBySig(\n uint256 proposalId,\n uint8 support,\n address voter,\n bytes memory signature\n ) external returns (uint256 balance);\n\n /**\n * @dev Cast a vote with a reason and additional encoded parameters using the voter's signature,\n * including ERC-1271 signature support.\n *\n * Emits a {VoteCast} or {VoteCastWithParams} event depending on the length of params.\n */\n function castVoteWithReasonAndParamsBySig(\n uint256 proposalId,\n uint8 support,\n address voter,\n string calldata reason,\n bytes memory params,\n bytes memory signature\n ) external returns (uint256 balance);\n}\n" + }, + "@openzeppelin/contracts/governance/utils/IVotes.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (governance/utils/IVotes.sol)\npragma solidity ^0.8.20;\n\n/**\n * @dev Common interface for {ERC20Votes}, {ERC721Votes}, and other {Votes}-enabled contracts.\n */\ninterface IVotes {\n /**\n * @dev The signature used has expired.\n */\n error VotesExpiredSignature(uint256 expiry);\n\n /**\n * @dev Emitted when an account changes their delegate.\n */\n event DelegateChanged(address indexed delegator, address indexed fromDelegate, address indexed toDelegate);\n\n /**\n * @dev Emitted when a token transfer or delegate change results in changes to a delegate's number of voting units.\n */\n event DelegateVotesChanged(address indexed delegate, uint256 previousVotes, uint256 newVotes);\n\n /**\n * @dev Returns the current amount of votes that `account` has.\n */\n function getVotes(address account) external view returns (uint256);\n\n /**\n * @dev Returns the amount of votes that `account` had at a specific moment in the past. If the `clock()` is\n * configured to use block numbers, this will return the value at the end of the corresponding block.\n */\n function getPastVotes(address account, uint256 timepoint) external view returns (uint256);\n\n /**\n * @dev Returns the total supply of votes available at a specific moment in the past. If the `clock()` is\n * configured to use block numbers, this will return the value at the end of the corresponding block.\n *\n * NOTE: This value is the sum of all available votes, which is not necessarily the sum of all delegated votes.\n * Votes that have not been delegated are still part of total supply, even though they would not participate in a\n * vote.\n */\n function getPastTotalSupply(uint256 timepoint) external view returns (uint256);\n\n /**\n * @dev Returns the delegate that `account` has chosen.\n */\n function delegates(address account) external view returns (address);\n\n /**\n * @dev Delegates votes from the sender to `delegatee`.\n */\n function delegate(address delegatee) external;\n\n /**\n * @dev Delegates votes from signer to `delegatee`.\n */\n function delegateBySig(address delegatee, uint256 nonce, uint256 expiry, uint8 v, bytes32 r, bytes32 s) external;\n}\n" + }, + "@openzeppelin/contracts/governance/utils/Votes.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (governance/utils/Votes.sol)\npragma solidity ^0.8.20;\n\nimport {IERC5805} from \"../../interfaces/IERC5805.sol\";\nimport {Context} from \"../../utils/Context.sol\";\nimport {Nonces} from \"../../utils/Nonces.sol\";\nimport {EIP712} from \"../../utils/cryptography/EIP712.sol\";\nimport {Checkpoints} from \"../../utils/structs/Checkpoints.sol\";\nimport {SafeCast} from \"../../utils/math/SafeCast.sol\";\nimport {ECDSA} from \"../../utils/cryptography/ECDSA.sol\";\nimport {Time} from \"../../utils/types/Time.sol\";\n\n/**\n * @dev This is a base abstract contract that tracks voting units, which are a measure of voting power that can be\n * transferred, and provides a system of vote delegation, where an account can delegate its voting units to a sort of\n * \"representative\" that will pool delegated voting units from different accounts and can then use it to vote in\n * decisions. In fact, voting units _must_ be delegated in order to count as actual votes, and an account has to\n * delegate those votes to itself if it wishes to participate in decisions and does not have a trusted representative.\n *\n * This contract is often combined with a token contract such that voting units correspond to token units. For an\n * example, see {ERC721Votes}.\n *\n * The full history of delegate votes is tracked on-chain so that governance protocols can consider votes as distributed\n * at a particular block number to protect against flash loans and double voting. The opt-in delegate system makes the\n * cost of this history tracking optional.\n *\n * When using this module the derived contract must implement {_getVotingUnits} (for example, make it return\n * {ERC721-balanceOf}), and can use {_transferVotingUnits} to track a change in the distribution of those units (in the\n * previous example, it would be included in {ERC721-_update}).\n */\nabstract contract Votes is Context, EIP712, Nonces, IERC5805 {\n using Checkpoints for Checkpoints.Trace208;\n\n bytes32 private constant DELEGATION_TYPEHASH =\n keccak256(\"Delegation(address delegatee,uint256 nonce,uint256 expiry)\");\n\n mapping(address account => address) private _delegatee;\n\n mapping(address delegatee => Checkpoints.Trace208) private _delegateCheckpoints;\n\n Checkpoints.Trace208 private _totalCheckpoints;\n\n /**\n * @dev The clock was incorrectly modified.\n */\n error ERC6372InconsistentClock();\n\n /**\n * @dev Lookup to future votes is not available.\n */\n error ERC5805FutureLookup(uint256 timepoint, uint48 clock);\n\n /**\n * @dev Clock used for flagging checkpoints. Can be overridden to implement timestamp based\n * checkpoints (and voting), in which case {CLOCK_MODE} should be overridden as well to match.\n */\n function clock() public view virtual returns (uint48) {\n return Time.blockNumber();\n }\n\n /**\n * @dev Machine-readable description of the clock as specified in ERC-6372.\n */\n // solhint-disable-next-line func-name-mixedcase\n function CLOCK_MODE() public view virtual returns (string memory) {\n // Check that the clock was not modified\n if (clock() != Time.blockNumber()) {\n revert ERC6372InconsistentClock();\n }\n return \"mode=blocknumber&from=default\";\n }\n\n /**\n * @dev Returns the current amount of votes that `account` has.\n */\n function getVotes(address account) public view virtual returns (uint256) {\n return _delegateCheckpoints[account].latest();\n }\n\n /**\n * @dev Returns the amount of votes that `account` had at a specific moment in the past. If the `clock()` is\n * configured to use block numbers, this will return the value at the end of the corresponding block.\n *\n * Requirements:\n *\n * - `timepoint` must be in the past. If operating using block numbers, the block must be already mined.\n */\n function getPastVotes(address account, uint256 timepoint) public view virtual returns (uint256) {\n uint48 currentTimepoint = clock();\n if (timepoint >= currentTimepoint) {\n revert ERC5805FutureLookup(timepoint, currentTimepoint);\n }\n return _delegateCheckpoints[account].upperLookupRecent(SafeCast.toUint48(timepoint));\n }\n\n /**\n * @dev Returns the total supply of votes available at a specific moment in the past. If the `clock()` is\n * configured to use block numbers, this will return the value at the end of the corresponding block.\n *\n * NOTE: This value is the sum of all available votes, which is not necessarily the sum of all delegated votes.\n * Votes that have not been delegated are still part of total supply, even though they would not participate in a\n * vote.\n *\n * Requirements:\n *\n * - `timepoint` must be in the past. If operating using block numbers, the block must be already mined.\n */\n function getPastTotalSupply(uint256 timepoint) public view virtual returns (uint256) {\n uint48 currentTimepoint = clock();\n if (timepoint >= currentTimepoint) {\n revert ERC5805FutureLookup(timepoint, currentTimepoint);\n }\n return _totalCheckpoints.upperLookupRecent(SafeCast.toUint48(timepoint));\n }\n\n /**\n * @dev Returns the current total supply of votes.\n */\n function _getTotalSupply() internal view virtual returns (uint256) {\n return _totalCheckpoints.latest();\n }\n\n /**\n * @dev Returns the delegate that `account` has chosen.\n */\n function delegates(address account) public view virtual returns (address) {\n return _delegatee[account];\n }\n\n /**\n * @dev Delegates votes from the sender to `delegatee`.\n */\n function delegate(address delegatee) public virtual {\n address account = _msgSender();\n _delegate(account, delegatee);\n }\n\n /**\n * @dev Delegates votes from signer to `delegatee`.\n */\n function delegateBySig(\n address delegatee,\n uint256 nonce,\n uint256 expiry,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) public virtual {\n if (block.timestamp > expiry) {\n revert VotesExpiredSignature(expiry);\n }\n address signer = ECDSA.recover(\n _hashTypedDataV4(keccak256(abi.encode(DELEGATION_TYPEHASH, delegatee, nonce, expiry))),\n v,\n r,\n s\n );\n _useCheckedNonce(signer, nonce);\n _delegate(signer, delegatee);\n }\n\n /**\n * @dev Delegate all of `account`'s voting units to `delegatee`.\n *\n * Emits events {IVotes-DelegateChanged} and {IVotes-DelegateVotesChanged}.\n */\n function _delegate(address account, address delegatee) internal virtual {\n address oldDelegate = delegates(account);\n _delegatee[account] = delegatee;\n\n emit DelegateChanged(account, oldDelegate, delegatee);\n _moveDelegateVotes(oldDelegate, delegatee, _getVotingUnits(account));\n }\n\n /**\n * @dev Transfers, mints, or burns voting units. To register a mint, `from` should be zero. To register a burn, `to`\n * should be zero. Total supply of voting units will be adjusted with mints and burns.\n */\n function _transferVotingUnits(address from, address to, uint256 amount) internal virtual {\n if (from == address(0)) {\n _push(_totalCheckpoints, _add, SafeCast.toUint208(amount));\n }\n if (to == address(0)) {\n _push(_totalCheckpoints, _subtract, SafeCast.toUint208(amount));\n }\n _moveDelegateVotes(delegates(from), delegates(to), amount);\n }\n\n /**\n * @dev Moves delegated votes from one delegate to another.\n */\n function _moveDelegateVotes(address from, address to, uint256 amount) internal virtual {\n if (from != to && amount > 0) {\n if (from != address(0)) {\n (uint256 oldValue, uint256 newValue) = _push(\n _delegateCheckpoints[from],\n _subtract,\n SafeCast.toUint208(amount)\n );\n emit DelegateVotesChanged(from, oldValue, newValue);\n }\n if (to != address(0)) {\n (uint256 oldValue, uint256 newValue) = _push(\n _delegateCheckpoints[to],\n _add,\n SafeCast.toUint208(amount)\n );\n emit DelegateVotesChanged(to, oldValue, newValue);\n }\n }\n }\n\n /**\n * @dev Get number of checkpoints for `account`.\n */\n function _numCheckpoints(address account) internal view virtual returns (uint32) {\n return SafeCast.toUint32(_delegateCheckpoints[account].length());\n }\n\n /**\n * @dev Get the `pos`-th checkpoint for `account`.\n */\n function _checkpoints(\n address account,\n uint32 pos\n ) internal view virtual returns (Checkpoints.Checkpoint208 memory) {\n return _delegateCheckpoints[account].at(pos);\n }\n\n function _push(\n Checkpoints.Trace208 storage store,\n function(uint208, uint208) view returns (uint208) op,\n uint208 delta\n ) private returns (uint208 oldValue, uint208 newValue) {\n return store.push(clock(), op(store.latest(), delta));\n }\n\n function _add(uint208 a, uint208 b) private pure returns (uint208) {\n return a + b;\n }\n\n function _subtract(uint208 a, uint208 b) private pure returns (uint208) {\n return a - b;\n }\n\n /**\n * @dev Must return the voting units held by an account.\n */\n function _getVotingUnits(address) internal view virtual returns (uint256);\n}\n" + }, + "@openzeppelin/contracts/interfaces/draft-IERC6093.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (interfaces/draft-IERC6093.sol)\npragma solidity ^0.8.20;\n\n/**\n * @dev Standard ERC-20 Errors\n * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC-20 tokens.\n */\ninterface IERC20Errors {\n /**\n * @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers.\n * @param sender Address whose tokens are being transferred.\n * @param balance Current balance for the interacting account.\n * @param needed Minimum amount required to perform a transfer.\n */\n error ERC20InsufficientBalance(address sender, uint256 balance, uint256 needed);\n\n /**\n * @dev Indicates a failure with the token `sender`. Used in transfers.\n * @param sender Address whose tokens are being transferred.\n */\n error ERC20InvalidSender(address sender);\n\n /**\n * @dev Indicates a failure with the token `receiver`. Used in transfers.\n * @param receiver Address to which tokens are being transferred.\n */\n error ERC20InvalidReceiver(address receiver);\n\n /**\n * @dev Indicates a failure with the `spender`’s `allowance`. Used in transfers.\n * @param spender Address that may be allowed to operate on tokens without being their owner.\n * @param allowance Amount of tokens a `spender` is allowed to operate with.\n * @param needed Minimum amount required to perform a transfer.\n */\n error ERC20InsufficientAllowance(address spender, uint256 allowance, uint256 needed);\n\n /**\n * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.\n * @param approver Address initiating an approval operation.\n */\n error ERC20InvalidApprover(address approver);\n\n /**\n * @dev Indicates a failure with the `spender` to be approved. Used in approvals.\n * @param spender Address that may be allowed to operate on tokens without being their owner.\n */\n error ERC20InvalidSpender(address spender);\n}\n\n/**\n * @dev Standard ERC-721 Errors\n * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC-721 tokens.\n */\ninterface IERC721Errors {\n /**\n * @dev Indicates that an address can't be an owner. For example, `address(0)` is a forbidden owner in ERC-20.\n * Used in balance queries.\n * @param owner Address of the current owner of a token.\n */\n error ERC721InvalidOwner(address owner);\n\n /**\n * @dev Indicates a `tokenId` whose `owner` is the zero address.\n * @param tokenId Identifier number of a token.\n */\n error ERC721NonexistentToken(uint256 tokenId);\n\n /**\n * @dev Indicates an error related to the ownership over a particular token. Used in transfers.\n * @param sender Address whose tokens are being transferred.\n * @param tokenId Identifier number of a token.\n * @param owner Address of the current owner of a token.\n */\n error ERC721IncorrectOwner(address sender, uint256 tokenId, address owner);\n\n /**\n * @dev Indicates a failure with the token `sender`. Used in transfers.\n * @param sender Address whose tokens are being transferred.\n */\n error ERC721InvalidSender(address sender);\n\n /**\n * @dev Indicates a failure with the token `receiver`. Used in transfers.\n * @param receiver Address to which tokens are being transferred.\n */\n error ERC721InvalidReceiver(address receiver);\n\n /**\n * @dev Indicates a failure with the `operator`’s approval. Used in transfers.\n * @param operator Address that may be allowed to operate on tokens without being their owner.\n * @param tokenId Identifier number of a token.\n */\n error ERC721InsufficientApproval(address operator, uint256 tokenId);\n\n /**\n * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.\n * @param approver Address initiating an approval operation.\n */\n error ERC721InvalidApprover(address approver);\n\n /**\n * @dev Indicates a failure with the `operator` to be approved. Used in approvals.\n * @param operator Address that may be allowed to operate on tokens without being their owner.\n */\n error ERC721InvalidOperator(address operator);\n}\n\n/**\n * @dev Standard ERC-1155 Errors\n * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC-1155 tokens.\n */\ninterface IERC1155Errors {\n /**\n * @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers.\n * @param sender Address whose tokens are being transferred.\n * @param balance Current balance for the interacting account.\n * @param needed Minimum amount required to perform a transfer.\n * @param tokenId Identifier number of a token.\n */\n error ERC1155InsufficientBalance(address sender, uint256 balance, uint256 needed, uint256 tokenId);\n\n /**\n * @dev Indicates a failure with the token `sender`. Used in transfers.\n * @param sender Address whose tokens are being transferred.\n */\n error ERC1155InvalidSender(address sender);\n\n /**\n * @dev Indicates a failure with the token `receiver`. Used in transfers.\n * @param receiver Address to which tokens are being transferred.\n */\n error ERC1155InvalidReceiver(address receiver);\n\n /**\n * @dev Indicates a failure with the `operator`’s approval. Used in transfers.\n * @param operator Address that may be allowed to operate on tokens without being their owner.\n * @param owner Address of the current owner of a token.\n */\n error ERC1155MissingApprovalForAll(address operator, address owner);\n\n /**\n * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.\n * @param approver Address initiating an approval operation.\n */\n error ERC1155InvalidApprover(address approver);\n\n /**\n * @dev Indicates a failure with the `operator` to be approved. Used in approvals.\n * @param operator Address that may be allowed to operate on tokens without being their owner.\n */\n error ERC1155InvalidOperator(address operator);\n\n /**\n * @dev Indicates an array length mismatch between ids and values in a safeBatchTransferFrom operation.\n * Used in batch transfers.\n * @param idsLength Length of the array of token identifiers\n * @param valuesLength Length of the array of token amounts\n */\n error ERC1155InvalidArrayLength(uint256 idsLength, uint256 valuesLength);\n}\n" + }, + "@openzeppelin/contracts/interfaces/IERC1271.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (interfaces/IERC1271.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Interface of the ERC-1271 standard signature validation method for\n * contracts as defined in https://eips.ethereum.org/EIPS/eip-1271[ERC-1271].\n */\ninterface IERC1271 {\n /**\n * @dev Should return whether the signature provided is valid for the provided data\n * @param hash Hash of the data to be signed\n * @param signature Signature byte array associated with _data\n */\n function isValidSignature(bytes32 hash, bytes memory signature) external view returns (bytes4 magicValue);\n}\n" + }, + "@openzeppelin/contracts/interfaces/IERC165.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC165.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC165} from \"../utils/introspection/IERC165.sol\";\n" + }, + "@openzeppelin/contracts/interfaces/IERC4906.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (interfaces/IERC4906.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC165} from \"./IERC165.sol\";\nimport {IERC721} from \"./IERC721.sol\";\n\n/// @title ERC-721 Metadata Update Extension\ninterface IERC4906 is IERC165, IERC721 {\n /// @dev This event emits when the metadata of a token is changed.\n /// So that the third-party platforms such as NFT market could\n /// timely update the images and related attributes of the NFT.\n event MetadataUpdate(uint256 _tokenId);\n\n /// @dev This event emits when the metadata of a range of tokens is changed.\n /// So that the third-party platforms such as NFT market could\n /// timely update the images and related attributes of the NFTs.\n event BatchMetadataUpdate(uint256 _fromTokenId, uint256 _toTokenId);\n}\n" + }, + "@openzeppelin/contracts/interfaces/IERC5267.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC5267.sol)\n\npragma solidity ^0.8.20;\n\ninterface IERC5267 {\n /**\n * @dev MAY be emitted to signal that the domain could have changed.\n */\n event EIP712DomainChanged();\n\n /**\n * @dev returns the fields and values that describe the domain separator used by this contract for EIP-712\n * signature.\n */\n function eip712Domain()\n external\n view\n returns (\n bytes1 fields,\n string memory name,\n string memory version,\n uint256 chainId,\n address verifyingContract,\n bytes32 salt,\n uint256[] memory extensions\n );\n}\n" + }, + "@openzeppelin/contracts/interfaces/IERC5805.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC5805.sol)\n\npragma solidity ^0.8.20;\n\nimport {IVotes} from \"../governance/utils/IVotes.sol\";\nimport {IERC6372} from \"./IERC6372.sol\";\n\ninterface IERC5805 is IERC6372, IVotes {}\n" + }, + "@openzeppelin/contracts/interfaces/IERC6372.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC6372.sol)\n\npragma solidity ^0.8.20;\n\ninterface IERC6372 {\n /**\n * @dev Clock used for flagging checkpoints. Can be overridden to implement timestamp based checkpoints (and voting).\n */\n function clock() external view returns (uint48);\n\n /**\n * @dev Description of the clock\n */\n // solhint-disable-next-line func-name-mixedcase\n function CLOCK_MODE() external view returns (string memory);\n}\n" + }, + "@openzeppelin/contracts/interfaces/IERC721.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC721.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC721} from \"../token/ERC721/IERC721.sol\";\n" + }, + "@openzeppelin/contracts/token/ERC1155/IERC1155Receiver.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC1155/IERC1155Receiver.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC165} from \"../../utils/introspection/IERC165.sol\";\n\n/**\n * @dev Interface that must be implemented by smart contracts in order to receive\n * ERC-1155 token transfers.\n */\ninterface IERC1155Receiver is IERC165 {\n /**\n * @dev Handles the receipt of a single ERC-1155 token type. This function is\n * called at the end of a `safeTransferFrom` after the balance has been updated.\n *\n * NOTE: To accept the transfer, this must return\n * `bytes4(keccak256(\"onERC1155Received(address,address,uint256,uint256,bytes)\"))`\n * (i.e. 0xf23a6e61, or its own function selector).\n *\n * @param operator The address which initiated the transfer (i.e. msg.sender)\n * @param from The address which previously owned the token\n * @param id The ID of the token being transferred\n * @param value The amount of tokens being transferred\n * @param data Additional data with no specified format\n * @return `bytes4(keccak256(\"onERC1155Received(address,address,uint256,uint256,bytes)\"))` if transfer is allowed\n */\n function onERC1155Received(\n address operator,\n address from,\n uint256 id,\n uint256 value,\n bytes calldata data\n ) external returns (bytes4);\n\n /**\n * @dev Handles the receipt of a multiple ERC-1155 token types. This function\n * is called at the end of a `safeBatchTransferFrom` after the balances have\n * been updated.\n *\n * NOTE: To accept the transfer(s), this must return\n * `bytes4(keccak256(\"onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)\"))`\n * (i.e. 0xbc197c81, or its own function selector).\n *\n * @param operator The address which initiated the batch transfer (i.e. msg.sender)\n * @param from The address which previously owned the token\n * @param ids An array containing ids of each token being transferred (order and length must match values array)\n * @param values An array containing amounts of each token being transferred (order and length must match ids array)\n * @param data Additional data with no specified format\n * @return `bytes4(keccak256(\"onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)\"))` if transfer is allowed\n */\n function onERC1155BatchReceived(\n address operator,\n address from,\n uint256[] calldata ids,\n uint256[] calldata values,\n bytes calldata data\n ) external returns (bytes4);\n}\n" + }, + "@openzeppelin/contracts/token/ERC721/ERC721.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC721/ERC721.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC721} from \"./IERC721.sol\";\nimport {IERC721Metadata} from \"./extensions/IERC721Metadata.sol\";\nimport {ERC721Utils} from \"./utils/ERC721Utils.sol\";\nimport {Context} from \"../../utils/Context.sol\";\nimport {Strings} from \"../../utils/Strings.sol\";\nimport {IERC165, ERC165} from \"../../utils/introspection/ERC165.sol\";\nimport {IERC721Errors} from \"../../interfaces/draft-IERC6093.sol\";\n\n/**\n * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC-721] Non-Fungible Token Standard, including\n * the Metadata extension, but not including the Enumerable extension, which is available separately as\n * {ERC721Enumerable}.\n */\nabstract contract ERC721 is Context, ERC165, IERC721, IERC721Metadata, IERC721Errors {\n using Strings for uint256;\n\n // Token name\n string private _name;\n\n // Token symbol\n string private _symbol;\n\n mapping(uint256 tokenId => address) private _owners;\n\n mapping(address owner => uint256) private _balances;\n\n mapping(uint256 tokenId => address) private _tokenApprovals;\n\n mapping(address owner => mapping(address operator => bool)) private _operatorApprovals;\n\n /**\n * @dev Initializes the contract by setting a `name` and a `symbol` to the token collection.\n */\n constructor(string memory name_, string memory symbol_) {\n _name = name_;\n _symbol = symbol_;\n }\n\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {\n return\n interfaceId == type(IERC721).interfaceId ||\n interfaceId == type(IERC721Metadata).interfaceId ||\n super.supportsInterface(interfaceId);\n }\n\n /**\n * @dev See {IERC721-balanceOf}.\n */\n function balanceOf(address owner) public view virtual returns (uint256) {\n if (owner == address(0)) {\n revert ERC721InvalidOwner(address(0));\n }\n return _balances[owner];\n }\n\n /**\n * @dev See {IERC721-ownerOf}.\n */\n function ownerOf(uint256 tokenId) public view virtual returns (address) {\n return _requireOwned(tokenId);\n }\n\n /**\n * @dev See {IERC721Metadata-name}.\n */\n function name() public view virtual returns (string memory) {\n return _name;\n }\n\n /**\n * @dev See {IERC721Metadata-symbol}.\n */\n function symbol() public view virtual returns (string memory) {\n return _symbol;\n }\n\n /**\n * @dev See {IERC721Metadata-tokenURI}.\n */\n function tokenURI(uint256 tokenId) public view virtual returns (string memory) {\n _requireOwned(tokenId);\n\n string memory baseURI = _baseURI();\n return bytes(baseURI).length > 0 ? string.concat(baseURI, tokenId.toString()) : \"\";\n }\n\n /**\n * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each\n * token will be the concatenation of the `baseURI` and the `tokenId`. Empty\n * by default, can be overridden in child contracts.\n */\n function _baseURI() internal view virtual returns (string memory) {\n return \"\";\n }\n\n /**\n * @dev See {IERC721-approve}.\n */\n function approve(address to, uint256 tokenId) public virtual {\n _approve(to, tokenId, _msgSender());\n }\n\n /**\n * @dev See {IERC721-getApproved}.\n */\n function getApproved(uint256 tokenId) public view virtual returns (address) {\n _requireOwned(tokenId);\n\n return _getApproved(tokenId);\n }\n\n /**\n * @dev See {IERC721-setApprovalForAll}.\n */\n function setApprovalForAll(address operator, bool approved) public virtual {\n _setApprovalForAll(_msgSender(), operator, approved);\n }\n\n /**\n * @dev See {IERC721-isApprovedForAll}.\n */\n function isApprovedForAll(address owner, address operator) public view virtual returns (bool) {\n return _operatorApprovals[owner][operator];\n }\n\n /**\n * @dev See {IERC721-transferFrom}.\n */\n function transferFrom(address from, address to, uint256 tokenId) public virtual {\n if (to == address(0)) {\n revert ERC721InvalidReceiver(address(0));\n }\n // Setting an \"auth\" arguments enables the `_isAuthorized` check which verifies that the token exists\n // (from != 0). Therefore, it is not needed to verify that the return value is not 0 here.\n address previousOwner = _update(to, tokenId, _msgSender());\n if (previousOwner != from) {\n revert ERC721IncorrectOwner(from, tokenId, previousOwner);\n }\n }\n\n /**\n * @dev See {IERC721-safeTransferFrom}.\n */\n function safeTransferFrom(address from, address to, uint256 tokenId) public {\n safeTransferFrom(from, to, tokenId, \"\");\n }\n\n /**\n * @dev See {IERC721-safeTransferFrom}.\n */\n function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory data) public virtual {\n transferFrom(from, to, tokenId);\n ERC721Utils.checkOnERC721Received(_msgSender(), from, to, tokenId, data);\n }\n\n /**\n * @dev Returns the owner of the `tokenId`. Does NOT revert if token doesn't exist\n *\n * IMPORTANT: Any overrides to this function that add ownership of tokens not tracked by the\n * core ERC-721 logic MUST be matched with the use of {_increaseBalance} to keep balances\n * consistent with ownership. The invariant to preserve is that for any address `a` the value returned by\n * `balanceOf(a)` must be equal to the number of tokens such that `_ownerOf(tokenId)` is `a`.\n */\n function _ownerOf(uint256 tokenId) internal view virtual returns (address) {\n return _owners[tokenId];\n }\n\n /**\n * @dev Returns the approved address for `tokenId`. Returns 0 if `tokenId` is not minted.\n */\n function _getApproved(uint256 tokenId) internal view virtual returns (address) {\n return _tokenApprovals[tokenId];\n }\n\n /**\n * @dev Returns whether `spender` is allowed to manage `owner`'s tokens, or `tokenId` in\n * particular (ignoring whether it is owned by `owner`).\n *\n * WARNING: This function assumes that `owner` is the actual owner of `tokenId` and does not verify this\n * assumption.\n */\n function _isAuthorized(address owner, address spender, uint256 tokenId) internal view virtual returns (bool) {\n return\n spender != address(0) &&\n (owner == spender || isApprovedForAll(owner, spender) || _getApproved(tokenId) == spender);\n }\n\n /**\n * @dev Checks if `spender` can operate on `tokenId`, assuming the provided `owner` is the actual owner.\n * Reverts if:\n * - `spender` does not have approval from `owner` for `tokenId`.\n * - `spender` does not have approval to manage all of `owner`'s assets.\n *\n * WARNING: This function assumes that `owner` is the actual owner of `tokenId` and does not verify this\n * assumption.\n */\n function _checkAuthorized(address owner, address spender, uint256 tokenId) internal view virtual {\n if (!_isAuthorized(owner, spender, tokenId)) {\n if (owner == address(0)) {\n revert ERC721NonexistentToken(tokenId);\n } else {\n revert ERC721InsufficientApproval(spender, tokenId);\n }\n }\n }\n\n /**\n * @dev Unsafe write access to the balances, used by extensions that \"mint\" tokens using an {ownerOf} override.\n *\n * NOTE: the value is limited to type(uint128).max. This protect against _balance overflow. It is unrealistic that\n * a uint256 would ever overflow from increments when these increments are bounded to uint128 values.\n *\n * WARNING: Increasing an account's balance using this function tends to be paired with an override of the\n * {_ownerOf} function to resolve the ownership of the corresponding tokens so that balances and ownership\n * remain consistent with one another.\n */\n function _increaseBalance(address account, uint128 value) internal virtual {\n unchecked {\n _balances[account] += value;\n }\n }\n\n /**\n * @dev Transfers `tokenId` from its current owner to `to`, or alternatively mints (or burns) if the current owner\n * (or `to`) is the zero address. Returns the owner of the `tokenId` before the update.\n *\n * The `auth` argument is optional. If the value passed is non 0, then this function will check that\n * `auth` is either the owner of the token, or approved to operate on the token (by the owner).\n *\n * Emits a {Transfer} event.\n *\n * NOTE: If overriding this function in a way that tracks balances, see also {_increaseBalance}.\n */\n function _update(address to, uint256 tokenId, address auth) internal virtual returns (address) {\n address from = _ownerOf(tokenId);\n\n // Perform (optional) operator check\n if (auth != address(0)) {\n _checkAuthorized(from, auth, tokenId);\n }\n\n // Execute the update\n if (from != address(0)) {\n // Clear approval. No need to re-authorize or emit the Approval event\n _approve(address(0), tokenId, address(0), false);\n\n unchecked {\n _balances[from] -= 1;\n }\n }\n\n if (to != address(0)) {\n unchecked {\n _balances[to] += 1;\n }\n }\n\n _owners[tokenId] = to;\n\n emit Transfer(from, to, tokenId);\n\n return from;\n }\n\n /**\n * @dev Mints `tokenId` and transfers it to `to`.\n *\n * WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible\n *\n * Requirements:\n *\n * - `tokenId` must not exist.\n * - `to` cannot be the zero address.\n *\n * Emits a {Transfer} event.\n */\n function _mint(address to, uint256 tokenId) internal {\n if (to == address(0)) {\n revert ERC721InvalidReceiver(address(0));\n }\n address previousOwner = _update(to, tokenId, address(0));\n if (previousOwner != address(0)) {\n revert ERC721InvalidSender(address(0));\n }\n }\n\n /**\n * @dev Mints `tokenId`, transfers it to `to` and checks for `to` acceptance.\n *\n * Requirements:\n *\n * - `tokenId` must not exist.\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\n *\n * Emits a {Transfer} event.\n */\n function _safeMint(address to, uint256 tokenId) internal {\n _safeMint(to, tokenId, \"\");\n }\n\n /**\n * @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is\n * forwarded in {IERC721Receiver-onERC721Received} to contract recipients.\n */\n function _safeMint(address to, uint256 tokenId, bytes memory data) internal virtual {\n _mint(to, tokenId);\n ERC721Utils.checkOnERC721Received(_msgSender(), address(0), to, tokenId, data);\n }\n\n /**\n * @dev Destroys `tokenId`.\n * The approval is cleared when the token is burned.\n * This is an internal function that does not check if the sender is authorized to operate on the token.\n *\n * Requirements:\n *\n * - `tokenId` must exist.\n *\n * Emits a {Transfer} event.\n */\n function _burn(uint256 tokenId) internal {\n address previousOwner = _update(address(0), tokenId, address(0));\n if (previousOwner == address(0)) {\n revert ERC721NonexistentToken(tokenId);\n }\n }\n\n /**\n * @dev Transfers `tokenId` from `from` to `to`.\n * As opposed to {transferFrom}, this imposes no restrictions on msg.sender.\n *\n * Requirements:\n *\n * - `to` cannot be the zero address.\n * - `tokenId` token must be owned by `from`.\n *\n * Emits a {Transfer} event.\n */\n function _transfer(address from, address to, uint256 tokenId) internal {\n if (to == address(0)) {\n revert ERC721InvalidReceiver(address(0));\n }\n address previousOwner = _update(to, tokenId, address(0));\n if (previousOwner == address(0)) {\n revert ERC721NonexistentToken(tokenId);\n } else if (previousOwner != from) {\n revert ERC721IncorrectOwner(from, tokenId, previousOwner);\n }\n }\n\n /**\n * @dev Safely transfers `tokenId` token from `from` to `to`, checking that contract recipients\n * are aware of the ERC-721 standard to prevent tokens from being forever locked.\n *\n * `data` is additional data, it has no specified format and it is sent in call to `to`.\n *\n * This internal function is like {safeTransferFrom} in the sense that it invokes\n * {IERC721Receiver-onERC721Received} on the receiver, and can be used to e.g.\n * implement alternative mechanisms to perform token transfer, such as signature-based.\n *\n * Requirements:\n *\n * - `tokenId` token must exist and be owned by `from`.\n * - `to` cannot be the zero address.\n * - `from` cannot be the zero address.\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\n *\n * Emits a {Transfer} event.\n */\n function _safeTransfer(address from, address to, uint256 tokenId) internal {\n _safeTransfer(from, to, tokenId, \"\");\n }\n\n /**\n * @dev Same as {xref-ERC721-_safeTransfer-address-address-uint256-}[`_safeTransfer`], with an additional `data` parameter which is\n * forwarded in {IERC721Receiver-onERC721Received} to contract recipients.\n */\n function _safeTransfer(address from, address to, uint256 tokenId, bytes memory data) internal virtual {\n _transfer(from, to, tokenId);\n ERC721Utils.checkOnERC721Received(_msgSender(), from, to, tokenId, data);\n }\n\n /**\n * @dev Approve `to` to operate on `tokenId`\n *\n * The `auth` argument is optional. If the value passed is non 0, then this function will check that `auth` is\n * either the owner of the token, or approved to operate on all tokens held by this owner.\n *\n * Emits an {Approval} event.\n *\n * Overrides to this logic should be done to the variant with an additional `bool emitEvent` argument.\n */\n function _approve(address to, uint256 tokenId, address auth) internal {\n _approve(to, tokenId, auth, true);\n }\n\n /**\n * @dev Variant of `_approve` with an optional flag to enable or disable the {Approval} event. The event is not\n * emitted in the context of transfers.\n */\n function _approve(address to, uint256 tokenId, address auth, bool emitEvent) internal virtual {\n // Avoid reading the owner unless necessary\n if (emitEvent || auth != address(0)) {\n address owner = _requireOwned(tokenId);\n\n // We do not use _isAuthorized because single-token approvals should not be able to call approve\n if (auth != address(0) && owner != auth && !isApprovedForAll(owner, auth)) {\n revert ERC721InvalidApprover(auth);\n }\n\n if (emitEvent) {\n emit Approval(owner, to, tokenId);\n }\n }\n\n _tokenApprovals[tokenId] = to;\n }\n\n /**\n * @dev Approve `operator` to operate on all of `owner` tokens\n *\n * Requirements:\n * - operator can't be the address zero.\n *\n * Emits an {ApprovalForAll} event.\n */\n function _setApprovalForAll(address owner, address operator, bool approved) internal virtual {\n if (operator == address(0)) {\n revert ERC721InvalidOperator(operator);\n }\n _operatorApprovals[owner][operator] = approved;\n emit ApprovalForAll(owner, operator, approved);\n }\n\n /**\n * @dev Reverts if the `tokenId` doesn't have a current owner (it hasn't been minted, or it has been burned).\n * Returns the owner.\n *\n * Overrides to ownership logic should be done to {_ownerOf}.\n */\n function _requireOwned(uint256 tokenId) internal view returns (address) {\n address owner = _ownerOf(tokenId);\n if (owner == address(0)) {\n revert ERC721NonexistentToken(tokenId);\n }\n return owner;\n }\n}\n" + }, + "@openzeppelin/contracts/token/ERC721/extensions/ERC721Burnable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC721/extensions/ERC721Burnable.sol)\n\npragma solidity ^0.8.20;\n\nimport {ERC721} from \"../ERC721.sol\";\nimport {Context} from \"../../../utils/Context.sol\";\n\n/**\n * @title ERC-721 Burnable Token\n * @dev ERC-721 Token that can be burned (destroyed).\n */\nabstract contract ERC721Burnable is Context, ERC721 {\n /**\n * @dev Burns `tokenId`. See {ERC721-_burn}.\n *\n * Requirements:\n *\n * - The caller must own `tokenId` or be an approved operator.\n */\n function burn(uint256 tokenId) public virtual {\n // Setting an \"auth\" arguments enables the `_isAuthorized` check which verifies that the token exists\n // (from != 0). Therefore, it is not needed to verify that the return value is not 0 here.\n _update(address(0), tokenId, _msgSender());\n }\n}\n" + }, + "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC721/extensions/ERC721Enumerable.sol)\n\npragma solidity ^0.8.20;\n\nimport {ERC721} from \"../ERC721.sol\";\nimport {IERC721Enumerable} from \"./IERC721Enumerable.sol\";\nimport {IERC165} from \"../../../utils/introspection/ERC165.sol\";\n\n/**\n * @dev This implements an optional extension of {ERC721} defined in the ERC that adds enumerability\n * of all the token ids in the contract as well as all token ids owned by each account.\n *\n * CAUTION: {ERC721} extensions that implement custom `balanceOf` logic, such as {ERC721Consecutive},\n * interfere with enumerability and should not be used together with {ERC721Enumerable}.\n */\nabstract contract ERC721Enumerable is ERC721, IERC721Enumerable {\n mapping(address owner => mapping(uint256 index => uint256)) private _ownedTokens;\n mapping(uint256 tokenId => uint256) private _ownedTokensIndex;\n\n uint256[] private _allTokens;\n mapping(uint256 tokenId => uint256) private _allTokensIndex;\n\n /**\n * @dev An `owner`'s token query was out of bounds for `index`.\n *\n * NOTE: The owner being `address(0)` indicates a global out of bounds index.\n */\n error ERC721OutOfBoundsIndex(address owner, uint256 index);\n\n /**\n * @dev Batch mint is not allowed.\n */\n error ERC721EnumerableForbiddenBatchMint();\n\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165, ERC721) returns (bool) {\n return interfaceId == type(IERC721Enumerable).interfaceId || super.supportsInterface(interfaceId);\n }\n\n /**\n * @dev See {IERC721Enumerable-tokenOfOwnerByIndex}.\n */\n function tokenOfOwnerByIndex(address owner, uint256 index) public view virtual returns (uint256) {\n if (index >= balanceOf(owner)) {\n revert ERC721OutOfBoundsIndex(owner, index);\n }\n return _ownedTokens[owner][index];\n }\n\n /**\n * @dev See {IERC721Enumerable-totalSupply}.\n */\n function totalSupply() public view virtual returns (uint256) {\n return _allTokens.length;\n }\n\n /**\n * @dev See {IERC721Enumerable-tokenByIndex}.\n */\n function tokenByIndex(uint256 index) public view virtual returns (uint256) {\n if (index >= totalSupply()) {\n revert ERC721OutOfBoundsIndex(address(0), index);\n }\n return _allTokens[index];\n }\n\n /**\n * @dev See {ERC721-_update}.\n */\n function _update(address to, uint256 tokenId, address auth) internal virtual override returns (address) {\n address previousOwner = super._update(to, tokenId, auth);\n\n if (previousOwner == address(0)) {\n _addTokenToAllTokensEnumeration(tokenId);\n } else if (previousOwner != to) {\n _removeTokenFromOwnerEnumeration(previousOwner, tokenId);\n }\n if (to == address(0)) {\n _removeTokenFromAllTokensEnumeration(tokenId);\n } else if (previousOwner != to) {\n _addTokenToOwnerEnumeration(to, tokenId);\n }\n\n return previousOwner;\n }\n\n /**\n * @dev Private function to add a token to this extension's ownership-tracking data structures.\n * @param to address representing the new owner of the given token ID\n * @param tokenId uint256 ID of the token to be added to the tokens list of the given address\n */\n function _addTokenToOwnerEnumeration(address to, uint256 tokenId) private {\n uint256 length = balanceOf(to) - 1;\n _ownedTokens[to][length] = tokenId;\n _ownedTokensIndex[tokenId] = length;\n }\n\n /**\n * @dev Private function to add a token to this extension's token tracking data structures.\n * @param tokenId uint256 ID of the token to be added to the tokens list\n */\n function _addTokenToAllTokensEnumeration(uint256 tokenId) private {\n _allTokensIndex[tokenId] = _allTokens.length;\n _allTokens.push(tokenId);\n }\n\n /**\n * @dev Private function to remove a token from this extension's ownership-tracking data structures. Note that\n * while the token is not assigned a new owner, the `_ownedTokensIndex` mapping is _not_ updated: this allows for\n * gas optimizations e.g. when performing a transfer operation (avoiding double writes).\n * This has O(1) time complexity, but alters the order of the _ownedTokens array.\n * @param from address representing the previous owner of the given token ID\n * @param tokenId uint256 ID of the token to be removed from the tokens list of the given address\n */\n function _removeTokenFromOwnerEnumeration(address from, uint256 tokenId) private {\n // To prevent a gap in from's tokens array, we store the last token in the index of the token to delete, and\n // then delete the last slot (swap and pop).\n\n uint256 lastTokenIndex = balanceOf(from);\n uint256 tokenIndex = _ownedTokensIndex[tokenId];\n\n mapping(uint256 index => uint256) storage _ownedTokensByOwner = _ownedTokens[from];\n\n // When the token to delete is the last token, the swap operation is unnecessary\n if (tokenIndex != lastTokenIndex) {\n uint256 lastTokenId = _ownedTokensByOwner[lastTokenIndex];\n\n _ownedTokensByOwner[tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token\n _ownedTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index\n }\n\n // This also deletes the contents at the last position of the array\n delete _ownedTokensIndex[tokenId];\n delete _ownedTokensByOwner[lastTokenIndex];\n }\n\n /**\n * @dev Private function to remove a token from this extension's token tracking data structures.\n * This has O(1) time complexity, but alters the order of the _allTokens array.\n * @param tokenId uint256 ID of the token to be removed from the tokens list\n */\n function _removeTokenFromAllTokensEnumeration(uint256 tokenId) private {\n // To prevent a gap in the tokens array, we store the last token in the index of the token to delete, and\n // then delete the last slot (swap and pop).\n\n uint256 lastTokenIndex = _allTokens.length - 1;\n uint256 tokenIndex = _allTokensIndex[tokenId];\n\n // When the token to delete is the last token, the swap operation is unnecessary. However, since this occurs so\n // rarely (when the last minted token is burnt) that we still do the swap here to avoid the gas cost of adding\n // an 'if' statement (like in _removeTokenFromOwnerEnumeration)\n uint256 lastTokenId = _allTokens[lastTokenIndex];\n\n _allTokens[tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token\n _allTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index\n\n // This also deletes the contents at the last position of the array\n delete _allTokensIndex[tokenId];\n _allTokens.pop();\n }\n\n /**\n * See {ERC721-_increaseBalance}. We need that to account tokens that were minted in batch\n */\n function _increaseBalance(address account, uint128 amount) internal virtual override {\n if (amount > 0) {\n revert ERC721EnumerableForbiddenBatchMint();\n }\n super._increaseBalance(account, amount);\n }\n}\n" + }, + "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC721/extensions/ERC721URIStorage.sol)\n\npragma solidity ^0.8.20;\n\nimport {ERC721} from \"../ERC721.sol\";\nimport {Strings} from \"../../../utils/Strings.sol\";\nimport {IERC4906} from \"../../../interfaces/IERC4906.sol\";\nimport {IERC165} from \"../../../interfaces/IERC165.sol\";\n\n/**\n * @dev ERC-721 token with storage based token URI management.\n */\nabstract contract ERC721URIStorage is IERC4906, ERC721 {\n using Strings for uint256;\n\n // Interface ID as defined in ERC-4906. This does not correspond to a traditional interface ID as ERC-4906 only\n // defines events and does not include any external function.\n bytes4 private constant ERC4906_INTERFACE_ID = bytes4(0x49064906);\n\n // Optional mapping for token URIs\n mapping(uint256 tokenId => string) private _tokenURIs;\n\n /**\n * @dev See {IERC165-supportsInterface}\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override(ERC721, IERC165) returns (bool) {\n return interfaceId == ERC4906_INTERFACE_ID || super.supportsInterface(interfaceId);\n }\n\n /**\n * @dev See {IERC721Metadata-tokenURI}.\n */\n function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {\n _requireOwned(tokenId);\n\n string memory _tokenURI = _tokenURIs[tokenId];\n string memory base = _baseURI();\n\n // If there is no base URI, return the token URI.\n if (bytes(base).length == 0) {\n return _tokenURI;\n }\n // If both are set, concatenate the baseURI and tokenURI (via string.concat).\n if (bytes(_tokenURI).length > 0) {\n return string.concat(base, _tokenURI);\n }\n\n return super.tokenURI(tokenId);\n }\n\n /**\n * @dev Sets `_tokenURI` as the tokenURI of `tokenId`.\n *\n * Emits {MetadataUpdate}.\n */\n function _setTokenURI(uint256 tokenId, string memory _tokenURI) internal virtual {\n _tokenURIs[tokenId] = _tokenURI;\n emit MetadataUpdate(tokenId);\n }\n}\n" + }, + "@openzeppelin/contracts/token/ERC721/extensions/ERC721Votes.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC721/extensions/ERC721Votes.sol)\n\npragma solidity ^0.8.20;\n\nimport {ERC721} from \"../ERC721.sol\";\nimport {Votes} from \"../../../governance/utils/Votes.sol\";\n\n/**\n * @dev Extension of ERC-721 to support voting and delegation as implemented by {Votes}, where each individual NFT counts\n * as 1 vote unit.\n *\n * Tokens do not count as votes until they are delegated, because votes must be tracked which incurs an additional cost\n * on every transfer. Token holders can either delegate to a trusted representative who will decide how to make use of\n * the votes in governance decisions, or they can delegate to themselves to be their own representative.\n */\nabstract contract ERC721Votes is ERC721, Votes {\n /**\n * @dev See {ERC721-_update}. Adjusts votes when tokens are transferred.\n *\n * Emits a {IVotes-DelegateVotesChanged} event.\n */\n function _update(address to, uint256 tokenId, address auth) internal virtual override returns (address) {\n address previousOwner = super._update(to, tokenId, auth);\n\n _transferVotingUnits(previousOwner, to, 1);\n\n return previousOwner;\n }\n\n /**\n * @dev Returns the balance of `account`.\n *\n * WARNING: Overriding this function will likely result in incorrect vote tracking.\n */\n function _getVotingUnits(address account) internal view virtual override returns (uint256) {\n return balanceOf(account);\n }\n\n /**\n * @dev See {ERC721-_increaseBalance}. We need that to account tokens that were minted in batch.\n */\n function _increaseBalance(address account, uint128 amount) internal virtual override {\n super._increaseBalance(account, amount);\n _transferVotingUnits(address(0), account, amount);\n }\n}\n" + }, + "@openzeppelin/contracts/token/ERC721/extensions/IERC721Enumerable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC721/extensions/IERC721Enumerable.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC721} from \"../IERC721.sol\";\n\n/**\n * @title ERC-721 Non-Fungible Token Standard, optional enumeration extension\n * @dev See https://eips.ethereum.org/EIPS/eip-721\n */\ninterface IERC721Enumerable is IERC721 {\n /**\n * @dev Returns the total amount of tokens stored by the contract.\n */\n function totalSupply() external view returns (uint256);\n\n /**\n * @dev Returns a token ID owned by `owner` at a given `index` of its token list.\n * Use along with {balanceOf} to enumerate all of ``owner``'s tokens.\n */\n function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256);\n\n /**\n * @dev Returns a token ID at a given `index` of all the tokens stored by the contract.\n * Use along with {totalSupply} to enumerate all tokens.\n */\n function tokenByIndex(uint256 index) external view returns (uint256);\n}\n" + }, + "@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC721/extensions/IERC721Metadata.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC721} from \"../IERC721.sol\";\n\n/**\n * @title ERC-721 Non-Fungible Token Standard, optional metadata extension\n * @dev See https://eips.ethereum.org/EIPS/eip-721\n */\ninterface IERC721Metadata is IERC721 {\n /**\n * @dev Returns the token collection name.\n */\n function name() external view returns (string memory);\n\n /**\n * @dev Returns the token collection symbol.\n */\n function symbol() external view returns (string memory);\n\n /**\n * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token.\n */\n function tokenURI(uint256 tokenId) external view returns (string memory);\n}\n" + }, + "@openzeppelin/contracts/token/ERC721/IERC721.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC721/IERC721.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC165} from \"../../utils/introspection/IERC165.sol\";\n\n/**\n * @dev Required interface of an ERC-721 compliant contract.\n */\ninterface IERC721 is IERC165 {\n /**\n * @dev Emitted when `tokenId` token is transferred from `from` to `to`.\n */\n event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);\n\n /**\n * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.\n */\n event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);\n\n /**\n * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.\n */\n event ApprovalForAll(address indexed owner, address indexed operator, bool approved);\n\n /**\n * @dev Returns the number of tokens in ``owner``'s account.\n */\n function balanceOf(address owner) external view returns (uint256 balance);\n\n /**\n * @dev Returns the owner of the `tokenId` token.\n *\n * Requirements:\n *\n * - `tokenId` must exist.\n */\n function ownerOf(uint256 tokenId) external view returns (address owner);\n\n /**\n * @dev Safely transfers `tokenId` token from `from` to `to`.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `tokenId` token must exist and be owned by `from`.\n * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon\n * a safe transfer.\n *\n * Emits a {Transfer} event.\n */\n function safeTransferFrom(address from, address to, uint256 tokenId, bytes calldata data) external;\n\n /**\n * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients\n * are aware of the ERC-721 protocol to prevent tokens from being forever locked.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `tokenId` token must exist and be owned by `from`.\n * - If the caller is not `from`, it must have been allowed to move this token by either {approve} or\n * {setApprovalForAll}.\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon\n * a safe transfer.\n *\n * Emits a {Transfer} event.\n */\n function safeTransferFrom(address from, address to, uint256 tokenId) external;\n\n /**\n * @dev Transfers `tokenId` token from `from` to `to`.\n *\n * WARNING: Note that the caller is responsible to confirm that the recipient is capable of receiving ERC-721\n * or else they may be permanently lost. Usage of {safeTransferFrom} prevents loss, though the caller must\n * understand this adds an external call which potentially creates a reentrancy vulnerability.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `tokenId` token must be owned by `from`.\n * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(address from, address to, uint256 tokenId) external;\n\n /**\n * @dev Gives permission to `to` to transfer `tokenId` token to another account.\n * The approval is cleared when the token is transferred.\n *\n * Only a single account can be approved at a time, so approving the zero address clears previous approvals.\n *\n * Requirements:\n *\n * - The caller must own the token or be an approved operator.\n * - `tokenId` must exist.\n *\n * Emits an {Approval} event.\n */\n function approve(address to, uint256 tokenId) external;\n\n /**\n * @dev Approve or remove `operator` as an operator for the caller.\n * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.\n *\n * Requirements:\n *\n * - The `operator` cannot be the address zero.\n *\n * Emits an {ApprovalForAll} event.\n */\n function setApprovalForAll(address operator, bool approved) external;\n\n /**\n * @dev Returns the account approved for `tokenId` token.\n *\n * Requirements:\n *\n * - `tokenId` must exist.\n */\n function getApproved(uint256 tokenId) external view returns (address operator);\n\n /**\n * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.\n *\n * See {setApprovalForAll}\n */\n function isApprovedForAll(address owner, address operator) external view returns (bool);\n}\n" + }, + "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC721/IERC721Receiver.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @title ERC-721 token receiver interface\n * @dev Interface for any contract that wants to support safeTransfers\n * from ERC-721 asset contracts.\n */\ninterface IERC721Receiver {\n /**\n * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom}\n * by `operator` from `from`, this function is called.\n *\n * It must return its Solidity selector to confirm the token transfer.\n * If any other value is returned or the interface is not implemented by the recipient, the transfer will be\n * reverted.\n *\n * The selector can be obtained in Solidity with `IERC721Receiver.onERC721Received.selector`.\n */\n function onERC721Received(\n address operator,\n address from,\n uint256 tokenId,\n bytes calldata data\n ) external returns (bytes4);\n}\n" + }, + "@openzeppelin/contracts/token/ERC721/utils/ERC721Utils.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC721/utils/ERC721Utils.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC721Receiver} from \"../IERC721Receiver.sol\";\nimport {IERC721Errors} from \"../../../interfaces/draft-IERC6093.sol\";\n\n/**\n * @dev Library that provide common ERC-721 utility functions.\n *\n * See https://eips.ethereum.org/EIPS/eip-721[ERC-721].\n *\n * _Available since v5.1._\n */\nlibrary ERC721Utils {\n /**\n * @dev Performs an acceptance check for the provided `operator` by calling {IERC721-onERC721Received}\n * on the `to` address. The `operator` is generally the address that initiated the token transfer (i.e. `msg.sender`).\n *\n * The acceptance call is not executed and treated as a no-op if the target address doesn't contain code (i.e. an EOA).\n * Otherwise, the recipient must implement {IERC721Receiver-onERC721Received} and return the acceptance magic value to accept\n * the transfer.\n */\n function checkOnERC721Received(\n address operator,\n address from,\n address to,\n uint256 tokenId,\n bytes memory data\n ) internal {\n if (to.code.length > 0) {\n try IERC721Receiver(to).onERC721Received(operator, from, tokenId, data) returns (bytes4 retval) {\n if (retval != IERC721Receiver.onERC721Received.selector) {\n // Token rejected\n revert IERC721Errors.ERC721InvalidReceiver(to);\n }\n } catch (bytes memory reason) {\n if (reason.length == 0) {\n // non-IERC721Receiver implementer\n revert IERC721Errors.ERC721InvalidReceiver(to);\n } else {\n assembly (\"memory-safe\") {\n revert(add(32, reason), mload(reason))\n }\n }\n }\n }\n }\n}\n" + }, + "@openzeppelin/contracts/utils/Address.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/Address.sol)\n\npragma solidity ^0.8.20;\n\nimport {Errors} from \"./Errors.sol\";\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary Address {\n /**\n * @dev There's no code at `target` (it is not a contract).\n */\n error AddressEmptyCode(address target);\n\n /**\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\n * `recipient`, forwarding all available gas and reverting on errors.\n *\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\n * imposed by `transfer`, making them unable to receive funds via\n * `transfer`. {sendValue} removes this limitation.\n *\n * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n *\n * IMPORTANT: because control is transferred to `recipient`, care must be\n * taken to not create reentrancy vulnerabilities. Consider using\n * {ReentrancyGuard} or the\n * https://solidity.readthedocs.io/en/v0.8.20/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n */\n function sendValue(address payable recipient, uint256 amount) internal {\n if (address(this).balance < amount) {\n revert Errors.InsufficientBalance(address(this).balance, amount);\n }\n\n (bool success, ) = recipient.call{value: amount}(\"\");\n if (!success) {\n revert Errors.FailedCall();\n }\n }\n\n /**\n * @dev Performs a Solidity function call using a low level `call`. A\n * plain `call` is an unsafe replacement for a function call: use this\n * function instead.\n *\n * If `target` reverts with a revert reason or custom error, it is bubbled\n * up by this function (like regular Solidity function calls). However, if\n * the call reverted with no returned reason, this function reverts with a\n * {Errors.FailedCall} error.\n *\n * Returns the raw returned data. To convert to the expected return value,\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\n *\n * Requirements:\n *\n * - `target` must be a contract.\n * - calling `target` with `data` must not revert.\n */\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but also transferring `value` wei to `target`.\n *\n * Requirements:\n *\n * - the calling contract must have an ETH balance of at least `value`.\n * - the called Solidity function must be `payable`.\n */\n function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {\n if (address(this).balance < value) {\n revert Errors.InsufficientBalance(address(this).balance, value);\n }\n (bool success, bytes memory returndata) = target.call{value: value}(data);\n return verifyCallResultFromTarget(target, success, returndata);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a static call.\n */\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\n (bool success, bytes memory returndata) = target.staticcall(data);\n return verifyCallResultFromTarget(target, success, returndata);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a delegate call.\n */\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\n (bool success, bytes memory returndata) = target.delegatecall(data);\n return verifyCallResultFromTarget(target, success, returndata);\n }\n\n /**\n * @dev Tool to verify that a low level call to smart-contract was successful, and reverts if the target\n * was not a contract or bubbling up the revert reason (falling back to {Errors.FailedCall}) in case\n * of an unsuccessful call.\n */\n function verifyCallResultFromTarget(\n address target,\n bool success,\n bytes memory returndata\n ) internal view returns (bytes memory) {\n if (!success) {\n _revert(returndata);\n } else {\n // only check if target is a contract if the call was successful and the return data is empty\n // otherwise we already know that it was a contract\n if (returndata.length == 0 && target.code.length == 0) {\n revert AddressEmptyCode(target);\n }\n return returndata;\n }\n }\n\n /**\n * @dev Tool to verify that a low level call was successful, and reverts if it wasn't, either by bubbling the\n * revert reason or with a default {Errors.FailedCall} error.\n */\n function verifyCallResult(bool success, bytes memory returndata) internal pure returns (bytes memory) {\n if (!success) {\n _revert(returndata);\n } else {\n return returndata;\n }\n }\n\n /**\n * @dev Reverts with returndata if present. Otherwise reverts with {Errors.FailedCall}.\n */\n function _revert(bytes memory returndata) private pure {\n // Look for revert reason and bubble it up if present\n if (returndata.length > 0) {\n // The easiest way to bubble the revert reason is using memory via assembly\n assembly (\"memory-safe\") {\n let returndata_size := mload(returndata)\n revert(add(32, returndata), returndata_size)\n }\n } else {\n revert Errors.FailedCall();\n }\n }\n}\n" + }, + "@openzeppelin/contracts/utils/Context.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract Context {\n function _msgSender() internal view virtual returns (address) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual returns (bytes calldata) {\n return msg.data;\n }\n\n function _contextSuffixLength() internal view virtual returns (uint256) {\n return 0;\n }\n}\n" + }, + "@openzeppelin/contracts/utils/cryptography/ECDSA.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/cryptography/ECDSA.sol)\n\npragma solidity ^0.8.20;\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 }\n\n /**\n * @dev The signature derives the `address(0)`.\n */\n error ECDSAInvalidSignature();\n\n /**\n * @dev The signature has an invalid length.\n */\n error ECDSAInvalidSignatureLength(uint256 length);\n\n /**\n * @dev The signature has an S value that is in the upper half order.\n */\n error ECDSAInvalidSignatureS(bytes32 s);\n\n /**\n * @dev Returns the address that signed a hashed message (`hash`) with `signature` or an error. This will not\n * return address(0) without also returning an error description. Errors are documented using an enum (error type)\n * and a bytes32 providing additional information about the error.\n *\n * If no error is returned, then the address can be used for verification purposes.\n *\n * The `ecrecover` EVM precompile 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 {MessageHashUtils-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 function tryRecover(\n bytes32 hash,\n bytes memory signature\n ) internal pure returns (address recovered, RecoverError err, bytes32 errArg) {\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 assembly (\"memory-safe\") {\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, bytes32(signature.length));\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 precompile 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 {MessageHashUtils-toEthSignedMessageHash} on it.\n */\n function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {\n (address recovered, RecoverError error, bytes32 errorArg) = tryRecover(hash, signature);\n _throwError(error, errorArg);\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[ERC-2098 short signatures]\n */\n function tryRecover(\n bytes32 hash,\n bytes32 r,\n bytes32 vs\n ) internal pure returns (address recovered, RecoverError err, bytes32 errArg) {\n unchecked {\n bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff);\n // We do not check for an overflow here since the shift operation results in 0 or 1.\n uint8 v = uint8((uint256(vs) >> 255) + 27);\n return tryRecover(hash, v, r, s);\n }\n }\n\n /**\n * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately.\n */\n function recover(bytes32 hash, bytes32 r, bytes32 vs) internal pure returns (address) {\n (address recovered, RecoverError error, bytes32 errorArg) = tryRecover(hash, r, vs);\n _throwError(error, errorArg);\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 function tryRecover(\n bytes32 hash,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) internal pure returns (address recovered, RecoverError err, bytes32 errArg) {\n // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature\n // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines\n // the valid range for s in (301): 0 < s < secp256k1n ÷ 2 + 1, and for v in (302): v ∈ {27, 28}. Most\n // signatures from current libraries generate a unique signature with an s-value in the lower half order.\n //\n // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value\n // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or\n // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept\n // these malleable signatures as well.\n if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) {\n return (address(0), RecoverError.InvalidSignatureS, s);\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, bytes32(0));\n }\n\n return (signer, RecoverError.NoError, bytes32(0));\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, bytes32 errorArg) = tryRecover(hash, v, r, s);\n _throwError(error, errorArg);\n return recovered;\n }\n\n /**\n * @dev Optionally reverts with the corresponding custom error according to the `error` argument provided.\n */\n function _throwError(RecoverError error, bytes32 errorArg) private pure {\n if (error == RecoverError.NoError) {\n return; // no error: do nothing\n } else if (error == RecoverError.InvalidSignature) {\n revert ECDSAInvalidSignature();\n } else if (error == RecoverError.InvalidSignatureLength) {\n revert ECDSAInvalidSignatureLength(uint256(errorArg));\n } else if (error == RecoverError.InvalidSignatureS) {\n revert ECDSAInvalidSignatureS(errorArg);\n }\n }\n}\n" + }, + "@openzeppelin/contracts/utils/cryptography/EIP712.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/cryptography/EIP712.sol)\n\npragma solidity ^0.8.20;\n\nimport {MessageHashUtils} from \"./MessageHashUtils.sol\";\nimport {ShortStrings, ShortString} from \"../ShortStrings.sol\";\nimport {IERC5267} from \"../../interfaces/IERC5267.sol\";\n\n/**\n * @dev https://eips.ethereum.org/EIPS/eip-712[EIP-712] is a standard for hashing and signing of typed structured data.\n *\n * The encoding scheme specified in the EIP requires a domain separator and a hash of the typed structured data, whose\n * encoding is very generic and therefore its implementation in Solidity is not feasible, thus this contract\n * does not implement the encoding itself. Protocols need to implement the type-specific encoding they need in order to\n * produce the hash of their typed data using a combination of `abi.encode` and `keccak256`.\n *\n * This contract implements the EIP-712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding\n * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA\n * ({_hashTypedDataV4}).\n *\n * The implementation of the domain separator was designed to be as efficient as possible while still properly updating\n * the chain id to protect against replay attacks on an eventual fork of the chain.\n *\n * NOTE: This contract implements the version of the encoding known as \"v4\", as implemented by the JSON RPC method\n * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask].\n *\n * NOTE: In the upgradeable version of this contract, the cached values will correspond to the address, and the domain\n * separator of the implementation contract. This will cause the {_domainSeparatorV4} function to always rebuild the\n * separator from the immutable values, which is cheaper than accessing a cached version in cold storage.\n *\n * @custom:oz-upgrades-unsafe-allow state-variable-immutable\n */\nabstract contract EIP712 is IERC5267 {\n using ShortStrings for *;\n\n bytes32 private constant TYPE_HASH =\n keccak256(\"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)\");\n\n // Cache the domain separator as an immutable value, but also store the chain id that it corresponds to, in order to\n // invalidate the cached domain separator if the chain id changes.\n bytes32 private immutable _cachedDomainSeparator;\n uint256 private immutable _cachedChainId;\n address private immutable _cachedThis;\n\n bytes32 private immutable _hashedName;\n bytes32 private immutable _hashedVersion;\n\n ShortString private immutable _name;\n ShortString private immutable _version;\n string private _nameFallback;\n string private _versionFallback;\n\n /**\n * @dev Initializes the domain separator and parameter caches.\n *\n * The meaning of `name` and `version` is specified in\n * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP-712]:\n *\n * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol.\n * - `version`: the current major version of the signing domain.\n *\n * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart\n * contract upgrade].\n */\n constructor(string memory name, string memory version) {\n _name = name.toShortStringWithFallback(_nameFallback);\n _version = version.toShortStringWithFallback(_versionFallback);\n _hashedName = keccak256(bytes(name));\n _hashedVersion = keccak256(bytes(version));\n\n _cachedChainId = block.chainid;\n _cachedDomainSeparator = _buildDomainSeparator();\n _cachedThis = address(this);\n }\n\n /**\n * @dev Returns the domain separator for the current chain.\n */\n function _domainSeparatorV4() internal view returns (bytes32) {\n if (address(this) == _cachedThis && block.chainid == _cachedChainId) {\n return _cachedDomainSeparator;\n } else {\n return _buildDomainSeparator();\n }\n }\n\n function _buildDomainSeparator() private view returns (bytes32) {\n return keccak256(abi.encode(TYPE_HASH, _hashedName, _hashedVersion, block.chainid, address(this)));\n }\n\n /**\n * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this\n * function returns the hash of the fully encoded EIP712 message for this domain.\n *\n * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example:\n *\n * ```solidity\n * bytes32 digest = _hashTypedDataV4(keccak256(abi.encode(\n * keccak256(\"Mail(address to,string contents)\"),\n * mailTo,\n * keccak256(bytes(mailContents))\n * )));\n * address signer = ECDSA.recover(digest, signature);\n * ```\n */\n function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) {\n return MessageHashUtils.toTypedDataHash(_domainSeparatorV4(), structHash);\n }\n\n /**\n * @dev See {IERC-5267}.\n */\n function eip712Domain()\n public\n view\n virtual\n returns (\n bytes1 fields,\n string memory name,\n string memory version,\n uint256 chainId,\n address verifyingContract,\n bytes32 salt,\n uint256[] memory extensions\n )\n {\n return (\n hex\"0f\", // 01111\n _EIP712Name(),\n _EIP712Version(),\n block.chainid,\n address(this),\n bytes32(0),\n new uint256[](0)\n );\n }\n\n /**\n * @dev The name parameter for the EIP712 domain.\n *\n * NOTE: By default this function reads _name which is an immutable value.\n * It only reads from storage if necessary (in case the value is too large to fit in a ShortString).\n */\n // solhint-disable-next-line func-name-mixedcase\n function _EIP712Name() internal view returns (string memory) {\n return _name.toStringWithFallback(_nameFallback);\n }\n\n /**\n * @dev The version parameter for the EIP712 domain.\n *\n * NOTE: By default this function reads _version which is an immutable value.\n * It only reads from storage if necessary (in case the value is too large to fit in a ShortString).\n */\n // solhint-disable-next-line func-name-mixedcase\n function _EIP712Version() internal view returns (string memory) {\n return _version.toStringWithFallback(_versionFallback);\n }\n}\n" + }, + "@openzeppelin/contracts/utils/cryptography/MessageHashUtils.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/cryptography/MessageHashUtils.sol)\n\npragma solidity ^0.8.20;\n\nimport {Strings} from \"../Strings.sol\";\n\n/**\n * @dev Signature message hash utilities for producing digests to be consumed by {ECDSA} recovery or signing.\n *\n * The library provides methods for generating a hash of a message that conforms to the\n * https://eips.ethereum.org/EIPS/eip-191[ERC-191] and https://eips.ethereum.org/EIPS/eip-712[EIP 712]\n * specifications.\n */\nlibrary MessageHashUtils {\n /**\n * @dev Returns the keccak256 digest of an ERC-191 signed data with version\n * `0x45` (`personal_sign` messages).\n *\n * The digest is calculated by prefixing a bytes32 `messageHash` with\n * `\"\\x19Ethereum Signed Message:\\n32\"` and hashing the result. It corresponds with the\n * hash signed when using the https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] JSON-RPC method.\n *\n * NOTE: The `messageHash` parameter is intended to be the result of hashing a raw message with\n * keccak256, although any bytes32 value can be safely used because the final digest will\n * be re-hashed.\n *\n * See {ECDSA-recover}.\n */\n function toEthSignedMessageHash(bytes32 messageHash) internal pure returns (bytes32 digest) {\n assembly (\"memory-safe\") {\n mstore(0x00, \"\\x19Ethereum Signed Message:\\n32\") // 32 is the bytes-length of messageHash\n mstore(0x1c, messageHash) // 0x1c (28) is the length of the prefix\n digest := keccak256(0x00, 0x3c) // 0x3c is the length of the prefix (0x1c) + messageHash (0x20)\n }\n }\n\n /**\n * @dev Returns the keccak256 digest of an ERC-191 signed data with version\n * `0x45` (`personal_sign` messages).\n *\n * The digest is calculated by prefixing an arbitrary `message` with\n * `\"\\x19Ethereum Signed Message:\\n\" + len(message)` and hashing the result. It corresponds with the\n * hash signed when using the https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] JSON-RPC method.\n *\n * See {ECDSA-recover}.\n */\n function toEthSignedMessageHash(bytes memory message) internal pure returns (bytes32) {\n return\n keccak256(bytes.concat(\"\\x19Ethereum Signed Message:\\n\", bytes(Strings.toString(message.length)), message));\n }\n\n /**\n * @dev Returns the keccak256 digest of an ERC-191 signed data with version\n * `0x00` (data with intended validator).\n *\n * The digest is calculated by prefixing an arbitrary `data` with `\"\\x19\\x00\"` and the intended\n * `validator` address. Then hashing the result.\n *\n * See {ECDSA-recover}.\n */\n function toDataWithIntendedValidatorHash(address validator, bytes memory data) internal pure returns (bytes32) {\n return keccak256(abi.encodePacked(hex\"19_00\", validator, data));\n }\n\n /**\n * @dev Returns the keccak256 digest of an EIP-712 typed data (ERC-191 version `0x01`).\n *\n * The digest is calculated from a `domainSeparator` and a `structHash`, by prefixing them with\n * `\\x19\\x01` and hashing the result. It corresponds to the hash signed by the\n * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`] JSON-RPC method as part of EIP-712.\n *\n * See {ECDSA-recover}.\n */\n function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32 digest) {\n assembly (\"memory-safe\") {\n let ptr := mload(0x40)\n mstore(ptr, hex\"19_01\")\n mstore(add(ptr, 0x02), domainSeparator)\n mstore(add(ptr, 0x22), structHash)\n digest := keccak256(ptr, 0x42)\n }\n }\n}\n" + }, + "@openzeppelin/contracts/utils/cryptography/SignatureChecker.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/cryptography/SignatureChecker.sol)\n\npragma solidity ^0.8.20;\n\nimport {ECDSA} from \"./ECDSA.sol\";\nimport {IERC1271} from \"../../interfaces/IERC1271.sol\";\n\n/**\n * @dev Signature verification helper that can be used instead of `ECDSA.recover` to seamlessly support both ECDSA\n * signatures from externally owned accounts (EOAs) as well as ERC-1271 signatures from smart contract wallets like\n * Argent and Safe Wallet (previously Gnosis Safe).\n */\nlibrary SignatureChecker {\n /**\n * @dev Checks if a signature is valid for a given signer and data hash. If the signer is a smart contract, the\n * signature is validated against that smart contract using ERC-1271, otherwise it's validated using `ECDSA.recover`.\n *\n * NOTE: Unlike ECDSA signatures, contract signatures are revocable, and the outcome of this function can thus\n * change through time. It could return true at block N and false at block N+1 (or the opposite).\n */\n function isValidSignatureNow(address signer, bytes32 hash, bytes memory signature) internal view returns (bool) {\n if (signer.code.length == 0) {\n (address recovered, ECDSA.RecoverError err, ) = ECDSA.tryRecover(hash, signature);\n return err == ECDSA.RecoverError.NoError && recovered == signer;\n } else {\n return isValidERC1271SignatureNow(signer, hash, signature);\n }\n }\n\n /**\n * @dev Checks if a signature is valid for a given signer and data hash. The signature is validated\n * against the signer smart contract using ERC-1271.\n *\n * NOTE: Unlike ECDSA signatures, contract signatures are revocable, and the outcome of this function can thus\n * change through time. It could return true at block N and false at block N+1 (or the opposite).\n */\n function isValidERC1271SignatureNow(\n address signer,\n bytes32 hash,\n bytes memory signature\n ) internal view returns (bool) {\n (bool success, bytes memory result) = signer.staticcall(\n abi.encodeCall(IERC1271.isValidSignature, (hash, signature))\n );\n return (success &&\n result.length >= 32 &&\n abi.decode(result, (bytes32)) == bytes32(IERC1271.isValidSignature.selector));\n }\n}\n" + }, + "@openzeppelin/contracts/utils/Errors.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/Errors.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Collection of common custom errors used in multiple contracts\n *\n * IMPORTANT: Backwards compatibility is not guaranteed in future versions of the library.\n * It is recommended to avoid relying on the error API for critical functionality.\n *\n * _Available since v5.1._\n */\nlibrary Errors {\n /**\n * @dev The ETH balance of the account is not enough to perform the operation.\n */\n error InsufficientBalance(uint256 balance, uint256 needed);\n\n /**\n * @dev A call to an address target failed. The target may have reverted.\n */\n error FailedCall();\n\n /**\n * @dev The deployment failed.\n */\n error FailedDeployment();\n\n /**\n * @dev A necessary precompile is missing.\n */\n error MissingPrecompile(address);\n}\n" + }, + "@openzeppelin/contracts/utils/introspection/ERC165.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/introspection/ERC165.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC165} from \"./IERC165.sol\";\n\n/**\n * @dev Implementation of the {IERC165} interface.\n *\n * Contracts that want to implement ERC-165 should inherit from this contract and override {supportsInterface} to check\n * for the additional interface id that will be supported. For example:\n *\n * ```solidity\n * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);\n * }\n * ```\n */\nabstract contract ERC165 is IERC165 {\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) {\n return interfaceId == type(IERC165).interfaceId;\n }\n}\n" + }, + "@openzeppelin/contracts/utils/introspection/IERC165.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/introspection/IERC165.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Interface of the ERC-165 standard, as defined in the\n * https://eips.ethereum.org/EIPS/eip-165[ERC].\n *\n * Implementers can declare support of contract interfaces, which can then be\n * queried by others ({ERC165Checker}).\n *\n * For an implementation, see {ERC165}.\n */\ninterface IERC165 {\n /**\n * @dev Returns true if this contract implements the interface defined by\n * `interfaceId`. See the corresponding\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[ERC section]\n * to learn more about how these ids are created.\n *\n * This function call must use less than 30 000 gas.\n */\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\n}\n" + }, + "@openzeppelin/contracts/utils/math/Math.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/math/Math.sol)\n\npragma solidity ^0.8.20;\n\nimport {Panic} from \"../Panic.sol\";\nimport {SafeCast} from \"./SafeCast.sol\";\n\n/**\n * @dev Standard math utilities missing in the Solidity language.\n */\nlibrary Math {\n enum Rounding {\n Floor, // Toward negative infinity\n Ceil, // Toward positive infinity\n Trunc, // Toward zero\n Expand // Away from zero\n }\n\n /**\n * @dev Returns the addition of two unsigned integers, with an success flag (no overflow).\n */\n function tryAdd(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\n unchecked {\n uint256 c = a + b;\n if (c < a) return (false, 0);\n return (true, c);\n }\n }\n\n /**\n * @dev Returns the subtraction of two unsigned integers, with an success flag (no overflow).\n */\n function trySub(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\n unchecked {\n if (b > a) return (false, 0);\n return (true, a - b);\n }\n }\n\n /**\n * @dev Returns the multiplication of two unsigned integers, with an success flag (no overflow).\n */\n function tryMul(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\n unchecked {\n // Gas optimization: this is cheaper than requiring 'a' not being zero, but the\n // benefit is lost if 'b' is also tested.\n // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522\n if (a == 0) return (true, 0);\n uint256 c = a * b;\n if (c / a != b) return (false, 0);\n return (true, c);\n }\n }\n\n /**\n * @dev Returns the division of two unsigned integers, with a success flag (no division by zero).\n */\n function tryDiv(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\n unchecked {\n if (b == 0) return (false, 0);\n return (true, a / b);\n }\n }\n\n /**\n * @dev Returns the remainder of dividing two unsigned integers, with a success flag (no division by zero).\n */\n function tryMod(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\n unchecked {\n if (b == 0) return (false, 0);\n return (true, a % b);\n }\n }\n\n /**\n * @dev Branchless ternary evaluation for `a ? b : c`. Gas costs are constant.\n *\n * IMPORTANT: This function may reduce bytecode size and consume less gas when used standalone.\n * However, the compiler may optimize Solidity ternary operations (i.e. `a ? b : c`) to only compute\n * one branch when needed, making this function more expensive.\n */\n function ternary(bool condition, uint256 a, uint256 b) internal pure returns (uint256) {\n unchecked {\n // branchless ternary works because:\n // b ^ (a ^ b) == a\n // b ^ 0 == b\n return b ^ ((a ^ b) * SafeCast.toUint(condition));\n }\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 ternary(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 ternary(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 towards infinity instead\n * of rounding towards zero.\n */\n function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {\n if (b == 0) {\n // Guarantee the same behavior as in a regular Solidity division.\n Panic.panic(Panic.DIVISION_BY_ZERO);\n }\n\n // The following calculation ensures accurate ceiling division without overflow.\n // Since a is non-zero, (a - 1) / b will not overflow.\n // The largest possible result occurs when (a - 1) / b is type(uint256).max,\n // but the largest value we can obtain is type(uint256).max - 1, which happens\n // when a = type(uint256).max and b = 1.\n unchecked {\n return SafeCast.toUint(a > 0) * ((a - 1) / b + 1);\n }\n }\n\n /**\n * @dev Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or\n * denominator == 0.\n *\n * Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv) with further edits by\n * 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²⁵⁶ and mod 2²⁵⁶ - 1, then use\n // the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256\n // variables such that product = prod1 * 2²⁵⁶ + prod0.\n uint256 prod0 = x * y; // 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 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²⁵⁶. Also prevents denominator == 0.\n if (denominator <= prod1) {\n Panic.panic(ternary(denominator == 0, Panic.DIVISION_BY_ZERO, Panic.UNDER_OVERFLOW));\n }\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.\n // Always >= 1. See https://cs.stackexchange.com/q/138556/92363.\n\n uint256 twos = denominator & (0 - denominator);\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²⁵⁶ / 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²⁵⁶. Now that denominator is an odd number, it has an inverse modulo 2²⁵⁶ such\n // that denominator * inv ≡ 1 mod 2²⁵⁶. Compute the inverse by starting with a seed that is correct for\n // four bits. That is, denominator * inv ≡ 1 mod 2⁴.\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\n // works in modular arithmetic, doubling the correct bits in each step.\n inverse *= 2 - denominator * inverse; // inverse mod 2⁸\n inverse *= 2 - denominator * inverse; // inverse mod 2¹⁶\n inverse *= 2 - denominator * inverse; // inverse mod 2³²\n inverse *= 2 - denominator * inverse; // inverse mod 2⁶⁴\n inverse *= 2 - denominator * inverse; // inverse mod 2¹²⁸\n inverse *= 2 - denominator * inverse; // inverse mod 2²⁵⁶\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²⁵⁶. Since the preconditions guarantee that the outcome is\n // less than 2²⁵⁶, 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 * @dev 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 return mulDiv(x, y, denominator) + SafeCast.toUint(unsignedRoundsUp(rounding) && mulmod(x, y, denominator) > 0);\n }\n\n /**\n * @dev Calculate the modular multiplicative inverse of a number in Z/nZ.\n *\n * If n is a prime, then Z/nZ is a field. In that case all elements are inversible, except 0.\n * If n is not a prime, then Z/nZ is not a field, and some elements might not be inversible.\n *\n * If the input value is not inversible, 0 is returned.\n *\n * NOTE: If you know for sure that n is (big) a prime, it may be cheaper to use Fermat's little theorem and get the\n * inverse using `Math.modExp(a, n - 2, n)`. See {invModPrime}.\n */\n function invMod(uint256 a, uint256 n) internal pure returns (uint256) {\n unchecked {\n if (n == 0) return 0;\n\n // The inverse modulo is calculated using the Extended Euclidean Algorithm (iterative version)\n // Used to compute integers x and y such that: ax + ny = gcd(a, n).\n // When the gcd is 1, then the inverse of a modulo n exists and it's x.\n // ax + ny = 1\n // ax = 1 + (-y)n\n // ax ≡ 1 (mod n) # x is the inverse of a modulo n\n\n // If the remainder is 0 the gcd is n right away.\n uint256 remainder = a % n;\n uint256 gcd = n;\n\n // Therefore the initial coefficients are:\n // ax + ny = gcd(a, n) = n\n // 0a + 1n = n\n int256 x = 0;\n int256 y = 1;\n\n while (remainder != 0) {\n uint256 quotient = gcd / remainder;\n\n (gcd, remainder) = (\n // The old remainder is the next gcd to try.\n remainder,\n // Compute the next remainder.\n // Can't overflow given that (a % gcd) * (gcd // (a % gcd)) <= gcd\n // where gcd is at most n (capped to type(uint256).max)\n gcd - remainder * quotient\n );\n\n (x, y) = (\n // Increment the coefficient of a.\n y,\n // Decrement the coefficient of n.\n // Can overflow, but the result is casted to uint256 so that the\n // next value of y is \"wrapped around\" to a value between 0 and n - 1.\n x - y * int256(quotient)\n );\n }\n\n if (gcd != 1) return 0; // No inverse exists.\n return ternary(x < 0, n - uint256(-x), uint256(x)); // Wrap the result if it's negative.\n }\n }\n\n /**\n * @dev Variant of {invMod}. More efficient, but only works if `p` is known to be a prime greater than `2`.\n *\n * From https://en.wikipedia.org/wiki/Fermat%27s_little_theorem[Fermat's little theorem], we know that if p is\n * prime, then `a**(p-1) ≡ 1 mod p`. As a consequence, we have `a * a**(p-2) ≡ 1 mod p`, which means that\n * `a**(p-2)` is the modular multiplicative inverse of a in Fp.\n *\n * NOTE: this function does NOT check that `p` is a prime greater than `2`.\n */\n function invModPrime(uint256 a, uint256 p) internal view returns (uint256) {\n unchecked {\n return Math.modExp(a, p - 2, p);\n }\n }\n\n /**\n * @dev Returns the modular exponentiation of the specified base, exponent and modulus (b ** e % m)\n *\n * Requirements:\n * - modulus can't be zero\n * - underlying staticcall to precompile must succeed\n *\n * IMPORTANT: The result is only valid if the underlying call succeeds. When using this function, make\n * sure the chain you're using it on supports the precompiled contract for modular exponentiation\n * at address 0x05 as specified in https://eips.ethereum.org/EIPS/eip-198[EIP-198]. Otherwise,\n * the underlying function will succeed given the lack of a revert, but the result may be incorrectly\n * interpreted as 0.\n */\n function modExp(uint256 b, uint256 e, uint256 m) internal view returns (uint256) {\n (bool success, uint256 result) = tryModExp(b, e, m);\n if (!success) {\n Panic.panic(Panic.DIVISION_BY_ZERO);\n }\n return result;\n }\n\n /**\n * @dev Returns the modular exponentiation of the specified base, exponent and modulus (b ** e % m).\n * It includes a success flag indicating if the operation succeeded. Operation will be marked as failed if trying\n * to operate modulo 0 or if the underlying precompile reverted.\n *\n * IMPORTANT: The result is only valid if the success flag is true. When using this function, make sure the chain\n * you're using it on supports the precompiled contract for modular exponentiation at address 0x05 as specified in\n * https://eips.ethereum.org/EIPS/eip-198[EIP-198]. Otherwise, the underlying function will succeed given the lack\n * of a revert, but the result may be incorrectly interpreted as 0.\n */\n function tryModExp(uint256 b, uint256 e, uint256 m) internal view returns (bool success, uint256 result) {\n if (m == 0) return (false, 0);\n assembly (\"memory-safe\") {\n let ptr := mload(0x40)\n // | Offset | Content | Content (Hex) |\n // |-----------|------------|--------------------------------------------------------------------|\n // | 0x00:0x1f | size of b | 0x0000000000000000000000000000000000000000000000000000000000000020 |\n // | 0x20:0x3f | size of e | 0x0000000000000000000000000000000000000000000000000000000000000020 |\n // | 0x40:0x5f | size of m | 0x0000000000000000000000000000000000000000000000000000000000000020 |\n // | 0x60:0x7f | value of b | 0x<.............................................................b> |\n // | 0x80:0x9f | value of e | 0x<.............................................................e> |\n // | 0xa0:0xbf | value of m | 0x<.............................................................m> |\n mstore(ptr, 0x20)\n mstore(add(ptr, 0x20), 0x20)\n mstore(add(ptr, 0x40), 0x20)\n mstore(add(ptr, 0x60), b)\n mstore(add(ptr, 0x80), e)\n mstore(add(ptr, 0xa0), m)\n\n // Given the result < m, it's guaranteed to fit in 32 bytes,\n // so we can use the memory scratch space located at offset 0.\n success := staticcall(gas(), 0x05, ptr, 0xc0, 0x00, 0x20)\n result := mload(0x00)\n }\n }\n\n /**\n * @dev Variant of {modExp} that supports inputs of arbitrary length.\n */\n function modExp(bytes memory b, bytes memory e, bytes memory m) internal view returns (bytes memory) {\n (bool success, bytes memory result) = tryModExp(b, e, m);\n if (!success) {\n Panic.panic(Panic.DIVISION_BY_ZERO);\n }\n return result;\n }\n\n /**\n * @dev Variant of {tryModExp} that supports inputs of arbitrary length.\n */\n function tryModExp(\n bytes memory b,\n bytes memory e,\n bytes memory m\n ) internal view returns (bool success, bytes memory result) {\n if (_zeroBytes(m)) return (false, new bytes(0));\n\n uint256 mLen = m.length;\n\n // Encode call args in result and move the free memory pointer\n result = abi.encodePacked(b.length, e.length, mLen, b, e, m);\n\n assembly (\"memory-safe\") {\n let dataPtr := add(result, 0x20)\n // Write result on top of args to avoid allocating extra memory.\n success := staticcall(gas(), 0x05, dataPtr, mload(result), dataPtr, mLen)\n // Overwrite the length.\n // result.length > returndatasize() is guaranteed because returndatasize() == m.length\n mstore(result, mLen)\n // Set the memory pointer after the returned data.\n mstore(0x40, add(dataPtr, mLen))\n }\n }\n\n /**\n * @dev Returns whether the provided byte array is zero.\n */\n function _zeroBytes(bytes memory byteArray) private pure returns (bool) {\n for (uint256 i = 0; i < byteArray.length; ++i) {\n if (byteArray[i] != 0) {\n return false;\n }\n }\n return true;\n }\n\n /**\n * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded\n * towards zero.\n *\n * This method is based on Newton's method for computing square roots; the algorithm is restricted to only\n * using integer operations.\n */\n function sqrt(uint256 a) internal pure returns (uint256) {\n unchecked {\n // Take care of easy edge cases when a == 0 or a == 1\n if (a <= 1) {\n return a;\n }\n\n // In this function, we use Newton's method to get a root of `f(x) := x² - a`. It involves building a\n // sequence x_n that converges toward sqrt(a). For each iteration x_n, we also define the error between\n // the current value as `ε_n = | x_n - sqrt(a) |`.\n //\n // For our first estimation, we consider `e` the smallest power of 2 which is bigger than the square root\n // of the target. (i.e. `2**(e-1) ≤ sqrt(a) < 2**e`). We know that `e ≤ 128` because `(2¹²⁸)² = 2²⁵⁶` is\n // bigger than any uint256.\n //\n // By noticing that\n // `2**(e-1) ≤ sqrt(a) < 2**e → (2**(e-1))² ≤ a < (2**e)² → 2**(2*e-2) ≤ a < 2**(2*e)`\n // we can deduce that `e - 1` is `log2(a) / 2`. We can thus compute `x_n = 2**(e-1)` using a method similar\n // to the msb function.\n uint256 aa = a;\n uint256 xn = 1;\n\n if (aa >= (1 << 128)) {\n aa >>= 128;\n xn <<= 64;\n }\n if (aa >= (1 << 64)) {\n aa >>= 64;\n xn <<= 32;\n }\n if (aa >= (1 << 32)) {\n aa >>= 32;\n xn <<= 16;\n }\n if (aa >= (1 << 16)) {\n aa >>= 16;\n xn <<= 8;\n }\n if (aa >= (1 << 8)) {\n aa >>= 8;\n xn <<= 4;\n }\n if (aa >= (1 << 4)) {\n aa >>= 4;\n xn <<= 2;\n }\n if (aa >= (1 << 2)) {\n xn <<= 1;\n }\n\n // We now have x_n such that `x_n = 2**(e-1) ≤ sqrt(a) < 2**e = 2 * x_n`. This implies ε_n ≤ 2**(e-1).\n //\n // We can refine our estimation by noticing that the middle of that interval minimizes the error.\n // If we move x_n to equal 2**(e-1) + 2**(e-2), then we reduce the error to ε_n ≤ 2**(e-2).\n // This is going to be our x_0 (and ε_0)\n xn = (3 * xn) >> 1; // ε_0 := | x_0 - sqrt(a) | ≤ 2**(e-2)\n\n // From here, Newton's method give us:\n // x_{n+1} = (x_n + a / x_n) / 2\n //\n // One should note that:\n // x_{n+1}² - a = ((x_n + a / x_n) / 2)² - a\n // = ((x_n² + a) / (2 * x_n))² - a\n // = (x_n⁴ + 2 * a * x_n² + a²) / (4 * x_n²) - a\n // = (x_n⁴ + 2 * a * x_n² + a² - 4 * a * x_n²) / (4 * x_n²)\n // = (x_n⁴ - 2 * a * x_n² + a²) / (4 * x_n²)\n // = (x_n² - a)² / (2 * x_n)²\n // = ((x_n² - a) / (2 * x_n))²\n // ≥ 0\n // Which proves that for all n ≥ 1, sqrt(a) ≤ x_n\n //\n // This gives us the proof of quadratic convergence of the sequence:\n // ε_{n+1} = | x_{n+1} - sqrt(a) |\n // = | (x_n + a / x_n) / 2 - sqrt(a) |\n // = | (x_n² + a - 2*x_n*sqrt(a)) / (2 * x_n) |\n // = | (x_n - sqrt(a))² / (2 * x_n) |\n // = | ε_n² / (2 * x_n) |\n // = ε_n² / | (2 * x_n) |\n //\n // For the first iteration, we have a special case where x_0 is known:\n // ε_1 = ε_0² / | (2 * x_0) |\n // ≤ (2**(e-2))² / (2 * (2**(e-1) + 2**(e-2)))\n // ≤ 2**(2*e-4) / (3 * 2**(e-1))\n // ≤ 2**(e-3) / 3\n // ≤ 2**(e-3-log2(3))\n // ≤ 2**(e-4.5)\n //\n // For the following iterations, we use the fact that, 2**(e-1) ≤ sqrt(a) ≤ x_n:\n // ε_{n+1} = ε_n² / | (2 * x_n) |\n // ≤ (2**(e-k))² / (2 * 2**(e-1))\n // ≤ 2**(2*e-2*k) / 2**e\n // ≤ 2**(e-2*k)\n xn = (xn + a / xn) >> 1; // ε_1 := | x_1 - sqrt(a) | ≤ 2**(e-4.5) -- special case, see above\n xn = (xn + a / xn) >> 1; // ε_2 := | x_2 - sqrt(a) | ≤ 2**(e-9) -- general case with k = 4.5\n xn = (xn + a / xn) >> 1; // ε_3 := | x_3 - sqrt(a) | ≤ 2**(e-18) -- general case with k = 9\n xn = (xn + a / xn) >> 1; // ε_4 := | x_4 - sqrt(a) | ≤ 2**(e-36) -- general case with k = 18\n xn = (xn + a / xn) >> 1; // ε_5 := | x_5 - sqrt(a) | ≤ 2**(e-72) -- general case with k = 36\n xn = (xn + a / xn) >> 1; // ε_6 := | x_6 - sqrt(a) | ≤ 2**(e-144) -- general case with k = 72\n\n // Because e ≤ 128 (as discussed during the first estimation phase), we know have reached a precision\n // ε_6 ≤ 2**(e-144) < 1. Given we're operating on integers, then we can ensure that xn is now either\n // sqrt(a) or sqrt(a) + 1.\n return xn - SafeCast.toUint(xn > a / xn);\n }\n }\n\n /**\n * @dev 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 + SafeCast.toUint(unsignedRoundsUp(rounding) && result * result < a);\n }\n }\n\n /**\n * @dev Return the log in base 2 of a positive value rounded towards zero.\n * Returns 0 if given 0.\n */\n function log2(uint256 value) internal pure returns (uint256) {\n uint256 result = 0;\n uint256 exp;\n unchecked {\n exp = 128 * SafeCast.toUint(value > (1 << 128) - 1);\n value >>= exp;\n result += exp;\n\n exp = 64 * SafeCast.toUint(value > (1 << 64) - 1);\n value >>= exp;\n result += exp;\n\n exp = 32 * SafeCast.toUint(value > (1 << 32) - 1);\n value >>= exp;\n result += exp;\n\n exp = 16 * SafeCast.toUint(value > (1 << 16) - 1);\n value >>= exp;\n result += exp;\n\n exp = 8 * SafeCast.toUint(value > (1 << 8) - 1);\n value >>= exp;\n result += exp;\n\n exp = 4 * SafeCast.toUint(value > (1 << 4) - 1);\n value >>= exp;\n result += exp;\n\n exp = 2 * SafeCast.toUint(value > (1 << 2) - 1);\n value >>= exp;\n result += exp;\n\n result += SafeCast.toUint(value > 1);\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 + SafeCast.toUint(unsignedRoundsUp(rounding) && 1 << result < value);\n }\n }\n\n /**\n * @dev Return the log in base 10 of a positive value rounded towards zero.\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 + SafeCast.toUint(unsignedRoundsUp(rounding) && 10 ** result < value);\n }\n }\n\n /**\n * @dev Return the log in base 256 of a positive value rounded towards zero.\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 uint256 isGt;\n unchecked {\n isGt = SafeCast.toUint(value > (1 << 128) - 1);\n value >>= isGt * 128;\n result += isGt * 16;\n\n isGt = SafeCast.toUint(value > (1 << 64) - 1);\n value >>= isGt * 64;\n result += isGt * 8;\n\n isGt = SafeCast.toUint(value > (1 << 32) - 1);\n value >>= isGt * 32;\n result += isGt * 4;\n\n isGt = SafeCast.toUint(value > (1 << 16) - 1);\n value >>= isGt * 16;\n result += isGt * 2;\n\n result += SafeCast.toUint(value > (1 << 8) - 1);\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 + SafeCast.toUint(unsignedRoundsUp(rounding) && 1 << (result << 3) < value);\n }\n }\n\n /**\n * @dev Returns whether a provided rounding mode is considered rounding up for unsigned integers.\n */\n function unsignedRoundsUp(Rounding rounding) internal pure returns (bool) {\n return uint8(rounding) % 2 == 1;\n }\n}\n" + }, + "@openzeppelin/contracts/utils/math/SafeCast.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/math/SafeCast.sol)\n// This file was procedurally generated from scripts/generate/templates/SafeCast.js.\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Wrappers over Solidity's uintXX/intXX/bool casting operators with added overflow\n * checks.\n *\n * Downcasting from uint256/int256 in Solidity does not revert on overflow. This can\n * easily result in undesired exploitation or bugs, since developers usually\n * assume that overflows raise errors. `SafeCast` restores this intuition by\n * reverting the transaction when such an operation overflows.\n *\n * Using this library instead of the unchecked operations eliminates an entire\n * class of bugs, so it's recommended to use it always.\n */\nlibrary SafeCast {\n /**\n * @dev Value doesn't fit in an uint of `bits` size.\n */\n error SafeCastOverflowedUintDowncast(uint8 bits, uint256 value);\n\n /**\n * @dev An int value doesn't fit in an uint of `bits` size.\n */\n error SafeCastOverflowedIntToUint(int256 value);\n\n /**\n * @dev Value doesn't fit in an int of `bits` size.\n */\n error SafeCastOverflowedIntDowncast(uint8 bits, int256 value);\n\n /**\n * @dev An uint value doesn't fit in an int of `bits` size.\n */\n error SafeCastOverflowedUintToInt(uint256 value);\n\n /**\n * @dev Returns the downcasted uint248 from uint256, reverting on\n * overflow (when the input is greater than largest uint248).\n *\n * Counterpart to Solidity's `uint248` operator.\n *\n * Requirements:\n *\n * - input must fit into 248 bits\n */\n function toUint248(uint256 value) internal pure returns (uint248) {\n if (value > type(uint248).max) {\n revert SafeCastOverflowedUintDowncast(248, value);\n }\n return uint248(value);\n }\n\n /**\n * @dev Returns the downcasted uint240 from uint256, reverting on\n * overflow (when the input is greater than largest uint240).\n *\n * Counterpart to Solidity's `uint240` operator.\n *\n * Requirements:\n *\n * - input must fit into 240 bits\n */\n function toUint240(uint256 value) internal pure returns (uint240) {\n if (value > type(uint240).max) {\n revert SafeCastOverflowedUintDowncast(240, value);\n }\n return uint240(value);\n }\n\n /**\n * @dev Returns the downcasted uint232 from uint256, reverting on\n * overflow (when the input is greater than largest uint232).\n *\n * Counterpart to Solidity's `uint232` operator.\n *\n * Requirements:\n *\n * - input must fit into 232 bits\n */\n function toUint232(uint256 value) internal pure returns (uint232) {\n if (value > type(uint232).max) {\n revert SafeCastOverflowedUintDowncast(232, value);\n }\n return uint232(value);\n }\n\n /**\n * @dev Returns the downcasted uint224 from uint256, reverting on\n * overflow (when the input is greater than largest uint224).\n *\n * Counterpart to Solidity's `uint224` operator.\n *\n * Requirements:\n *\n * - input must fit into 224 bits\n */\n function toUint224(uint256 value) internal pure returns (uint224) {\n if (value > type(uint224).max) {\n revert SafeCastOverflowedUintDowncast(224, value);\n }\n return uint224(value);\n }\n\n /**\n * @dev Returns the downcasted uint216 from uint256, reverting on\n * overflow (when the input is greater than largest uint216).\n *\n * Counterpart to Solidity's `uint216` operator.\n *\n * Requirements:\n *\n * - input must fit into 216 bits\n */\n function toUint216(uint256 value) internal pure returns (uint216) {\n if (value > type(uint216).max) {\n revert SafeCastOverflowedUintDowncast(216, value);\n }\n return uint216(value);\n }\n\n /**\n * @dev Returns the downcasted uint208 from uint256, reverting on\n * overflow (when the input is greater than largest uint208).\n *\n * Counterpart to Solidity's `uint208` operator.\n *\n * Requirements:\n *\n * - input must fit into 208 bits\n */\n function toUint208(uint256 value) internal pure returns (uint208) {\n if (value > type(uint208).max) {\n revert SafeCastOverflowedUintDowncast(208, value);\n }\n return uint208(value);\n }\n\n /**\n * @dev Returns the downcasted uint200 from uint256, reverting on\n * overflow (when the input is greater than largest uint200).\n *\n * Counterpart to Solidity's `uint200` operator.\n *\n * Requirements:\n *\n * - input must fit into 200 bits\n */\n function toUint200(uint256 value) internal pure returns (uint200) {\n if (value > type(uint200).max) {\n revert SafeCastOverflowedUintDowncast(200, value);\n }\n return uint200(value);\n }\n\n /**\n * @dev Returns the downcasted uint192 from uint256, reverting on\n * overflow (when the input is greater than largest uint192).\n *\n * Counterpart to Solidity's `uint192` operator.\n *\n * Requirements:\n *\n * - input must fit into 192 bits\n */\n function toUint192(uint256 value) internal pure returns (uint192) {\n if (value > type(uint192).max) {\n revert SafeCastOverflowedUintDowncast(192, value);\n }\n return uint192(value);\n }\n\n /**\n * @dev Returns the downcasted uint184 from uint256, reverting on\n * overflow (when the input is greater than largest uint184).\n *\n * Counterpart to Solidity's `uint184` operator.\n *\n * Requirements:\n *\n * - input must fit into 184 bits\n */\n function toUint184(uint256 value) internal pure returns (uint184) {\n if (value > type(uint184).max) {\n revert SafeCastOverflowedUintDowncast(184, value);\n }\n return uint184(value);\n }\n\n /**\n * @dev Returns the downcasted uint176 from uint256, reverting on\n * overflow (when the input is greater than largest uint176).\n *\n * Counterpart to Solidity's `uint176` operator.\n *\n * Requirements:\n *\n * - input must fit into 176 bits\n */\n function toUint176(uint256 value) internal pure returns (uint176) {\n if (value > type(uint176).max) {\n revert SafeCastOverflowedUintDowncast(176, value);\n }\n return uint176(value);\n }\n\n /**\n * @dev Returns the downcasted uint168 from uint256, reverting on\n * overflow (when the input is greater than largest uint168).\n *\n * Counterpart to Solidity's `uint168` operator.\n *\n * Requirements:\n *\n * - input must fit into 168 bits\n */\n function toUint168(uint256 value) internal pure returns (uint168) {\n if (value > type(uint168).max) {\n revert SafeCastOverflowedUintDowncast(168, value);\n }\n return uint168(value);\n }\n\n /**\n * @dev Returns the downcasted uint160 from uint256, reverting on\n * overflow (when the input is greater than largest uint160).\n *\n * Counterpart to Solidity's `uint160` operator.\n *\n * Requirements:\n *\n * - input must fit into 160 bits\n */\n function toUint160(uint256 value) internal pure returns (uint160) {\n if (value > type(uint160).max) {\n revert SafeCastOverflowedUintDowncast(160, value);\n }\n return uint160(value);\n }\n\n /**\n * @dev Returns the downcasted uint152 from uint256, reverting on\n * overflow (when the input is greater than largest uint152).\n *\n * Counterpart to Solidity's `uint152` operator.\n *\n * Requirements:\n *\n * - input must fit into 152 bits\n */\n function toUint152(uint256 value) internal pure returns (uint152) {\n if (value > type(uint152).max) {\n revert SafeCastOverflowedUintDowncast(152, value);\n }\n return uint152(value);\n }\n\n /**\n * @dev Returns the downcasted uint144 from uint256, reverting on\n * overflow (when the input is greater than largest uint144).\n *\n * Counterpart to Solidity's `uint144` operator.\n *\n * Requirements:\n *\n * - input must fit into 144 bits\n */\n function toUint144(uint256 value) internal pure returns (uint144) {\n if (value > type(uint144).max) {\n revert SafeCastOverflowedUintDowncast(144, value);\n }\n return uint144(value);\n }\n\n /**\n * @dev Returns the downcasted uint136 from uint256, reverting on\n * overflow (when the input is greater than largest uint136).\n *\n * Counterpart to Solidity's `uint136` operator.\n *\n * Requirements:\n *\n * - input must fit into 136 bits\n */\n function toUint136(uint256 value) internal pure returns (uint136) {\n if (value > type(uint136).max) {\n revert SafeCastOverflowedUintDowncast(136, value);\n }\n return uint136(value);\n }\n\n /**\n * @dev Returns the downcasted uint128 from uint256, reverting on\n * overflow (when the input is greater than largest uint128).\n *\n * Counterpart to Solidity's `uint128` operator.\n *\n * Requirements:\n *\n * - input must fit into 128 bits\n */\n function toUint128(uint256 value) internal pure returns (uint128) {\n if (value > type(uint128).max) {\n revert SafeCastOverflowedUintDowncast(128, value);\n }\n return uint128(value);\n }\n\n /**\n * @dev Returns the downcasted uint120 from uint256, reverting on\n * overflow (when the input is greater than largest uint120).\n *\n * Counterpart to Solidity's `uint120` operator.\n *\n * Requirements:\n *\n * - input must fit into 120 bits\n */\n function toUint120(uint256 value) internal pure returns (uint120) {\n if (value > type(uint120).max) {\n revert SafeCastOverflowedUintDowncast(120, value);\n }\n return uint120(value);\n }\n\n /**\n * @dev Returns the downcasted uint112 from uint256, reverting on\n * overflow (when the input is greater than largest uint112).\n *\n * Counterpart to Solidity's `uint112` operator.\n *\n * Requirements:\n *\n * - input must fit into 112 bits\n */\n function toUint112(uint256 value) internal pure returns (uint112) {\n if (value > type(uint112).max) {\n revert SafeCastOverflowedUintDowncast(112, value);\n }\n return uint112(value);\n }\n\n /**\n * @dev Returns the downcasted uint104 from uint256, reverting on\n * overflow (when the input is greater than largest uint104).\n *\n * Counterpart to Solidity's `uint104` operator.\n *\n * Requirements:\n *\n * - input must fit into 104 bits\n */\n function toUint104(uint256 value) internal pure returns (uint104) {\n if (value > type(uint104).max) {\n revert SafeCastOverflowedUintDowncast(104, value);\n }\n return uint104(value);\n }\n\n /**\n * @dev Returns the downcasted uint96 from uint256, reverting on\n * overflow (when the input is greater than largest uint96).\n *\n * Counterpart to Solidity's `uint96` operator.\n *\n * Requirements:\n *\n * - input must fit into 96 bits\n */\n function toUint96(uint256 value) internal pure returns (uint96) {\n if (value > type(uint96).max) {\n revert SafeCastOverflowedUintDowncast(96, value);\n }\n return uint96(value);\n }\n\n /**\n * @dev Returns the downcasted uint88 from uint256, reverting on\n * overflow (when the input is greater than largest uint88).\n *\n * Counterpart to Solidity's `uint88` operator.\n *\n * Requirements:\n *\n * - input must fit into 88 bits\n */\n function toUint88(uint256 value) internal pure returns (uint88) {\n if (value > type(uint88).max) {\n revert SafeCastOverflowedUintDowncast(88, value);\n }\n return uint88(value);\n }\n\n /**\n * @dev Returns the downcasted uint80 from uint256, reverting on\n * overflow (when the input is greater than largest uint80).\n *\n * Counterpart to Solidity's `uint80` operator.\n *\n * Requirements:\n *\n * - input must fit into 80 bits\n */\n function toUint80(uint256 value) internal pure returns (uint80) {\n if (value > type(uint80).max) {\n revert SafeCastOverflowedUintDowncast(80, value);\n }\n return uint80(value);\n }\n\n /**\n * @dev Returns the downcasted uint72 from uint256, reverting on\n * overflow (when the input is greater than largest uint72).\n *\n * Counterpart to Solidity's `uint72` operator.\n *\n * Requirements:\n *\n * - input must fit into 72 bits\n */\n function toUint72(uint256 value) internal pure returns (uint72) {\n if (value > type(uint72).max) {\n revert SafeCastOverflowedUintDowncast(72, value);\n }\n return uint72(value);\n }\n\n /**\n * @dev Returns the downcasted uint64 from uint256, reverting on\n * overflow (when the input is greater than largest uint64).\n *\n * Counterpart to Solidity's `uint64` operator.\n *\n * Requirements:\n *\n * - input must fit into 64 bits\n */\n function toUint64(uint256 value) internal pure returns (uint64) {\n if (value > type(uint64).max) {\n revert SafeCastOverflowedUintDowncast(64, value);\n }\n return uint64(value);\n }\n\n /**\n * @dev Returns the downcasted uint56 from uint256, reverting on\n * overflow (when the input is greater than largest uint56).\n *\n * Counterpart to Solidity's `uint56` operator.\n *\n * Requirements:\n *\n * - input must fit into 56 bits\n */\n function toUint56(uint256 value) internal pure returns (uint56) {\n if (value > type(uint56).max) {\n revert SafeCastOverflowedUintDowncast(56, value);\n }\n return uint56(value);\n }\n\n /**\n * @dev Returns the downcasted uint48 from uint256, reverting on\n * overflow (when the input is greater than largest uint48).\n *\n * Counterpart to Solidity's `uint48` operator.\n *\n * Requirements:\n *\n * - input must fit into 48 bits\n */\n function toUint48(uint256 value) internal pure returns (uint48) {\n if (value > type(uint48).max) {\n revert SafeCastOverflowedUintDowncast(48, value);\n }\n return uint48(value);\n }\n\n /**\n * @dev Returns the downcasted uint40 from uint256, reverting on\n * overflow (when the input is greater than largest uint40).\n *\n * Counterpart to Solidity's `uint40` operator.\n *\n * Requirements:\n *\n * - input must fit into 40 bits\n */\n function toUint40(uint256 value) internal pure returns (uint40) {\n if (value > type(uint40).max) {\n revert SafeCastOverflowedUintDowncast(40, value);\n }\n return uint40(value);\n }\n\n /**\n * @dev Returns the downcasted uint32 from uint256, reverting on\n * overflow (when the input is greater than largest uint32).\n *\n * Counterpart to Solidity's `uint32` operator.\n *\n * Requirements:\n *\n * - input must fit into 32 bits\n */\n function toUint32(uint256 value) internal pure returns (uint32) {\n if (value > type(uint32).max) {\n revert SafeCastOverflowedUintDowncast(32, value);\n }\n return uint32(value);\n }\n\n /**\n * @dev Returns the downcasted uint24 from uint256, reverting on\n * overflow (when the input is greater than largest uint24).\n *\n * Counterpart to Solidity's `uint24` operator.\n *\n * Requirements:\n *\n * - input must fit into 24 bits\n */\n function toUint24(uint256 value) internal pure returns (uint24) {\n if (value > type(uint24).max) {\n revert SafeCastOverflowedUintDowncast(24, value);\n }\n return uint24(value);\n }\n\n /**\n * @dev Returns the downcasted uint16 from uint256, reverting on\n * overflow (when the input is greater than largest uint16).\n *\n * Counterpart to Solidity's `uint16` operator.\n *\n * Requirements:\n *\n * - input must fit into 16 bits\n */\n function toUint16(uint256 value) internal pure returns (uint16) {\n if (value > type(uint16).max) {\n revert SafeCastOverflowedUintDowncast(16, value);\n }\n return uint16(value);\n }\n\n /**\n * @dev Returns the downcasted uint8 from uint256, reverting on\n * overflow (when the input is greater than largest uint8).\n *\n * Counterpart to Solidity's `uint8` operator.\n *\n * Requirements:\n *\n * - input must fit into 8 bits\n */\n function toUint8(uint256 value) internal pure returns (uint8) {\n if (value > type(uint8).max) {\n revert SafeCastOverflowedUintDowncast(8, value);\n }\n return uint8(value);\n }\n\n /**\n * @dev Converts a signed int256 into an unsigned uint256.\n *\n * Requirements:\n *\n * - input must be greater than or equal to 0.\n */\n function toUint256(int256 value) internal pure returns (uint256) {\n if (value < 0) {\n revert SafeCastOverflowedIntToUint(value);\n }\n return uint256(value);\n }\n\n /**\n * @dev Returns the downcasted int248 from int256, reverting on\n * overflow (when the input is less than smallest int248 or\n * greater than largest int248).\n *\n * Counterpart to Solidity's `int248` operator.\n *\n * Requirements:\n *\n * - input must fit into 248 bits\n */\n function toInt248(int256 value) internal pure returns (int248 downcasted) {\n downcasted = int248(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(248, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int240 from int256, reverting on\n * overflow (when the input is less than smallest int240 or\n * greater than largest int240).\n *\n * Counterpart to Solidity's `int240` operator.\n *\n * Requirements:\n *\n * - input must fit into 240 bits\n */\n function toInt240(int256 value) internal pure returns (int240 downcasted) {\n downcasted = int240(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(240, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int232 from int256, reverting on\n * overflow (when the input is less than smallest int232 or\n * greater than largest int232).\n *\n * Counterpart to Solidity's `int232` operator.\n *\n * Requirements:\n *\n * - input must fit into 232 bits\n */\n function toInt232(int256 value) internal pure returns (int232 downcasted) {\n downcasted = int232(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(232, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int224 from int256, reverting on\n * overflow (when the input is less than smallest int224 or\n * greater than largest int224).\n *\n * Counterpart to Solidity's `int224` operator.\n *\n * Requirements:\n *\n * - input must fit into 224 bits\n */\n function toInt224(int256 value) internal pure returns (int224 downcasted) {\n downcasted = int224(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(224, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int216 from int256, reverting on\n * overflow (when the input is less than smallest int216 or\n * greater than largest int216).\n *\n * Counterpart to Solidity's `int216` operator.\n *\n * Requirements:\n *\n * - input must fit into 216 bits\n */\n function toInt216(int256 value) internal pure returns (int216 downcasted) {\n downcasted = int216(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(216, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int208 from int256, reverting on\n * overflow (when the input is less than smallest int208 or\n * greater than largest int208).\n *\n * Counterpart to Solidity's `int208` operator.\n *\n * Requirements:\n *\n * - input must fit into 208 bits\n */\n function toInt208(int256 value) internal pure returns (int208 downcasted) {\n downcasted = int208(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(208, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int200 from int256, reverting on\n * overflow (when the input is less than smallest int200 or\n * greater than largest int200).\n *\n * Counterpart to Solidity's `int200` operator.\n *\n * Requirements:\n *\n * - input must fit into 200 bits\n */\n function toInt200(int256 value) internal pure returns (int200 downcasted) {\n downcasted = int200(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(200, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int192 from int256, reverting on\n * overflow (when the input is less than smallest int192 or\n * greater than largest int192).\n *\n * Counterpart to Solidity's `int192` operator.\n *\n * Requirements:\n *\n * - input must fit into 192 bits\n */\n function toInt192(int256 value) internal pure returns (int192 downcasted) {\n downcasted = int192(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(192, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int184 from int256, reverting on\n * overflow (when the input is less than smallest int184 or\n * greater than largest int184).\n *\n * Counterpart to Solidity's `int184` operator.\n *\n * Requirements:\n *\n * - input must fit into 184 bits\n */\n function toInt184(int256 value) internal pure returns (int184 downcasted) {\n downcasted = int184(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(184, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int176 from int256, reverting on\n * overflow (when the input is less than smallest int176 or\n * greater than largest int176).\n *\n * Counterpart to Solidity's `int176` operator.\n *\n * Requirements:\n *\n * - input must fit into 176 bits\n */\n function toInt176(int256 value) internal pure returns (int176 downcasted) {\n downcasted = int176(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(176, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int168 from int256, reverting on\n * overflow (when the input is less than smallest int168 or\n * greater than largest int168).\n *\n * Counterpart to Solidity's `int168` operator.\n *\n * Requirements:\n *\n * - input must fit into 168 bits\n */\n function toInt168(int256 value) internal pure returns (int168 downcasted) {\n downcasted = int168(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(168, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int160 from int256, reverting on\n * overflow (when the input is less than smallest int160 or\n * greater than largest int160).\n *\n * Counterpart to Solidity's `int160` operator.\n *\n * Requirements:\n *\n * - input must fit into 160 bits\n */\n function toInt160(int256 value) internal pure returns (int160 downcasted) {\n downcasted = int160(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(160, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int152 from int256, reverting on\n * overflow (when the input is less than smallest int152 or\n * greater than largest int152).\n *\n * Counterpart to Solidity's `int152` operator.\n *\n * Requirements:\n *\n * - input must fit into 152 bits\n */\n function toInt152(int256 value) internal pure returns (int152 downcasted) {\n downcasted = int152(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(152, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int144 from int256, reverting on\n * overflow (when the input is less than smallest int144 or\n * greater than largest int144).\n *\n * Counterpart to Solidity's `int144` operator.\n *\n * Requirements:\n *\n * - input must fit into 144 bits\n */\n function toInt144(int256 value) internal pure returns (int144 downcasted) {\n downcasted = int144(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(144, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int136 from int256, reverting on\n * overflow (when the input is less than smallest int136 or\n * greater than largest int136).\n *\n * Counterpart to Solidity's `int136` operator.\n *\n * Requirements:\n *\n * - input must fit into 136 bits\n */\n function toInt136(int256 value) internal pure returns (int136 downcasted) {\n downcasted = int136(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(136, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int128 from int256, reverting on\n * overflow (when the input is less than smallest int128 or\n * greater than largest int128).\n *\n * Counterpart to Solidity's `int128` operator.\n *\n * Requirements:\n *\n * - input must fit into 128 bits\n */\n function toInt128(int256 value) internal pure returns (int128 downcasted) {\n downcasted = int128(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(128, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int120 from int256, reverting on\n * overflow (when the input is less than smallest int120 or\n * greater than largest int120).\n *\n * Counterpart to Solidity's `int120` operator.\n *\n * Requirements:\n *\n * - input must fit into 120 bits\n */\n function toInt120(int256 value) internal pure returns (int120 downcasted) {\n downcasted = int120(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(120, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int112 from int256, reverting on\n * overflow (when the input is less than smallest int112 or\n * greater than largest int112).\n *\n * Counterpart to Solidity's `int112` operator.\n *\n * Requirements:\n *\n * - input must fit into 112 bits\n */\n function toInt112(int256 value) internal pure returns (int112 downcasted) {\n downcasted = int112(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(112, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int104 from int256, reverting on\n * overflow (when the input is less than smallest int104 or\n * greater than largest int104).\n *\n * Counterpart to Solidity's `int104` operator.\n *\n * Requirements:\n *\n * - input must fit into 104 bits\n */\n function toInt104(int256 value) internal pure returns (int104 downcasted) {\n downcasted = int104(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(104, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int96 from int256, reverting on\n * overflow (when the input is less than smallest int96 or\n * greater than largest int96).\n *\n * Counterpart to Solidity's `int96` operator.\n *\n * Requirements:\n *\n * - input must fit into 96 bits\n */\n function toInt96(int256 value) internal pure returns (int96 downcasted) {\n downcasted = int96(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(96, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int88 from int256, reverting on\n * overflow (when the input is less than smallest int88 or\n * greater than largest int88).\n *\n * Counterpart to Solidity's `int88` operator.\n *\n * Requirements:\n *\n * - input must fit into 88 bits\n */\n function toInt88(int256 value) internal pure returns (int88 downcasted) {\n downcasted = int88(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(88, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int80 from int256, reverting on\n * overflow (when the input is less than smallest int80 or\n * greater than largest int80).\n *\n * Counterpart to Solidity's `int80` operator.\n *\n * Requirements:\n *\n * - input must fit into 80 bits\n */\n function toInt80(int256 value) internal pure returns (int80 downcasted) {\n downcasted = int80(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(80, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int72 from int256, reverting on\n * overflow (when the input is less than smallest int72 or\n * greater than largest int72).\n *\n * Counterpart to Solidity's `int72` operator.\n *\n * Requirements:\n *\n * - input must fit into 72 bits\n */\n function toInt72(int256 value) internal pure returns (int72 downcasted) {\n downcasted = int72(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(72, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int64 from int256, reverting on\n * overflow (when the input is less than smallest int64 or\n * greater than largest int64).\n *\n * Counterpart to Solidity's `int64` operator.\n *\n * Requirements:\n *\n * - input must fit into 64 bits\n */\n function toInt64(int256 value) internal pure returns (int64 downcasted) {\n downcasted = int64(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(64, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int56 from int256, reverting on\n * overflow (when the input is less than smallest int56 or\n * greater than largest int56).\n *\n * Counterpart to Solidity's `int56` operator.\n *\n * Requirements:\n *\n * - input must fit into 56 bits\n */\n function toInt56(int256 value) internal pure returns (int56 downcasted) {\n downcasted = int56(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(56, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int48 from int256, reverting on\n * overflow (when the input is less than smallest int48 or\n * greater than largest int48).\n *\n * Counterpart to Solidity's `int48` operator.\n *\n * Requirements:\n *\n * - input must fit into 48 bits\n */\n function toInt48(int256 value) internal pure returns (int48 downcasted) {\n downcasted = int48(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(48, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int40 from int256, reverting on\n * overflow (when the input is less than smallest int40 or\n * greater than largest int40).\n *\n * Counterpart to Solidity's `int40` operator.\n *\n * Requirements:\n *\n * - input must fit into 40 bits\n */\n function toInt40(int256 value) internal pure returns (int40 downcasted) {\n downcasted = int40(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(40, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int32 from int256, reverting on\n * overflow (when the input is less than smallest int32 or\n * greater than largest int32).\n *\n * Counterpart to Solidity's `int32` operator.\n *\n * Requirements:\n *\n * - input must fit into 32 bits\n */\n function toInt32(int256 value) internal pure returns (int32 downcasted) {\n downcasted = int32(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(32, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int24 from int256, reverting on\n * overflow (when the input is less than smallest int24 or\n * greater than largest int24).\n *\n * Counterpart to Solidity's `int24` operator.\n *\n * Requirements:\n *\n * - input must fit into 24 bits\n */\n function toInt24(int256 value) internal pure returns (int24 downcasted) {\n downcasted = int24(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(24, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int16 from int256, reverting on\n * overflow (when the input is less than smallest int16 or\n * greater than largest int16).\n *\n * Counterpart to Solidity's `int16` operator.\n *\n * Requirements:\n *\n * - input must fit into 16 bits\n */\n function toInt16(int256 value) internal pure returns (int16 downcasted) {\n downcasted = int16(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(16, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int8 from int256, reverting on\n * overflow (when the input is less than smallest int8 or\n * greater than largest int8).\n *\n * Counterpart to Solidity's `int8` operator.\n *\n * Requirements:\n *\n * - input must fit into 8 bits\n */\n function toInt8(int256 value) internal pure returns (int8 downcasted) {\n downcasted = int8(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(8, value);\n }\n }\n\n /**\n * @dev Converts an unsigned uint256 into a signed int256.\n *\n * Requirements:\n *\n * - input must be less than or equal to maxInt256.\n */\n function toInt256(uint256 value) internal pure returns (int256) {\n // Note: Unsafe cast below is okay because `type(int256).max` is guaranteed to be positive\n if (value > uint256(type(int256).max)) {\n revert SafeCastOverflowedUintToInt(value);\n }\n return int256(value);\n }\n\n /**\n * @dev Cast a boolean (false or true) to a uint256 (0 or 1) with no jump.\n */\n function toUint(bool b) internal pure returns (uint256 u) {\n assembly (\"memory-safe\") {\n u := iszero(iszero(b))\n }\n }\n}\n" + }, + "@openzeppelin/contracts/utils/math/SignedMath.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/math/SignedMath.sol)\n\npragma solidity ^0.8.20;\n\nimport {SafeCast} from \"./SafeCast.sol\";\n\n/**\n * @dev Standard signed math utilities missing in the Solidity language.\n */\nlibrary SignedMath {\n /**\n * @dev Branchless ternary evaluation for `a ? b : c`. Gas costs are constant.\n *\n * IMPORTANT: This function may reduce bytecode size and consume less gas when used standalone.\n * However, the compiler may optimize Solidity ternary operations (i.e. `a ? b : c`) to only compute\n * one branch when needed, making this function more expensive.\n */\n function ternary(bool condition, int256 a, int256 b) internal pure returns (int256) {\n unchecked {\n // branchless ternary works because:\n // b ^ (a ^ b) == a\n // b ^ 0 == b\n return b ^ ((a ^ b) * int256(SafeCast.toUint(condition)));\n }\n }\n\n /**\n * @dev Returns the largest of two signed numbers.\n */\n function max(int256 a, int256 b) internal pure returns (int256) {\n return ternary(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 ternary(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 // Formula from the \"Bit Twiddling Hacks\" by Sean Eron Anderson.\n // Since `n` is a signed integer, the generated bytecode will use the SAR opcode to perform the right shift,\n // taking advantage of the most significant (or \"sign\" bit) in two's complement representation.\n // This opcode adds new most significant bits set to the value of the previous most significant bit. As a result,\n // the mask will either be `bytes32(0)` (if n is positive) or `~bytes32(0)` (if n is negative).\n int256 mask = n >> 255;\n\n // A `bytes32(0)` mask leaves the input unchanged, while a `~bytes32(0)` mask complements it.\n return uint256((n + mask) ^ mask);\n }\n }\n}\n" + }, + "@openzeppelin/contracts/utils/Nonces.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/Nonces.sol)\npragma solidity ^0.8.20;\n\n/**\n * @dev Provides tracking nonces for addresses. Nonces will only increment.\n */\nabstract contract Nonces {\n /**\n * @dev The nonce used for an `account` is not the expected current nonce.\n */\n error InvalidAccountNonce(address account, uint256 currentNonce);\n\n mapping(address account => uint256) private _nonces;\n\n /**\n * @dev Returns the next unused nonce for an address.\n */\n function nonces(address owner) public view virtual returns (uint256) {\n return _nonces[owner];\n }\n\n /**\n * @dev Consumes a nonce.\n *\n * Returns the current value and increments nonce.\n */\n function _useNonce(address owner) internal virtual returns (uint256) {\n // For each account, the nonce has an initial value of 0, can only be incremented by one, and cannot be\n // decremented or reset. This guarantees that the nonce never overflows.\n unchecked {\n // It is important to do x++ and not ++x here.\n return _nonces[owner]++;\n }\n }\n\n /**\n * @dev Same as {_useNonce} but checking that `nonce` is the next valid for `owner`.\n */\n function _useCheckedNonce(address owner, uint256 nonce) internal virtual {\n uint256 current = _useNonce(owner);\n if (nonce != current) {\n revert InvalidAccountNonce(owner, current);\n }\n }\n}\n" + }, + "@openzeppelin/contracts/utils/Panic.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/Panic.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Helper library for emitting standardized panic codes.\n *\n * ```solidity\n * contract Example {\n * using Panic for uint256;\n *\n * // Use any of the declared internal constants\n * function foo() { Panic.GENERIC.panic(); }\n *\n * // Alternatively\n * function foo() { Panic.panic(Panic.GENERIC); }\n * }\n * ```\n *\n * Follows the list from https://github.com/ethereum/solidity/blob/v0.8.24/libsolutil/ErrorCodes.h[libsolutil].\n *\n * _Available since v5.1._\n */\n// slither-disable-next-line unused-state\nlibrary Panic {\n /// @dev generic / unspecified error\n uint256 internal constant GENERIC = 0x00;\n /// @dev used by the assert() builtin\n uint256 internal constant ASSERT = 0x01;\n /// @dev arithmetic underflow or overflow\n uint256 internal constant UNDER_OVERFLOW = 0x11;\n /// @dev division or modulo by zero\n uint256 internal constant DIVISION_BY_ZERO = 0x12;\n /// @dev enum conversion error\n uint256 internal constant ENUM_CONVERSION_ERROR = 0x21;\n /// @dev invalid encoding in storage\n uint256 internal constant STORAGE_ENCODING_ERROR = 0x22;\n /// @dev empty array pop\n uint256 internal constant EMPTY_ARRAY_POP = 0x31;\n /// @dev array out of bounds access\n uint256 internal constant ARRAY_OUT_OF_BOUNDS = 0x32;\n /// @dev resource error (too large allocation or too large array)\n uint256 internal constant RESOURCE_ERROR = 0x41;\n /// @dev calling invalid internal function\n uint256 internal constant INVALID_INTERNAL_FUNCTION = 0x51;\n\n /// @dev Reverts with a panic code. Recommended to use with\n /// the internal constants with predefined codes.\n function panic(uint256 code) internal pure {\n assembly (\"memory-safe\") {\n mstore(0x00, 0x4e487b71)\n mstore(0x20, code)\n revert(0x1c, 0x24)\n }\n }\n}\n" + }, + "@openzeppelin/contracts/utils/ShortStrings.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/ShortStrings.sol)\n\npragma solidity ^0.8.20;\n\nimport {StorageSlot} from \"./StorageSlot.sol\";\n\n// | string | 0xAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA |\n// | length | 0x BB |\ntype ShortString is bytes32;\n\n/**\n * @dev This library provides functions to convert short memory strings\n * into a `ShortString` type that can be used as an immutable variable.\n *\n * Strings of arbitrary length can be optimized using this library if\n * they are short enough (up to 31 bytes) by packing them with their\n * length (1 byte) in a single EVM word (32 bytes). Additionally, a\n * fallback mechanism can be used for every other case.\n *\n * Usage example:\n *\n * ```solidity\n * contract Named {\n * using ShortStrings for *;\n *\n * ShortString private immutable _name;\n * string private _nameFallback;\n *\n * constructor(string memory contractName) {\n * _name = contractName.toShortStringWithFallback(_nameFallback);\n * }\n *\n * function name() external view returns (string memory) {\n * return _name.toStringWithFallback(_nameFallback);\n * }\n * }\n * ```\n */\nlibrary ShortStrings {\n // Used as an identifier for strings longer than 31 bytes.\n bytes32 private constant FALLBACK_SENTINEL = 0x00000000000000000000000000000000000000000000000000000000000000FF;\n\n error StringTooLong(string str);\n error InvalidShortString();\n\n /**\n * @dev Encode a string of at most 31 chars into a `ShortString`.\n *\n * This will trigger a `StringTooLong` error is the input string is too long.\n */\n function toShortString(string memory str) internal pure returns (ShortString) {\n bytes memory bstr = bytes(str);\n if (bstr.length > 31) {\n revert StringTooLong(str);\n }\n return ShortString.wrap(bytes32(uint256(bytes32(bstr)) | bstr.length));\n }\n\n /**\n * @dev Decode a `ShortString` back to a \"normal\" string.\n */\n function toString(ShortString sstr) internal pure returns (string memory) {\n uint256 len = byteLength(sstr);\n // using `new string(len)` would work locally but is not memory safe.\n string memory str = new string(32);\n assembly (\"memory-safe\") {\n mstore(str, len)\n mstore(add(str, 0x20), sstr)\n }\n return str;\n }\n\n /**\n * @dev Return the length of a `ShortString`.\n */\n function byteLength(ShortString sstr) internal pure returns (uint256) {\n uint256 result = uint256(ShortString.unwrap(sstr)) & 0xFF;\n if (result > 31) {\n revert InvalidShortString();\n }\n return result;\n }\n\n /**\n * @dev Encode a string into a `ShortString`, or write it to storage if it is too long.\n */\n function toShortStringWithFallback(string memory value, string storage store) internal returns (ShortString) {\n if (bytes(value).length < 32) {\n return toShortString(value);\n } else {\n StorageSlot.getStringSlot(store).value = value;\n return ShortString.wrap(FALLBACK_SENTINEL);\n }\n }\n\n /**\n * @dev Decode a string that was encoded to `ShortString` or written to storage using {setWithFallback}.\n */\n function toStringWithFallback(ShortString value, string storage store) internal pure returns (string memory) {\n if (ShortString.unwrap(value) != FALLBACK_SENTINEL) {\n return toString(value);\n } else {\n return store;\n }\n }\n\n /**\n * @dev Return the length of a string that was encoded to `ShortString` or written to storage using\n * {setWithFallback}.\n *\n * WARNING: This will return the \"byte length\" of the string. This may not reflect the actual length in terms of\n * actual characters as the UTF-8 encoding of a single character can span over multiple bytes.\n */\n function byteLengthWithFallback(ShortString value, string storage store) internal view returns (uint256) {\n if (ShortString.unwrap(value) != FALLBACK_SENTINEL) {\n return byteLength(value);\n } else {\n return bytes(store).length;\n }\n }\n}\n" + }, + "@openzeppelin/contracts/utils/StorageSlot.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/StorageSlot.sol)\n// This file was procedurally generated from scripts/generate/templates/StorageSlot.js.\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Library for reading and writing primitive types to specific storage slots.\n *\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\n * This library helps with reading and writing to such slots without the need for inline assembly.\n *\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\n *\n * Example usage to set ERC-1967 implementation slot:\n * ```solidity\n * contract ERC1967 {\n * // Define the slot. Alternatively, use the SlotDerivation library to derive the slot.\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\n *\n * function _getImplementation() internal view returns (address) {\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\n * }\n *\n * function _setImplementation(address newImplementation) internal {\n * require(newImplementation.code.length > 0);\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\n * }\n * }\n * ```\n *\n * TIP: Consider using this library along with {SlotDerivation}.\n */\nlibrary StorageSlot {\n struct AddressSlot {\n address value;\n }\n\n struct BooleanSlot {\n bool value;\n }\n\n struct Bytes32Slot {\n bytes32 value;\n }\n\n struct Uint256Slot {\n uint256 value;\n }\n\n struct Int256Slot {\n int256 value;\n }\n\n struct StringSlot {\n string value;\n }\n\n struct BytesSlot {\n bytes value;\n }\n\n /**\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\n */\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\n assembly (\"memory-safe\") {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns a `BooleanSlot` with member `value` located at `slot`.\n */\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\n assembly (\"memory-safe\") {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns a `Bytes32Slot` with member `value` located at `slot`.\n */\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\n assembly (\"memory-safe\") {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns a `Uint256Slot` with member `value` located at `slot`.\n */\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\n assembly (\"memory-safe\") {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns a `Int256Slot` with member `value` located at `slot`.\n */\n function getInt256Slot(bytes32 slot) internal pure returns (Int256Slot storage r) {\n assembly (\"memory-safe\") {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns a `StringSlot` with member `value` located at `slot`.\n */\n function getStringSlot(bytes32 slot) internal pure returns (StringSlot storage r) {\n assembly (\"memory-safe\") {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `StringSlot` representation of the string storage pointer `store`.\n */\n function getStringSlot(string storage store) internal pure returns (StringSlot storage r) {\n assembly (\"memory-safe\") {\n r.slot := store.slot\n }\n }\n\n /**\n * @dev Returns a `BytesSlot` with member `value` located at `slot`.\n */\n function getBytesSlot(bytes32 slot) internal pure returns (BytesSlot storage r) {\n assembly (\"memory-safe\") {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `BytesSlot` representation of the bytes storage pointer `store`.\n */\n function getBytesSlot(bytes storage store) internal pure returns (BytesSlot storage r) {\n assembly (\"memory-safe\") {\n r.slot := store.slot\n }\n }\n}\n" + }, + "@openzeppelin/contracts/utils/Strings.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/Strings.sol)\n\npragma solidity ^0.8.20;\n\nimport {Math} from \"./math/Math.sol\";\nimport {SignedMath} from \"./math/SignedMath.sol\";\n\n/**\n * @dev String operations.\n */\nlibrary Strings {\n bytes16 private constant HEX_DIGITS = \"0123456789abcdef\";\n uint8 private constant ADDRESS_LENGTH = 20;\n\n /**\n * @dev The `value` string doesn't fit in the specified `length`.\n */\n error StringsInsufficientHexLength(uint256 value, uint256 length);\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 assembly (\"memory-safe\") {\n ptr := add(buffer, add(32, length))\n }\n while (true) {\n ptr--;\n assembly (\"memory-safe\") {\n mstore8(ptr, byte(mod(value, 10), HEX_DIGITS))\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 toStringSigned(int256 value) internal pure returns (string memory) {\n return string.concat(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 uint256 localValue = value;\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] = HEX_DIGITS[localValue & 0xf];\n localValue >>= 4;\n }\n if (localValue != 0) {\n revert StringsInsufficientHexLength(value, length);\n }\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\n * 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 Converts an `address` with fixed length of 20 bytes to its checksummed ASCII `string` hexadecimal\n * representation, according to EIP-55.\n */\n function toChecksumHexString(address addr) internal pure returns (string memory) {\n bytes memory buffer = bytes(toHexString(addr));\n\n // hash the hex part of buffer (skip length + 2 bytes, length 40)\n uint256 hashValue;\n assembly (\"memory-safe\") {\n hashValue := shr(96, keccak256(add(buffer, 0x22), 40))\n }\n\n for (uint256 i = 41; i > 1; --i) {\n // possible values for buffer[i] are 48 (0) to 57 (9) and 97 (a) to 102 (f)\n if (hashValue & 0xf > 7 && uint8(buffer[i]) > 96) {\n // case shift by xoring with 0x20\n buffer[i] ^= 0x20;\n }\n hashValue >>= 4;\n }\n return string(buffer);\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 bytes(a).length == bytes(b).length && keccak256(bytes(a)) == keccak256(bytes(b));\n }\n}\n" + }, + "@openzeppelin/contracts/utils/structs/Checkpoints.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/structs/Checkpoints.sol)\n// This file was procedurally generated from scripts/generate/templates/Checkpoints.js.\n\npragma solidity ^0.8.20;\n\nimport {Math} from \"../math/Math.sol\";\n\n/**\n * @dev This library defines the `Trace*` struct, for checkpointing values as they change at different points in\n * time, and later looking up past values by block number. See {Votes} as an example.\n *\n * To create a history of checkpoints define a variable type `Checkpoints.Trace*` in your contract, and store a new\n * checkpoint for the current transaction block using the {push} function.\n */\nlibrary Checkpoints {\n /**\n * @dev A value was attempted to be inserted on a past checkpoint.\n */\n error CheckpointUnorderedInsertion();\n\n struct Trace224 {\n Checkpoint224[] _checkpoints;\n }\n\n struct Checkpoint224 {\n uint32 _key;\n uint224 _value;\n }\n\n /**\n * @dev Pushes a (`key`, `value`) pair into a Trace224 so that it is stored as the checkpoint.\n *\n * Returns previous value and new value.\n *\n * IMPORTANT: Never accept `key` as a user input, since an arbitrary `type(uint32).max` key set will disable the\n * library.\n */\n function push(\n Trace224 storage self,\n uint32 key,\n uint224 value\n ) internal returns (uint224 oldValue, uint224 newValue) {\n return _insert(self._checkpoints, key, value);\n }\n\n /**\n * @dev Returns the value in the first (oldest) checkpoint with key greater or equal than the search key, or zero if\n * there is none.\n */\n function lowerLookup(Trace224 storage self, uint32 key) internal view returns (uint224) {\n uint256 len = self._checkpoints.length;\n uint256 pos = _lowerBinaryLookup(self._checkpoints, key, 0, len);\n return pos == len ? 0 : _unsafeAccess(self._checkpoints, pos)._value;\n }\n\n /**\n * @dev Returns the value in the last (most recent) checkpoint with key lower or equal than the search key, or zero\n * if there is none.\n */\n function upperLookup(Trace224 storage self, uint32 key) internal view returns (uint224) {\n uint256 len = self._checkpoints.length;\n uint256 pos = _upperBinaryLookup(self._checkpoints, key, 0, len);\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\n }\n\n /**\n * @dev Returns the value in the last (most recent) checkpoint with key lower or equal than the search key, or zero\n * if there is none.\n *\n * NOTE: This is a variant of {upperLookup} that is optimised to find \"recent\" checkpoint (checkpoints with high\n * keys).\n */\n function upperLookupRecent(Trace224 storage self, uint32 key) internal view returns (uint224) {\n uint256 len = self._checkpoints.length;\n\n uint256 low = 0;\n uint256 high = len;\n\n if (len > 5) {\n uint256 mid = len - Math.sqrt(len);\n if (key < _unsafeAccess(self._checkpoints, mid)._key) {\n high = mid;\n } else {\n low = mid + 1;\n }\n }\n\n uint256 pos = _upperBinaryLookup(self._checkpoints, key, low, high);\n\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\n }\n\n /**\n * @dev Returns the value in the most recent checkpoint, or zero if there are no checkpoints.\n */\n function latest(Trace224 storage self) internal view returns (uint224) {\n uint256 pos = self._checkpoints.length;\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\n }\n\n /**\n * @dev Returns whether there is a checkpoint in the structure (i.e. it is not empty), and if so the key and value\n * in the most recent checkpoint.\n */\n function latestCheckpoint(Trace224 storage self) internal view returns (bool exists, uint32 _key, uint224 _value) {\n uint256 pos = self._checkpoints.length;\n if (pos == 0) {\n return (false, 0, 0);\n } else {\n Checkpoint224 storage ckpt = _unsafeAccess(self._checkpoints, pos - 1);\n return (true, ckpt._key, ckpt._value);\n }\n }\n\n /**\n * @dev Returns the number of checkpoint.\n */\n function length(Trace224 storage self) internal view returns (uint256) {\n return self._checkpoints.length;\n }\n\n /**\n * @dev Returns checkpoint at given position.\n */\n function at(Trace224 storage self, uint32 pos) internal view returns (Checkpoint224 memory) {\n return self._checkpoints[pos];\n }\n\n /**\n * @dev Pushes a (`key`, `value`) pair into an ordered list of checkpoints, either by inserting a new checkpoint,\n * or by updating the last one.\n */\n function _insert(\n Checkpoint224[] storage self,\n uint32 key,\n uint224 value\n ) private returns (uint224 oldValue, uint224 newValue) {\n uint256 pos = self.length;\n\n if (pos > 0) {\n Checkpoint224 storage last = _unsafeAccess(self, pos - 1);\n uint32 lastKey = last._key;\n uint224 lastValue = last._value;\n\n // Checkpoint keys must be non-decreasing.\n if (lastKey > key) {\n revert CheckpointUnorderedInsertion();\n }\n\n // Update or push new checkpoint\n if (lastKey == key) {\n last._value = value;\n } else {\n self.push(Checkpoint224({_key: key, _value: value}));\n }\n return (lastValue, value);\n } else {\n self.push(Checkpoint224({_key: key, _value: value}));\n return (0, value);\n }\n }\n\n /**\n * @dev Return the index of the first (oldest) checkpoint with key strictly bigger than the search key, or `high`\n * if there is none. `low` and `high` define a section where to do the search, with inclusive `low` and exclusive\n * `high`.\n *\n * WARNING: `high` should not be greater than the array's length.\n */\n function _upperBinaryLookup(\n Checkpoint224[] storage self,\n uint32 key,\n uint256 low,\n uint256 high\n ) private view returns (uint256) {\n while (low < high) {\n uint256 mid = Math.average(low, high);\n if (_unsafeAccess(self, mid)._key > key) {\n high = mid;\n } else {\n low = mid + 1;\n }\n }\n return high;\n }\n\n /**\n * @dev Return the index of the first (oldest) checkpoint with key greater or equal than the search key, or `high`\n * if there is none. `low` and `high` define a section where to do the search, with inclusive `low` and exclusive\n * `high`.\n *\n * WARNING: `high` should not be greater than the array's length.\n */\n function _lowerBinaryLookup(\n Checkpoint224[] storage self,\n uint32 key,\n uint256 low,\n uint256 high\n ) private view returns (uint256) {\n while (low < high) {\n uint256 mid = Math.average(low, high);\n if (_unsafeAccess(self, mid)._key < key) {\n low = mid + 1;\n } else {\n high = mid;\n }\n }\n return high;\n }\n\n /**\n * @dev Access an element of the array without performing bounds check. The position is assumed to be within bounds.\n */\n function _unsafeAccess(\n Checkpoint224[] storage self,\n uint256 pos\n ) private pure returns (Checkpoint224 storage result) {\n assembly {\n mstore(0, self.slot)\n result.slot := add(keccak256(0, 0x20), pos)\n }\n }\n\n struct Trace208 {\n Checkpoint208[] _checkpoints;\n }\n\n struct Checkpoint208 {\n uint48 _key;\n uint208 _value;\n }\n\n /**\n * @dev Pushes a (`key`, `value`) pair into a Trace208 so that it is stored as the checkpoint.\n *\n * Returns previous value and new value.\n *\n * IMPORTANT: Never accept `key` as a user input, since an arbitrary `type(uint48).max` key set will disable the\n * library.\n */\n function push(\n Trace208 storage self,\n uint48 key,\n uint208 value\n ) internal returns (uint208 oldValue, uint208 newValue) {\n return _insert(self._checkpoints, key, value);\n }\n\n /**\n * @dev Returns the value in the first (oldest) checkpoint with key greater or equal than the search key, or zero if\n * there is none.\n */\n function lowerLookup(Trace208 storage self, uint48 key) internal view returns (uint208) {\n uint256 len = self._checkpoints.length;\n uint256 pos = _lowerBinaryLookup(self._checkpoints, key, 0, len);\n return pos == len ? 0 : _unsafeAccess(self._checkpoints, pos)._value;\n }\n\n /**\n * @dev Returns the value in the last (most recent) checkpoint with key lower or equal than the search key, or zero\n * if there is none.\n */\n function upperLookup(Trace208 storage self, uint48 key) internal view returns (uint208) {\n uint256 len = self._checkpoints.length;\n uint256 pos = _upperBinaryLookup(self._checkpoints, key, 0, len);\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\n }\n\n /**\n * @dev Returns the value in the last (most recent) checkpoint with key lower or equal than the search key, or zero\n * if there is none.\n *\n * NOTE: This is a variant of {upperLookup} that is optimised to find \"recent\" checkpoint (checkpoints with high\n * keys).\n */\n function upperLookupRecent(Trace208 storage self, uint48 key) internal view returns (uint208) {\n uint256 len = self._checkpoints.length;\n\n uint256 low = 0;\n uint256 high = len;\n\n if (len > 5) {\n uint256 mid = len - Math.sqrt(len);\n if (key < _unsafeAccess(self._checkpoints, mid)._key) {\n high = mid;\n } else {\n low = mid + 1;\n }\n }\n\n uint256 pos = _upperBinaryLookup(self._checkpoints, key, low, high);\n\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\n }\n\n /**\n * @dev Returns the value in the most recent checkpoint, or zero if there are no checkpoints.\n */\n function latest(Trace208 storage self) internal view returns (uint208) {\n uint256 pos = self._checkpoints.length;\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\n }\n\n /**\n * @dev Returns whether there is a checkpoint in the structure (i.e. it is not empty), and if so the key and value\n * in the most recent checkpoint.\n */\n function latestCheckpoint(Trace208 storage self) internal view returns (bool exists, uint48 _key, uint208 _value) {\n uint256 pos = self._checkpoints.length;\n if (pos == 0) {\n return (false, 0, 0);\n } else {\n Checkpoint208 storage ckpt = _unsafeAccess(self._checkpoints, pos - 1);\n return (true, ckpt._key, ckpt._value);\n }\n }\n\n /**\n * @dev Returns the number of checkpoint.\n */\n function length(Trace208 storage self) internal view returns (uint256) {\n return self._checkpoints.length;\n }\n\n /**\n * @dev Returns checkpoint at given position.\n */\n function at(Trace208 storage self, uint32 pos) internal view returns (Checkpoint208 memory) {\n return self._checkpoints[pos];\n }\n\n /**\n * @dev Pushes a (`key`, `value`) pair into an ordered list of checkpoints, either by inserting a new checkpoint,\n * or by updating the last one.\n */\n function _insert(\n Checkpoint208[] storage self,\n uint48 key,\n uint208 value\n ) private returns (uint208 oldValue, uint208 newValue) {\n uint256 pos = self.length;\n\n if (pos > 0) {\n Checkpoint208 storage last = _unsafeAccess(self, pos - 1);\n uint48 lastKey = last._key;\n uint208 lastValue = last._value;\n\n // Checkpoint keys must be non-decreasing.\n if (lastKey > key) {\n revert CheckpointUnorderedInsertion();\n }\n\n // Update or push new checkpoint\n if (lastKey == key) {\n last._value = value;\n } else {\n self.push(Checkpoint208({_key: key, _value: value}));\n }\n return (lastValue, value);\n } else {\n self.push(Checkpoint208({_key: key, _value: value}));\n return (0, value);\n }\n }\n\n /**\n * @dev Return the index of the first (oldest) checkpoint with key strictly bigger than the search key, or `high`\n * if there is none. `low` and `high` define a section where to do the search, with inclusive `low` and exclusive\n * `high`.\n *\n * WARNING: `high` should not be greater than the array's length.\n */\n function _upperBinaryLookup(\n Checkpoint208[] storage self,\n uint48 key,\n uint256 low,\n uint256 high\n ) private view returns (uint256) {\n while (low < high) {\n uint256 mid = Math.average(low, high);\n if (_unsafeAccess(self, mid)._key > key) {\n high = mid;\n } else {\n low = mid + 1;\n }\n }\n return high;\n }\n\n /**\n * @dev Return the index of the first (oldest) checkpoint with key greater or equal than the search key, or `high`\n * if there is none. `low` and `high` define a section where to do the search, with inclusive `low` and exclusive\n * `high`.\n *\n * WARNING: `high` should not be greater than the array's length.\n */\n function _lowerBinaryLookup(\n Checkpoint208[] storage self,\n uint48 key,\n uint256 low,\n uint256 high\n ) private view returns (uint256) {\n while (low < high) {\n uint256 mid = Math.average(low, high);\n if (_unsafeAccess(self, mid)._key < key) {\n low = mid + 1;\n } else {\n high = mid;\n }\n }\n return high;\n }\n\n /**\n * @dev Access an element of the array without performing bounds check. The position is assumed to be within bounds.\n */\n function _unsafeAccess(\n Checkpoint208[] storage self,\n uint256 pos\n ) private pure returns (Checkpoint208 storage result) {\n assembly {\n mstore(0, self.slot)\n result.slot := add(keccak256(0, 0x20), pos)\n }\n }\n\n struct Trace160 {\n Checkpoint160[] _checkpoints;\n }\n\n struct Checkpoint160 {\n uint96 _key;\n uint160 _value;\n }\n\n /**\n * @dev Pushes a (`key`, `value`) pair into a Trace160 so that it is stored as the checkpoint.\n *\n * Returns previous value and new value.\n *\n * IMPORTANT: Never accept `key` as a user input, since an arbitrary `type(uint96).max` key set will disable the\n * library.\n */\n function push(\n Trace160 storage self,\n uint96 key,\n uint160 value\n ) internal returns (uint160 oldValue, uint160 newValue) {\n return _insert(self._checkpoints, key, value);\n }\n\n /**\n * @dev Returns the value in the first (oldest) checkpoint with key greater or equal than the search key, or zero if\n * there is none.\n */\n function lowerLookup(Trace160 storage self, uint96 key) internal view returns (uint160) {\n uint256 len = self._checkpoints.length;\n uint256 pos = _lowerBinaryLookup(self._checkpoints, key, 0, len);\n return pos == len ? 0 : _unsafeAccess(self._checkpoints, pos)._value;\n }\n\n /**\n * @dev Returns the value in the last (most recent) checkpoint with key lower or equal than the search key, or zero\n * if there is none.\n */\n function upperLookup(Trace160 storage self, uint96 key) internal view returns (uint160) {\n uint256 len = self._checkpoints.length;\n uint256 pos = _upperBinaryLookup(self._checkpoints, key, 0, len);\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\n }\n\n /**\n * @dev Returns the value in the last (most recent) checkpoint with key lower or equal than the search key, or zero\n * if there is none.\n *\n * NOTE: This is a variant of {upperLookup} that is optimised to find \"recent\" checkpoint (checkpoints with high\n * keys).\n */\n function upperLookupRecent(Trace160 storage self, uint96 key) internal view returns (uint160) {\n uint256 len = self._checkpoints.length;\n\n uint256 low = 0;\n uint256 high = len;\n\n if (len > 5) {\n uint256 mid = len - Math.sqrt(len);\n if (key < _unsafeAccess(self._checkpoints, mid)._key) {\n high = mid;\n } else {\n low = mid + 1;\n }\n }\n\n uint256 pos = _upperBinaryLookup(self._checkpoints, key, low, high);\n\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\n }\n\n /**\n * @dev Returns the value in the most recent checkpoint, or zero if there are no checkpoints.\n */\n function latest(Trace160 storage self) internal view returns (uint160) {\n uint256 pos = self._checkpoints.length;\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\n }\n\n /**\n * @dev Returns whether there is a checkpoint in the structure (i.e. it is not empty), and if so the key and value\n * in the most recent checkpoint.\n */\n function latestCheckpoint(Trace160 storage self) internal view returns (bool exists, uint96 _key, uint160 _value) {\n uint256 pos = self._checkpoints.length;\n if (pos == 0) {\n return (false, 0, 0);\n } else {\n Checkpoint160 storage ckpt = _unsafeAccess(self._checkpoints, pos - 1);\n return (true, ckpt._key, ckpt._value);\n }\n }\n\n /**\n * @dev Returns the number of checkpoint.\n */\n function length(Trace160 storage self) internal view returns (uint256) {\n return self._checkpoints.length;\n }\n\n /**\n * @dev Returns checkpoint at given position.\n */\n function at(Trace160 storage self, uint32 pos) internal view returns (Checkpoint160 memory) {\n return self._checkpoints[pos];\n }\n\n /**\n * @dev Pushes a (`key`, `value`) pair into an ordered list of checkpoints, either by inserting a new checkpoint,\n * or by updating the last one.\n */\n function _insert(\n Checkpoint160[] storage self,\n uint96 key,\n uint160 value\n ) private returns (uint160 oldValue, uint160 newValue) {\n uint256 pos = self.length;\n\n if (pos > 0) {\n Checkpoint160 storage last = _unsafeAccess(self, pos - 1);\n uint96 lastKey = last._key;\n uint160 lastValue = last._value;\n\n // Checkpoint keys must be non-decreasing.\n if (lastKey > key) {\n revert CheckpointUnorderedInsertion();\n }\n\n // Update or push new checkpoint\n if (lastKey == key) {\n last._value = value;\n } else {\n self.push(Checkpoint160({_key: key, _value: value}));\n }\n return (lastValue, value);\n } else {\n self.push(Checkpoint160({_key: key, _value: value}));\n return (0, value);\n }\n }\n\n /**\n * @dev Return the index of the first (oldest) checkpoint with key strictly bigger than the search key, or `high`\n * if there is none. `low` and `high` define a section where to do the search, with inclusive `low` and exclusive\n * `high`.\n *\n * WARNING: `high` should not be greater than the array's length.\n */\n function _upperBinaryLookup(\n Checkpoint160[] storage self,\n uint96 key,\n uint256 low,\n uint256 high\n ) private view returns (uint256) {\n while (low < high) {\n uint256 mid = Math.average(low, high);\n if (_unsafeAccess(self, mid)._key > key) {\n high = mid;\n } else {\n low = mid + 1;\n }\n }\n return high;\n }\n\n /**\n * @dev Return the index of the first (oldest) checkpoint with key greater or equal than the search key, or `high`\n * if there is none. `low` and `high` define a section where to do the search, with inclusive `low` and exclusive\n * `high`.\n *\n * WARNING: `high` should not be greater than the array's length.\n */\n function _lowerBinaryLookup(\n Checkpoint160[] storage self,\n uint96 key,\n uint256 low,\n uint256 high\n ) private view returns (uint256) {\n while (low < high) {\n uint256 mid = Math.average(low, high);\n if (_unsafeAccess(self, mid)._key < key) {\n low = mid + 1;\n } else {\n high = mid;\n }\n }\n return high;\n }\n\n /**\n * @dev Access an element of the array without performing bounds check. The position is assumed to be within bounds.\n */\n function _unsafeAccess(\n Checkpoint160[] storage self,\n uint256 pos\n ) private pure returns (Checkpoint160 storage result) {\n assembly {\n mstore(0, self.slot)\n result.slot := add(keccak256(0, 0x20), pos)\n }\n }\n}\n" + }, + "@openzeppelin/contracts/utils/structs/DoubleEndedQueue.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/structs/DoubleEndedQueue.sol)\npragma solidity ^0.8.20;\n\nimport {Panic} from \"../Panic.sol\";\n\n/**\n * @dev A sequence of items with the ability to efficiently push and pop items (i.e. insert and remove) on both ends of\n * the sequence (called front and back). Among other access patterns, it can be used to implement efficient LIFO and\n * FIFO queues. Storage use is optimized, and all operations are O(1) constant time. This includes {clear}, given that\n * the existing queue contents are left in storage.\n *\n * The struct is called `Bytes32Deque`. Other types can be cast to and from `bytes32`. This data structure can only be\n * used in storage, and not in memory.\n * ```solidity\n * DoubleEndedQueue.Bytes32Deque queue;\n * ```\n */\nlibrary DoubleEndedQueue {\n /**\n * @dev Indices are 128 bits so begin and end are packed in a single storage slot for efficient access.\n *\n * Struct members have an underscore prefix indicating that they are \"private\" and should not be read or written to\n * directly. Use the functions provided below instead. Modifying the struct manually may violate assumptions and\n * lead to unexpected behavior.\n *\n * The first item is at data[begin] and the last item is at data[end - 1]. This range can wrap around.\n */\n struct Bytes32Deque {\n uint128 _begin;\n uint128 _end;\n mapping(uint128 index => bytes32) _data;\n }\n\n /**\n * @dev Inserts an item at the end of the queue.\n *\n * Reverts with {Panic-RESOURCE_ERROR} if the queue is full.\n */\n function pushBack(Bytes32Deque storage deque, bytes32 value) internal {\n unchecked {\n uint128 backIndex = deque._end;\n if (backIndex + 1 == deque._begin) Panic.panic(Panic.RESOURCE_ERROR);\n deque._data[backIndex] = value;\n deque._end = backIndex + 1;\n }\n }\n\n /**\n * @dev Removes the item at the end of the queue and returns it.\n *\n * Reverts with {Panic-EMPTY_ARRAY_POP} if the queue is empty.\n */\n function popBack(Bytes32Deque storage deque) internal returns (bytes32 value) {\n unchecked {\n uint128 backIndex = deque._end;\n if (backIndex == deque._begin) Panic.panic(Panic.EMPTY_ARRAY_POP);\n --backIndex;\n value = deque._data[backIndex];\n delete deque._data[backIndex];\n deque._end = backIndex;\n }\n }\n\n /**\n * @dev Inserts an item at the beginning of the queue.\n *\n * Reverts with {Panic-RESOURCE_ERROR} if the queue is full.\n */\n function pushFront(Bytes32Deque storage deque, bytes32 value) internal {\n unchecked {\n uint128 frontIndex = deque._begin - 1;\n if (frontIndex == deque._end) Panic.panic(Panic.RESOURCE_ERROR);\n deque._data[frontIndex] = value;\n deque._begin = frontIndex;\n }\n }\n\n /**\n * @dev Removes the item at the beginning of the queue and returns it.\n *\n * Reverts with {Panic-EMPTY_ARRAY_POP} if the queue is empty.\n */\n function popFront(Bytes32Deque storage deque) internal returns (bytes32 value) {\n unchecked {\n uint128 frontIndex = deque._begin;\n if (frontIndex == deque._end) Panic.panic(Panic.EMPTY_ARRAY_POP);\n value = deque._data[frontIndex];\n delete deque._data[frontIndex];\n deque._begin = frontIndex + 1;\n }\n }\n\n /**\n * @dev Returns the item at the beginning of the queue.\n *\n * Reverts with {Panic-ARRAY_OUT_OF_BOUNDS} if the queue is empty.\n */\n function front(Bytes32Deque storage deque) internal view returns (bytes32 value) {\n if (empty(deque)) Panic.panic(Panic.ARRAY_OUT_OF_BOUNDS);\n return deque._data[deque._begin];\n }\n\n /**\n * @dev Returns the item at the end of the queue.\n *\n * Reverts with {Panic-ARRAY_OUT_OF_BOUNDS} if the queue is empty.\n */\n function back(Bytes32Deque storage deque) internal view returns (bytes32 value) {\n if (empty(deque)) Panic.panic(Panic.ARRAY_OUT_OF_BOUNDS);\n unchecked {\n return deque._data[deque._end - 1];\n }\n }\n\n /**\n * @dev Return the item at a position in the queue given by `index`, with the first item at 0 and last item at\n * `length(deque) - 1`.\n *\n * Reverts with {Panic-ARRAY_OUT_OF_BOUNDS} if the index is out of bounds.\n */\n function at(Bytes32Deque storage deque, uint256 index) internal view returns (bytes32 value) {\n if (index >= length(deque)) Panic.panic(Panic.ARRAY_OUT_OF_BOUNDS);\n // By construction, length is a uint128, so the check above ensures that index can be safely downcast to uint128\n unchecked {\n return deque._data[deque._begin + uint128(index)];\n }\n }\n\n /**\n * @dev Resets the queue back to being empty.\n *\n * NOTE: The current items are left behind in storage. This does not affect the functioning of the queue, but misses\n * out on potential gas refunds.\n */\n function clear(Bytes32Deque storage deque) internal {\n deque._begin = 0;\n deque._end = 0;\n }\n\n /**\n * @dev Returns the number of items in the queue.\n */\n function length(Bytes32Deque storage deque) internal view returns (uint256) {\n unchecked {\n return uint256(deque._end - deque._begin);\n }\n }\n\n /**\n * @dev Returns true if the queue is empty.\n */\n function empty(Bytes32Deque storage deque) internal view returns (bool) {\n return deque._end == deque._begin;\n }\n}\n" + }, + "@openzeppelin/contracts/utils/types/Time.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/types/Time.sol)\n\npragma solidity ^0.8.20;\n\nimport {Math} from \"../math/Math.sol\";\nimport {SafeCast} from \"../math/SafeCast.sol\";\n\n/**\n * @dev This library provides helpers for manipulating time-related objects.\n *\n * It uses the following types:\n * - `uint48` for timepoints\n * - `uint32` for durations\n *\n * While the library doesn't provide specific types for timepoints and duration, it does provide:\n * - a `Delay` type to represent duration that can be programmed to change value automatically at a given point\n * - additional helper functions\n */\nlibrary Time {\n using Time for *;\n\n /**\n * @dev Get the block timestamp as a Timepoint.\n */\n function timestamp() internal view returns (uint48) {\n return SafeCast.toUint48(block.timestamp);\n }\n\n /**\n * @dev Get the block number as a Timepoint.\n */\n function blockNumber() internal view returns (uint48) {\n return SafeCast.toUint48(block.number);\n }\n\n // ==================================================== Delay =====================================================\n /**\n * @dev A `Delay` is a uint32 duration that can be programmed to change value automatically at a given point in the\n * future. The \"effect\" timepoint describes when the transitions happens from the \"old\" value to the \"new\" value.\n * This allows updating the delay applied to some operation while keeping some guarantees.\n *\n * In particular, the {update} function guarantees that if the delay is reduced, the old delay still applies for\n * some time. For example if the delay is currently 7 days to do an upgrade, the admin should not be able to set\n * the delay to 0 and upgrade immediately. If the admin wants to reduce the delay, the old delay (7 days) should\n * still apply for some time.\n *\n *\n * The `Delay` type is 112 bits long, and packs the following:\n *\n * ```\n * | [uint48]: effect date (timepoint)\n * | | [uint32]: value before (duration)\n * ↓ ↓ ↓ [uint32]: value after (duration)\n * 0xAAAAAAAAAAAABBBBBBBBCCCCCCCC\n * ```\n *\n * NOTE: The {get} and {withUpdate} functions operate using timestamps. Block number based delays are not currently\n * supported.\n */\n type Delay is uint112;\n\n /**\n * @dev Wrap a duration into a Delay to add the one-step \"update in the future\" feature\n */\n function toDelay(uint32 duration) internal pure returns (Delay) {\n return Delay.wrap(duration);\n }\n\n /**\n * @dev Get the value at a given timepoint plus the pending value and effect timepoint if there is a scheduled\n * change after this timepoint. If the effect timepoint is 0, then the pending value should not be considered.\n */\n function _getFullAt(\n Delay self,\n uint48 timepoint\n ) private pure returns (uint32 valueBefore, uint32 valueAfter, uint48 effect) {\n (valueBefore, valueAfter, effect) = self.unpack();\n return effect <= timepoint ? (valueAfter, 0, 0) : (valueBefore, valueAfter, effect);\n }\n\n /**\n * @dev Get the current value plus the pending value and effect timepoint if there is a scheduled change. If the\n * effect timepoint is 0, then the pending value should not be considered.\n */\n function getFull(Delay self) internal view returns (uint32 valueBefore, uint32 valueAfter, uint48 effect) {\n return _getFullAt(self, timestamp());\n }\n\n /**\n * @dev Get the current value.\n */\n function get(Delay self) internal view returns (uint32) {\n (uint32 delay, , ) = self.getFull();\n return delay;\n }\n\n /**\n * @dev Update a Delay object so that it takes a new duration after a timepoint that is automatically computed to\n * enforce the old delay at the moment of the update. Returns the updated Delay object and the timestamp when the\n * new delay becomes effective.\n */\n function withUpdate(\n Delay self,\n uint32 newValue,\n uint32 minSetback\n ) internal view returns (Delay updatedDelay, uint48 effect) {\n uint32 value = self.get();\n uint32 setback = uint32(Math.max(minSetback, value > newValue ? value - newValue : 0));\n effect = timestamp() + setback;\n return (pack(value, newValue, effect), effect);\n }\n\n /**\n * @dev Split a delay into its components: valueBefore, valueAfter and effect (transition timepoint).\n */\n function unpack(Delay self) internal pure returns (uint32 valueBefore, uint32 valueAfter, uint48 effect) {\n uint112 raw = Delay.unwrap(self);\n\n valueAfter = uint32(raw);\n valueBefore = uint32(raw >> 32);\n effect = uint48(raw >> 64);\n\n return (valueBefore, valueAfter, effect);\n }\n\n /**\n * @dev pack the components into a Delay object.\n */\n function pack(uint32 valueBefore, uint32 valueAfter, uint48 effect) internal pure returns (Delay) {\n return Delay.wrap((uint112(effect) << 64) | (uint112(valueBefore) << 32) | uint112(valueAfter));\n }\n}\n" + }, + "contracts/variants/crosschain/Gov.sol": { + "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity ^0.8.20;\n\nimport \"@openzeppelin/contracts/governance/Governor.sol\";\nimport \"@openzeppelin/contracts/governance/extensions/GovernorSettings.sol\";\nimport \"@openzeppelin/contracts/governance/extensions/GovernorCountingSimple.sol\";\nimport \"@openzeppelin/contracts/governance/extensions/GovernorVotes.sol\";\nimport \"@openzeppelin/contracts/governance/extensions/GovernorVotesQuorumFraction.sol\";\nimport \"./ProofHandler.sol\";\n\n/**\n * @title Cross-chain Governance Contract\n * @author Web3 Hackers Collective\n * @notice Implementation of a DAO with secure cross-chain synchronization capabilities\n * @dev Uses ProofHandler library for managing cross-chain parameter updates\n * @custom:security-contact julien@strat.cc\n */\ncontract Gov is\n Governor,\n GovernorSettings,\n GovernorCountingSimple,\n GovernorVotes,\n GovernorVotesQuorumFraction\n{\n /// @notice Chain ID where this contract was originally deployed\n uint256 public immutable home;\n\n /// @notice IPFS CID of the DAO's manifesto\n string public manifesto;\n\n /// @notice Storage for proof handling\n ProofHandler.ProofStorage private _proofStorage;\n\n /// @notice Types of operations that can be synchronized across chains\n enum OperationType {\n SET_MANIFESTO,\n UPDATE_VOTING_DELAY,\n UPDATE_VOTING_PERIOD,\n UPDATE_PROPOSAL_THRESHOLD,\n UPDATE_QUORUM\n }\n\n /// @notice Emitted when the manifesto is updated\n /// @param oldManifesto Previous manifesto CID\n /// @param newManifesto New manifesto CID\n /// @param nonce Update sequence number\n event ManifestoUpdated(string oldManifesto, string newManifesto, uint256 nonce);\n\n /// @notice Emitted when a governance parameter is updated\n /// @param operationType Type of parameter updated\n /// @param oldValue Previous value\n /// @param newValue New value\n /// @param nonce Update sequence number\n event GovernanceParameterUpdated(\n OperationType indexed operationType,\n uint256 oldValue,\n uint256 newValue,\n uint256 nonce\n );\n\n /// @notice Restricts functions to be called only on the home chain\n modifier onlyHomeChain() {\n require(block.chainid == home, \"Operation only allowed on home chain\");\n _;\n }\n\n /**\n * @notice Initializes the governance contract\n * @param _home Chain ID where this contract is considered home\n * @param _token The voting token contract address\n * @param _manifestoCid Initial manifesto CID\n * @param _name Name of the governance contract\n * @param _votingDelay Time before voting begins\n * @param _votingPeriod Duration of voting period\n * @param _proposalThreshold Minimum votes needed for proposal\n * @param _quorum Minimum participation percentage required\n */\n constructor(\n uint256 _home,\n IVotes _token,\n string memory _manifestoCid,\n string memory _name,\n uint48 _votingDelay,\n uint32 _votingPeriod,\n uint256 _proposalThreshold,\n uint256 _quorum\n )\n Governor(_name)\n GovernorSettings(_votingDelay, _votingPeriod, _proposalThreshold)\n GovernorVotes(_token)\n GovernorVotesQuorumFraction(_quorum)\n {\n home = _home;\n manifesto = _manifestoCid;\n }\n\n /**\n * @notice Updates the DAO's manifesto on the home chain\n * @param newManifesto New manifesto CID\n */\n function setManifesto(string memory newManifesto) public onlyGovernance onlyHomeChain {\n uint256 nonce = ProofHandler.incrementNonce(\n _proofStorage,\n uint8(OperationType.SET_MANIFESTO)\n );\n string memory oldManifesto = manifesto;\n manifesto = newManifesto;\n emit ManifestoUpdated(oldManifesto, newManifesto, nonce);\n }\n\n /**\n * @notice Updates the voting delay parameter on the home chain\n * @param newVotingDelay New voting delay value\n */\n function setVotingDelay(\n uint48 newVotingDelay\n ) public virtual override onlyGovernance onlyHomeChain {\n uint256 nonce = ProofHandler.incrementNonce(\n _proofStorage,\n uint8(OperationType.UPDATE_VOTING_DELAY)\n );\n uint256 oldValue = votingDelay();\n _setVotingDelay(newVotingDelay);\n emit GovernanceParameterUpdated(\n OperationType.UPDATE_VOTING_DELAY,\n oldValue,\n newVotingDelay,\n nonce\n );\n }\n\n /**\n * @notice Updates the voting period parameter on the home chain\n * @param newVotingPeriod New voting period value\n */\n function setVotingPeriod(\n uint32 newVotingPeriod\n ) public virtual override onlyGovernance onlyHomeChain {\n uint256 nonce = ProofHandler.incrementNonce(\n _proofStorage,\n uint8(OperationType.UPDATE_VOTING_PERIOD)\n );\n uint256 oldValue = votingPeriod();\n _setVotingPeriod(newVotingPeriod);\n emit GovernanceParameterUpdated(\n OperationType.UPDATE_VOTING_PERIOD,\n oldValue,\n newVotingPeriod,\n nonce\n );\n }\n\n /**\n * @notice Updates the proposal threshold parameter on the home chain\n * @param newProposalThreshold New proposal threshold value\n */\n function setProposalThreshold(\n uint256 newProposalThreshold\n ) public virtual override onlyGovernance onlyHomeChain {\n uint256 nonce = ProofHandler.incrementNonce(\n _proofStorage,\n uint8(OperationType.UPDATE_PROPOSAL_THRESHOLD)\n );\n uint256 oldValue = proposalThreshold();\n _setProposalThreshold(newProposalThreshold);\n emit GovernanceParameterUpdated(\n OperationType.UPDATE_PROPOSAL_THRESHOLD,\n oldValue,\n newProposalThreshold,\n nonce\n );\n }\n\n /**\n * @notice Updates the quorum numerator on the home chain\n * @param newQuorumNumerator New quorum numerator value\n */\n function updateQuorumNumerator(\n uint256 newQuorumNumerator\n ) public virtual override onlyGovernance onlyHomeChain {\n uint256 nonce = ProofHandler.incrementNonce(\n _proofStorage,\n uint8(OperationType.UPDATE_QUORUM)\n );\n uint256 oldValue = quorumNumerator();\n _updateQuorumNumerator(newQuorumNumerator);\n emit GovernanceParameterUpdated(\n OperationType.UPDATE_QUORUM,\n oldValue,\n newQuorumNumerator,\n nonce\n );\n }\n\n /**\n * @notice Generates proof for parameter updates\n * @param operationType Type of parameter being updated\n * @param value Encoded parameter value\n * @return proof Encoded proof data\n */\n function generateParameterProof(\n uint8 operationType,\n bytes memory value\n ) external view returns (bytes memory proof) {\n require(block.chainid == home, \"Proofs only generated on home chain\");\n uint256 nextNonce = ProofHandler.getNextNonce(_proofStorage, operationType);\n return ProofHandler.generateProof(address(this), operationType, value, nextNonce);\n }\n\n /**\n * @notice Claims a parameter update on a foreign chain\n * @param proof Proof generated by home chain\n */\n function claimParameterUpdate(bytes memory proof) external {\n (uint8 operationType, bytes memory value, uint256 nonce) = ProofHandler.verifyAndClaimProof(\n proof,\n address(this),\n _proofStorage\n );\n\n if (operationType == uint8(OperationType.SET_MANIFESTO)) {\n string memory newManifesto = abi.decode(value, (string));\n string memory oldManifesto = manifesto;\n manifesto = newManifesto;\n emit ManifestoUpdated(oldManifesto, newManifesto, nonce);\n } else if (operationType == uint8(OperationType.UPDATE_VOTING_DELAY)) {\n uint48 newValue = uint48(bytes6(value));\n uint256 oldValue = votingDelay();\n _setVotingDelay(newValue);\n emit GovernanceParameterUpdated(\n OperationType.UPDATE_VOTING_DELAY,\n oldValue,\n newValue,\n nonce\n );\n } else if (operationType == uint8(OperationType.UPDATE_VOTING_PERIOD)) {\n uint32 newValue = uint32(bytes4(value));\n uint256 oldValue = votingPeriod();\n _setVotingPeriod(newValue);\n emit GovernanceParameterUpdated(\n OperationType.UPDATE_VOTING_PERIOD,\n oldValue,\n newValue,\n nonce\n );\n } else if (operationType == uint8(OperationType.UPDATE_PROPOSAL_THRESHOLD)) {\n uint256 newValue = abi.decode(value, (uint256));\n uint256 oldValue = proposalThreshold();\n _setProposalThreshold(newValue);\n emit GovernanceParameterUpdated(\n OperationType.UPDATE_PROPOSAL_THRESHOLD,\n oldValue,\n newValue,\n nonce\n );\n } else if (operationType == uint8(OperationType.UPDATE_QUORUM)) {\n uint256 newValue = abi.decode(value, (uint256));\n uint256 oldValue = quorumNumerator();\n _updateQuorumNumerator(newValue);\n emit GovernanceParameterUpdated(OperationType.UPDATE_QUORUM, oldValue, newValue, nonce);\n }\n }\n\n // Required overrides\n\n function votingDelay() public view override(Governor, GovernorSettings) returns (uint256) {\n return super.votingDelay();\n }\n\n function votingPeriod() public view override(Governor, GovernorSettings) returns (uint256) {\n return super.votingPeriod();\n }\n\n function quorum(\n uint256 blockNumber\n ) public view override(Governor, GovernorVotesQuorumFraction) returns (uint256) {\n return super.quorum(blockNumber);\n }\n\n function proposalThreshold()\n public\n view\n override(Governor, GovernorSettings)\n returns (uint256)\n {\n return super.proposalThreshold();\n }\n}\n" + }, + "contracts/variants/crosschain/NFT.sol": { + "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity ^0.8.20;\n\nimport \"@openzeppelin/contracts/token/ERC721/ERC721.sol\";\nimport \"@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol\";\nimport \"@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol\";\nimport \"@openzeppelin/contracts/token/ERC721/extensions/ERC721Burnable.sol\";\nimport \"@openzeppelin/contracts/access/Ownable.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/EIP712.sol\";\nimport \"@openzeppelin/contracts/token/ERC721/extensions/ERC721Votes.sol\";\nimport \"./ProofHandler.sol\";\n\n/**\n * @title Cross-chain Membership NFT Contract\n * @author Web3 Hackers Collective\n * @notice Non-transferable NFT implementation for DAO membership with cross-chain capabilities\n * @dev Uses ProofHandler library for cross-chain proof management\n * @custom:security-contact julien@strat.cc\n */\ncontract NFT is\n ERC721,\n ERC721Enumerable,\n ERC721URIStorage,\n ERC721Burnable,\n Ownable,\n EIP712,\n ERC721Votes\n{\n using ProofHandler for ProofHandler.ProofStorage;\n\n /// @notice Chain ID where contract was originally deployed\n uint256 public immutable home;\n\n /// @notice Next token ID to be minted\n uint256 private _nextTokenId;\n\n /// @notice Storage for proof handling\n ProofHandler.ProofStorage private _proofStorage;\n\n /// @notice Types of operations that can be synchronized across chains\n enum OperationType {\n MINT,\n BURN,\n SET_METADATA\n }\n\n /// @notice Emitted when a membership is claimed\n /// @param tokenId The ID of the claimed token\n /// @param member The address receiving the membership\n /// @param nonce Operation sequence number\n event MembershipClaimed(uint256 indexed tokenId, address indexed member, uint256 nonce);\n\n /// @notice Emitted when a membership is revoked\n /// @param tokenId The ID of the revoked token\n /// @param member The address losing membership\n /// @param nonce Operation sequence number\n event MembershipRevoked(uint256 indexed tokenId, address indexed member, uint256 nonce);\n\n /// @notice Emitted when metadata is updated\n /// @param tokenId The ID of the updated token\n /// @param newUri The new metadata URI\n /// @param nonce Operation sequence number\n event MetadataUpdated(uint256 indexed tokenId, string newUri, uint256 nonce);\n\n /// @notice Restricts functions to home chain\n modifier onlyHomeChain() {\n require(block.chainid == home, \"Operation only allowed on home chain\");\n _;\n }\n\n /**\n * @notice Initializes the NFT contract\n * @param _home Chain ID where contract is considered home\n * @param initialOwner Initial contract owner\n * @param _firstMembers Array of initial member addresses\n * @param _uri Initial token URI\n * @param _name Token collection name\n * @param _symbol Token collection symbol\n */\n constructor(\n uint256 _home,\n address initialOwner,\n address[] memory _firstMembers,\n string memory _uri,\n string memory _name,\n string memory _symbol\n ) ERC721(_name, _symbol) Ownable(initialOwner) EIP712(_name, \"1\") {\n home = _home;\n for (uint i; i < _firstMembers.length; i++) {\n _govMint(_firstMembers[i], _uri);\n }\n }\n\n /**\n * @notice Adds a new member on home chain\n * @dev Only callable by owner (governance) on home chain\n * @param to Address to mint token to\n * @param uri Token metadata URI\n */\n function safeMint(address to, string memory uri) public onlyOwner onlyHomeChain {\n uint256 nonce = _proofStorage.incrementNonce(uint8(OperationType.MINT));\n _govMint(to, uri);\n emit MembershipClaimed(_nextTokenId - 1, to, nonce);\n }\n\n /**\n * @notice Burns token on home chain\n * @dev Only callable by owner (governance) on home chain\n * @param tokenId ID of token to burn\n */\n function govBurn(uint256 tokenId) public onlyOwner onlyHomeChain {\n uint256 nonce = _proofStorage.incrementNonce(uint8(OperationType.BURN));\n address owner = ownerOf(tokenId);\n _burn(tokenId);\n emit MembershipRevoked(tokenId, owner, nonce);\n }\n\n /**\n * @notice Updates token metadata on home chain\n * @dev Only callable by owner (governance) on home chain\n * @param tokenId ID of token to update\n * @param uri New metadata URI\n */\n function setMetadata(uint256 tokenId, string memory uri) public onlyOwner onlyHomeChain {\n uint256 nonce = _proofStorage.incrementNonce(uint8(OperationType.SET_METADATA));\n _setTokenURI(tokenId, uri);\n emit MetadataUpdated(tokenId, uri, nonce);\n }\n\n /**\n * @notice Generates proof for NFT operations\n * @param operationType Type of operation\n * @param params Operation parameters\n * @return Encoded proof data\n */\n function generateOperationProof(\n uint8 operationType,\n bytes memory params\n ) external view returns (bytes memory) {\n require(block.chainid == home, \"Proofs only generated on home chain\");\n uint256 nextNonce = _proofStorage.getNextNonce(operationType);\n return ProofHandler.generateProof(address(this), operationType, params, nextNonce);\n }\n\n /**\n * @notice Claims an NFT operation on a foreign chain\n * @param proof Proof generated by home chain\n */\n function claimOperation(bytes memory proof) external {\n (uint8 operationType, bytes memory params, uint256 nonce) = ProofHandler\n .verifyAndClaimProof(proof, address(this), _proofStorage);\n\n if (operationType == uint8(OperationType.MINT)) {\n (address to, string memory uri) = abi.decode(params, (address, string));\n _govMint(to, uri);\n emit MembershipClaimed(_nextTokenId - 1, to, nonce);\n } else if (operationType == uint8(OperationType.BURN)) {\n uint256 tokenId = abi.decode(params, (uint256));\n address owner = ownerOf(tokenId);\n _burn(tokenId);\n emit MembershipRevoked(tokenId, owner, nonce);\n } else if (operationType == uint8(OperationType.SET_METADATA)) {\n (uint256 tokenId, string memory uri) = abi.decode(params, (uint256, string));\n _setTokenURI(tokenId, uri);\n emit MetadataUpdated(tokenId, uri, nonce);\n }\n }\n\n /**\n * @notice Internal function for minting without proof verification\n * @param to Address to receive token\n * @param uri Token metadata URI\n */\n function _govMint(address to, string memory uri) internal {\n uint256 tokenId = _nextTokenId++;\n _safeMint(to, tokenId);\n _setTokenURI(tokenId, uri);\n }\n\n // Required overrides\n\n function _update(\n address to,\n uint256 tokenId,\n address auth\n ) internal override(ERC721, ERC721Enumerable, ERC721Votes) returns (address) {\n require(auth == address(0) || to == address(0), \"NFT is not transferable\");\n return super._update(to, tokenId, auth);\n }\n\n function _increaseBalance(\n address account,\n uint128 value\n ) internal override(ERC721, ERC721Enumerable, ERC721Votes) {\n super._increaseBalance(account, value);\n }\n\n function tokenURI(\n uint256 tokenId\n ) public view override(ERC721, ERC721URIStorage) returns (string memory) {\n return super.tokenURI(tokenId);\n }\n\n function supportsInterface(\n bytes4 interfaceId\n ) public view override(ERC721, ERC721Enumerable, ERC721URIStorage) returns (bool) {\n return super.supportsInterface(interfaceId);\n }\n\n function clock() public view override returns (uint48) {\n return uint48(block.timestamp);\n }\n\n function CLOCK_MODE() public pure override returns (string memory) {\n return \"mode=timestamp\";\n }\n}\n" + }, + "contracts/variants/crosschain/ProofHandler.sol": { + "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity ^0.8.20;\n\n/**\n * @title Proof Handler Library\n * @author Web3 Hackers Collective\n * @notice Library for standardized cross-chain proof generation and verification\n * @dev Handles proof generation, verification, and tracking for cross-chain operations\n * @custom:security-contact julien@strat.cc\n */\nlibrary ProofHandler {\n /// @notice Tracks which proofs have been applied on each chain\n struct ProofStorage {\n mapping(bytes32 => bool) updateAppliedOnChain;\n mapping(uint8 => uint256) currentNonce;\n }\n\n /// @dev Emitted when a proof is claimed\n event ProofClaimed(uint8 indexed operationType, bytes params, uint256 nonce);\n\n /**\n * @notice Generates a proof for cross-chain operations\n * @param contractAddress Address of contract generating the proof\n * @param operationType Type of operation being performed\n * @param params Operation parameters\n * @param nonce Current nonce for this operation type\n * @return proof Encoded proof data\n */\n function generateProof(\n address contractAddress,\n uint8 operationType,\n bytes memory params,\n uint256 nonce\n ) public pure returns (bytes memory proof) {\n bytes32 message = keccak256(\n abi.encodePacked(contractAddress, operationType, params, nonce)\n );\n bytes32 digest = keccak256(abi.encodePacked(\"\\x19Ethereum Signed Message:\\n32\", message));\n\n return abi.encode(operationType, params, nonce, digest);\n }\n\n /**\n * @notice Verifies and claims a proof\n * @param proof Proof to verify and claim\n * @param contractAddress Address of contract claiming the proof\n * @param storage_ Proof storage struct\n * @return operationType The type of operation being performed\n * @return params The operation parameters\n * @return nonce The operation sequence number\n */\n function verifyAndClaimProof(\n bytes memory proof,\n address contractAddress,\n ProofStorage storage storage_\n ) public returns (uint8 operationType, bytes memory params, uint256 nonce) {\n bytes32 digest;\n (operationType, params, nonce, digest) = abi.decode(\n proof,\n (uint8, bytes, uint256, bytes32)\n );\n\n bytes32 proofHash = keccak256(proof);\n require(!storage_.updateAppliedOnChain[proofHash], \"Proof already claimed\");\n require(nonce == storage_.currentNonce[operationType] + 1, \"Invalid nonce\");\n\n bytes32 message = keccak256(\n abi.encodePacked(contractAddress, operationType, params, nonce)\n );\n bytes32 expectedDigest = keccak256(\n abi.encodePacked(\"\\x19Ethereum Signed Message:\\n32\", message)\n );\n require(digest == expectedDigest, \"Invalid proof\");\n\n storage_.updateAppliedOnChain[proofHash] = true;\n storage_.currentNonce[operationType] = nonce;\n\n emit ProofClaimed(operationType, params, nonce);\n\n return (operationType, params, nonce);\n }\n\n /**\n * @notice Gets the next nonce for an operation type\n * @param storage_ Proof storage struct\n * @param operationType Type of operation\n * @return nonce Next nonce value\n */\n function getNextNonce(\n ProofStorage storage storage_,\n uint8 operationType\n ) public view returns (uint256 nonce) {\n return storage_.currentNonce[operationType] + 1;\n }\n\n /**\n * @notice Increments the nonce for an operation type\n * @param storage_ Proof storage struct\n * @param operationType Type of operation\n * @return nonce New nonce value\n */\n function incrementNonce(\n ProofStorage storage storage_,\n uint8 operationType\n ) public returns (uint256 nonce) {\n storage_.currentNonce[operationType]++;\n return storage_.currentNonce[operationType];\n }\n}\n" + } + }, + "settings": { + "optimizer": { + "enabled": true, + "runs": 200 + }, + "evmVersion": "paris", + "outputSelection": { + "*": { + "*": [ + "abi", + "evm.bytecode", + "evm.deployedBytecode", + "evm.methodIdentifiers", + "metadata", + "devdoc", + "userdoc", + "storageLayout", + "evm.gasEstimates" + ], + "": [ + "ast" + ] + } + }, + "metadata": { + "useLiteralContent": true + } + } +} \ No newline at end of file diff --git a/deployments/baseSepolia/solcInputs/c27a34cff02617821c386fb97b476bc1.json b/deployments/baseSepolia/solcInputs/c27a34cff02617821c386fb97b476bc1.json new file mode 100644 index 0000000..f692b04 --- /dev/null +++ b/deployments/baseSepolia/solcInputs/c27a34cff02617821c386fb97b476bc1.json @@ -0,0 +1,147 @@ +{ + "language": "Solidity", + "sources": { + "@openzeppelin/contracts/access/Ownable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol)\n\npragma solidity ^0.8.20;\n\nimport {Context} from \"../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 * The initial owner is set to the address provided by the deployer. This can\n * 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 /**\n * @dev The caller account is not authorized to perform an operation.\n */\n error OwnableUnauthorizedAccount(address account);\n\n /**\n * @dev The owner is not a valid owner account. (eg. `address(0)`)\n */\n error OwnableInvalidOwner(address owner);\n\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n /**\n * @dev Initializes the contract setting the address provided by the deployer as the initial owner.\n */\n constructor(address initialOwner) {\n if (initialOwner == address(0)) {\n revert OwnableInvalidOwner(address(0));\n }\n _transferOwnership(initialOwner);\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 if (owner() != _msgSender()) {\n revert OwnableUnauthorizedAccount(_msgSender());\n }\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 if (newOwner == address(0)) {\n revert OwnableInvalidOwner(address(0));\n }\n _transferOwnership(newOwner);\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Internal function without access restriction.\n */\n function _transferOwnership(address newOwner) internal virtual {\n address oldOwner = _owner;\n _owner = newOwner;\n emit OwnershipTransferred(oldOwner, newOwner);\n }\n}\n" + }, + "@openzeppelin/contracts/governance/utils/IVotes.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (governance/utils/IVotes.sol)\npragma solidity ^0.8.20;\n\n/**\n * @dev Common interface for {ERC20Votes}, {ERC721Votes}, and other {Votes}-enabled contracts.\n */\ninterface IVotes {\n /**\n * @dev The signature used has expired.\n */\n error VotesExpiredSignature(uint256 expiry);\n\n /**\n * @dev Emitted when an account changes their delegate.\n */\n event DelegateChanged(address indexed delegator, address indexed fromDelegate, address indexed toDelegate);\n\n /**\n * @dev Emitted when a token transfer or delegate change results in changes to a delegate's number of voting units.\n */\n event DelegateVotesChanged(address indexed delegate, uint256 previousVotes, uint256 newVotes);\n\n /**\n * @dev Returns the current amount of votes that `account` has.\n */\n function getVotes(address account) external view returns (uint256);\n\n /**\n * @dev Returns the amount of votes that `account` had at a specific moment in the past. If the `clock()` is\n * configured to use block numbers, this will return the value at the end of the corresponding block.\n */\n function getPastVotes(address account, uint256 timepoint) external view returns (uint256);\n\n /**\n * @dev Returns the total supply of votes available at a specific moment in the past. If the `clock()` is\n * configured to use block numbers, this will return the value at the end of the corresponding block.\n *\n * NOTE: This value is the sum of all available votes, which is not necessarily the sum of all delegated votes.\n * Votes that have not been delegated are still part of total supply, even though they would not participate in a\n * vote.\n */\n function getPastTotalSupply(uint256 timepoint) external view returns (uint256);\n\n /**\n * @dev Returns the delegate that `account` has chosen.\n */\n function delegates(address account) external view returns (address);\n\n /**\n * @dev Delegates votes from the sender to `delegatee`.\n */\n function delegate(address delegatee) external;\n\n /**\n * @dev Delegates votes from signer to `delegatee`.\n */\n function delegateBySig(address delegatee, uint256 nonce, uint256 expiry, uint8 v, bytes32 r, bytes32 s) external;\n}\n" + }, + "@openzeppelin/contracts/governance/utils/Votes.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (governance/utils/Votes.sol)\npragma solidity ^0.8.20;\n\nimport {IERC5805} from \"../../interfaces/IERC5805.sol\";\nimport {Context} from \"../../utils/Context.sol\";\nimport {Nonces} from \"../../utils/Nonces.sol\";\nimport {EIP712} from \"../../utils/cryptography/EIP712.sol\";\nimport {Checkpoints} from \"../../utils/structs/Checkpoints.sol\";\nimport {SafeCast} from \"../../utils/math/SafeCast.sol\";\nimport {ECDSA} from \"../../utils/cryptography/ECDSA.sol\";\nimport {Time} from \"../../utils/types/Time.sol\";\n\n/**\n * @dev This is a base abstract contract that tracks voting units, which are a measure of voting power that can be\n * transferred, and provides a system of vote delegation, where an account can delegate its voting units to a sort of\n * \"representative\" that will pool delegated voting units from different accounts and can then use it to vote in\n * decisions. In fact, voting units _must_ be delegated in order to count as actual votes, and an account has to\n * delegate those votes to itself if it wishes to participate in decisions and does not have a trusted representative.\n *\n * This contract is often combined with a token contract such that voting units correspond to token units. For an\n * example, see {ERC721Votes}.\n *\n * The full history of delegate votes is tracked on-chain so that governance protocols can consider votes as distributed\n * at a particular block number to protect against flash loans and double voting. The opt-in delegate system makes the\n * cost of this history tracking optional.\n *\n * When using this module the derived contract must implement {_getVotingUnits} (for example, make it return\n * {ERC721-balanceOf}), and can use {_transferVotingUnits} to track a change in the distribution of those units (in the\n * previous example, it would be included in {ERC721-_update}).\n */\nabstract contract Votes is Context, EIP712, Nonces, IERC5805 {\n using Checkpoints for Checkpoints.Trace208;\n\n bytes32 private constant DELEGATION_TYPEHASH =\n keccak256(\"Delegation(address delegatee,uint256 nonce,uint256 expiry)\");\n\n mapping(address account => address) private _delegatee;\n\n mapping(address delegatee => Checkpoints.Trace208) private _delegateCheckpoints;\n\n Checkpoints.Trace208 private _totalCheckpoints;\n\n /**\n * @dev The clock was incorrectly modified.\n */\n error ERC6372InconsistentClock();\n\n /**\n * @dev Lookup to future votes is not available.\n */\n error ERC5805FutureLookup(uint256 timepoint, uint48 clock);\n\n /**\n * @dev Clock used for flagging checkpoints. Can be overridden to implement timestamp based\n * checkpoints (and voting), in which case {CLOCK_MODE} should be overridden as well to match.\n */\n function clock() public view virtual returns (uint48) {\n return Time.blockNumber();\n }\n\n /**\n * @dev Machine-readable description of the clock as specified in ERC-6372.\n */\n // solhint-disable-next-line func-name-mixedcase\n function CLOCK_MODE() public view virtual returns (string memory) {\n // Check that the clock was not modified\n if (clock() != Time.blockNumber()) {\n revert ERC6372InconsistentClock();\n }\n return \"mode=blocknumber&from=default\";\n }\n\n /**\n * @dev Returns the current amount of votes that `account` has.\n */\n function getVotes(address account) public view virtual returns (uint256) {\n return _delegateCheckpoints[account].latest();\n }\n\n /**\n * @dev Returns the amount of votes that `account` had at a specific moment in the past. If the `clock()` is\n * configured to use block numbers, this will return the value at the end of the corresponding block.\n *\n * Requirements:\n *\n * - `timepoint` must be in the past. If operating using block numbers, the block must be already mined.\n */\n function getPastVotes(address account, uint256 timepoint) public view virtual returns (uint256) {\n uint48 currentTimepoint = clock();\n if (timepoint >= currentTimepoint) {\n revert ERC5805FutureLookup(timepoint, currentTimepoint);\n }\n return _delegateCheckpoints[account].upperLookupRecent(SafeCast.toUint48(timepoint));\n }\n\n /**\n * @dev Returns the total supply of votes available at a specific moment in the past. If the `clock()` is\n * configured to use block numbers, this will return the value at the end of the corresponding block.\n *\n * NOTE: This value is the sum of all available votes, which is not necessarily the sum of all delegated votes.\n * Votes that have not been delegated are still part of total supply, even though they would not participate in a\n * vote.\n *\n * Requirements:\n *\n * - `timepoint` must be in the past. If operating using block numbers, the block must be already mined.\n */\n function getPastTotalSupply(uint256 timepoint) public view virtual returns (uint256) {\n uint48 currentTimepoint = clock();\n if (timepoint >= currentTimepoint) {\n revert ERC5805FutureLookup(timepoint, currentTimepoint);\n }\n return _totalCheckpoints.upperLookupRecent(SafeCast.toUint48(timepoint));\n }\n\n /**\n * @dev Returns the current total supply of votes.\n */\n function _getTotalSupply() internal view virtual returns (uint256) {\n return _totalCheckpoints.latest();\n }\n\n /**\n * @dev Returns the delegate that `account` has chosen.\n */\n function delegates(address account) public view virtual returns (address) {\n return _delegatee[account];\n }\n\n /**\n * @dev Delegates votes from the sender to `delegatee`.\n */\n function delegate(address delegatee) public virtual {\n address account = _msgSender();\n _delegate(account, delegatee);\n }\n\n /**\n * @dev Delegates votes from signer to `delegatee`.\n */\n function delegateBySig(\n address delegatee,\n uint256 nonce,\n uint256 expiry,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) public virtual {\n if (block.timestamp > expiry) {\n revert VotesExpiredSignature(expiry);\n }\n address signer = ECDSA.recover(\n _hashTypedDataV4(keccak256(abi.encode(DELEGATION_TYPEHASH, delegatee, nonce, expiry))),\n v,\n r,\n s\n );\n _useCheckedNonce(signer, nonce);\n _delegate(signer, delegatee);\n }\n\n /**\n * @dev Delegate all of `account`'s voting units to `delegatee`.\n *\n * Emits events {IVotes-DelegateChanged} and {IVotes-DelegateVotesChanged}.\n */\n function _delegate(address account, address delegatee) internal virtual {\n address oldDelegate = delegates(account);\n _delegatee[account] = delegatee;\n\n emit DelegateChanged(account, oldDelegate, delegatee);\n _moveDelegateVotes(oldDelegate, delegatee, _getVotingUnits(account));\n }\n\n /**\n * @dev Transfers, mints, or burns voting units. To register a mint, `from` should be zero. To register a burn, `to`\n * should be zero. Total supply of voting units will be adjusted with mints and burns.\n */\n function _transferVotingUnits(address from, address to, uint256 amount) internal virtual {\n if (from == address(0)) {\n _push(_totalCheckpoints, _add, SafeCast.toUint208(amount));\n }\n if (to == address(0)) {\n _push(_totalCheckpoints, _subtract, SafeCast.toUint208(amount));\n }\n _moveDelegateVotes(delegates(from), delegates(to), amount);\n }\n\n /**\n * @dev Moves delegated votes from one delegate to another.\n */\n function _moveDelegateVotes(address from, address to, uint256 amount) internal virtual {\n if (from != to && amount > 0) {\n if (from != address(0)) {\n (uint256 oldValue, uint256 newValue) = _push(\n _delegateCheckpoints[from],\n _subtract,\n SafeCast.toUint208(amount)\n );\n emit DelegateVotesChanged(from, oldValue, newValue);\n }\n if (to != address(0)) {\n (uint256 oldValue, uint256 newValue) = _push(\n _delegateCheckpoints[to],\n _add,\n SafeCast.toUint208(amount)\n );\n emit DelegateVotesChanged(to, oldValue, newValue);\n }\n }\n }\n\n /**\n * @dev Get number of checkpoints for `account`.\n */\n function _numCheckpoints(address account) internal view virtual returns (uint32) {\n return SafeCast.toUint32(_delegateCheckpoints[account].length());\n }\n\n /**\n * @dev Get the `pos`-th checkpoint for `account`.\n */\n function _checkpoints(\n address account,\n uint32 pos\n ) internal view virtual returns (Checkpoints.Checkpoint208 memory) {\n return _delegateCheckpoints[account].at(pos);\n }\n\n function _push(\n Checkpoints.Trace208 storage store,\n function(uint208, uint208) view returns (uint208) op,\n uint208 delta\n ) private returns (uint208 oldValue, uint208 newValue) {\n return store.push(clock(), op(store.latest(), delta));\n }\n\n function _add(uint208 a, uint208 b) private pure returns (uint208) {\n return a + b;\n }\n\n function _subtract(uint208 a, uint208 b) private pure returns (uint208) {\n return a - b;\n }\n\n /**\n * @dev Must return the voting units held by an account.\n */\n function _getVotingUnits(address) internal view virtual returns (uint256);\n}\n" + }, + "@openzeppelin/contracts/interfaces/draft-IERC6093.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (interfaces/draft-IERC6093.sol)\npragma solidity ^0.8.20;\n\n/**\n * @dev Standard ERC-20 Errors\n * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC-20 tokens.\n */\ninterface IERC20Errors {\n /**\n * @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers.\n * @param sender Address whose tokens are being transferred.\n * @param balance Current balance for the interacting account.\n * @param needed Minimum amount required to perform a transfer.\n */\n error ERC20InsufficientBalance(address sender, uint256 balance, uint256 needed);\n\n /**\n * @dev Indicates a failure with the token `sender`. Used in transfers.\n * @param sender Address whose tokens are being transferred.\n */\n error ERC20InvalidSender(address sender);\n\n /**\n * @dev Indicates a failure with the token `receiver`. Used in transfers.\n * @param receiver Address to which tokens are being transferred.\n */\n error ERC20InvalidReceiver(address receiver);\n\n /**\n * @dev Indicates a failure with the `spender`’s `allowance`. Used in transfers.\n * @param spender Address that may be allowed to operate on tokens without being their owner.\n * @param allowance Amount of tokens a `spender` is allowed to operate with.\n * @param needed Minimum amount required to perform a transfer.\n */\n error ERC20InsufficientAllowance(address spender, uint256 allowance, uint256 needed);\n\n /**\n * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.\n * @param approver Address initiating an approval operation.\n */\n error ERC20InvalidApprover(address approver);\n\n /**\n * @dev Indicates a failure with the `spender` to be approved. Used in approvals.\n * @param spender Address that may be allowed to operate on tokens without being their owner.\n */\n error ERC20InvalidSpender(address spender);\n}\n\n/**\n * @dev Standard ERC-721 Errors\n * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC-721 tokens.\n */\ninterface IERC721Errors {\n /**\n * @dev Indicates that an address can't be an owner. For example, `address(0)` is a forbidden owner in ERC-20.\n * Used in balance queries.\n * @param owner Address of the current owner of a token.\n */\n error ERC721InvalidOwner(address owner);\n\n /**\n * @dev Indicates a `tokenId` whose `owner` is the zero address.\n * @param tokenId Identifier number of a token.\n */\n error ERC721NonexistentToken(uint256 tokenId);\n\n /**\n * @dev Indicates an error related to the ownership over a particular token. Used in transfers.\n * @param sender Address whose tokens are being transferred.\n * @param tokenId Identifier number of a token.\n * @param owner Address of the current owner of a token.\n */\n error ERC721IncorrectOwner(address sender, uint256 tokenId, address owner);\n\n /**\n * @dev Indicates a failure with the token `sender`. Used in transfers.\n * @param sender Address whose tokens are being transferred.\n */\n error ERC721InvalidSender(address sender);\n\n /**\n * @dev Indicates a failure with the token `receiver`. Used in transfers.\n * @param receiver Address to which tokens are being transferred.\n */\n error ERC721InvalidReceiver(address receiver);\n\n /**\n * @dev Indicates a failure with the `operator`’s approval. Used in transfers.\n * @param operator Address that may be allowed to operate on tokens without being their owner.\n * @param tokenId Identifier number of a token.\n */\n error ERC721InsufficientApproval(address operator, uint256 tokenId);\n\n /**\n * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.\n * @param approver Address initiating an approval operation.\n */\n error ERC721InvalidApprover(address approver);\n\n /**\n * @dev Indicates a failure with the `operator` to be approved. Used in approvals.\n * @param operator Address that may be allowed to operate on tokens without being their owner.\n */\n error ERC721InvalidOperator(address operator);\n}\n\n/**\n * @dev Standard ERC-1155 Errors\n * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC-1155 tokens.\n */\ninterface IERC1155Errors {\n /**\n * @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers.\n * @param sender Address whose tokens are being transferred.\n * @param balance Current balance for the interacting account.\n * @param needed Minimum amount required to perform a transfer.\n * @param tokenId Identifier number of a token.\n */\n error ERC1155InsufficientBalance(address sender, uint256 balance, uint256 needed, uint256 tokenId);\n\n /**\n * @dev Indicates a failure with the token `sender`. Used in transfers.\n * @param sender Address whose tokens are being transferred.\n */\n error ERC1155InvalidSender(address sender);\n\n /**\n * @dev Indicates a failure with the token `receiver`. Used in transfers.\n * @param receiver Address to which tokens are being transferred.\n */\n error ERC1155InvalidReceiver(address receiver);\n\n /**\n * @dev Indicates a failure with the `operator`’s approval. Used in transfers.\n * @param operator Address that may be allowed to operate on tokens without being their owner.\n * @param owner Address of the current owner of a token.\n */\n error ERC1155MissingApprovalForAll(address operator, address owner);\n\n /**\n * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.\n * @param approver Address initiating an approval operation.\n */\n error ERC1155InvalidApprover(address approver);\n\n /**\n * @dev Indicates a failure with the `operator` to be approved. Used in approvals.\n * @param operator Address that may be allowed to operate on tokens without being their owner.\n */\n error ERC1155InvalidOperator(address operator);\n\n /**\n * @dev Indicates an array length mismatch between ids and values in a safeBatchTransferFrom operation.\n * Used in batch transfers.\n * @param idsLength Length of the array of token identifiers\n * @param valuesLength Length of the array of token amounts\n */\n error ERC1155InvalidArrayLength(uint256 idsLength, uint256 valuesLength);\n}\n" + }, + "@openzeppelin/contracts/interfaces/IERC165.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC165.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC165} from \"../utils/introspection/IERC165.sol\";\n" + }, + "@openzeppelin/contracts/interfaces/IERC4906.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (interfaces/IERC4906.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC165} from \"./IERC165.sol\";\nimport {IERC721} from \"./IERC721.sol\";\n\n/// @title ERC-721 Metadata Update Extension\ninterface IERC4906 is IERC165, IERC721 {\n /// @dev This event emits when the metadata of a token is changed.\n /// So that the third-party platforms such as NFT market could\n /// timely update the images and related attributes of the NFT.\n event MetadataUpdate(uint256 _tokenId);\n\n /// @dev This event emits when the metadata of a range of tokens is changed.\n /// So that the third-party platforms such as NFT market could\n /// timely update the images and related attributes of the NFTs.\n event BatchMetadataUpdate(uint256 _fromTokenId, uint256 _toTokenId);\n}\n" + }, + "@openzeppelin/contracts/interfaces/IERC5267.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC5267.sol)\n\npragma solidity ^0.8.20;\n\ninterface IERC5267 {\n /**\n * @dev MAY be emitted to signal that the domain could have changed.\n */\n event EIP712DomainChanged();\n\n /**\n * @dev returns the fields and values that describe the domain separator used by this contract for EIP-712\n * signature.\n */\n function eip712Domain()\n external\n view\n returns (\n bytes1 fields,\n string memory name,\n string memory version,\n uint256 chainId,\n address verifyingContract,\n bytes32 salt,\n uint256[] memory extensions\n );\n}\n" + }, + "@openzeppelin/contracts/interfaces/IERC5805.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC5805.sol)\n\npragma solidity ^0.8.20;\n\nimport {IVotes} from \"../governance/utils/IVotes.sol\";\nimport {IERC6372} from \"./IERC6372.sol\";\n\ninterface IERC5805 is IERC6372, IVotes {}\n" + }, + "@openzeppelin/contracts/interfaces/IERC6372.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC6372.sol)\n\npragma solidity ^0.8.20;\n\ninterface IERC6372 {\n /**\n * @dev Clock used for flagging checkpoints. Can be overridden to implement timestamp based checkpoints (and voting).\n */\n function clock() external view returns (uint48);\n\n /**\n * @dev Description of the clock\n */\n // solhint-disable-next-line func-name-mixedcase\n function CLOCK_MODE() external view returns (string memory);\n}\n" + }, + "@openzeppelin/contracts/interfaces/IERC721.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC721.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC721} from \"../token/ERC721/IERC721.sol\";\n" + }, + "@openzeppelin/contracts/token/ERC721/ERC721.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC721/ERC721.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC721} from \"./IERC721.sol\";\nimport {IERC721Metadata} from \"./extensions/IERC721Metadata.sol\";\nimport {ERC721Utils} from \"./utils/ERC721Utils.sol\";\nimport {Context} from \"../../utils/Context.sol\";\nimport {Strings} from \"../../utils/Strings.sol\";\nimport {IERC165, ERC165} from \"../../utils/introspection/ERC165.sol\";\nimport {IERC721Errors} from \"../../interfaces/draft-IERC6093.sol\";\n\n/**\n * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC-721] Non-Fungible Token Standard, including\n * the Metadata extension, but not including the Enumerable extension, which is available separately as\n * {ERC721Enumerable}.\n */\nabstract contract ERC721 is Context, ERC165, IERC721, IERC721Metadata, IERC721Errors {\n using Strings for uint256;\n\n // Token name\n string private _name;\n\n // Token symbol\n string private _symbol;\n\n mapping(uint256 tokenId => address) private _owners;\n\n mapping(address owner => uint256) private _balances;\n\n mapping(uint256 tokenId => address) private _tokenApprovals;\n\n mapping(address owner => mapping(address operator => bool)) private _operatorApprovals;\n\n /**\n * @dev Initializes the contract by setting a `name` and a `symbol` to the token collection.\n */\n constructor(string memory name_, string memory symbol_) {\n _name = name_;\n _symbol = symbol_;\n }\n\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {\n return\n interfaceId == type(IERC721).interfaceId ||\n interfaceId == type(IERC721Metadata).interfaceId ||\n super.supportsInterface(interfaceId);\n }\n\n /**\n * @dev See {IERC721-balanceOf}.\n */\n function balanceOf(address owner) public view virtual returns (uint256) {\n if (owner == address(0)) {\n revert ERC721InvalidOwner(address(0));\n }\n return _balances[owner];\n }\n\n /**\n * @dev See {IERC721-ownerOf}.\n */\n function ownerOf(uint256 tokenId) public view virtual returns (address) {\n return _requireOwned(tokenId);\n }\n\n /**\n * @dev See {IERC721Metadata-name}.\n */\n function name() public view virtual returns (string memory) {\n return _name;\n }\n\n /**\n * @dev See {IERC721Metadata-symbol}.\n */\n function symbol() public view virtual returns (string memory) {\n return _symbol;\n }\n\n /**\n * @dev See {IERC721Metadata-tokenURI}.\n */\n function tokenURI(uint256 tokenId) public view virtual returns (string memory) {\n _requireOwned(tokenId);\n\n string memory baseURI = _baseURI();\n return bytes(baseURI).length > 0 ? string.concat(baseURI, tokenId.toString()) : \"\";\n }\n\n /**\n * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each\n * token will be the concatenation of the `baseURI` and the `tokenId`. Empty\n * by default, can be overridden in child contracts.\n */\n function _baseURI() internal view virtual returns (string memory) {\n return \"\";\n }\n\n /**\n * @dev See {IERC721-approve}.\n */\n function approve(address to, uint256 tokenId) public virtual {\n _approve(to, tokenId, _msgSender());\n }\n\n /**\n * @dev See {IERC721-getApproved}.\n */\n function getApproved(uint256 tokenId) public view virtual returns (address) {\n _requireOwned(tokenId);\n\n return _getApproved(tokenId);\n }\n\n /**\n * @dev See {IERC721-setApprovalForAll}.\n */\n function setApprovalForAll(address operator, bool approved) public virtual {\n _setApprovalForAll(_msgSender(), operator, approved);\n }\n\n /**\n * @dev See {IERC721-isApprovedForAll}.\n */\n function isApprovedForAll(address owner, address operator) public view virtual returns (bool) {\n return _operatorApprovals[owner][operator];\n }\n\n /**\n * @dev See {IERC721-transferFrom}.\n */\n function transferFrom(address from, address to, uint256 tokenId) public virtual {\n if (to == address(0)) {\n revert ERC721InvalidReceiver(address(0));\n }\n // Setting an \"auth\" arguments enables the `_isAuthorized` check which verifies that the token exists\n // (from != 0). Therefore, it is not needed to verify that the return value is not 0 here.\n address previousOwner = _update(to, tokenId, _msgSender());\n if (previousOwner != from) {\n revert ERC721IncorrectOwner(from, tokenId, previousOwner);\n }\n }\n\n /**\n * @dev See {IERC721-safeTransferFrom}.\n */\n function safeTransferFrom(address from, address to, uint256 tokenId) public {\n safeTransferFrom(from, to, tokenId, \"\");\n }\n\n /**\n * @dev See {IERC721-safeTransferFrom}.\n */\n function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory data) public virtual {\n transferFrom(from, to, tokenId);\n ERC721Utils.checkOnERC721Received(_msgSender(), from, to, tokenId, data);\n }\n\n /**\n * @dev Returns the owner of the `tokenId`. Does NOT revert if token doesn't exist\n *\n * IMPORTANT: Any overrides to this function that add ownership of tokens not tracked by the\n * core ERC-721 logic MUST be matched with the use of {_increaseBalance} to keep balances\n * consistent with ownership. The invariant to preserve is that for any address `a` the value returned by\n * `balanceOf(a)` must be equal to the number of tokens such that `_ownerOf(tokenId)` is `a`.\n */\n function _ownerOf(uint256 tokenId) internal view virtual returns (address) {\n return _owners[tokenId];\n }\n\n /**\n * @dev Returns the approved address for `tokenId`. Returns 0 if `tokenId` is not minted.\n */\n function _getApproved(uint256 tokenId) internal view virtual returns (address) {\n return _tokenApprovals[tokenId];\n }\n\n /**\n * @dev Returns whether `spender` is allowed to manage `owner`'s tokens, or `tokenId` in\n * particular (ignoring whether it is owned by `owner`).\n *\n * WARNING: This function assumes that `owner` is the actual owner of `tokenId` and does not verify this\n * assumption.\n */\n function _isAuthorized(address owner, address spender, uint256 tokenId) internal view virtual returns (bool) {\n return\n spender != address(0) &&\n (owner == spender || isApprovedForAll(owner, spender) || _getApproved(tokenId) == spender);\n }\n\n /**\n * @dev Checks if `spender` can operate on `tokenId`, assuming the provided `owner` is the actual owner.\n * Reverts if:\n * - `spender` does not have approval from `owner` for `tokenId`.\n * - `spender` does not have approval to manage all of `owner`'s assets.\n *\n * WARNING: This function assumes that `owner` is the actual owner of `tokenId` and does not verify this\n * assumption.\n */\n function _checkAuthorized(address owner, address spender, uint256 tokenId) internal view virtual {\n if (!_isAuthorized(owner, spender, tokenId)) {\n if (owner == address(0)) {\n revert ERC721NonexistentToken(tokenId);\n } else {\n revert ERC721InsufficientApproval(spender, tokenId);\n }\n }\n }\n\n /**\n * @dev Unsafe write access to the balances, used by extensions that \"mint\" tokens using an {ownerOf} override.\n *\n * NOTE: the value is limited to type(uint128).max. This protect against _balance overflow. It is unrealistic that\n * a uint256 would ever overflow from increments when these increments are bounded to uint128 values.\n *\n * WARNING: Increasing an account's balance using this function tends to be paired with an override of the\n * {_ownerOf} function to resolve the ownership of the corresponding tokens so that balances and ownership\n * remain consistent with one another.\n */\n function _increaseBalance(address account, uint128 value) internal virtual {\n unchecked {\n _balances[account] += value;\n }\n }\n\n /**\n * @dev Transfers `tokenId` from its current owner to `to`, or alternatively mints (or burns) if the current owner\n * (or `to`) is the zero address. Returns the owner of the `tokenId` before the update.\n *\n * The `auth` argument is optional. If the value passed is non 0, then this function will check that\n * `auth` is either the owner of the token, or approved to operate on the token (by the owner).\n *\n * Emits a {Transfer} event.\n *\n * NOTE: If overriding this function in a way that tracks balances, see also {_increaseBalance}.\n */\n function _update(address to, uint256 tokenId, address auth) internal virtual returns (address) {\n address from = _ownerOf(tokenId);\n\n // Perform (optional) operator check\n if (auth != address(0)) {\n _checkAuthorized(from, auth, tokenId);\n }\n\n // Execute the update\n if (from != address(0)) {\n // Clear approval. No need to re-authorize or emit the Approval event\n _approve(address(0), tokenId, address(0), false);\n\n unchecked {\n _balances[from] -= 1;\n }\n }\n\n if (to != address(0)) {\n unchecked {\n _balances[to] += 1;\n }\n }\n\n _owners[tokenId] = to;\n\n emit Transfer(from, to, tokenId);\n\n return from;\n }\n\n /**\n * @dev Mints `tokenId` and transfers it to `to`.\n *\n * WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible\n *\n * Requirements:\n *\n * - `tokenId` must not exist.\n * - `to` cannot be the zero address.\n *\n * Emits a {Transfer} event.\n */\n function _mint(address to, uint256 tokenId) internal {\n if (to == address(0)) {\n revert ERC721InvalidReceiver(address(0));\n }\n address previousOwner = _update(to, tokenId, address(0));\n if (previousOwner != address(0)) {\n revert ERC721InvalidSender(address(0));\n }\n }\n\n /**\n * @dev Mints `tokenId`, transfers it to `to` and checks for `to` acceptance.\n *\n * Requirements:\n *\n * - `tokenId` must not exist.\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\n *\n * Emits a {Transfer} event.\n */\n function _safeMint(address to, uint256 tokenId) internal {\n _safeMint(to, tokenId, \"\");\n }\n\n /**\n * @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is\n * forwarded in {IERC721Receiver-onERC721Received} to contract recipients.\n */\n function _safeMint(address to, uint256 tokenId, bytes memory data) internal virtual {\n _mint(to, tokenId);\n ERC721Utils.checkOnERC721Received(_msgSender(), address(0), to, tokenId, data);\n }\n\n /**\n * @dev Destroys `tokenId`.\n * The approval is cleared when the token is burned.\n * This is an internal function that does not check if the sender is authorized to operate on the token.\n *\n * Requirements:\n *\n * - `tokenId` must exist.\n *\n * Emits a {Transfer} event.\n */\n function _burn(uint256 tokenId) internal {\n address previousOwner = _update(address(0), tokenId, address(0));\n if (previousOwner == address(0)) {\n revert ERC721NonexistentToken(tokenId);\n }\n }\n\n /**\n * @dev Transfers `tokenId` from `from` to `to`.\n * As opposed to {transferFrom}, this imposes no restrictions on msg.sender.\n *\n * Requirements:\n *\n * - `to` cannot be the zero address.\n * - `tokenId` token must be owned by `from`.\n *\n * Emits a {Transfer} event.\n */\n function _transfer(address from, address to, uint256 tokenId) internal {\n if (to == address(0)) {\n revert ERC721InvalidReceiver(address(0));\n }\n address previousOwner = _update(to, tokenId, address(0));\n if (previousOwner == address(0)) {\n revert ERC721NonexistentToken(tokenId);\n } else if (previousOwner != from) {\n revert ERC721IncorrectOwner(from, tokenId, previousOwner);\n }\n }\n\n /**\n * @dev Safely transfers `tokenId` token from `from` to `to`, checking that contract recipients\n * are aware of the ERC-721 standard to prevent tokens from being forever locked.\n *\n * `data` is additional data, it has no specified format and it is sent in call to `to`.\n *\n * This internal function is like {safeTransferFrom} in the sense that it invokes\n * {IERC721Receiver-onERC721Received} on the receiver, and can be used to e.g.\n * implement alternative mechanisms to perform token transfer, such as signature-based.\n *\n * Requirements:\n *\n * - `tokenId` token must exist and be owned by `from`.\n * - `to` cannot be the zero address.\n * - `from` cannot be the zero address.\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\n *\n * Emits a {Transfer} event.\n */\n function _safeTransfer(address from, address to, uint256 tokenId) internal {\n _safeTransfer(from, to, tokenId, \"\");\n }\n\n /**\n * @dev Same as {xref-ERC721-_safeTransfer-address-address-uint256-}[`_safeTransfer`], with an additional `data` parameter which is\n * forwarded in {IERC721Receiver-onERC721Received} to contract recipients.\n */\n function _safeTransfer(address from, address to, uint256 tokenId, bytes memory data) internal virtual {\n _transfer(from, to, tokenId);\n ERC721Utils.checkOnERC721Received(_msgSender(), from, to, tokenId, data);\n }\n\n /**\n * @dev Approve `to` to operate on `tokenId`\n *\n * The `auth` argument is optional. If the value passed is non 0, then this function will check that `auth` is\n * either the owner of the token, or approved to operate on all tokens held by this owner.\n *\n * Emits an {Approval} event.\n *\n * Overrides to this logic should be done to the variant with an additional `bool emitEvent` argument.\n */\n function _approve(address to, uint256 tokenId, address auth) internal {\n _approve(to, tokenId, auth, true);\n }\n\n /**\n * @dev Variant of `_approve` with an optional flag to enable or disable the {Approval} event. The event is not\n * emitted in the context of transfers.\n */\n function _approve(address to, uint256 tokenId, address auth, bool emitEvent) internal virtual {\n // Avoid reading the owner unless necessary\n if (emitEvent || auth != address(0)) {\n address owner = _requireOwned(tokenId);\n\n // We do not use _isAuthorized because single-token approvals should not be able to call approve\n if (auth != address(0) && owner != auth && !isApprovedForAll(owner, auth)) {\n revert ERC721InvalidApprover(auth);\n }\n\n if (emitEvent) {\n emit Approval(owner, to, tokenId);\n }\n }\n\n _tokenApprovals[tokenId] = to;\n }\n\n /**\n * @dev Approve `operator` to operate on all of `owner` tokens\n *\n * Requirements:\n * - operator can't be the address zero.\n *\n * Emits an {ApprovalForAll} event.\n */\n function _setApprovalForAll(address owner, address operator, bool approved) internal virtual {\n if (operator == address(0)) {\n revert ERC721InvalidOperator(operator);\n }\n _operatorApprovals[owner][operator] = approved;\n emit ApprovalForAll(owner, operator, approved);\n }\n\n /**\n * @dev Reverts if the `tokenId` doesn't have a current owner (it hasn't been minted, or it has been burned).\n * Returns the owner.\n *\n * Overrides to ownership logic should be done to {_ownerOf}.\n */\n function _requireOwned(uint256 tokenId) internal view returns (address) {\n address owner = _ownerOf(tokenId);\n if (owner == address(0)) {\n revert ERC721NonexistentToken(tokenId);\n }\n return owner;\n }\n}\n" + }, + "@openzeppelin/contracts/token/ERC721/extensions/ERC721Burnable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC721/extensions/ERC721Burnable.sol)\n\npragma solidity ^0.8.20;\n\nimport {ERC721} from \"../ERC721.sol\";\nimport {Context} from \"../../../utils/Context.sol\";\n\n/**\n * @title ERC-721 Burnable Token\n * @dev ERC-721 Token that can be burned (destroyed).\n */\nabstract contract ERC721Burnable is Context, ERC721 {\n /**\n * @dev Burns `tokenId`. See {ERC721-_burn}.\n *\n * Requirements:\n *\n * - The caller must own `tokenId` or be an approved operator.\n */\n function burn(uint256 tokenId) public virtual {\n // Setting an \"auth\" arguments enables the `_isAuthorized` check which verifies that the token exists\n // (from != 0). Therefore, it is not needed to verify that the return value is not 0 here.\n _update(address(0), tokenId, _msgSender());\n }\n}\n" + }, + "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC721/extensions/ERC721Enumerable.sol)\n\npragma solidity ^0.8.20;\n\nimport {ERC721} from \"../ERC721.sol\";\nimport {IERC721Enumerable} from \"./IERC721Enumerable.sol\";\nimport {IERC165} from \"../../../utils/introspection/ERC165.sol\";\n\n/**\n * @dev This implements an optional extension of {ERC721} defined in the ERC that adds enumerability\n * of all the token ids in the contract as well as all token ids owned by each account.\n *\n * CAUTION: {ERC721} extensions that implement custom `balanceOf` logic, such as {ERC721Consecutive},\n * interfere with enumerability and should not be used together with {ERC721Enumerable}.\n */\nabstract contract ERC721Enumerable is ERC721, IERC721Enumerable {\n mapping(address owner => mapping(uint256 index => uint256)) private _ownedTokens;\n mapping(uint256 tokenId => uint256) private _ownedTokensIndex;\n\n uint256[] private _allTokens;\n mapping(uint256 tokenId => uint256) private _allTokensIndex;\n\n /**\n * @dev An `owner`'s token query was out of bounds for `index`.\n *\n * NOTE: The owner being `address(0)` indicates a global out of bounds index.\n */\n error ERC721OutOfBoundsIndex(address owner, uint256 index);\n\n /**\n * @dev Batch mint is not allowed.\n */\n error ERC721EnumerableForbiddenBatchMint();\n\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165, ERC721) returns (bool) {\n return interfaceId == type(IERC721Enumerable).interfaceId || super.supportsInterface(interfaceId);\n }\n\n /**\n * @dev See {IERC721Enumerable-tokenOfOwnerByIndex}.\n */\n function tokenOfOwnerByIndex(address owner, uint256 index) public view virtual returns (uint256) {\n if (index >= balanceOf(owner)) {\n revert ERC721OutOfBoundsIndex(owner, index);\n }\n return _ownedTokens[owner][index];\n }\n\n /**\n * @dev See {IERC721Enumerable-totalSupply}.\n */\n function totalSupply() public view virtual returns (uint256) {\n return _allTokens.length;\n }\n\n /**\n * @dev See {IERC721Enumerable-tokenByIndex}.\n */\n function tokenByIndex(uint256 index) public view virtual returns (uint256) {\n if (index >= totalSupply()) {\n revert ERC721OutOfBoundsIndex(address(0), index);\n }\n return _allTokens[index];\n }\n\n /**\n * @dev See {ERC721-_update}.\n */\n function _update(address to, uint256 tokenId, address auth) internal virtual override returns (address) {\n address previousOwner = super._update(to, tokenId, auth);\n\n if (previousOwner == address(0)) {\n _addTokenToAllTokensEnumeration(tokenId);\n } else if (previousOwner != to) {\n _removeTokenFromOwnerEnumeration(previousOwner, tokenId);\n }\n if (to == address(0)) {\n _removeTokenFromAllTokensEnumeration(tokenId);\n } else if (previousOwner != to) {\n _addTokenToOwnerEnumeration(to, tokenId);\n }\n\n return previousOwner;\n }\n\n /**\n * @dev Private function to add a token to this extension's ownership-tracking data structures.\n * @param to address representing the new owner of the given token ID\n * @param tokenId uint256 ID of the token to be added to the tokens list of the given address\n */\n function _addTokenToOwnerEnumeration(address to, uint256 tokenId) private {\n uint256 length = balanceOf(to) - 1;\n _ownedTokens[to][length] = tokenId;\n _ownedTokensIndex[tokenId] = length;\n }\n\n /**\n * @dev Private function to add a token to this extension's token tracking data structures.\n * @param tokenId uint256 ID of the token to be added to the tokens list\n */\n function _addTokenToAllTokensEnumeration(uint256 tokenId) private {\n _allTokensIndex[tokenId] = _allTokens.length;\n _allTokens.push(tokenId);\n }\n\n /**\n * @dev Private function to remove a token from this extension's ownership-tracking data structures. Note that\n * while the token is not assigned a new owner, the `_ownedTokensIndex` mapping is _not_ updated: this allows for\n * gas optimizations e.g. when performing a transfer operation (avoiding double writes).\n * This has O(1) time complexity, but alters the order of the _ownedTokens array.\n * @param from address representing the previous owner of the given token ID\n * @param tokenId uint256 ID of the token to be removed from the tokens list of the given address\n */\n function _removeTokenFromOwnerEnumeration(address from, uint256 tokenId) private {\n // To prevent a gap in from's tokens array, we store the last token in the index of the token to delete, and\n // then delete the last slot (swap and pop).\n\n uint256 lastTokenIndex = balanceOf(from);\n uint256 tokenIndex = _ownedTokensIndex[tokenId];\n\n mapping(uint256 index => uint256) storage _ownedTokensByOwner = _ownedTokens[from];\n\n // When the token to delete is the last token, the swap operation is unnecessary\n if (tokenIndex != lastTokenIndex) {\n uint256 lastTokenId = _ownedTokensByOwner[lastTokenIndex];\n\n _ownedTokensByOwner[tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token\n _ownedTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index\n }\n\n // This also deletes the contents at the last position of the array\n delete _ownedTokensIndex[tokenId];\n delete _ownedTokensByOwner[lastTokenIndex];\n }\n\n /**\n * @dev Private function to remove a token from this extension's token tracking data structures.\n * This has O(1) time complexity, but alters the order of the _allTokens array.\n * @param tokenId uint256 ID of the token to be removed from the tokens list\n */\n function _removeTokenFromAllTokensEnumeration(uint256 tokenId) private {\n // To prevent a gap in the tokens array, we store the last token in the index of the token to delete, and\n // then delete the last slot (swap and pop).\n\n uint256 lastTokenIndex = _allTokens.length - 1;\n uint256 tokenIndex = _allTokensIndex[tokenId];\n\n // When the token to delete is the last token, the swap operation is unnecessary. However, since this occurs so\n // rarely (when the last minted token is burnt) that we still do the swap here to avoid the gas cost of adding\n // an 'if' statement (like in _removeTokenFromOwnerEnumeration)\n uint256 lastTokenId = _allTokens[lastTokenIndex];\n\n _allTokens[tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token\n _allTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index\n\n // This also deletes the contents at the last position of the array\n delete _allTokensIndex[tokenId];\n _allTokens.pop();\n }\n\n /**\n * See {ERC721-_increaseBalance}. We need that to account tokens that were minted in batch\n */\n function _increaseBalance(address account, uint128 amount) internal virtual override {\n if (amount > 0) {\n revert ERC721EnumerableForbiddenBatchMint();\n }\n super._increaseBalance(account, amount);\n }\n}\n" + }, + "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC721/extensions/ERC721URIStorage.sol)\n\npragma solidity ^0.8.20;\n\nimport {ERC721} from \"../ERC721.sol\";\nimport {Strings} from \"../../../utils/Strings.sol\";\nimport {IERC4906} from \"../../../interfaces/IERC4906.sol\";\nimport {IERC165} from \"../../../interfaces/IERC165.sol\";\n\n/**\n * @dev ERC-721 token with storage based token URI management.\n */\nabstract contract ERC721URIStorage is IERC4906, ERC721 {\n using Strings for uint256;\n\n // Interface ID as defined in ERC-4906. This does not correspond to a traditional interface ID as ERC-4906 only\n // defines events and does not include any external function.\n bytes4 private constant ERC4906_INTERFACE_ID = bytes4(0x49064906);\n\n // Optional mapping for token URIs\n mapping(uint256 tokenId => string) private _tokenURIs;\n\n /**\n * @dev See {IERC165-supportsInterface}\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override(ERC721, IERC165) returns (bool) {\n return interfaceId == ERC4906_INTERFACE_ID || super.supportsInterface(interfaceId);\n }\n\n /**\n * @dev See {IERC721Metadata-tokenURI}.\n */\n function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {\n _requireOwned(tokenId);\n\n string memory _tokenURI = _tokenURIs[tokenId];\n string memory base = _baseURI();\n\n // If there is no base URI, return the token URI.\n if (bytes(base).length == 0) {\n return _tokenURI;\n }\n // If both are set, concatenate the baseURI and tokenURI (via string.concat).\n if (bytes(_tokenURI).length > 0) {\n return string.concat(base, _tokenURI);\n }\n\n return super.tokenURI(tokenId);\n }\n\n /**\n * @dev Sets `_tokenURI` as the tokenURI of `tokenId`.\n *\n * Emits {MetadataUpdate}.\n */\n function _setTokenURI(uint256 tokenId, string memory _tokenURI) internal virtual {\n _tokenURIs[tokenId] = _tokenURI;\n emit MetadataUpdate(tokenId);\n }\n}\n" + }, + "@openzeppelin/contracts/token/ERC721/extensions/ERC721Votes.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC721/extensions/ERC721Votes.sol)\n\npragma solidity ^0.8.20;\n\nimport {ERC721} from \"../ERC721.sol\";\nimport {Votes} from \"../../../governance/utils/Votes.sol\";\n\n/**\n * @dev Extension of ERC-721 to support voting and delegation as implemented by {Votes}, where each individual NFT counts\n * as 1 vote unit.\n *\n * Tokens do not count as votes until they are delegated, because votes must be tracked which incurs an additional cost\n * on every transfer. Token holders can either delegate to a trusted representative who will decide how to make use of\n * the votes in governance decisions, or they can delegate to themselves to be their own representative.\n */\nabstract contract ERC721Votes is ERC721, Votes {\n /**\n * @dev See {ERC721-_update}. Adjusts votes when tokens are transferred.\n *\n * Emits a {IVotes-DelegateVotesChanged} event.\n */\n function _update(address to, uint256 tokenId, address auth) internal virtual override returns (address) {\n address previousOwner = super._update(to, tokenId, auth);\n\n _transferVotingUnits(previousOwner, to, 1);\n\n return previousOwner;\n }\n\n /**\n * @dev Returns the balance of `account`.\n *\n * WARNING: Overriding this function will likely result in incorrect vote tracking.\n */\n function _getVotingUnits(address account) internal view virtual override returns (uint256) {\n return balanceOf(account);\n }\n\n /**\n * @dev See {ERC721-_increaseBalance}. We need that to account tokens that were minted in batch.\n */\n function _increaseBalance(address account, uint128 amount) internal virtual override {\n super._increaseBalance(account, amount);\n _transferVotingUnits(address(0), account, amount);\n }\n}\n" + }, + "@openzeppelin/contracts/token/ERC721/extensions/IERC721Enumerable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC721/extensions/IERC721Enumerable.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC721} from \"../IERC721.sol\";\n\n/**\n * @title ERC-721 Non-Fungible Token Standard, optional enumeration extension\n * @dev See https://eips.ethereum.org/EIPS/eip-721\n */\ninterface IERC721Enumerable is IERC721 {\n /**\n * @dev Returns the total amount of tokens stored by the contract.\n */\n function totalSupply() external view returns (uint256);\n\n /**\n * @dev Returns a token ID owned by `owner` at a given `index` of its token list.\n * Use along with {balanceOf} to enumerate all of ``owner``'s tokens.\n */\n function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256);\n\n /**\n * @dev Returns a token ID at a given `index` of all the tokens stored by the contract.\n * Use along with {totalSupply} to enumerate all tokens.\n */\n function tokenByIndex(uint256 index) external view returns (uint256);\n}\n" + }, + "@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC721/extensions/IERC721Metadata.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC721} from \"../IERC721.sol\";\n\n/**\n * @title ERC-721 Non-Fungible Token Standard, optional metadata extension\n * @dev See https://eips.ethereum.org/EIPS/eip-721\n */\ninterface IERC721Metadata is IERC721 {\n /**\n * @dev Returns the token collection name.\n */\n function name() external view returns (string memory);\n\n /**\n * @dev Returns the token collection symbol.\n */\n function symbol() external view returns (string memory);\n\n /**\n * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token.\n */\n function tokenURI(uint256 tokenId) external view returns (string memory);\n}\n" + }, + "@openzeppelin/contracts/token/ERC721/IERC721.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC721/IERC721.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC165} from \"../../utils/introspection/IERC165.sol\";\n\n/**\n * @dev Required interface of an ERC-721 compliant contract.\n */\ninterface IERC721 is IERC165 {\n /**\n * @dev Emitted when `tokenId` token is transferred from `from` to `to`.\n */\n event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);\n\n /**\n * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.\n */\n event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);\n\n /**\n * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.\n */\n event ApprovalForAll(address indexed owner, address indexed operator, bool approved);\n\n /**\n * @dev Returns the number of tokens in ``owner``'s account.\n */\n function balanceOf(address owner) external view returns (uint256 balance);\n\n /**\n * @dev Returns the owner of the `tokenId` token.\n *\n * Requirements:\n *\n * - `tokenId` must exist.\n */\n function ownerOf(uint256 tokenId) external view returns (address owner);\n\n /**\n * @dev Safely transfers `tokenId` token from `from` to `to`.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `tokenId` token must exist and be owned by `from`.\n * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon\n * a safe transfer.\n *\n * Emits a {Transfer} event.\n */\n function safeTransferFrom(address from, address to, uint256 tokenId, bytes calldata data) external;\n\n /**\n * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients\n * are aware of the ERC-721 protocol to prevent tokens from being forever locked.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `tokenId` token must exist and be owned by `from`.\n * - If the caller is not `from`, it must have been allowed to move this token by either {approve} or\n * {setApprovalForAll}.\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon\n * a safe transfer.\n *\n * Emits a {Transfer} event.\n */\n function safeTransferFrom(address from, address to, uint256 tokenId) external;\n\n /**\n * @dev Transfers `tokenId` token from `from` to `to`.\n *\n * WARNING: Note that the caller is responsible to confirm that the recipient is capable of receiving ERC-721\n * or else they may be permanently lost. Usage of {safeTransferFrom} prevents loss, though the caller must\n * understand this adds an external call which potentially creates a reentrancy vulnerability.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `tokenId` token must be owned by `from`.\n * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(address from, address to, uint256 tokenId) external;\n\n /**\n * @dev Gives permission to `to` to transfer `tokenId` token to another account.\n * The approval is cleared when the token is transferred.\n *\n * Only a single account can be approved at a time, so approving the zero address clears previous approvals.\n *\n * Requirements:\n *\n * - The caller must own the token or be an approved operator.\n * - `tokenId` must exist.\n *\n * Emits an {Approval} event.\n */\n function approve(address to, uint256 tokenId) external;\n\n /**\n * @dev Approve or remove `operator` as an operator for the caller.\n * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.\n *\n * Requirements:\n *\n * - The `operator` cannot be the address zero.\n *\n * Emits an {ApprovalForAll} event.\n */\n function setApprovalForAll(address operator, bool approved) external;\n\n /**\n * @dev Returns the account approved for `tokenId` token.\n *\n * Requirements:\n *\n * - `tokenId` must exist.\n */\n function getApproved(uint256 tokenId) external view returns (address operator);\n\n /**\n * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.\n *\n * See {setApprovalForAll}\n */\n function isApprovedForAll(address owner, address operator) external view returns (bool);\n}\n" + }, + "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC721/IERC721Receiver.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @title ERC-721 token receiver interface\n * @dev Interface for any contract that wants to support safeTransfers\n * from ERC-721 asset contracts.\n */\ninterface IERC721Receiver {\n /**\n * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom}\n * by `operator` from `from`, this function is called.\n *\n * It must return its Solidity selector to confirm the token transfer.\n * If any other value is returned or the interface is not implemented by the recipient, the transfer will be\n * reverted.\n *\n * The selector can be obtained in Solidity with `IERC721Receiver.onERC721Received.selector`.\n */\n function onERC721Received(\n address operator,\n address from,\n uint256 tokenId,\n bytes calldata data\n ) external returns (bytes4);\n}\n" + }, + "@openzeppelin/contracts/token/ERC721/utils/ERC721Utils.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC721/utils/ERC721Utils.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC721Receiver} from \"../IERC721Receiver.sol\";\nimport {IERC721Errors} from \"../../../interfaces/draft-IERC6093.sol\";\n\n/**\n * @dev Library that provide common ERC-721 utility functions.\n *\n * See https://eips.ethereum.org/EIPS/eip-721[ERC-721].\n *\n * _Available since v5.1._\n */\nlibrary ERC721Utils {\n /**\n * @dev Performs an acceptance check for the provided `operator` by calling {IERC721-onERC721Received}\n * on the `to` address. The `operator` is generally the address that initiated the token transfer (i.e. `msg.sender`).\n *\n * The acceptance call is not executed and treated as a no-op if the target address doesn't contain code (i.e. an EOA).\n * Otherwise, the recipient must implement {IERC721Receiver-onERC721Received} and return the acceptance magic value to accept\n * the transfer.\n */\n function checkOnERC721Received(\n address operator,\n address from,\n address to,\n uint256 tokenId,\n bytes memory data\n ) internal {\n if (to.code.length > 0) {\n try IERC721Receiver(to).onERC721Received(operator, from, tokenId, data) returns (bytes4 retval) {\n if (retval != IERC721Receiver.onERC721Received.selector) {\n // Token rejected\n revert IERC721Errors.ERC721InvalidReceiver(to);\n }\n } catch (bytes memory reason) {\n if (reason.length == 0) {\n // non-IERC721Receiver implementer\n revert IERC721Errors.ERC721InvalidReceiver(to);\n } else {\n assembly (\"memory-safe\") {\n revert(add(32, reason), mload(reason))\n }\n }\n }\n }\n }\n}\n" + }, + "@openzeppelin/contracts/utils/Context.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract Context {\n function _msgSender() internal view virtual returns (address) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual returns (bytes calldata) {\n return msg.data;\n }\n\n function _contextSuffixLength() internal view virtual returns (uint256) {\n return 0;\n }\n}\n" + }, + "@openzeppelin/contracts/utils/cryptography/ECDSA.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/cryptography/ECDSA.sol)\n\npragma solidity ^0.8.20;\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 }\n\n /**\n * @dev The signature derives the `address(0)`.\n */\n error ECDSAInvalidSignature();\n\n /**\n * @dev The signature has an invalid length.\n */\n error ECDSAInvalidSignatureLength(uint256 length);\n\n /**\n * @dev The signature has an S value that is in the upper half order.\n */\n error ECDSAInvalidSignatureS(bytes32 s);\n\n /**\n * @dev Returns the address that signed a hashed message (`hash`) with `signature` or an error. This will not\n * return address(0) without also returning an error description. Errors are documented using an enum (error type)\n * and a bytes32 providing additional information about the error.\n *\n * If no error is returned, then the address can be used for verification purposes.\n *\n * The `ecrecover` EVM precompile 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 {MessageHashUtils-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 function tryRecover(\n bytes32 hash,\n bytes memory signature\n ) internal pure returns (address recovered, RecoverError err, bytes32 errArg) {\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 assembly (\"memory-safe\") {\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, bytes32(signature.length));\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 precompile 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 {MessageHashUtils-toEthSignedMessageHash} on it.\n */\n function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {\n (address recovered, RecoverError error, bytes32 errorArg) = tryRecover(hash, signature);\n _throwError(error, errorArg);\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[ERC-2098 short signatures]\n */\n function tryRecover(\n bytes32 hash,\n bytes32 r,\n bytes32 vs\n ) internal pure returns (address recovered, RecoverError err, bytes32 errArg) {\n unchecked {\n bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff);\n // We do not check for an overflow here since the shift operation results in 0 or 1.\n uint8 v = uint8((uint256(vs) >> 255) + 27);\n return tryRecover(hash, v, r, s);\n }\n }\n\n /**\n * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately.\n */\n function recover(bytes32 hash, bytes32 r, bytes32 vs) internal pure returns (address) {\n (address recovered, RecoverError error, bytes32 errorArg) = tryRecover(hash, r, vs);\n _throwError(error, errorArg);\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 function tryRecover(\n bytes32 hash,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) internal pure returns (address recovered, RecoverError err, bytes32 errArg) {\n // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature\n // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines\n // the valid range for s in (301): 0 < s < secp256k1n ÷ 2 + 1, and for v in (302): v ∈ {27, 28}. Most\n // signatures from current libraries generate a unique signature with an s-value in the lower half order.\n //\n // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value\n // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or\n // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept\n // these malleable signatures as well.\n if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) {\n return (address(0), RecoverError.InvalidSignatureS, s);\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, bytes32(0));\n }\n\n return (signer, RecoverError.NoError, bytes32(0));\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, bytes32 errorArg) = tryRecover(hash, v, r, s);\n _throwError(error, errorArg);\n return recovered;\n }\n\n /**\n * @dev Optionally reverts with the corresponding custom error according to the `error` argument provided.\n */\n function _throwError(RecoverError error, bytes32 errorArg) private pure {\n if (error == RecoverError.NoError) {\n return; // no error: do nothing\n } else if (error == RecoverError.InvalidSignature) {\n revert ECDSAInvalidSignature();\n } else if (error == RecoverError.InvalidSignatureLength) {\n revert ECDSAInvalidSignatureLength(uint256(errorArg));\n } else if (error == RecoverError.InvalidSignatureS) {\n revert ECDSAInvalidSignatureS(errorArg);\n }\n }\n}\n" + }, + "@openzeppelin/contracts/utils/cryptography/EIP712.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/cryptography/EIP712.sol)\n\npragma solidity ^0.8.20;\n\nimport {MessageHashUtils} from \"./MessageHashUtils.sol\";\nimport {ShortStrings, ShortString} from \"../ShortStrings.sol\";\nimport {IERC5267} from \"../../interfaces/IERC5267.sol\";\n\n/**\n * @dev https://eips.ethereum.org/EIPS/eip-712[EIP-712] is a standard for hashing and signing of typed structured data.\n *\n * The encoding scheme specified in the EIP requires a domain separator and a hash of the typed structured data, whose\n * encoding is very generic and therefore its implementation in Solidity is not feasible, thus this contract\n * does not implement the encoding itself. Protocols need to implement the type-specific encoding they need in order to\n * produce the hash of their typed data using a combination of `abi.encode` and `keccak256`.\n *\n * This contract implements the EIP-712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding\n * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA\n * ({_hashTypedDataV4}).\n *\n * The implementation of the domain separator was designed to be as efficient as possible while still properly updating\n * the chain id to protect against replay attacks on an eventual fork of the chain.\n *\n * NOTE: This contract implements the version of the encoding known as \"v4\", as implemented by the JSON RPC method\n * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask].\n *\n * NOTE: In the upgradeable version of this contract, the cached values will correspond to the address, and the domain\n * separator of the implementation contract. This will cause the {_domainSeparatorV4} function to always rebuild the\n * separator from the immutable values, which is cheaper than accessing a cached version in cold storage.\n *\n * @custom:oz-upgrades-unsafe-allow state-variable-immutable\n */\nabstract contract EIP712 is IERC5267 {\n using ShortStrings for *;\n\n bytes32 private constant TYPE_HASH =\n keccak256(\"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)\");\n\n // Cache the domain separator as an immutable value, but also store the chain id that it corresponds to, in order to\n // invalidate the cached domain separator if the chain id changes.\n bytes32 private immutable _cachedDomainSeparator;\n uint256 private immutable _cachedChainId;\n address private immutable _cachedThis;\n\n bytes32 private immutable _hashedName;\n bytes32 private immutable _hashedVersion;\n\n ShortString private immutable _name;\n ShortString private immutable _version;\n string private _nameFallback;\n string private _versionFallback;\n\n /**\n * @dev Initializes the domain separator and parameter caches.\n *\n * The meaning of `name` and `version` is specified in\n * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP-712]:\n *\n * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol.\n * - `version`: the current major version of the signing domain.\n *\n * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart\n * contract upgrade].\n */\n constructor(string memory name, string memory version) {\n _name = name.toShortStringWithFallback(_nameFallback);\n _version = version.toShortStringWithFallback(_versionFallback);\n _hashedName = keccak256(bytes(name));\n _hashedVersion = keccak256(bytes(version));\n\n _cachedChainId = block.chainid;\n _cachedDomainSeparator = _buildDomainSeparator();\n _cachedThis = address(this);\n }\n\n /**\n * @dev Returns the domain separator for the current chain.\n */\n function _domainSeparatorV4() internal view returns (bytes32) {\n if (address(this) == _cachedThis && block.chainid == _cachedChainId) {\n return _cachedDomainSeparator;\n } else {\n return _buildDomainSeparator();\n }\n }\n\n function _buildDomainSeparator() private view returns (bytes32) {\n return keccak256(abi.encode(TYPE_HASH, _hashedName, _hashedVersion, block.chainid, address(this)));\n }\n\n /**\n * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this\n * function returns the hash of the fully encoded EIP712 message for this domain.\n *\n * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example:\n *\n * ```solidity\n * bytes32 digest = _hashTypedDataV4(keccak256(abi.encode(\n * keccak256(\"Mail(address to,string contents)\"),\n * mailTo,\n * keccak256(bytes(mailContents))\n * )));\n * address signer = ECDSA.recover(digest, signature);\n * ```\n */\n function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) {\n return MessageHashUtils.toTypedDataHash(_domainSeparatorV4(), structHash);\n }\n\n /**\n * @dev See {IERC-5267}.\n */\n function eip712Domain()\n public\n view\n virtual\n returns (\n bytes1 fields,\n string memory name,\n string memory version,\n uint256 chainId,\n address verifyingContract,\n bytes32 salt,\n uint256[] memory extensions\n )\n {\n return (\n hex\"0f\", // 01111\n _EIP712Name(),\n _EIP712Version(),\n block.chainid,\n address(this),\n bytes32(0),\n new uint256[](0)\n );\n }\n\n /**\n * @dev The name parameter for the EIP712 domain.\n *\n * NOTE: By default this function reads _name which is an immutable value.\n * It only reads from storage if necessary (in case the value is too large to fit in a ShortString).\n */\n // solhint-disable-next-line func-name-mixedcase\n function _EIP712Name() internal view returns (string memory) {\n return _name.toStringWithFallback(_nameFallback);\n }\n\n /**\n * @dev The version parameter for the EIP712 domain.\n *\n * NOTE: By default this function reads _version which is an immutable value.\n * It only reads from storage if necessary (in case the value is too large to fit in a ShortString).\n */\n // solhint-disable-next-line func-name-mixedcase\n function _EIP712Version() internal view returns (string memory) {\n return _version.toStringWithFallback(_versionFallback);\n }\n}\n" + }, + "@openzeppelin/contracts/utils/cryptography/MessageHashUtils.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/cryptography/MessageHashUtils.sol)\n\npragma solidity ^0.8.20;\n\nimport {Strings} from \"../Strings.sol\";\n\n/**\n * @dev Signature message hash utilities for producing digests to be consumed by {ECDSA} recovery or signing.\n *\n * The library provides methods for generating a hash of a message that conforms to the\n * https://eips.ethereum.org/EIPS/eip-191[ERC-191] and https://eips.ethereum.org/EIPS/eip-712[EIP 712]\n * specifications.\n */\nlibrary MessageHashUtils {\n /**\n * @dev Returns the keccak256 digest of an ERC-191 signed data with version\n * `0x45` (`personal_sign` messages).\n *\n * The digest is calculated by prefixing a bytes32 `messageHash` with\n * `\"\\x19Ethereum Signed Message:\\n32\"` and hashing the result. It corresponds with the\n * hash signed when using the https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] JSON-RPC method.\n *\n * NOTE: The `messageHash` parameter is intended to be the result of hashing a raw message with\n * keccak256, although any bytes32 value can be safely used because the final digest will\n * be re-hashed.\n *\n * See {ECDSA-recover}.\n */\n function toEthSignedMessageHash(bytes32 messageHash) internal pure returns (bytes32 digest) {\n assembly (\"memory-safe\") {\n mstore(0x00, \"\\x19Ethereum Signed Message:\\n32\") // 32 is the bytes-length of messageHash\n mstore(0x1c, messageHash) // 0x1c (28) is the length of the prefix\n digest := keccak256(0x00, 0x3c) // 0x3c is the length of the prefix (0x1c) + messageHash (0x20)\n }\n }\n\n /**\n * @dev Returns the keccak256 digest of an ERC-191 signed data with version\n * `0x45` (`personal_sign` messages).\n *\n * The digest is calculated by prefixing an arbitrary `message` with\n * `\"\\x19Ethereum Signed Message:\\n\" + len(message)` and hashing the result. It corresponds with the\n * hash signed when using the https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] JSON-RPC method.\n *\n * See {ECDSA-recover}.\n */\n function toEthSignedMessageHash(bytes memory message) internal pure returns (bytes32) {\n return\n keccak256(bytes.concat(\"\\x19Ethereum Signed Message:\\n\", bytes(Strings.toString(message.length)), message));\n }\n\n /**\n * @dev Returns the keccak256 digest of an ERC-191 signed data with version\n * `0x00` (data with intended validator).\n *\n * The digest is calculated by prefixing an arbitrary `data` with `\"\\x19\\x00\"` and the intended\n * `validator` address. Then hashing the result.\n *\n * See {ECDSA-recover}.\n */\n function toDataWithIntendedValidatorHash(address validator, bytes memory data) internal pure returns (bytes32) {\n return keccak256(abi.encodePacked(hex\"19_00\", validator, data));\n }\n\n /**\n * @dev Returns the keccak256 digest of an EIP-712 typed data (ERC-191 version `0x01`).\n *\n * The digest is calculated from a `domainSeparator` and a `structHash`, by prefixing them with\n * `\\x19\\x01` and hashing the result. It corresponds to the hash signed by the\n * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`] JSON-RPC method as part of EIP-712.\n *\n * See {ECDSA-recover}.\n */\n function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32 digest) {\n assembly (\"memory-safe\") {\n let ptr := mload(0x40)\n mstore(ptr, hex\"19_01\")\n mstore(add(ptr, 0x02), domainSeparator)\n mstore(add(ptr, 0x22), structHash)\n digest := keccak256(ptr, 0x42)\n }\n }\n}\n" + }, + "@openzeppelin/contracts/utils/introspection/ERC165.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/introspection/ERC165.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC165} from \"./IERC165.sol\";\n\n/**\n * @dev Implementation of the {IERC165} interface.\n *\n * Contracts that want to implement ERC-165 should inherit from this contract and override {supportsInterface} to check\n * for the additional interface id that will be supported. For example:\n *\n * ```solidity\n * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);\n * }\n * ```\n */\nabstract contract ERC165 is IERC165 {\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) {\n return interfaceId == type(IERC165).interfaceId;\n }\n}\n" + }, + "@openzeppelin/contracts/utils/introspection/IERC165.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/introspection/IERC165.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Interface of the ERC-165 standard, as defined in the\n * https://eips.ethereum.org/EIPS/eip-165[ERC].\n *\n * Implementers can declare support of contract interfaces, which can then be\n * queried by others ({ERC165Checker}).\n *\n * For an implementation, see {ERC165}.\n */\ninterface IERC165 {\n /**\n * @dev Returns true if this contract implements the interface defined by\n * `interfaceId`. See the corresponding\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[ERC section]\n * to learn more about how these ids are created.\n *\n * This function call must use less than 30 000 gas.\n */\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\n}\n" + }, + "@openzeppelin/contracts/utils/math/Math.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/math/Math.sol)\n\npragma solidity ^0.8.20;\n\nimport {Panic} from \"../Panic.sol\";\nimport {SafeCast} from \"./SafeCast.sol\";\n\n/**\n * @dev Standard math utilities missing in the Solidity language.\n */\nlibrary Math {\n enum Rounding {\n Floor, // Toward negative infinity\n Ceil, // Toward positive infinity\n Trunc, // Toward zero\n Expand // Away from zero\n }\n\n /**\n * @dev Returns the addition of two unsigned integers, with an success flag (no overflow).\n */\n function tryAdd(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\n unchecked {\n uint256 c = a + b;\n if (c < a) return (false, 0);\n return (true, c);\n }\n }\n\n /**\n * @dev Returns the subtraction of two unsigned integers, with an success flag (no overflow).\n */\n function trySub(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\n unchecked {\n if (b > a) return (false, 0);\n return (true, a - b);\n }\n }\n\n /**\n * @dev Returns the multiplication of two unsigned integers, with an success flag (no overflow).\n */\n function tryMul(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\n unchecked {\n // Gas optimization: this is cheaper than requiring 'a' not being zero, but the\n // benefit is lost if 'b' is also tested.\n // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522\n if (a == 0) return (true, 0);\n uint256 c = a * b;\n if (c / a != b) return (false, 0);\n return (true, c);\n }\n }\n\n /**\n * @dev Returns the division of two unsigned integers, with a success flag (no division by zero).\n */\n function tryDiv(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\n unchecked {\n if (b == 0) return (false, 0);\n return (true, a / b);\n }\n }\n\n /**\n * @dev Returns the remainder of dividing two unsigned integers, with a success flag (no division by zero).\n */\n function tryMod(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\n unchecked {\n if (b == 0) return (false, 0);\n return (true, a % b);\n }\n }\n\n /**\n * @dev Branchless ternary evaluation for `a ? b : c`. Gas costs are constant.\n *\n * IMPORTANT: This function may reduce bytecode size and consume less gas when used standalone.\n * However, the compiler may optimize Solidity ternary operations (i.e. `a ? b : c`) to only compute\n * one branch when needed, making this function more expensive.\n */\n function ternary(bool condition, uint256 a, uint256 b) internal pure returns (uint256) {\n unchecked {\n // branchless ternary works because:\n // b ^ (a ^ b) == a\n // b ^ 0 == b\n return b ^ ((a ^ b) * SafeCast.toUint(condition));\n }\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 ternary(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 ternary(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 towards infinity instead\n * of rounding towards zero.\n */\n function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {\n if (b == 0) {\n // Guarantee the same behavior as in a regular Solidity division.\n Panic.panic(Panic.DIVISION_BY_ZERO);\n }\n\n // The following calculation ensures accurate ceiling division without overflow.\n // Since a is non-zero, (a - 1) / b will not overflow.\n // The largest possible result occurs when (a - 1) / b is type(uint256).max,\n // but the largest value we can obtain is type(uint256).max - 1, which happens\n // when a = type(uint256).max and b = 1.\n unchecked {\n return SafeCast.toUint(a > 0) * ((a - 1) / b + 1);\n }\n }\n\n /**\n * @dev Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or\n * denominator == 0.\n *\n * Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv) with further edits by\n * 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²⁵⁶ and mod 2²⁵⁶ - 1, then use\n // the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256\n // variables such that product = prod1 * 2²⁵⁶ + prod0.\n uint256 prod0 = x * y; // 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 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²⁵⁶. Also prevents denominator == 0.\n if (denominator <= prod1) {\n Panic.panic(ternary(denominator == 0, Panic.DIVISION_BY_ZERO, Panic.UNDER_OVERFLOW));\n }\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.\n // Always >= 1. See https://cs.stackexchange.com/q/138556/92363.\n\n uint256 twos = denominator & (0 - denominator);\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²⁵⁶ / 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²⁵⁶. Now that denominator is an odd number, it has an inverse modulo 2²⁵⁶ such\n // that denominator * inv ≡ 1 mod 2²⁵⁶. Compute the inverse by starting with a seed that is correct for\n // four bits. That is, denominator * inv ≡ 1 mod 2⁴.\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\n // works in modular arithmetic, doubling the correct bits in each step.\n inverse *= 2 - denominator * inverse; // inverse mod 2⁸\n inverse *= 2 - denominator * inverse; // inverse mod 2¹⁶\n inverse *= 2 - denominator * inverse; // inverse mod 2³²\n inverse *= 2 - denominator * inverse; // inverse mod 2⁶⁴\n inverse *= 2 - denominator * inverse; // inverse mod 2¹²⁸\n inverse *= 2 - denominator * inverse; // inverse mod 2²⁵⁶\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²⁵⁶. Since the preconditions guarantee that the outcome is\n // less than 2²⁵⁶, 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 * @dev 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 return mulDiv(x, y, denominator) + SafeCast.toUint(unsignedRoundsUp(rounding) && mulmod(x, y, denominator) > 0);\n }\n\n /**\n * @dev Calculate the modular multiplicative inverse of a number in Z/nZ.\n *\n * If n is a prime, then Z/nZ is a field. In that case all elements are inversible, except 0.\n * If n is not a prime, then Z/nZ is not a field, and some elements might not be inversible.\n *\n * If the input value is not inversible, 0 is returned.\n *\n * NOTE: If you know for sure that n is (big) a prime, it may be cheaper to use Fermat's little theorem and get the\n * inverse using `Math.modExp(a, n - 2, n)`. See {invModPrime}.\n */\n function invMod(uint256 a, uint256 n) internal pure returns (uint256) {\n unchecked {\n if (n == 0) return 0;\n\n // The inverse modulo is calculated using the Extended Euclidean Algorithm (iterative version)\n // Used to compute integers x and y such that: ax + ny = gcd(a, n).\n // When the gcd is 1, then the inverse of a modulo n exists and it's x.\n // ax + ny = 1\n // ax = 1 + (-y)n\n // ax ≡ 1 (mod n) # x is the inverse of a modulo n\n\n // If the remainder is 0 the gcd is n right away.\n uint256 remainder = a % n;\n uint256 gcd = n;\n\n // Therefore the initial coefficients are:\n // ax + ny = gcd(a, n) = n\n // 0a + 1n = n\n int256 x = 0;\n int256 y = 1;\n\n while (remainder != 0) {\n uint256 quotient = gcd / remainder;\n\n (gcd, remainder) = (\n // The old remainder is the next gcd to try.\n remainder,\n // Compute the next remainder.\n // Can't overflow given that (a % gcd) * (gcd // (a % gcd)) <= gcd\n // where gcd is at most n (capped to type(uint256).max)\n gcd - remainder * quotient\n );\n\n (x, y) = (\n // Increment the coefficient of a.\n y,\n // Decrement the coefficient of n.\n // Can overflow, but the result is casted to uint256 so that the\n // next value of y is \"wrapped around\" to a value between 0 and n - 1.\n x - y * int256(quotient)\n );\n }\n\n if (gcd != 1) return 0; // No inverse exists.\n return ternary(x < 0, n - uint256(-x), uint256(x)); // Wrap the result if it's negative.\n }\n }\n\n /**\n * @dev Variant of {invMod}. More efficient, but only works if `p` is known to be a prime greater than `2`.\n *\n * From https://en.wikipedia.org/wiki/Fermat%27s_little_theorem[Fermat's little theorem], we know that if p is\n * prime, then `a**(p-1) ≡ 1 mod p`. As a consequence, we have `a * a**(p-2) ≡ 1 mod p`, which means that\n * `a**(p-2)` is the modular multiplicative inverse of a in Fp.\n *\n * NOTE: this function does NOT check that `p` is a prime greater than `2`.\n */\n function invModPrime(uint256 a, uint256 p) internal view returns (uint256) {\n unchecked {\n return Math.modExp(a, p - 2, p);\n }\n }\n\n /**\n * @dev Returns the modular exponentiation of the specified base, exponent and modulus (b ** e % m)\n *\n * Requirements:\n * - modulus can't be zero\n * - underlying staticcall to precompile must succeed\n *\n * IMPORTANT: The result is only valid if the underlying call succeeds. When using this function, make\n * sure the chain you're using it on supports the precompiled contract for modular exponentiation\n * at address 0x05 as specified in https://eips.ethereum.org/EIPS/eip-198[EIP-198]. Otherwise,\n * the underlying function will succeed given the lack of a revert, but the result may be incorrectly\n * interpreted as 0.\n */\n function modExp(uint256 b, uint256 e, uint256 m) internal view returns (uint256) {\n (bool success, uint256 result) = tryModExp(b, e, m);\n if (!success) {\n Panic.panic(Panic.DIVISION_BY_ZERO);\n }\n return result;\n }\n\n /**\n * @dev Returns the modular exponentiation of the specified base, exponent and modulus (b ** e % m).\n * It includes a success flag indicating if the operation succeeded. Operation will be marked as failed if trying\n * to operate modulo 0 or if the underlying precompile reverted.\n *\n * IMPORTANT: The result is only valid if the success flag is true. When using this function, make sure the chain\n * you're using it on supports the precompiled contract for modular exponentiation at address 0x05 as specified in\n * https://eips.ethereum.org/EIPS/eip-198[EIP-198]. Otherwise, the underlying function will succeed given the lack\n * of a revert, but the result may be incorrectly interpreted as 0.\n */\n function tryModExp(uint256 b, uint256 e, uint256 m) internal view returns (bool success, uint256 result) {\n if (m == 0) return (false, 0);\n assembly (\"memory-safe\") {\n let ptr := mload(0x40)\n // | Offset | Content | Content (Hex) |\n // |-----------|------------|--------------------------------------------------------------------|\n // | 0x00:0x1f | size of b | 0x0000000000000000000000000000000000000000000000000000000000000020 |\n // | 0x20:0x3f | size of e | 0x0000000000000000000000000000000000000000000000000000000000000020 |\n // | 0x40:0x5f | size of m | 0x0000000000000000000000000000000000000000000000000000000000000020 |\n // | 0x60:0x7f | value of b | 0x<.............................................................b> |\n // | 0x80:0x9f | value of e | 0x<.............................................................e> |\n // | 0xa0:0xbf | value of m | 0x<.............................................................m> |\n mstore(ptr, 0x20)\n mstore(add(ptr, 0x20), 0x20)\n mstore(add(ptr, 0x40), 0x20)\n mstore(add(ptr, 0x60), b)\n mstore(add(ptr, 0x80), e)\n mstore(add(ptr, 0xa0), m)\n\n // Given the result < m, it's guaranteed to fit in 32 bytes,\n // so we can use the memory scratch space located at offset 0.\n success := staticcall(gas(), 0x05, ptr, 0xc0, 0x00, 0x20)\n result := mload(0x00)\n }\n }\n\n /**\n * @dev Variant of {modExp} that supports inputs of arbitrary length.\n */\n function modExp(bytes memory b, bytes memory e, bytes memory m) internal view returns (bytes memory) {\n (bool success, bytes memory result) = tryModExp(b, e, m);\n if (!success) {\n Panic.panic(Panic.DIVISION_BY_ZERO);\n }\n return result;\n }\n\n /**\n * @dev Variant of {tryModExp} that supports inputs of arbitrary length.\n */\n function tryModExp(\n bytes memory b,\n bytes memory e,\n bytes memory m\n ) internal view returns (bool success, bytes memory result) {\n if (_zeroBytes(m)) return (false, new bytes(0));\n\n uint256 mLen = m.length;\n\n // Encode call args in result and move the free memory pointer\n result = abi.encodePacked(b.length, e.length, mLen, b, e, m);\n\n assembly (\"memory-safe\") {\n let dataPtr := add(result, 0x20)\n // Write result on top of args to avoid allocating extra memory.\n success := staticcall(gas(), 0x05, dataPtr, mload(result), dataPtr, mLen)\n // Overwrite the length.\n // result.length > returndatasize() is guaranteed because returndatasize() == m.length\n mstore(result, mLen)\n // Set the memory pointer after the returned data.\n mstore(0x40, add(dataPtr, mLen))\n }\n }\n\n /**\n * @dev Returns whether the provided byte array is zero.\n */\n function _zeroBytes(bytes memory byteArray) private pure returns (bool) {\n for (uint256 i = 0; i < byteArray.length; ++i) {\n if (byteArray[i] != 0) {\n return false;\n }\n }\n return true;\n }\n\n /**\n * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded\n * towards zero.\n *\n * This method is based on Newton's method for computing square roots; the algorithm is restricted to only\n * using integer operations.\n */\n function sqrt(uint256 a) internal pure returns (uint256) {\n unchecked {\n // Take care of easy edge cases when a == 0 or a == 1\n if (a <= 1) {\n return a;\n }\n\n // In this function, we use Newton's method to get a root of `f(x) := x² - a`. It involves building a\n // sequence x_n that converges toward sqrt(a). For each iteration x_n, we also define the error between\n // the current value as `ε_n = | x_n - sqrt(a) |`.\n //\n // For our first estimation, we consider `e` the smallest power of 2 which is bigger than the square root\n // of the target. (i.e. `2**(e-1) ≤ sqrt(a) < 2**e`). We know that `e ≤ 128` because `(2¹²⁸)² = 2²⁵⁶` is\n // bigger than any uint256.\n //\n // By noticing that\n // `2**(e-1) ≤ sqrt(a) < 2**e → (2**(e-1))² ≤ a < (2**e)² → 2**(2*e-2) ≤ a < 2**(2*e)`\n // we can deduce that `e - 1` is `log2(a) / 2`. We can thus compute `x_n = 2**(e-1)` using a method similar\n // to the msb function.\n uint256 aa = a;\n uint256 xn = 1;\n\n if (aa >= (1 << 128)) {\n aa >>= 128;\n xn <<= 64;\n }\n if (aa >= (1 << 64)) {\n aa >>= 64;\n xn <<= 32;\n }\n if (aa >= (1 << 32)) {\n aa >>= 32;\n xn <<= 16;\n }\n if (aa >= (1 << 16)) {\n aa >>= 16;\n xn <<= 8;\n }\n if (aa >= (1 << 8)) {\n aa >>= 8;\n xn <<= 4;\n }\n if (aa >= (1 << 4)) {\n aa >>= 4;\n xn <<= 2;\n }\n if (aa >= (1 << 2)) {\n xn <<= 1;\n }\n\n // We now have x_n such that `x_n = 2**(e-1) ≤ sqrt(a) < 2**e = 2 * x_n`. This implies ε_n ≤ 2**(e-1).\n //\n // We can refine our estimation by noticing that the middle of that interval minimizes the error.\n // If we move x_n to equal 2**(e-1) + 2**(e-2), then we reduce the error to ε_n ≤ 2**(e-2).\n // This is going to be our x_0 (and ε_0)\n xn = (3 * xn) >> 1; // ε_0 := | x_0 - sqrt(a) | ≤ 2**(e-2)\n\n // From here, Newton's method give us:\n // x_{n+1} = (x_n + a / x_n) / 2\n //\n // One should note that:\n // x_{n+1}² - a = ((x_n + a / x_n) / 2)² - a\n // = ((x_n² + a) / (2 * x_n))² - a\n // = (x_n⁴ + 2 * a * x_n² + a²) / (4 * x_n²) - a\n // = (x_n⁴ + 2 * a * x_n² + a² - 4 * a * x_n²) / (4 * x_n²)\n // = (x_n⁴ - 2 * a * x_n² + a²) / (4 * x_n²)\n // = (x_n² - a)² / (2 * x_n)²\n // = ((x_n² - a) / (2 * x_n))²\n // ≥ 0\n // Which proves that for all n ≥ 1, sqrt(a) ≤ x_n\n //\n // This gives us the proof of quadratic convergence of the sequence:\n // ε_{n+1} = | x_{n+1} - sqrt(a) |\n // = | (x_n + a / x_n) / 2 - sqrt(a) |\n // = | (x_n² + a - 2*x_n*sqrt(a)) / (2 * x_n) |\n // = | (x_n - sqrt(a))² / (2 * x_n) |\n // = | ε_n² / (2 * x_n) |\n // = ε_n² / | (2 * x_n) |\n //\n // For the first iteration, we have a special case where x_0 is known:\n // ε_1 = ε_0² / | (2 * x_0) |\n // ≤ (2**(e-2))² / (2 * (2**(e-1) + 2**(e-2)))\n // ≤ 2**(2*e-4) / (3 * 2**(e-1))\n // ≤ 2**(e-3) / 3\n // ≤ 2**(e-3-log2(3))\n // ≤ 2**(e-4.5)\n //\n // For the following iterations, we use the fact that, 2**(e-1) ≤ sqrt(a) ≤ x_n:\n // ε_{n+1} = ε_n² / | (2 * x_n) |\n // ≤ (2**(e-k))² / (2 * 2**(e-1))\n // ≤ 2**(2*e-2*k) / 2**e\n // ≤ 2**(e-2*k)\n xn = (xn + a / xn) >> 1; // ε_1 := | x_1 - sqrt(a) | ≤ 2**(e-4.5) -- special case, see above\n xn = (xn + a / xn) >> 1; // ε_2 := | x_2 - sqrt(a) | ≤ 2**(e-9) -- general case with k = 4.5\n xn = (xn + a / xn) >> 1; // ε_3 := | x_3 - sqrt(a) | ≤ 2**(e-18) -- general case with k = 9\n xn = (xn + a / xn) >> 1; // ε_4 := | x_4 - sqrt(a) | ≤ 2**(e-36) -- general case with k = 18\n xn = (xn + a / xn) >> 1; // ε_5 := | x_5 - sqrt(a) | ≤ 2**(e-72) -- general case with k = 36\n xn = (xn + a / xn) >> 1; // ε_6 := | x_6 - sqrt(a) | ≤ 2**(e-144) -- general case with k = 72\n\n // Because e ≤ 128 (as discussed during the first estimation phase), we know have reached a precision\n // ε_6 ≤ 2**(e-144) < 1. Given we're operating on integers, then we can ensure that xn is now either\n // sqrt(a) or sqrt(a) + 1.\n return xn - SafeCast.toUint(xn > a / xn);\n }\n }\n\n /**\n * @dev 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 + SafeCast.toUint(unsignedRoundsUp(rounding) && result * result < a);\n }\n }\n\n /**\n * @dev Return the log in base 2 of a positive value rounded towards zero.\n * Returns 0 if given 0.\n */\n function log2(uint256 value) internal pure returns (uint256) {\n uint256 result = 0;\n uint256 exp;\n unchecked {\n exp = 128 * SafeCast.toUint(value > (1 << 128) - 1);\n value >>= exp;\n result += exp;\n\n exp = 64 * SafeCast.toUint(value > (1 << 64) - 1);\n value >>= exp;\n result += exp;\n\n exp = 32 * SafeCast.toUint(value > (1 << 32) - 1);\n value >>= exp;\n result += exp;\n\n exp = 16 * SafeCast.toUint(value > (1 << 16) - 1);\n value >>= exp;\n result += exp;\n\n exp = 8 * SafeCast.toUint(value > (1 << 8) - 1);\n value >>= exp;\n result += exp;\n\n exp = 4 * SafeCast.toUint(value > (1 << 4) - 1);\n value >>= exp;\n result += exp;\n\n exp = 2 * SafeCast.toUint(value > (1 << 2) - 1);\n value >>= exp;\n result += exp;\n\n result += SafeCast.toUint(value > 1);\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 + SafeCast.toUint(unsignedRoundsUp(rounding) && 1 << result < value);\n }\n }\n\n /**\n * @dev Return the log in base 10 of a positive value rounded towards zero.\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 + SafeCast.toUint(unsignedRoundsUp(rounding) && 10 ** result < value);\n }\n }\n\n /**\n * @dev Return the log in base 256 of a positive value rounded towards zero.\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 uint256 isGt;\n unchecked {\n isGt = SafeCast.toUint(value > (1 << 128) - 1);\n value >>= isGt * 128;\n result += isGt * 16;\n\n isGt = SafeCast.toUint(value > (1 << 64) - 1);\n value >>= isGt * 64;\n result += isGt * 8;\n\n isGt = SafeCast.toUint(value > (1 << 32) - 1);\n value >>= isGt * 32;\n result += isGt * 4;\n\n isGt = SafeCast.toUint(value > (1 << 16) - 1);\n value >>= isGt * 16;\n result += isGt * 2;\n\n result += SafeCast.toUint(value > (1 << 8) - 1);\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 + SafeCast.toUint(unsignedRoundsUp(rounding) && 1 << (result << 3) < value);\n }\n }\n\n /**\n * @dev Returns whether a provided rounding mode is considered rounding up for unsigned integers.\n */\n function unsignedRoundsUp(Rounding rounding) internal pure returns (bool) {\n return uint8(rounding) % 2 == 1;\n }\n}\n" + }, + "@openzeppelin/contracts/utils/math/SafeCast.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/math/SafeCast.sol)\n// This file was procedurally generated from scripts/generate/templates/SafeCast.js.\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Wrappers over Solidity's uintXX/intXX/bool casting operators with added overflow\n * checks.\n *\n * Downcasting from uint256/int256 in Solidity does not revert on overflow. This can\n * easily result in undesired exploitation or bugs, since developers usually\n * assume that overflows raise errors. `SafeCast` restores this intuition by\n * reverting the transaction when such an operation overflows.\n *\n * Using this library instead of the unchecked operations eliminates an entire\n * class of bugs, so it's recommended to use it always.\n */\nlibrary SafeCast {\n /**\n * @dev Value doesn't fit in an uint of `bits` size.\n */\n error SafeCastOverflowedUintDowncast(uint8 bits, uint256 value);\n\n /**\n * @dev An int value doesn't fit in an uint of `bits` size.\n */\n error SafeCastOverflowedIntToUint(int256 value);\n\n /**\n * @dev Value doesn't fit in an int of `bits` size.\n */\n error SafeCastOverflowedIntDowncast(uint8 bits, int256 value);\n\n /**\n * @dev An uint value doesn't fit in an int of `bits` size.\n */\n error SafeCastOverflowedUintToInt(uint256 value);\n\n /**\n * @dev Returns the downcasted uint248 from uint256, reverting on\n * overflow (when the input is greater than largest uint248).\n *\n * Counterpart to Solidity's `uint248` operator.\n *\n * Requirements:\n *\n * - input must fit into 248 bits\n */\n function toUint248(uint256 value) internal pure returns (uint248) {\n if (value > type(uint248).max) {\n revert SafeCastOverflowedUintDowncast(248, value);\n }\n return uint248(value);\n }\n\n /**\n * @dev Returns the downcasted uint240 from uint256, reverting on\n * overflow (when the input is greater than largest uint240).\n *\n * Counterpart to Solidity's `uint240` operator.\n *\n * Requirements:\n *\n * - input must fit into 240 bits\n */\n function toUint240(uint256 value) internal pure returns (uint240) {\n if (value > type(uint240).max) {\n revert SafeCastOverflowedUintDowncast(240, value);\n }\n return uint240(value);\n }\n\n /**\n * @dev Returns the downcasted uint232 from uint256, reverting on\n * overflow (when the input is greater than largest uint232).\n *\n * Counterpart to Solidity's `uint232` operator.\n *\n * Requirements:\n *\n * - input must fit into 232 bits\n */\n function toUint232(uint256 value) internal pure returns (uint232) {\n if (value > type(uint232).max) {\n revert SafeCastOverflowedUintDowncast(232, value);\n }\n return uint232(value);\n }\n\n /**\n * @dev Returns the downcasted uint224 from uint256, reverting on\n * overflow (when the input is greater than largest uint224).\n *\n * Counterpart to Solidity's `uint224` operator.\n *\n * Requirements:\n *\n * - input must fit into 224 bits\n */\n function toUint224(uint256 value) internal pure returns (uint224) {\n if (value > type(uint224).max) {\n revert SafeCastOverflowedUintDowncast(224, value);\n }\n return uint224(value);\n }\n\n /**\n * @dev Returns the downcasted uint216 from uint256, reverting on\n * overflow (when the input is greater than largest uint216).\n *\n * Counterpart to Solidity's `uint216` operator.\n *\n * Requirements:\n *\n * - input must fit into 216 bits\n */\n function toUint216(uint256 value) internal pure returns (uint216) {\n if (value > type(uint216).max) {\n revert SafeCastOverflowedUintDowncast(216, value);\n }\n return uint216(value);\n }\n\n /**\n * @dev Returns the downcasted uint208 from uint256, reverting on\n * overflow (when the input is greater than largest uint208).\n *\n * Counterpart to Solidity's `uint208` operator.\n *\n * Requirements:\n *\n * - input must fit into 208 bits\n */\n function toUint208(uint256 value) internal pure returns (uint208) {\n if (value > type(uint208).max) {\n revert SafeCastOverflowedUintDowncast(208, value);\n }\n return uint208(value);\n }\n\n /**\n * @dev Returns the downcasted uint200 from uint256, reverting on\n * overflow (when the input is greater than largest uint200).\n *\n * Counterpart to Solidity's `uint200` operator.\n *\n * Requirements:\n *\n * - input must fit into 200 bits\n */\n function toUint200(uint256 value) internal pure returns (uint200) {\n if (value > type(uint200).max) {\n revert SafeCastOverflowedUintDowncast(200, value);\n }\n return uint200(value);\n }\n\n /**\n * @dev Returns the downcasted uint192 from uint256, reverting on\n * overflow (when the input is greater than largest uint192).\n *\n * Counterpart to Solidity's `uint192` operator.\n *\n * Requirements:\n *\n * - input must fit into 192 bits\n */\n function toUint192(uint256 value) internal pure returns (uint192) {\n if (value > type(uint192).max) {\n revert SafeCastOverflowedUintDowncast(192, value);\n }\n return uint192(value);\n }\n\n /**\n * @dev Returns the downcasted uint184 from uint256, reverting on\n * overflow (when the input is greater than largest uint184).\n *\n * Counterpart to Solidity's `uint184` operator.\n *\n * Requirements:\n *\n * - input must fit into 184 bits\n */\n function toUint184(uint256 value) internal pure returns (uint184) {\n if (value > type(uint184).max) {\n revert SafeCastOverflowedUintDowncast(184, value);\n }\n return uint184(value);\n }\n\n /**\n * @dev Returns the downcasted uint176 from uint256, reverting on\n * overflow (when the input is greater than largest uint176).\n *\n * Counterpart to Solidity's `uint176` operator.\n *\n * Requirements:\n *\n * - input must fit into 176 bits\n */\n function toUint176(uint256 value) internal pure returns (uint176) {\n if (value > type(uint176).max) {\n revert SafeCastOverflowedUintDowncast(176, value);\n }\n return uint176(value);\n }\n\n /**\n * @dev Returns the downcasted uint168 from uint256, reverting on\n * overflow (when the input is greater than largest uint168).\n *\n * Counterpart to Solidity's `uint168` operator.\n *\n * Requirements:\n *\n * - input must fit into 168 bits\n */\n function toUint168(uint256 value) internal pure returns (uint168) {\n if (value > type(uint168).max) {\n revert SafeCastOverflowedUintDowncast(168, value);\n }\n return uint168(value);\n }\n\n /**\n * @dev Returns the downcasted uint160 from uint256, reverting on\n * overflow (when the input is greater than largest uint160).\n *\n * Counterpart to Solidity's `uint160` operator.\n *\n * Requirements:\n *\n * - input must fit into 160 bits\n */\n function toUint160(uint256 value) internal pure returns (uint160) {\n if (value > type(uint160).max) {\n revert SafeCastOverflowedUintDowncast(160, value);\n }\n return uint160(value);\n }\n\n /**\n * @dev Returns the downcasted uint152 from uint256, reverting on\n * overflow (when the input is greater than largest uint152).\n *\n * Counterpart to Solidity's `uint152` operator.\n *\n * Requirements:\n *\n * - input must fit into 152 bits\n */\n function toUint152(uint256 value) internal pure returns (uint152) {\n if (value > type(uint152).max) {\n revert SafeCastOverflowedUintDowncast(152, value);\n }\n return uint152(value);\n }\n\n /**\n * @dev Returns the downcasted uint144 from uint256, reverting on\n * overflow (when the input is greater than largest uint144).\n *\n * Counterpart to Solidity's `uint144` operator.\n *\n * Requirements:\n *\n * - input must fit into 144 bits\n */\n function toUint144(uint256 value) internal pure returns (uint144) {\n if (value > type(uint144).max) {\n revert SafeCastOverflowedUintDowncast(144, value);\n }\n return uint144(value);\n }\n\n /**\n * @dev Returns the downcasted uint136 from uint256, reverting on\n * overflow (when the input is greater than largest uint136).\n *\n * Counterpart to Solidity's `uint136` operator.\n *\n * Requirements:\n *\n * - input must fit into 136 bits\n */\n function toUint136(uint256 value) internal pure returns (uint136) {\n if (value > type(uint136).max) {\n revert SafeCastOverflowedUintDowncast(136, value);\n }\n return uint136(value);\n }\n\n /**\n * @dev Returns the downcasted uint128 from uint256, reverting on\n * overflow (when the input is greater than largest uint128).\n *\n * Counterpart to Solidity's `uint128` operator.\n *\n * Requirements:\n *\n * - input must fit into 128 bits\n */\n function toUint128(uint256 value) internal pure returns (uint128) {\n if (value > type(uint128).max) {\n revert SafeCastOverflowedUintDowncast(128, value);\n }\n return uint128(value);\n }\n\n /**\n * @dev Returns the downcasted uint120 from uint256, reverting on\n * overflow (when the input is greater than largest uint120).\n *\n * Counterpart to Solidity's `uint120` operator.\n *\n * Requirements:\n *\n * - input must fit into 120 bits\n */\n function toUint120(uint256 value) internal pure returns (uint120) {\n if (value > type(uint120).max) {\n revert SafeCastOverflowedUintDowncast(120, value);\n }\n return uint120(value);\n }\n\n /**\n * @dev Returns the downcasted uint112 from uint256, reverting on\n * overflow (when the input is greater than largest uint112).\n *\n * Counterpart to Solidity's `uint112` operator.\n *\n * Requirements:\n *\n * - input must fit into 112 bits\n */\n function toUint112(uint256 value) internal pure returns (uint112) {\n if (value > type(uint112).max) {\n revert SafeCastOverflowedUintDowncast(112, value);\n }\n return uint112(value);\n }\n\n /**\n * @dev Returns the downcasted uint104 from uint256, reverting on\n * overflow (when the input is greater than largest uint104).\n *\n * Counterpart to Solidity's `uint104` operator.\n *\n * Requirements:\n *\n * - input must fit into 104 bits\n */\n function toUint104(uint256 value) internal pure returns (uint104) {\n if (value > type(uint104).max) {\n revert SafeCastOverflowedUintDowncast(104, value);\n }\n return uint104(value);\n }\n\n /**\n * @dev Returns the downcasted uint96 from uint256, reverting on\n * overflow (when the input is greater than largest uint96).\n *\n * Counterpart to Solidity's `uint96` operator.\n *\n * Requirements:\n *\n * - input must fit into 96 bits\n */\n function toUint96(uint256 value) internal pure returns (uint96) {\n if (value > type(uint96).max) {\n revert SafeCastOverflowedUintDowncast(96, value);\n }\n return uint96(value);\n }\n\n /**\n * @dev Returns the downcasted uint88 from uint256, reverting on\n * overflow (when the input is greater than largest uint88).\n *\n * Counterpart to Solidity's `uint88` operator.\n *\n * Requirements:\n *\n * - input must fit into 88 bits\n */\n function toUint88(uint256 value) internal pure returns (uint88) {\n if (value > type(uint88).max) {\n revert SafeCastOverflowedUintDowncast(88, value);\n }\n return uint88(value);\n }\n\n /**\n * @dev Returns the downcasted uint80 from uint256, reverting on\n * overflow (when the input is greater than largest uint80).\n *\n * Counterpart to Solidity's `uint80` operator.\n *\n * Requirements:\n *\n * - input must fit into 80 bits\n */\n function toUint80(uint256 value) internal pure returns (uint80) {\n if (value > type(uint80).max) {\n revert SafeCastOverflowedUintDowncast(80, value);\n }\n return uint80(value);\n }\n\n /**\n * @dev Returns the downcasted uint72 from uint256, reverting on\n * overflow (when the input is greater than largest uint72).\n *\n * Counterpart to Solidity's `uint72` operator.\n *\n * Requirements:\n *\n * - input must fit into 72 bits\n */\n function toUint72(uint256 value) internal pure returns (uint72) {\n if (value > type(uint72).max) {\n revert SafeCastOverflowedUintDowncast(72, value);\n }\n return uint72(value);\n }\n\n /**\n * @dev Returns the downcasted uint64 from uint256, reverting on\n * overflow (when the input is greater than largest uint64).\n *\n * Counterpart to Solidity's `uint64` operator.\n *\n * Requirements:\n *\n * - input must fit into 64 bits\n */\n function toUint64(uint256 value) internal pure returns (uint64) {\n if (value > type(uint64).max) {\n revert SafeCastOverflowedUintDowncast(64, value);\n }\n return uint64(value);\n }\n\n /**\n * @dev Returns the downcasted uint56 from uint256, reverting on\n * overflow (when the input is greater than largest uint56).\n *\n * Counterpart to Solidity's `uint56` operator.\n *\n * Requirements:\n *\n * - input must fit into 56 bits\n */\n function toUint56(uint256 value) internal pure returns (uint56) {\n if (value > type(uint56).max) {\n revert SafeCastOverflowedUintDowncast(56, value);\n }\n return uint56(value);\n }\n\n /**\n * @dev Returns the downcasted uint48 from uint256, reverting on\n * overflow (when the input is greater than largest uint48).\n *\n * Counterpart to Solidity's `uint48` operator.\n *\n * Requirements:\n *\n * - input must fit into 48 bits\n */\n function toUint48(uint256 value) internal pure returns (uint48) {\n if (value > type(uint48).max) {\n revert SafeCastOverflowedUintDowncast(48, value);\n }\n return uint48(value);\n }\n\n /**\n * @dev Returns the downcasted uint40 from uint256, reverting on\n * overflow (when the input is greater than largest uint40).\n *\n * Counterpart to Solidity's `uint40` operator.\n *\n * Requirements:\n *\n * - input must fit into 40 bits\n */\n function toUint40(uint256 value) internal pure returns (uint40) {\n if (value > type(uint40).max) {\n revert SafeCastOverflowedUintDowncast(40, value);\n }\n return uint40(value);\n }\n\n /**\n * @dev Returns the downcasted uint32 from uint256, reverting on\n * overflow (when the input is greater than largest uint32).\n *\n * Counterpart to Solidity's `uint32` operator.\n *\n * Requirements:\n *\n * - input must fit into 32 bits\n */\n function toUint32(uint256 value) internal pure returns (uint32) {\n if (value > type(uint32).max) {\n revert SafeCastOverflowedUintDowncast(32, value);\n }\n return uint32(value);\n }\n\n /**\n * @dev Returns the downcasted uint24 from uint256, reverting on\n * overflow (when the input is greater than largest uint24).\n *\n * Counterpart to Solidity's `uint24` operator.\n *\n * Requirements:\n *\n * - input must fit into 24 bits\n */\n function toUint24(uint256 value) internal pure returns (uint24) {\n if (value > type(uint24).max) {\n revert SafeCastOverflowedUintDowncast(24, value);\n }\n return uint24(value);\n }\n\n /**\n * @dev Returns the downcasted uint16 from uint256, reverting on\n * overflow (when the input is greater than largest uint16).\n *\n * Counterpart to Solidity's `uint16` operator.\n *\n * Requirements:\n *\n * - input must fit into 16 bits\n */\n function toUint16(uint256 value) internal pure returns (uint16) {\n if (value > type(uint16).max) {\n revert SafeCastOverflowedUintDowncast(16, value);\n }\n return uint16(value);\n }\n\n /**\n * @dev Returns the downcasted uint8 from uint256, reverting on\n * overflow (when the input is greater than largest uint8).\n *\n * Counterpart to Solidity's `uint8` operator.\n *\n * Requirements:\n *\n * - input must fit into 8 bits\n */\n function toUint8(uint256 value) internal pure returns (uint8) {\n if (value > type(uint8).max) {\n revert SafeCastOverflowedUintDowncast(8, value);\n }\n return uint8(value);\n }\n\n /**\n * @dev Converts a signed int256 into an unsigned uint256.\n *\n * Requirements:\n *\n * - input must be greater than or equal to 0.\n */\n function toUint256(int256 value) internal pure returns (uint256) {\n if (value < 0) {\n revert SafeCastOverflowedIntToUint(value);\n }\n return uint256(value);\n }\n\n /**\n * @dev Returns the downcasted int248 from int256, reverting on\n * overflow (when the input is less than smallest int248 or\n * greater than largest int248).\n *\n * Counterpart to Solidity's `int248` operator.\n *\n * Requirements:\n *\n * - input must fit into 248 bits\n */\n function toInt248(int256 value) internal pure returns (int248 downcasted) {\n downcasted = int248(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(248, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int240 from int256, reverting on\n * overflow (when the input is less than smallest int240 or\n * greater than largest int240).\n *\n * Counterpart to Solidity's `int240` operator.\n *\n * Requirements:\n *\n * - input must fit into 240 bits\n */\n function toInt240(int256 value) internal pure returns (int240 downcasted) {\n downcasted = int240(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(240, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int232 from int256, reverting on\n * overflow (when the input is less than smallest int232 or\n * greater than largest int232).\n *\n * Counterpart to Solidity's `int232` operator.\n *\n * Requirements:\n *\n * - input must fit into 232 bits\n */\n function toInt232(int256 value) internal pure returns (int232 downcasted) {\n downcasted = int232(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(232, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int224 from int256, reverting on\n * overflow (when the input is less than smallest int224 or\n * greater than largest int224).\n *\n * Counterpart to Solidity's `int224` operator.\n *\n * Requirements:\n *\n * - input must fit into 224 bits\n */\n function toInt224(int256 value) internal pure returns (int224 downcasted) {\n downcasted = int224(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(224, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int216 from int256, reverting on\n * overflow (when the input is less than smallest int216 or\n * greater than largest int216).\n *\n * Counterpart to Solidity's `int216` operator.\n *\n * Requirements:\n *\n * - input must fit into 216 bits\n */\n function toInt216(int256 value) internal pure returns (int216 downcasted) {\n downcasted = int216(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(216, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int208 from int256, reverting on\n * overflow (when the input is less than smallest int208 or\n * greater than largest int208).\n *\n * Counterpart to Solidity's `int208` operator.\n *\n * Requirements:\n *\n * - input must fit into 208 bits\n */\n function toInt208(int256 value) internal pure returns (int208 downcasted) {\n downcasted = int208(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(208, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int200 from int256, reverting on\n * overflow (when the input is less than smallest int200 or\n * greater than largest int200).\n *\n * Counterpart to Solidity's `int200` operator.\n *\n * Requirements:\n *\n * - input must fit into 200 bits\n */\n function toInt200(int256 value) internal pure returns (int200 downcasted) {\n downcasted = int200(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(200, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int192 from int256, reverting on\n * overflow (when the input is less than smallest int192 or\n * greater than largest int192).\n *\n * Counterpart to Solidity's `int192` operator.\n *\n * Requirements:\n *\n * - input must fit into 192 bits\n */\n function toInt192(int256 value) internal pure returns (int192 downcasted) {\n downcasted = int192(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(192, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int184 from int256, reverting on\n * overflow (when the input is less than smallest int184 or\n * greater than largest int184).\n *\n * Counterpart to Solidity's `int184` operator.\n *\n * Requirements:\n *\n * - input must fit into 184 bits\n */\n function toInt184(int256 value) internal pure returns (int184 downcasted) {\n downcasted = int184(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(184, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int176 from int256, reverting on\n * overflow (when the input is less than smallest int176 or\n * greater than largest int176).\n *\n * Counterpart to Solidity's `int176` operator.\n *\n * Requirements:\n *\n * - input must fit into 176 bits\n */\n function toInt176(int256 value) internal pure returns (int176 downcasted) {\n downcasted = int176(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(176, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int168 from int256, reverting on\n * overflow (when the input is less than smallest int168 or\n * greater than largest int168).\n *\n * Counterpart to Solidity's `int168` operator.\n *\n * Requirements:\n *\n * - input must fit into 168 bits\n */\n function toInt168(int256 value) internal pure returns (int168 downcasted) {\n downcasted = int168(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(168, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int160 from int256, reverting on\n * overflow (when the input is less than smallest int160 or\n * greater than largest int160).\n *\n * Counterpart to Solidity's `int160` operator.\n *\n * Requirements:\n *\n * - input must fit into 160 bits\n */\n function toInt160(int256 value) internal pure returns (int160 downcasted) {\n downcasted = int160(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(160, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int152 from int256, reverting on\n * overflow (when the input is less than smallest int152 or\n * greater than largest int152).\n *\n * Counterpart to Solidity's `int152` operator.\n *\n * Requirements:\n *\n * - input must fit into 152 bits\n */\n function toInt152(int256 value) internal pure returns (int152 downcasted) {\n downcasted = int152(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(152, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int144 from int256, reverting on\n * overflow (when the input is less than smallest int144 or\n * greater than largest int144).\n *\n * Counterpart to Solidity's `int144` operator.\n *\n * Requirements:\n *\n * - input must fit into 144 bits\n */\n function toInt144(int256 value) internal pure returns (int144 downcasted) {\n downcasted = int144(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(144, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int136 from int256, reverting on\n * overflow (when the input is less than smallest int136 or\n * greater than largest int136).\n *\n * Counterpart to Solidity's `int136` operator.\n *\n * Requirements:\n *\n * - input must fit into 136 bits\n */\n function toInt136(int256 value) internal pure returns (int136 downcasted) {\n downcasted = int136(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(136, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int128 from int256, reverting on\n * overflow (when the input is less than smallest int128 or\n * greater than largest int128).\n *\n * Counterpart to Solidity's `int128` operator.\n *\n * Requirements:\n *\n * - input must fit into 128 bits\n */\n function toInt128(int256 value) internal pure returns (int128 downcasted) {\n downcasted = int128(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(128, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int120 from int256, reverting on\n * overflow (when the input is less than smallest int120 or\n * greater than largest int120).\n *\n * Counterpart to Solidity's `int120` operator.\n *\n * Requirements:\n *\n * - input must fit into 120 bits\n */\n function toInt120(int256 value) internal pure returns (int120 downcasted) {\n downcasted = int120(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(120, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int112 from int256, reverting on\n * overflow (when the input is less than smallest int112 or\n * greater than largest int112).\n *\n * Counterpart to Solidity's `int112` operator.\n *\n * Requirements:\n *\n * - input must fit into 112 bits\n */\n function toInt112(int256 value) internal pure returns (int112 downcasted) {\n downcasted = int112(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(112, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int104 from int256, reverting on\n * overflow (when the input is less than smallest int104 or\n * greater than largest int104).\n *\n * Counterpart to Solidity's `int104` operator.\n *\n * Requirements:\n *\n * - input must fit into 104 bits\n */\n function toInt104(int256 value) internal pure returns (int104 downcasted) {\n downcasted = int104(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(104, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int96 from int256, reverting on\n * overflow (when the input is less than smallest int96 or\n * greater than largest int96).\n *\n * Counterpart to Solidity's `int96` operator.\n *\n * Requirements:\n *\n * - input must fit into 96 bits\n */\n function toInt96(int256 value) internal pure returns (int96 downcasted) {\n downcasted = int96(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(96, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int88 from int256, reverting on\n * overflow (when the input is less than smallest int88 or\n * greater than largest int88).\n *\n * Counterpart to Solidity's `int88` operator.\n *\n * Requirements:\n *\n * - input must fit into 88 bits\n */\n function toInt88(int256 value) internal pure returns (int88 downcasted) {\n downcasted = int88(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(88, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int80 from int256, reverting on\n * overflow (when the input is less than smallest int80 or\n * greater than largest int80).\n *\n * Counterpart to Solidity's `int80` operator.\n *\n * Requirements:\n *\n * - input must fit into 80 bits\n */\n function toInt80(int256 value) internal pure returns (int80 downcasted) {\n downcasted = int80(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(80, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int72 from int256, reverting on\n * overflow (when the input is less than smallest int72 or\n * greater than largest int72).\n *\n * Counterpart to Solidity's `int72` operator.\n *\n * Requirements:\n *\n * - input must fit into 72 bits\n */\n function toInt72(int256 value) internal pure returns (int72 downcasted) {\n downcasted = int72(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(72, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int64 from int256, reverting on\n * overflow (when the input is less than smallest int64 or\n * greater than largest int64).\n *\n * Counterpart to Solidity's `int64` operator.\n *\n * Requirements:\n *\n * - input must fit into 64 bits\n */\n function toInt64(int256 value) internal pure returns (int64 downcasted) {\n downcasted = int64(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(64, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int56 from int256, reverting on\n * overflow (when the input is less than smallest int56 or\n * greater than largest int56).\n *\n * Counterpart to Solidity's `int56` operator.\n *\n * Requirements:\n *\n * - input must fit into 56 bits\n */\n function toInt56(int256 value) internal pure returns (int56 downcasted) {\n downcasted = int56(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(56, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int48 from int256, reverting on\n * overflow (when the input is less than smallest int48 or\n * greater than largest int48).\n *\n * Counterpart to Solidity's `int48` operator.\n *\n * Requirements:\n *\n * - input must fit into 48 bits\n */\n function toInt48(int256 value) internal pure returns (int48 downcasted) {\n downcasted = int48(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(48, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int40 from int256, reverting on\n * overflow (when the input is less than smallest int40 or\n * greater than largest int40).\n *\n * Counterpart to Solidity's `int40` operator.\n *\n * Requirements:\n *\n * - input must fit into 40 bits\n */\n function toInt40(int256 value) internal pure returns (int40 downcasted) {\n downcasted = int40(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(40, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int32 from int256, reverting on\n * overflow (when the input is less than smallest int32 or\n * greater than largest int32).\n *\n * Counterpart to Solidity's `int32` operator.\n *\n * Requirements:\n *\n * - input must fit into 32 bits\n */\n function toInt32(int256 value) internal pure returns (int32 downcasted) {\n downcasted = int32(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(32, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int24 from int256, reverting on\n * overflow (when the input is less than smallest int24 or\n * greater than largest int24).\n *\n * Counterpart to Solidity's `int24` operator.\n *\n * Requirements:\n *\n * - input must fit into 24 bits\n */\n function toInt24(int256 value) internal pure returns (int24 downcasted) {\n downcasted = int24(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(24, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int16 from int256, reverting on\n * overflow (when the input is less than smallest int16 or\n * greater than largest int16).\n *\n * Counterpart to Solidity's `int16` operator.\n *\n * Requirements:\n *\n * - input must fit into 16 bits\n */\n function toInt16(int256 value) internal pure returns (int16 downcasted) {\n downcasted = int16(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(16, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int8 from int256, reverting on\n * overflow (when the input is less than smallest int8 or\n * greater than largest int8).\n *\n * Counterpart to Solidity's `int8` operator.\n *\n * Requirements:\n *\n * - input must fit into 8 bits\n */\n function toInt8(int256 value) internal pure returns (int8 downcasted) {\n downcasted = int8(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(8, value);\n }\n }\n\n /**\n * @dev Converts an unsigned uint256 into a signed int256.\n *\n * Requirements:\n *\n * - input must be less than or equal to maxInt256.\n */\n function toInt256(uint256 value) internal pure returns (int256) {\n // Note: Unsafe cast below is okay because `type(int256).max` is guaranteed to be positive\n if (value > uint256(type(int256).max)) {\n revert SafeCastOverflowedUintToInt(value);\n }\n return int256(value);\n }\n\n /**\n * @dev Cast a boolean (false or true) to a uint256 (0 or 1) with no jump.\n */\n function toUint(bool b) internal pure returns (uint256 u) {\n assembly (\"memory-safe\") {\n u := iszero(iszero(b))\n }\n }\n}\n" + }, + "@openzeppelin/contracts/utils/math/SignedMath.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/math/SignedMath.sol)\n\npragma solidity ^0.8.20;\n\nimport {SafeCast} from \"./SafeCast.sol\";\n\n/**\n * @dev Standard signed math utilities missing in the Solidity language.\n */\nlibrary SignedMath {\n /**\n * @dev Branchless ternary evaluation for `a ? b : c`. Gas costs are constant.\n *\n * IMPORTANT: This function may reduce bytecode size and consume less gas when used standalone.\n * However, the compiler may optimize Solidity ternary operations (i.e. `a ? b : c`) to only compute\n * one branch when needed, making this function more expensive.\n */\n function ternary(bool condition, int256 a, int256 b) internal pure returns (int256) {\n unchecked {\n // branchless ternary works because:\n // b ^ (a ^ b) == a\n // b ^ 0 == b\n return b ^ ((a ^ b) * int256(SafeCast.toUint(condition)));\n }\n }\n\n /**\n * @dev Returns the largest of two signed numbers.\n */\n function max(int256 a, int256 b) internal pure returns (int256) {\n return ternary(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 ternary(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 // Formula from the \"Bit Twiddling Hacks\" by Sean Eron Anderson.\n // Since `n` is a signed integer, the generated bytecode will use the SAR opcode to perform the right shift,\n // taking advantage of the most significant (or \"sign\" bit) in two's complement representation.\n // This opcode adds new most significant bits set to the value of the previous most significant bit. As a result,\n // the mask will either be `bytes32(0)` (if n is positive) or `~bytes32(0)` (if n is negative).\n int256 mask = n >> 255;\n\n // A `bytes32(0)` mask leaves the input unchanged, while a `~bytes32(0)` mask complements it.\n return uint256((n + mask) ^ mask);\n }\n }\n}\n" + }, + "@openzeppelin/contracts/utils/Nonces.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/Nonces.sol)\npragma solidity ^0.8.20;\n\n/**\n * @dev Provides tracking nonces for addresses. Nonces will only increment.\n */\nabstract contract Nonces {\n /**\n * @dev The nonce used for an `account` is not the expected current nonce.\n */\n error InvalidAccountNonce(address account, uint256 currentNonce);\n\n mapping(address account => uint256) private _nonces;\n\n /**\n * @dev Returns the next unused nonce for an address.\n */\n function nonces(address owner) public view virtual returns (uint256) {\n return _nonces[owner];\n }\n\n /**\n * @dev Consumes a nonce.\n *\n * Returns the current value and increments nonce.\n */\n function _useNonce(address owner) internal virtual returns (uint256) {\n // For each account, the nonce has an initial value of 0, can only be incremented by one, and cannot be\n // decremented or reset. This guarantees that the nonce never overflows.\n unchecked {\n // It is important to do x++ and not ++x here.\n return _nonces[owner]++;\n }\n }\n\n /**\n * @dev Same as {_useNonce} but checking that `nonce` is the next valid for `owner`.\n */\n function _useCheckedNonce(address owner, uint256 nonce) internal virtual {\n uint256 current = _useNonce(owner);\n if (nonce != current) {\n revert InvalidAccountNonce(owner, current);\n }\n }\n}\n" + }, + "@openzeppelin/contracts/utils/Panic.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/Panic.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Helper library for emitting standardized panic codes.\n *\n * ```solidity\n * contract Example {\n * using Panic for uint256;\n *\n * // Use any of the declared internal constants\n * function foo() { Panic.GENERIC.panic(); }\n *\n * // Alternatively\n * function foo() { Panic.panic(Panic.GENERIC); }\n * }\n * ```\n *\n * Follows the list from https://github.com/ethereum/solidity/blob/v0.8.24/libsolutil/ErrorCodes.h[libsolutil].\n *\n * _Available since v5.1._\n */\n// slither-disable-next-line unused-state\nlibrary Panic {\n /// @dev generic / unspecified error\n uint256 internal constant GENERIC = 0x00;\n /// @dev used by the assert() builtin\n uint256 internal constant ASSERT = 0x01;\n /// @dev arithmetic underflow or overflow\n uint256 internal constant UNDER_OVERFLOW = 0x11;\n /// @dev division or modulo by zero\n uint256 internal constant DIVISION_BY_ZERO = 0x12;\n /// @dev enum conversion error\n uint256 internal constant ENUM_CONVERSION_ERROR = 0x21;\n /// @dev invalid encoding in storage\n uint256 internal constant STORAGE_ENCODING_ERROR = 0x22;\n /// @dev empty array pop\n uint256 internal constant EMPTY_ARRAY_POP = 0x31;\n /// @dev array out of bounds access\n uint256 internal constant ARRAY_OUT_OF_BOUNDS = 0x32;\n /// @dev resource error (too large allocation or too large array)\n uint256 internal constant RESOURCE_ERROR = 0x41;\n /// @dev calling invalid internal function\n uint256 internal constant INVALID_INTERNAL_FUNCTION = 0x51;\n\n /// @dev Reverts with a panic code. Recommended to use with\n /// the internal constants with predefined codes.\n function panic(uint256 code) internal pure {\n assembly (\"memory-safe\") {\n mstore(0x00, 0x4e487b71)\n mstore(0x20, code)\n revert(0x1c, 0x24)\n }\n }\n}\n" + }, + "@openzeppelin/contracts/utils/ShortStrings.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/ShortStrings.sol)\n\npragma solidity ^0.8.20;\n\nimport {StorageSlot} from \"./StorageSlot.sol\";\n\n// | string | 0xAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA |\n// | length | 0x BB |\ntype ShortString is bytes32;\n\n/**\n * @dev This library provides functions to convert short memory strings\n * into a `ShortString` type that can be used as an immutable variable.\n *\n * Strings of arbitrary length can be optimized using this library if\n * they are short enough (up to 31 bytes) by packing them with their\n * length (1 byte) in a single EVM word (32 bytes). Additionally, a\n * fallback mechanism can be used for every other case.\n *\n * Usage example:\n *\n * ```solidity\n * contract Named {\n * using ShortStrings for *;\n *\n * ShortString private immutable _name;\n * string private _nameFallback;\n *\n * constructor(string memory contractName) {\n * _name = contractName.toShortStringWithFallback(_nameFallback);\n * }\n *\n * function name() external view returns (string memory) {\n * return _name.toStringWithFallback(_nameFallback);\n * }\n * }\n * ```\n */\nlibrary ShortStrings {\n // Used as an identifier for strings longer than 31 bytes.\n bytes32 private constant FALLBACK_SENTINEL = 0x00000000000000000000000000000000000000000000000000000000000000FF;\n\n error StringTooLong(string str);\n error InvalidShortString();\n\n /**\n * @dev Encode a string of at most 31 chars into a `ShortString`.\n *\n * This will trigger a `StringTooLong` error is the input string is too long.\n */\n function toShortString(string memory str) internal pure returns (ShortString) {\n bytes memory bstr = bytes(str);\n if (bstr.length > 31) {\n revert StringTooLong(str);\n }\n return ShortString.wrap(bytes32(uint256(bytes32(bstr)) | bstr.length));\n }\n\n /**\n * @dev Decode a `ShortString` back to a \"normal\" string.\n */\n function toString(ShortString sstr) internal pure returns (string memory) {\n uint256 len = byteLength(sstr);\n // using `new string(len)` would work locally but is not memory safe.\n string memory str = new string(32);\n assembly (\"memory-safe\") {\n mstore(str, len)\n mstore(add(str, 0x20), sstr)\n }\n return str;\n }\n\n /**\n * @dev Return the length of a `ShortString`.\n */\n function byteLength(ShortString sstr) internal pure returns (uint256) {\n uint256 result = uint256(ShortString.unwrap(sstr)) & 0xFF;\n if (result > 31) {\n revert InvalidShortString();\n }\n return result;\n }\n\n /**\n * @dev Encode a string into a `ShortString`, or write it to storage if it is too long.\n */\n function toShortStringWithFallback(string memory value, string storage store) internal returns (ShortString) {\n if (bytes(value).length < 32) {\n return toShortString(value);\n } else {\n StorageSlot.getStringSlot(store).value = value;\n return ShortString.wrap(FALLBACK_SENTINEL);\n }\n }\n\n /**\n * @dev Decode a string that was encoded to `ShortString` or written to storage using {setWithFallback}.\n */\n function toStringWithFallback(ShortString value, string storage store) internal pure returns (string memory) {\n if (ShortString.unwrap(value) != FALLBACK_SENTINEL) {\n return toString(value);\n } else {\n return store;\n }\n }\n\n /**\n * @dev Return the length of a string that was encoded to `ShortString` or written to storage using\n * {setWithFallback}.\n *\n * WARNING: This will return the \"byte length\" of the string. This may not reflect the actual length in terms of\n * actual characters as the UTF-8 encoding of a single character can span over multiple bytes.\n */\n function byteLengthWithFallback(ShortString value, string storage store) internal view returns (uint256) {\n if (ShortString.unwrap(value) != FALLBACK_SENTINEL) {\n return byteLength(value);\n } else {\n return bytes(store).length;\n }\n }\n}\n" + }, + "@openzeppelin/contracts/utils/StorageSlot.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/StorageSlot.sol)\n// This file was procedurally generated from scripts/generate/templates/StorageSlot.js.\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Library for reading and writing primitive types to specific storage slots.\n *\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\n * This library helps with reading and writing to such slots without the need for inline assembly.\n *\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\n *\n * Example usage to set ERC-1967 implementation slot:\n * ```solidity\n * contract ERC1967 {\n * // Define the slot. Alternatively, use the SlotDerivation library to derive the slot.\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\n *\n * function _getImplementation() internal view returns (address) {\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\n * }\n *\n * function _setImplementation(address newImplementation) internal {\n * require(newImplementation.code.length > 0);\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\n * }\n * }\n * ```\n *\n * TIP: Consider using this library along with {SlotDerivation}.\n */\nlibrary StorageSlot {\n struct AddressSlot {\n address value;\n }\n\n struct BooleanSlot {\n bool value;\n }\n\n struct Bytes32Slot {\n bytes32 value;\n }\n\n struct Uint256Slot {\n uint256 value;\n }\n\n struct Int256Slot {\n int256 value;\n }\n\n struct StringSlot {\n string value;\n }\n\n struct BytesSlot {\n bytes value;\n }\n\n /**\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\n */\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\n assembly (\"memory-safe\") {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns a `BooleanSlot` with member `value` located at `slot`.\n */\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\n assembly (\"memory-safe\") {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns a `Bytes32Slot` with member `value` located at `slot`.\n */\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\n assembly (\"memory-safe\") {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns a `Uint256Slot` with member `value` located at `slot`.\n */\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\n assembly (\"memory-safe\") {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns a `Int256Slot` with member `value` located at `slot`.\n */\n function getInt256Slot(bytes32 slot) internal pure returns (Int256Slot storage r) {\n assembly (\"memory-safe\") {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns a `StringSlot` with member `value` located at `slot`.\n */\n function getStringSlot(bytes32 slot) internal pure returns (StringSlot storage r) {\n assembly (\"memory-safe\") {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `StringSlot` representation of the string storage pointer `store`.\n */\n function getStringSlot(string storage store) internal pure returns (StringSlot storage r) {\n assembly (\"memory-safe\") {\n r.slot := store.slot\n }\n }\n\n /**\n * @dev Returns a `BytesSlot` with member `value` located at `slot`.\n */\n function getBytesSlot(bytes32 slot) internal pure returns (BytesSlot storage r) {\n assembly (\"memory-safe\") {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `BytesSlot` representation of the bytes storage pointer `store`.\n */\n function getBytesSlot(bytes storage store) internal pure returns (BytesSlot storage r) {\n assembly (\"memory-safe\") {\n r.slot := store.slot\n }\n }\n}\n" + }, + "@openzeppelin/contracts/utils/Strings.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/Strings.sol)\n\npragma solidity ^0.8.20;\n\nimport {Math} from \"./math/Math.sol\";\nimport {SignedMath} from \"./math/SignedMath.sol\";\n\n/**\n * @dev String operations.\n */\nlibrary Strings {\n bytes16 private constant HEX_DIGITS = \"0123456789abcdef\";\n uint8 private constant ADDRESS_LENGTH = 20;\n\n /**\n * @dev The `value` string doesn't fit in the specified `length`.\n */\n error StringsInsufficientHexLength(uint256 value, uint256 length);\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 assembly (\"memory-safe\") {\n ptr := add(buffer, add(32, length))\n }\n while (true) {\n ptr--;\n assembly (\"memory-safe\") {\n mstore8(ptr, byte(mod(value, 10), HEX_DIGITS))\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 toStringSigned(int256 value) internal pure returns (string memory) {\n return string.concat(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 uint256 localValue = value;\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] = HEX_DIGITS[localValue & 0xf];\n localValue >>= 4;\n }\n if (localValue != 0) {\n revert StringsInsufficientHexLength(value, length);\n }\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\n * 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 Converts an `address` with fixed length of 20 bytes to its checksummed ASCII `string` hexadecimal\n * representation, according to EIP-55.\n */\n function toChecksumHexString(address addr) internal pure returns (string memory) {\n bytes memory buffer = bytes(toHexString(addr));\n\n // hash the hex part of buffer (skip length + 2 bytes, length 40)\n uint256 hashValue;\n assembly (\"memory-safe\") {\n hashValue := shr(96, keccak256(add(buffer, 0x22), 40))\n }\n\n for (uint256 i = 41; i > 1; --i) {\n // possible values for buffer[i] are 48 (0) to 57 (9) and 97 (a) to 102 (f)\n if (hashValue & 0xf > 7 && uint8(buffer[i]) > 96) {\n // case shift by xoring with 0x20\n buffer[i] ^= 0x20;\n }\n hashValue >>= 4;\n }\n return string(buffer);\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 bytes(a).length == bytes(b).length && keccak256(bytes(a)) == keccak256(bytes(b));\n }\n}\n" + }, + "@openzeppelin/contracts/utils/structs/Checkpoints.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/structs/Checkpoints.sol)\n// This file was procedurally generated from scripts/generate/templates/Checkpoints.js.\n\npragma solidity ^0.8.20;\n\nimport {Math} from \"../math/Math.sol\";\n\n/**\n * @dev This library defines the `Trace*` struct, for checkpointing values as they change at different points in\n * time, and later looking up past values by block number. See {Votes} as an example.\n *\n * To create a history of checkpoints define a variable type `Checkpoints.Trace*` in your contract, and store a new\n * checkpoint for the current transaction block using the {push} function.\n */\nlibrary Checkpoints {\n /**\n * @dev A value was attempted to be inserted on a past checkpoint.\n */\n error CheckpointUnorderedInsertion();\n\n struct Trace224 {\n Checkpoint224[] _checkpoints;\n }\n\n struct Checkpoint224 {\n uint32 _key;\n uint224 _value;\n }\n\n /**\n * @dev Pushes a (`key`, `value`) pair into a Trace224 so that it is stored as the checkpoint.\n *\n * Returns previous value and new value.\n *\n * IMPORTANT: Never accept `key` as a user input, since an arbitrary `type(uint32).max` key set will disable the\n * library.\n */\n function push(\n Trace224 storage self,\n uint32 key,\n uint224 value\n ) internal returns (uint224 oldValue, uint224 newValue) {\n return _insert(self._checkpoints, key, value);\n }\n\n /**\n * @dev Returns the value in the first (oldest) checkpoint with key greater or equal than the search key, or zero if\n * there is none.\n */\n function lowerLookup(Trace224 storage self, uint32 key) internal view returns (uint224) {\n uint256 len = self._checkpoints.length;\n uint256 pos = _lowerBinaryLookup(self._checkpoints, key, 0, len);\n return pos == len ? 0 : _unsafeAccess(self._checkpoints, pos)._value;\n }\n\n /**\n * @dev Returns the value in the last (most recent) checkpoint with key lower or equal than the search key, or zero\n * if there is none.\n */\n function upperLookup(Trace224 storage self, uint32 key) internal view returns (uint224) {\n uint256 len = self._checkpoints.length;\n uint256 pos = _upperBinaryLookup(self._checkpoints, key, 0, len);\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\n }\n\n /**\n * @dev Returns the value in the last (most recent) checkpoint with key lower or equal than the search key, or zero\n * if there is none.\n *\n * NOTE: This is a variant of {upperLookup} that is optimised to find \"recent\" checkpoint (checkpoints with high\n * keys).\n */\n function upperLookupRecent(Trace224 storage self, uint32 key) internal view returns (uint224) {\n uint256 len = self._checkpoints.length;\n\n uint256 low = 0;\n uint256 high = len;\n\n if (len > 5) {\n uint256 mid = len - Math.sqrt(len);\n if (key < _unsafeAccess(self._checkpoints, mid)._key) {\n high = mid;\n } else {\n low = mid + 1;\n }\n }\n\n uint256 pos = _upperBinaryLookup(self._checkpoints, key, low, high);\n\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\n }\n\n /**\n * @dev Returns the value in the most recent checkpoint, or zero if there are no checkpoints.\n */\n function latest(Trace224 storage self) internal view returns (uint224) {\n uint256 pos = self._checkpoints.length;\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\n }\n\n /**\n * @dev Returns whether there is a checkpoint in the structure (i.e. it is not empty), and if so the key and value\n * in the most recent checkpoint.\n */\n function latestCheckpoint(Trace224 storage self) internal view returns (bool exists, uint32 _key, uint224 _value) {\n uint256 pos = self._checkpoints.length;\n if (pos == 0) {\n return (false, 0, 0);\n } else {\n Checkpoint224 storage ckpt = _unsafeAccess(self._checkpoints, pos - 1);\n return (true, ckpt._key, ckpt._value);\n }\n }\n\n /**\n * @dev Returns the number of checkpoint.\n */\n function length(Trace224 storage self) internal view returns (uint256) {\n return self._checkpoints.length;\n }\n\n /**\n * @dev Returns checkpoint at given position.\n */\n function at(Trace224 storage self, uint32 pos) internal view returns (Checkpoint224 memory) {\n return self._checkpoints[pos];\n }\n\n /**\n * @dev Pushes a (`key`, `value`) pair into an ordered list of checkpoints, either by inserting a new checkpoint,\n * or by updating the last one.\n */\n function _insert(\n Checkpoint224[] storage self,\n uint32 key,\n uint224 value\n ) private returns (uint224 oldValue, uint224 newValue) {\n uint256 pos = self.length;\n\n if (pos > 0) {\n Checkpoint224 storage last = _unsafeAccess(self, pos - 1);\n uint32 lastKey = last._key;\n uint224 lastValue = last._value;\n\n // Checkpoint keys must be non-decreasing.\n if (lastKey > key) {\n revert CheckpointUnorderedInsertion();\n }\n\n // Update or push new checkpoint\n if (lastKey == key) {\n last._value = value;\n } else {\n self.push(Checkpoint224({_key: key, _value: value}));\n }\n return (lastValue, value);\n } else {\n self.push(Checkpoint224({_key: key, _value: value}));\n return (0, value);\n }\n }\n\n /**\n * @dev Return the index of the first (oldest) checkpoint with key strictly bigger than the search key, or `high`\n * if there is none. `low` and `high` define a section where to do the search, with inclusive `low` and exclusive\n * `high`.\n *\n * WARNING: `high` should not be greater than the array's length.\n */\n function _upperBinaryLookup(\n Checkpoint224[] storage self,\n uint32 key,\n uint256 low,\n uint256 high\n ) private view returns (uint256) {\n while (low < high) {\n uint256 mid = Math.average(low, high);\n if (_unsafeAccess(self, mid)._key > key) {\n high = mid;\n } else {\n low = mid + 1;\n }\n }\n return high;\n }\n\n /**\n * @dev Return the index of the first (oldest) checkpoint with key greater or equal than the search key, or `high`\n * if there is none. `low` and `high` define a section where to do the search, with inclusive `low` and exclusive\n * `high`.\n *\n * WARNING: `high` should not be greater than the array's length.\n */\n function _lowerBinaryLookup(\n Checkpoint224[] storage self,\n uint32 key,\n uint256 low,\n uint256 high\n ) private view returns (uint256) {\n while (low < high) {\n uint256 mid = Math.average(low, high);\n if (_unsafeAccess(self, mid)._key < key) {\n low = mid + 1;\n } else {\n high = mid;\n }\n }\n return high;\n }\n\n /**\n * @dev Access an element of the array without performing bounds check. The position is assumed to be within bounds.\n */\n function _unsafeAccess(\n Checkpoint224[] storage self,\n uint256 pos\n ) private pure returns (Checkpoint224 storage result) {\n assembly {\n mstore(0, self.slot)\n result.slot := add(keccak256(0, 0x20), pos)\n }\n }\n\n struct Trace208 {\n Checkpoint208[] _checkpoints;\n }\n\n struct Checkpoint208 {\n uint48 _key;\n uint208 _value;\n }\n\n /**\n * @dev Pushes a (`key`, `value`) pair into a Trace208 so that it is stored as the checkpoint.\n *\n * Returns previous value and new value.\n *\n * IMPORTANT: Never accept `key` as a user input, since an arbitrary `type(uint48).max` key set will disable the\n * library.\n */\n function push(\n Trace208 storage self,\n uint48 key,\n uint208 value\n ) internal returns (uint208 oldValue, uint208 newValue) {\n return _insert(self._checkpoints, key, value);\n }\n\n /**\n * @dev Returns the value in the first (oldest) checkpoint with key greater or equal than the search key, or zero if\n * there is none.\n */\n function lowerLookup(Trace208 storage self, uint48 key) internal view returns (uint208) {\n uint256 len = self._checkpoints.length;\n uint256 pos = _lowerBinaryLookup(self._checkpoints, key, 0, len);\n return pos == len ? 0 : _unsafeAccess(self._checkpoints, pos)._value;\n }\n\n /**\n * @dev Returns the value in the last (most recent) checkpoint with key lower or equal than the search key, or zero\n * if there is none.\n */\n function upperLookup(Trace208 storage self, uint48 key) internal view returns (uint208) {\n uint256 len = self._checkpoints.length;\n uint256 pos = _upperBinaryLookup(self._checkpoints, key, 0, len);\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\n }\n\n /**\n * @dev Returns the value in the last (most recent) checkpoint with key lower or equal than the search key, or zero\n * if there is none.\n *\n * NOTE: This is a variant of {upperLookup} that is optimised to find \"recent\" checkpoint (checkpoints with high\n * keys).\n */\n function upperLookupRecent(Trace208 storage self, uint48 key) internal view returns (uint208) {\n uint256 len = self._checkpoints.length;\n\n uint256 low = 0;\n uint256 high = len;\n\n if (len > 5) {\n uint256 mid = len - Math.sqrt(len);\n if (key < _unsafeAccess(self._checkpoints, mid)._key) {\n high = mid;\n } else {\n low = mid + 1;\n }\n }\n\n uint256 pos = _upperBinaryLookup(self._checkpoints, key, low, high);\n\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\n }\n\n /**\n * @dev Returns the value in the most recent checkpoint, or zero if there are no checkpoints.\n */\n function latest(Trace208 storage self) internal view returns (uint208) {\n uint256 pos = self._checkpoints.length;\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\n }\n\n /**\n * @dev Returns whether there is a checkpoint in the structure (i.e. it is not empty), and if so the key and value\n * in the most recent checkpoint.\n */\n function latestCheckpoint(Trace208 storage self) internal view returns (bool exists, uint48 _key, uint208 _value) {\n uint256 pos = self._checkpoints.length;\n if (pos == 0) {\n return (false, 0, 0);\n } else {\n Checkpoint208 storage ckpt = _unsafeAccess(self._checkpoints, pos - 1);\n return (true, ckpt._key, ckpt._value);\n }\n }\n\n /**\n * @dev Returns the number of checkpoint.\n */\n function length(Trace208 storage self) internal view returns (uint256) {\n return self._checkpoints.length;\n }\n\n /**\n * @dev Returns checkpoint at given position.\n */\n function at(Trace208 storage self, uint32 pos) internal view returns (Checkpoint208 memory) {\n return self._checkpoints[pos];\n }\n\n /**\n * @dev Pushes a (`key`, `value`) pair into an ordered list of checkpoints, either by inserting a new checkpoint,\n * or by updating the last one.\n */\n function _insert(\n Checkpoint208[] storage self,\n uint48 key,\n uint208 value\n ) private returns (uint208 oldValue, uint208 newValue) {\n uint256 pos = self.length;\n\n if (pos > 0) {\n Checkpoint208 storage last = _unsafeAccess(self, pos - 1);\n uint48 lastKey = last._key;\n uint208 lastValue = last._value;\n\n // Checkpoint keys must be non-decreasing.\n if (lastKey > key) {\n revert CheckpointUnorderedInsertion();\n }\n\n // Update or push new checkpoint\n if (lastKey == key) {\n last._value = value;\n } else {\n self.push(Checkpoint208({_key: key, _value: value}));\n }\n return (lastValue, value);\n } else {\n self.push(Checkpoint208({_key: key, _value: value}));\n return (0, value);\n }\n }\n\n /**\n * @dev Return the index of the first (oldest) checkpoint with key strictly bigger than the search key, or `high`\n * if there is none. `low` and `high` define a section where to do the search, with inclusive `low` and exclusive\n * `high`.\n *\n * WARNING: `high` should not be greater than the array's length.\n */\n function _upperBinaryLookup(\n Checkpoint208[] storage self,\n uint48 key,\n uint256 low,\n uint256 high\n ) private view returns (uint256) {\n while (low < high) {\n uint256 mid = Math.average(low, high);\n if (_unsafeAccess(self, mid)._key > key) {\n high = mid;\n } else {\n low = mid + 1;\n }\n }\n return high;\n }\n\n /**\n * @dev Return the index of the first (oldest) checkpoint with key greater or equal than the search key, or `high`\n * if there is none. `low` and `high` define a section where to do the search, with inclusive `low` and exclusive\n * `high`.\n *\n * WARNING: `high` should not be greater than the array's length.\n */\n function _lowerBinaryLookup(\n Checkpoint208[] storage self,\n uint48 key,\n uint256 low,\n uint256 high\n ) private view returns (uint256) {\n while (low < high) {\n uint256 mid = Math.average(low, high);\n if (_unsafeAccess(self, mid)._key < key) {\n low = mid + 1;\n } else {\n high = mid;\n }\n }\n return high;\n }\n\n /**\n * @dev Access an element of the array without performing bounds check. The position is assumed to be within bounds.\n */\n function _unsafeAccess(\n Checkpoint208[] storage self,\n uint256 pos\n ) private pure returns (Checkpoint208 storage result) {\n assembly {\n mstore(0, self.slot)\n result.slot := add(keccak256(0, 0x20), pos)\n }\n }\n\n struct Trace160 {\n Checkpoint160[] _checkpoints;\n }\n\n struct Checkpoint160 {\n uint96 _key;\n uint160 _value;\n }\n\n /**\n * @dev Pushes a (`key`, `value`) pair into a Trace160 so that it is stored as the checkpoint.\n *\n * Returns previous value and new value.\n *\n * IMPORTANT: Never accept `key` as a user input, since an arbitrary `type(uint96).max` key set will disable the\n * library.\n */\n function push(\n Trace160 storage self,\n uint96 key,\n uint160 value\n ) internal returns (uint160 oldValue, uint160 newValue) {\n return _insert(self._checkpoints, key, value);\n }\n\n /**\n * @dev Returns the value in the first (oldest) checkpoint with key greater or equal than the search key, or zero if\n * there is none.\n */\n function lowerLookup(Trace160 storage self, uint96 key) internal view returns (uint160) {\n uint256 len = self._checkpoints.length;\n uint256 pos = _lowerBinaryLookup(self._checkpoints, key, 0, len);\n return pos == len ? 0 : _unsafeAccess(self._checkpoints, pos)._value;\n }\n\n /**\n * @dev Returns the value in the last (most recent) checkpoint with key lower or equal than the search key, or zero\n * if there is none.\n */\n function upperLookup(Trace160 storage self, uint96 key) internal view returns (uint160) {\n uint256 len = self._checkpoints.length;\n uint256 pos = _upperBinaryLookup(self._checkpoints, key, 0, len);\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\n }\n\n /**\n * @dev Returns the value in the last (most recent) checkpoint with key lower or equal than the search key, or zero\n * if there is none.\n *\n * NOTE: This is a variant of {upperLookup} that is optimised to find \"recent\" checkpoint (checkpoints with high\n * keys).\n */\n function upperLookupRecent(Trace160 storage self, uint96 key) internal view returns (uint160) {\n uint256 len = self._checkpoints.length;\n\n uint256 low = 0;\n uint256 high = len;\n\n if (len > 5) {\n uint256 mid = len - Math.sqrt(len);\n if (key < _unsafeAccess(self._checkpoints, mid)._key) {\n high = mid;\n } else {\n low = mid + 1;\n }\n }\n\n uint256 pos = _upperBinaryLookup(self._checkpoints, key, low, high);\n\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\n }\n\n /**\n * @dev Returns the value in the most recent checkpoint, or zero if there are no checkpoints.\n */\n function latest(Trace160 storage self) internal view returns (uint160) {\n uint256 pos = self._checkpoints.length;\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\n }\n\n /**\n * @dev Returns whether there is a checkpoint in the structure (i.e. it is not empty), and if so the key and value\n * in the most recent checkpoint.\n */\n function latestCheckpoint(Trace160 storage self) internal view returns (bool exists, uint96 _key, uint160 _value) {\n uint256 pos = self._checkpoints.length;\n if (pos == 0) {\n return (false, 0, 0);\n } else {\n Checkpoint160 storage ckpt = _unsafeAccess(self._checkpoints, pos - 1);\n return (true, ckpt._key, ckpt._value);\n }\n }\n\n /**\n * @dev Returns the number of checkpoint.\n */\n function length(Trace160 storage self) internal view returns (uint256) {\n return self._checkpoints.length;\n }\n\n /**\n * @dev Returns checkpoint at given position.\n */\n function at(Trace160 storage self, uint32 pos) internal view returns (Checkpoint160 memory) {\n return self._checkpoints[pos];\n }\n\n /**\n * @dev Pushes a (`key`, `value`) pair into an ordered list of checkpoints, either by inserting a new checkpoint,\n * or by updating the last one.\n */\n function _insert(\n Checkpoint160[] storage self,\n uint96 key,\n uint160 value\n ) private returns (uint160 oldValue, uint160 newValue) {\n uint256 pos = self.length;\n\n if (pos > 0) {\n Checkpoint160 storage last = _unsafeAccess(self, pos - 1);\n uint96 lastKey = last._key;\n uint160 lastValue = last._value;\n\n // Checkpoint keys must be non-decreasing.\n if (lastKey > key) {\n revert CheckpointUnorderedInsertion();\n }\n\n // Update or push new checkpoint\n if (lastKey == key) {\n last._value = value;\n } else {\n self.push(Checkpoint160({_key: key, _value: value}));\n }\n return (lastValue, value);\n } else {\n self.push(Checkpoint160({_key: key, _value: value}));\n return (0, value);\n }\n }\n\n /**\n * @dev Return the index of the first (oldest) checkpoint with key strictly bigger than the search key, or `high`\n * if there is none. `low` and `high` define a section where to do the search, with inclusive `low` and exclusive\n * `high`.\n *\n * WARNING: `high` should not be greater than the array's length.\n */\n function _upperBinaryLookup(\n Checkpoint160[] storage self,\n uint96 key,\n uint256 low,\n uint256 high\n ) private view returns (uint256) {\n while (low < high) {\n uint256 mid = Math.average(low, high);\n if (_unsafeAccess(self, mid)._key > key) {\n high = mid;\n } else {\n low = mid + 1;\n }\n }\n return high;\n }\n\n /**\n * @dev Return the index of the first (oldest) checkpoint with key greater or equal than the search key, or `high`\n * if there is none. `low` and `high` define a section where to do the search, with inclusive `low` and exclusive\n * `high`.\n *\n * WARNING: `high` should not be greater than the array's length.\n */\n function _lowerBinaryLookup(\n Checkpoint160[] storage self,\n uint96 key,\n uint256 low,\n uint256 high\n ) private view returns (uint256) {\n while (low < high) {\n uint256 mid = Math.average(low, high);\n if (_unsafeAccess(self, mid)._key < key) {\n low = mid + 1;\n } else {\n high = mid;\n }\n }\n return high;\n }\n\n /**\n * @dev Access an element of the array without performing bounds check. The position is assumed to be within bounds.\n */\n function _unsafeAccess(\n Checkpoint160[] storage self,\n uint256 pos\n ) private pure returns (Checkpoint160 storage result) {\n assembly {\n mstore(0, self.slot)\n result.slot := add(keccak256(0, 0x20), pos)\n }\n }\n}\n" + }, + "@openzeppelin/contracts/utils/types/Time.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/types/Time.sol)\n\npragma solidity ^0.8.20;\n\nimport {Math} from \"../math/Math.sol\";\nimport {SafeCast} from \"../math/SafeCast.sol\";\n\n/**\n * @dev This library provides helpers for manipulating time-related objects.\n *\n * It uses the following types:\n * - `uint48` for timepoints\n * - `uint32` for durations\n *\n * While the library doesn't provide specific types for timepoints and duration, it does provide:\n * - a `Delay` type to represent duration that can be programmed to change value automatically at a given point\n * - additional helper functions\n */\nlibrary Time {\n using Time for *;\n\n /**\n * @dev Get the block timestamp as a Timepoint.\n */\n function timestamp() internal view returns (uint48) {\n return SafeCast.toUint48(block.timestamp);\n }\n\n /**\n * @dev Get the block number as a Timepoint.\n */\n function blockNumber() internal view returns (uint48) {\n return SafeCast.toUint48(block.number);\n }\n\n // ==================================================== Delay =====================================================\n /**\n * @dev A `Delay` is a uint32 duration that can be programmed to change value automatically at a given point in the\n * future. The \"effect\" timepoint describes when the transitions happens from the \"old\" value to the \"new\" value.\n * This allows updating the delay applied to some operation while keeping some guarantees.\n *\n * In particular, the {update} function guarantees that if the delay is reduced, the old delay still applies for\n * some time. For example if the delay is currently 7 days to do an upgrade, the admin should not be able to set\n * the delay to 0 and upgrade immediately. If the admin wants to reduce the delay, the old delay (7 days) should\n * still apply for some time.\n *\n *\n * The `Delay` type is 112 bits long, and packs the following:\n *\n * ```\n * | [uint48]: effect date (timepoint)\n * | | [uint32]: value before (duration)\n * ↓ ↓ ↓ [uint32]: value after (duration)\n * 0xAAAAAAAAAAAABBBBBBBBCCCCCCCC\n * ```\n *\n * NOTE: The {get} and {withUpdate} functions operate using timestamps. Block number based delays are not currently\n * supported.\n */\n type Delay is uint112;\n\n /**\n * @dev Wrap a duration into a Delay to add the one-step \"update in the future\" feature\n */\n function toDelay(uint32 duration) internal pure returns (Delay) {\n return Delay.wrap(duration);\n }\n\n /**\n * @dev Get the value at a given timepoint plus the pending value and effect timepoint if there is a scheduled\n * change after this timepoint. If the effect timepoint is 0, then the pending value should not be considered.\n */\n function _getFullAt(\n Delay self,\n uint48 timepoint\n ) private pure returns (uint32 valueBefore, uint32 valueAfter, uint48 effect) {\n (valueBefore, valueAfter, effect) = self.unpack();\n return effect <= timepoint ? (valueAfter, 0, 0) : (valueBefore, valueAfter, effect);\n }\n\n /**\n * @dev Get the current value plus the pending value and effect timepoint if there is a scheduled change. If the\n * effect timepoint is 0, then the pending value should not be considered.\n */\n function getFull(Delay self) internal view returns (uint32 valueBefore, uint32 valueAfter, uint48 effect) {\n return _getFullAt(self, timestamp());\n }\n\n /**\n * @dev Get the current value.\n */\n function get(Delay self) internal view returns (uint32) {\n (uint32 delay, , ) = self.getFull();\n return delay;\n }\n\n /**\n * @dev Update a Delay object so that it takes a new duration after a timepoint that is automatically computed to\n * enforce the old delay at the moment of the update. Returns the updated Delay object and the timestamp when the\n * new delay becomes effective.\n */\n function withUpdate(\n Delay self,\n uint32 newValue,\n uint32 minSetback\n ) internal view returns (Delay updatedDelay, uint48 effect) {\n uint32 value = self.get();\n uint32 setback = uint32(Math.max(minSetback, value > newValue ? value - newValue : 0));\n effect = timestamp() + setback;\n return (pack(value, newValue, effect), effect);\n }\n\n /**\n * @dev Split a delay into its components: valueBefore, valueAfter and effect (transition timepoint).\n */\n function unpack(Delay self) internal pure returns (uint32 valueBefore, uint32 valueAfter, uint48 effect) {\n uint112 raw = Delay.unwrap(self);\n\n valueAfter = uint32(raw);\n valueBefore = uint32(raw >> 32);\n effect = uint48(raw >> 64);\n\n return (valueBefore, valueAfter, effect);\n }\n\n /**\n * @dev pack the components into a Delay object.\n */\n function pack(uint32 valueBefore, uint32 valueAfter, uint48 effect) internal pure returns (Delay) {\n return Delay.wrap((uint112(effect) << 64) | (uint112(valueBefore) << 32) | uint112(valueAfter));\n }\n}\n" + }, + "contracts/variants/crosschain/NFT.sol": { + "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity ^0.8.20;\n\nimport \"@openzeppelin/contracts/token/ERC721/ERC721.sol\";\nimport \"@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol\";\nimport \"@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol\";\nimport \"@openzeppelin/contracts/token/ERC721/extensions/ERC721Burnable.sol\";\nimport \"@openzeppelin/contracts/access/Ownable.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/EIP712.sol\";\nimport \"@openzeppelin/contracts/token/ERC721/extensions/ERC721Votes.sol\";\nimport \"./ProofHandler.sol\";\n\n/**\n * @title Cross-chain Membership NFT Contract\n * @author Web3 Hackers Collective\n * @notice Non-transferable NFT implementation for DAO membership with cross-chain capabilities\n * @dev Extends OpenZeppelin's NFT standards with cross-chain operation support and delegation\n * @custom:security-contact julien@strat.cc\n */\ncontract NFT is\n ERC721,\n ERC721Enumerable,\n ERC721URIStorage,\n ERC721Burnable,\n Ownable,\n EIP712,\n ERC721Votes\n{\n using ProofHandler for ProofHandler.ProofStorage;\n\n /// @notice Chain ID where contract was originally deployed\n uint256 public immutable home;\n\n /// @notice Next token ID to be minted\n uint256 private _nextTokenId;\n\n /// @notice Storage for proof handling\n ProofHandler.ProofStorage private _proofStorage;\n\n /// @notice Types of operations that can be synchronized across chains\n enum OperationType {\n MINT,\n BURN,\n SET_METADATA,\n DELEGATE\n }\n\n /// @notice Emitted when a membership is claimed\n /// @param tokenId The ID of the claimed token\n /// @param member The address receiving the membership\n /// @param nonce Operation sequence number\n event MembershipClaimed(uint256 indexed tokenId, address indexed member, uint256 nonce);\n\n /// @notice Emitted when a membership is revoked\n /// @param tokenId The ID of the revoked token\n /// @param member The address losing membership\n /// @param nonce Operation sequence number\n event MembershipRevoked(uint256 indexed tokenId, address indexed member, uint256 nonce);\n\n /// @notice Emitted when metadata is updated\n /// @param tokenId The ID of the updated token\n /// @param newUri The new metadata URI\n /// @param nonce Operation sequence number\n event MetadataUpdated(uint256 indexed tokenId, string newUri, uint256 nonce);\n\n /// @notice Emitted when delegation is synchronized across chains\n /// @param delegator The address delegating their voting power\n /// @param delegatee The address receiving the delegation\n /// @param nonce Operation sequence number\n event DelegationSynced(address indexed delegator, address indexed delegatee, uint256 nonce);\n\n /// @notice Restricts functions to home chain\n modifier onlyHomeChain() {\n require(block.chainid == home, \"Operation only allowed on home chain\");\n _;\n }\n\n /**\n * @notice Initializes the NFT contract\n * @param _home Chain ID where contract is considered home\n * @param initialOwner Initial contract owner\n * @param _firstMembers Array of initial member addresses\n * @param _uri Initial token URI\n * @param _name Token collection name\n * @param _symbol Token collection symbol\n */\n constructor(\n uint256 _home,\n address initialOwner,\n address[] memory _firstMembers,\n string memory _uri,\n string memory _name,\n string memory _symbol\n ) ERC721(_name, _symbol) Ownable(initialOwner) EIP712(_name, \"1\") {\n home = _home;\n for (uint i; i < _firstMembers.length; i++) {\n _govMint(_firstMembers[i], _uri);\n _delegate(_firstMembers[i], _firstMembers[i]);\n }\n }\n\n /**\n * @notice Adds a new member on home chain\n * @dev Only callable by owner (governance) on home chain\n * @param to Address to mint token to\n * @param uri Token metadata URI\n */\n function safeMint(address to, string memory uri) public onlyOwner onlyHomeChain {\n uint256 nonce = _proofStorage.incrementNonce(uint8(OperationType.MINT));\n _govMint(to, uri);\n emit MembershipClaimed(_nextTokenId - 1, to, nonce);\n }\n\n /**\n * @notice Burns token on home chain\n * @dev Only callable by owner (governance) on home chain\n * @param tokenId ID of token to burn\n */\n function govBurn(uint256 tokenId) public onlyOwner onlyHomeChain {\n uint256 nonce = _proofStorage.incrementNonce(uint8(OperationType.BURN));\n address owner = ownerOf(tokenId);\n _burn(tokenId);\n emit MembershipRevoked(tokenId, owner, nonce);\n }\n\n /**\n * @notice Updates token metadata on home chain\n * @dev Only callable by owner (governance) on home chain\n * @param tokenId ID of token to update\n * @param uri New metadata URI\n */\n function setMetadata(uint256 tokenId, string memory uri) public onlyOwner onlyHomeChain {\n uint256 nonce = _proofStorage.incrementNonce(uint8(OperationType.SET_METADATA));\n _setTokenURI(tokenId, uri);\n emit MetadataUpdated(tokenId, uri, nonce);\n }\n\n /**\n * @notice Delegates voting power to another address on home chain\n * @dev Overrides ERC721Votes delegate function to add cross-chain functionality\n * @param delegatee Address to delegate voting power to\n */\n function delegate(address delegatee) public virtual override onlyHomeChain {\n uint256 nonce = _proofStorage.incrementNonce(uint8(OperationType.DELEGATE));\n _delegate(_msgSender(), delegatee);\n emit DelegationSynced(_msgSender(), delegatee, nonce);\n }\n\n /**\n * @notice Generates proof for NFT operations\n * @dev Only callable on home chain\n * @param operationType Type of operation\n * @param params Operation parameters\n * @return Encoded proof data\n */\n function generateOperationProof(\n uint8 operationType,\n bytes memory params\n ) external view returns (bytes memory) {\n require(block.chainid == home, \"Proofs only generated on home chain\");\n uint256 nextNonce = _proofStorage.getNextNonce(operationType);\n return ProofHandler.generateProof(address(this), operationType, params, nextNonce);\n }\n\n /**\n * @notice Generates proof for delegation\n * @dev Only callable on home chain\n * @param delegator Address delegating voting power\n * @param delegatee Address receiving delegation\n * @return Encoded proof data\n */\n function generateDelegationProof(\n address delegator,\n address delegatee\n ) external view returns (bytes memory) {\n require(block.chainid == home, \"Proofs only generated on home chain\");\n uint256 nextNonce = _proofStorage.getNextNonce(uint8(OperationType.DELEGATE));\n bytes memory params = abi.encode(delegator, delegatee);\n return\n ProofHandler.generateProof(\n address(this),\n uint8(OperationType.DELEGATE),\n params,\n nextNonce\n );\n }\n\n // Claim operations\n\n /**\n * @notice Claims an NFT operation on a foreign chain\n * @param proof Proof generated by home chain\n */\n function claimOperation(bytes memory proof) external {\n (uint8 operationType, bytes memory params, uint256 nonce) = ProofHandler\n .verifyAndClaimProof(proof, address(this), _proofStorage);\n\n if (operationType == uint8(OperationType.MINT)) {\n (address to, string memory uri) = abi.decode(params, (address, string));\n _govMint(to, uri);\n emit MembershipClaimed(_nextTokenId - 1, to, nonce);\n } else if (operationType == uint8(OperationType.BURN)) {\n uint256 tokenId = abi.decode(params, (uint256));\n address owner = ownerOf(tokenId);\n _burn(tokenId);\n emit MembershipRevoked(tokenId, owner, nonce);\n } else if (operationType == uint8(OperationType.SET_METADATA)) {\n (uint256 tokenId, string memory uri) = abi.decode(params, (uint256, string));\n _setTokenURI(tokenId, uri);\n emit MetadataUpdated(tokenId, uri, nonce);\n } else if (operationType == uint8(OperationType.DELEGATE)) {\n (address delegator, address delegatee) = abi.decode(params, (address, address));\n _delegate(delegator, delegatee);\n emit DelegationSynced(delegator, delegatee, nonce);\n }\n }\n\n /**\n * @notice Claims a delegation operation on a foreign chain\n * @param proof Proof generated by home chain\n */\n function claimDelegation(bytes memory proof) external {\n (uint8 operationType, bytes memory params, uint256 nonce) = ProofHandler\n .verifyAndClaimProof(proof, address(this), _proofStorage);\n\n require(operationType == uint8(OperationType.DELEGATE), \"Invalid operation type\");\n (address delegator, address delegatee) = abi.decode(params, (address, address));\n\n _delegate(delegator, delegatee);\n emit DelegationSynced(delegator, delegatee, nonce);\n }\n\n /**\n * @notice Internal function for minting without proof verification\n * @param to Address to receive token\n * @param uri Token metadata URI\n */\n function _govMint(address to, string memory uri) internal {\n uint256 tokenId = _nextTokenId++;\n _safeMint(to, tokenId);\n _setTokenURI(tokenId, uri);\n _delegate(to, to);\n }\n\n // Required overrides\n\n /**\n * @notice Updates token data\n * @dev Overrides ERC721 _update to make NFTs non-transferable\n * @param to Recipient address\n * @param tokenId Token ID\n * @param auth Address authorized for transfer\n * @return Previous owner address\n */\n function _update(\n address to,\n uint256 tokenId,\n address auth\n ) internal override(ERC721, ERC721Enumerable, ERC721Votes) returns (address) {\n require(auth == address(0) || to == address(0), \"NFT is not transferable\");\n return super._update(to, tokenId, auth);\n }\n\n /**\n * @notice Increments account balance\n * @dev Internal override to maintain compatibility\n * @param account Account to update\n * @param value Amount to increase by\n */\n function _increaseBalance(\n address account,\n uint128 value\n ) internal override(ERC721, ERC721Enumerable, ERC721Votes) {\n super._increaseBalance(account, value);\n }\n\n /**\n * @notice Gets token URI\n * @param tokenId Token ID to query\n * @return URI string\n */\n function tokenURI(\n uint256 tokenId\n ) public view override(ERC721, ERC721URIStorage) returns (string memory) {\n return super.tokenURI(tokenId);\n }\n\n /**\n * @notice Checks interface support\n * @param interfaceId Interface identifier to check\n * @return bool True if interface is supported\n */\n function supportsInterface(\n bytes4 interfaceId\n ) public view override(ERC721, ERC721Enumerable, ERC721URIStorage) returns (bool) {\n return super.supportsInterface(interfaceId);\n }\n\n /**\n * @notice Gets current timestamp\n * @dev Used for voting snapshots\n * @return Current block timestamp\n */\n function clock() public view override returns (uint48) {\n return uint48(block.timestamp);\n }\n\n /**\n * @notice Gets clock mode description\n * @return String indicating timestamp-based voting\n */\n function CLOCK_MODE() public pure override returns (string memory) {\n return \"mode=timestamp\";\n }\n}\n" + }, + "contracts/variants/crosschain/ProofHandler.sol": { + "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity ^0.8.20;\n\n/**\n * @title Proof Handler Library\n * @author Web3 Hackers Collective\n * @notice Library for standardized cross-chain proof generation and verification\n * @dev Handles proof generation, verification, and tracking for cross-chain operations\n * @custom:security-contact julien@strat.cc\n */\nlibrary ProofHandler {\n /// @notice Tracks which proofs have been applied on each chain\n struct ProofStorage {\n mapping(bytes32 => bool) updateAppliedOnChain;\n mapping(uint8 => uint256) currentNonce;\n }\n\n /// @dev Emitted when a proof is claimed\n event ProofClaimed(uint8 indexed operationType, bytes params, uint256 nonce);\n\n /**\n * @notice Generates a proof for cross-chain operations\n * @param contractAddress Address of contract generating the proof\n * @param operationType Type of operation being performed\n * @param params Operation parameters\n * @param nonce Current nonce for this operation type\n * @return proof Encoded proof data\n */\n function generateProof(\n address contractAddress,\n uint8 operationType,\n bytes memory params,\n uint256 nonce\n ) public pure returns (bytes memory proof) {\n bytes32 message = keccak256(\n abi.encodePacked(contractAddress, operationType, params, nonce)\n );\n bytes32 digest = keccak256(abi.encodePacked(\"\\x19Ethereum Signed Message:\\n32\", message));\n\n return abi.encode(operationType, params, nonce, digest);\n }\n\n /**\n * @notice Verifies and claims a proof\n * @param proof Proof to verify and claim\n * @param contractAddress Address of contract claiming the proof\n * @param storage_ Proof storage struct\n * @return operationType The type of operation being performed\n * @return params The operation parameters\n * @return nonce The operation sequence number\n */\n function verifyAndClaimProof(\n bytes memory proof,\n address contractAddress,\n ProofStorage storage storage_\n ) public returns (uint8 operationType, bytes memory params, uint256 nonce) {\n bytes32 digest;\n (operationType, params, nonce, digest) = abi.decode(\n proof,\n (uint8, bytes, uint256, bytes32)\n );\n\n bytes32 proofHash = keccak256(proof);\n require(!storage_.updateAppliedOnChain[proofHash], \"Proof already claimed\");\n require(nonce == storage_.currentNonce[operationType] + 1, \"Invalid nonce\");\n\n bytes32 message = keccak256(\n abi.encodePacked(contractAddress, operationType, params, nonce)\n );\n bytes32 expectedDigest = keccak256(\n abi.encodePacked(\"\\x19Ethereum Signed Message:\\n32\", message)\n );\n require(digest == expectedDigest, \"Invalid proof\");\n\n storage_.updateAppliedOnChain[proofHash] = true;\n storage_.currentNonce[operationType] = nonce;\n\n emit ProofClaimed(operationType, params, nonce);\n\n return (operationType, params, nonce);\n }\n\n /**\n * @notice Gets the next nonce for an operation type\n * @param storage_ Proof storage struct\n * @param operationType Type of operation\n * @return nonce Next nonce value\n */\n function getNextNonce(\n ProofStorage storage storage_,\n uint8 operationType\n ) public view returns (uint256 nonce) {\n return storage_.currentNonce[operationType] + 1;\n }\n\n /**\n * @notice Increments the nonce for an operation type\n * @param storage_ Proof storage struct\n * @param operationType Type of operation\n * @return nonce New nonce value\n */\n function incrementNonce(\n ProofStorage storage storage_,\n uint8 operationType\n ) public returns (uint256 nonce) {\n storage_.currentNonce[operationType]++;\n return storage_.currentNonce[operationType];\n }\n}\n" + } + }, + "settings": { + "optimizer": { + "enabled": true, + "runs": 200 + }, + "evmVersion": "paris", + "outputSelection": { + "*": { + "*": [ + "abi", + "evm.bytecode", + "evm.deployedBytecode", + "evm.methodIdentifiers", + "metadata", + "devdoc", + "userdoc", + "storageLayout", + "evm.gasEstimates" + ], + "": [ + "ast" + ] + } + }, + "metadata": { + "useLiteralContent": true + } + } +} \ No newline at end of file diff --git a/deployments/op-sepolia/CrosschainGov.json b/deployments/op-sepolia/CrosschainGov.json deleted file mode 100644 index 9a69212..0000000 --- a/deployments/op-sepolia/CrosschainGov.json +++ /dev/null @@ -1,2584 +0,0 @@ -{ - "address": "0xB8de4177BAf7365DFc7E6ad860E4B223b40f91A0", - "abi": [ - { - "inputs": [ - { - "internalType": "uint256", - "name": "_home", - "type": "uint256" - }, - { - "internalType": "contract IVotes", - "name": "_token", - "type": "address" - }, - { - "internalType": "string", - "name": "_manifestoCid", - "type": "string" - }, - { - "internalType": "string", - "name": "_name", - "type": "string" - }, - { - "internalType": "uint48", - "name": "_votingDelay", - "type": "uint48" - }, - { - "internalType": "uint32", - "name": "_votingPeriod", - "type": "uint32" - }, - { - "internalType": "uint256", - "name": "_proposalThreshold", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_quorum", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "inputs": [], - "name": "CheckpointUnorderedInsertion", - "type": "error" - }, - { - "inputs": [], - "name": "FailedCall", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "voter", - "type": "address" - } - ], - "name": "GovernorAlreadyCastVote", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "proposalId", - "type": "uint256" - } - ], - "name": "GovernorAlreadyQueuedProposal", - "type": "error" - }, - { - "inputs": [], - "name": "GovernorDisabledDeposit", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "proposer", - "type": "address" - }, - { - "internalType": "uint256", - "name": "votes", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "threshold", - "type": "uint256" - } - ], - "name": "GovernorInsufficientProposerVotes", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "targets", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "calldatas", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "values", - "type": "uint256" - } - ], - "name": "GovernorInvalidProposalLength", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "quorumNumerator", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "quorumDenominator", - "type": "uint256" - } - ], - "name": "GovernorInvalidQuorumFraction", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "voter", - "type": "address" - } - ], - "name": "GovernorInvalidSignature", - "type": "error" - }, - { - "inputs": [], - "name": "GovernorInvalidVoteParams", - "type": "error" - }, - { - "inputs": [], - "name": "GovernorInvalidVoteType", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "votingPeriod", - "type": "uint256" - } - ], - "name": "GovernorInvalidVotingPeriod", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "proposalId", - "type": "uint256" - } - ], - "name": "GovernorNonexistentProposal", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "proposalId", - "type": "uint256" - } - ], - "name": "GovernorNotQueuedProposal", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "GovernorOnlyExecutor", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "GovernorOnlyProposer", - "type": "error" - }, - { - "inputs": [], - "name": "GovernorQueueNotImplemented", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "proposer", - "type": "address" - } - ], - "name": "GovernorRestrictedProposer", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "proposalId", - "type": "uint256" - }, - { - "internalType": "enum IGovernor.ProposalState", - "name": "current", - "type": "uint8" - }, - { - "internalType": "bytes32", - "name": "expectedStates", - "type": "bytes32" - } - ], - "name": "GovernorUnexpectedProposalState", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "internalType": "uint256", - "name": "currentNonce", - "type": "uint256" - } - ], - "name": "InvalidAccountNonce", - "type": "error" - }, - { - "inputs": [], - "name": "InvalidShortString", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint8", - "name": "bits", - "type": "uint8" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - } - ], - "name": "SafeCastOverflowedUintDowncast", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "str", - "type": "string" - } - ], - "name": "StringTooLong", - "type": "error" - }, - { - "anonymous": false, - "inputs": [], - "name": "EIP712DomainChanged", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "enum Gov.OperationType", - "name": "operationType", - "type": "uint8" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "oldValue", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "newValue", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "nonce", - "type": "uint256" - } - ], - "name": "GovernanceParameterUpdated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "string", - "name": "oldManifesto", - "type": "string" - }, - { - "indexed": false, - "internalType": "string", - "name": "newManifesto", - "type": "string" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "nonce", - "type": "uint256" - } - ], - "name": "ManifestoUpdated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "proposalId", - "type": "uint256" - } - ], - "name": "ProposalCanceled", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "proposalId", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "address", - "name": "proposer", - "type": "address" - }, - { - "indexed": false, - "internalType": "address[]", - "name": "targets", - "type": "address[]" - }, - { - "indexed": false, - "internalType": "uint256[]", - "name": "values", - "type": "uint256[]" - }, - { - "indexed": false, - "internalType": "string[]", - "name": "signatures", - "type": "string[]" - }, - { - "indexed": false, - "internalType": "bytes[]", - "name": "calldatas", - "type": "bytes[]" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "voteStart", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "voteEnd", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "string", - "name": "description", - "type": "string" - } - ], - "name": "ProposalCreated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "proposalId", - "type": "uint256" - } - ], - "name": "ProposalExecuted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "proposalId", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "etaSeconds", - "type": "uint256" - } - ], - "name": "ProposalQueued", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "oldProposalThreshold", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "newProposalThreshold", - "type": "uint256" - } - ], - "name": "ProposalThresholdSet", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "oldQuorumNumerator", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "newQuorumNumerator", - "type": "uint256" - } - ], - "name": "QuorumNumeratorUpdated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "voter", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "proposalId", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint8", - "name": "support", - "type": "uint8" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "weight", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "string", - "name": "reason", - "type": "string" - } - ], - "name": "VoteCast", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "voter", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "proposalId", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint8", - "name": "support", - "type": "uint8" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "weight", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "string", - "name": "reason", - "type": "string" - }, - { - "indexed": false, - "internalType": "bytes", - "name": "params", - "type": "bytes" - } - ], - "name": "VoteCastWithParams", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "oldVotingDelay", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "newVotingDelay", - "type": "uint256" - } - ], - "name": "VotingDelaySet", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "oldVotingPeriod", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "newVotingPeriod", - "type": "uint256" - } - ], - "name": "VotingPeriodSet", - "type": "event" - }, - { - "inputs": [], - "name": "BALLOT_TYPEHASH", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "CLOCK_MODE", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "COUNTING_MODE", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "pure", - "type": "function" - }, - { - "inputs": [], - "name": "EXTENDED_BALLOT_TYPEHASH", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address[]", - "name": "targets", - "type": "address[]" - }, - { - "internalType": "uint256[]", - "name": "values", - "type": "uint256[]" - }, - { - "internalType": "bytes[]", - "name": "calldatas", - "type": "bytes[]" - }, - { - "internalType": "bytes32", - "name": "descriptionHash", - "type": "bytes32" - } - ], - "name": "cancel", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "proposalId", - "type": "uint256" - }, - { - "internalType": "uint8", - "name": "support", - "type": "uint8" - } - ], - "name": "castVote", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "proposalId", - "type": "uint256" - }, - { - "internalType": "uint8", - "name": "support", - "type": "uint8" - }, - { - "internalType": "address", - "name": "voter", - "type": "address" - }, - { - "internalType": "bytes", - "name": "signature", - "type": "bytes" - } - ], - "name": "castVoteBySig", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "proposalId", - "type": "uint256" - }, - { - "internalType": "uint8", - "name": "support", - "type": "uint8" - }, - { - "internalType": "string", - "name": "reason", - "type": "string" - } - ], - "name": "castVoteWithReason", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "proposalId", - "type": "uint256" - }, - { - "internalType": "uint8", - "name": "support", - "type": "uint8" - }, - { - "internalType": "string", - "name": "reason", - "type": "string" - }, - { - "internalType": "bytes", - "name": "params", - "type": "bytes" - } - ], - "name": "castVoteWithReasonAndParams", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "proposalId", - "type": "uint256" - }, - { - "internalType": "uint8", - "name": "support", - "type": "uint8" - }, - { - "internalType": "address", - "name": "voter", - "type": "address" - }, - { - "internalType": "string", - "name": "reason", - "type": "string" - }, - { - "internalType": "bytes", - "name": "params", - "type": "bytes" - }, - { - "internalType": "bytes", - "name": "signature", - "type": "bytes" - } - ], - "name": "castVoteWithReasonAndParamsBySig", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes", - "name": "proof", - "type": "bytes" - } - ], - "name": "claimParameterUpdate", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "clock", - "outputs": [ - { - "internalType": "uint48", - "name": "", - "type": "uint48" - } - ], - "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": [ - { - "internalType": "address[]", - "name": "targets", - "type": "address[]" - }, - { - "internalType": "uint256[]", - "name": "values", - "type": "uint256[]" - }, - { - "internalType": "bytes[]", - "name": "calldatas", - "type": "bytes[]" - }, - { - "internalType": "bytes32", - "name": "descriptionHash", - "type": "bytes32" - } - ], - "name": "execute", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint8", - "name": "operationType", - "type": "uint8" - }, - { - "internalType": "bytes", - "name": "value", - "type": "bytes" - } - ], - "name": "generateParameterProof", - "outputs": [ - { - "internalType": "bytes", - "name": "proof", - "type": "bytes" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "internalType": "uint256", - "name": "timepoint", - "type": "uint256" - } - ], - "name": "getVotes", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "internalType": "uint256", - "name": "timepoint", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "params", - "type": "bytes" - } - ], - "name": "getVotesWithParams", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "proposalId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "hasVoted", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address[]", - "name": "targets", - "type": "address[]" - }, - { - "internalType": "uint256[]", - "name": "values", - "type": "uint256[]" - }, - { - "internalType": "bytes[]", - "name": "calldatas", - "type": "bytes[]" - }, - { - "internalType": "bytes32", - "name": "descriptionHash", - "type": "bytes32" - } - ], - "name": "hashProposal", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "pure", - "type": "function" - }, - { - "inputs": [], - "name": "home", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "manifesto", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "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": "", - "type": "address" - }, - { - "internalType": "address", - "name": "", - "type": "address" - }, - { - "internalType": "uint256[]", - "name": "", - "type": "uint256[]" - }, - { - "internalType": "uint256[]", - "name": "", - "type": "uint256[]" - }, - { - "internalType": "bytes", - "name": "", - "type": "bytes" - } - ], - "name": "onERC1155BatchReceived", - "outputs": [ - { - "internalType": "bytes4", - "name": "", - "type": "bytes4" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - }, - { - "internalType": "address", - "name": "", - "type": "address" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "", - "type": "bytes" - } - ], - "name": "onERC1155Received", - "outputs": [ - { - "internalType": "bytes4", - "name": "", - "type": "bytes4" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - }, - { - "internalType": "address", - "name": "", - "type": "address" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "", - "type": "bytes" - } - ], - "name": "onERC721Received", - "outputs": [ - { - "internalType": "bytes4", - "name": "", - "type": "bytes4" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "proposalId", - "type": "uint256" - } - ], - "name": "proposalDeadline", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "proposalId", - "type": "uint256" - } - ], - "name": "proposalEta", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "name": "proposalNeedsQueuing", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "proposalId", - "type": "uint256" - } - ], - "name": "proposalProposer", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "proposalId", - "type": "uint256" - } - ], - "name": "proposalSnapshot", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "proposalThreshold", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "proposalId", - "type": "uint256" - } - ], - "name": "proposalVotes", - "outputs": [ - { - "internalType": "uint256", - "name": "againstVotes", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "forVotes", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "abstainVotes", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address[]", - "name": "targets", - "type": "address[]" - }, - { - "internalType": "uint256[]", - "name": "values", - "type": "uint256[]" - }, - { - "internalType": "bytes[]", - "name": "calldatas", - "type": "bytes[]" - }, - { - "internalType": "string", - "name": "description", - "type": "string" - } - ], - "name": "propose", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address[]", - "name": "targets", - "type": "address[]" - }, - { - "internalType": "uint256[]", - "name": "values", - "type": "uint256[]" - }, - { - "internalType": "bytes[]", - "name": "calldatas", - "type": "bytes[]" - }, - { - "internalType": "bytes32", - "name": "descriptionHash", - "type": "bytes32" - } - ], - "name": "queue", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "blockNumber", - "type": "uint256" - } - ], - "name": "quorum", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "quorumDenominator", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "timepoint", - "type": "uint256" - } - ], - "name": "quorumNumerator", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "quorumNumerator", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "target", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "name": "relay", - "outputs": [], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "newManifesto", - "type": "string" - } - ], - "name": "setManifesto", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "newProposalThreshold", - "type": "uint256" - } - ], - "name": "setProposalThreshold", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint48", - "name": "newVotingDelay", - "type": "uint48" - } - ], - "name": "setVotingDelay", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint32", - "name": "newVotingPeriod", - "type": "uint32" - } - ], - "name": "setVotingPeriod", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "proposalId", - "type": "uint256" - } - ], - "name": "state", - "outputs": [ - { - "internalType": "enum IGovernor.ProposalState", - "name": "", - "type": "uint8" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes4", - "name": "interfaceId", - "type": "bytes4" - } - ], - "name": "supportsInterface", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "token", - "outputs": [ - { - "internalType": "contract IERC5805", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "newQuorumNumerator", - "type": "uint256" - } - ], - "name": "updateQuorumNumerator", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "version", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "votingDelay", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "votingPeriod", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "stateMutability": "payable", - "type": "receive" - } - ], - "transactionHash": "0x00980d29e2ed7f0054521e302fa4fb7cf1de9da6a0aefa8901071480f0181cd6", - "receipt": { - "to": "0x4e59b44847b379578588920cA78FbF26c0B4956C", - "from": "0x27292E1a901E3E0bE7d144aDba4CAD07da2d8a42", - "contractAddress": null, - "transactionIndex": 4, - "gasUsed": "4474021", - "logsBloom": "0x00000400000000000100000000001000000000000000000000000000000008000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000080002000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000080000800000000000000000200000000000000000000000200000000000000000000000000000", - "blockHash": "0x7ea4bb9113a7961b107fcd347ac49b213c1f047f00c32b000284826536cc81ca", - "transactionHash": "0x00980d29e2ed7f0054521e302fa4fb7cf1de9da6a0aefa8901071480f0181cd6", - "logs": [ - { - "transactionIndex": 4, - "blockNumber": 20641670, - "transactionHash": "0x00980d29e2ed7f0054521e302fa4fb7cf1de9da6a0aefa8901071480f0181cd6", - "address": "0xB8de4177BAf7365DFc7E6ad860E4B223b40f91A0", - "topics": [ - "0xc565b045403dc03c2eea82b81a0465edad9e2e7fc4d97e11421c209da93d7a93" - ], - "data": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "logIndex": 21, - "blockHash": "0x7ea4bb9113a7961b107fcd347ac49b213c1f047f00c32b000284826536cc81ca" - }, - { - "transactionIndex": 4, - "blockNumber": 20641670, - "transactionHash": "0x00980d29e2ed7f0054521e302fa4fb7cf1de9da6a0aefa8901071480f0181cd6", - "address": "0xB8de4177BAf7365DFc7E6ad860E4B223b40f91A0", - "topics": [ - "0x7e3f7f0708a84de9203036abaa450dccc85ad5ff52f78c170f3edb55cf5e8828" - ], - "data": "0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c8", - "logIndex": 22, - "blockHash": "0x7ea4bb9113a7961b107fcd347ac49b213c1f047f00c32b000284826536cc81ca" - }, - { - "transactionIndex": 4, - "blockNumber": 20641670, - "transactionHash": "0x00980d29e2ed7f0054521e302fa4fb7cf1de9da6a0aefa8901071480f0181cd6", - "address": "0xB8de4177BAf7365DFc7E6ad860E4B223b40f91A0", - "topics": [ - "0xccb45da8d5717e6c4544694297c4ba5cf151d455c9bb0ed4fc7a38411bc05461" - ], - "data": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001", - "logIndex": 23, - "blockHash": "0x7ea4bb9113a7961b107fcd347ac49b213c1f047f00c32b000284826536cc81ca" - }, - { - "transactionIndex": 4, - "blockNumber": 20641670, - "transactionHash": "0x00980d29e2ed7f0054521e302fa4fb7cf1de9da6a0aefa8901071480f0181cd6", - "address": "0xB8de4177BAf7365DFc7E6ad860E4B223b40f91A0", - "topics": [ - "0x0553476bf02ef2726e8ce5ced78d63e26e602e4a2257b1f559418e24b4633997" - ], - "data": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005", - "logIndex": 24, - "blockHash": "0x7ea4bb9113a7961b107fcd347ac49b213c1f047f00c32b000284826536cc81ca" - } - ], - "blockNumber": 20641670, - "cumulativeGasUsed": "6088829", - "status": 1, - "byzantium": true - }, - "args": [ - 11155111, - "0xe74bC6A3Ee4ED824708DD88465BD2CdD6b869620", - "https://bafkreifnnreoxxgkhty7v2w3qwiie6cfxpv3vcco2xldekfvbiem3nm6dm.ipfs.w3s.link/", - "Test DAO", - 0, - 200, - 1, - 5 - ], - "numDeployments": 1, - "solcInputHash": "96a9008abeaccbd30a9b75989ce7f0fd", - "metadata": "{\"compiler\":{\"version\":\"0.8.20+commit.a1b79de6\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_home\",\"type\":\"uint256\"},{\"internalType\":\"contract IVotes\",\"name\":\"_token\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"_manifestoCid\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"_name\",\"type\":\"string\"},{\"internalType\":\"uint48\",\"name\":\"_votingDelay\",\"type\":\"uint48\"},{\"internalType\":\"uint32\",\"name\":\"_votingPeriod\",\"type\":\"uint32\"},{\"internalType\":\"uint256\",\"name\":\"_proposalThreshold\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_quorum\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"CheckpointUnorderedInsertion\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"FailedCall\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"voter\",\"type\":\"address\"}],\"name\":\"GovernorAlreadyCastVote\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"proposalId\",\"type\":\"uint256\"}],\"name\":\"GovernorAlreadyQueuedProposal\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"GovernorDisabledDeposit\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"proposer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"votes\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"threshold\",\"type\":\"uint256\"}],\"name\":\"GovernorInsufficientProposerVotes\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"targets\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"calldatas\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"values\",\"type\":\"uint256\"}],\"name\":\"GovernorInvalidProposalLength\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"quorumNumerator\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"quorumDenominator\",\"type\":\"uint256\"}],\"name\":\"GovernorInvalidQuorumFraction\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"voter\",\"type\":\"address\"}],\"name\":\"GovernorInvalidSignature\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"GovernorInvalidVoteParams\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"GovernorInvalidVoteType\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"votingPeriod\",\"type\":\"uint256\"}],\"name\":\"GovernorInvalidVotingPeriod\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"proposalId\",\"type\":\"uint256\"}],\"name\":\"GovernorNonexistentProposal\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"proposalId\",\"type\":\"uint256\"}],\"name\":\"GovernorNotQueuedProposal\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"GovernorOnlyExecutor\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"GovernorOnlyProposer\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"GovernorQueueNotImplemented\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"proposer\",\"type\":\"address\"}],\"name\":\"GovernorRestrictedProposer\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"proposalId\",\"type\":\"uint256\"},{\"internalType\":\"enum IGovernor.ProposalState\",\"name\":\"current\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"expectedStates\",\"type\":\"bytes32\"}],\"name\":\"GovernorUnexpectedProposalState\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"currentNonce\",\"type\":\"uint256\"}],\"name\":\"InvalidAccountNonce\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidShortString\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint8\",\"name\":\"bits\",\"type\":\"uint8\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"SafeCastOverflowedUintDowncast\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"str\",\"type\":\"string\"}],\"name\":\"StringTooLong\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[],\"name\":\"EIP712DomainChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"enum Gov.OperationType\",\"name\":\"operationType\",\"type\":\"uint8\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"oldValue\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newValue\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"}],\"name\":\"GovernanceParameterUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"string\",\"name\":\"oldManifesto\",\"type\":\"string\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"newManifesto\",\"type\":\"string\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"}],\"name\":\"ManifestoUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"proposalId\",\"type\":\"uint256\"}],\"name\":\"ProposalCanceled\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"proposalId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"proposer\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address[]\",\"name\":\"targets\",\"type\":\"address[]\"},{\"indexed\":false,\"internalType\":\"uint256[]\",\"name\":\"values\",\"type\":\"uint256[]\"},{\"indexed\":false,\"internalType\":\"string[]\",\"name\":\"signatures\",\"type\":\"string[]\"},{\"indexed\":false,\"internalType\":\"bytes[]\",\"name\":\"calldatas\",\"type\":\"bytes[]\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"voteStart\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"voteEnd\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"description\",\"type\":\"string\"}],\"name\":\"ProposalCreated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"proposalId\",\"type\":\"uint256\"}],\"name\":\"ProposalExecuted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"proposalId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"etaSeconds\",\"type\":\"uint256\"}],\"name\":\"ProposalQueued\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"oldProposalThreshold\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newProposalThreshold\",\"type\":\"uint256\"}],\"name\":\"ProposalThresholdSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"oldQuorumNumerator\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newQuorumNumerator\",\"type\":\"uint256\"}],\"name\":\"QuorumNumeratorUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"voter\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"proposalId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"support\",\"type\":\"uint8\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"weight\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"reason\",\"type\":\"string\"}],\"name\":\"VoteCast\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"voter\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"proposalId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"support\",\"type\":\"uint8\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"weight\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"reason\",\"type\":\"string\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"params\",\"type\":\"bytes\"}],\"name\":\"VoteCastWithParams\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"oldVotingDelay\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newVotingDelay\",\"type\":\"uint256\"}],\"name\":\"VotingDelaySet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"oldVotingPeriod\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newVotingPeriod\",\"type\":\"uint256\"}],\"name\":\"VotingPeriodSet\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"BALLOT_TYPEHASH\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"CLOCK_MODE\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"COUNTING_MODE\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"EXTENDED_BALLOT_TYPEHASH\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"targets\",\"type\":\"address[]\"},{\"internalType\":\"uint256[]\",\"name\":\"values\",\"type\":\"uint256[]\"},{\"internalType\":\"bytes[]\",\"name\":\"calldatas\",\"type\":\"bytes[]\"},{\"internalType\":\"bytes32\",\"name\":\"descriptionHash\",\"type\":\"bytes32\"}],\"name\":\"cancel\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"proposalId\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"support\",\"type\":\"uint8\"}],\"name\":\"castVote\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"proposalId\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"support\",\"type\":\"uint8\"},{\"internalType\":\"address\",\"name\":\"voter\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"signature\",\"type\":\"bytes\"}],\"name\":\"castVoteBySig\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"proposalId\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"support\",\"type\":\"uint8\"},{\"internalType\":\"string\",\"name\":\"reason\",\"type\":\"string\"}],\"name\":\"castVoteWithReason\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"proposalId\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"support\",\"type\":\"uint8\"},{\"internalType\":\"string\",\"name\":\"reason\",\"type\":\"string\"},{\"internalType\":\"bytes\",\"name\":\"params\",\"type\":\"bytes\"}],\"name\":\"castVoteWithReasonAndParams\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"proposalId\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"support\",\"type\":\"uint8\"},{\"internalType\":\"address\",\"name\":\"voter\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"reason\",\"type\":\"string\"},{\"internalType\":\"bytes\",\"name\":\"params\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"signature\",\"type\":\"bytes\"}],\"name\":\"castVoteWithReasonAndParamsBySig\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"proof\",\"type\":\"bytes\"}],\"name\":\"claimParameterUpdate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"clock\",\"outputs\":[{\"internalType\":\"uint48\",\"name\":\"\",\"type\":\"uint48\"}],\"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\":[{\"internalType\":\"address[]\",\"name\":\"targets\",\"type\":\"address[]\"},{\"internalType\":\"uint256[]\",\"name\":\"values\",\"type\":\"uint256[]\"},{\"internalType\":\"bytes[]\",\"name\":\"calldatas\",\"type\":\"bytes[]\"},{\"internalType\":\"bytes32\",\"name\":\"descriptionHash\",\"type\":\"bytes32\"}],\"name\":\"execute\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint8\",\"name\":\"operationType\",\"type\":\"uint8\"},{\"internalType\":\"bytes\",\"name\":\"value\",\"type\":\"bytes\"}],\"name\":\"generateParameterProof\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"proof\",\"type\":\"bytes\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"timepoint\",\"type\":\"uint256\"}],\"name\":\"getVotes\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"timepoint\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"params\",\"type\":\"bytes\"}],\"name\":\"getVotesWithParams\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"proposalId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"hasVoted\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"targets\",\"type\":\"address[]\"},{\"internalType\":\"uint256[]\",\"name\":\"values\",\"type\":\"uint256[]\"},{\"internalType\":\"bytes[]\",\"name\":\"calldatas\",\"type\":\"bytes[]\"},{\"internalType\":\"bytes32\",\"name\":\"descriptionHash\",\"type\":\"bytes32\"}],\"name\":\"hashProposal\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"home\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"manifesto\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"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\":\"\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"uint256[]\",\"name\":\"\",\"type\":\"uint256[]\"},{\"internalType\":\"uint256[]\",\"name\":\"\",\"type\":\"uint256[]\"},{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"name\":\"onERC1155BatchReceived\",\"outputs\":[{\"internalType\":\"bytes4\",\"name\":\"\",\"type\":\"bytes4\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"name\":\"onERC1155Received\",\"outputs\":[{\"internalType\":\"bytes4\",\"name\":\"\",\"type\":\"bytes4\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"name\":\"onERC721Received\",\"outputs\":[{\"internalType\":\"bytes4\",\"name\":\"\",\"type\":\"bytes4\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"proposalId\",\"type\":\"uint256\"}],\"name\":\"proposalDeadline\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"proposalId\",\"type\":\"uint256\"}],\"name\":\"proposalEta\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"proposalNeedsQueuing\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"proposalId\",\"type\":\"uint256\"}],\"name\":\"proposalProposer\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"proposalId\",\"type\":\"uint256\"}],\"name\":\"proposalSnapshot\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"proposalThreshold\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"proposalId\",\"type\":\"uint256\"}],\"name\":\"proposalVotes\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"againstVotes\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"forVotes\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"abstainVotes\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"targets\",\"type\":\"address[]\"},{\"internalType\":\"uint256[]\",\"name\":\"values\",\"type\":\"uint256[]\"},{\"internalType\":\"bytes[]\",\"name\":\"calldatas\",\"type\":\"bytes[]\"},{\"internalType\":\"string\",\"name\":\"description\",\"type\":\"string\"}],\"name\":\"propose\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"targets\",\"type\":\"address[]\"},{\"internalType\":\"uint256[]\",\"name\":\"values\",\"type\":\"uint256[]\"},{\"internalType\":\"bytes[]\",\"name\":\"calldatas\",\"type\":\"bytes[]\"},{\"internalType\":\"bytes32\",\"name\":\"descriptionHash\",\"type\":\"bytes32\"}],\"name\":\"queue\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"blockNumber\",\"type\":\"uint256\"}],\"name\":\"quorum\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"quorumDenominator\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"timepoint\",\"type\":\"uint256\"}],\"name\":\"quorumNumerator\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"quorumNumerator\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"target\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"relay\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"newManifesto\",\"type\":\"string\"}],\"name\":\"setManifesto\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"newProposalThreshold\",\"type\":\"uint256\"}],\"name\":\"setProposalThreshold\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint48\",\"name\":\"newVotingDelay\",\"type\":\"uint48\"}],\"name\":\"setVotingDelay\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"newVotingPeriod\",\"type\":\"uint32\"}],\"name\":\"setVotingPeriod\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"proposalId\",\"type\":\"uint256\"}],\"name\":\"state\",\"outputs\":[{\"internalType\":\"enum IGovernor.ProposalState\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"interfaceId\",\"type\":\"bytes4\"}],\"name\":\"supportsInterface\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"token\",\"outputs\":[{\"internalType\":\"contract IERC5805\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"newQuorumNumerator\",\"type\":\"uint256\"}],\"name\":\"updateQuorumNumerator\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"version\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"votingDelay\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"votingPeriod\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"author\":\"Web3 Hackers Collective\",\"custom:security-contact\":\"julien@strat.cc\",\"details\":\"Uses ProofHandler library for managing cross-chain parameter updates\",\"errors\":{\"CheckpointUnorderedInsertion()\":[{\"details\":\"A value was attempted to be inserted on a past checkpoint.\"}],\"FailedCall()\":[{\"details\":\"A call to an address target failed. The target may have reverted.\"}],\"GovernorAlreadyCastVote(address)\":[{\"details\":\"The vote was already cast.\"}],\"GovernorAlreadyQueuedProposal(uint256)\":[{\"details\":\"The proposal has already been queued.\"}],\"GovernorDisabledDeposit()\":[{\"details\":\"Token deposits are disabled in this contract.\"}],\"GovernorInsufficientProposerVotes(address,uint256,uint256)\":[{\"details\":\"The `proposer` does not have the required votes to create a proposal.\"}],\"GovernorInvalidProposalLength(uint256,uint256,uint256)\":[{\"details\":\"Empty proposal or a mismatch between the parameters length for a proposal call.\"}],\"GovernorInvalidQuorumFraction(uint256,uint256)\":[{\"details\":\"The quorum set is not a valid fraction.\"}],\"GovernorInvalidSignature(address)\":[{\"details\":\"The provided signature is not valid for the expected `voter`. If the `voter` is a contract, the signature is not valid using {IERC1271-isValidSignature}.\"}],\"GovernorInvalidVoteParams()\":[{\"details\":\"The provided params buffer is not supported by the counting module.\"}],\"GovernorInvalidVoteType()\":[{\"details\":\"The vote type used is not valid for the corresponding counting module.\"}],\"GovernorInvalidVotingPeriod(uint256)\":[{\"details\":\"The voting period set is not a valid period.\"}],\"GovernorNonexistentProposal(uint256)\":[{\"details\":\"The `proposalId` doesn't exist.\"}],\"GovernorNotQueuedProposal(uint256)\":[{\"details\":\"The proposal hasn't been queued yet.\"}],\"GovernorOnlyExecutor(address)\":[{\"details\":\"The `account` is not the governance executor.\"}],\"GovernorOnlyProposer(address)\":[{\"details\":\"The `account` is not a proposer.\"}],\"GovernorQueueNotImplemented()\":[{\"details\":\"Queue operation is not implemented for this governor. Execute should be called directly.\"}],\"GovernorRestrictedProposer(address)\":[{\"details\":\"The `proposer` is not allowed to create a proposal.\"}],\"GovernorUnexpectedProposalState(uint256,uint8,bytes32)\":[{\"details\":\"The current state of a proposal is not the required for performing an operation. The `expectedStates` is a bitmap with the bits enabled for each ProposalState enum position counting from right to left. NOTE: If `expectedState` is `bytes32(0)`, the proposal is expected to not be in any state (i.e. not exist). This is the case when a proposal that is expected to be unset is already initiated (the proposal is duplicated). See {Governor-_encodeStateBitmap}.\"}],\"InvalidAccountNonce(address,uint256)\":[{\"details\":\"The nonce used for an `account` is not the expected current nonce.\"}],\"SafeCastOverflowedUintDowncast(uint8,uint256)\":[{\"details\":\"Value doesn't fit in an uint of `bits` size.\"}]},\"events\":{\"EIP712DomainChanged()\":{\"details\":\"MAY be emitted to signal that the domain could have changed.\"},\"GovernanceParameterUpdated(uint8,uint256,uint256,uint256)\":{\"params\":{\"newValue\":\"New value\",\"nonce\":\"Update sequence number\",\"oldValue\":\"Previous value\",\"operationType\":\"Type of parameter updated\"}},\"ManifestoUpdated(string,string,uint256)\":{\"params\":{\"newManifesto\":\"New manifesto CID\",\"nonce\":\"Update sequence number\",\"oldManifesto\":\"Previous manifesto CID\"}},\"ProposalCanceled(uint256)\":{\"details\":\"Emitted when a proposal is canceled.\"},\"ProposalCreated(uint256,address,address[],uint256[],string[],bytes[],uint256,uint256,string)\":{\"details\":\"Emitted when a proposal is created.\"},\"ProposalExecuted(uint256)\":{\"details\":\"Emitted when a proposal is executed.\"},\"ProposalQueued(uint256,uint256)\":{\"details\":\"Emitted when a proposal is queued.\"},\"VoteCast(address,uint256,uint8,uint256,string)\":{\"details\":\"Emitted when a vote is cast without params. Note: `support` values should be seen as buckets. Their interpretation depends on the voting module used.\"},\"VoteCastWithParams(address,uint256,uint8,uint256,string,bytes)\":{\"details\":\"Emitted when a vote is cast with params. Note: `support` values should be seen as buckets. Their interpretation depends on the voting module used. `params` are additional encoded parameters. Their interpretation also depends on the voting module used.\"}},\"kind\":\"dev\",\"methods\":{\"CLOCK_MODE()\":{\"details\":\"Machine-readable description of the clock as specified in ERC-6372.\"},\"COUNTING_MODE()\":{\"details\":\"See {IGovernor-COUNTING_MODE}.\"},\"cancel(address[],uint256[],bytes[],bytes32)\":{\"details\":\"See {IGovernor-cancel}.\"},\"castVote(uint256,uint8)\":{\"details\":\"See {IGovernor-castVote}.\"},\"castVoteBySig(uint256,uint8,address,bytes)\":{\"details\":\"See {IGovernor-castVoteBySig}.\"},\"castVoteWithReason(uint256,uint8,string)\":{\"details\":\"See {IGovernor-castVoteWithReason}.\"},\"castVoteWithReasonAndParams(uint256,uint8,string,bytes)\":{\"details\":\"See {IGovernor-castVoteWithReasonAndParams}.\"},\"castVoteWithReasonAndParamsBySig(uint256,uint8,address,string,bytes,bytes)\":{\"details\":\"See {IGovernor-castVoteWithReasonAndParamsBySig}.\"},\"claimParameterUpdate(bytes)\":{\"params\":{\"proof\":\"Proof generated by home chain\"}},\"clock()\":{\"details\":\"Clock (as specified in ERC-6372) is set to match the token's clock. Fallback to block numbers if the token does not implement ERC-6372.\"},\"constructor\":{\"params\":{\"_home\":\"Chain ID where this contract is considered home\",\"_manifestoCid\":\"Initial manifesto CID\",\"_name\":\"Name of the governance contract\",\"_proposalThreshold\":\"Minimum votes needed for proposal\",\"_quorum\":\"Minimum participation percentage required\",\"_token\":\"The voting token contract address\",\"_votingDelay\":\"Time before voting begins\",\"_votingPeriod\":\"Duration of voting period\"}},\"eip712Domain()\":{\"details\":\"See {IERC-5267}.\"},\"execute(address[],uint256[],bytes[],bytes32)\":{\"details\":\"See {IGovernor-execute}.\"},\"generateParameterProof(uint8,bytes)\":{\"params\":{\"operationType\":\"Type of parameter being updated\",\"value\":\"Encoded parameter value\"},\"returns\":{\"proof\":\"Encoded proof data\"}},\"getVotes(address,uint256)\":{\"details\":\"See {IGovernor-getVotes}.\"},\"getVotesWithParams(address,uint256,bytes)\":{\"details\":\"See {IGovernor-getVotesWithParams}.\"},\"hasVoted(uint256,address)\":{\"details\":\"See {IGovernor-hasVoted}.\"},\"hashProposal(address[],uint256[],bytes[],bytes32)\":{\"details\":\"See {IGovernor-hashProposal}. The proposal id is produced by hashing the ABI encoded `targets` array, the `values` array, the `calldatas` array and the descriptionHash (bytes32 which itself is the keccak256 hash of the description string). This proposal id can be produced from the proposal data which is part of the {ProposalCreated} event. It can even be computed in advance, before the proposal is submitted. Note that the chainId and the governor address are not part of the proposal id computation. Consequently, the same proposal (with same operation and same description) will have the same id if submitted on multiple governors across multiple networks. This also means that in order to execute the same operation twice (on the same governor) the proposer will have to change the description in order to avoid proposal id conflicts.\"},\"name()\":{\"details\":\"See {IGovernor-name}.\"},\"nonces(address)\":{\"details\":\"Returns the next unused nonce for an address.\"},\"onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)\":{\"details\":\"See {IERC1155Receiver-onERC1155BatchReceived}. Receiving tokens is disabled if the governance executor is other than the governor itself (eg. when using with a timelock).\"},\"onERC1155Received(address,address,uint256,uint256,bytes)\":{\"details\":\"See {IERC1155Receiver-onERC1155Received}. Receiving tokens is disabled if the governance executor is other than the governor itself (eg. when using with a timelock).\"},\"onERC721Received(address,address,uint256,bytes)\":{\"details\":\"See {IERC721Receiver-onERC721Received}. Receiving tokens is disabled if the governance executor is other than the governor itself (eg. when using with a timelock).\"},\"proposalDeadline(uint256)\":{\"details\":\"See {IGovernor-proposalDeadline}.\"},\"proposalEta(uint256)\":{\"details\":\"See {IGovernor-proposalEta}.\"},\"proposalNeedsQueuing(uint256)\":{\"details\":\"See {IGovernor-proposalNeedsQueuing}.\"},\"proposalProposer(uint256)\":{\"details\":\"See {IGovernor-proposalProposer}.\"},\"proposalSnapshot(uint256)\":{\"details\":\"See {IGovernor-proposalSnapshot}.\"},\"proposalVotes(uint256)\":{\"details\":\"Accessor to the internal vote counts.\"},\"propose(address[],uint256[],bytes[],string)\":{\"details\":\"See {IGovernor-propose}. This function has opt-in frontrunning protection, described in {_isValidDescriptionForProposer}.\"},\"queue(address[],uint256[],bytes[],bytes32)\":{\"details\":\"See {IGovernor-queue}.\"},\"quorumDenominator()\":{\"details\":\"Returns the quorum denominator. Defaults to 100, but may be overridden.\"},\"quorumNumerator()\":{\"details\":\"Returns the current quorum numerator. See {quorumDenominator}.\"},\"quorumNumerator(uint256)\":{\"details\":\"Returns the quorum numerator at a specific timepoint. See {quorumDenominator}.\"},\"relay(address,uint256,bytes)\":{\"details\":\"Relays a transaction or function call to an arbitrary target. In cases where the governance executor is some contract other than the governor itself, like when using a timelock, this function can be invoked in a governance proposal to recover tokens or Ether that was sent to the governor contract by mistake. Note that if the executor is simply the governor itself, use of `relay` is redundant.\"},\"setManifesto(string)\":{\"params\":{\"newManifesto\":\"New manifesto CID\"}},\"setProposalThreshold(uint256)\":{\"params\":{\"newProposalThreshold\":\"New proposal threshold value\"}},\"setVotingDelay(uint48)\":{\"params\":{\"newVotingDelay\":\"New voting delay value\"}},\"setVotingPeriod(uint32)\":{\"params\":{\"newVotingPeriod\":\"New voting period value\"}},\"state(uint256)\":{\"details\":\"See {IGovernor-state}.\"},\"supportsInterface(bytes4)\":{\"details\":\"See {IERC165-supportsInterface}.\"},\"token()\":{\"details\":\"The token that voting power is sourced from.\"},\"updateQuorumNumerator(uint256)\":{\"params\":{\"newQuorumNumerator\":\"New quorum numerator value\"}},\"version()\":{\"details\":\"See {IGovernor-version}.\"}},\"title\":\"Cross-chain Governance Contract\",\"version\":1},\"userdoc\":{\"events\":{\"GovernanceParameterUpdated(uint8,uint256,uint256,uint256)\":{\"notice\":\"Emitted when a governance parameter is updated\"},\"ManifestoUpdated(string,string,uint256)\":{\"notice\":\"Emitted when the manifesto is updated\"}},\"kind\":\"user\",\"methods\":{\"claimParameterUpdate(bytes)\":{\"notice\":\"Claims a parameter update on a foreign chain\"},\"constructor\":{\"notice\":\"Initializes the governance contract\"},\"generateParameterProof(uint8,bytes)\":{\"notice\":\"Generates proof for parameter updates\"},\"home()\":{\"notice\":\"Chain ID where this contract was originally deployed\"},\"manifesto()\":{\"notice\":\"IPFS CID of the DAO's manifesto\"},\"setManifesto(string)\":{\"notice\":\"Updates the DAO's manifesto on the home chain\"},\"setProposalThreshold(uint256)\":{\"notice\":\"Updates the proposal threshold parameter on the home chain\"},\"setVotingDelay(uint48)\":{\"notice\":\"Updates the voting delay parameter on the home chain\"},\"setVotingPeriod(uint32)\":{\"notice\":\"Updates the voting period parameter on the home chain\"},\"updateQuorumNumerator(uint256)\":{\"notice\":\"Updates the quorum numerator on the home chain\"}},\"notice\":\"Implementation of a DAO with secure cross-chain synchronization capabilities\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/variants/crosschain/Gov.sol\":\"Gov\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/governance/Governor.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (governance/Governor.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {IERC721Receiver} from \\\"../token/ERC721/IERC721Receiver.sol\\\";\\nimport {IERC1155Receiver} from \\\"../token/ERC1155/IERC1155Receiver.sol\\\";\\nimport {EIP712} from \\\"../utils/cryptography/EIP712.sol\\\";\\nimport {SignatureChecker} from \\\"../utils/cryptography/SignatureChecker.sol\\\";\\nimport {IERC165, ERC165} from \\\"../utils/introspection/ERC165.sol\\\";\\nimport {SafeCast} from \\\"../utils/math/SafeCast.sol\\\";\\nimport {DoubleEndedQueue} from \\\"../utils/structs/DoubleEndedQueue.sol\\\";\\nimport {Address} from \\\"../utils/Address.sol\\\";\\nimport {Context} from \\\"../utils/Context.sol\\\";\\nimport {Nonces} from \\\"../utils/Nonces.sol\\\";\\nimport {IGovernor, IERC6372} from \\\"./IGovernor.sol\\\";\\n\\n/**\\n * @dev Core of the governance system, designed to be extended through various modules.\\n *\\n * This contract is abstract and requires several functions to be implemented in various modules:\\n *\\n * - A counting module must implement {quorum}, {_quorumReached}, {_voteSucceeded} and {_countVote}\\n * - A voting module must implement {_getVotes}\\n * - Additionally, {votingPeriod} must also be implemented\\n */\\nabstract contract Governor is Context, ERC165, EIP712, Nonces, IGovernor, IERC721Receiver, IERC1155Receiver {\\n using DoubleEndedQueue for DoubleEndedQueue.Bytes32Deque;\\n\\n bytes32 public constant BALLOT_TYPEHASH =\\n keccak256(\\\"Ballot(uint256 proposalId,uint8 support,address voter,uint256 nonce)\\\");\\n bytes32 public constant EXTENDED_BALLOT_TYPEHASH =\\n keccak256(\\n \\\"ExtendedBallot(uint256 proposalId,uint8 support,address voter,uint256 nonce,string reason,bytes params)\\\"\\n );\\n\\n struct ProposalCore {\\n address proposer;\\n uint48 voteStart;\\n uint32 voteDuration;\\n bool executed;\\n bool canceled;\\n uint48 etaSeconds;\\n }\\n\\n bytes32 private constant ALL_PROPOSAL_STATES_BITMAP = bytes32((2 ** (uint8(type(ProposalState).max) + 1)) - 1);\\n string private _name;\\n\\n mapping(uint256 proposalId => ProposalCore) private _proposals;\\n\\n // This queue keeps track of the governor operating on itself. Calls to functions protected by the {onlyGovernance}\\n // modifier needs to be whitelisted in this queue. Whitelisting is set in {execute}, consumed by the\\n // {onlyGovernance} modifier and eventually reset after {_executeOperations} completes. This ensures that the\\n // execution of {onlyGovernance} protected calls can only be achieved through successful proposals.\\n DoubleEndedQueue.Bytes32Deque private _governanceCall;\\n\\n /**\\n * @dev Restricts a function so it can only be executed through governance proposals. For example, governance\\n * parameter setters in {GovernorSettings} are protected using this modifier.\\n *\\n * The governance executing address may be different from the Governor's own address, for example it could be a\\n * timelock. This can be customized by modules by overriding {_executor}. The executor is only able to invoke these\\n * functions during the execution of the governor's {execute} function, and not under any other circumstances. Thus,\\n * for example, additional timelock proposers are not able to change governance parameters without going through the\\n * governance protocol (since v4.6).\\n */\\n modifier onlyGovernance() {\\n _checkGovernance();\\n _;\\n }\\n\\n /**\\n * @dev Sets the value for {name} and {version}\\n */\\n constructor(string memory name_) EIP712(name_, version()) {\\n _name = name_;\\n }\\n\\n /**\\n * @dev Function to receive ETH that will be handled by the governor (disabled if executor is a third party contract)\\n */\\n receive() external payable virtual {\\n if (_executor() != address(this)) {\\n revert GovernorDisabledDeposit();\\n }\\n }\\n\\n /**\\n * @dev See {IERC165-supportsInterface}.\\n */\\n function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165, ERC165) returns (bool) {\\n return\\n interfaceId == type(IGovernor).interfaceId ||\\n interfaceId == type(IERC1155Receiver).interfaceId ||\\n super.supportsInterface(interfaceId);\\n }\\n\\n /**\\n * @dev See {IGovernor-name}.\\n */\\n function name() public view virtual returns (string memory) {\\n return _name;\\n }\\n\\n /**\\n * @dev See {IGovernor-version}.\\n */\\n function version() public view virtual returns (string memory) {\\n return \\\"1\\\";\\n }\\n\\n /**\\n * @dev See {IGovernor-hashProposal}.\\n *\\n * The proposal id is produced by hashing the ABI encoded `targets` array, the `values` array, the `calldatas` array\\n * and the descriptionHash (bytes32 which itself is the keccak256 hash of the description string). This proposal id\\n * can be produced from the proposal data which is part of the {ProposalCreated} event. It can even be computed in\\n * advance, before the proposal is submitted.\\n *\\n * Note that the chainId and the governor address are not part of the proposal id computation. Consequently, the\\n * same proposal (with same operation and same description) will have the same id if submitted on multiple governors\\n * across multiple networks. This also means that in order to execute the same operation twice (on the same\\n * governor) the proposer will have to change the description in order to avoid proposal id conflicts.\\n */\\n function hashProposal(\\n address[] memory targets,\\n uint256[] memory values,\\n bytes[] memory calldatas,\\n bytes32 descriptionHash\\n ) public pure virtual returns (uint256) {\\n return uint256(keccak256(abi.encode(targets, values, calldatas, descriptionHash)));\\n }\\n\\n /**\\n * @dev See {IGovernor-state}.\\n */\\n function state(uint256 proposalId) public view virtual returns (ProposalState) {\\n // We read the struct fields into the stack at once so Solidity emits a single SLOAD\\n ProposalCore storage proposal = _proposals[proposalId];\\n bool proposalExecuted = proposal.executed;\\n bool proposalCanceled = proposal.canceled;\\n\\n if (proposalExecuted) {\\n return ProposalState.Executed;\\n }\\n\\n if (proposalCanceled) {\\n return ProposalState.Canceled;\\n }\\n\\n uint256 snapshot = proposalSnapshot(proposalId);\\n\\n if (snapshot == 0) {\\n revert GovernorNonexistentProposal(proposalId);\\n }\\n\\n uint256 currentTimepoint = clock();\\n\\n if (snapshot >= currentTimepoint) {\\n return ProposalState.Pending;\\n }\\n\\n uint256 deadline = proposalDeadline(proposalId);\\n\\n if (deadline >= currentTimepoint) {\\n return ProposalState.Active;\\n } else if (!_quorumReached(proposalId) || !_voteSucceeded(proposalId)) {\\n return ProposalState.Defeated;\\n } else if (proposalEta(proposalId) == 0) {\\n return ProposalState.Succeeded;\\n } else {\\n return ProposalState.Queued;\\n }\\n }\\n\\n /**\\n * @dev See {IGovernor-proposalThreshold}.\\n */\\n function proposalThreshold() public view virtual returns (uint256) {\\n return 0;\\n }\\n\\n /**\\n * @dev See {IGovernor-proposalSnapshot}.\\n */\\n function proposalSnapshot(uint256 proposalId) public view virtual returns (uint256) {\\n return _proposals[proposalId].voteStart;\\n }\\n\\n /**\\n * @dev See {IGovernor-proposalDeadline}.\\n */\\n function proposalDeadline(uint256 proposalId) public view virtual returns (uint256) {\\n return _proposals[proposalId].voteStart + _proposals[proposalId].voteDuration;\\n }\\n\\n /**\\n * @dev See {IGovernor-proposalProposer}.\\n */\\n function proposalProposer(uint256 proposalId) public view virtual returns (address) {\\n return _proposals[proposalId].proposer;\\n }\\n\\n /**\\n * @dev See {IGovernor-proposalEta}.\\n */\\n function proposalEta(uint256 proposalId) public view virtual returns (uint256) {\\n return _proposals[proposalId].etaSeconds;\\n }\\n\\n /**\\n * @dev See {IGovernor-proposalNeedsQueuing}.\\n */\\n function proposalNeedsQueuing(uint256) public view virtual returns (bool) {\\n return false;\\n }\\n\\n /**\\n * @dev Reverts if the `msg.sender` is not the executor. In case the executor is not this contract\\n * itself, the function reverts if `msg.data` is not whitelisted as a result of an {execute}\\n * operation. See {onlyGovernance}.\\n */\\n function _checkGovernance() internal virtual {\\n if (_executor() != _msgSender()) {\\n revert GovernorOnlyExecutor(_msgSender());\\n }\\n if (_executor() != address(this)) {\\n bytes32 msgDataHash = keccak256(_msgData());\\n // loop until popping the expected operation - throw if deque is empty (operation not authorized)\\n while (_governanceCall.popFront() != msgDataHash) {}\\n }\\n }\\n\\n /**\\n * @dev Amount of votes already cast passes the threshold limit.\\n */\\n function _quorumReached(uint256 proposalId) internal view virtual returns (bool);\\n\\n /**\\n * @dev Is the proposal successful or not.\\n */\\n function _voteSucceeded(uint256 proposalId) internal view virtual returns (bool);\\n\\n /**\\n * @dev Get the voting weight of `account` at a specific `timepoint`, for a vote as described by `params`.\\n */\\n function _getVotes(address account, uint256 timepoint, bytes memory params) internal view virtual returns (uint256);\\n\\n /**\\n * @dev Register a vote for `proposalId` by `account` with a given `support`, voting `weight` and voting `params`.\\n *\\n * Note: Support is generic and can represent various things depending on the voting system used.\\n */\\n function _countVote(\\n uint256 proposalId,\\n address account,\\n uint8 support,\\n uint256 totalWeight,\\n bytes memory params\\n ) internal virtual returns (uint256);\\n\\n /**\\n * @dev Default additional encoded parameters used by castVote methods that don't include them\\n *\\n * Note: Should be overridden by specific implementations to use an appropriate value, the\\n * meaning of the additional params, in the context of that implementation\\n */\\n function _defaultParams() internal view virtual returns (bytes memory) {\\n return \\\"\\\";\\n }\\n\\n /**\\n * @dev See {IGovernor-propose}. This function has opt-in frontrunning protection, described in {_isValidDescriptionForProposer}.\\n */\\n function propose(\\n address[] memory targets,\\n uint256[] memory values,\\n bytes[] memory calldatas,\\n string memory description\\n ) public virtual returns (uint256) {\\n address proposer = _msgSender();\\n\\n // check description restriction\\n if (!_isValidDescriptionForProposer(proposer, description)) {\\n revert GovernorRestrictedProposer(proposer);\\n }\\n\\n // check proposal threshold\\n uint256 votesThreshold = proposalThreshold();\\n if (votesThreshold > 0) {\\n uint256 proposerVotes = getVotes(proposer, clock() - 1);\\n if (proposerVotes < votesThreshold) {\\n revert GovernorInsufficientProposerVotes(proposer, proposerVotes, votesThreshold);\\n }\\n }\\n\\n return _propose(targets, values, calldatas, description, proposer);\\n }\\n\\n /**\\n * @dev Internal propose mechanism. Can be overridden to add more logic on proposal creation.\\n *\\n * Emits a {IGovernor-ProposalCreated} event.\\n */\\n function _propose(\\n address[] memory targets,\\n uint256[] memory values,\\n bytes[] memory calldatas,\\n string memory description,\\n address proposer\\n ) internal virtual returns (uint256 proposalId) {\\n proposalId = hashProposal(targets, values, calldatas, keccak256(bytes(description)));\\n\\n if (targets.length != values.length || targets.length != calldatas.length || targets.length == 0) {\\n revert GovernorInvalidProposalLength(targets.length, calldatas.length, values.length);\\n }\\n if (_proposals[proposalId].voteStart != 0) {\\n revert GovernorUnexpectedProposalState(proposalId, state(proposalId), bytes32(0));\\n }\\n\\n uint256 snapshot = clock() + votingDelay();\\n uint256 duration = votingPeriod();\\n\\n ProposalCore storage proposal = _proposals[proposalId];\\n proposal.proposer = proposer;\\n proposal.voteStart = SafeCast.toUint48(snapshot);\\n proposal.voteDuration = SafeCast.toUint32(duration);\\n\\n emit ProposalCreated(\\n proposalId,\\n proposer,\\n targets,\\n values,\\n new string[](targets.length),\\n calldatas,\\n snapshot,\\n snapshot + duration,\\n description\\n );\\n\\n // Using a named return variable to avoid stack too deep errors\\n }\\n\\n /**\\n * @dev See {IGovernor-queue}.\\n */\\n function queue(\\n address[] memory targets,\\n uint256[] memory values,\\n bytes[] memory calldatas,\\n bytes32 descriptionHash\\n ) public virtual returns (uint256) {\\n uint256 proposalId = hashProposal(targets, values, calldatas, descriptionHash);\\n\\n _validateStateBitmap(proposalId, _encodeStateBitmap(ProposalState.Succeeded));\\n\\n uint48 etaSeconds = _queueOperations(proposalId, targets, values, calldatas, descriptionHash);\\n\\n if (etaSeconds != 0) {\\n _proposals[proposalId].etaSeconds = etaSeconds;\\n emit ProposalQueued(proposalId, etaSeconds);\\n } else {\\n revert GovernorQueueNotImplemented();\\n }\\n\\n return proposalId;\\n }\\n\\n /**\\n * @dev Internal queuing mechanism. Can be overridden (without a super call) to modify the way queuing is\\n * performed (for example adding a vault/timelock).\\n *\\n * This is empty by default, and must be overridden to implement queuing.\\n *\\n * This function returns a timestamp that describes the expected ETA for execution. If the returned value is 0\\n * (which is the default value), the core will consider queueing did not succeed, and the public {queue} function\\n * will revert.\\n *\\n * NOTE: Calling this function directly will NOT check the current state of the proposal, or emit the\\n * `ProposalQueued` event. Queuing a proposal should be done using {queue}.\\n */\\n function _queueOperations(\\n uint256 /*proposalId*/,\\n address[] memory /*targets*/,\\n uint256[] memory /*values*/,\\n bytes[] memory /*calldatas*/,\\n bytes32 /*descriptionHash*/\\n ) internal virtual returns (uint48) {\\n return 0;\\n }\\n\\n /**\\n * @dev See {IGovernor-execute}.\\n */\\n function execute(\\n address[] memory targets,\\n uint256[] memory values,\\n bytes[] memory calldatas,\\n bytes32 descriptionHash\\n ) public payable virtual returns (uint256) {\\n uint256 proposalId = hashProposal(targets, values, calldatas, descriptionHash);\\n\\n _validateStateBitmap(\\n proposalId,\\n _encodeStateBitmap(ProposalState.Succeeded) | _encodeStateBitmap(ProposalState.Queued)\\n );\\n\\n // mark as executed before calls to avoid reentrancy\\n _proposals[proposalId].executed = true;\\n\\n // before execute: register governance call in queue.\\n if (_executor() != address(this)) {\\n for (uint256 i = 0; i < targets.length; ++i) {\\n if (targets[i] == address(this)) {\\n _governanceCall.pushBack(keccak256(calldatas[i]));\\n }\\n }\\n }\\n\\n _executeOperations(proposalId, targets, values, calldatas, descriptionHash);\\n\\n // after execute: cleanup governance call queue.\\n if (_executor() != address(this) && !_governanceCall.empty()) {\\n _governanceCall.clear();\\n }\\n\\n emit ProposalExecuted(proposalId);\\n\\n return proposalId;\\n }\\n\\n /**\\n * @dev Internal execution mechanism. Can be overridden (without a super call) to modify the way execution is\\n * performed (for example adding a vault/timelock).\\n *\\n * NOTE: Calling this function directly will NOT check the current state of the proposal, set the executed flag to\\n * true or emit the `ProposalExecuted` event. Executing a proposal should be done using {execute} or {_execute}.\\n */\\n function _executeOperations(\\n uint256 /* proposalId */,\\n address[] memory targets,\\n uint256[] memory values,\\n bytes[] memory calldatas,\\n bytes32 /*descriptionHash*/\\n ) internal virtual {\\n for (uint256 i = 0; i < targets.length; ++i) {\\n (bool success, bytes memory returndata) = targets[i].call{value: values[i]}(calldatas[i]);\\n Address.verifyCallResult(success, returndata);\\n }\\n }\\n\\n /**\\n * @dev See {IGovernor-cancel}.\\n */\\n function cancel(\\n address[] memory targets,\\n uint256[] memory values,\\n bytes[] memory calldatas,\\n bytes32 descriptionHash\\n ) public virtual returns (uint256) {\\n // The proposalId will be recomputed in the `_cancel` call further down. However we need the value before we\\n // do the internal call, because we need to check the proposal state BEFORE the internal `_cancel` call\\n // changes it. The `hashProposal` duplication has a cost that is limited, and that we accept.\\n uint256 proposalId = hashProposal(targets, values, calldatas, descriptionHash);\\n\\n // public cancel restrictions (on top of existing _cancel restrictions).\\n _validateStateBitmap(proposalId, _encodeStateBitmap(ProposalState.Pending));\\n if (_msgSender() != proposalProposer(proposalId)) {\\n revert GovernorOnlyProposer(_msgSender());\\n }\\n\\n return _cancel(targets, values, calldatas, descriptionHash);\\n }\\n\\n /**\\n * @dev Internal cancel mechanism with minimal restrictions. A proposal can be cancelled in any state other than\\n * Canceled, Expired, or Executed. Once cancelled a proposal can't be re-submitted.\\n *\\n * Emits a {IGovernor-ProposalCanceled} event.\\n */\\n function _cancel(\\n address[] memory targets,\\n uint256[] memory values,\\n bytes[] memory calldatas,\\n bytes32 descriptionHash\\n ) internal virtual returns (uint256) {\\n uint256 proposalId = hashProposal(targets, values, calldatas, descriptionHash);\\n\\n _validateStateBitmap(\\n proposalId,\\n ALL_PROPOSAL_STATES_BITMAP ^\\n _encodeStateBitmap(ProposalState.Canceled) ^\\n _encodeStateBitmap(ProposalState.Expired) ^\\n _encodeStateBitmap(ProposalState.Executed)\\n );\\n\\n _proposals[proposalId].canceled = true;\\n emit ProposalCanceled(proposalId);\\n\\n return proposalId;\\n }\\n\\n /**\\n * @dev See {IGovernor-getVotes}.\\n */\\n function getVotes(address account, uint256 timepoint) public view virtual returns (uint256) {\\n return _getVotes(account, timepoint, _defaultParams());\\n }\\n\\n /**\\n * @dev See {IGovernor-getVotesWithParams}.\\n */\\n function getVotesWithParams(\\n address account,\\n uint256 timepoint,\\n bytes memory params\\n ) public view virtual returns (uint256) {\\n return _getVotes(account, timepoint, params);\\n }\\n\\n /**\\n * @dev See {IGovernor-castVote}.\\n */\\n function castVote(uint256 proposalId, uint8 support) public virtual returns (uint256) {\\n address voter = _msgSender();\\n return _castVote(proposalId, voter, support, \\\"\\\");\\n }\\n\\n /**\\n * @dev See {IGovernor-castVoteWithReason}.\\n */\\n function castVoteWithReason(\\n uint256 proposalId,\\n uint8 support,\\n string calldata reason\\n ) public virtual returns (uint256) {\\n address voter = _msgSender();\\n return _castVote(proposalId, voter, support, reason);\\n }\\n\\n /**\\n * @dev See {IGovernor-castVoteWithReasonAndParams}.\\n */\\n function castVoteWithReasonAndParams(\\n uint256 proposalId,\\n uint8 support,\\n string calldata reason,\\n bytes memory params\\n ) public virtual returns (uint256) {\\n address voter = _msgSender();\\n return _castVote(proposalId, voter, support, reason, params);\\n }\\n\\n /**\\n * @dev See {IGovernor-castVoteBySig}.\\n */\\n function castVoteBySig(\\n uint256 proposalId,\\n uint8 support,\\n address voter,\\n bytes memory signature\\n ) public virtual returns (uint256) {\\n bool valid = SignatureChecker.isValidSignatureNow(\\n voter,\\n _hashTypedDataV4(keccak256(abi.encode(BALLOT_TYPEHASH, proposalId, support, voter, _useNonce(voter)))),\\n signature\\n );\\n\\n if (!valid) {\\n revert GovernorInvalidSignature(voter);\\n }\\n\\n return _castVote(proposalId, voter, support, \\\"\\\");\\n }\\n\\n /**\\n * @dev See {IGovernor-castVoteWithReasonAndParamsBySig}.\\n */\\n function castVoteWithReasonAndParamsBySig(\\n uint256 proposalId,\\n uint8 support,\\n address voter,\\n string calldata reason,\\n bytes memory params,\\n bytes memory signature\\n ) public virtual returns (uint256) {\\n bool valid = SignatureChecker.isValidSignatureNow(\\n voter,\\n _hashTypedDataV4(\\n keccak256(\\n abi.encode(\\n EXTENDED_BALLOT_TYPEHASH,\\n proposalId,\\n support,\\n voter,\\n _useNonce(voter),\\n keccak256(bytes(reason)),\\n keccak256(params)\\n )\\n )\\n ),\\n signature\\n );\\n\\n if (!valid) {\\n revert GovernorInvalidSignature(voter);\\n }\\n\\n return _castVote(proposalId, voter, support, reason, params);\\n }\\n\\n /**\\n * @dev Internal vote casting mechanism: Check that the vote is pending, that it has not been cast yet, retrieve\\n * voting weight using {IGovernor-getVotes} and call the {_countVote} internal function. Uses the _defaultParams().\\n *\\n * Emits a {IGovernor-VoteCast} event.\\n */\\n function _castVote(\\n uint256 proposalId,\\n address account,\\n uint8 support,\\n string memory reason\\n ) internal virtual returns (uint256) {\\n return _castVote(proposalId, account, support, reason, _defaultParams());\\n }\\n\\n /**\\n * @dev Internal vote casting mechanism: Check that the vote is pending, that it has not been cast yet, retrieve\\n * voting weight using {IGovernor-getVotes} and call the {_countVote} internal function.\\n *\\n * Emits a {IGovernor-VoteCast} event.\\n */\\n function _castVote(\\n uint256 proposalId,\\n address account,\\n uint8 support,\\n string memory reason,\\n bytes memory params\\n ) internal virtual returns (uint256) {\\n _validateStateBitmap(proposalId, _encodeStateBitmap(ProposalState.Active));\\n\\n uint256 totalWeight = _getVotes(account, proposalSnapshot(proposalId), params);\\n uint256 votedWeight = _countVote(proposalId, account, support, totalWeight, params);\\n\\n if (params.length == 0) {\\n emit VoteCast(account, proposalId, support, votedWeight, reason);\\n } else {\\n emit VoteCastWithParams(account, proposalId, support, votedWeight, reason, params);\\n }\\n\\n return votedWeight;\\n }\\n\\n /**\\n * @dev Relays a transaction or function call to an arbitrary target. In cases where the governance executor\\n * is some contract other than the governor itself, like when using a timelock, this function can be invoked\\n * in a governance proposal to recover tokens or Ether that was sent to the governor contract by mistake.\\n * Note that if the executor is simply the governor itself, use of `relay` is redundant.\\n */\\n function relay(address target, uint256 value, bytes calldata data) external payable virtual onlyGovernance {\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n Address.verifyCallResult(success, returndata);\\n }\\n\\n /**\\n * @dev Address through which the governor executes action. Will be overloaded by module that execute actions\\n * through another contract such as a timelock.\\n */\\n function _executor() internal view virtual returns (address) {\\n return address(this);\\n }\\n\\n /**\\n * @dev See {IERC721Receiver-onERC721Received}.\\n * Receiving tokens is disabled if the governance executor is other than the governor itself (eg. when using with a timelock).\\n */\\n function onERC721Received(address, address, uint256, bytes memory) public virtual returns (bytes4) {\\n if (_executor() != address(this)) {\\n revert GovernorDisabledDeposit();\\n }\\n return this.onERC721Received.selector;\\n }\\n\\n /**\\n * @dev See {IERC1155Receiver-onERC1155Received}.\\n * Receiving tokens is disabled if the governance executor is other than the governor itself (eg. when using with a timelock).\\n */\\n function onERC1155Received(address, address, uint256, uint256, bytes memory) public virtual returns (bytes4) {\\n if (_executor() != address(this)) {\\n revert GovernorDisabledDeposit();\\n }\\n return this.onERC1155Received.selector;\\n }\\n\\n /**\\n * @dev See {IERC1155Receiver-onERC1155BatchReceived}.\\n * Receiving tokens is disabled if the governance executor is other than the governor itself (eg. when using with a timelock).\\n */\\n function onERC1155BatchReceived(\\n address,\\n address,\\n uint256[] memory,\\n uint256[] memory,\\n bytes memory\\n ) public virtual returns (bytes4) {\\n if (_executor() != address(this)) {\\n revert GovernorDisabledDeposit();\\n }\\n return this.onERC1155BatchReceived.selector;\\n }\\n\\n /**\\n * @dev Encodes a `ProposalState` into a `bytes32` representation where each bit enabled corresponds to\\n * the underlying position in the `ProposalState` enum. For example:\\n *\\n * 0x000...10000\\n * ^^^^^^------ ...\\n * ^----- Succeeded\\n * ^---- Defeated\\n * ^--- Canceled\\n * ^-- Active\\n * ^- Pending\\n */\\n function _encodeStateBitmap(ProposalState proposalState) internal pure returns (bytes32) {\\n return bytes32(1 << uint8(proposalState));\\n }\\n\\n /**\\n * @dev Check that the current state of a proposal matches the requirements described by the `allowedStates` bitmap.\\n * This bitmap should be built using `_encodeStateBitmap`.\\n *\\n * If requirements are not met, reverts with a {GovernorUnexpectedProposalState} error.\\n */\\n function _validateStateBitmap(uint256 proposalId, bytes32 allowedStates) private view returns (ProposalState) {\\n ProposalState currentState = state(proposalId);\\n if (_encodeStateBitmap(currentState) & allowedStates == bytes32(0)) {\\n revert GovernorUnexpectedProposalState(proposalId, currentState, allowedStates);\\n }\\n return currentState;\\n }\\n\\n /*\\n * @dev Check if the proposer is authorized to submit a proposal with the given description.\\n *\\n * If the proposal description ends with `#proposer=0x???`, where `0x???` is an address written as a hex string\\n * (case insensitive), then the submission of this proposal will only be authorized to said address.\\n *\\n * This is used for frontrunning protection. By adding this pattern at the end of their proposal, one can ensure\\n * that no other address can submit the same proposal. An attacker would have to either remove or change that part,\\n * which would result in a different proposal id.\\n *\\n * If the description does not match this pattern, it is unrestricted and anyone can submit it. This includes:\\n * - If the `0x???` part is not a valid hex string.\\n * - If the `0x???` part is a valid hex string, but does not contain exactly 40 hex digits.\\n * - If it ends with the expected suffix followed by newlines or other whitespace.\\n * - If it ends with some other similar suffix, e.g. `#other=abc`.\\n * - If it does not end with any such suffix.\\n */\\n function _isValidDescriptionForProposer(\\n address proposer,\\n string memory description\\n ) internal view virtual returns (bool) {\\n uint256 len = bytes(description).length;\\n\\n // Length is too short to contain a valid proposer suffix\\n if (len < 52) {\\n return true;\\n }\\n\\n // Extract what would be the `#proposer=0x` marker beginning the suffix\\n bytes12 marker;\\n assembly (\\\"memory-safe\\\") {\\n // - Start of the string contents in memory = description + 32\\n // - First character of the marker = len - 52\\n // - Length of \\\"#proposer=0x0000000000000000000000000000000000000000\\\" = 52\\n // - We read the memory word starting at the first character of the marker:\\n // - (description + 32) + (len - 52) = description + (len - 20)\\n // - Note: Solidity will ignore anything past the first 12 bytes\\n marker := mload(add(description, sub(len, 20)))\\n }\\n\\n // If the marker is not found, there is no proposer suffix to check\\n if (marker != bytes12(\\\"#proposer=0x\\\")) {\\n return true;\\n }\\n\\n // Parse the 40 characters following the marker as uint160\\n uint160 recovered = 0;\\n for (uint256 i = len - 40; i < len; ++i) {\\n (bool isHex, uint8 value) = _tryHexToUint(bytes(description)[i]);\\n // If any of the characters is not a hex digit, ignore the suffix entirely\\n if (!isHex) {\\n return true;\\n }\\n recovered = (recovered << 4) | value;\\n }\\n\\n return recovered == uint160(proposer);\\n }\\n\\n /**\\n * @dev Try to parse a character from a string as a hex value. Returns `(true, value)` if the char is in\\n * `[0-9a-fA-F]` and `(false, 0)` otherwise. Value is guaranteed to be in the range `0 <= value < 16`\\n */\\n function _tryHexToUint(bytes1 char) private pure returns (bool isHex, uint8 value) {\\n uint8 c = uint8(char);\\n unchecked {\\n // Case 0-9\\n if (47 < c && c < 58) {\\n return (true, c - 48);\\n }\\n // Case A-F\\n else if (64 < c && c < 71) {\\n return (true, c - 55);\\n }\\n // Case a-f\\n else if (96 < c && c < 103) {\\n return (true, c - 87);\\n }\\n // Else: not a hex char\\n else {\\n return (false, 0);\\n }\\n }\\n }\\n\\n /**\\n * @inheritdoc IERC6372\\n */\\n function clock() public view virtual returns (uint48);\\n\\n /**\\n * @inheritdoc IERC6372\\n */\\n // solhint-disable-next-line func-name-mixedcase\\n function CLOCK_MODE() public view virtual returns (string memory);\\n\\n /**\\n * @inheritdoc IGovernor\\n */\\n function votingDelay() public view virtual returns (uint256);\\n\\n /**\\n * @inheritdoc IGovernor\\n */\\n function votingPeriod() public view virtual returns (uint256);\\n\\n /**\\n * @inheritdoc IGovernor\\n */\\n function quorum(uint256 timepoint) public view virtual returns (uint256);\\n}\\n\",\"keccak256\":\"0xe0f387e99c7dfcb1d3e7d2f36e408ab59a851a5e0502d21889568466a2a491bc\",\"license\":\"MIT\"},\"@openzeppelin/contracts/governance/IGovernor.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (governance/IGovernor.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {IERC165} from \\\"../interfaces/IERC165.sol\\\";\\nimport {IERC6372} from \\\"../interfaces/IERC6372.sol\\\";\\n\\n/**\\n * @dev Interface of the {Governor} core.\\n *\\n * NOTE: Event parameters lack the `indexed` keyword for compatibility with GovernorBravo events.\\n * Making event parameters `indexed` affects how events are decoded, potentially breaking existing indexers.\\n */\\ninterface IGovernor is IERC165, IERC6372 {\\n enum ProposalState {\\n Pending,\\n Active,\\n Canceled,\\n Defeated,\\n Succeeded,\\n Queued,\\n Expired,\\n Executed\\n }\\n\\n /**\\n * @dev Empty proposal or a mismatch between the parameters length for a proposal call.\\n */\\n error GovernorInvalidProposalLength(uint256 targets, uint256 calldatas, uint256 values);\\n\\n /**\\n * @dev The vote was already cast.\\n */\\n error GovernorAlreadyCastVote(address voter);\\n\\n /**\\n * @dev Token deposits are disabled in this contract.\\n */\\n error GovernorDisabledDeposit();\\n\\n /**\\n * @dev The `account` is not a proposer.\\n */\\n error GovernorOnlyProposer(address account);\\n\\n /**\\n * @dev The `account` is not the governance executor.\\n */\\n error GovernorOnlyExecutor(address account);\\n\\n /**\\n * @dev The `proposalId` doesn't exist.\\n */\\n error GovernorNonexistentProposal(uint256 proposalId);\\n\\n /**\\n * @dev The current state of a proposal is not the required for performing an operation.\\n * The `expectedStates` is a bitmap with the bits enabled for each ProposalState enum position\\n * counting from right to left.\\n *\\n * NOTE: If `expectedState` is `bytes32(0)`, the proposal is expected to not be in any state (i.e. not exist).\\n * This is the case when a proposal that is expected to be unset is already initiated (the proposal is duplicated).\\n *\\n * See {Governor-_encodeStateBitmap}.\\n */\\n error GovernorUnexpectedProposalState(uint256 proposalId, ProposalState current, bytes32 expectedStates);\\n\\n /**\\n * @dev The voting period set is not a valid period.\\n */\\n error GovernorInvalidVotingPeriod(uint256 votingPeriod);\\n\\n /**\\n * @dev The `proposer` does not have the required votes to create a proposal.\\n */\\n error GovernorInsufficientProposerVotes(address proposer, uint256 votes, uint256 threshold);\\n\\n /**\\n * @dev The `proposer` is not allowed to create a proposal.\\n */\\n error GovernorRestrictedProposer(address proposer);\\n\\n /**\\n * @dev The vote type used is not valid for the corresponding counting module.\\n */\\n error GovernorInvalidVoteType();\\n\\n /**\\n * @dev The provided params buffer is not supported by the counting module.\\n */\\n error GovernorInvalidVoteParams();\\n\\n /**\\n * @dev Queue operation is not implemented for this governor. Execute should be called directly.\\n */\\n error GovernorQueueNotImplemented();\\n\\n /**\\n * @dev The proposal hasn't been queued yet.\\n */\\n error GovernorNotQueuedProposal(uint256 proposalId);\\n\\n /**\\n * @dev The proposal has already been queued.\\n */\\n error GovernorAlreadyQueuedProposal(uint256 proposalId);\\n\\n /**\\n * @dev The provided signature is not valid for the expected `voter`.\\n * If the `voter` is a contract, the signature is not valid using {IERC1271-isValidSignature}.\\n */\\n error GovernorInvalidSignature(address voter);\\n\\n /**\\n * @dev Emitted when a proposal is created.\\n */\\n event ProposalCreated(\\n uint256 proposalId,\\n address proposer,\\n address[] targets,\\n uint256[] values,\\n string[] signatures,\\n bytes[] calldatas,\\n uint256 voteStart,\\n uint256 voteEnd,\\n string description\\n );\\n\\n /**\\n * @dev Emitted when a proposal is queued.\\n */\\n event ProposalQueued(uint256 proposalId, uint256 etaSeconds);\\n\\n /**\\n * @dev Emitted when a proposal is executed.\\n */\\n event ProposalExecuted(uint256 proposalId);\\n\\n /**\\n * @dev Emitted when a proposal is canceled.\\n */\\n event ProposalCanceled(uint256 proposalId);\\n\\n /**\\n * @dev Emitted when a vote is cast without params.\\n *\\n * Note: `support` values should be seen as buckets. Their interpretation depends on the voting module used.\\n */\\n event VoteCast(address indexed voter, uint256 proposalId, uint8 support, uint256 weight, string reason);\\n\\n /**\\n * @dev Emitted when a vote is cast with params.\\n *\\n * Note: `support` values should be seen as buckets. Their interpretation depends on the voting module used.\\n * `params` are additional encoded parameters. Their interpretation also depends on the voting module used.\\n */\\n event VoteCastWithParams(\\n address indexed voter,\\n uint256 proposalId,\\n uint8 support,\\n uint256 weight,\\n string reason,\\n bytes params\\n );\\n\\n /**\\n * @notice module:core\\n * @dev Name of the governor instance (used in building the EIP-712 domain separator).\\n */\\n function name() external view returns (string memory);\\n\\n /**\\n * @notice module:core\\n * @dev Version of the governor instance (used in building the EIP-712 domain separator). Default: \\\"1\\\"\\n */\\n function version() external view returns (string memory);\\n\\n /**\\n * @notice module:voting\\n * @dev A description of the possible `support` values for {castVote} and the way these votes are counted, meant to\\n * be consumed by UIs to show correct vote options and interpret the results. The string is a URL-encoded sequence of\\n * key-value pairs that each describe one aspect, for example `support=bravo&quorum=for,abstain`.\\n *\\n * There are 2 standard keys: `support` and `quorum`.\\n *\\n * - `support=bravo` refers to the vote options 0 = Against, 1 = For, 2 = Abstain, as in `GovernorBravo`.\\n * - `quorum=bravo` means that only For votes are counted towards quorum.\\n * - `quorum=for,abstain` means that both For and Abstain votes are counted towards quorum.\\n *\\n * If a counting module makes use of encoded `params`, it should include this under a `params` key with a unique\\n * name that describes the behavior. For example:\\n *\\n * - `params=fractional` might refer to a scheme where votes are divided fractionally between for/against/abstain.\\n * - `params=erc721` might refer to a scheme where specific NFTs are delegated to vote.\\n *\\n * NOTE: The string can be decoded by the standard\\n * https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams[`URLSearchParams`]\\n * JavaScript class.\\n */\\n // solhint-disable-next-line func-name-mixedcase\\n function COUNTING_MODE() external view returns (string memory);\\n\\n /**\\n * @notice module:core\\n * @dev Hashing function used to (re)build the proposal id from the proposal details..\\n */\\n function hashProposal(\\n address[] memory targets,\\n uint256[] memory values,\\n bytes[] memory calldatas,\\n bytes32 descriptionHash\\n ) external pure returns (uint256);\\n\\n /**\\n * @notice module:core\\n * @dev Current state of a proposal, following Compound's convention\\n */\\n function state(uint256 proposalId) external view returns (ProposalState);\\n\\n /**\\n * @notice module:core\\n * @dev The number of votes required in order for a voter to become a proposer.\\n */\\n function proposalThreshold() external view returns (uint256);\\n\\n /**\\n * @notice module:core\\n * @dev Timepoint used to retrieve user's votes and quorum. If using block number (as per Compound's Comp), the\\n * snapshot is performed at the end of this block. Hence, voting for this proposal starts at the beginning of the\\n * following block.\\n */\\n function proposalSnapshot(uint256 proposalId) external view returns (uint256);\\n\\n /**\\n * @notice module:core\\n * @dev Timepoint at which votes close. If using block number, votes close at the end of this block, so it is\\n * possible to cast a vote during this block.\\n */\\n function proposalDeadline(uint256 proposalId) external view returns (uint256);\\n\\n /**\\n * @notice module:core\\n * @dev The account that created a proposal.\\n */\\n function proposalProposer(uint256 proposalId) external view returns (address);\\n\\n /**\\n * @notice module:core\\n * @dev The time when a queued proposal becomes executable (\\\"ETA\\\"). Unlike {proposalSnapshot} and\\n * {proposalDeadline}, this doesn't use the governor clock, and instead relies on the executor's clock which may be\\n * different. In most cases this will be a timestamp.\\n */\\n function proposalEta(uint256 proposalId) external view returns (uint256);\\n\\n /**\\n * @notice module:core\\n * @dev Whether a proposal needs to be queued before execution.\\n */\\n function proposalNeedsQueuing(uint256 proposalId) external view returns (bool);\\n\\n /**\\n * @notice module:user-config\\n * @dev Delay, between the proposal is created and the vote starts. The unit this duration is expressed in depends\\n * on the clock (see ERC-6372) this contract uses.\\n *\\n * This can be increased to leave time for users to buy voting power, or delegate it, before the voting of a\\n * proposal starts.\\n *\\n * NOTE: While this interface returns a uint256, timepoints are stored as uint48 following the ERC-6372 clock type.\\n * Consequently this value must fit in a uint48 (when added to the current clock). See {IERC6372-clock}.\\n */\\n function votingDelay() external view returns (uint256);\\n\\n /**\\n * @notice module:user-config\\n * @dev Delay between the vote start and vote end. The unit this duration is expressed in depends on the clock\\n * (see ERC-6372) this contract uses.\\n *\\n * NOTE: The {votingDelay} can delay the start of the vote. This must be considered when setting the voting\\n * duration compared to the voting delay.\\n *\\n * NOTE: This value is stored when the proposal is submitted so that possible changes to the value do not affect\\n * proposals that have already been submitted. The type used to save it is a uint32. Consequently, while this\\n * interface returns a uint256, the value it returns should fit in a uint32.\\n */\\n function votingPeriod() external view returns (uint256);\\n\\n /**\\n * @notice module:user-config\\n * @dev Minimum number of cast voted required for a proposal to be successful.\\n *\\n * NOTE: The `timepoint` parameter corresponds to the snapshot used for counting vote. This allows to scale the\\n * quorum depending on values such as the totalSupply of a token at this timepoint (see {ERC20Votes}).\\n */\\n function quorum(uint256 timepoint) external view returns (uint256);\\n\\n /**\\n * @notice module:reputation\\n * @dev Voting power of an `account` at a specific `timepoint`.\\n *\\n * Note: this can be implemented in a number of ways, for example by reading the delegated balance from one (or\\n * multiple), {ERC20Votes} tokens.\\n */\\n function getVotes(address account, uint256 timepoint) external view returns (uint256);\\n\\n /**\\n * @notice module:reputation\\n * @dev Voting power of an `account` at a specific `timepoint` given additional encoded parameters.\\n */\\n function getVotesWithParams(\\n address account,\\n uint256 timepoint,\\n bytes memory params\\n ) external view returns (uint256);\\n\\n /**\\n * @notice module:voting\\n * @dev Returns whether `account` has cast a vote on `proposalId`.\\n */\\n function hasVoted(uint256 proposalId, address account) external view returns (bool);\\n\\n /**\\n * @dev Create a new proposal. Vote start after a delay specified by {IGovernor-votingDelay} and lasts for a\\n * duration specified by {IGovernor-votingPeriod}.\\n *\\n * Emits a {ProposalCreated} event.\\n *\\n * NOTE: The state of the Governor and `targets` may change between the proposal creation and its execution.\\n * This may be the result of third party actions on the targeted contracts, or other governor proposals.\\n * For example, the balance of this contract could be updated or its access control permissions may be modified,\\n * possibly compromising the proposal's ability to execute successfully (e.g. the governor doesn't have enough\\n * value to cover a proposal with multiple transfers).\\n */\\n function propose(\\n address[] memory targets,\\n uint256[] memory values,\\n bytes[] memory calldatas,\\n string memory description\\n ) external returns (uint256 proposalId);\\n\\n /**\\n * @dev Queue a proposal. Some governors require this step to be performed before execution can happen. If queuing\\n * is not necessary, this function may revert.\\n * Queuing a proposal requires the quorum to be reached, the vote to be successful, and the deadline to be reached.\\n *\\n * Emits a {ProposalQueued} event.\\n */\\n function queue(\\n address[] memory targets,\\n uint256[] memory values,\\n bytes[] memory calldatas,\\n bytes32 descriptionHash\\n ) external returns (uint256 proposalId);\\n\\n /**\\n * @dev Execute a successful proposal. This requires the quorum to be reached, the vote to be successful, and the\\n * deadline to be reached. Depending on the governor it might also be required that the proposal was queued and\\n * that some delay passed.\\n *\\n * Emits a {ProposalExecuted} event.\\n *\\n * NOTE: Some modules can modify the requirements for execution, for example by adding an additional timelock.\\n */\\n function execute(\\n address[] memory targets,\\n uint256[] memory values,\\n bytes[] memory calldatas,\\n bytes32 descriptionHash\\n ) external payable returns (uint256 proposalId);\\n\\n /**\\n * @dev Cancel a proposal. A proposal is cancellable by the proposer, but only while it is Pending state, i.e.\\n * before the vote starts.\\n *\\n * Emits a {ProposalCanceled} event.\\n */\\n function cancel(\\n address[] memory targets,\\n uint256[] memory values,\\n bytes[] memory calldatas,\\n bytes32 descriptionHash\\n ) external returns (uint256 proposalId);\\n\\n /**\\n * @dev Cast a vote\\n *\\n * Emits a {VoteCast} event.\\n */\\n function castVote(uint256 proposalId, uint8 support) external returns (uint256 balance);\\n\\n /**\\n * @dev Cast a vote with a reason\\n *\\n * Emits a {VoteCast} event.\\n */\\n function castVoteWithReason(\\n uint256 proposalId,\\n uint8 support,\\n string calldata reason\\n ) external returns (uint256 balance);\\n\\n /**\\n * @dev Cast a vote with a reason and additional encoded parameters\\n *\\n * Emits a {VoteCast} or {VoteCastWithParams} event depending on the length of params.\\n */\\n function castVoteWithReasonAndParams(\\n uint256 proposalId,\\n uint8 support,\\n string calldata reason,\\n bytes memory params\\n ) external returns (uint256 balance);\\n\\n /**\\n * @dev Cast a vote using the voter's signature, including ERC-1271 signature support.\\n *\\n * Emits a {VoteCast} event.\\n */\\n function castVoteBySig(\\n uint256 proposalId,\\n uint8 support,\\n address voter,\\n bytes memory signature\\n ) external returns (uint256 balance);\\n\\n /**\\n * @dev Cast a vote with a reason and additional encoded parameters using the voter's signature,\\n * including ERC-1271 signature support.\\n *\\n * Emits a {VoteCast} or {VoteCastWithParams} event depending on the length of params.\\n */\\n function castVoteWithReasonAndParamsBySig(\\n uint256 proposalId,\\n uint8 support,\\n address voter,\\n string calldata reason,\\n bytes memory params,\\n bytes memory signature\\n ) external returns (uint256 balance);\\n}\\n\",\"keccak256\":\"0x9406604436e6925413ab70149fec16f3b28cc9e492b2baaa09c0acefd315b2a7\",\"license\":\"MIT\"},\"@openzeppelin/contracts/governance/extensions/GovernorCountingSimple.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (governance/extensions/GovernorCountingSimple.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {Governor} from \\\"../Governor.sol\\\";\\n\\n/**\\n * @dev Extension of {Governor} for simple, 3 options, vote counting.\\n */\\nabstract contract GovernorCountingSimple is Governor {\\n /**\\n * @dev Supported vote types. Matches Governor Bravo ordering.\\n */\\n enum VoteType {\\n Against,\\n For,\\n Abstain\\n }\\n\\n struct ProposalVote {\\n uint256 againstVotes;\\n uint256 forVotes;\\n uint256 abstainVotes;\\n mapping(address voter => bool) hasVoted;\\n }\\n\\n mapping(uint256 proposalId => ProposalVote) private _proposalVotes;\\n\\n /**\\n * @dev See {IGovernor-COUNTING_MODE}.\\n */\\n // solhint-disable-next-line func-name-mixedcase\\n function COUNTING_MODE() public pure virtual override returns (string memory) {\\n return \\\"support=bravo&quorum=for,abstain\\\";\\n }\\n\\n /**\\n * @dev See {IGovernor-hasVoted}.\\n */\\n function hasVoted(uint256 proposalId, address account) public view virtual override returns (bool) {\\n return _proposalVotes[proposalId].hasVoted[account];\\n }\\n\\n /**\\n * @dev Accessor to the internal vote counts.\\n */\\n function proposalVotes(\\n uint256 proposalId\\n ) public view virtual returns (uint256 againstVotes, uint256 forVotes, uint256 abstainVotes) {\\n ProposalVote storage proposalVote = _proposalVotes[proposalId];\\n return (proposalVote.againstVotes, proposalVote.forVotes, proposalVote.abstainVotes);\\n }\\n\\n /**\\n * @dev See {Governor-_quorumReached}.\\n */\\n function _quorumReached(uint256 proposalId) internal view virtual override returns (bool) {\\n ProposalVote storage proposalVote = _proposalVotes[proposalId];\\n\\n return quorum(proposalSnapshot(proposalId)) <= proposalVote.forVotes + proposalVote.abstainVotes;\\n }\\n\\n /**\\n * @dev See {Governor-_voteSucceeded}. In this module, the forVotes must be strictly over the againstVotes.\\n */\\n function _voteSucceeded(uint256 proposalId) internal view virtual override returns (bool) {\\n ProposalVote storage proposalVote = _proposalVotes[proposalId];\\n\\n return proposalVote.forVotes > proposalVote.againstVotes;\\n }\\n\\n /**\\n * @dev See {Governor-_countVote}. In this module, the support follows the `VoteType` enum (from Governor Bravo).\\n */\\n function _countVote(\\n uint256 proposalId,\\n address account,\\n uint8 support,\\n uint256 totalWeight,\\n bytes memory // params\\n ) internal virtual override returns (uint256) {\\n ProposalVote storage proposalVote = _proposalVotes[proposalId];\\n\\n if (proposalVote.hasVoted[account]) {\\n revert GovernorAlreadyCastVote(account);\\n }\\n proposalVote.hasVoted[account] = true;\\n\\n if (support == uint8(VoteType.Against)) {\\n proposalVote.againstVotes += totalWeight;\\n } else if (support == uint8(VoteType.For)) {\\n proposalVote.forVotes += totalWeight;\\n } else if (support == uint8(VoteType.Abstain)) {\\n proposalVote.abstainVotes += totalWeight;\\n } else {\\n revert GovernorInvalidVoteType();\\n }\\n\\n return totalWeight;\\n }\\n}\\n\",\"keccak256\":\"0xdc21c15a8582ca58529bf4b63209718a86fd944cbb206a492687333fe8cce0ff\",\"license\":\"MIT\"},\"@openzeppelin/contracts/governance/extensions/GovernorSettings.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (governance/extensions/GovernorSettings.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {Governor} from \\\"../Governor.sol\\\";\\n\\n/**\\n * @dev Extension of {Governor} for settings updatable through governance.\\n */\\nabstract contract GovernorSettings is Governor {\\n // amount of token\\n uint256 private _proposalThreshold;\\n // timepoint: limited to uint48 in core (same as clock() type)\\n uint48 private _votingDelay;\\n // duration: limited to uint32 in core\\n uint32 private _votingPeriod;\\n\\n event VotingDelaySet(uint256 oldVotingDelay, uint256 newVotingDelay);\\n event VotingPeriodSet(uint256 oldVotingPeriod, uint256 newVotingPeriod);\\n event ProposalThresholdSet(uint256 oldProposalThreshold, uint256 newProposalThreshold);\\n\\n /**\\n * @dev Initialize the governance parameters.\\n */\\n constructor(uint48 initialVotingDelay, uint32 initialVotingPeriod, uint256 initialProposalThreshold) {\\n _setVotingDelay(initialVotingDelay);\\n _setVotingPeriod(initialVotingPeriod);\\n _setProposalThreshold(initialProposalThreshold);\\n }\\n\\n /**\\n * @dev See {IGovernor-votingDelay}.\\n */\\n function votingDelay() public view virtual override returns (uint256) {\\n return _votingDelay;\\n }\\n\\n /**\\n * @dev See {IGovernor-votingPeriod}.\\n */\\n function votingPeriod() public view virtual override returns (uint256) {\\n return _votingPeriod;\\n }\\n\\n /**\\n * @dev See {Governor-proposalThreshold}.\\n */\\n function proposalThreshold() public view virtual override returns (uint256) {\\n return _proposalThreshold;\\n }\\n\\n /**\\n * @dev Update the voting delay. This operation can only be performed through a governance proposal.\\n *\\n * Emits a {VotingDelaySet} event.\\n */\\n function setVotingDelay(uint48 newVotingDelay) public virtual onlyGovernance {\\n _setVotingDelay(newVotingDelay);\\n }\\n\\n /**\\n * @dev Update the voting period. This operation can only be performed through a governance proposal.\\n *\\n * Emits a {VotingPeriodSet} event.\\n */\\n function setVotingPeriod(uint32 newVotingPeriod) public virtual onlyGovernance {\\n _setVotingPeriod(newVotingPeriod);\\n }\\n\\n /**\\n * @dev Update the proposal threshold. This operation can only be performed through a governance proposal.\\n *\\n * Emits a {ProposalThresholdSet} event.\\n */\\n function setProposalThreshold(uint256 newProposalThreshold) public virtual onlyGovernance {\\n _setProposalThreshold(newProposalThreshold);\\n }\\n\\n /**\\n * @dev Internal setter for the voting delay.\\n *\\n * Emits a {VotingDelaySet} event.\\n */\\n function _setVotingDelay(uint48 newVotingDelay) internal virtual {\\n emit VotingDelaySet(_votingDelay, newVotingDelay);\\n _votingDelay = newVotingDelay;\\n }\\n\\n /**\\n * @dev Internal setter for the voting period.\\n *\\n * Emits a {VotingPeriodSet} event.\\n */\\n function _setVotingPeriod(uint32 newVotingPeriod) internal virtual {\\n if (newVotingPeriod == 0) {\\n revert GovernorInvalidVotingPeriod(0);\\n }\\n emit VotingPeriodSet(_votingPeriod, newVotingPeriod);\\n _votingPeriod = newVotingPeriod;\\n }\\n\\n /**\\n * @dev Internal setter for the proposal threshold.\\n *\\n * Emits a {ProposalThresholdSet} event.\\n */\\n function _setProposalThreshold(uint256 newProposalThreshold) internal virtual {\\n emit ProposalThresholdSet(_proposalThreshold, newProposalThreshold);\\n _proposalThreshold = newProposalThreshold;\\n }\\n}\\n\",\"keccak256\":\"0x1e0810708b8f5de8d3db73240ccee2d36a305cb904aa5acd4588834ebce6acce\",\"license\":\"MIT\"},\"@openzeppelin/contracts/governance/extensions/GovernorVotes.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (governance/extensions/GovernorVotes.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {Governor} from \\\"../Governor.sol\\\";\\nimport {IVotes} from \\\"../utils/IVotes.sol\\\";\\nimport {IERC5805} from \\\"../../interfaces/IERC5805.sol\\\";\\nimport {SafeCast} from \\\"../../utils/math/SafeCast.sol\\\";\\nimport {Time} from \\\"../../utils/types/Time.sol\\\";\\n\\n/**\\n * @dev Extension of {Governor} for voting weight extraction from an {ERC20Votes} token, or since v4.5 an {ERC721Votes}\\n * token.\\n */\\nabstract contract GovernorVotes is Governor {\\n IERC5805 private immutable _token;\\n\\n constructor(IVotes tokenAddress) {\\n _token = IERC5805(address(tokenAddress));\\n }\\n\\n /**\\n * @dev The token that voting power is sourced from.\\n */\\n function token() public view virtual returns (IERC5805) {\\n return _token;\\n }\\n\\n /**\\n * @dev Clock (as specified in ERC-6372) is set to match the token's clock. Fallback to block numbers if the token\\n * does not implement ERC-6372.\\n */\\n function clock() public view virtual override returns (uint48) {\\n try token().clock() returns (uint48 timepoint) {\\n return timepoint;\\n } catch {\\n return Time.blockNumber();\\n }\\n }\\n\\n /**\\n * @dev Machine-readable description of the clock as specified in ERC-6372.\\n */\\n // solhint-disable-next-line func-name-mixedcase\\n function CLOCK_MODE() public view virtual override returns (string memory) {\\n try token().CLOCK_MODE() returns (string memory clockmode) {\\n return clockmode;\\n } catch {\\n return \\\"mode=blocknumber&from=default\\\";\\n }\\n }\\n\\n /**\\n * Read the voting weight from the token's built in snapshot mechanism (see {Governor-_getVotes}).\\n */\\n function _getVotes(\\n address account,\\n uint256 timepoint,\\n bytes memory /*params*/\\n ) internal view virtual override returns (uint256) {\\n return token().getPastVotes(account, timepoint);\\n }\\n}\\n\",\"keccak256\":\"0x6fc0e9e0c3ed137dc2281a120cdc01b92010a26e6fd5fc4e6af08fc0f28bdb9e\",\"license\":\"MIT\"},\"@openzeppelin/contracts/governance/extensions/GovernorVotesQuorumFraction.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (governance/extensions/GovernorVotesQuorumFraction.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {GovernorVotes} from \\\"./GovernorVotes.sol\\\";\\nimport {SafeCast} from \\\"../../utils/math/SafeCast.sol\\\";\\nimport {Checkpoints} from \\\"../../utils/structs/Checkpoints.sol\\\";\\n\\n/**\\n * @dev Extension of {Governor} for voting weight extraction from an {ERC20Votes} token and a quorum expressed as a\\n * fraction of the total supply.\\n */\\nabstract contract GovernorVotesQuorumFraction is GovernorVotes {\\n using Checkpoints for Checkpoints.Trace208;\\n\\n Checkpoints.Trace208 private _quorumNumeratorHistory;\\n\\n event QuorumNumeratorUpdated(uint256 oldQuorumNumerator, uint256 newQuorumNumerator);\\n\\n /**\\n * @dev The quorum set is not a valid fraction.\\n */\\n error GovernorInvalidQuorumFraction(uint256 quorumNumerator, uint256 quorumDenominator);\\n\\n /**\\n * @dev Initialize quorum as a fraction of the token's total supply.\\n *\\n * The fraction is specified as `numerator / denominator`. By default the denominator is 100, so quorum is\\n * specified as a percent: a numerator of 10 corresponds to quorum being 10% of total supply. The denominator can be\\n * customized by overriding {quorumDenominator}.\\n */\\n constructor(uint256 quorumNumeratorValue) {\\n _updateQuorumNumerator(quorumNumeratorValue);\\n }\\n\\n /**\\n * @dev Returns the current quorum numerator. See {quorumDenominator}.\\n */\\n function quorumNumerator() public view virtual returns (uint256) {\\n return _quorumNumeratorHistory.latest();\\n }\\n\\n /**\\n * @dev Returns the quorum numerator at a specific timepoint. See {quorumDenominator}.\\n */\\n function quorumNumerator(uint256 timepoint) public view virtual returns (uint256) {\\n uint256 length = _quorumNumeratorHistory._checkpoints.length;\\n\\n // Optimistic search, check the latest checkpoint\\n Checkpoints.Checkpoint208 storage latest = _quorumNumeratorHistory._checkpoints[length - 1];\\n uint48 latestKey = latest._key;\\n uint208 latestValue = latest._value;\\n if (latestKey <= timepoint) {\\n return latestValue;\\n }\\n\\n // Otherwise, do the binary search\\n return _quorumNumeratorHistory.upperLookupRecent(SafeCast.toUint48(timepoint));\\n }\\n\\n /**\\n * @dev Returns the quorum denominator. Defaults to 100, but may be overridden.\\n */\\n function quorumDenominator() public view virtual returns (uint256) {\\n return 100;\\n }\\n\\n /**\\n * @dev Returns the quorum for a timepoint, in terms of number of votes: `supply * numerator / denominator`.\\n */\\n function quorum(uint256 timepoint) public view virtual override returns (uint256) {\\n return (token().getPastTotalSupply(timepoint) * quorumNumerator(timepoint)) / quorumDenominator();\\n }\\n\\n /**\\n * @dev Changes the quorum numerator.\\n *\\n * Emits a {QuorumNumeratorUpdated} event.\\n *\\n * Requirements:\\n *\\n * - Must be called through a governance proposal.\\n * - New numerator must be smaller or equal to the denominator.\\n */\\n function updateQuorumNumerator(uint256 newQuorumNumerator) external virtual onlyGovernance {\\n _updateQuorumNumerator(newQuorumNumerator);\\n }\\n\\n /**\\n * @dev Changes the quorum numerator.\\n *\\n * Emits a {QuorumNumeratorUpdated} event.\\n *\\n * Requirements:\\n *\\n * - New numerator must be smaller or equal to the denominator.\\n */\\n function _updateQuorumNumerator(uint256 newQuorumNumerator) internal virtual {\\n uint256 denominator = quorumDenominator();\\n if (newQuorumNumerator > denominator) {\\n revert GovernorInvalidQuorumFraction(newQuorumNumerator, denominator);\\n }\\n\\n uint256 oldQuorumNumerator = quorumNumerator();\\n _quorumNumeratorHistory.push(clock(), SafeCast.toUint208(newQuorumNumerator));\\n\\n emit QuorumNumeratorUpdated(oldQuorumNumerator, newQuorumNumerator);\\n }\\n}\\n\",\"keccak256\":\"0x5b5cdb361ed018c0162942d673c17e187c1a52ded2ce4f41e8a3f3f5d1656e00\",\"license\":\"MIT\"},\"@openzeppelin/contracts/governance/utils/IVotes.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (governance/utils/IVotes.sol)\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Common interface for {ERC20Votes}, {ERC721Votes}, and other {Votes}-enabled contracts.\\n */\\ninterface IVotes {\\n /**\\n * @dev The signature used has expired.\\n */\\n error VotesExpiredSignature(uint256 expiry);\\n\\n /**\\n * @dev Emitted when an account changes their delegate.\\n */\\n event DelegateChanged(address indexed delegator, address indexed fromDelegate, address indexed toDelegate);\\n\\n /**\\n * @dev Emitted when a token transfer or delegate change results in changes to a delegate's number of voting units.\\n */\\n event DelegateVotesChanged(address indexed delegate, uint256 previousVotes, uint256 newVotes);\\n\\n /**\\n * @dev Returns the current amount of votes that `account` has.\\n */\\n function getVotes(address account) external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of votes that `account` had at a specific moment in the past. If the `clock()` is\\n * configured to use block numbers, this will return the value at the end of the corresponding block.\\n */\\n function getPastVotes(address account, uint256 timepoint) external view returns (uint256);\\n\\n /**\\n * @dev Returns the total supply of votes available at a specific moment in the past. If the `clock()` is\\n * configured to use block numbers, this will return the value at the end of the corresponding block.\\n *\\n * NOTE: This value is the sum of all available votes, which is not necessarily the sum of all delegated votes.\\n * Votes that have not been delegated are still part of total supply, even though they would not participate in a\\n * vote.\\n */\\n function getPastTotalSupply(uint256 timepoint) external view returns (uint256);\\n\\n /**\\n * @dev Returns the delegate that `account` has chosen.\\n */\\n function delegates(address account) external view returns (address);\\n\\n /**\\n * @dev Delegates votes from the sender to `delegatee`.\\n */\\n function delegate(address delegatee) external;\\n\\n /**\\n * @dev Delegates votes from signer to `delegatee`.\\n */\\n function delegateBySig(address delegatee, uint256 nonce, uint256 expiry, uint8 v, bytes32 r, bytes32 s) external;\\n}\\n\",\"keccak256\":\"0x5e2b397ae88fd5c68e4f6762eb9f65f65c36702eb57796495f471d024ce70947\",\"license\":\"MIT\"},\"@openzeppelin/contracts/interfaces/IERC1271.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (interfaces/IERC1271.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Interface of the ERC-1271 standard signature validation method for\\n * contracts as defined in https://eips.ethereum.org/EIPS/eip-1271[ERC-1271].\\n */\\ninterface IERC1271 {\\n /**\\n * @dev Should return whether the signature provided is valid for the provided data\\n * @param hash Hash of the data to be signed\\n * @param signature Signature byte array associated with _data\\n */\\n function isValidSignature(bytes32 hash, bytes memory signature) external view returns (bytes4 magicValue);\\n}\\n\",\"keccak256\":\"0x4aaaf1c0737dd16e81f0d2b9833c549747a5ede6873bf1444bc72aa572d03e98\",\"license\":\"MIT\"},\"@openzeppelin/contracts/interfaces/IERC165.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC165.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {IERC165} from \\\"../utils/introspection/IERC165.sol\\\";\\n\",\"keccak256\":\"0xde7e9fd9aee8d4f40772f96bb3b58836cbc6dfc0227014a061947f8821ea9724\",\"license\":\"MIT\"},\"@openzeppelin/contracts/interfaces/IERC5267.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC5267.sol)\\n\\npragma solidity ^0.8.20;\\n\\ninterface IERC5267 {\\n /**\\n * @dev MAY be emitted to signal that the domain could have changed.\\n */\\n event EIP712DomainChanged();\\n\\n /**\\n * @dev returns the fields and values that describe the domain separator used by this contract for EIP-712\\n * signature.\\n */\\n function eip712Domain()\\n external\\n view\\n returns (\\n bytes1 fields,\\n string memory name,\\n string memory version,\\n uint256 chainId,\\n address verifyingContract,\\n bytes32 salt,\\n uint256[] memory extensions\\n );\\n}\\n\",\"keccak256\":\"0x92aa1df62dc3d33f1656d63bede0923e0df0b706ad4137c8b10b0a8fe549fd92\",\"license\":\"MIT\"},\"@openzeppelin/contracts/interfaces/IERC5805.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC5805.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {IVotes} from \\\"../governance/utils/IVotes.sol\\\";\\nimport {IERC6372} from \\\"./IERC6372.sol\\\";\\n\\ninterface IERC5805 is IERC6372, IVotes {}\\n\",\"keccak256\":\"0x4b9b89f91adbb7d3574f85394754cfb08c5b4eafca8a7061e2094a019ab8f818\",\"license\":\"MIT\"},\"@openzeppelin/contracts/interfaces/IERC6372.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC6372.sol)\\n\\npragma solidity ^0.8.20;\\n\\ninterface IERC6372 {\\n /**\\n * @dev Clock used for flagging checkpoints. Can be overridden to implement timestamp based checkpoints (and voting).\\n */\\n function clock() external view returns (uint48);\\n\\n /**\\n * @dev Description of the clock\\n */\\n // solhint-disable-next-line func-name-mixedcase\\n function CLOCK_MODE() external view returns (string memory);\\n}\\n\",\"keccak256\":\"0xeb2857b7dafb7e0d8526dbfe794e6c047df2851c9e6ee91dc4a55f3c34af5d33\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC1155/IERC1155Receiver.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC1155/IERC1155Receiver.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {IERC165} from \\\"../../utils/introspection/IERC165.sol\\\";\\n\\n/**\\n * @dev Interface that must be implemented by smart contracts in order to receive\\n * ERC-1155 token transfers.\\n */\\ninterface IERC1155Receiver is IERC165 {\\n /**\\n * @dev Handles the receipt of a single ERC-1155 token type. This function is\\n * called at the end of a `safeTransferFrom` after the balance has been updated.\\n *\\n * NOTE: To accept the transfer, this must return\\n * `bytes4(keccak256(\\\"onERC1155Received(address,address,uint256,uint256,bytes)\\\"))`\\n * (i.e. 0xf23a6e61, or its own function selector).\\n *\\n * @param operator The address which initiated the transfer (i.e. msg.sender)\\n * @param from The address which previously owned the token\\n * @param id The ID of the token being transferred\\n * @param value The amount of tokens being transferred\\n * @param data Additional data with no specified format\\n * @return `bytes4(keccak256(\\\"onERC1155Received(address,address,uint256,uint256,bytes)\\\"))` if transfer is allowed\\n */\\n function onERC1155Received(\\n address operator,\\n address from,\\n uint256 id,\\n uint256 value,\\n bytes calldata data\\n ) external returns (bytes4);\\n\\n /**\\n * @dev Handles the receipt of a multiple ERC-1155 token types. This function\\n * is called at the end of a `safeBatchTransferFrom` after the balances have\\n * been updated.\\n *\\n * NOTE: To accept the transfer(s), this must return\\n * `bytes4(keccak256(\\\"onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)\\\"))`\\n * (i.e. 0xbc197c81, or its own function selector).\\n *\\n * @param operator The address which initiated the batch transfer (i.e. msg.sender)\\n * @param from The address which previously owned the token\\n * @param ids An array containing ids of each token being transferred (order and length must match values array)\\n * @param values An array containing amounts of each token being transferred (order and length must match ids array)\\n * @param data Additional data with no specified format\\n * @return `bytes4(keccak256(\\\"onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)\\\"))` if transfer is allowed\\n */\\n function onERC1155BatchReceived(\\n address operator,\\n address from,\\n uint256[] calldata ids,\\n uint256[] calldata values,\\n bytes calldata data\\n ) external returns (bytes4);\\n}\\n\",\"keccak256\":\"0x61a23d601c2ab69dd726ac55058604cbda98e1d728ba31a51c379a3f9eeea715\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC721/IERC721Receiver.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @title ERC-721 token receiver interface\\n * @dev Interface for any contract that wants to support safeTransfers\\n * from ERC-721 asset contracts.\\n */\\ninterface IERC721Receiver {\\n /**\\n * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom}\\n * by `operator` from `from`, this function is called.\\n *\\n * It must return its Solidity selector to confirm the token transfer.\\n * If any other value is returned or the interface is not implemented by the recipient, the transfer will be\\n * reverted.\\n *\\n * The selector can be obtained in Solidity with `IERC721Receiver.onERC721Received.selector`.\\n */\\n function onERC721Received(\\n address operator,\\n address from,\\n uint256 tokenId,\\n bytes calldata data\\n ) external returns (bytes4);\\n}\\n\",\"keccak256\":\"0xb5afb8e8eebc4d1c6404df2f5e1e6d2c3d24fd01e5dfc855314951ecfaae462d\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {Errors} from \\\"./Errors.sol\\\";\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev There's no code at `target` (it is not a contract).\\n */\\n error AddressEmptyCode(address target);\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.8.20/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n if (address(this).balance < amount) {\\n revert Errors.InsufficientBalance(address(this).balance, amount);\\n }\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n if (!success) {\\n revert Errors.FailedCall();\\n }\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason or custom error, it is bubbled\\n * up by this function (like regular Solidity function calls). However, if\\n * the call reverted with no returned reason, this function reverts with a\\n * {Errors.FailedCall} error.\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n */\\n function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {\\n if (address(this).balance < value) {\\n revert Errors.InsufficientBalance(address(this).balance, value);\\n }\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResultFromTarget(target, success, returndata);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResultFromTarget(target, success, returndata);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResultFromTarget(target, success, returndata);\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call to smart-contract was successful, and reverts if the target\\n * was not a contract or bubbling up the revert reason (falling back to {Errors.FailedCall}) in case\\n * of an unsuccessful call.\\n */\\n function verifyCallResultFromTarget(\\n address target,\\n bool success,\\n bytes memory returndata\\n ) internal view returns (bytes memory) {\\n if (!success) {\\n _revert(returndata);\\n } else {\\n // only check if target is a contract if the call was successful and the return data is empty\\n // otherwise we already know that it was a contract\\n if (returndata.length == 0 && target.code.length == 0) {\\n revert AddressEmptyCode(target);\\n }\\n return returndata;\\n }\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call was successful, and reverts if it wasn't, either by bubbling the\\n * revert reason or with a default {Errors.FailedCall} error.\\n */\\n function verifyCallResult(bool success, bytes memory returndata) internal pure returns (bytes memory) {\\n if (!success) {\\n _revert(returndata);\\n } else {\\n return returndata;\\n }\\n }\\n\\n /**\\n * @dev Reverts with returndata if present. Otherwise reverts with {Errors.FailedCall}.\\n */\\n function _revert(bytes memory returndata) private pure {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n assembly (\\\"memory-safe\\\") {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert Errors.FailedCall();\\n }\\n }\\n}\\n\",\"keccak256\":\"0x9d8da059267bac779a2dbbb9a26c2acf00ca83085e105d62d5d4ef96054a47f5\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)\\n\\npragma solidity ^0.8.20;\\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\":\"0x493033a8d1b176a037b2cc6a04dad01a5c157722049bbecf632ca876224dd4b2\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Errors.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/Errors.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Collection of common custom errors used in multiple contracts\\n *\\n * IMPORTANT: Backwards compatibility is not guaranteed in future versions of the library.\\n * It is recommended to avoid relying on the error API for critical functionality.\\n *\\n * _Available since v5.1._\\n */\\nlibrary Errors {\\n /**\\n * @dev The ETH balance of the account is not enough to perform the operation.\\n */\\n error InsufficientBalance(uint256 balance, uint256 needed);\\n\\n /**\\n * @dev A call to an address target failed. The target may have reverted.\\n */\\n error FailedCall();\\n\\n /**\\n * @dev The deployment failed.\\n */\\n error FailedDeployment();\\n\\n /**\\n * @dev A necessary precompile is missing.\\n */\\n error MissingPrecompile(address);\\n}\\n\",\"keccak256\":\"0x6afa713bfd42cf0f7656efa91201007ac465e42049d7de1d50753a373648c123\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Nonces.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/Nonces.sol)\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Provides tracking nonces for addresses. Nonces will only increment.\\n */\\nabstract contract Nonces {\\n /**\\n * @dev The nonce used for an `account` is not the expected current nonce.\\n */\\n error InvalidAccountNonce(address account, uint256 currentNonce);\\n\\n mapping(address account => uint256) private _nonces;\\n\\n /**\\n * @dev Returns the next unused nonce for an address.\\n */\\n function nonces(address owner) public view virtual returns (uint256) {\\n return _nonces[owner];\\n }\\n\\n /**\\n * @dev Consumes a nonce.\\n *\\n * Returns the current value and increments nonce.\\n */\\n function _useNonce(address owner) internal virtual returns (uint256) {\\n // For each account, the nonce has an initial value of 0, can only be incremented by one, and cannot be\\n // decremented or reset. This guarantees that the nonce never overflows.\\n unchecked {\\n // It is important to do x++ and not ++x here.\\n return _nonces[owner]++;\\n }\\n }\\n\\n /**\\n * @dev Same as {_useNonce} but checking that `nonce` is the next valid for `owner`.\\n */\\n function _useCheckedNonce(address owner, uint256 nonce) internal virtual {\\n uint256 current = _useNonce(owner);\\n if (nonce != current) {\\n revert InvalidAccountNonce(owner, current);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x0082767004fca261c332e9ad100868327a863a88ef724e844857128845ab350f\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Panic.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/Panic.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Helper library for emitting standardized panic codes.\\n *\\n * ```solidity\\n * contract Example {\\n * using Panic for uint256;\\n *\\n * // Use any of the declared internal constants\\n * function foo() { Panic.GENERIC.panic(); }\\n *\\n * // Alternatively\\n * function foo() { Panic.panic(Panic.GENERIC); }\\n * }\\n * ```\\n *\\n * Follows the list from https://github.com/ethereum/solidity/blob/v0.8.24/libsolutil/ErrorCodes.h[libsolutil].\\n *\\n * _Available since v5.1._\\n */\\n// slither-disable-next-line unused-state\\nlibrary Panic {\\n /// @dev generic / unspecified error\\n uint256 internal constant GENERIC = 0x00;\\n /// @dev used by the assert() builtin\\n uint256 internal constant ASSERT = 0x01;\\n /// @dev arithmetic underflow or overflow\\n uint256 internal constant UNDER_OVERFLOW = 0x11;\\n /// @dev division or modulo by zero\\n uint256 internal constant DIVISION_BY_ZERO = 0x12;\\n /// @dev enum conversion error\\n uint256 internal constant ENUM_CONVERSION_ERROR = 0x21;\\n /// @dev invalid encoding in storage\\n uint256 internal constant STORAGE_ENCODING_ERROR = 0x22;\\n /// @dev empty array pop\\n uint256 internal constant EMPTY_ARRAY_POP = 0x31;\\n /// @dev array out of bounds access\\n uint256 internal constant ARRAY_OUT_OF_BOUNDS = 0x32;\\n /// @dev resource error (too large allocation or too large array)\\n uint256 internal constant RESOURCE_ERROR = 0x41;\\n /// @dev calling invalid internal function\\n uint256 internal constant INVALID_INTERNAL_FUNCTION = 0x51;\\n\\n /// @dev Reverts with a panic code. Recommended to use with\\n /// the internal constants with predefined codes.\\n function panic(uint256 code) internal pure {\\n assembly (\\\"memory-safe\\\") {\\n mstore(0x00, 0x4e487b71)\\n mstore(0x20, code)\\n revert(0x1c, 0x24)\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf7fe324703a64fc51702311dc51562d5cb1497734f074e4f483bfb6717572d7a\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/ShortStrings.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/ShortStrings.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {StorageSlot} from \\\"./StorageSlot.sol\\\";\\n\\n// | string | 0xAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA |\\n// | length | 0x BB |\\ntype ShortString is bytes32;\\n\\n/**\\n * @dev This library provides functions to convert short memory strings\\n * into a `ShortString` type that can be used as an immutable variable.\\n *\\n * Strings of arbitrary length can be optimized using this library if\\n * they are short enough (up to 31 bytes) by packing them with their\\n * length (1 byte) in a single EVM word (32 bytes). Additionally, a\\n * fallback mechanism can be used for every other case.\\n *\\n * Usage example:\\n *\\n * ```solidity\\n * contract Named {\\n * using ShortStrings for *;\\n *\\n * ShortString private immutable _name;\\n * string private _nameFallback;\\n *\\n * constructor(string memory contractName) {\\n * _name = contractName.toShortStringWithFallback(_nameFallback);\\n * }\\n *\\n * function name() external view returns (string memory) {\\n * return _name.toStringWithFallback(_nameFallback);\\n * }\\n * }\\n * ```\\n */\\nlibrary ShortStrings {\\n // Used as an identifier for strings longer than 31 bytes.\\n bytes32 private constant FALLBACK_SENTINEL = 0x00000000000000000000000000000000000000000000000000000000000000FF;\\n\\n error StringTooLong(string str);\\n error InvalidShortString();\\n\\n /**\\n * @dev Encode a string of at most 31 chars into a `ShortString`.\\n *\\n * This will trigger a `StringTooLong` error is the input string is too long.\\n */\\n function toShortString(string memory str) internal pure returns (ShortString) {\\n bytes memory bstr = bytes(str);\\n if (bstr.length > 31) {\\n revert StringTooLong(str);\\n }\\n return ShortString.wrap(bytes32(uint256(bytes32(bstr)) | bstr.length));\\n }\\n\\n /**\\n * @dev Decode a `ShortString` back to a \\\"normal\\\" string.\\n */\\n function toString(ShortString sstr) internal pure returns (string memory) {\\n uint256 len = byteLength(sstr);\\n // using `new string(len)` would work locally but is not memory safe.\\n string memory str = new string(32);\\n assembly (\\\"memory-safe\\\") {\\n mstore(str, len)\\n mstore(add(str, 0x20), sstr)\\n }\\n return str;\\n }\\n\\n /**\\n * @dev Return the length of a `ShortString`.\\n */\\n function byteLength(ShortString sstr) internal pure returns (uint256) {\\n uint256 result = uint256(ShortString.unwrap(sstr)) & 0xFF;\\n if (result > 31) {\\n revert InvalidShortString();\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Encode a string into a `ShortString`, or write it to storage if it is too long.\\n */\\n function toShortStringWithFallback(string memory value, string storage store) internal returns (ShortString) {\\n if (bytes(value).length < 32) {\\n return toShortString(value);\\n } else {\\n StorageSlot.getStringSlot(store).value = value;\\n return ShortString.wrap(FALLBACK_SENTINEL);\\n }\\n }\\n\\n /**\\n * @dev Decode a string that was encoded to `ShortString` or written to storage using {setWithFallback}.\\n */\\n function toStringWithFallback(ShortString value, string storage store) internal pure returns (string memory) {\\n if (ShortString.unwrap(value) != FALLBACK_SENTINEL) {\\n return toString(value);\\n } else {\\n return store;\\n }\\n }\\n\\n /**\\n * @dev Return the length of a string that was encoded to `ShortString` or written to storage using\\n * {setWithFallback}.\\n *\\n * WARNING: This will return the \\\"byte length\\\" of the string. This may not reflect the actual length in terms of\\n * actual characters as the UTF-8 encoding of a single character can span over multiple bytes.\\n */\\n function byteLengthWithFallback(ShortString value, string storage store) internal view returns (uint256) {\\n if (ShortString.unwrap(value) != FALLBACK_SENTINEL) {\\n return byteLength(value);\\n } else {\\n return bytes(store).length;\\n }\\n }\\n}\\n\",\"keccak256\":\"0x7d94fa0af099a2172eb01f9c8a8a443cbe7e0e43654841563e4e09968efdb549\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/StorageSlot.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/StorageSlot.sol)\\n// This file was procedurally generated from scripts/generate/templates/StorageSlot.js.\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Library for reading and writing primitive types to specific storage slots.\\n *\\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\\n * This library helps with reading and writing to such slots without the need for inline assembly.\\n *\\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\\n *\\n * Example usage to set ERC-1967 implementation slot:\\n * ```solidity\\n * contract ERC1967 {\\n * // Define the slot. Alternatively, use the SlotDerivation library to derive the slot.\\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n *\\n * function _getImplementation() internal view returns (address) {\\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n * }\\n *\\n * function _setImplementation(address newImplementation) internal {\\n * require(newImplementation.code.length > 0);\\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n * }\\n * }\\n * ```\\n *\\n * TIP: Consider using this library along with {SlotDerivation}.\\n */\\nlibrary StorageSlot {\\n struct AddressSlot {\\n address value;\\n }\\n\\n struct BooleanSlot {\\n bool value;\\n }\\n\\n struct Bytes32Slot {\\n bytes32 value;\\n }\\n\\n struct Uint256Slot {\\n uint256 value;\\n }\\n\\n struct Int256Slot {\\n int256 value;\\n }\\n\\n struct StringSlot {\\n string value;\\n }\\n\\n struct BytesSlot {\\n bytes value;\\n }\\n\\n /**\\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\\n */\\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\\n assembly (\\\"memory-safe\\\") {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns a `BooleanSlot` with member `value` located at `slot`.\\n */\\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\\n assembly (\\\"memory-safe\\\") {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns a `Bytes32Slot` with member `value` located at `slot`.\\n */\\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\\n assembly (\\\"memory-safe\\\") {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns a `Uint256Slot` with member `value` located at `slot`.\\n */\\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\\n assembly (\\\"memory-safe\\\") {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns a `Int256Slot` with member `value` located at `slot`.\\n */\\n function getInt256Slot(bytes32 slot) internal pure returns (Int256Slot storage r) {\\n assembly (\\\"memory-safe\\\") {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns a `StringSlot` with member `value` located at `slot`.\\n */\\n function getStringSlot(bytes32 slot) internal pure returns (StringSlot storage r) {\\n assembly (\\\"memory-safe\\\") {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `StringSlot` representation of the string storage pointer `store`.\\n */\\n function getStringSlot(string storage store) internal pure returns (StringSlot storage r) {\\n assembly (\\\"memory-safe\\\") {\\n r.slot := store.slot\\n }\\n }\\n\\n /**\\n * @dev Returns a `BytesSlot` with member `value` located at `slot`.\\n */\\n function getBytesSlot(bytes32 slot) internal pure returns (BytesSlot storage r) {\\n assembly (\\\"memory-safe\\\") {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `BytesSlot` representation of the bytes storage pointer `store`.\\n */\\n function getBytesSlot(bytes storage store) internal pure returns (BytesSlot storage r) {\\n assembly (\\\"memory-safe\\\") {\\n r.slot := store.slot\\n }\\n }\\n}\\n\",\"keccak256\":\"0xcf74f855663ce2ae00ed8352666b7935f6cddea2932fdf2c3ecd30a9b1cd0e97\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Strings.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/Strings.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {Math} from \\\"./math/Math.sol\\\";\\nimport {SignedMath} from \\\"./math/SignedMath.sol\\\";\\n\\n/**\\n * @dev String operations.\\n */\\nlibrary Strings {\\n bytes16 private constant HEX_DIGITS = \\\"0123456789abcdef\\\";\\n uint8 private constant ADDRESS_LENGTH = 20;\\n\\n /**\\n * @dev The `value` string doesn't fit in the specified `length`.\\n */\\n error StringsInsufficientHexLength(uint256 value, uint256 length);\\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 assembly (\\\"memory-safe\\\") {\\n ptr := add(buffer, add(32, length))\\n }\\n while (true) {\\n ptr--;\\n assembly (\\\"memory-safe\\\") {\\n mstore8(ptr, byte(mod(value, 10), HEX_DIGITS))\\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 toStringSigned(int256 value) internal pure returns (string memory) {\\n return string.concat(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 uint256 localValue = value;\\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] = HEX_DIGITS[localValue & 0xf];\\n localValue >>= 4;\\n }\\n if (localValue != 0) {\\n revert StringsInsufficientHexLength(value, length);\\n }\\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\\n * 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 Converts an `address` with fixed length of 20 bytes to its checksummed ASCII `string` hexadecimal\\n * representation, according to EIP-55.\\n */\\n function toChecksumHexString(address addr) internal pure returns (string memory) {\\n bytes memory buffer = bytes(toHexString(addr));\\n\\n // hash the hex part of buffer (skip length + 2 bytes, length 40)\\n uint256 hashValue;\\n assembly (\\\"memory-safe\\\") {\\n hashValue := shr(96, keccak256(add(buffer, 0x22), 40))\\n }\\n\\n for (uint256 i = 41; i > 1; --i) {\\n // possible values for buffer[i] are 48 (0) to 57 (9) and 97 (a) to 102 (f)\\n if (hashValue & 0xf > 7 && uint8(buffer[i]) > 96) {\\n // case shift by xoring with 0x20\\n buffer[i] ^= 0x20;\\n }\\n hashValue >>= 4;\\n }\\n return string(buffer);\\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 bytes(a).length == bytes(b).length && keccak256(bytes(a)) == keccak256(bytes(b));\\n }\\n}\\n\",\"keccak256\":\"0x725209b582291bb83058e3078624b53d15a133f7401c30295e7f3704181d2aed\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/cryptography/ECDSA.sol)\\n\\npragma solidity ^0.8.20;\\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 }\\n\\n /**\\n * @dev The signature derives the `address(0)`.\\n */\\n error ECDSAInvalidSignature();\\n\\n /**\\n * @dev The signature has an invalid length.\\n */\\n error ECDSAInvalidSignatureLength(uint256 length);\\n\\n /**\\n * @dev The signature has an S value that is in the upper half order.\\n */\\n error ECDSAInvalidSignatureS(bytes32 s);\\n\\n /**\\n * @dev Returns the address that signed a hashed message (`hash`) with `signature` or an error. This will not\\n * return address(0) without also returning an error description. Errors are documented using an enum (error type)\\n * and a bytes32 providing additional information about the error.\\n *\\n * If no error is returned, then the address can be used for verification purposes.\\n *\\n * The `ecrecover` EVM precompile 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 {MessageHashUtils-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 function tryRecover(\\n bytes32 hash,\\n bytes memory signature\\n ) internal pure returns (address recovered, RecoverError err, bytes32 errArg) {\\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 assembly (\\\"memory-safe\\\") {\\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, bytes32(signature.length));\\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 precompile 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 {MessageHashUtils-toEthSignedMessageHash} on it.\\n */\\n function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {\\n (address recovered, RecoverError error, bytes32 errorArg) = tryRecover(hash, signature);\\n _throwError(error, errorArg);\\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[ERC-2098 short signatures]\\n */\\n function tryRecover(\\n bytes32 hash,\\n bytes32 r,\\n bytes32 vs\\n ) internal pure returns (address recovered, RecoverError err, bytes32 errArg) {\\n unchecked {\\n bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff);\\n // We do not check for an overflow here since the shift operation results in 0 or 1.\\n uint8 v = uint8((uint256(vs) >> 255) + 27);\\n return tryRecover(hash, v, r, s);\\n }\\n }\\n\\n /**\\n * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately.\\n */\\n function recover(bytes32 hash, bytes32 r, bytes32 vs) internal pure returns (address) {\\n (address recovered, RecoverError error, bytes32 errorArg) = tryRecover(hash, r, vs);\\n _throwError(error, errorArg);\\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 function tryRecover(\\n bytes32 hash,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) internal pure returns (address recovered, RecoverError err, bytes32 errArg) {\\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, s);\\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, bytes32(0));\\n }\\n\\n return (signer, RecoverError.NoError, bytes32(0));\\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, bytes32 errorArg) = tryRecover(hash, v, r, s);\\n _throwError(error, errorArg);\\n return recovered;\\n }\\n\\n /**\\n * @dev Optionally reverts with the corresponding custom error according to the `error` argument provided.\\n */\\n function _throwError(RecoverError error, bytes32 errorArg) private pure {\\n if (error == RecoverError.NoError) {\\n return; // no error: do nothing\\n } else if (error == RecoverError.InvalidSignature) {\\n revert ECDSAInvalidSignature();\\n } else if (error == RecoverError.InvalidSignatureLength) {\\n revert ECDSAInvalidSignatureLength(uint256(errorArg));\\n } else if (error == RecoverError.InvalidSignatureS) {\\n revert ECDSAInvalidSignatureS(errorArg);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x69f54c02b7d81d505910ec198c11ed4c6a728418a868b906b4a0cf29946fda84\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/cryptography/EIP712.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/cryptography/EIP712.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {MessageHashUtils} from \\\"./MessageHashUtils.sol\\\";\\nimport {ShortStrings, ShortString} from \\\"../ShortStrings.sol\\\";\\nimport {IERC5267} from \\\"../../interfaces/IERC5267.sol\\\";\\n\\n/**\\n * @dev https://eips.ethereum.org/EIPS/eip-712[EIP-712] is a standard for hashing and signing of typed structured data.\\n *\\n * The encoding scheme specified in the EIP requires a domain separator and a hash of the typed structured data, whose\\n * encoding is very generic and therefore its implementation in Solidity is not feasible, thus this contract\\n * does not implement the encoding itself. Protocols need to implement the type-specific encoding they need in order to\\n * produce the hash of their typed data using a combination of `abi.encode` and `keccak256`.\\n *\\n * This contract implements the EIP-712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding\\n * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA\\n * ({_hashTypedDataV4}).\\n *\\n * The implementation of the domain separator was designed to be as efficient as possible while still properly updating\\n * the chain id to protect against replay attacks on an eventual fork of the chain.\\n *\\n * NOTE: This contract implements the version of the encoding known as \\\"v4\\\", as implemented by the JSON RPC method\\n * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask].\\n *\\n * NOTE: In the upgradeable version of this contract, the cached values will correspond to the address, and the domain\\n * separator of the implementation contract. This will cause the {_domainSeparatorV4} function to always rebuild the\\n * separator from the immutable values, which is cheaper than accessing a cached version in cold storage.\\n *\\n * @custom:oz-upgrades-unsafe-allow state-variable-immutable\\n */\\nabstract contract EIP712 is IERC5267 {\\n using ShortStrings for *;\\n\\n bytes32 private constant TYPE_HASH =\\n keccak256(\\\"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)\\\");\\n\\n // Cache the domain separator as an immutable value, but also store the chain id that it corresponds to, in order to\\n // invalidate the cached domain separator if the chain id changes.\\n bytes32 private immutable _cachedDomainSeparator;\\n uint256 private immutable _cachedChainId;\\n address private immutable _cachedThis;\\n\\n bytes32 private immutable _hashedName;\\n bytes32 private immutable _hashedVersion;\\n\\n ShortString private immutable _name;\\n ShortString private immutable _version;\\n string private _nameFallback;\\n string private _versionFallback;\\n\\n /**\\n * @dev Initializes the domain separator and parameter caches.\\n *\\n * The meaning of `name` and `version` is specified in\\n * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP-712]:\\n *\\n * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol.\\n * - `version`: the current major version of the signing domain.\\n *\\n * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart\\n * contract upgrade].\\n */\\n constructor(string memory name, string memory version) {\\n _name = name.toShortStringWithFallback(_nameFallback);\\n _version = version.toShortStringWithFallback(_versionFallback);\\n _hashedName = keccak256(bytes(name));\\n _hashedVersion = keccak256(bytes(version));\\n\\n _cachedChainId = block.chainid;\\n _cachedDomainSeparator = _buildDomainSeparator();\\n _cachedThis = address(this);\\n }\\n\\n /**\\n * @dev Returns the domain separator for the current chain.\\n */\\n function _domainSeparatorV4() internal view returns (bytes32) {\\n if (address(this) == _cachedThis && block.chainid == _cachedChainId) {\\n return _cachedDomainSeparator;\\n } else {\\n return _buildDomainSeparator();\\n }\\n }\\n\\n function _buildDomainSeparator() private view returns (bytes32) {\\n return keccak256(abi.encode(TYPE_HASH, _hashedName, _hashedVersion, block.chainid, address(this)));\\n }\\n\\n /**\\n * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this\\n * function returns the hash of the fully encoded EIP712 message for this domain.\\n *\\n * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example:\\n *\\n * ```solidity\\n * bytes32 digest = _hashTypedDataV4(keccak256(abi.encode(\\n * keccak256(\\\"Mail(address to,string contents)\\\"),\\n * mailTo,\\n * keccak256(bytes(mailContents))\\n * )));\\n * address signer = ECDSA.recover(digest, signature);\\n * ```\\n */\\n function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) {\\n return MessageHashUtils.toTypedDataHash(_domainSeparatorV4(), structHash);\\n }\\n\\n /**\\n * @dev See {IERC-5267}.\\n */\\n function eip712Domain()\\n public\\n view\\n virtual\\n returns (\\n bytes1 fields,\\n string memory name,\\n string memory version,\\n uint256 chainId,\\n address verifyingContract,\\n bytes32 salt,\\n uint256[] memory extensions\\n )\\n {\\n return (\\n hex\\\"0f\\\", // 01111\\n _EIP712Name(),\\n _EIP712Version(),\\n block.chainid,\\n address(this),\\n bytes32(0),\\n new uint256[](0)\\n );\\n }\\n\\n /**\\n * @dev The name parameter for the EIP712 domain.\\n *\\n * NOTE: By default this function reads _name which is an immutable value.\\n * It only reads from storage if necessary (in case the value is too large to fit in a ShortString).\\n */\\n // solhint-disable-next-line func-name-mixedcase\\n function _EIP712Name() internal view returns (string memory) {\\n return _name.toStringWithFallback(_nameFallback);\\n }\\n\\n /**\\n * @dev The version parameter for the EIP712 domain.\\n *\\n * NOTE: By default this function reads _version which is an immutable value.\\n * It only reads from storage if necessary (in case the value is too large to fit in a ShortString).\\n */\\n // solhint-disable-next-line func-name-mixedcase\\n function _EIP712Version() internal view returns (string memory) {\\n return _version.toStringWithFallback(_versionFallback);\\n }\\n}\\n\",\"keccak256\":\"0x10eb97d047f8d84fe263a02bb4a656ac6674f6679d74532cc37546289e073a9d\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/cryptography/MessageHashUtils.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/cryptography/MessageHashUtils.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {Strings} from \\\"../Strings.sol\\\";\\n\\n/**\\n * @dev Signature message hash utilities for producing digests to be consumed by {ECDSA} recovery or signing.\\n *\\n * The library provides methods for generating a hash of a message that conforms to the\\n * https://eips.ethereum.org/EIPS/eip-191[ERC-191] and https://eips.ethereum.org/EIPS/eip-712[EIP 712]\\n * specifications.\\n */\\nlibrary MessageHashUtils {\\n /**\\n * @dev Returns the keccak256 digest of an ERC-191 signed data with version\\n * `0x45` (`personal_sign` messages).\\n *\\n * The digest is calculated by prefixing a bytes32 `messageHash` with\\n * `\\\"\\\\x19Ethereum Signed Message:\\\\n32\\\"` and hashing the result. It corresponds with the\\n * hash signed when using the https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] JSON-RPC method.\\n *\\n * NOTE: The `messageHash` parameter is intended to be the result of hashing a raw message with\\n * keccak256, although any bytes32 value can be safely used because the final digest will\\n * be re-hashed.\\n *\\n * See {ECDSA-recover}.\\n */\\n function toEthSignedMessageHash(bytes32 messageHash) internal pure returns (bytes32 digest) {\\n assembly (\\\"memory-safe\\\") {\\n mstore(0x00, \\\"\\\\x19Ethereum Signed Message:\\\\n32\\\") // 32 is the bytes-length of messageHash\\n mstore(0x1c, messageHash) // 0x1c (28) is the length of the prefix\\n digest := keccak256(0x00, 0x3c) // 0x3c is the length of the prefix (0x1c) + messageHash (0x20)\\n }\\n }\\n\\n /**\\n * @dev Returns the keccak256 digest of an ERC-191 signed data with version\\n * `0x45` (`personal_sign` messages).\\n *\\n * The digest is calculated by prefixing an arbitrary `message` with\\n * `\\\"\\\\x19Ethereum Signed Message:\\\\n\\\" + len(message)` and hashing the result. It corresponds with the\\n * hash signed when using the https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] JSON-RPC method.\\n *\\n * See {ECDSA-recover}.\\n */\\n function toEthSignedMessageHash(bytes memory message) internal pure returns (bytes32) {\\n return\\n keccak256(bytes.concat(\\\"\\\\x19Ethereum Signed Message:\\\\n\\\", bytes(Strings.toString(message.length)), message));\\n }\\n\\n /**\\n * @dev Returns the keccak256 digest of an ERC-191 signed data with version\\n * `0x00` (data with intended validator).\\n *\\n * The digest is calculated by prefixing an arbitrary `data` with `\\\"\\\\x19\\\\x00\\\"` and the intended\\n * `validator` address. Then hashing the result.\\n *\\n * See {ECDSA-recover}.\\n */\\n function toDataWithIntendedValidatorHash(address validator, bytes memory data) internal pure returns (bytes32) {\\n return keccak256(abi.encodePacked(hex\\\"19_00\\\", validator, data));\\n }\\n\\n /**\\n * @dev Returns the keccak256 digest of an EIP-712 typed data (ERC-191 version `0x01`).\\n *\\n * The digest is calculated from a `domainSeparator` and a `structHash`, by prefixing them with\\n * `\\\\x19\\\\x01` and hashing the result. It corresponds to the hash signed by the\\n * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`] JSON-RPC method as part of EIP-712.\\n *\\n * See {ECDSA-recover}.\\n */\\n function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32 digest) {\\n assembly (\\\"memory-safe\\\") {\\n let ptr := mload(0x40)\\n mstore(ptr, hex\\\"19_01\\\")\\n mstore(add(ptr, 0x02), domainSeparator)\\n mstore(add(ptr, 0x22), structHash)\\n digest := keccak256(ptr, 0x42)\\n }\\n }\\n}\\n\",\"keccak256\":\"0x4515543bc4c78561f6bea83ecfdfc3dead55bd59858287d682045b11de1ae575\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/cryptography/SignatureChecker.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/cryptography/SignatureChecker.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {ECDSA} from \\\"./ECDSA.sol\\\";\\nimport {IERC1271} from \\\"../../interfaces/IERC1271.sol\\\";\\n\\n/**\\n * @dev Signature verification helper that can be used instead of `ECDSA.recover` to seamlessly support both ECDSA\\n * signatures from externally owned accounts (EOAs) as well as ERC-1271 signatures from smart contract wallets like\\n * Argent and Safe Wallet (previously Gnosis Safe).\\n */\\nlibrary SignatureChecker {\\n /**\\n * @dev Checks if a signature is valid for a given signer and data hash. If the signer is a smart contract, the\\n * signature is validated against that smart contract using ERC-1271, otherwise it's validated using `ECDSA.recover`.\\n *\\n * NOTE: Unlike ECDSA signatures, contract signatures are revocable, and the outcome of this function can thus\\n * change through time. It could return true at block N and false at block N+1 (or the opposite).\\n */\\n function isValidSignatureNow(address signer, bytes32 hash, bytes memory signature) internal view returns (bool) {\\n if (signer.code.length == 0) {\\n (address recovered, ECDSA.RecoverError err, ) = ECDSA.tryRecover(hash, signature);\\n return err == ECDSA.RecoverError.NoError && recovered == signer;\\n } else {\\n return isValidERC1271SignatureNow(signer, hash, signature);\\n }\\n }\\n\\n /**\\n * @dev Checks if a signature is valid for a given signer and data hash. The signature is validated\\n * against the signer smart contract using ERC-1271.\\n *\\n * NOTE: Unlike ECDSA signatures, contract signatures are revocable, and the outcome of this function can thus\\n * change through time. It could return true at block N and false at block N+1 (or the opposite).\\n */\\n function isValidERC1271SignatureNow(\\n address signer,\\n bytes32 hash,\\n bytes memory signature\\n ) internal view returns (bool) {\\n (bool success, bytes memory result) = signer.staticcall(\\n abi.encodeCall(IERC1271.isValidSignature, (hash, signature))\\n );\\n return (success &&\\n result.length >= 32 &&\\n abi.decode(result, (bytes32)) == bytes32(IERC1271.isValidSignature.selector));\\n }\\n}\\n\",\"keccak256\":\"0xbdc3bb48ccedb818cd75a6d74a16df55a822e9f6d3cc54c59f576f10aab67b5f\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/introspection/ERC165.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/introspection/ERC165.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {IERC165} from \\\"./IERC165.sol\\\";\\n\\n/**\\n * @dev Implementation of the {IERC165} interface.\\n *\\n * Contracts that want to implement ERC-165 should inherit from this contract and override {supportsInterface} to check\\n * for the additional interface id that will be supported. For example:\\n *\\n * ```solidity\\n * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\\n * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);\\n * }\\n * ```\\n */\\nabstract contract ERC165 is IERC165 {\\n /**\\n * @dev See {IERC165-supportsInterface}.\\n */\\n function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) {\\n return interfaceId == type(IERC165).interfaceId;\\n }\\n}\\n\",\"keccak256\":\"0xddce8e17e3d3f9ed818b4f4c4478a8262aab8b11ed322f1bf5ed705bb4bd97fa\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/introspection/IERC165.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/introspection/IERC165.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Interface of the ERC-165 standard, as defined in the\\n * https://eips.ethereum.org/EIPS/eip-165[ERC].\\n *\\n * Implementers can declare support of contract interfaces, which can then be\\n * queried by others ({ERC165Checker}).\\n *\\n * For an implementation, see {ERC165}.\\n */\\ninterface IERC165 {\\n /**\\n * @dev Returns true if this contract implements the interface defined by\\n * `interfaceId`. See the corresponding\\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[ERC section]\\n * to learn more about how these ids are created.\\n *\\n * This function call must use less than 30 000 gas.\\n */\\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x79796192ec90263f21b464d5bc90b777a525971d3de8232be80d9c4f9fb353b8\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/math/Math.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/math/Math.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {Panic} from \\\"../Panic.sol\\\";\\nimport {SafeCast} from \\\"./SafeCast.sol\\\";\\n\\n/**\\n * @dev Standard math utilities missing in the Solidity language.\\n */\\nlibrary Math {\\n enum Rounding {\\n Floor, // Toward negative infinity\\n Ceil, // Toward positive infinity\\n Trunc, // Toward zero\\n Expand // Away from zero\\n }\\n\\n /**\\n * @dev Returns the addition of two unsigned integers, with an success flag (no overflow).\\n */\\n function tryAdd(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\\n unchecked {\\n uint256 c = a + b;\\n if (c < a) return (false, 0);\\n return (true, c);\\n }\\n }\\n\\n /**\\n * @dev Returns the subtraction of two unsigned integers, with an success flag (no overflow).\\n */\\n function trySub(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\\n unchecked {\\n if (b > a) return (false, 0);\\n return (true, a - b);\\n }\\n }\\n\\n /**\\n * @dev Returns the multiplication of two unsigned integers, with an success flag (no overflow).\\n */\\n function tryMul(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\\n unchecked {\\n // Gas optimization: this is cheaper than requiring 'a' not being zero, but the\\n // benefit is lost if 'b' is also tested.\\n // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522\\n if (a == 0) return (true, 0);\\n uint256 c = a * b;\\n if (c / a != b) return (false, 0);\\n return (true, c);\\n }\\n }\\n\\n /**\\n * @dev Returns the division of two unsigned integers, with a success flag (no division by zero).\\n */\\n function tryDiv(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\\n unchecked {\\n if (b == 0) return (false, 0);\\n return (true, a / b);\\n }\\n }\\n\\n /**\\n * @dev Returns the remainder of dividing two unsigned integers, with a success flag (no division by zero).\\n */\\n function tryMod(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\\n unchecked {\\n if (b == 0) return (false, 0);\\n return (true, a % b);\\n }\\n }\\n\\n /**\\n * @dev Branchless ternary evaluation for `a ? b : c`. Gas costs are constant.\\n *\\n * IMPORTANT: This function may reduce bytecode size and consume less gas when used standalone.\\n * However, the compiler may optimize Solidity ternary operations (i.e. `a ? b : c`) to only compute\\n * one branch when needed, making this function more expensive.\\n */\\n function ternary(bool condition, uint256 a, uint256 b) internal pure returns (uint256) {\\n unchecked {\\n // branchless ternary works because:\\n // b ^ (a ^ b) == a\\n // b ^ 0 == b\\n return b ^ ((a ^ b) * SafeCast.toUint(condition));\\n }\\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 ternary(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 ternary(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 towards infinity instead\\n * of rounding towards zero.\\n */\\n function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {\\n if (b == 0) {\\n // Guarantee the same behavior as in a regular Solidity division.\\n Panic.panic(Panic.DIVISION_BY_ZERO);\\n }\\n\\n // The following calculation ensures accurate ceiling division without overflow.\\n // Since a is non-zero, (a - 1) / b will not overflow.\\n // The largest possible result occurs when (a - 1) / b is type(uint256).max,\\n // but the largest value we can obtain is type(uint256).max - 1, which happens\\n // when a = type(uint256).max and b = 1.\\n unchecked {\\n return SafeCast.toUint(a > 0) * ((a - 1) / b + 1);\\n }\\n }\\n\\n /**\\n * @dev Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or\\n * denominator == 0.\\n *\\n * Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv) with further edits by\\n * 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\\u00b2\\u2075\\u2076 and mod 2\\u00b2\\u2075\\u2076 - 1, then use\\n // the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256\\n // variables such that product = prod1 * 2\\u00b2\\u2075\\u2076 + prod0.\\n uint256 prod0 = x * y; // 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 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\\u00b2\\u2075\\u2076. Also prevents denominator == 0.\\n if (denominator <= prod1) {\\n Panic.panic(ternary(denominator == 0, Panic.DIVISION_BY_ZERO, Panic.UNDER_OVERFLOW));\\n }\\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.\\n // Always >= 1. See https://cs.stackexchange.com/q/138556/92363.\\n\\n uint256 twos = denominator & (0 - denominator);\\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\\u00b2\\u2075\\u2076 / 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\\u00b2\\u2075\\u2076. Now that denominator is an odd number, it has an inverse modulo 2\\u00b2\\u2075\\u2076 such\\n // that denominator * inv \\u2261 1 mod 2\\u00b2\\u2075\\u2076. Compute the inverse by starting with a seed that is correct for\\n // four bits. That is, denominator * inv \\u2261 1 mod 2\\u2074.\\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\\n // works in modular arithmetic, doubling the correct bits in each step.\\n inverse *= 2 - denominator * inverse; // inverse mod 2\\u2078\\n inverse *= 2 - denominator * inverse; // inverse mod 2\\u00b9\\u2076\\n inverse *= 2 - denominator * inverse; // inverse mod 2\\u00b3\\u00b2\\n inverse *= 2 - denominator * inverse; // inverse mod 2\\u2076\\u2074\\n inverse *= 2 - denominator * inverse; // inverse mod 2\\u00b9\\u00b2\\u2078\\n inverse *= 2 - denominator * inverse; // inverse mod 2\\u00b2\\u2075\\u2076\\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\\u00b2\\u2075\\u2076. Since the preconditions guarantee that the outcome is\\n // less than 2\\u00b2\\u2075\\u2076, 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 * @dev 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 return mulDiv(x, y, denominator) + SafeCast.toUint(unsignedRoundsUp(rounding) && mulmod(x, y, denominator) > 0);\\n }\\n\\n /**\\n * @dev Calculate the modular multiplicative inverse of a number in Z/nZ.\\n *\\n * If n is a prime, then Z/nZ is a field. In that case all elements are inversible, except 0.\\n * If n is not a prime, then Z/nZ is not a field, and some elements might not be inversible.\\n *\\n * If the input value is not inversible, 0 is returned.\\n *\\n * NOTE: If you know for sure that n is (big) a prime, it may be cheaper to use Fermat's little theorem and get the\\n * inverse using `Math.modExp(a, n - 2, n)`. See {invModPrime}.\\n */\\n function invMod(uint256 a, uint256 n) internal pure returns (uint256) {\\n unchecked {\\n if (n == 0) return 0;\\n\\n // The inverse modulo is calculated using the Extended Euclidean Algorithm (iterative version)\\n // Used to compute integers x and y such that: ax + ny = gcd(a, n).\\n // When the gcd is 1, then the inverse of a modulo n exists and it's x.\\n // ax + ny = 1\\n // ax = 1 + (-y)n\\n // ax \\u2261 1 (mod n) # x is the inverse of a modulo n\\n\\n // If the remainder is 0 the gcd is n right away.\\n uint256 remainder = a % n;\\n uint256 gcd = n;\\n\\n // Therefore the initial coefficients are:\\n // ax + ny = gcd(a, n) = n\\n // 0a + 1n = n\\n int256 x = 0;\\n int256 y = 1;\\n\\n while (remainder != 0) {\\n uint256 quotient = gcd / remainder;\\n\\n (gcd, remainder) = (\\n // The old remainder is the next gcd to try.\\n remainder,\\n // Compute the next remainder.\\n // Can't overflow given that (a % gcd) * (gcd // (a % gcd)) <= gcd\\n // where gcd is at most n (capped to type(uint256).max)\\n gcd - remainder * quotient\\n );\\n\\n (x, y) = (\\n // Increment the coefficient of a.\\n y,\\n // Decrement the coefficient of n.\\n // Can overflow, but the result is casted to uint256 so that the\\n // next value of y is \\\"wrapped around\\\" to a value between 0 and n - 1.\\n x - y * int256(quotient)\\n );\\n }\\n\\n if (gcd != 1) return 0; // No inverse exists.\\n return ternary(x < 0, n - uint256(-x), uint256(x)); // Wrap the result if it's negative.\\n }\\n }\\n\\n /**\\n * @dev Variant of {invMod}. More efficient, but only works if `p` is known to be a prime greater than `2`.\\n *\\n * From https://en.wikipedia.org/wiki/Fermat%27s_little_theorem[Fermat's little theorem], we know that if p is\\n * prime, then `a**(p-1) \\u2261 1 mod p`. As a consequence, we have `a * a**(p-2) \\u2261 1 mod p`, which means that\\n * `a**(p-2)` is the modular multiplicative inverse of a in Fp.\\n *\\n * NOTE: this function does NOT check that `p` is a prime greater than `2`.\\n */\\n function invModPrime(uint256 a, uint256 p) internal view returns (uint256) {\\n unchecked {\\n return Math.modExp(a, p - 2, p);\\n }\\n }\\n\\n /**\\n * @dev Returns the modular exponentiation of the specified base, exponent and modulus (b ** e % m)\\n *\\n * Requirements:\\n * - modulus can't be zero\\n * - underlying staticcall to precompile must succeed\\n *\\n * IMPORTANT: The result is only valid if the underlying call succeeds. When using this function, make\\n * sure the chain you're using it on supports the precompiled contract for modular exponentiation\\n * at address 0x05 as specified in https://eips.ethereum.org/EIPS/eip-198[EIP-198]. Otherwise,\\n * the underlying function will succeed given the lack of a revert, but the result may be incorrectly\\n * interpreted as 0.\\n */\\n function modExp(uint256 b, uint256 e, uint256 m) internal view returns (uint256) {\\n (bool success, uint256 result) = tryModExp(b, e, m);\\n if (!success) {\\n Panic.panic(Panic.DIVISION_BY_ZERO);\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Returns the modular exponentiation of the specified base, exponent and modulus (b ** e % m).\\n * It includes a success flag indicating if the operation succeeded. Operation will be marked as failed if trying\\n * to operate modulo 0 or if the underlying precompile reverted.\\n *\\n * IMPORTANT: The result is only valid if the success flag is true. When using this function, make sure the chain\\n * you're using it on supports the precompiled contract for modular exponentiation at address 0x05 as specified in\\n * https://eips.ethereum.org/EIPS/eip-198[EIP-198]. Otherwise, the underlying function will succeed given the lack\\n * of a revert, but the result may be incorrectly interpreted as 0.\\n */\\n function tryModExp(uint256 b, uint256 e, uint256 m) internal view returns (bool success, uint256 result) {\\n if (m == 0) return (false, 0);\\n assembly (\\\"memory-safe\\\") {\\n let ptr := mload(0x40)\\n // | Offset | Content | Content (Hex) |\\n // |-----------|------------|--------------------------------------------------------------------|\\n // | 0x00:0x1f | size of b | 0x0000000000000000000000000000000000000000000000000000000000000020 |\\n // | 0x20:0x3f | size of e | 0x0000000000000000000000000000000000000000000000000000000000000020 |\\n // | 0x40:0x5f | size of m | 0x0000000000000000000000000000000000000000000000000000000000000020 |\\n // | 0x60:0x7f | value of b | 0x<.............................................................b> |\\n // | 0x80:0x9f | value of e | 0x<.............................................................e> |\\n // | 0xa0:0xbf | value of m | 0x<.............................................................m> |\\n mstore(ptr, 0x20)\\n mstore(add(ptr, 0x20), 0x20)\\n mstore(add(ptr, 0x40), 0x20)\\n mstore(add(ptr, 0x60), b)\\n mstore(add(ptr, 0x80), e)\\n mstore(add(ptr, 0xa0), m)\\n\\n // Given the result < m, it's guaranteed to fit in 32 bytes,\\n // so we can use the memory scratch space located at offset 0.\\n success := staticcall(gas(), 0x05, ptr, 0xc0, 0x00, 0x20)\\n result := mload(0x00)\\n }\\n }\\n\\n /**\\n * @dev Variant of {modExp} that supports inputs of arbitrary length.\\n */\\n function modExp(bytes memory b, bytes memory e, bytes memory m) internal view returns (bytes memory) {\\n (bool success, bytes memory result) = tryModExp(b, e, m);\\n if (!success) {\\n Panic.panic(Panic.DIVISION_BY_ZERO);\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Variant of {tryModExp} that supports inputs of arbitrary length.\\n */\\n function tryModExp(\\n bytes memory b,\\n bytes memory e,\\n bytes memory m\\n ) internal view returns (bool success, bytes memory result) {\\n if (_zeroBytes(m)) return (false, new bytes(0));\\n\\n uint256 mLen = m.length;\\n\\n // Encode call args in result and move the free memory pointer\\n result = abi.encodePacked(b.length, e.length, mLen, b, e, m);\\n\\n assembly (\\\"memory-safe\\\") {\\n let dataPtr := add(result, 0x20)\\n // Write result on top of args to avoid allocating extra memory.\\n success := staticcall(gas(), 0x05, dataPtr, mload(result), dataPtr, mLen)\\n // Overwrite the length.\\n // result.length > returndatasize() is guaranteed because returndatasize() == m.length\\n mstore(result, mLen)\\n // Set the memory pointer after the returned data.\\n mstore(0x40, add(dataPtr, mLen))\\n }\\n }\\n\\n /**\\n * @dev Returns whether the provided byte array is zero.\\n */\\n function _zeroBytes(bytes memory byteArray) private pure returns (bool) {\\n for (uint256 i = 0; i < byteArray.length; ++i) {\\n if (byteArray[i] != 0) {\\n return false;\\n }\\n }\\n return true;\\n }\\n\\n /**\\n * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded\\n * towards zero.\\n *\\n * This method is based on Newton's method for computing square roots; the algorithm is restricted to only\\n * using integer operations.\\n */\\n function sqrt(uint256 a) internal pure returns (uint256) {\\n unchecked {\\n // Take care of easy edge cases when a == 0 or a == 1\\n if (a <= 1) {\\n return a;\\n }\\n\\n // In this function, we use Newton's method to get a root of `f(x) := x\\u00b2 - a`. It involves building a\\n // sequence x_n that converges toward sqrt(a). For each iteration x_n, we also define the error between\\n // the current value as `\\u03b5_n = | x_n - sqrt(a) |`.\\n //\\n // For our first estimation, we consider `e` the smallest power of 2 which is bigger than the square root\\n // of the target. (i.e. `2**(e-1) \\u2264 sqrt(a) < 2**e`). We know that `e \\u2264 128` because `(2\\u00b9\\u00b2\\u2078)\\u00b2 = 2\\u00b2\\u2075\\u2076` is\\n // bigger than any uint256.\\n //\\n // By noticing that\\n // `2**(e-1) \\u2264 sqrt(a) < 2**e \\u2192 (2**(e-1))\\u00b2 \\u2264 a < (2**e)\\u00b2 \\u2192 2**(2*e-2) \\u2264 a < 2**(2*e)`\\n // we can deduce that `e - 1` is `log2(a) / 2`. We can thus compute `x_n = 2**(e-1)` using a method similar\\n // to the msb function.\\n uint256 aa = a;\\n uint256 xn = 1;\\n\\n if (aa >= (1 << 128)) {\\n aa >>= 128;\\n xn <<= 64;\\n }\\n if (aa >= (1 << 64)) {\\n aa >>= 64;\\n xn <<= 32;\\n }\\n if (aa >= (1 << 32)) {\\n aa >>= 32;\\n xn <<= 16;\\n }\\n if (aa >= (1 << 16)) {\\n aa >>= 16;\\n xn <<= 8;\\n }\\n if (aa >= (1 << 8)) {\\n aa >>= 8;\\n xn <<= 4;\\n }\\n if (aa >= (1 << 4)) {\\n aa >>= 4;\\n xn <<= 2;\\n }\\n if (aa >= (1 << 2)) {\\n xn <<= 1;\\n }\\n\\n // We now have x_n such that `x_n = 2**(e-1) \\u2264 sqrt(a) < 2**e = 2 * x_n`. This implies \\u03b5_n \\u2264 2**(e-1).\\n //\\n // We can refine our estimation by noticing that the middle of that interval minimizes the error.\\n // If we move x_n to equal 2**(e-1) + 2**(e-2), then we reduce the error to \\u03b5_n \\u2264 2**(e-2).\\n // This is going to be our x_0 (and \\u03b5_0)\\n xn = (3 * xn) >> 1; // \\u03b5_0 := | x_0 - sqrt(a) | \\u2264 2**(e-2)\\n\\n // From here, Newton's method give us:\\n // x_{n+1} = (x_n + a / x_n) / 2\\n //\\n // One should note that:\\n // x_{n+1}\\u00b2 - a = ((x_n + a / x_n) / 2)\\u00b2 - a\\n // = ((x_n\\u00b2 + a) / (2 * x_n))\\u00b2 - a\\n // = (x_n\\u2074 + 2 * a * x_n\\u00b2 + a\\u00b2) / (4 * x_n\\u00b2) - a\\n // = (x_n\\u2074 + 2 * a * x_n\\u00b2 + a\\u00b2 - 4 * a * x_n\\u00b2) / (4 * x_n\\u00b2)\\n // = (x_n\\u2074 - 2 * a * x_n\\u00b2 + a\\u00b2) / (4 * x_n\\u00b2)\\n // = (x_n\\u00b2 - a)\\u00b2 / (2 * x_n)\\u00b2\\n // = ((x_n\\u00b2 - a) / (2 * x_n))\\u00b2\\n // \\u2265 0\\n // Which proves that for all n \\u2265 1, sqrt(a) \\u2264 x_n\\n //\\n // This gives us the proof of quadratic convergence of the sequence:\\n // \\u03b5_{n+1} = | x_{n+1} - sqrt(a) |\\n // = | (x_n + a / x_n) / 2 - sqrt(a) |\\n // = | (x_n\\u00b2 + a - 2*x_n*sqrt(a)) / (2 * x_n) |\\n // = | (x_n - sqrt(a))\\u00b2 / (2 * x_n) |\\n // = | \\u03b5_n\\u00b2 / (2 * x_n) |\\n // = \\u03b5_n\\u00b2 / | (2 * x_n) |\\n //\\n // For the first iteration, we have a special case where x_0 is known:\\n // \\u03b5_1 = \\u03b5_0\\u00b2 / | (2 * x_0) |\\n // \\u2264 (2**(e-2))\\u00b2 / (2 * (2**(e-1) + 2**(e-2)))\\n // \\u2264 2**(2*e-4) / (3 * 2**(e-1))\\n // \\u2264 2**(e-3) / 3\\n // \\u2264 2**(e-3-log2(3))\\n // \\u2264 2**(e-4.5)\\n //\\n // For the following iterations, we use the fact that, 2**(e-1) \\u2264 sqrt(a) \\u2264 x_n:\\n // \\u03b5_{n+1} = \\u03b5_n\\u00b2 / | (2 * x_n) |\\n // \\u2264 (2**(e-k))\\u00b2 / (2 * 2**(e-1))\\n // \\u2264 2**(2*e-2*k) / 2**e\\n // \\u2264 2**(e-2*k)\\n xn = (xn + a / xn) >> 1; // \\u03b5_1 := | x_1 - sqrt(a) | \\u2264 2**(e-4.5) -- special case, see above\\n xn = (xn + a / xn) >> 1; // \\u03b5_2 := | x_2 - sqrt(a) | \\u2264 2**(e-9) -- general case with k = 4.5\\n xn = (xn + a / xn) >> 1; // \\u03b5_3 := | x_3 - sqrt(a) | \\u2264 2**(e-18) -- general case with k = 9\\n xn = (xn + a / xn) >> 1; // \\u03b5_4 := | x_4 - sqrt(a) | \\u2264 2**(e-36) -- general case with k = 18\\n xn = (xn + a / xn) >> 1; // \\u03b5_5 := | x_5 - sqrt(a) | \\u2264 2**(e-72) -- general case with k = 36\\n xn = (xn + a / xn) >> 1; // \\u03b5_6 := | x_6 - sqrt(a) | \\u2264 2**(e-144) -- general case with k = 72\\n\\n // Because e \\u2264 128 (as discussed during the first estimation phase), we know have reached a precision\\n // \\u03b5_6 \\u2264 2**(e-144) < 1. Given we're operating on integers, then we can ensure that xn is now either\\n // sqrt(a) or sqrt(a) + 1.\\n return xn - SafeCast.toUint(xn > a / xn);\\n }\\n }\\n\\n /**\\n * @dev 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 + SafeCast.toUint(unsignedRoundsUp(rounding) && result * result < a);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 2 of a positive value rounded towards zero.\\n * Returns 0 if given 0.\\n */\\n function log2(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n uint256 exp;\\n unchecked {\\n exp = 128 * SafeCast.toUint(value > (1 << 128) - 1);\\n value >>= exp;\\n result += exp;\\n\\n exp = 64 * SafeCast.toUint(value > (1 << 64) - 1);\\n value >>= exp;\\n result += exp;\\n\\n exp = 32 * SafeCast.toUint(value > (1 << 32) - 1);\\n value >>= exp;\\n result += exp;\\n\\n exp = 16 * SafeCast.toUint(value > (1 << 16) - 1);\\n value >>= exp;\\n result += exp;\\n\\n exp = 8 * SafeCast.toUint(value > (1 << 8) - 1);\\n value >>= exp;\\n result += exp;\\n\\n exp = 4 * SafeCast.toUint(value > (1 << 4) - 1);\\n value >>= exp;\\n result += exp;\\n\\n exp = 2 * SafeCast.toUint(value > (1 << 2) - 1);\\n value >>= exp;\\n result += exp;\\n\\n result += SafeCast.toUint(value > 1);\\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 + SafeCast.toUint(unsignedRoundsUp(rounding) && 1 << result < value);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 10 of a positive value rounded towards zero.\\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 + SafeCast.toUint(unsignedRoundsUp(rounding) && 10 ** result < value);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 256 of a positive value rounded towards zero.\\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 uint256 isGt;\\n unchecked {\\n isGt = SafeCast.toUint(value > (1 << 128) - 1);\\n value >>= isGt * 128;\\n result += isGt * 16;\\n\\n isGt = SafeCast.toUint(value > (1 << 64) - 1);\\n value >>= isGt * 64;\\n result += isGt * 8;\\n\\n isGt = SafeCast.toUint(value > (1 << 32) - 1);\\n value >>= isGt * 32;\\n result += isGt * 4;\\n\\n isGt = SafeCast.toUint(value > (1 << 16) - 1);\\n value >>= isGt * 16;\\n result += isGt * 2;\\n\\n result += SafeCast.toUint(value > (1 << 8) - 1);\\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 + SafeCast.toUint(unsignedRoundsUp(rounding) && 1 << (result << 3) < value);\\n }\\n }\\n\\n /**\\n * @dev Returns whether a provided rounding mode is considered rounding up for unsigned integers.\\n */\\n function unsignedRoundsUp(Rounding rounding) internal pure returns (bool) {\\n return uint8(rounding) % 2 == 1;\\n }\\n}\\n\",\"keccak256\":\"0xa00be322d7db5786750ce0ac7e2f5b633ac30a5ed5fa1ced1e74acfc19acecea\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/math/SafeCast.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/math/SafeCast.sol)\\n// This file was procedurally generated from scripts/generate/templates/SafeCast.js.\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Wrappers over Solidity's uintXX/intXX/bool casting operators with added overflow\\n * checks.\\n *\\n * Downcasting from uint256/int256 in Solidity does not revert on overflow. This can\\n * easily result in undesired exploitation or bugs, since developers usually\\n * assume that overflows raise errors. `SafeCast` restores this intuition by\\n * reverting the transaction when such an operation overflows.\\n *\\n * Using this library instead of the unchecked operations eliminates an entire\\n * class of bugs, so it's recommended to use it always.\\n */\\nlibrary SafeCast {\\n /**\\n * @dev Value doesn't fit in an uint of `bits` size.\\n */\\n error SafeCastOverflowedUintDowncast(uint8 bits, uint256 value);\\n\\n /**\\n * @dev An int value doesn't fit in an uint of `bits` size.\\n */\\n error SafeCastOverflowedIntToUint(int256 value);\\n\\n /**\\n * @dev Value doesn't fit in an int of `bits` size.\\n */\\n error SafeCastOverflowedIntDowncast(uint8 bits, int256 value);\\n\\n /**\\n * @dev An uint value doesn't fit in an int of `bits` size.\\n */\\n error SafeCastOverflowedUintToInt(uint256 value);\\n\\n /**\\n * @dev Returns the downcasted uint248 from uint256, reverting on\\n * overflow (when the input is greater than largest uint248).\\n *\\n * Counterpart to Solidity's `uint248` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 248 bits\\n */\\n function toUint248(uint256 value) internal pure returns (uint248) {\\n if (value > type(uint248).max) {\\n revert SafeCastOverflowedUintDowncast(248, value);\\n }\\n return uint248(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint240 from uint256, reverting on\\n * overflow (when the input is greater than largest uint240).\\n *\\n * Counterpart to Solidity's `uint240` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 240 bits\\n */\\n function toUint240(uint256 value) internal pure returns (uint240) {\\n if (value > type(uint240).max) {\\n revert SafeCastOverflowedUintDowncast(240, value);\\n }\\n return uint240(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint232 from uint256, reverting on\\n * overflow (when the input is greater than largest uint232).\\n *\\n * Counterpart to Solidity's `uint232` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 232 bits\\n */\\n function toUint232(uint256 value) internal pure returns (uint232) {\\n if (value > type(uint232).max) {\\n revert SafeCastOverflowedUintDowncast(232, value);\\n }\\n return uint232(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint224 from uint256, reverting on\\n * overflow (when the input is greater than largest uint224).\\n *\\n * Counterpart to Solidity's `uint224` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 224 bits\\n */\\n function toUint224(uint256 value) internal pure returns (uint224) {\\n if (value > type(uint224).max) {\\n revert SafeCastOverflowedUintDowncast(224, value);\\n }\\n return uint224(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint216 from uint256, reverting on\\n * overflow (when the input is greater than largest uint216).\\n *\\n * Counterpart to Solidity's `uint216` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 216 bits\\n */\\n function toUint216(uint256 value) internal pure returns (uint216) {\\n if (value > type(uint216).max) {\\n revert SafeCastOverflowedUintDowncast(216, value);\\n }\\n return uint216(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint208 from uint256, reverting on\\n * overflow (when the input is greater than largest uint208).\\n *\\n * Counterpart to Solidity's `uint208` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 208 bits\\n */\\n function toUint208(uint256 value) internal pure returns (uint208) {\\n if (value > type(uint208).max) {\\n revert SafeCastOverflowedUintDowncast(208, value);\\n }\\n return uint208(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint200 from uint256, reverting on\\n * overflow (when the input is greater than largest uint200).\\n *\\n * Counterpart to Solidity's `uint200` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 200 bits\\n */\\n function toUint200(uint256 value) internal pure returns (uint200) {\\n if (value > type(uint200).max) {\\n revert SafeCastOverflowedUintDowncast(200, value);\\n }\\n return uint200(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint192 from uint256, reverting on\\n * overflow (when the input is greater than largest uint192).\\n *\\n * Counterpart to Solidity's `uint192` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 192 bits\\n */\\n function toUint192(uint256 value) internal pure returns (uint192) {\\n if (value > type(uint192).max) {\\n revert SafeCastOverflowedUintDowncast(192, value);\\n }\\n return uint192(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint184 from uint256, reverting on\\n * overflow (when the input is greater than largest uint184).\\n *\\n * Counterpart to Solidity's `uint184` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 184 bits\\n */\\n function toUint184(uint256 value) internal pure returns (uint184) {\\n if (value > type(uint184).max) {\\n revert SafeCastOverflowedUintDowncast(184, value);\\n }\\n return uint184(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint176 from uint256, reverting on\\n * overflow (when the input is greater than largest uint176).\\n *\\n * Counterpart to Solidity's `uint176` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 176 bits\\n */\\n function toUint176(uint256 value) internal pure returns (uint176) {\\n if (value > type(uint176).max) {\\n revert SafeCastOverflowedUintDowncast(176, value);\\n }\\n return uint176(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint168 from uint256, reverting on\\n * overflow (when the input is greater than largest uint168).\\n *\\n * Counterpart to Solidity's `uint168` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 168 bits\\n */\\n function toUint168(uint256 value) internal pure returns (uint168) {\\n if (value > type(uint168).max) {\\n revert SafeCastOverflowedUintDowncast(168, value);\\n }\\n return uint168(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint160 from uint256, reverting on\\n * overflow (when the input is greater than largest uint160).\\n *\\n * Counterpart to Solidity's `uint160` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 160 bits\\n */\\n function toUint160(uint256 value) internal pure returns (uint160) {\\n if (value > type(uint160).max) {\\n revert SafeCastOverflowedUintDowncast(160, value);\\n }\\n return uint160(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint152 from uint256, reverting on\\n * overflow (when the input is greater than largest uint152).\\n *\\n * Counterpart to Solidity's `uint152` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 152 bits\\n */\\n function toUint152(uint256 value) internal pure returns (uint152) {\\n if (value > type(uint152).max) {\\n revert SafeCastOverflowedUintDowncast(152, value);\\n }\\n return uint152(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint144 from uint256, reverting on\\n * overflow (when the input is greater than largest uint144).\\n *\\n * Counterpart to Solidity's `uint144` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 144 bits\\n */\\n function toUint144(uint256 value) internal pure returns (uint144) {\\n if (value > type(uint144).max) {\\n revert SafeCastOverflowedUintDowncast(144, value);\\n }\\n return uint144(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint136 from uint256, reverting on\\n * overflow (when the input is greater than largest uint136).\\n *\\n * Counterpart to Solidity's `uint136` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 136 bits\\n */\\n function toUint136(uint256 value) internal pure returns (uint136) {\\n if (value > type(uint136).max) {\\n revert SafeCastOverflowedUintDowncast(136, value);\\n }\\n return uint136(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint128 from uint256, reverting on\\n * overflow (when the input is greater than largest uint128).\\n *\\n * Counterpart to Solidity's `uint128` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 128 bits\\n */\\n function toUint128(uint256 value) internal pure returns (uint128) {\\n if (value > type(uint128).max) {\\n revert SafeCastOverflowedUintDowncast(128, value);\\n }\\n return uint128(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint120 from uint256, reverting on\\n * overflow (when the input is greater than largest uint120).\\n *\\n * Counterpart to Solidity's `uint120` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 120 bits\\n */\\n function toUint120(uint256 value) internal pure returns (uint120) {\\n if (value > type(uint120).max) {\\n revert SafeCastOverflowedUintDowncast(120, value);\\n }\\n return uint120(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint112 from uint256, reverting on\\n * overflow (when the input is greater than largest uint112).\\n *\\n * Counterpart to Solidity's `uint112` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 112 bits\\n */\\n function toUint112(uint256 value) internal pure returns (uint112) {\\n if (value > type(uint112).max) {\\n revert SafeCastOverflowedUintDowncast(112, value);\\n }\\n return uint112(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint104 from uint256, reverting on\\n * overflow (when the input is greater than largest uint104).\\n *\\n * Counterpart to Solidity's `uint104` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 104 bits\\n */\\n function toUint104(uint256 value) internal pure returns (uint104) {\\n if (value > type(uint104).max) {\\n revert SafeCastOverflowedUintDowncast(104, value);\\n }\\n return uint104(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint96 from uint256, reverting on\\n * overflow (when the input is greater than largest uint96).\\n *\\n * Counterpart to Solidity's `uint96` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 96 bits\\n */\\n function toUint96(uint256 value) internal pure returns (uint96) {\\n if (value > type(uint96).max) {\\n revert SafeCastOverflowedUintDowncast(96, value);\\n }\\n return uint96(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint88 from uint256, reverting on\\n * overflow (when the input is greater than largest uint88).\\n *\\n * Counterpart to Solidity's `uint88` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 88 bits\\n */\\n function toUint88(uint256 value) internal pure returns (uint88) {\\n if (value > type(uint88).max) {\\n revert SafeCastOverflowedUintDowncast(88, value);\\n }\\n return uint88(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint80 from uint256, reverting on\\n * overflow (when the input is greater than largest uint80).\\n *\\n * Counterpart to Solidity's `uint80` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 80 bits\\n */\\n function toUint80(uint256 value) internal pure returns (uint80) {\\n if (value > type(uint80).max) {\\n revert SafeCastOverflowedUintDowncast(80, value);\\n }\\n return uint80(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint72 from uint256, reverting on\\n * overflow (when the input is greater than largest uint72).\\n *\\n * Counterpart to Solidity's `uint72` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 72 bits\\n */\\n function toUint72(uint256 value) internal pure returns (uint72) {\\n if (value > type(uint72).max) {\\n revert SafeCastOverflowedUintDowncast(72, value);\\n }\\n return uint72(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint64 from uint256, reverting on\\n * overflow (when the input is greater than largest uint64).\\n *\\n * Counterpart to Solidity's `uint64` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 64 bits\\n */\\n function toUint64(uint256 value) internal pure returns (uint64) {\\n if (value > type(uint64).max) {\\n revert SafeCastOverflowedUintDowncast(64, value);\\n }\\n return uint64(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint56 from uint256, reverting on\\n * overflow (when the input is greater than largest uint56).\\n *\\n * Counterpart to Solidity's `uint56` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 56 bits\\n */\\n function toUint56(uint256 value) internal pure returns (uint56) {\\n if (value > type(uint56).max) {\\n revert SafeCastOverflowedUintDowncast(56, value);\\n }\\n return uint56(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint48 from uint256, reverting on\\n * overflow (when the input is greater than largest uint48).\\n *\\n * Counterpart to Solidity's `uint48` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 48 bits\\n */\\n function toUint48(uint256 value) internal pure returns (uint48) {\\n if (value > type(uint48).max) {\\n revert SafeCastOverflowedUintDowncast(48, value);\\n }\\n return uint48(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint40 from uint256, reverting on\\n * overflow (when the input is greater than largest uint40).\\n *\\n * Counterpart to Solidity's `uint40` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 40 bits\\n */\\n function toUint40(uint256 value) internal pure returns (uint40) {\\n if (value > type(uint40).max) {\\n revert SafeCastOverflowedUintDowncast(40, value);\\n }\\n return uint40(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint32 from uint256, reverting on\\n * overflow (when the input is greater than largest uint32).\\n *\\n * Counterpart to Solidity's `uint32` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 32 bits\\n */\\n function toUint32(uint256 value) internal pure returns (uint32) {\\n if (value > type(uint32).max) {\\n revert SafeCastOverflowedUintDowncast(32, value);\\n }\\n return uint32(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint24 from uint256, reverting on\\n * overflow (when the input is greater than largest uint24).\\n *\\n * Counterpart to Solidity's `uint24` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 24 bits\\n */\\n function toUint24(uint256 value) internal pure returns (uint24) {\\n if (value > type(uint24).max) {\\n revert SafeCastOverflowedUintDowncast(24, value);\\n }\\n return uint24(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint16 from uint256, reverting on\\n * overflow (when the input is greater than largest uint16).\\n *\\n * Counterpart to Solidity's `uint16` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 16 bits\\n */\\n function toUint16(uint256 value) internal pure returns (uint16) {\\n if (value > type(uint16).max) {\\n revert SafeCastOverflowedUintDowncast(16, value);\\n }\\n return uint16(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint8 from uint256, reverting on\\n * overflow (when the input is greater than largest uint8).\\n *\\n * Counterpart to Solidity's `uint8` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 8 bits\\n */\\n function toUint8(uint256 value) internal pure returns (uint8) {\\n if (value > type(uint8).max) {\\n revert SafeCastOverflowedUintDowncast(8, value);\\n }\\n return uint8(value);\\n }\\n\\n /**\\n * @dev Converts a signed int256 into an unsigned uint256.\\n *\\n * Requirements:\\n *\\n * - input must be greater than or equal to 0.\\n */\\n function toUint256(int256 value) internal pure returns (uint256) {\\n if (value < 0) {\\n revert SafeCastOverflowedIntToUint(value);\\n }\\n return uint256(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted int248 from int256, reverting on\\n * overflow (when the input is less than smallest int248 or\\n * greater than largest int248).\\n *\\n * Counterpart to Solidity's `int248` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 248 bits\\n */\\n function toInt248(int256 value) internal pure returns (int248 downcasted) {\\n downcasted = int248(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(248, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int240 from int256, reverting on\\n * overflow (when the input is less than smallest int240 or\\n * greater than largest int240).\\n *\\n * Counterpart to Solidity's `int240` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 240 bits\\n */\\n function toInt240(int256 value) internal pure returns (int240 downcasted) {\\n downcasted = int240(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(240, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int232 from int256, reverting on\\n * overflow (when the input is less than smallest int232 or\\n * greater than largest int232).\\n *\\n * Counterpart to Solidity's `int232` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 232 bits\\n */\\n function toInt232(int256 value) internal pure returns (int232 downcasted) {\\n downcasted = int232(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(232, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int224 from int256, reverting on\\n * overflow (when the input is less than smallest int224 or\\n * greater than largest int224).\\n *\\n * Counterpart to Solidity's `int224` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 224 bits\\n */\\n function toInt224(int256 value) internal pure returns (int224 downcasted) {\\n downcasted = int224(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(224, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int216 from int256, reverting on\\n * overflow (when the input is less than smallest int216 or\\n * greater than largest int216).\\n *\\n * Counterpart to Solidity's `int216` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 216 bits\\n */\\n function toInt216(int256 value) internal pure returns (int216 downcasted) {\\n downcasted = int216(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(216, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int208 from int256, reverting on\\n * overflow (when the input is less than smallest int208 or\\n * greater than largest int208).\\n *\\n * Counterpart to Solidity's `int208` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 208 bits\\n */\\n function toInt208(int256 value) internal pure returns (int208 downcasted) {\\n downcasted = int208(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(208, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int200 from int256, reverting on\\n * overflow (when the input is less than smallest int200 or\\n * greater than largest int200).\\n *\\n * Counterpart to Solidity's `int200` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 200 bits\\n */\\n function toInt200(int256 value) internal pure returns (int200 downcasted) {\\n downcasted = int200(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(200, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int192 from int256, reverting on\\n * overflow (when the input is less than smallest int192 or\\n * greater than largest int192).\\n *\\n * Counterpart to Solidity's `int192` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 192 bits\\n */\\n function toInt192(int256 value) internal pure returns (int192 downcasted) {\\n downcasted = int192(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(192, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int184 from int256, reverting on\\n * overflow (when the input is less than smallest int184 or\\n * greater than largest int184).\\n *\\n * Counterpart to Solidity's `int184` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 184 bits\\n */\\n function toInt184(int256 value) internal pure returns (int184 downcasted) {\\n downcasted = int184(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(184, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int176 from int256, reverting on\\n * overflow (when the input is less than smallest int176 or\\n * greater than largest int176).\\n *\\n * Counterpart to Solidity's `int176` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 176 bits\\n */\\n function toInt176(int256 value) internal pure returns (int176 downcasted) {\\n downcasted = int176(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(176, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int168 from int256, reverting on\\n * overflow (when the input is less than smallest int168 or\\n * greater than largest int168).\\n *\\n * Counterpart to Solidity's `int168` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 168 bits\\n */\\n function toInt168(int256 value) internal pure returns (int168 downcasted) {\\n downcasted = int168(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(168, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int160 from int256, reverting on\\n * overflow (when the input is less than smallest int160 or\\n * greater than largest int160).\\n *\\n * Counterpart to Solidity's `int160` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 160 bits\\n */\\n function toInt160(int256 value) internal pure returns (int160 downcasted) {\\n downcasted = int160(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(160, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int152 from int256, reverting on\\n * overflow (when the input is less than smallest int152 or\\n * greater than largest int152).\\n *\\n * Counterpart to Solidity's `int152` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 152 bits\\n */\\n function toInt152(int256 value) internal pure returns (int152 downcasted) {\\n downcasted = int152(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(152, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int144 from int256, reverting on\\n * overflow (when the input is less than smallest int144 or\\n * greater than largest int144).\\n *\\n * Counterpart to Solidity's `int144` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 144 bits\\n */\\n function toInt144(int256 value) internal pure returns (int144 downcasted) {\\n downcasted = int144(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(144, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int136 from int256, reverting on\\n * overflow (when the input is less than smallest int136 or\\n * greater than largest int136).\\n *\\n * Counterpart to Solidity's `int136` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 136 bits\\n */\\n function toInt136(int256 value) internal pure returns (int136 downcasted) {\\n downcasted = int136(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(136, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int128 from int256, reverting on\\n * overflow (when the input is less than smallest int128 or\\n * greater than largest int128).\\n *\\n * Counterpart to Solidity's `int128` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 128 bits\\n */\\n function toInt128(int256 value) internal pure returns (int128 downcasted) {\\n downcasted = int128(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(128, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int120 from int256, reverting on\\n * overflow (when the input is less than smallest int120 or\\n * greater than largest int120).\\n *\\n * Counterpart to Solidity's `int120` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 120 bits\\n */\\n function toInt120(int256 value) internal pure returns (int120 downcasted) {\\n downcasted = int120(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(120, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int112 from int256, reverting on\\n * overflow (when the input is less than smallest int112 or\\n * greater than largest int112).\\n *\\n * Counterpart to Solidity's `int112` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 112 bits\\n */\\n function toInt112(int256 value) internal pure returns (int112 downcasted) {\\n downcasted = int112(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(112, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int104 from int256, reverting on\\n * overflow (when the input is less than smallest int104 or\\n * greater than largest int104).\\n *\\n * Counterpart to Solidity's `int104` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 104 bits\\n */\\n function toInt104(int256 value) internal pure returns (int104 downcasted) {\\n downcasted = int104(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(104, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int96 from int256, reverting on\\n * overflow (when the input is less than smallest int96 or\\n * greater than largest int96).\\n *\\n * Counterpart to Solidity's `int96` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 96 bits\\n */\\n function toInt96(int256 value) internal pure returns (int96 downcasted) {\\n downcasted = int96(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(96, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int88 from int256, reverting on\\n * overflow (when the input is less than smallest int88 or\\n * greater than largest int88).\\n *\\n * Counterpart to Solidity's `int88` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 88 bits\\n */\\n function toInt88(int256 value) internal pure returns (int88 downcasted) {\\n downcasted = int88(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(88, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int80 from int256, reverting on\\n * overflow (when the input is less than smallest int80 or\\n * greater than largest int80).\\n *\\n * Counterpart to Solidity's `int80` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 80 bits\\n */\\n function toInt80(int256 value) internal pure returns (int80 downcasted) {\\n downcasted = int80(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(80, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int72 from int256, reverting on\\n * overflow (when the input is less than smallest int72 or\\n * greater than largest int72).\\n *\\n * Counterpart to Solidity's `int72` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 72 bits\\n */\\n function toInt72(int256 value) internal pure returns (int72 downcasted) {\\n downcasted = int72(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(72, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int64 from int256, reverting on\\n * overflow (when the input is less than smallest int64 or\\n * greater than largest int64).\\n *\\n * Counterpart to Solidity's `int64` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 64 bits\\n */\\n function toInt64(int256 value) internal pure returns (int64 downcasted) {\\n downcasted = int64(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(64, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int56 from int256, reverting on\\n * overflow (when the input is less than smallest int56 or\\n * greater than largest int56).\\n *\\n * Counterpart to Solidity's `int56` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 56 bits\\n */\\n function toInt56(int256 value) internal pure returns (int56 downcasted) {\\n downcasted = int56(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(56, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int48 from int256, reverting on\\n * overflow (when the input is less than smallest int48 or\\n * greater than largest int48).\\n *\\n * Counterpart to Solidity's `int48` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 48 bits\\n */\\n function toInt48(int256 value) internal pure returns (int48 downcasted) {\\n downcasted = int48(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(48, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int40 from int256, reverting on\\n * overflow (when the input is less than smallest int40 or\\n * greater than largest int40).\\n *\\n * Counterpart to Solidity's `int40` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 40 bits\\n */\\n function toInt40(int256 value) internal pure returns (int40 downcasted) {\\n downcasted = int40(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(40, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int32 from int256, reverting on\\n * overflow (when the input is less than smallest int32 or\\n * greater than largest int32).\\n *\\n * Counterpart to Solidity's `int32` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 32 bits\\n */\\n function toInt32(int256 value) internal pure returns (int32 downcasted) {\\n downcasted = int32(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(32, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int24 from int256, reverting on\\n * overflow (when the input is less than smallest int24 or\\n * greater than largest int24).\\n *\\n * Counterpart to Solidity's `int24` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 24 bits\\n */\\n function toInt24(int256 value) internal pure returns (int24 downcasted) {\\n downcasted = int24(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(24, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int16 from int256, reverting on\\n * overflow (when the input is less than smallest int16 or\\n * greater than largest int16).\\n *\\n * Counterpart to Solidity's `int16` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 16 bits\\n */\\n function toInt16(int256 value) internal pure returns (int16 downcasted) {\\n downcasted = int16(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(16, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int8 from int256, reverting on\\n * overflow (when the input is less than smallest int8 or\\n * greater than largest int8).\\n *\\n * Counterpart to Solidity's `int8` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 8 bits\\n */\\n function toInt8(int256 value) internal pure returns (int8 downcasted) {\\n downcasted = int8(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(8, value);\\n }\\n }\\n\\n /**\\n * @dev Converts an unsigned uint256 into a signed int256.\\n *\\n * Requirements:\\n *\\n * - input must be less than or equal to maxInt256.\\n */\\n function toInt256(uint256 value) internal pure returns (int256) {\\n // Note: Unsafe cast below is okay because `type(int256).max` is guaranteed to be positive\\n if (value > uint256(type(int256).max)) {\\n revert SafeCastOverflowedUintToInt(value);\\n }\\n return int256(value);\\n }\\n\\n /**\\n * @dev Cast a boolean (false or true) to a uint256 (0 or 1) with no jump.\\n */\\n function toUint(bool b) internal pure returns (uint256 u) {\\n assembly (\\\"memory-safe\\\") {\\n u := iszero(iszero(b))\\n }\\n }\\n}\\n\",\"keccak256\":\"0x195533c86d0ef72bcc06456a4f66a9b941f38eb403739b00f21fd7c1abd1ae54\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/math/SignedMath.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/math/SignedMath.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {SafeCast} from \\\"./SafeCast.sol\\\";\\n\\n/**\\n * @dev Standard signed math utilities missing in the Solidity language.\\n */\\nlibrary SignedMath {\\n /**\\n * @dev Branchless ternary evaluation for `a ? b : c`. Gas costs are constant.\\n *\\n * IMPORTANT: This function may reduce bytecode size and consume less gas when used standalone.\\n * However, the compiler may optimize Solidity ternary operations (i.e. `a ? b : c`) to only compute\\n * one branch when needed, making this function more expensive.\\n */\\n function ternary(bool condition, int256 a, int256 b) internal pure returns (int256) {\\n unchecked {\\n // branchless ternary works because:\\n // b ^ (a ^ b) == a\\n // b ^ 0 == b\\n return b ^ ((a ^ b) * int256(SafeCast.toUint(condition)));\\n }\\n }\\n\\n /**\\n * @dev Returns the largest of two signed numbers.\\n */\\n function max(int256 a, int256 b) internal pure returns (int256) {\\n return ternary(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 ternary(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 // Formula from the \\\"Bit Twiddling Hacks\\\" by Sean Eron Anderson.\\n // Since `n` is a signed integer, the generated bytecode will use the SAR opcode to perform the right shift,\\n // taking advantage of the most significant (or \\\"sign\\\" bit) in two's complement representation.\\n // This opcode adds new most significant bits set to the value of the previous most significant bit. As a result,\\n // the mask will either be `bytes32(0)` (if n is positive) or `~bytes32(0)` (if n is negative).\\n int256 mask = n >> 255;\\n\\n // A `bytes32(0)` mask leaves the input unchanged, while a `~bytes32(0)` mask complements it.\\n return uint256((n + mask) ^ mask);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xb1970fac7b64e6c09611e6691791e848d5e3fe410fa5899e7df2e0afd77a99e3\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/structs/Checkpoints.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/structs/Checkpoints.sol)\\n// This file was procedurally generated from scripts/generate/templates/Checkpoints.js.\\n\\npragma solidity ^0.8.20;\\n\\nimport {Math} from \\\"../math/Math.sol\\\";\\n\\n/**\\n * @dev This library defines the `Trace*` struct, for checkpointing values as they change at different points in\\n * time, and later looking up past values by block number. See {Votes} as an example.\\n *\\n * To create a history of checkpoints define a variable type `Checkpoints.Trace*` in your contract, and store a new\\n * checkpoint for the current transaction block using the {push} function.\\n */\\nlibrary Checkpoints {\\n /**\\n * @dev A value was attempted to be inserted on a past checkpoint.\\n */\\n error CheckpointUnorderedInsertion();\\n\\n struct Trace224 {\\n Checkpoint224[] _checkpoints;\\n }\\n\\n struct Checkpoint224 {\\n uint32 _key;\\n uint224 _value;\\n }\\n\\n /**\\n * @dev Pushes a (`key`, `value`) pair into a Trace224 so that it is stored as the checkpoint.\\n *\\n * Returns previous value and new value.\\n *\\n * IMPORTANT: Never accept `key` as a user input, since an arbitrary `type(uint32).max` key set will disable the\\n * library.\\n */\\n function push(\\n Trace224 storage self,\\n uint32 key,\\n uint224 value\\n ) internal returns (uint224 oldValue, uint224 newValue) {\\n return _insert(self._checkpoints, key, value);\\n }\\n\\n /**\\n * @dev Returns the value in the first (oldest) checkpoint with key greater or equal than the search key, or zero if\\n * there is none.\\n */\\n function lowerLookup(Trace224 storage self, uint32 key) internal view returns (uint224) {\\n uint256 len = self._checkpoints.length;\\n uint256 pos = _lowerBinaryLookup(self._checkpoints, key, 0, len);\\n return pos == len ? 0 : _unsafeAccess(self._checkpoints, pos)._value;\\n }\\n\\n /**\\n * @dev Returns the value in the last (most recent) checkpoint with key lower or equal than the search key, or zero\\n * if there is none.\\n */\\n function upperLookup(Trace224 storage self, uint32 key) internal view returns (uint224) {\\n uint256 len = self._checkpoints.length;\\n uint256 pos = _upperBinaryLookup(self._checkpoints, key, 0, len);\\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\\n }\\n\\n /**\\n * @dev Returns the value in the last (most recent) checkpoint with key lower or equal than the search key, or zero\\n * if there is none.\\n *\\n * NOTE: This is a variant of {upperLookup} that is optimised to find \\\"recent\\\" checkpoint (checkpoints with high\\n * keys).\\n */\\n function upperLookupRecent(Trace224 storage self, uint32 key) internal view returns (uint224) {\\n uint256 len = self._checkpoints.length;\\n\\n uint256 low = 0;\\n uint256 high = len;\\n\\n if (len > 5) {\\n uint256 mid = len - Math.sqrt(len);\\n if (key < _unsafeAccess(self._checkpoints, mid)._key) {\\n high = mid;\\n } else {\\n low = mid + 1;\\n }\\n }\\n\\n uint256 pos = _upperBinaryLookup(self._checkpoints, key, low, high);\\n\\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\\n }\\n\\n /**\\n * @dev Returns the value in the most recent checkpoint, or zero if there are no checkpoints.\\n */\\n function latest(Trace224 storage self) internal view returns (uint224) {\\n uint256 pos = self._checkpoints.length;\\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\\n }\\n\\n /**\\n * @dev Returns whether there is a checkpoint in the structure (i.e. it is not empty), and if so the key and value\\n * in the most recent checkpoint.\\n */\\n function latestCheckpoint(Trace224 storage self) internal view returns (bool exists, uint32 _key, uint224 _value) {\\n uint256 pos = self._checkpoints.length;\\n if (pos == 0) {\\n return (false, 0, 0);\\n } else {\\n Checkpoint224 storage ckpt = _unsafeAccess(self._checkpoints, pos - 1);\\n return (true, ckpt._key, ckpt._value);\\n }\\n }\\n\\n /**\\n * @dev Returns the number of checkpoint.\\n */\\n function length(Trace224 storage self) internal view returns (uint256) {\\n return self._checkpoints.length;\\n }\\n\\n /**\\n * @dev Returns checkpoint at given position.\\n */\\n function at(Trace224 storage self, uint32 pos) internal view returns (Checkpoint224 memory) {\\n return self._checkpoints[pos];\\n }\\n\\n /**\\n * @dev Pushes a (`key`, `value`) pair into an ordered list of checkpoints, either by inserting a new checkpoint,\\n * or by updating the last one.\\n */\\n function _insert(\\n Checkpoint224[] storage self,\\n uint32 key,\\n uint224 value\\n ) private returns (uint224 oldValue, uint224 newValue) {\\n uint256 pos = self.length;\\n\\n if (pos > 0) {\\n Checkpoint224 storage last = _unsafeAccess(self, pos - 1);\\n uint32 lastKey = last._key;\\n uint224 lastValue = last._value;\\n\\n // Checkpoint keys must be non-decreasing.\\n if (lastKey > key) {\\n revert CheckpointUnorderedInsertion();\\n }\\n\\n // Update or push new checkpoint\\n if (lastKey == key) {\\n last._value = value;\\n } else {\\n self.push(Checkpoint224({_key: key, _value: value}));\\n }\\n return (lastValue, value);\\n } else {\\n self.push(Checkpoint224({_key: key, _value: value}));\\n return (0, value);\\n }\\n }\\n\\n /**\\n * @dev Return the index of the first (oldest) checkpoint with key strictly bigger than the search key, or `high`\\n * if there is none. `low` and `high` define a section where to do the search, with inclusive `low` and exclusive\\n * `high`.\\n *\\n * WARNING: `high` should not be greater than the array's length.\\n */\\n function _upperBinaryLookup(\\n Checkpoint224[] storage self,\\n uint32 key,\\n uint256 low,\\n uint256 high\\n ) private view returns (uint256) {\\n while (low < high) {\\n uint256 mid = Math.average(low, high);\\n if (_unsafeAccess(self, mid)._key > key) {\\n high = mid;\\n } else {\\n low = mid + 1;\\n }\\n }\\n return high;\\n }\\n\\n /**\\n * @dev Return the index of the first (oldest) checkpoint with key greater or equal than the search key, or `high`\\n * if there is none. `low` and `high` define a section where to do the search, with inclusive `low` and exclusive\\n * `high`.\\n *\\n * WARNING: `high` should not be greater than the array's length.\\n */\\n function _lowerBinaryLookup(\\n Checkpoint224[] storage self,\\n uint32 key,\\n uint256 low,\\n uint256 high\\n ) private view returns (uint256) {\\n while (low < high) {\\n uint256 mid = Math.average(low, high);\\n if (_unsafeAccess(self, mid)._key < key) {\\n low = mid + 1;\\n } else {\\n high = mid;\\n }\\n }\\n return high;\\n }\\n\\n /**\\n * @dev Access an element of the array without performing bounds check. The position is assumed to be within bounds.\\n */\\n function _unsafeAccess(\\n Checkpoint224[] storage self,\\n uint256 pos\\n ) private pure returns (Checkpoint224 storage result) {\\n assembly {\\n mstore(0, self.slot)\\n result.slot := add(keccak256(0, 0x20), pos)\\n }\\n }\\n\\n struct Trace208 {\\n Checkpoint208[] _checkpoints;\\n }\\n\\n struct Checkpoint208 {\\n uint48 _key;\\n uint208 _value;\\n }\\n\\n /**\\n * @dev Pushes a (`key`, `value`) pair into a Trace208 so that it is stored as the checkpoint.\\n *\\n * Returns previous value and new value.\\n *\\n * IMPORTANT: Never accept `key` as a user input, since an arbitrary `type(uint48).max` key set will disable the\\n * library.\\n */\\n function push(\\n Trace208 storage self,\\n uint48 key,\\n uint208 value\\n ) internal returns (uint208 oldValue, uint208 newValue) {\\n return _insert(self._checkpoints, key, value);\\n }\\n\\n /**\\n * @dev Returns the value in the first (oldest) checkpoint with key greater or equal than the search key, or zero if\\n * there is none.\\n */\\n function lowerLookup(Trace208 storage self, uint48 key) internal view returns (uint208) {\\n uint256 len = self._checkpoints.length;\\n uint256 pos = _lowerBinaryLookup(self._checkpoints, key, 0, len);\\n return pos == len ? 0 : _unsafeAccess(self._checkpoints, pos)._value;\\n }\\n\\n /**\\n * @dev Returns the value in the last (most recent) checkpoint with key lower or equal than the search key, or zero\\n * if there is none.\\n */\\n function upperLookup(Trace208 storage self, uint48 key) internal view returns (uint208) {\\n uint256 len = self._checkpoints.length;\\n uint256 pos = _upperBinaryLookup(self._checkpoints, key, 0, len);\\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\\n }\\n\\n /**\\n * @dev Returns the value in the last (most recent) checkpoint with key lower or equal than the search key, or zero\\n * if there is none.\\n *\\n * NOTE: This is a variant of {upperLookup} that is optimised to find \\\"recent\\\" checkpoint (checkpoints with high\\n * keys).\\n */\\n function upperLookupRecent(Trace208 storage self, uint48 key) internal view returns (uint208) {\\n uint256 len = self._checkpoints.length;\\n\\n uint256 low = 0;\\n uint256 high = len;\\n\\n if (len > 5) {\\n uint256 mid = len - Math.sqrt(len);\\n if (key < _unsafeAccess(self._checkpoints, mid)._key) {\\n high = mid;\\n } else {\\n low = mid + 1;\\n }\\n }\\n\\n uint256 pos = _upperBinaryLookup(self._checkpoints, key, low, high);\\n\\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\\n }\\n\\n /**\\n * @dev Returns the value in the most recent checkpoint, or zero if there are no checkpoints.\\n */\\n function latest(Trace208 storage self) internal view returns (uint208) {\\n uint256 pos = self._checkpoints.length;\\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\\n }\\n\\n /**\\n * @dev Returns whether there is a checkpoint in the structure (i.e. it is not empty), and if so the key and value\\n * in the most recent checkpoint.\\n */\\n function latestCheckpoint(Trace208 storage self) internal view returns (bool exists, uint48 _key, uint208 _value) {\\n uint256 pos = self._checkpoints.length;\\n if (pos == 0) {\\n return (false, 0, 0);\\n } else {\\n Checkpoint208 storage ckpt = _unsafeAccess(self._checkpoints, pos - 1);\\n return (true, ckpt._key, ckpt._value);\\n }\\n }\\n\\n /**\\n * @dev Returns the number of checkpoint.\\n */\\n function length(Trace208 storage self) internal view returns (uint256) {\\n return self._checkpoints.length;\\n }\\n\\n /**\\n * @dev Returns checkpoint at given position.\\n */\\n function at(Trace208 storage self, uint32 pos) internal view returns (Checkpoint208 memory) {\\n return self._checkpoints[pos];\\n }\\n\\n /**\\n * @dev Pushes a (`key`, `value`) pair into an ordered list of checkpoints, either by inserting a new checkpoint,\\n * or by updating the last one.\\n */\\n function _insert(\\n Checkpoint208[] storage self,\\n uint48 key,\\n uint208 value\\n ) private returns (uint208 oldValue, uint208 newValue) {\\n uint256 pos = self.length;\\n\\n if (pos > 0) {\\n Checkpoint208 storage last = _unsafeAccess(self, pos - 1);\\n uint48 lastKey = last._key;\\n uint208 lastValue = last._value;\\n\\n // Checkpoint keys must be non-decreasing.\\n if (lastKey > key) {\\n revert CheckpointUnorderedInsertion();\\n }\\n\\n // Update or push new checkpoint\\n if (lastKey == key) {\\n last._value = value;\\n } else {\\n self.push(Checkpoint208({_key: key, _value: value}));\\n }\\n return (lastValue, value);\\n } else {\\n self.push(Checkpoint208({_key: key, _value: value}));\\n return (0, value);\\n }\\n }\\n\\n /**\\n * @dev Return the index of the first (oldest) checkpoint with key strictly bigger than the search key, or `high`\\n * if there is none. `low` and `high` define a section where to do the search, with inclusive `low` and exclusive\\n * `high`.\\n *\\n * WARNING: `high` should not be greater than the array's length.\\n */\\n function _upperBinaryLookup(\\n Checkpoint208[] storage self,\\n uint48 key,\\n uint256 low,\\n uint256 high\\n ) private view returns (uint256) {\\n while (low < high) {\\n uint256 mid = Math.average(low, high);\\n if (_unsafeAccess(self, mid)._key > key) {\\n high = mid;\\n } else {\\n low = mid + 1;\\n }\\n }\\n return high;\\n }\\n\\n /**\\n * @dev Return the index of the first (oldest) checkpoint with key greater or equal than the search key, or `high`\\n * if there is none. `low` and `high` define a section where to do the search, with inclusive `low` and exclusive\\n * `high`.\\n *\\n * WARNING: `high` should not be greater than the array's length.\\n */\\n function _lowerBinaryLookup(\\n Checkpoint208[] storage self,\\n uint48 key,\\n uint256 low,\\n uint256 high\\n ) private view returns (uint256) {\\n while (low < high) {\\n uint256 mid = Math.average(low, high);\\n if (_unsafeAccess(self, mid)._key < key) {\\n low = mid + 1;\\n } else {\\n high = mid;\\n }\\n }\\n return high;\\n }\\n\\n /**\\n * @dev Access an element of the array without performing bounds check. The position is assumed to be within bounds.\\n */\\n function _unsafeAccess(\\n Checkpoint208[] storage self,\\n uint256 pos\\n ) private pure returns (Checkpoint208 storage result) {\\n assembly {\\n mstore(0, self.slot)\\n result.slot := add(keccak256(0, 0x20), pos)\\n }\\n }\\n\\n struct Trace160 {\\n Checkpoint160[] _checkpoints;\\n }\\n\\n struct Checkpoint160 {\\n uint96 _key;\\n uint160 _value;\\n }\\n\\n /**\\n * @dev Pushes a (`key`, `value`) pair into a Trace160 so that it is stored as the checkpoint.\\n *\\n * Returns previous value and new value.\\n *\\n * IMPORTANT: Never accept `key` as a user input, since an arbitrary `type(uint96).max` key set will disable the\\n * library.\\n */\\n function push(\\n Trace160 storage self,\\n uint96 key,\\n uint160 value\\n ) internal returns (uint160 oldValue, uint160 newValue) {\\n return _insert(self._checkpoints, key, value);\\n }\\n\\n /**\\n * @dev Returns the value in the first (oldest) checkpoint with key greater or equal than the search key, or zero if\\n * there is none.\\n */\\n function lowerLookup(Trace160 storage self, uint96 key) internal view returns (uint160) {\\n uint256 len = self._checkpoints.length;\\n uint256 pos = _lowerBinaryLookup(self._checkpoints, key, 0, len);\\n return pos == len ? 0 : _unsafeAccess(self._checkpoints, pos)._value;\\n }\\n\\n /**\\n * @dev Returns the value in the last (most recent) checkpoint with key lower or equal than the search key, or zero\\n * if there is none.\\n */\\n function upperLookup(Trace160 storage self, uint96 key) internal view returns (uint160) {\\n uint256 len = self._checkpoints.length;\\n uint256 pos = _upperBinaryLookup(self._checkpoints, key, 0, len);\\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\\n }\\n\\n /**\\n * @dev Returns the value in the last (most recent) checkpoint with key lower or equal than the search key, or zero\\n * if there is none.\\n *\\n * NOTE: This is a variant of {upperLookup} that is optimised to find \\\"recent\\\" checkpoint (checkpoints with high\\n * keys).\\n */\\n function upperLookupRecent(Trace160 storage self, uint96 key) internal view returns (uint160) {\\n uint256 len = self._checkpoints.length;\\n\\n uint256 low = 0;\\n uint256 high = len;\\n\\n if (len > 5) {\\n uint256 mid = len - Math.sqrt(len);\\n if (key < _unsafeAccess(self._checkpoints, mid)._key) {\\n high = mid;\\n } else {\\n low = mid + 1;\\n }\\n }\\n\\n uint256 pos = _upperBinaryLookup(self._checkpoints, key, low, high);\\n\\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\\n }\\n\\n /**\\n * @dev Returns the value in the most recent checkpoint, or zero if there are no checkpoints.\\n */\\n function latest(Trace160 storage self) internal view returns (uint160) {\\n uint256 pos = self._checkpoints.length;\\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\\n }\\n\\n /**\\n * @dev Returns whether there is a checkpoint in the structure (i.e. it is not empty), and if so the key and value\\n * in the most recent checkpoint.\\n */\\n function latestCheckpoint(Trace160 storage self) internal view returns (bool exists, uint96 _key, uint160 _value) {\\n uint256 pos = self._checkpoints.length;\\n if (pos == 0) {\\n return (false, 0, 0);\\n } else {\\n Checkpoint160 storage ckpt = _unsafeAccess(self._checkpoints, pos - 1);\\n return (true, ckpt._key, ckpt._value);\\n }\\n }\\n\\n /**\\n * @dev Returns the number of checkpoint.\\n */\\n function length(Trace160 storage self) internal view returns (uint256) {\\n return self._checkpoints.length;\\n }\\n\\n /**\\n * @dev Returns checkpoint at given position.\\n */\\n function at(Trace160 storage self, uint32 pos) internal view returns (Checkpoint160 memory) {\\n return self._checkpoints[pos];\\n }\\n\\n /**\\n * @dev Pushes a (`key`, `value`) pair into an ordered list of checkpoints, either by inserting a new checkpoint,\\n * or by updating the last one.\\n */\\n function _insert(\\n Checkpoint160[] storage self,\\n uint96 key,\\n uint160 value\\n ) private returns (uint160 oldValue, uint160 newValue) {\\n uint256 pos = self.length;\\n\\n if (pos > 0) {\\n Checkpoint160 storage last = _unsafeAccess(self, pos - 1);\\n uint96 lastKey = last._key;\\n uint160 lastValue = last._value;\\n\\n // Checkpoint keys must be non-decreasing.\\n if (lastKey > key) {\\n revert CheckpointUnorderedInsertion();\\n }\\n\\n // Update or push new checkpoint\\n if (lastKey == key) {\\n last._value = value;\\n } else {\\n self.push(Checkpoint160({_key: key, _value: value}));\\n }\\n return (lastValue, value);\\n } else {\\n self.push(Checkpoint160({_key: key, _value: value}));\\n return (0, value);\\n }\\n }\\n\\n /**\\n * @dev Return the index of the first (oldest) checkpoint with key strictly bigger than the search key, or `high`\\n * if there is none. `low` and `high` define a section where to do the search, with inclusive `low` and exclusive\\n * `high`.\\n *\\n * WARNING: `high` should not be greater than the array's length.\\n */\\n function _upperBinaryLookup(\\n Checkpoint160[] storage self,\\n uint96 key,\\n uint256 low,\\n uint256 high\\n ) private view returns (uint256) {\\n while (low < high) {\\n uint256 mid = Math.average(low, high);\\n if (_unsafeAccess(self, mid)._key > key) {\\n high = mid;\\n } else {\\n low = mid + 1;\\n }\\n }\\n return high;\\n }\\n\\n /**\\n * @dev Return the index of the first (oldest) checkpoint with key greater or equal than the search key, or `high`\\n * if there is none. `low` and `high` define a section where to do the search, with inclusive `low` and exclusive\\n * `high`.\\n *\\n * WARNING: `high` should not be greater than the array's length.\\n */\\n function _lowerBinaryLookup(\\n Checkpoint160[] storage self,\\n uint96 key,\\n uint256 low,\\n uint256 high\\n ) private view returns (uint256) {\\n while (low < high) {\\n uint256 mid = Math.average(low, high);\\n if (_unsafeAccess(self, mid)._key < key) {\\n low = mid + 1;\\n } else {\\n high = mid;\\n }\\n }\\n return high;\\n }\\n\\n /**\\n * @dev Access an element of the array without performing bounds check. The position is assumed to be within bounds.\\n */\\n function _unsafeAccess(\\n Checkpoint160[] storage self,\\n uint256 pos\\n ) private pure returns (Checkpoint160 storage result) {\\n assembly {\\n mstore(0, self.slot)\\n result.slot := add(keccak256(0, 0x20), pos)\\n }\\n }\\n}\\n\",\"keccak256\":\"0x66364cd3247ea71cdb58f080f5d5ed6732433a8001413139661841535494692f\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/structs/DoubleEndedQueue.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/structs/DoubleEndedQueue.sol)\\npragma solidity ^0.8.20;\\n\\nimport {Panic} from \\\"../Panic.sol\\\";\\n\\n/**\\n * @dev A sequence of items with the ability to efficiently push and pop items (i.e. insert and remove) on both ends of\\n * the sequence (called front and back). Among other access patterns, it can be used to implement efficient LIFO and\\n * FIFO queues. Storage use is optimized, and all operations are O(1) constant time. This includes {clear}, given that\\n * the existing queue contents are left in storage.\\n *\\n * The struct is called `Bytes32Deque`. Other types can be cast to and from `bytes32`. This data structure can only be\\n * used in storage, and not in memory.\\n * ```solidity\\n * DoubleEndedQueue.Bytes32Deque queue;\\n * ```\\n */\\nlibrary DoubleEndedQueue {\\n /**\\n * @dev Indices are 128 bits so begin and end are packed in a single storage slot for efficient access.\\n *\\n * Struct members have an underscore prefix indicating that they are \\\"private\\\" and should not be read or written to\\n * directly. Use the functions provided below instead. Modifying the struct manually may violate assumptions and\\n * lead to unexpected behavior.\\n *\\n * The first item is at data[begin] and the last item is at data[end - 1]. This range can wrap around.\\n */\\n struct Bytes32Deque {\\n uint128 _begin;\\n uint128 _end;\\n mapping(uint128 index => bytes32) _data;\\n }\\n\\n /**\\n * @dev Inserts an item at the end of the queue.\\n *\\n * Reverts with {Panic-RESOURCE_ERROR} if the queue is full.\\n */\\n function pushBack(Bytes32Deque storage deque, bytes32 value) internal {\\n unchecked {\\n uint128 backIndex = deque._end;\\n if (backIndex + 1 == deque._begin) Panic.panic(Panic.RESOURCE_ERROR);\\n deque._data[backIndex] = value;\\n deque._end = backIndex + 1;\\n }\\n }\\n\\n /**\\n * @dev Removes the item at the end of the queue and returns it.\\n *\\n * Reverts with {Panic-EMPTY_ARRAY_POP} if the queue is empty.\\n */\\n function popBack(Bytes32Deque storage deque) internal returns (bytes32 value) {\\n unchecked {\\n uint128 backIndex = deque._end;\\n if (backIndex == deque._begin) Panic.panic(Panic.EMPTY_ARRAY_POP);\\n --backIndex;\\n value = deque._data[backIndex];\\n delete deque._data[backIndex];\\n deque._end = backIndex;\\n }\\n }\\n\\n /**\\n * @dev Inserts an item at the beginning of the queue.\\n *\\n * Reverts with {Panic-RESOURCE_ERROR} if the queue is full.\\n */\\n function pushFront(Bytes32Deque storage deque, bytes32 value) internal {\\n unchecked {\\n uint128 frontIndex = deque._begin - 1;\\n if (frontIndex == deque._end) Panic.panic(Panic.RESOURCE_ERROR);\\n deque._data[frontIndex] = value;\\n deque._begin = frontIndex;\\n }\\n }\\n\\n /**\\n * @dev Removes the item at the beginning of the queue and returns it.\\n *\\n * Reverts with {Panic-EMPTY_ARRAY_POP} if the queue is empty.\\n */\\n function popFront(Bytes32Deque storage deque) internal returns (bytes32 value) {\\n unchecked {\\n uint128 frontIndex = deque._begin;\\n if (frontIndex == deque._end) Panic.panic(Panic.EMPTY_ARRAY_POP);\\n value = deque._data[frontIndex];\\n delete deque._data[frontIndex];\\n deque._begin = frontIndex + 1;\\n }\\n }\\n\\n /**\\n * @dev Returns the item at the beginning of the queue.\\n *\\n * Reverts with {Panic-ARRAY_OUT_OF_BOUNDS} if the queue is empty.\\n */\\n function front(Bytes32Deque storage deque) internal view returns (bytes32 value) {\\n if (empty(deque)) Panic.panic(Panic.ARRAY_OUT_OF_BOUNDS);\\n return deque._data[deque._begin];\\n }\\n\\n /**\\n * @dev Returns the item at the end of the queue.\\n *\\n * Reverts with {Panic-ARRAY_OUT_OF_BOUNDS} if the queue is empty.\\n */\\n function back(Bytes32Deque storage deque) internal view returns (bytes32 value) {\\n if (empty(deque)) Panic.panic(Panic.ARRAY_OUT_OF_BOUNDS);\\n unchecked {\\n return deque._data[deque._end - 1];\\n }\\n }\\n\\n /**\\n * @dev Return the item at a position in the queue given by `index`, with the first item at 0 and last item at\\n * `length(deque) - 1`.\\n *\\n * Reverts with {Panic-ARRAY_OUT_OF_BOUNDS} if the index is out of bounds.\\n */\\n function at(Bytes32Deque storage deque, uint256 index) internal view returns (bytes32 value) {\\n if (index >= length(deque)) Panic.panic(Panic.ARRAY_OUT_OF_BOUNDS);\\n // By construction, length is a uint128, so the check above ensures that index can be safely downcast to uint128\\n unchecked {\\n return deque._data[deque._begin + uint128(index)];\\n }\\n }\\n\\n /**\\n * @dev Resets the queue back to being empty.\\n *\\n * NOTE: The current items are left behind in storage. This does not affect the functioning of the queue, but misses\\n * out on potential gas refunds.\\n */\\n function clear(Bytes32Deque storage deque) internal {\\n deque._begin = 0;\\n deque._end = 0;\\n }\\n\\n /**\\n * @dev Returns the number of items in the queue.\\n */\\n function length(Bytes32Deque storage deque) internal view returns (uint256) {\\n unchecked {\\n return uint256(deque._end - deque._begin);\\n }\\n }\\n\\n /**\\n * @dev Returns true if the queue is empty.\\n */\\n function empty(Bytes32Deque storage deque) internal view returns (bool) {\\n return deque._end == deque._begin;\\n }\\n}\\n\",\"keccak256\":\"0x1e1d74658d7f4eab3d4f8fb0c6c5953bc5f629d9425e978d557dabff7b58b217\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/types/Time.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/types/Time.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {Math} from \\\"../math/Math.sol\\\";\\nimport {SafeCast} from \\\"../math/SafeCast.sol\\\";\\n\\n/**\\n * @dev This library provides helpers for manipulating time-related objects.\\n *\\n * It uses the following types:\\n * - `uint48` for timepoints\\n * - `uint32` for durations\\n *\\n * While the library doesn't provide specific types for timepoints and duration, it does provide:\\n * - a `Delay` type to represent duration that can be programmed to change value automatically at a given point\\n * - additional helper functions\\n */\\nlibrary Time {\\n using Time for *;\\n\\n /**\\n * @dev Get the block timestamp as a Timepoint.\\n */\\n function timestamp() internal view returns (uint48) {\\n return SafeCast.toUint48(block.timestamp);\\n }\\n\\n /**\\n * @dev Get the block number as a Timepoint.\\n */\\n function blockNumber() internal view returns (uint48) {\\n return SafeCast.toUint48(block.number);\\n }\\n\\n // ==================================================== Delay =====================================================\\n /**\\n * @dev A `Delay` is a uint32 duration that can be programmed to change value automatically at a given point in the\\n * future. The \\\"effect\\\" timepoint describes when the transitions happens from the \\\"old\\\" value to the \\\"new\\\" value.\\n * This allows updating the delay applied to some operation while keeping some guarantees.\\n *\\n * In particular, the {update} function guarantees that if the delay is reduced, the old delay still applies for\\n * some time. For example if the delay is currently 7 days to do an upgrade, the admin should not be able to set\\n * the delay to 0 and upgrade immediately. If the admin wants to reduce the delay, the old delay (7 days) should\\n * still apply for some time.\\n *\\n *\\n * The `Delay` type is 112 bits long, and packs the following:\\n *\\n * ```\\n * | [uint48]: effect date (timepoint)\\n * | | [uint32]: value before (duration)\\n * \\u2193 \\u2193 \\u2193 [uint32]: value after (duration)\\n * 0xAAAAAAAAAAAABBBBBBBBCCCCCCCC\\n * ```\\n *\\n * NOTE: The {get} and {withUpdate} functions operate using timestamps. Block number based delays are not currently\\n * supported.\\n */\\n type Delay is uint112;\\n\\n /**\\n * @dev Wrap a duration into a Delay to add the one-step \\\"update in the future\\\" feature\\n */\\n function toDelay(uint32 duration) internal pure returns (Delay) {\\n return Delay.wrap(duration);\\n }\\n\\n /**\\n * @dev Get the value at a given timepoint plus the pending value and effect timepoint if there is a scheduled\\n * change after this timepoint. If the effect timepoint is 0, then the pending value should not be considered.\\n */\\n function _getFullAt(\\n Delay self,\\n uint48 timepoint\\n ) private pure returns (uint32 valueBefore, uint32 valueAfter, uint48 effect) {\\n (valueBefore, valueAfter, effect) = self.unpack();\\n return effect <= timepoint ? (valueAfter, 0, 0) : (valueBefore, valueAfter, effect);\\n }\\n\\n /**\\n * @dev Get the current value plus the pending value and effect timepoint if there is a scheduled change. If the\\n * effect timepoint is 0, then the pending value should not be considered.\\n */\\n function getFull(Delay self) internal view returns (uint32 valueBefore, uint32 valueAfter, uint48 effect) {\\n return _getFullAt(self, timestamp());\\n }\\n\\n /**\\n * @dev Get the current value.\\n */\\n function get(Delay self) internal view returns (uint32) {\\n (uint32 delay, , ) = self.getFull();\\n return delay;\\n }\\n\\n /**\\n * @dev Update a Delay object so that it takes a new duration after a timepoint that is automatically computed to\\n * enforce the old delay at the moment of the update. Returns the updated Delay object and the timestamp when the\\n * new delay becomes effective.\\n */\\n function withUpdate(\\n Delay self,\\n uint32 newValue,\\n uint32 minSetback\\n ) internal view returns (Delay updatedDelay, uint48 effect) {\\n uint32 value = self.get();\\n uint32 setback = uint32(Math.max(minSetback, value > newValue ? value - newValue : 0));\\n effect = timestamp() + setback;\\n return (pack(value, newValue, effect), effect);\\n }\\n\\n /**\\n * @dev Split a delay into its components: valueBefore, valueAfter and effect (transition timepoint).\\n */\\n function unpack(Delay self) internal pure returns (uint32 valueBefore, uint32 valueAfter, uint48 effect) {\\n uint112 raw = Delay.unwrap(self);\\n\\n valueAfter = uint32(raw);\\n valueBefore = uint32(raw >> 32);\\n effect = uint48(raw >> 64);\\n\\n return (valueBefore, valueAfter, effect);\\n }\\n\\n /**\\n * @dev pack the components into a Delay object.\\n */\\n function pack(uint32 valueBefore, uint32 valueAfter, uint48 effect) internal pure returns (Delay) {\\n return Delay.wrap((uint112(effect) << 64) | (uint112(valueBefore) << 32) | uint112(valueAfter));\\n }\\n}\\n\",\"keccak256\":\"0x36776530f012618bc7526ceb28e77b85e582cb12d9b9466a71d4bd6bf952e4cc\",\"license\":\"MIT\"},\"contracts/variants/crosschain/Gov.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity ^0.8.20;\\n\\nimport \\\"@openzeppelin/contracts/governance/Governor.sol\\\";\\nimport \\\"@openzeppelin/contracts/governance/extensions/GovernorSettings.sol\\\";\\nimport \\\"@openzeppelin/contracts/governance/extensions/GovernorCountingSimple.sol\\\";\\nimport \\\"@openzeppelin/contracts/governance/extensions/GovernorVotes.sol\\\";\\nimport \\\"@openzeppelin/contracts/governance/extensions/GovernorVotesQuorumFraction.sol\\\";\\nimport \\\"./ProofHandler.sol\\\";\\n\\n/**\\n * @title Cross-chain Governance Contract\\n * @author Web3 Hackers Collective\\n * @notice Implementation of a DAO with secure cross-chain synchronization capabilities\\n * @dev Uses ProofHandler library for managing cross-chain parameter updates\\n * @custom:security-contact julien@strat.cc\\n */\\ncontract Gov is\\n Governor,\\n GovernorSettings,\\n GovernorCountingSimple,\\n GovernorVotes,\\n GovernorVotesQuorumFraction\\n{\\n /// @notice Chain ID where this contract was originally deployed\\n uint256 public immutable home;\\n\\n /// @notice IPFS CID of the DAO's manifesto\\n string public manifesto;\\n\\n /// @notice Storage for proof handling\\n ProofHandler.ProofStorage private _proofStorage;\\n\\n /// @notice Types of operations that can be synchronized across chains\\n enum OperationType {\\n SET_MANIFESTO,\\n UPDATE_VOTING_DELAY,\\n UPDATE_VOTING_PERIOD,\\n UPDATE_PROPOSAL_THRESHOLD,\\n UPDATE_QUORUM\\n }\\n\\n /// @notice Emitted when the manifesto is updated\\n /// @param oldManifesto Previous manifesto CID\\n /// @param newManifesto New manifesto CID\\n /// @param nonce Update sequence number\\n event ManifestoUpdated(string oldManifesto, string newManifesto, uint256 nonce);\\n\\n /// @notice Emitted when a governance parameter is updated\\n /// @param operationType Type of parameter updated\\n /// @param oldValue Previous value\\n /// @param newValue New value\\n /// @param nonce Update sequence number\\n event GovernanceParameterUpdated(\\n OperationType indexed operationType,\\n uint256 oldValue,\\n uint256 newValue,\\n uint256 nonce\\n );\\n\\n /// @notice Restricts functions to be called only on the home chain\\n modifier onlyHomeChain() {\\n require(block.chainid == home, \\\"Operation only allowed on home chain\\\");\\n _;\\n }\\n\\n /**\\n * @notice Initializes the governance contract\\n * @param _home Chain ID where this contract is considered home\\n * @param _token The voting token contract address\\n * @param _manifestoCid Initial manifesto CID\\n * @param _name Name of the governance contract\\n * @param _votingDelay Time before voting begins\\n * @param _votingPeriod Duration of voting period\\n * @param _proposalThreshold Minimum votes needed for proposal\\n * @param _quorum Minimum participation percentage required\\n */\\n constructor(\\n uint256 _home,\\n IVotes _token,\\n string memory _manifestoCid,\\n string memory _name,\\n uint48 _votingDelay,\\n uint32 _votingPeriod,\\n uint256 _proposalThreshold,\\n uint256 _quorum\\n )\\n Governor(_name)\\n GovernorSettings(_votingDelay, _votingPeriod, _proposalThreshold)\\n GovernorVotes(_token)\\n GovernorVotesQuorumFraction(_quorum)\\n {\\n home = _home;\\n manifesto = _manifestoCid;\\n }\\n\\n /**\\n * @notice Updates the DAO's manifesto on the home chain\\n * @param newManifesto New manifesto CID\\n */\\n function setManifesto(string memory newManifesto) public onlyGovernance onlyHomeChain {\\n uint256 nonce = ProofHandler.incrementNonce(\\n _proofStorage,\\n uint8(OperationType.SET_MANIFESTO)\\n );\\n string memory oldManifesto = manifesto;\\n manifesto = newManifesto;\\n emit ManifestoUpdated(oldManifesto, newManifesto, nonce);\\n }\\n\\n /**\\n * @notice Updates the voting delay parameter on the home chain\\n * @param newVotingDelay New voting delay value\\n */\\n function setVotingDelay(\\n uint48 newVotingDelay\\n ) public virtual override onlyGovernance onlyHomeChain {\\n uint256 nonce = ProofHandler.incrementNonce(\\n _proofStorage,\\n uint8(OperationType.UPDATE_VOTING_DELAY)\\n );\\n uint256 oldValue = votingDelay();\\n _setVotingDelay(newVotingDelay);\\n emit GovernanceParameterUpdated(\\n OperationType.UPDATE_VOTING_DELAY,\\n oldValue,\\n newVotingDelay,\\n nonce\\n );\\n }\\n\\n /**\\n * @notice Updates the voting period parameter on the home chain\\n * @param newVotingPeriod New voting period value\\n */\\n function setVotingPeriod(\\n uint32 newVotingPeriod\\n ) public virtual override onlyGovernance onlyHomeChain {\\n uint256 nonce = ProofHandler.incrementNonce(\\n _proofStorage,\\n uint8(OperationType.UPDATE_VOTING_PERIOD)\\n );\\n uint256 oldValue = votingPeriod();\\n _setVotingPeriod(newVotingPeriod);\\n emit GovernanceParameterUpdated(\\n OperationType.UPDATE_VOTING_PERIOD,\\n oldValue,\\n newVotingPeriod,\\n nonce\\n );\\n }\\n\\n /**\\n * @notice Updates the proposal threshold parameter on the home chain\\n * @param newProposalThreshold New proposal threshold value\\n */\\n function setProposalThreshold(\\n uint256 newProposalThreshold\\n ) public virtual override onlyGovernance onlyHomeChain {\\n uint256 nonce = ProofHandler.incrementNonce(\\n _proofStorage,\\n uint8(OperationType.UPDATE_PROPOSAL_THRESHOLD)\\n );\\n uint256 oldValue = proposalThreshold();\\n _setProposalThreshold(newProposalThreshold);\\n emit GovernanceParameterUpdated(\\n OperationType.UPDATE_PROPOSAL_THRESHOLD,\\n oldValue,\\n newProposalThreshold,\\n nonce\\n );\\n }\\n\\n /**\\n * @notice Updates the quorum numerator on the home chain\\n * @param newQuorumNumerator New quorum numerator value\\n */\\n function updateQuorumNumerator(\\n uint256 newQuorumNumerator\\n ) public virtual override onlyGovernance onlyHomeChain {\\n uint256 nonce = ProofHandler.incrementNonce(\\n _proofStorage,\\n uint8(OperationType.UPDATE_QUORUM)\\n );\\n uint256 oldValue = quorumNumerator();\\n _updateQuorumNumerator(newQuorumNumerator);\\n emit GovernanceParameterUpdated(\\n OperationType.UPDATE_QUORUM,\\n oldValue,\\n newQuorumNumerator,\\n nonce\\n );\\n }\\n\\n /**\\n * @notice Generates proof for parameter updates\\n * @param operationType Type of parameter being updated\\n * @param value Encoded parameter value\\n * @return proof Encoded proof data\\n */\\n function generateParameterProof(\\n uint8 operationType,\\n bytes memory value\\n ) external view returns (bytes memory proof) {\\n require(block.chainid == home, \\\"Proofs only generated on home chain\\\");\\n uint256 nextNonce = ProofHandler.getNextNonce(_proofStorage, operationType);\\n return ProofHandler.generateProof(address(this), operationType, value, nextNonce);\\n }\\n\\n /**\\n * @notice Claims a parameter update on a foreign chain\\n * @param proof Proof generated by home chain\\n */\\n function claimParameterUpdate(bytes memory proof) external {\\n (uint8 operationType, bytes memory value, uint256 nonce) = ProofHandler.verifyAndClaimProof(\\n proof,\\n address(this),\\n _proofStorage\\n );\\n\\n if (operationType == uint8(OperationType.SET_MANIFESTO)) {\\n string memory newManifesto = abi.decode(value, (string));\\n string memory oldManifesto = manifesto;\\n manifesto = newManifesto;\\n emit ManifestoUpdated(oldManifesto, newManifesto, nonce);\\n } else if (operationType == uint8(OperationType.UPDATE_VOTING_DELAY)) {\\n uint48 newValue = uint48(bytes6(value));\\n uint256 oldValue = votingDelay();\\n _setVotingDelay(newValue);\\n emit GovernanceParameterUpdated(\\n OperationType.UPDATE_VOTING_DELAY,\\n oldValue,\\n newValue,\\n nonce\\n );\\n } else if (operationType == uint8(OperationType.UPDATE_VOTING_PERIOD)) {\\n uint32 newValue = uint32(bytes4(value));\\n uint256 oldValue = votingPeriod();\\n _setVotingPeriod(newValue);\\n emit GovernanceParameterUpdated(\\n OperationType.UPDATE_VOTING_PERIOD,\\n oldValue,\\n newValue,\\n nonce\\n );\\n } else if (operationType == uint8(OperationType.UPDATE_PROPOSAL_THRESHOLD)) {\\n uint256 newValue = abi.decode(value, (uint256));\\n uint256 oldValue = proposalThreshold();\\n _setProposalThreshold(newValue);\\n emit GovernanceParameterUpdated(\\n OperationType.UPDATE_PROPOSAL_THRESHOLD,\\n oldValue,\\n newValue,\\n nonce\\n );\\n } else if (operationType == uint8(OperationType.UPDATE_QUORUM)) {\\n uint256 newValue = abi.decode(value, (uint256));\\n uint256 oldValue = quorumNumerator();\\n _updateQuorumNumerator(newValue);\\n emit GovernanceParameterUpdated(OperationType.UPDATE_QUORUM, oldValue, newValue, nonce);\\n }\\n }\\n\\n // Required overrides\\n\\n function votingDelay() public view override(Governor, GovernorSettings) returns (uint256) {\\n return super.votingDelay();\\n }\\n\\n function votingPeriod() public view override(Governor, GovernorSettings) returns (uint256) {\\n return super.votingPeriod();\\n }\\n\\n function quorum(\\n uint256 blockNumber\\n ) public view override(Governor, GovernorVotesQuorumFraction) returns (uint256) {\\n return super.quorum(blockNumber);\\n }\\n\\n function proposalThreshold()\\n public\\n view\\n override(Governor, GovernorSettings)\\n returns (uint256)\\n {\\n return super.proposalThreshold();\\n }\\n}\\n\",\"keccak256\":\"0xf4500a14a3a21a6ded0cd8df07f4c3d173e3108f1bcee5cfaadf2d3892b50734\",\"license\":\"GPL-3.0\"},\"contracts/variants/crosschain/ProofHandler.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity ^0.8.20;\\n\\n/**\\n * @title Proof Handler Library\\n * @author Web3 Hackers Collective\\n * @notice Library for standardized cross-chain proof generation and verification\\n * @dev Handles proof generation, verification, and tracking for cross-chain operations\\n * @custom:security-contact julien@strat.cc\\n */\\nlibrary ProofHandler {\\n /// @notice Tracks which proofs have been applied on each chain\\n struct ProofStorage {\\n mapping(bytes32 => bool) updateAppliedOnChain;\\n mapping(uint8 => uint256) currentNonce;\\n }\\n\\n /// @dev Emitted when a proof is claimed\\n event ProofClaimed(uint8 indexed operationType, bytes params, uint256 nonce);\\n\\n /**\\n * @notice Generates a proof for cross-chain operations\\n * @param contractAddress Address of contract generating the proof\\n * @param operationType Type of operation being performed\\n * @param params Operation parameters\\n * @param nonce Current nonce for this operation type\\n * @return proof Encoded proof data\\n */\\n function generateProof(\\n address contractAddress,\\n uint8 operationType,\\n bytes memory params,\\n uint256 nonce\\n ) public pure returns (bytes memory proof) {\\n bytes32 message = keccak256(\\n abi.encodePacked(contractAddress, operationType, params, nonce)\\n );\\n bytes32 digest = keccak256(abi.encodePacked(\\\"\\\\x19Ethereum Signed Message:\\\\n32\\\", message));\\n\\n return abi.encode(operationType, params, nonce, digest);\\n }\\n\\n /**\\n * @notice Verifies and claims a proof\\n * @param proof Proof to verify and claim\\n * @param contractAddress Address of contract claiming the proof\\n * @param storage_ Proof storage struct\\n * @return operationType The type of operation being performed\\n * @return params The operation parameters\\n * @return nonce The operation sequence number\\n */\\n function verifyAndClaimProof(\\n bytes memory proof,\\n address contractAddress,\\n ProofStorage storage storage_\\n ) public returns (uint8 operationType, bytes memory params, uint256 nonce) {\\n bytes32 digest;\\n (operationType, params, nonce, digest) = abi.decode(\\n proof,\\n (uint8, bytes, uint256, bytes32)\\n );\\n\\n bytes32 proofHash = keccak256(proof);\\n require(!storage_.updateAppliedOnChain[proofHash], \\\"Proof already claimed\\\");\\n require(nonce == storage_.currentNonce[operationType] + 1, \\\"Invalid nonce\\\");\\n\\n bytes32 message = keccak256(\\n abi.encodePacked(contractAddress, operationType, params, nonce)\\n );\\n bytes32 expectedDigest = keccak256(\\n abi.encodePacked(\\\"\\\\x19Ethereum Signed Message:\\\\n32\\\", message)\\n );\\n require(digest == expectedDigest, \\\"Invalid proof\\\");\\n\\n storage_.updateAppliedOnChain[proofHash] = true;\\n storage_.currentNonce[operationType] = nonce;\\n\\n emit ProofClaimed(operationType, params, nonce);\\n\\n return (operationType, params, nonce);\\n }\\n\\n /**\\n * @notice Gets the next nonce for an operation type\\n * @param storage_ Proof storage struct\\n * @param operationType Type of operation\\n * @return nonce Next nonce value\\n */\\n function getNextNonce(\\n ProofStorage storage storage_,\\n uint8 operationType\\n ) public view returns (uint256 nonce) {\\n return storage_.currentNonce[operationType] + 1;\\n }\\n\\n /**\\n * @notice Increments the nonce for an operation type\\n * @param storage_ Proof storage struct\\n * @param operationType Type of operation\\n * @return nonce New nonce value\\n */\\n function incrementNonce(\\n ProofStorage storage storage_,\\n uint8 operationType\\n ) public returns (uint256 nonce) {\\n storage_.currentNonce[operationType]++;\\n return storage_.currentNonce[operationType];\\n }\\n}\\n\",\"keccak256\":\"0x3719e47c508f29977d48842c5c1d27cce7cb289cbb592526f170f98135ff41a7\",\"license\":\"GPL-3.0\"}},\"version\":1}", - "bytecode": "0x6101a06040523480156200001257600080fd5b5060405162005684380380620056848339810160408190526200003591620007d4565b808785858589806200005b6040805180820190915260018152603160f81b602082015290565b6200006882600062000181565b610120526200007981600162000181565b61014052815160208084019190912060e052815190820120610100524660a0526200010760e05161010051604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f60208201529081019290925260608201524660808201523060a082015260009060c00160405160208183030381529060405280519060200120905090565b60805250503060c05260036200011e828262000930565b506200012c905083620001ba565b620001378262000220565b6200014281620002c7565b5050506001600160a01b0316610160526200015d8162000308565b50610180889052600b62000172878262000930565b50505050505050505062000a96565b6000602083511015620001a1576200019983620003a8565b9050620001b4565b81620001ae848262000930565b5060ff90505b92915050565b6008546040805165ffffffffffff928316815291831660208301527fc565b045403dc03c2eea82b81a0465edad9e2e7fc4d97e11421c209da93d7a93910160405180910390a16008805465ffffffffffff191665ffffffffffff92909216919091179055565b8063ffffffff16600003620002505760405163f1cfbf0560e01b8152600060048201526024015b60405180910390fd5b6008546040805163ffffffff66010000000000009093048316815291831660208301527f7e3f7f0708a84de9203036abaa450dccc85ad5ff52f78c170f3edb55cf5e8828910160405180910390a16008805463ffffffff90921666010000000000000263ffffffff60301b19909216919091179055565b60075460408051918252602082018390527fccb45da8d5717e6c4544694297c4ba5cf151d455c9bb0ed4fc7a38411bc05461910160405180910390a1600755565b606480821115620003375760405163243e544560e01b8152600481018390526024810182905260440162000247565b600062000343620003eb565b9050620003686200035362000407565b6200035e8562000489565b600a9190620004c3565b505060408051828152602081018590527f0553476bf02ef2726e8ce5ced78d63e26e602e4a2257b1f559418e24b4633997910160405180910390a1505050565b600080829050601f81511115620003d6578260405163305a27a960e01b8152600401620002479190620009fc565b8051620003e38262000a31565b179392505050565b6000620003f9600a620004e0565b6001600160d01b0316905090565b6000620004146101605190565b6001600160a01b03166391ddadf46040518163ffffffff1660e01b8152600401602060405180830381865afa92505050801562000470575060408051601f3d908101601f191682019092526200046d9181019062000a56565b60015b62000484576200047f62000530565b905090565b919050565b60006001600160d01b03821115620004bf576040516306dfcc6560e41b815260d060048201526024810183905260440162000247565b5090565b600080620004d38585856200053d565b915091505b935093915050565b8054600090801562000526576200050c83620004fe60018462000a74565b600091825260209091200190565b54660100000000000090046001600160d01b031662000529565b60005b9392505050565b60006200047f43620006a6565b825460009081908015620006475760006200055f87620004fe60018562000a74565b805490915065ffffffffffff80821691660100000000000090046001600160d01b0316908816821115620005a657604051632520601d60e01b815260040160405180910390fd5b8765ffffffffffff168265ffffffffffff1603620005e457825465ffffffffffff1666010000000000006001600160d01b0389160217835562000638565b6040805180820190915265ffffffffffff808a1682526001600160d01b03808a1660208085019182528d54600181018f5560008f815291909120945191519092166601000000000000029216919091179101555b9450859350620004d892505050565b50506040805180820190915265ffffffffffff80851682526001600160d01b0380851660208085019182528854600181018a5560008a8152918220955192519093166601000000000000029190931617920191909155905081620004d8565b600065ffffffffffff821115620004bf576040516306dfcc6560e41b8152603060048201526024810183905260440162000247565b634e487b7160e01b600052604160045260246000fd5b60005b838110156200070e578181015183820152602001620006f4565b50506000910152565b600082601f8301126200072957600080fd5b81516001600160401b0380821115620007465762000746620006db565b604051601f8301601f19908116603f01168101908282118183101715620007715762000771620006db565b816040528381528660208588010111156200078b57600080fd5b6200079e846020830160208901620006f1565b9695505050505050565b805165ffffffffffff811681146200048457600080fd5b805163ffffffff811681146200048457600080fd5b600080600080600080600080610100898b031215620007f257600080fd5b885160208a01519098506001600160a01b03811681146200081257600080fd5b60408a01519097506001600160401b03808211156200083057600080fd5b6200083e8c838d0162000717565b975060608b01519150808211156200085557600080fd5b50620008648b828c0162000717565b9550506200087560808a01620007a8565b93506200088560a08a01620007bf565b60c08a015160e0909a0151989b979a5095989497939692505050565b600181811c90821680620008b657607f821691505b602082108103620008d757634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200092b57600081815260208120601f850160051c81016020861015620009065750805b601f850160051c820191505b81811015620009275782815560010162000912565b5050505b505050565b81516001600160401b038111156200094c576200094c620006db565b62000964816200095d8454620008a1565b84620008dd565b602080601f8311600181146200099c5760008415620009835750858301515b600019600386901b1c1916600185901b17855562000927565b600085815260208120601f198616915b82811015620009cd57888601518255948401946001909101908401620009ac565b5085821015620009ec5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b602081526000825180602084015262000a1d816040850160208701620006f1565b601f01601f19169190910160400192915050565b80516020808301519190811015620008d75760001960209190910360031b1b16919050565b60006020828403121562000a6957600080fd5b6200052982620007a8565b81810381811115620001b457634e487b7160e01b600052601160045260246000fd5b60805160a05160c05160e0516101005161012051610140516101605161018051614b3762000b4d600039600081816107e201528181610b1501528181610d06015281816114e901528181611d1a01528181611f30015261206f015260008181610a90015281816111b60152818161180d01528181612b200152612d1101526000612aeb01526000612abe01526000612f3a01526000612f1201526000612e6d01526000612e9701526000612ec10152614b376000f3fe6080604052600436106102e85760003560e01c80637ecebe0011610190578063c01f9e37116100dc578063e2f3dce011610095578063ece40cc11161006f578063ece40cc114610a15578063f23a6e6114610a35578063f8ce560a14610a61578063fc0c546a14610a8157600080fd5b8063e2f3dce0146109c0578063e540d01d146109d5578063eb9019d4146109f557600080fd5b8063c01f9e37146108d3578063c28bc2fa146108f3578063c59057e414610906578063cc31491c14610926578063dd4e2ba514610946578063deaaa7cc1461098c57600080fd5b80639fa92f9d11610149578063ab58fb8e11610123578063ab58fb8e1461083a578063b47a321814610872578063b58131b014610892578063bc197c81146108a757600080fd5b80639fa92f9d146107d0578063a7713a7014610804578063a9a952941461081957600080fd5b80637ecebe00146106f257806384b0196e146107285780638ff262e31461075057806391ddadf41461077057806397c3d3341461079c5780639a802a6d146107b057600080fd5b80633e4f49e61161024f578063567813881161020857806360c4247f116101e257806360c4247f1461067257806379051887146106925780637b3c71d3146106b25780637d5e81e2146106d257600080fd5b806356781388146106125780635b8d0e0d146106325780635f398a141461065257600080fd5b80633e4f49e6146104e75780634385963214610514578063452115d61461055e5780634bf5d7e91461057e578063544ffc9c1461059357806354fd4d50146105e857600080fd5b8063160cbed7116102a1578063160cbed71461042b5780631985ba761461044b5780632656227d1461046b5780632d63f6931461047e5780632fe3e2611461049e5780633932abb1146104d257600080fd5b806301ffc9a7146102f657806302a251a31461032b57806306f3f9e61461035757806306fdde0314610377578063143489d014610399578063150b7a02146103e757600080fd5b366102f157005b005b600080fd5b34801561030257600080fd5b506103166103113660046137ad565b610ab4565b60405190151581526020015b60405180910390f35b34801561033757600080fd5b50600854600160301b900463ffffffff165b604051908152602001610322565b34801561036357600080fd5b506102ef6103723660046137d7565b610b0b565b34801561038357600080fd5b5061038c610c2a565b6040516103229190613840565b3480156103a557600080fd5b506103cf6103b43660046137d7565b6000908152600460205260409020546001600160a01b031690565b6040516001600160a01b039091168152602001610322565b3480156103f357600080fd5b5061041261040236600461392d565b630a85bd0160e11b949350505050565b6040516001600160e01b03199091168152602001610322565b34801561043757600080fd5b50610349610446366004613afe565b610cbc565b34801561045757600080fd5b506102ef610466366004613b8d565b610cfc565b610349610479366004613afe565b610ea2565b34801561048a57600080fd5b506103496104993660046137d7565b610fd5565b3480156104aa57600080fd5b506103497f3e83946653575f9a39005e1545185629e92736b7528ab20ca3816f315424a81181565b3480156104de57600080fd5b50610349610ff6565b3480156104f357600080fd5b506105076105023660046137d7565b611009565b6040516103229190613bf9565b34801561052057600080fd5b5061031661052f366004613c07565b60008281526009602090815260408083206001600160a01b038516845260030190915290205460ff1692915050565b34801561056a57600080fd5b50610349610579366004613afe565b611143565b34801561058a57600080fd5b5061038c6111b2565b34801561059f57600080fd5b506105cd6105ae3660046137d7565b6000908152600960205260409020805460018201546002909201549092565b60408051938452602084019290925290820152606001610322565b3480156105f457600080fd5b506040805180820190915260018152603160f81b602082015261038c565b34801561061e57600080fd5b5061034961062d366004613c42565b611274565b34801561063e57600080fd5b5061034961064d366004613cba565b61129d565b34801561065e57600080fd5b5061034961066d366004613d74565b6113fc565b34801561067e57600080fd5b5061034961068d3660046137d7565b611451565b34801561069e57600080fd5b506102ef6106ad366004613e0d565b6114df565b3480156106be57600080fd5b506103496106cd366004613e2a565b6115f0565b3480156106de57600080fd5b506103496106ed366004613e85565b611638565b3480156106fe57600080fd5b5061034961070d366004613f25565b6001600160a01b031660009081526002602052604090205490565b34801561073457600080fd5b5061073d6116f1565b6040516103229796959493929190613f7b565b34801561075c57600080fd5b5061034961076b366004613feb565b611737565b34801561077c57600080fd5b50610785611809565b60405165ffffffffffff9091168152602001610322565b3480156107a857600080fd5b506064610349565b3480156107bc57600080fd5b506103496107cb36600461403c565b611891565b3480156107dc57600080fd5b506103497f000000000000000000000000000000000000000000000000000000000000000081565b34801561081057600080fd5b506103496118a8565b34801561082557600080fd5b506103166108343660046137d7565b50600090565b34801561084657600080fd5b506103496108553660046137d7565b60009081526004602052604090206001015465ffffffffffff1690565b34801561087e57600080fd5b506102ef61088d366004613b8d565b6118c2565b34801561089e57600080fd5b50610349611c0e565b3480156108b357600080fd5b506104126108c2366004614092565b63bc197c8160e01b95945050505050565b3480156108df57600080fd5b506103496108ee3660046137d7565b611c19565b6102ef610901366004614121565b611c5c565b34801561091257600080fd5b50610349610921366004613afe565b611cdc565b34801561093257600080fd5b5061038c610941366004614162565b611d16565b34801561095257600080fd5b506040805180820190915260208082527f737570706f72743d627261766f2671756f72756d3d666f722c6162737461696e9082015261038c565b34801561099857600080fd5b506103497ff2aad550cf55f045cb27e9c559f9889fdfb6e6cdaa032301d6ea397784ae51d781565b3480156109cc57600080fd5b5061038c611e98565b3480156109e157600080fd5b506102ef6109f03660046141b1565b611f26565b348015610a0157600080fd5b50610349610a103660046141d7565b612044565b348015610a2157600080fd5b506102ef610a303660046137d7565b612065565b348015610a4157600080fd5b50610412610a50366004614201565b63f23a6e6160e01b95945050505050565b348015610a6d57600080fd5b50610349610a7c3660046137d7565b612148565b348015610a8d57600080fd5b507f00000000000000000000000000000000000000000000000000000000000000006103cf565b60006001600160e01b031982166332a2ad4360e11b1480610ae557506001600160e01b03198216630271189760e51b145b80610b0057506301ffc9a760e01b6001600160e01b03198316145b92915050565b905090565b610b13612153565b7f00000000000000000000000000000000000000000000000000000000000000004614610b5b5760405162461bcd60e51b8152600401610b5290614265565b60405180910390fd5b604051633b0d4dd760e01b8152600c6004828101919091526024820152600090730152ee45780385dACCCCB128D816031CfFe5F36B90633b0d4dd790604401602060405180830381865af4158015610bb7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bdb91906142a9565b90506000610be76118a8565b9050610bf28361218b565b60045b6040805183815260208101869052908101849052600080516020614ae2833981519152906060015b60405180910390a2505050565b606060038054610c39906142c2565b80601f0160208091040260200160405190810160405280929190818152602001828054610c65906142c2565b8015610cb25780601f10610c8757610100808354040283529160200191610cb2565b820191906000526020600020905b815481529060010190602001808311610c9557829003601f168201915b5050505050905090565b600080610ccb86868686611cdc565b9050610ce081610cdb6004612219565b61223c565b506000604051634844252360e11b815260040160405180910390fd5b610d04612153565b7f00000000000000000000000000000000000000000000000000000000000000004614610d435760405162461bcd60e51b8152600401610b5290614265565b604051633b0d4dd760e01b8152600c600482015260006024820181905290730152ee45780385dACCCCB128D816031CfFe5F36B90633b0d4dd790604401602060405180830381865af4158015610d9d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dc191906142a9565b90506000600b8054610dd2906142c2565b80601f0160208091040260200160405190810160405280929190818152602001828054610dfe906142c2565b8015610e4b5780601f10610e2057610100808354040283529160200191610e4b565b820191906000526020600020905b815481529060010190602001808311610e2e57829003601f168201915b5050505050905082600b9081610e619190614347565b507f67c6aa39e9b4a701119ddc2f40a18145fff9b6f4fa224d5f29c28755f719ffb2818484604051610e9593929190614406565b60405180910390a1505050565b600080610eb186868686611cdc565b9050610ed181610ec16005612219565b610ecb6004612219565b1761223c565b506000818152600460205260409020805460ff60f01b1916600160f01b17905530610ef93090565b6001600160a01b031614610f8b5760005b8651811015610f8957306001600160a01b0316878281518110610f2f57610f2f61443c565b60200260200101516001600160a01b031603610f7957610f79858281518110610f5a57610f5a61443c565b602002602001015180519060200120600561227b90919063ffffffff16565b610f8281614468565b9050610f0a565b505b610f9881878787876122dd565b6040518181527f712ae1383f79ac853f8d882153778e0260ef8f03b504e2866e0593e04d2b291f906020015b60405180910390a195945050505050565b600090815260046020526040902054600160a01b900465ffffffffffff1690565b6000610b0660085465ffffffffffff1690565b6000818152600460205260408120805460ff600160f01b8204811691600160f81b900416811561103e57506007949350505050565b801561104f57506002949350505050565b600061105a86610fd5565b90508060000361108057604051636ad0607560e01b815260048101879052602401610b52565b600061108a611809565b65ffffffffffff1690508082106110a8575060009695505050505050565b60006110b388611c19565b90508181106110ca57506001979650505050505050565b6110d3886123bd565b15806110f357506000888152600960205260409020805460019091015411155b1561110657506003979650505050505050565b60008881526004602052604090206001015465ffffffffffff1660000361113557506004979650505050505050565b506005979650505050505050565b60008061115286868686611cdc565b905061116281610cdb6000612219565b506000818152600460205260409020546001600160a01b0316331461119c5760405163233d98e360e01b8152336004820152602401610b52565b6111a8868686866123f4565b9695505050505050565b60607f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316634bf5d7e96040518163ffffffff1660e01b8152600401600060405180830381865afa92505050801561123357506040513d6000823e601f3d908101601f1916820160405261123091908101906144b1565b60015b61126f575060408051808201909152601d81527f6d6f64653d626c6f636b6e756d6265722666726f6d3d64656661756c74000000602082015290565b919050565b600080339050611295848285604051806020016040528060008152506124a5565b949350505050565b6000806113808761137a7f3e83946653575f9a39005e1545185629e92736b7528ab20ca3816f315424a8118c8c8c6112f28e6001600160a01b0316600090815260026020526040902080546001810190915590565b8d8d6040516113029291906144f9565b60405180910390208c8051906020012060405160200161135f9796959493929190968752602087019590955260ff9390931660408601526001600160a01b03919091166060850152608084015260a083015260c082015260e00190565b604051602081830303815290604052805190602001206124d1565b856124fe565b9050806113ab576040516394ab6c0760e01b81526001600160a01b0388166004820152602401610b52565b6113ef89888a89898080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508b9250612572915050565b9998505050505050505050565b60008033905061144687828888888080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508a9250612572915050565b979650505050505050565b600a80546000918290611465600184614509565b815481106114755761147561443c565b6000918252602090912001805490915065ffffffffffff811690600160301b90046001600160d01b03168582116114b8576001600160d01b031695945050505050565b6114cc6114c487612654565b600a9061268b565b6001600160d01b03169695505050505050565b6114e7612153565b7f000000000000000000000000000000000000000000000000000000000000000046146115265760405162461bcd60e51b8152600401610b5290614265565b604051633b0d4dd760e01b8152600c600482015260016024820152600090730152ee45780385dACCCCB128D816031CfFe5F36B90633b0d4dd790604401602060405180830381865af4158015611580573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115a491906142a9565b905060006115b0610ff6565b90506115bb83612740565b60016040805183815265ffffffffffff86166020820152908101849052600080516020614ae283398151915290606001610c1d565b6000803390506111a886828787878080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506124a592505050565b60003361164581846127a6565b61166d5760405163d9b3955760e01b81526001600160a01b0382166004820152602401610b52565b6000611677611c0e565b905080156116e45760006116a683600161168f611809565b611699919061451c565b65ffffffffffff16612044565b9050818110156116e257604051636121770b60e11b81526001600160a01b03841660048201526024810182905260448101839052606401610b52565b505b6114468787878786612897565b600060608060008060006060611705612ab7565b61170d612ae4565b60408051600080825260208201909252600f60f81b9b939a50919850469750309650945092509050565b6000806117c38461137a7ff2aad550cf55f045cb27e9c559f9889fdfb6e6cdaa032301d6ea397784ae51d789898961178c8b6001600160a01b0316600090815260026020526040902080546001810190915590565b60408051602081019690965285019390935260ff90911660608401526001600160a01b0316608083015260a082015260c00161135f565b9050806117ee576040516394ab6c0760e01b81526001600160a01b0385166004820152602401610b52565b6111a8868587604051806020016040528060008152506124a5565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166391ddadf46040518163ffffffff1660e01b8152600401602060405180830381865afa925050508015611885575060408051601f3d908101601f1916820190925261188291810190614542565b60015b61126f57610b06612b11565b600061189e848484612b1c565b90505b9392505050565b60006118b4600a612bb2565b6001600160d01b0316905090565b6000806000730152ee45780385dACCCCB128D816031CfFe5F36B63c0af65918530600c6040518463ffffffff1660e01b81526004016119039392919061455f565b600060405180830381865af4158015611920573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261194891908101906145ad565b9194509250905060ff8316611a505760008280602001905181019061196d91906144b1565b90506000600b805461197e906142c2565b80601f01602080910402602001604051908101604052809291908181526020018280546119aa906142c2565b80156119f75780601f106119cc576101008083540402835291602001916119f7565b820191906000526020600020905b8154815290600101906020018083116119da57829003601f168201915b5050505050905081600b9081611a0d9190614347565b507f67c6aa39e9b4a701119ddc2f40a18145fff9b6f4fa224d5f29c28755f719ffb2818385604051611a4193929190614406565b60405180910390a15050611c08565b60001960ff841601611ac1576000611a6783614606565b60d01c90506000611a76610ff6565b9050611a8182612740565b60016040805183815265ffffffffffff85166020820152908101859052600080516020614ae2833981519152906060015b60405180910390a25050611c08565b60011960ff841601611b34576000611ad88361463d565b60e01c90506000611af660085463ffffffff600160301b9091041690565b9050611b0182612beb565b60026040805183815263ffffffff85166020820152908101859052600080516020614ae283398151915290606001611ab2565b60021960ff841601611b9b57600082806020019051810190611b5691906142a9565b90506000611b62611c0e565b9050611b6d82612c89565b60036040805183815260208101859052908101859052600080516020614ae283398151915290606001611ab2565b60031960ff841601611c0857600082806020019051810190611bbd91906142a9565b90506000611bc96118a8565b9050611bd48261218b565b60046040805183815260208101859052908101859052600080516020614ae28339815191529060600160405180910390a250505b50505050565b6000610b0660075490565b600081815260046020526040812054611c4e90600160d01b810463ffffffff1690600160a01b900465ffffffffffff16614670565b65ffffffffffff1692915050565b611c64612153565b600080856001600160a01b0316858585604051611c829291906144f9565b60006040518083038185875af1925050503d8060008114611cbf576040519150601f19603f3d011682016040523d82523d6000602084013e611cc4565b606091505b5091509150611cd38282612cca565b50505050505050565b600084848484604051602001611cf5949392919061471a565b60408051601f19818403018152919052805160209091012095945050505050565b60607f00000000000000000000000000000000000000000000000000000000000000004614611d935760405162461bcd60e51b815260206004820152602360248201527f50726f6f6673206f6e6c792067656e657261746564206f6e20686f6d6520636860448201526230b4b760e91b6064820152608401610b52565b604051630564edeb60e31b8152600c600482015260ff84166024820152600090730152ee45780385dACCCCB128D816031CfFe5F36B90632b276f5890604401602060405180830381865af4158015611def573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e1391906142a9565b604051637352178160e01b8152909150730152ee45780385dACCCCB128D816031CfFe5F36B90637352178190611e53903090889088908790600401614765565b600060405180830381865af4158015611e70573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261129591908101906147a3565b600b8054611ea5906142c2565b80601f0160208091040260200160405190810160405280929190818152602001828054611ed1906142c2565b8015611f1e5780601f10611ef357610100808354040283529160200191611f1e565b820191906000526020600020905b815481529060010190602001808311611f0157829003601f168201915b505050505081565b611f2e612153565b7f00000000000000000000000000000000000000000000000000000000000000004614611f6d5760405162461bcd60e51b8152600401610b5290614265565b604051633b0d4dd760e01b8152600c600482015260026024820152600090730152ee45780385dACCCCB128D816031CfFe5F36B90633b0d4dd790604401602060405180830381865af4158015611fc7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611feb91906142a9565b9050600061200660085463ffffffff600160301b9091041690565b905061201183612beb565b60026040805183815263ffffffff86166020820152908101849052600080516020614ae283398151915290606001610c1d565b60006118a1838361206060408051602081019091526000815290565b612b1c565b61206d612153565b7f000000000000000000000000000000000000000000000000000000000000000046146120ac5760405162461bcd60e51b8152600401610b5290614265565b604051633b0d4dd760e01b8152600c600482015260036024820152600090730152ee45780385dACCCCB128D816031CfFe5F36B90633b0d4dd790604401602060405180830381865af4158015612106573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061212a91906142a9565b90506000612136611c0e565b905061214183612c89565b6003610bf5565b6000610b0082612ce6565b303314612175576040516347096e4760e01b8152336004820152602401610b52565b565b806121826005612d90565b03612177575b50565b6064808211156121b85760405163243e544560e01b81526004810183905260248101829052604401610b52565b60006121c26118a8565b90506121e16121cf611809565b6121d885612dff565b600a9190612e33565b505060408051828152602081018590527f0553476bf02ef2726e8ce5ced78d63e26e602e4a2257b1f559418e24b46339979101610e95565b600081600781111561222d5761222d613bc1565b600160ff919091161b92915050565b60008061224884611009565b905060008361225683612219565b16036118a1578381846040516331b75e4d60e01b8152600401610b52939291906147d7565b81546001600160801b03600160801b8204811691811660018301909116036122a7576122a76041612e4e565b6001600160801b03808216600090815260018086016020526040909120939093558354919092018216600160801b029116179055565b60005b84518110156123b5576000808683815181106122fe576122fe61443c565b60200260200101516001600160a01b03168684815181106123215761232161443c565b602002602001015186858151811061233b5761233b61443c565b602002602001015160405161235091906147f9565b60006040518083038185875af1925050503d806000811461238d576040519150601f19603f3d011682016040523d82523d6000602084013e612392565b606091505b50915091506123a18282612cca565b505050806123ae90614468565b90506122e0565b505050505050565b6000818152600960205260408120600281015460018201546123df9190614815565b6123eb610a7c85610fd5565b11159392505050565b60008061240386868686611cdc565b9050612451816124136007612219565b61241d6006612219565b6124276002612219565b6001612434600782614828565b61243f906002614925565b6124499190614509565b18181861223c565b506000818152600460205260409081902080546001600160f81b0316600160f81b179055517f789cf55be980739dad1d0699b93b58e806b51c9d96619bfa8fe0a28abaa7b30c90610fc49083815260200190565b60006124c8858585856124c360408051602081019091526000815290565b612572565b95945050505050565b6000610b006124de612e60565b8360405161190160f01b8152600281019290925260228201526042902090565b6000836001600160a01b03163b6000036125605760008061251f8585612f8b565b509092509050600081600381111561253957612539613bc1565b1480156125575750856001600160a01b0316826001600160a01b0316145b925050506118a1565b61256b848484612fd8565b90506118a1565b600061258286610cdb6001612219565b5060006125988661259289610fd5565b85612b1c565b905060006125a988888885886130b3565b9050835160000361260057866001600160a01b03167fb8e138887d0aa13bab447e82de9d5c1777041ecd21ca36ba824ff1e6c07ddda4898884896040516125f39493929190614934565b60405180910390a2611446565b866001600160a01b03167fe2babfbac5889a709b63bb7f598b324e08bc5a4fb9ec647fb3cbc9ec07eb8712898884898960405161264195949392919061495c565b60405180910390a2979650505050505050565b600065ffffffffffff821115612687576040516306dfcc6560e41b81526030600482015260248101839052604401610b52565b5090565b8154600090818160058111156126ea5760006126a6846131b6565b6126b09085614509565b60008881526020902090915081015465ffffffffffff90811690871610156126da578091506126e8565b6126e5816001614815565b92505b505b60006126f88787858561330f565b905080156127335761271d8761270f600184614509565b600091825260209091200190565b54600160301b90046001600160d01b0316611446565b6000979650505050505050565b6008546040805165ffffffffffff928316815291831660208301527fc565b045403dc03c2eea82b81a0465edad9e2e7fc4d97e11421c209da93d7a93910160405180910390a16008805465ffffffffffff191665ffffffffffff92909216919091179055565b805160009060348110156127be576001915050610b00565b82810160131901516001600160a01b031981166b046e0e4dee0dee6cae47a60f60a31b146127f157600192505050610b00565b6000806127ff602885614509565b90505b83811015612876576000806128368884815181106128225761282261443c565b01602001516001600160f81b031916613371565b915091508161284e5760019650505050505050610b00565b8060ff166004856001600160a01b0316901b17935050508061286f90614468565b9050612802565b50856001600160a01b0316816001600160a01b031614935050505092915050565b60006128ac8686868680519060200120611cdc565b9050845186511415806128c157508351865114155b806128cb57508551155b1561290057855184518651604051630447b05d60e41b8152600481019390935260248301919091526044820152606401610b52565b600081815260046020526040902054600160a01b900465ffffffffffff161561294b578061292d82611009565b6040516331b75e4d60e01b8152610b529291906000906004016147d7565b6000612955610ff6565b61295d611809565b65ffffffffffff1661296f9190614815565b9050600061298a60085463ffffffff600160301b9091041690565b600084815260046020526040902080546001600160a01b0319166001600160a01b0387161781559091506129bd83612654565b815465ffffffffffff91909116600160a01b0265ffffffffffff60a01b199091161781556129ea82613403565b815463ffffffff91909116600160d01b0263ffffffff60d01b1990911617815588517f7d84a6263ae0d98d3329bd7b46bb4e8d6f98cd35a7adb45c274c8b7fd5ebd5e090859087908c908c906001600160401b03811115612a4d57612a4d61386a565b604051908082528060200260200182016040528015612a8057816020015b6060815260200190600190039081612a6b5790505b508c89612a8d8a82614815565b8e604051612aa3999897969594939291906149a2565b60405180910390a150505095945050505050565b6060610b067f00000000000000000000000000000000000000000000000000000000000000006000613434565b6060610b067f00000000000000000000000000000000000000000000000000000000000000006001613434565b6000610b0643612654565b60007f0000000000000000000000000000000000000000000000000000000000000000604051630748d63560e31b81526001600160a01b038681166004830152602482018690529190911690633a46b1a890604401602060405180830381865afa158015612b8e573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061189e91906142a9565b80546000908015612be257612bcc8361270f600184614509565b54600160301b90046001600160d01b03166118a1565b60009392505050565b8063ffffffff16600003612c155760405163f1cfbf0560e01b815260006004820152602401610b52565b6008546040805163ffffffff600160301b9093048316815291831660208301527f7e3f7f0708a84de9203036abaa450dccc85ad5ff52f78c170f3edb55cf5e8828910160405180910390a16008805463ffffffff909216600160301b0269ffffffff00000000000019909216919091179055565b60075460408051918252602082018390527fccb45da8d5717e6c4544694297c4ba5cf151d455c9bb0ed4fc7a38411bc05461910160405180910390a1600755565b606082612cdf57612cda826134df565b610b00565b5080610b00565b60006064612cf383611451565b604051632394e7a360e21b8152600481018590526001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001690638e539e8c90602401602060405180830381865afa158015612d58573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612d7c91906142a9565b612d869190614a79565b610b009190614aa6565b80546000906001600160801b0380821691600160801b9004168103612db957612db96031612e4e565b6001600160801b038181166000908152600185810160205260408220805492905585546fffffffffffffffffffffffffffffffff19169301909116919091179092555090565b60006001600160d01b03821115612687576040516306dfcc6560e41b815260d0600482015260248101839052604401610b52565b600080612e41858585613508565b915091505b935093915050565b634e487b71600052806020526024601cfd5b6000306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016148015612eb957507f000000000000000000000000000000000000000000000000000000000000000046145b15612ee357507f000000000000000000000000000000000000000000000000000000000000000090565b610b06604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f60208201527f0000000000000000000000000000000000000000000000000000000000000000918101919091527f000000000000000000000000000000000000000000000000000000000000000060608201524660808201523060a082015260009060c00160405160208183030381529060405280519060200120905090565b60008060008351604103612fc55760208401516040850151606086015160001a612fb78882858561365c565b955095509550505050612fd1565b50508151600091506002905b9250925092565b6000806000856001600160a01b03168585604051602401612ffa929190614ac8565b60408051601f198184030181529181526020820180516001600160e01b0316630b135d3f60e11b1790525161302f91906147f9565b600060405180830381855afa9150503d806000811461306a576040519150601f19603f3d011682016040523d82523d6000602084013e61306f565b606091505b509150915081801561308357506020815110155b80156111a857508051630b135d3f60e11b906130a890830160209081019084016142a9565b149695505050505050565b60008581526009602090815260408083206001600160a01b03881684526003810190925282205460ff1615613106576040516371c6af4960e01b81526001600160a01b0387166004820152602401610b52565b6001600160a01b03861660009081526003820160205260409020805460ff1916600117905560ff851661315257838160000160008282546131479190614815565b909155506131ab9050565b60001960ff86160161317257838160010160008282546131479190614815565b60011960ff86160161319257838160020160008282546131479190614815565b6040516303599be160e11b815260040160405180910390fd5b509195945050505050565b6000600182116131c4575090565b816001600160801b82106131dd5760809190911c9060401b5b6801000000000000000082106131f85760409190911c9060201b5b640100000000821061320f5760209190911c9060101b5b6201000082106132245760109190911c9060081b5b61010082106132385760089190911c9060041b5b6010821061324b5760049190911c9060021b5b600482106132575760011b5b600302600190811c9081858161326f5761326f614a90565b048201901c9050600181858161328757613287614a90565b048201901c9050600181858161329f5761329f614a90565b048201901c905060018185816132b7576132b7614a90565b048201901c905060018185816132cf576132cf614a90565b048201901c905060018185816132e7576132e7614a90565b048201901c905061330681858161330057613300614a90565b04821190565b90039392505050565b60005b81831015613369576000613326848461372b565b60008781526020902090915065ffffffffffff86169082015465ffffffffffff16111561335557809250613363565b613360816001614815565b93505b50613312565b509392505050565b60008060f883901c602f8111801561338c5750603a8160ff16105b156133a157600194602f199091019350915050565b8060ff1660401080156133b7575060478160ff16105b156133cc576001946036199091019350915050565b8060ff1660601080156133e2575060678160ff16105b156133f7576001946056199091019350915050565b50600093849350915050565b600063ffffffff821115612687576040516306dfcc6560e41b81526020600482015260248101839052604401610b52565b606060ff831461344e5761344783613746565b9050610b00565b81805461345a906142c2565b80601f0160208091040260200160405190810160405280929190818152602001828054613486906142c2565b80156134d35780601f106134a8576101008083540402835291602001916134d3565b820191906000526020600020905b8154815290600101906020018083116134b657829003601f168201915b50505050509050610b00565b8051156134ef5780518082602001fd5b60405163d6bda27560e01b815260040160405180910390fd5b8254600090819080156136015760006135268761270f600185614509565b805490915065ffffffffffff80821691600160301b90046001600160d01b031690881682111561356957604051632520601d60e01b815260040160405180910390fd5b8765ffffffffffff168265ffffffffffff16036135a257825465ffffffffffff16600160301b6001600160d01b038916021783556135f3565b6040805180820190915265ffffffffffff808a1682526001600160d01b03808a1660208085019182528d54600181018f5560008f81529190912094519151909216600160301b029216919091179101555b9450859350612e4692505050565b50506040805180820190915265ffffffffffff80851682526001600160d01b0380851660208085019182528854600181018a5560008a815291822095519251909316600160301b029190931617920191909155905081612e46565b600080807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08411156136975750600091506003905082613721565b604080516000808252602082018084528a905260ff891692820192909252606081018790526080810186905260019060a0016020604051602081039080840390855afa1580156136eb573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b03811661371757506000925060019150829050613721565b9250600091508190505b9450945094915050565b600061373a6002848418614aa6565b6118a190848416614815565b6060600061375383613785565b604080516020808252818301909252919250600091906020820181803683375050509182525060208101929092525090565b600060ff8216601f811115610b0057604051632cd44ac360e21b815260040160405180910390fd5b6000602082840312156137bf57600080fd5b81356001600160e01b0319811681146118a157600080fd5b6000602082840312156137e957600080fd5b5035919050565b60005b8381101561380b5781810151838201526020016137f3565b50506000910152565b6000815180845261382c8160208601602086016137f0565b601f01601f19169290920160200192915050565b6020815260006118a16020830184613814565b80356001600160a01b038116811461126f57600080fd5b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b03811182821017156138a8576138a861386a565b604052919050565b60006001600160401b038211156138c9576138c961386a565b50601f01601f191660200190565b600082601f8301126138e857600080fd5b81356138fb6138f6826138b0565b613880565b81815284602083860101111561391057600080fd5b816020850160208301376000918101602001919091529392505050565b6000806000806080858703121561394357600080fd5b61394c85613853565b935061395a60208601613853565b92506040850135915060608501356001600160401b0381111561397c57600080fd5b613988878288016138d7565b91505092959194509250565b60006001600160401b038211156139ad576139ad61386a565b5060051b60200190565b600082601f8301126139c857600080fd5b813560206139d86138f683613994565b82815260059290921b840181019181810190868411156139f757600080fd5b8286015b84811015613a1957613a0c81613853565b83529183019183016139fb565b509695505050505050565b600082601f830112613a3557600080fd5b81356020613a456138f683613994565b82815260059290921b84018101918181019086841115613a6457600080fd5b8286015b84811015613a195780358352918301918301613a68565b600082601f830112613a9057600080fd5b81356020613aa06138f683613994565b82815260059290921b84018101918181019086841115613abf57600080fd5b8286015b84811015613a195780356001600160401b03811115613ae25760008081fd5b613af08986838b01016138d7565b845250918301918301613ac3565b60008060008060808587031215613b1457600080fd5b84356001600160401b0380821115613b2b57600080fd5b613b37888389016139b7565b95506020870135915080821115613b4d57600080fd5b613b5988838901613a24565b94506040870135915080821115613b6f57600080fd5b50613b7c87828801613a7f565b949793965093946060013593505050565b600060208284031215613b9f57600080fd5b81356001600160401b03811115613bb557600080fd5b611295848285016138d7565b634e487b7160e01b600052602160045260246000fd5b60088110613bf557634e487b7160e01b600052602160045260246000fd5b9052565b60208101610b008284613bd7565b60008060408385031215613c1a57600080fd5b82359150613c2a60208401613853565b90509250929050565b60ff8116811461218857600080fd5b60008060408385031215613c5557600080fd5b823591506020830135613c6781613c33565b809150509250929050565b60008083601f840112613c8457600080fd5b5081356001600160401b03811115613c9b57600080fd5b602083019150836020828501011115613cb357600080fd5b9250929050565b600080600080600080600060c0888a031215613cd557600080fd5b873596506020880135613ce781613c33565b9550613cf560408901613853565b945060608801356001600160401b0380821115613d1157600080fd5b613d1d8b838c01613c72565b909650945060808a0135915080821115613d3657600080fd5b613d428b838c016138d7565b935060a08a0135915080821115613d5857600080fd5b50613d658a828b016138d7565b91505092959891949750929550565b600080600080600060808688031215613d8c57600080fd5b853594506020860135613d9e81613c33565b935060408601356001600160401b0380821115613dba57600080fd5b613dc689838a01613c72565b90955093506060880135915080821115613ddf57600080fd5b50613dec888289016138d7565b9150509295509295909350565b65ffffffffffff8116811461218857600080fd5b600060208284031215613e1f57600080fd5b81356118a181613df9565b60008060008060608587031215613e4057600080fd5b843593506020850135613e5281613c33565b925060408501356001600160401b03811115613e6d57600080fd5b613e7987828801613c72565b95989497509550505050565b60008060008060808587031215613e9b57600080fd5b84356001600160401b0380821115613eb257600080fd5b613ebe888389016139b7565b95506020870135915080821115613ed457600080fd5b613ee088838901613a24565b94506040870135915080821115613ef657600080fd5b613f0288838901613a7f565b93506060870135915080821115613f1857600080fd5b50613988878288016138d7565b600060208284031215613f3757600080fd5b6118a182613853565b600081518084526020808501945080840160005b83811015613f7057815187529582019590820190600101613f54565b509495945050505050565b60ff60f81b8816815260e060208201526000613f9a60e0830189613814565b8281036040840152613fac8189613814565b606084018890526001600160a01b038716608085015260a0840186905283810360c08501529050613fdd8185613f40565b9a9950505050505050505050565b6000806000806080858703121561400157600080fd5b84359350602085013561401381613c33565b925061402160408601613853565b915060608501356001600160401b0381111561397c57600080fd5b60008060006060848603121561405157600080fd5b61405a84613853565b92506020840135915060408401356001600160401b0381111561407c57600080fd5b614088868287016138d7565b9150509250925092565b600080600080600060a086880312156140aa57600080fd5b6140b386613853565b94506140c160208701613853565b935060408601356001600160401b03808211156140dd57600080fd5b6140e989838a01613a24565b945060608801359150808211156140ff57600080fd5b61410b89838a01613a24565b93506080880135915080821115613ddf57600080fd5b6000806000806060858703121561413757600080fd5b61414085613853565b93506020850135925060408501356001600160401b03811115613e6d57600080fd5b6000806040838503121561417557600080fd5b823561418081613c33565b915060208301356001600160401b0381111561419b57600080fd5b6141a7858286016138d7565b9150509250929050565b6000602082840312156141c357600080fd5b813563ffffffff811681146118a157600080fd5b600080604083850312156141ea57600080fd5b6141f383613853565b946020939093013593505050565b600080600080600060a0868803121561421957600080fd5b61422286613853565b945061423060208701613853565b9350604086013592506060860135915060808601356001600160401b0381111561425957600080fd5b613dec888289016138d7565b60208082526024908201527f4f7065726174696f6e206f6e6c7920616c6c6f776564206f6e20686f6d6520636040820152633430b4b760e11b606082015260800190565b6000602082840312156142bb57600080fd5b5051919050565b600181811c908216806142d657607f821691505b6020821081036142f657634e487b7160e01b600052602260045260246000fd5b50919050565b601f82111561434257600081815260208120601f850160051c810160208610156143235750805b601f850160051c820191505b818110156123b55782815560010161432f565b505050565b81516001600160401b038111156143605761436061386a565b6143748161436e84546142c2565b846142fc565b602080601f8311600181146143a957600084156143915750858301515b600019600386901b1c1916600185901b1785556123b5565b600085815260208120601f198616915b828110156143d8578886015182559484019460019091019084016143b9565b50858210156143f65787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6060815260006144196060830186613814565b828103602084015261442b8186613814565b915050826040830152949350505050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60006001820161447a5761447a614452565b5060010190565b600061448f6138f6846138b0565b90508281528383830111156144a357600080fd5b6118a18360208301846137f0565b6000602082840312156144c357600080fd5b81516001600160401b038111156144d957600080fd5b8201601f810184136144ea57600080fd5b61129584825160208401614481565b8183823760009101908152919050565b81810381811115610b0057610b00614452565b65ffffffffffff82811682821603908082111561453b5761453b614452565b5092915050565b60006020828403121561455457600080fd5b81516118a181613df9565b6060815260006145726060830186613814565b6001600160a01b039490941660208301525060400152919050565b600082601f83011261459e57600080fd5b6118a183835160208501614481565b6000806000606084860312156145c257600080fd5b83516145cd81613c33565b60208501519093506001600160401b038111156145e957600080fd5b6145f58682870161458d565b925050604084015190509250925092565b805160208201516001600160d01b031980821692919060068310156146355780818460060360031b1b83161693505b505050919050565b805160208201516001600160e01b031980821692919060048310156146355760049290920360031b82901b161692915050565b65ffffffffffff81811683821601908082111561453b5761453b614452565b600081518084526020808501945080840160005b83811015613f705781516001600160a01b0316875295820195908201906001016146a3565b6000815180845260208085019450848260051b860182860160005b8581101561470d5783830389526146fb838351613814565b988501989250908401906001016146e3565b5090979650505050505050565b60808152600061472d608083018761468f565b828103602084015261473f8187613f40565b9050828103604084015261475381866146c8565b91505082606083015295945050505050565b6001600160a01b038516815260ff8416602082015260806040820181905260009061479290830185613814565b905082606083015295945050505050565b6000602082840312156147b557600080fd5b81516001600160401b038111156147cb57600080fd5b6112958482850161458d565b838152606081016147eb6020830185613bd7565b826040830152949350505050565b6000825161480b8184602087016137f0565b9190910192915050565b80820180821115610b0057610b00614452565b60ff8181168382160190811115610b0057610b00614452565b600181815b8085111561487c57816000190482111561486257614862614452565b8085161561486f57918102915b93841c9390800290614846565b509250929050565b60008261489357506001610b00565b816148a057506000610b00565b81600181146148b657600281146148c0576148dc565b6001915050610b00565b60ff8411156148d1576148d1614452565b50506001821b610b00565b5060208310610133831016604e8410600b84101617156148ff575081810a610b00565b6149098383614841565b806000190482111561491d5761491d614452565b029392505050565b60006118a160ff841683614884565b84815260ff841660208201528260408201526080606082015260006111a86080830184613814565b85815260ff8516602082015283604082015260a06060820152600061498460a0830185613814565b82810360808401526149968185613814565b98975050505050505050565b60006101208b8352602060018060a01b038c16818501528160408501526149cb8285018c61468f565b915083820360608501526149df828b613f40565b915083820360808501528189518084528284019150828160051b850101838c0160005b83811015614a3057601f19878403018552614a1e838351613814565b94860194925090850190600101614a02565b505086810360a0880152614a44818c6146c8565b9450505050508560c08401528460e0840152828103610100840152614a698185613814565b9c9b505050505050505050505050565b8082028115828204841417610b0057610b00614452565b634e487b7160e01b600052601260045260246000fd5b600082614ac357634e487b7160e01b600052601260045260246000fd5b500490565b82815260406020820152600061189e604083018461381456fe80c51ad8a7db1a7a86cc355b77bd5cd7ea08f6071ea91d85a8f792734700a0eca2646970667358221220a295bf4977b633b13f69388b67ec678a5025198475985e252038973de715a24d64736f6c63430008140033", - "deployedBytecode": "0x6080604052600436106102e85760003560e01c80637ecebe0011610190578063c01f9e37116100dc578063e2f3dce011610095578063ece40cc11161006f578063ece40cc114610a15578063f23a6e6114610a35578063f8ce560a14610a61578063fc0c546a14610a8157600080fd5b8063e2f3dce0146109c0578063e540d01d146109d5578063eb9019d4146109f557600080fd5b8063c01f9e37146108d3578063c28bc2fa146108f3578063c59057e414610906578063cc31491c14610926578063dd4e2ba514610946578063deaaa7cc1461098c57600080fd5b80639fa92f9d11610149578063ab58fb8e11610123578063ab58fb8e1461083a578063b47a321814610872578063b58131b014610892578063bc197c81146108a757600080fd5b80639fa92f9d146107d0578063a7713a7014610804578063a9a952941461081957600080fd5b80637ecebe00146106f257806384b0196e146107285780638ff262e31461075057806391ddadf41461077057806397c3d3341461079c5780639a802a6d146107b057600080fd5b80633e4f49e61161024f578063567813881161020857806360c4247f116101e257806360c4247f1461067257806379051887146106925780637b3c71d3146106b25780637d5e81e2146106d257600080fd5b806356781388146106125780635b8d0e0d146106325780635f398a141461065257600080fd5b80633e4f49e6146104e75780634385963214610514578063452115d61461055e5780634bf5d7e91461057e578063544ffc9c1461059357806354fd4d50146105e857600080fd5b8063160cbed7116102a1578063160cbed71461042b5780631985ba761461044b5780632656227d1461046b5780632d63f6931461047e5780632fe3e2611461049e5780633932abb1146104d257600080fd5b806301ffc9a7146102f657806302a251a31461032b57806306f3f9e61461035757806306fdde0314610377578063143489d014610399578063150b7a02146103e757600080fd5b366102f157005b005b600080fd5b34801561030257600080fd5b506103166103113660046137ad565b610ab4565b60405190151581526020015b60405180910390f35b34801561033757600080fd5b50600854600160301b900463ffffffff165b604051908152602001610322565b34801561036357600080fd5b506102ef6103723660046137d7565b610b0b565b34801561038357600080fd5b5061038c610c2a565b6040516103229190613840565b3480156103a557600080fd5b506103cf6103b43660046137d7565b6000908152600460205260409020546001600160a01b031690565b6040516001600160a01b039091168152602001610322565b3480156103f357600080fd5b5061041261040236600461392d565b630a85bd0160e11b949350505050565b6040516001600160e01b03199091168152602001610322565b34801561043757600080fd5b50610349610446366004613afe565b610cbc565b34801561045757600080fd5b506102ef610466366004613b8d565b610cfc565b610349610479366004613afe565b610ea2565b34801561048a57600080fd5b506103496104993660046137d7565b610fd5565b3480156104aa57600080fd5b506103497f3e83946653575f9a39005e1545185629e92736b7528ab20ca3816f315424a81181565b3480156104de57600080fd5b50610349610ff6565b3480156104f357600080fd5b506105076105023660046137d7565b611009565b6040516103229190613bf9565b34801561052057600080fd5b5061031661052f366004613c07565b60008281526009602090815260408083206001600160a01b038516845260030190915290205460ff1692915050565b34801561056a57600080fd5b50610349610579366004613afe565b611143565b34801561058a57600080fd5b5061038c6111b2565b34801561059f57600080fd5b506105cd6105ae3660046137d7565b6000908152600960205260409020805460018201546002909201549092565b60408051938452602084019290925290820152606001610322565b3480156105f457600080fd5b506040805180820190915260018152603160f81b602082015261038c565b34801561061e57600080fd5b5061034961062d366004613c42565b611274565b34801561063e57600080fd5b5061034961064d366004613cba565b61129d565b34801561065e57600080fd5b5061034961066d366004613d74565b6113fc565b34801561067e57600080fd5b5061034961068d3660046137d7565b611451565b34801561069e57600080fd5b506102ef6106ad366004613e0d565b6114df565b3480156106be57600080fd5b506103496106cd366004613e2a565b6115f0565b3480156106de57600080fd5b506103496106ed366004613e85565b611638565b3480156106fe57600080fd5b5061034961070d366004613f25565b6001600160a01b031660009081526002602052604090205490565b34801561073457600080fd5b5061073d6116f1565b6040516103229796959493929190613f7b565b34801561075c57600080fd5b5061034961076b366004613feb565b611737565b34801561077c57600080fd5b50610785611809565b60405165ffffffffffff9091168152602001610322565b3480156107a857600080fd5b506064610349565b3480156107bc57600080fd5b506103496107cb36600461403c565b611891565b3480156107dc57600080fd5b506103497f000000000000000000000000000000000000000000000000000000000000000081565b34801561081057600080fd5b506103496118a8565b34801561082557600080fd5b506103166108343660046137d7565b50600090565b34801561084657600080fd5b506103496108553660046137d7565b60009081526004602052604090206001015465ffffffffffff1690565b34801561087e57600080fd5b506102ef61088d366004613b8d565b6118c2565b34801561089e57600080fd5b50610349611c0e565b3480156108b357600080fd5b506104126108c2366004614092565b63bc197c8160e01b95945050505050565b3480156108df57600080fd5b506103496108ee3660046137d7565b611c19565b6102ef610901366004614121565b611c5c565b34801561091257600080fd5b50610349610921366004613afe565b611cdc565b34801561093257600080fd5b5061038c610941366004614162565b611d16565b34801561095257600080fd5b506040805180820190915260208082527f737570706f72743d627261766f2671756f72756d3d666f722c6162737461696e9082015261038c565b34801561099857600080fd5b506103497ff2aad550cf55f045cb27e9c559f9889fdfb6e6cdaa032301d6ea397784ae51d781565b3480156109cc57600080fd5b5061038c611e98565b3480156109e157600080fd5b506102ef6109f03660046141b1565b611f26565b348015610a0157600080fd5b50610349610a103660046141d7565b612044565b348015610a2157600080fd5b506102ef610a303660046137d7565b612065565b348015610a4157600080fd5b50610412610a50366004614201565b63f23a6e6160e01b95945050505050565b348015610a6d57600080fd5b50610349610a7c3660046137d7565b612148565b348015610a8d57600080fd5b507f00000000000000000000000000000000000000000000000000000000000000006103cf565b60006001600160e01b031982166332a2ad4360e11b1480610ae557506001600160e01b03198216630271189760e51b145b80610b0057506301ffc9a760e01b6001600160e01b03198316145b92915050565b905090565b610b13612153565b7f00000000000000000000000000000000000000000000000000000000000000004614610b5b5760405162461bcd60e51b8152600401610b5290614265565b60405180910390fd5b604051633b0d4dd760e01b8152600c600482810191909152602482015260009073__$b1c1335e68417b4234016f4aa58fdfac77$__90633b0d4dd790604401602060405180830381865af4158015610bb7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bdb91906142a9565b90506000610be76118a8565b9050610bf28361218b565b60045b6040805183815260208101869052908101849052600080516020614ae2833981519152906060015b60405180910390a2505050565b606060038054610c39906142c2565b80601f0160208091040260200160405190810160405280929190818152602001828054610c65906142c2565b8015610cb25780601f10610c8757610100808354040283529160200191610cb2565b820191906000526020600020905b815481529060010190602001808311610c9557829003601f168201915b5050505050905090565b600080610ccb86868686611cdc565b9050610ce081610cdb6004612219565b61223c565b506000604051634844252360e11b815260040160405180910390fd5b610d04612153565b7f00000000000000000000000000000000000000000000000000000000000000004614610d435760405162461bcd60e51b8152600401610b5290614265565b604051633b0d4dd760e01b8152600c60048201526000602482018190529073__$b1c1335e68417b4234016f4aa58fdfac77$__90633b0d4dd790604401602060405180830381865af4158015610d9d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dc191906142a9565b90506000600b8054610dd2906142c2565b80601f0160208091040260200160405190810160405280929190818152602001828054610dfe906142c2565b8015610e4b5780601f10610e2057610100808354040283529160200191610e4b565b820191906000526020600020905b815481529060010190602001808311610e2e57829003601f168201915b5050505050905082600b9081610e619190614347565b507f67c6aa39e9b4a701119ddc2f40a18145fff9b6f4fa224d5f29c28755f719ffb2818484604051610e9593929190614406565b60405180910390a1505050565b600080610eb186868686611cdc565b9050610ed181610ec16005612219565b610ecb6004612219565b1761223c565b506000818152600460205260409020805460ff60f01b1916600160f01b17905530610ef93090565b6001600160a01b031614610f8b5760005b8651811015610f8957306001600160a01b0316878281518110610f2f57610f2f61443c565b60200260200101516001600160a01b031603610f7957610f79858281518110610f5a57610f5a61443c565b602002602001015180519060200120600561227b90919063ffffffff16565b610f8281614468565b9050610f0a565b505b610f9881878787876122dd565b6040518181527f712ae1383f79ac853f8d882153778e0260ef8f03b504e2866e0593e04d2b291f906020015b60405180910390a195945050505050565b600090815260046020526040902054600160a01b900465ffffffffffff1690565b6000610b0660085465ffffffffffff1690565b6000818152600460205260408120805460ff600160f01b8204811691600160f81b900416811561103e57506007949350505050565b801561104f57506002949350505050565b600061105a86610fd5565b90508060000361108057604051636ad0607560e01b815260048101879052602401610b52565b600061108a611809565b65ffffffffffff1690508082106110a8575060009695505050505050565b60006110b388611c19565b90508181106110ca57506001979650505050505050565b6110d3886123bd565b15806110f357506000888152600960205260409020805460019091015411155b1561110657506003979650505050505050565b60008881526004602052604090206001015465ffffffffffff1660000361113557506004979650505050505050565b506005979650505050505050565b60008061115286868686611cdc565b905061116281610cdb6000612219565b506000818152600460205260409020546001600160a01b0316331461119c5760405163233d98e360e01b8152336004820152602401610b52565b6111a8868686866123f4565b9695505050505050565b60607f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316634bf5d7e96040518163ffffffff1660e01b8152600401600060405180830381865afa92505050801561123357506040513d6000823e601f3d908101601f1916820160405261123091908101906144b1565b60015b61126f575060408051808201909152601d81527f6d6f64653d626c6f636b6e756d6265722666726f6d3d64656661756c74000000602082015290565b919050565b600080339050611295848285604051806020016040528060008152506124a5565b949350505050565b6000806113808761137a7f3e83946653575f9a39005e1545185629e92736b7528ab20ca3816f315424a8118c8c8c6112f28e6001600160a01b0316600090815260026020526040902080546001810190915590565b8d8d6040516113029291906144f9565b60405180910390208c8051906020012060405160200161135f9796959493929190968752602087019590955260ff9390931660408601526001600160a01b03919091166060850152608084015260a083015260c082015260e00190565b604051602081830303815290604052805190602001206124d1565b856124fe565b9050806113ab576040516394ab6c0760e01b81526001600160a01b0388166004820152602401610b52565b6113ef89888a89898080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508b9250612572915050565b9998505050505050505050565b60008033905061144687828888888080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508a9250612572915050565b979650505050505050565b600a80546000918290611465600184614509565b815481106114755761147561443c565b6000918252602090912001805490915065ffffffffffff811690600160301b90046001600160d01b03168582116114b8576001600160d01b031695945050505050565b6114cc6114c487612654565b600a9061268b565b6001600160d01b03169695505050505050565b6114e7612153565b7f000000000000000000000000000000000000000000000000000000000000000046146115265760405162461bcd60e51b8152600401610b5290614265565b604051633b0d4dd760e01b8152600c60048201526001602482015260009073__$b1c1335e68417b4234016f4aa58fdfac77$__90633b0d4dd790604401602060405180830381865af4158015611580573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115a491906142a9565b905060006115b0610ff6565b90506115bb83612740565b60016040805183815265ffffffffffff86166020820152908101849052600080516020614ae283398151915290606001610c1d565b6000803390506111a886828787878080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506124a592505050565b60003361164581846127a6565b61166d5760405163d9b3955760e01b81526001600160a01b0382166004820152602401610b52565b6000611677611c0e565b905080156116e45760006116a683600161168f611809565b611699919061451c565b65ffffffffffff16612044565b9050818110156116e257604051636121770b60e11b81526001600160a01b03841660048201526024810182905260448101839052606401610b52565b505b6114468787878786612897565b600060608060008060006060611705612ab7565b61170d612ae4565b60408051600080825260208201909252600f60f81b9b939a50919850469750309650945092509050565b6000806117c38461137a7ff2aad550cf55f045cb27e9c559f9889fdfb6e6cdaa032301d6ea397784ae51d789898961178c8b6001600160a01b0316600090815260026020526040902080546001810190915590565b60408051602081019690965285019390935260ff90911660608401526001600160a01b0316608083015260a082015260c00161135f565b9050806117ee576040516394ab6c0760e01b81526001600160a01b0385166004820152602401610b52565b6111a8868587604051806020016040528060008152506124a5565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166391ddadf46040518163ffffffff1660e01b8152600401602060405180830381865afa925050508015611885575060408051601f3d908101601f1916820190925261188291810190614542565b60015b61126f57610b06612b11565b600061189e848484612b1c565b90505b9392505050565b60006118b4600a612bb2565b6001600160d01b0316905090565b600080600073__$b1c1335e68417b4234016f4aa58fdfac77$__63c0af65918530600c6040518463ffffffff1660e01b81526004016119039392919061455f565b600060405180830381865af4158015611920573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261194891908101906145ad565b9194509250905060ff8316611a505760008280602001905181019061196d91906144b1565b90506000600b805461197e906142c2565b80601f01602080910402602001604051908101604052809291908181526020018280546119aa906142c2565b80156119f75780601f106119cc576101008083540402835291602001916119f7565b820191906000526020600020905b8154815290600101906020018083116119da57829003601f168201915b5050505050905081600b9081611a0d9190614347565b507f67c6aa39e9b4a701119ddc2f40a18145fff9b6f4fa224d5f29c28755f719ffb2818385604051611a4193929190614406565b60405180910390a15050611c08565b60001960ff841601611ac1576000611a6783614606565b60d01c90506000611a76610ff6565b9050611a8182612740565b60016040805183815265ffffffffffff85166020820152908101859052600080516020614ae2833981519152906060015b60405180910390a25050611c08565b60011960ff841601611b34576000611ad88361463d565b60e01c90506000611af660085463ffffffff600160301b9091041690565b9050611b0182612beb565b60026040805183815263ffffffff85166020820152908101859052600080516020614ae283398151915290606001611ab2565b60021960ff841601611b9b57600082806020019051810190611b5691906142a9565b90506000611b62611c0e565b9050611b6d82612c89565b60036040805183815260208101859052908101859052600080516020614ae283398151915290606001611ab2565b60031960ff841601611c0857600082806020019051810190611bbd91906142a9565b90506000611bc96118a8565b9050611bd48261218b565b60046040805183815260208101859052908101859052600080516020614ae28339815191529060600160405180910390a250505b50505050565b6000610b0660075490565b600081815260046020526040812054611c4e90600160d01b810463ffffffff1690600160a01b900465ffffffffffff16614670565b65ffffffffffff1692915050565b611c64612153565b600080856001600160a01b0316858585604051611c829291906144f9565b60006040518083038185875af1925050503d8060008114611cbf576040519150601f19603f3d011682016040523d82523d6000602084013e611cc4565b606091505b5091509150611cd38282612cca565b50505050505050565b600084848484604051602001611cf5949392919061471a565b60408051601f19818403018152919052805160209091012095945050505050565b60607f00000000000000000000000000000000000000000000000000000000000000004614611d935760405162461bcd60e51b815260206004820152602360248201527f50726f6f6673206f6e6c792067656e657261746564206f6e20686f6d6520636860448201526230b4b760e91b6064820152608401610b52565b604051630564edeb60e31b8152600c600482015260ff8416602482015260009073__$b1c1335e68417b4234016f4aa58fdfac77$__90632b276f5890604401602060405180830381865af4158015611def573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e1391906142a9565b604051637352178160e01b815290915073__$b1c1335e68417b4234016f4aa58fdfac77$__90637352178190611e53903090889088908790600401614765565b600060405180830381865af4158015611e70573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261129591908101906147a3565b600b8054611ea5906142c2565b80601f0160208091040260200160405190810160405280929190818152602001828054611ed1906142c2565b8015611f1e5780601f10611ef357610100808354040283529160200191611f1e565b820191906000526020600020905b815481529060010190602001808311611f0157829003601f168201915b505050505081565b611f2e612153565b7f00000000000000000000000000000000000000000000000000000000000000004614611f6d5760405162461bcd60e51b8152600401610b5290614265565b604051633b0d4dd760e01b8152600c60048201526002602482015260009073__$b1c1335e68417b4234016f4aa58fdfac77$__90633b0d4dd790604401602060405180830381865af4158015611fc7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611feb91906142a9565b9050600061200660085463ffffffff600160301b9091041690565b905061201183612beb565b60026040805183815263ffffffff86166020820152908101849052600080516020614ae283398151915290606001610c1d565b60006118a1838361206060408051602081019091526000815290565b612b1c565b61206d612153565b7f000000000000000000000000000000000000000000000000000000000000000046146120ac5760405162461bcd60e51b8152600401610b5290614265565b604051633b0d4dd760e01b8152600c60048201526003602482015260009073__$b1c1335e68417b4234016f4aa58fdfac77$__90633b0d4dd790604401602060405180830381865af4158015612106573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061212a91906142a9565b90506000612136611c0e565b905061214183612c89565b6003610bf5565b6000610b0082612ce6565b303314612175576040516347096e4760e01b8152336004820152602401610b52565b565b806121826005612d90565b03612177575b50565b6064808211156121b85760405163243e544560e01b81526004810183905260248101829052604401610b52565b60006121c26118a8565b90506121e16121cf611809565b6121d885612dff565b600a9190612e33565b505060408051828152602081018590527f0553476bf02ef2726e8ce5ced78d63e26e602e4a2257b1f559418e24b46339979101610e95565b600081600781111561222d5761222d613bc1565b600160ff919091161b92915050565b60008061224884611009565b905060008361225683612219565b16036118a1578381846040516331b75e4d60e01b8152600401610b52939291906147d7565b81546001600160801b03600160801b8204811691811660018301909116036122a7576122a76041612e4e565b6001600160801b03808216600090815260018086016020526040909120939093558354919092018216600160801b029116179055565b60005b84518110156123b5576000808683815181106122fe576122fe61443c565b60200260200101516001600160a01b03168684815181106123215761232161443c565b602002602001015186858151811061233b5761233b61443c565b602002602001015160405161235091906147f9565b60006040518083038185875af1925050503d806000811461238d576040519150601f19603f3d011682016040523d82523d6000602084013e612392565b606091505b50915091506123a18282612cca565b505050806123ae90614468565b90506122e0565b505050505050565b6000818152600960205260408120600281015460018201546123df9190614815565b6123eb610a7c85610fd5565b11159392505050565b60008061240386868686611cdc565b9050612451816124136007612219565b61241d6006612219565b6124276002612219565b6001612434600782614828565b61243f906002614925565b6124499190614509565b18181861223c565b506000818152600460205260409081902080546001600160f81b0316600160f81b179055517f789cf55be980739dad1d0699b93b58e806b51c9d96619bfa8fe0a28abaa7b30c90610fc49083815260200190565b60006124c8858585856124c360408051602081019091526000815290565b612572565b95945050505050565b6000610b006124de612e60565b8360405161190160f01b8152600281019290925260228201526042902090565b6000836001600160a01b03163b6000036125605760008061251f8585612f8b565b509092509050600081600381111561253957612539613bc1565b1480156125575750856001600160a01b0316826001600160a01b0316145b925050506118a1565b61256b848484612fd8565b90506118a1565b600061258286610cdb6001612219565b5060006125988661259289610fd5565b85612b1c565b905060006125a988888885886130b3565b9050835160000361260057866001600160a01b03167fb8e138887d0aa13bab447e82de9d5c1777041ecd21ca36ba824ff1e6c07ddda4898884896040516125f39493929190614934565b60405180910390a2611446565b866001600160a01b03167fe2babfbac5889a709b63bb7f598b324e08bc5a4fb9ec647fb3cbc9ec07eb8712898884898960405161264195949392919061495c565b60405180910390a2979650505050505050565b600065ffffffffffff821115612687576040516306dfcc6560e41b81526030600482015260248101839052604401610b52565b5090565b8154600090818160058111156126ea5760006126a6846131b6565b6126b09085614509565b60008881526020902090915081015465ffffffffffff90811690871610156126da578091506126e8565b6126e5816001614815565b92505b505b60006126f88787858561330f565b905080156127335761271d8761270f600184614509565b600091825260209091200190565b54600160301b90046001600160d01b0316611446565b6000979650505050505050565b6008546040805165ffffffffffff928316815291831660208301527fc565b045403dc03c2eea82b81a0465edad9e2e7fc4d97e11421c209da93d7a93910160405180910390a16008805465ffffffffffff191665ffffffffffff92909216919091179055565b805160009060348110156127be576001915050610b00565b82810160131901516001600160a01b031981166b046e0e4dee0dee6cae47a60f60a31b146127f157600192505050610b00565b6000806127ff602885614509565b90505b83811015612876576000806128368884815181106128225761282261443c565b01602001516001600160f81b031916613371565b915091508161284e5760019650505050505050610b00565b8060ff166004856001600160a01b0316901b17935050508061286f90614468565b9050612802565b50856001600160a01b0316816001600160a01b031614935050505092915050565b60006128ac8686868680519060200120611cdc565b9050845186511415806128c157508351865114155b806128cb57508551155b1561290057855184518651604051630447b05d60e41b8152600481019390935260248301919091526044820152606401610b52565b600081815260046020526040902054600160a01b900465ffffffffffff161561294b578061292d82611009565b6040516331b75e4d60e01b8152610b529291906000906004016147d7565b6000612955610ff6565b61295d611809565b65ffffffffffff1661296f9190614815565b9050600061298a60085463ffffffff600160301b9091041690565b600084815260046020526040902080546001600160a01b0319166001600160a01b0387161781559091506129bd83612654565b815465ffffffffffff91909116600160a01b0265ffffffffffff60a01b199091161781556129ea82613403565b815463ffffffff91909116600160d01b0263ffffffff60d01b1990911617815588517f7d84a6263ae0d98d3329bd7b46bb4e8d6f98cd35a7adb45c274c8b7fd5ebd5e090859087908c908c906001600160401b03811115612a4d57612a4d61386a565b604051908082528060200260200182016040528015612a8057816020015b6060815260200190600190039081612a6b5790505b508c89612a8d8a82614815565b8e604051612aa3999897969594939291906149a2565b60405180910390a150505095945050505050565b6060610b067f00000000000000000000000000000000000000000000000000000000000000006000613434565b6060610b067f00000000000000000000000000000000000000000000000000000000000000006001613434565b6000610b0643612654565b60007f0000000000000000000000000000000000000000000000000000000000000000604051630748d63560e31b81526001600160a01b038681166004830152602482018690529190911690633a46b1a890604401602060405180830381865afa158015612b8e573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061189e91906142a9565b80546000908015612be257612bcc8361270f600184614509565b54600160301b90046001600160d01b03166118a1565b60009392505050565b8063ffffffff16600003612c155760405163f1cfbf0560e01b815260006004820152602401610b52565b6008546040805163ffffffff600160301b9093048316815291831660208301527f7e3f7f0708a84de9203036abaa450dccc85ad5ff52f78c170f3edb55cf5e8828910160405180910390a16008805463ffffffff909216600160301b0269ffffffff00000000000019909216919091179055565b60075460408051918252602082018390527fccb45da8d5717e6c4544694297c4ba5cf151d455c9bb0ed4fc7a38411bc05461910160405180910390a1600755565b606082612cdf57612cda826134df565b610b00565b5080610b00565b60006064612cf383611451565b604051632394e7a360e21b8152600481018590526001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001690638e539e8c90602401602060405180830381865afa158015612d58573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612d7c91906142a9565b612d869190614a79565b610b009190614aa6565b80546000906001600160801b0380821691600160801b9004168103612db957612db96031612e4e565b6001600160801b038181166000908152600185810160205260408220805492905585546fffffffffffffffffffffffffffffffff19169301909116919091179092555090565b60006001600160d01b03821115612687576040516306dfcc6560e41b815260d0600482015260248101839052604401610b52565b600080612e41858585613508565b915091505b935093915050565b634e487b71600052806020526024601cfd5b6000306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016148015612eb957507f000000000000000000000000000000000000000000000000000000000000000046145b15612ee357507f000000000000000000000000000000000000000000000000000000000000000090565b610b06604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f60208201527f0000000000000000000000000000000000000000000000000000000000000000918101919091527f000000000000000000000000000000000000000000000000000000000000000060608201524660808201523060a082015260009060c00160405160208183030381529060405280519060200120905090565b60008060008351604103612fc55760208401516040850151606086015160001a612fb78882858561365c565b955095509550505050612fd1565b50508151600091506002905b9250925092565b6000806000856001600160a01b03168585604051602401612ffa929190614ac8565b60408051601f198184030181529181526020820180516001600160e01b0316630b135d3f60e11b1790525161302f91906147f9565b600060405180830381855afa9150503d806000811461306a576040519150601f19603f3d011682016040523d82523d6000602084013e61306f565b606091505b509150915081801561308357506020815110155b80156111a857508051630b135d3f60e11b906130a890830160209081019084016142a9565b149695505050505050565b60008581526009602090815260408083206001600160a01b03881684526003810190925282205460ff1615613106576040516371c6af4960e01b81526001600160a01b0387166004820152602401610b52565b6001600160a01b03861660009081526003820160205260409020805460ff1916600117905560ff851661315257838160000160008282546131479190614815565b909155506131ab9050565b60001960ff86160161317257838160010160008282546131479190614815565b60011960ff86160161319257838160020160008282546131479190614815565b6040516303599be160e11b815260040160405180910390fd5b509195945050505050565b6000600182116131c4575090565b816001600160801b82106131dd5760809190911c9060401b5b6801000000000000000082106131f85760409190911c9060201b5b640100000000821061320f5760209190911c9060101b5b6201000082106132245760109190911c9060081b5b61010082106132385760089190911c9060041b5b6010821061324b5760049190911c9060021b5b600482106132575760011b5b600302600190811c9081858161326f5761326f614a90565b048201901c9050600181858161328757613287614a90565b048201901c9050600181858161329f5761329f614a90565b048201901c905060018185816132b7576132b7614a90565b048201901c905060018185816132cf576132cf614a90565b048201901c905060018185816132e7576132e7614a90565b048201901c905061330681858161330057613300614a90565b04821190565b90039392505050565b60005b81831015613369576000613326848461372b565b60008781526020902090915065ffffffffffff86169082015465ffffffffffff16111561335557809250613363565b613360816001614815565b93505b50613312565b509392505050565b60008060f883901c602f8111801561338c5750603a8160ff16105b156133a157600194602f199091019350915050565b8060ff1660401080156133b7575060478160ff16105b156133cc576001946036199091019350915050565b8060ff1660601080156133e2575060678160ff16105b156133f7576001946056199091019350915050565b50600093849350915050565b600063ffffffff821115612687576040516306dfcc6560e41b81526020600482015260248101839052604401610b52565b606060ff831461344e5761344783613746565b9050610b00565b81805461345a906142c2565b80601f0160208091040260200160405190810160405280929190818152602001828054613486906142c2565b80156134d35780601f106134a8576101008083540402835291602001916134d3565b820191906000526020600020905b8154815290600101906020018083116134b657829003601f168201915b50505050509050610b00565b8051156134ef5780518082602001fd5b60405163d6bda27560e01b815260040160405180910390fd5b8254600090819080156136015760006135268761270f600185614509565b805490915065ffffffffffff80821691600160301b90046001600160d01b031690881682111561356957604051632520601d60e01b815260040160405180910390fd5b8765ffffffffffff168265ffffffffffff16036135a257825465ffffffffffff16600160301b6001600160d01b038916021783556135f3565b6040805180820190915265ffffffffffff808a1682526001600160d01b03808a1660208085019182528d54600181018f5560008f81529190912094519151909216600160301b029216919091179101555b9450859350612e4692505050565b50506040805180820190915265ffffffffffff80851682526001600160d01b0380851660208085019182528854600181018a5560008a815291822095519251909316600160301b029190931617920191909155905081612e46565b600080807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08411156136975750600091506003905082613721565b604080516000808252602082018084528a905260ff891692820192909252606081018790526080810186905260019060a0016020604051602081039080840390855afa1580156136eb573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b03811661371757506000925060019150829050613721565b9250600091508190505b9450945094915050565b600061373a6002848418614aa6565b6118a190848416614815565b6060600061375383613785565b604080516020808252818301909252919250600091906020820181803683375050509182525060208101929092525090565b600060ff8216601f811115610b0057604051632cd44ac360e21b815260040160405180910390fd5b6000602082840312156137bf57600080fd5b81356001600160e01b0319811681146118a157600080fd5b6000602082840312156137e957600080fd5b5035919050565b60005b8381101561380b5781810151838201526020016137f3565b50506000910152565b6000815180845261382c8160208601602086016137f0565b601f01601f19169290920160200192915050565b6020815260006118a16020830184613814565b80356001600160a01b038116811461126f57600080fd5b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b03811182821017156138a8576138a861386a565b604052919050565b60006001600160401b038211156138c9576138c961386a565b50601f01601f191660200190565b600082601f8301126138e857600080fd5b81356138fb6138f6826138b0565b613880565b81815284602083860101111561391057600080fd5b816020850160208301376000918101602001919091529392505050565b6000806000806080858703121561394357600080fd5b61394c85613853565b935061395a60208601613853565b92506040850135915060608501356001600160401b0381111561397c57600080fd5b613988878288016138d7565b91505092959194509250565b60006001600160401b038211156139ad576139ad61386a565b5060051b60200190565b600082601f8301126139c857600080fd5b813560206139d86138f683613994565b82815260059290921b840181019181810190868411156139f757600080fd5b8286015b84811015613a1957613a0c81613853565b83529183019183016139fb565b509695505050505050565b600082601f830112613a3557600080fd5b81356020613a456138f683613994565b82815260059290921b84018101918181019086841115613a6457600080fd5b8286015b84811015613a195780358352918301918301613a68565b600082601f830112613a9057600080fd5b81356020613aa06138f683613994565b82815260059290921b84018101918181019086841115613abf57600080fd5b8286015b84811015613a195780356001600160401b03811115613ae25760008081fd5b613af08986838b01016138d7565b845250918301918301613ac3565b60008060008060808587031215613b1457600080fd5b84356001600160401b0380821115613b2b57600080fd5b613b37888389016139b7565b95506020870135915080821115613b4d57600080fd5b613b5988838901613a24565b94506040870135915080821115613b6f57600080fd5b50613b7c87828801613a7f565b949793965093946060013593505050565b600060208284031215613b9f57600080fd5b81356001600160401b03811115613bb557600080fd5b611295848285016138d7565b634e487b7160e01b600052602160045260246000fd5b60088110613bf557634e487b7160e01b600052602160045260246000fd5b9052565b60208101610b008284613bd7565b60008060408385031215613c1a57600080fd5b82359150613c2a60208401613853565b90509250929050565b60ff8116811461218857600080fd5b60008060408385031215613c5557600080fd5b823591506020830135613c6781613c33565b809150509250929050565b60008083601f840112613c8457600080fd5b5081356001600160401b03811115613c9b57600080fd5b602083019150836020828501011115613cb357600080fd5b9250929050565b600080600080600080600060c0888a031215613cd557600080fd5b873596506020880135613ce781613c33565b9550613cf560408901613853565b945060608801356001600160401b0380821115613d1157600080fd5b613d1d8b838c01613c72565b909650945060808a0135915080821115613d3657600080fd5b613d428b838c016138d7565b935060a08a0135915080821115613d5857600080fd5b50613d658a828b016138d7565b91505092959891949750929550565b600080600080600060808688031215613d8c57600080fd5b853594506020860135613d9e81613c33565b935060408601356001600160401b0380821115613dba57600080fd5b613dc689838a01613c72565b90955093506060880135915080821115613ddf57600080fd5b50613dec888289016138d7565b9150509295509295909350565b65ffffffffffff8116811461218857600080fd5b600060208284031215613e1f57600080fd5b81356118a181613df9565b60008060008060608587031215613e4057600080fd5b843593506020850135613e5281613c33565b925060408501356001600160401b03811115613e6d57600080fd5b613e7987828801613c72565b95989497509550505050565b60008060008060808587031215613e9b57600080fd5b84356001600160401b0380821115613eb257600080fd5b613ebe888389016139b7565b95506020870135915080821115613ed457600080fd5b613ee088838901613a24565b94506040870135915080821115613ef657600080fd5b613f0288838901613a7f565b93506060870135915080821115613f1857600080fd5b50613988878288016138d7565b600060208284031215613f3757600080fd5b6118a182613853565b600081518084526020808501945080840160005b83811015613f7057815187529582019590820190600101613f54565b509495945050505050565b60ff60f81b8816815260e060208201526000613f9a60e0830189613814565b8281036040840152613fac8189613814565b606084018890526001600160a01b038716608085015260a0840186905283810360c08501529050613fdd8185613f40565b9a9950505050505050505050565b6000806000806080858703121561400157600080fd5b84359350602085013561401381613c33565b925061402160408601613853565b915060608501356001600160401b0381111561397c57600080fd5b60008060006060848603121561405157600080fd5b61405a84613853565b92506020840135915060408401356001600160401b0381111561407c57600080fd5b614088868287016138d7565b9150509250925092565b600080600080600060a086880312156140aa57600080fd5b6140b386613853565b94506140c160208701613853565b935060408601356001600160401b03808211156140dd57600080fd5b6140e989838a01613a24565b945060608801359150808211156140ff57600080fd5b61410b89838a01613a24565b93506080880135915080821115613ddf57600080fd5b6000806000806060858703121561413757600080fd5b61414085613853565b93506020850135925060408501356001600160401b03811115613e6d57600080fd5b6000806040838503121561417557600080fd5b823561418081613c33565b915060208301356001600160401b0381111561419b57600080fd5b6141a7858286016138d7565b9150509250929050565b6000602082840312156141c357600080fd5b813563ffffffff811681146118a157600080fd5b600080604083850312156141ea57600080fd5b6141f383613853565b946020939093013593505050565b600080600080600060a0868803121561421957600080fd5b61422286613853565b945061423060208701613853565b9350604086013592506060860135915060808601356001600160401b0381111561425957600080fd5b613dec888289016138d7565b60208082526024908201527f4f7065726174696f6e206f6e6c7920616c6c6f776564206f6e20686f6d6520636040820152633430b4b760e11b606082015260800190565b6000602082840312156142bb57600080fd5b5051919050565b600181811c908216806142d657607f821691505b6020821081036142f657634e487b7160e01b600052602260045260246000fd5b50919050565b601f82111561434257600081815260208120601f850160051c810160208610156143235750805b601f850160051c820191505b818110156123b55782815560010161432f565b505050565b81516001600160401b038111156143605761436061386a565b6143748161436e84546142c2565b846142fc565b602080601f8311600181146143a957600084156143915750858301515b600019600386901b1c1916600185901b1785556123b5565b600085815260208120601f198616915b828110156143d8578886015182559484019460019091019084016143b9565b50858210156143f65787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6060815260006144196060830186613814565b828103602084015261442b8186613814565b915050826040830152949350505050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60006001820161447a5761447a614452565b5060010190565b600061448f6138f6846138b0565b90508281528383830111156144a357600080fd5b6118a18360208301846137f0565b6000602082840312156144c357600080fd5b81516001600160401b038111156144d957600080fd5b8201601f810184136144ea57600080fd5b61129584825160208401614481565b8183823760009101908152919050565b81810381811115610b0057610b00614452565b65ffffffffffff82811682821603908082111561453b5761453b614452565b5092915050565b60006020828403121561455457600080fd5b81516118a181613df9565b6060815260006145726060830186613814565b6001600160a01b039490941660208301525060400152919050565b600082601f83011261459e57600080fd5b6118a183835160208501614481565b6000806000606084860312156145c257600080fd5b83516145cd81613c33565b60208501519093506001600160401b038111156145e957600080fd5b6145f58682870161458d565b925050604084015190509250925092565b805160208201516001600160d01b031980821692919060068310156146355780818460060360031b1b83161693505b505050919050565b805160208201516001600160e01b031980821692919060048310156146355760049290920360031b82901b161692915050565b65ffffffffffff81811683821601908082111561453b5761453b614452565b600081518084526020808501945080840160005b83811015613f705781516001600160a01b0316875295820195908201906001016146a3565b6000815180845260208085019450848260051b860182860160005b8581101561470d5783830389526146fb838351613814565b988501989250908401906001016146e3565b5090979650505050505050565b60808152600061472d608083018761468f565b828103602084015261473f8187613f40565b9050828103604084015261475381866146c8565b91505082606083015295945050505050565b6001600160a01b038516815260ff8416602082015260806040820181905260009061479290830185613814565b905082606083015295945050505050565b6000602082840312156147b557600080fd5b81516001600160401b038111156147cb57600080fd5b6112958482850161458d565b838152606081016147eb6020830185613bd7565b826040830152949350505050565b6000825161480b8184602087016137f0565b9190910192915050565b80820180821115610b0057610b00614452565b60ff8181168382160190811115610b0057610b00614452565b600181815b8085111561487c57816000190482111561486257614862614452565b8085161561486f57918102915b93841c9390800290614846565b509250929050565b60008261489357506001610b00565b816148a057506000610b00565b81600181146148b657600281146148c0576148dc565b6001915050610b00565b60ff8411156148d1576148d1614452565b50506001821b610b00565b5060208310610133831016604e8410600b84101617156148ff575081810a610b00565b6149098383614841565b806000190482111561491d5761491d614452565b029392505050565b60006118a160ff841683614884565b84815260ff841660208201528260408201526080606082015260006111a86080830184613814565b85815260ff8516602082015283604082015260a06060820152600061498460a0830185613814565b82810360808401526149968185613814565b98975050505050505050565b60006101208b8352602060018060a01b038c16818501528160408501526149cb8285018c61468f565b915083820360608501526149df828b613f40565b915083820360808501528189518084528284019150828160051b850101838c0160005b83811015614a3057601f19878403018552614a1e838351613814565b94860194925090850190600101614a02565b505086810360a0880152614a44818c6146c8565b9450505050508560c08401528460e0840152828103610100840152614a698185613814565b9c9b505050505050505050505050565b8082028115828204841417610b0057610b00614452565b634e487b7160e01b600052601260045260246000fd5b600082614ac357634e487b7160e01b600052601260045260246000fd5b500490565b82815260406020820152600061189e604083018461381456fe80c51ad8a7db1a7a86cc355b77bd5cd7ea08f6071ea91d85a8f792734700a0eca2646970667358221220a295bf4977b633b13f69388b67ec678a5025198475985e252038973de715a24d64736f6c63430008140033", - "libraries": { - "ProofHandler": "0x0152ee45780385dACCCCB128D816031CfFe5F36B" - }, - "devdoc": { - "author": "Web3 Hackers Collective", - "custom:security-contact": "julien@strat.cc", - "details": "Uses ProofHandler library for managing cross-chain parameter updates", - "errors": { - "CheckpointUnorderedInsertion()": [ - { - "details": "A value was attempted to be inserted on a past checkpoint." - } - ], - "FailedCall()": [ - { - "details": "A call to an address target failed. The target may have reverted." - } - ], - "GovernorAlreadyCastVote(address)": [ - { - "details": "The vote was already cast." - } - ], - "GovernorAlreadyQueuedProposal(uint256)": [ - { - "details": "The proposal has already been queued." - } - ], - "GovernorDisabledDeposit()": [ - { - "details": "Token deposits are disabled in this contract." - } - ], - "GovernorInsufficientProposerVotes(address,uint256,uint256)": [ - { - "details": "The `proposer` does not have the required votes to create a proposal." - } - ], - "GovernorInvalidProposalLength(uint256,uint256,uint256)": [ - { - "details": "Empty proposal or a mismatch between the parameters length for a proposal call." - } - ], - "GovernorInvalidQuorumFraction(uint256,uint256)": [ - { - "details": "The quorum set is not a valid fraction." - } - ], - "GovernorInvalidSignature(address)": [ - { - "details": "The provided signature is not valid for the expected `voter`. If the `voter` is a contract, the signature is not valid using {IERC1271-isValidSignature}." - } - ], - "GovernorInvalidVoteParams()": [ - { - "details": "The provided params buffer is not supported by the counting module." - } - ], - "GovernorInvalidVoteType()": [ - { - "details": "The vote type used is not valid for the corresponding counting module." - } - ], - "GovernorInvalidVotingPeriod(uint256)": [ - { - "details": "The voting period set is not a valid period." - } - ], - "GovernorNonexistentProposal(uint256)": [ - { - "details": "The `proposalId` doesn't exist." - } - ], - "GovernorNotQueuedProposal(uint256)": [ - { - "details": "The proposal hasn't been queued yet." - } - ], - "GovernorOnlyExecutor(address)": [ - { - "details": "The `account` is not the governance executor." - } - ], - "GovernorOnlyProposer(address)": [ - { - "details": "The `account` is not a proposer." - } - ], - "GovernorQueueNotImplemented()": [ - { - "details": "Queue operation is not implemented for this governor. Execute should be called directly." - } - ], - "GovernorRestrictedProposer(address)": [ - { - "details": "The `proposer` is not allowed to create a proposal." - } - ], - "GovernorUnexpectedProposalState(uint256,uint8,bytes32)": [ - { - "details": "The current state of a proposal is not the required for performing an operation. The `expectedStates` is a bitmap with the bits enabled for each ProposalState enum position counting from right to left. NOTE: If `expectedState` is `bytes32(0)`, the proposal is expected to not be in any state (i.e. not exist). This is the case when a proposal that is expected to be unset is already initiated (the proposal is duplicated). See {Governor-_encodeStateBitmap}." - } - ], - "InvalidAccountNonce(address,uint256)": [ - { - "details": "The nonce used for an `account` is not the expected current nonce." - } - ], - "SafeCastOverflowedUintDowncast(uint8,uint256)": [ - { - "details": "Value doesn't fit in an uint of `bits` size." - } - ] - }, - "events": { - "EIP712DomainChanged()": { - "details": "MAY be emitted to signal that the domain could have changed." - }, - "GovernanceParameterUpdated(uint8,uint256,uint256,uint256)": { - "params": { - "newValue": "New value", - "nonce": "Update sequence number", - "oldValue": "Previous value", - "operationType": "Type of parameter updated" - } - }, - "ManifestoUpdated(string,string,uint256)": { - "params": { - "newManifesto": "New manifesto CID", - "nonce": "Update sequence number", - "oldManifesto": "Previous manifesto CID" - } - }, - "ProposalCanceled(uint256)": { - "details": "Emitted when a proposal is canceled." - }, - "ProposalCreated(uint256,address,address[],uint256[],string[],bytes[],uint256,uint256,string)": { - "details": "Emitted when a proposal is created." - }, - "ProposalExecuted(uint256)": { - "details": "Emitted when a proposal is executed." - }, - "ProposalQueued(uint256,uint256)": { - "details": "Emitted when a proposal is queued." - }, - "VoteCast(address,uint256,uint8,uint256,string)": { - "details": "Emitted when a vote is cast without params. Note: `support` values should be seen as buckets. Their interpretation depends on the voting module used." - }, - "VoteCastWithParams(address,uint256,uint8,uint256,string,bytes)": { - "details": "Emitted when a vote is cast with params. Note: `support` values should be seen as buckets. Their interpretation depends on the voting module used. `params` are additional encoded parameters. Their interpretation also depends on the voting module used." - } - }, - "kind": "dev", - "methods": { - "CLOCK_MODE()": { - "details": "Machine-readable description of the clock as specified in ERC-6372." - }, - "COUNTING_MODE()": { - "details": "See {IGovernor-COUNTING_MODE}." - }, - "cancel(address[],uint256[],bytes[],bytes32)": { - "details": "See {IGovernor-cancel}." - }, - "castVote(uint256,uint8)": { - "details": "See {IGovernor-castVote}." - }, - "castVoteBySig(uint256,uint8,address,bytes)": { - "details": "See {IGovernor-castVoteBySig}." - }, - "castVoteWithReason(uint256,uint8,string)": { - "details": "See {IGovernor-castVoteWithReason}." - }, - "castVoteWithReasonAndParams(uint256,uint8,string,bytes)": { - "details": "See {IGovernor-castVoteWithReasonAndParams}." - }, - "castVoteWithReasonAndParamsBySig(uint256,uint8,address,string,bytes,bytes)": { - "details": "See {IGovernor-castVoteWithReasonAndParamsBySig}." - }, - "claimParameterUpdate(bytes)": { - "params": { - "proof": "Proof generated by home chain" - } - }, - "clock()": { - "details": "Clock (as specified in ERC-6372) is set to match the token's clock. Fallback to block numbers if the token does not implement ERC-6372." - }, - "constructor": { - "params": { - "_home": "Chain ID where this contract is considered home", - "_manifestoCid": "Initial manifesto CID", - "_name": "Name of the governance contract", - "_proposalThreshold": "Minimum votes needed for proposal", - "_quorum": "Minimum participation percentage required", - "_token": "The voting token contract address", - "_votingDelay": "Time before voting begins", - "_votingPeriod": "Duration of voting period" - } - }, - "eip712Domain()": { - "details": "See {IERC-5267}." - }, - "execute(address[],uint256[],bytes[],bytes32)": { - "details": "See {IGovernor-execute}." - }, - "generateParameterProof(uint8,bytes)": { - "params": { - "operationType": "Type of parameter being updated", - "value": "Encoded parameter value" - }, - "returns": { - "proof": "Encoded proof data" - } - }, - "getVotes(address,uint256)": { - "details": "See {IGovernor-getVotes}." - }, - "getVotesWithParams(address,uint256,bytes)": { - "details": "See {IGovernor-getVotesWithParams}." - }, - "hasVoted(uint256,address)": { - "details": "See {IGovernor-hasVoted}." - }, - "hashProposal(address[],uint256[],bytes[],bytes32)": { - "details": "See {IGovernor-hashProposal}. The proposal id is produced by hashing the ABI encoded `targets` array, the `values` array, the `calldatas` array and the descriptionHash (bytes32 which itself is the keccak256 hash of the description string). This proposal id can be produced from the proposal data which is part of the {ProposalCreated} event. It can even be computed in advance, before the proposal is submitted. Note that the chainId and the governor address are not part of the proposal id computation. Consequently, the same proposal (with same operation and same description) will have the same id if submitted on multiple governors across multiple networks. This also means that in order to execute the same operation twice (on the same governor) the proposer will have to change the description in order to avoid proposal id conflicts." - }, - "name()": { - "details": "See {IGovernor-name}." - }, - "nonces(address)": { - "details": "Returns the next unused nonce for an address." - }, - "onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)": { - "details": "See {IERC1155Receiver-onERC1155BatchReceived}. Receiving tokens is disabled if the governance executor is other than the governor itself (eg. when using with a timelock)." - }, - "onERC1155Received(address,address,uint256,uint256,bytes)": { - "details": "See {IERC1155Receiver-onERC1155Received}. Receiving tokens is disabled if the governance executor is other than the governor itself (eg. when using with a timelock)." - }, - "onERC721Received(address,address,uint256,bytes)": { - "details": "See {IERC721Receiver-onERC721Received}. Receiving tokens is disabled if the governance executor is other than the governor itself (eg. when using with a timelock)." - }, - "proposalDeadline(uint256)": { - "details": "See {IGovernor-proposalDeadline}." - }, - "proposalEta(uint256)": { - "details": "See {IGovernor-proposalEta}." - }, - "proposalNeedsQueuing(uint256)": { - "details": "See {IGovernor-proposalNeedsQueuing}." - }, - "proposalProposer(uint256)": { - "details": "See {IGovernor-proposalProposer}." - }, - "proposalSnapshot(uint256)": { - "details": "See {IGovernor-proposalSnapshot}." - }, - "proposalVotes(uint256)": { - "details": "Accessor to the internal vote counts." - }, - "propose(address[],uint256[],bytes[],string)": { - "details": "See {IGovernor-propose}. This function has opt-in frontrunning protection, described in {_isValidDescriptionForProposer}." - }, - "queue(address[],uint256[],bytes[],bytes32)": { - "details": "See {IGovernor-queue}." - }, - "quorumDenominator()": { - "details": "Returns the quorum denominator. Defaults to 100, but may be overridden." - }, - "quorumNumerator()": { - "details": "Returns the current quorum numerator. See {quorumDenominator}." - }, - "quorumNumerator(uint256)": { - "details": "Returns the quorum numerator at a specific timepoint. See {quorumDenominator}." - }, - "relay(address,uint256,bytes)": { - "details": "Relays a transaction or function call to an arbitrary target. In cases where the governance executor is some contract other than the governor itself, like when using a timelock, this function can be invoked in a governance proposal to recover tokens or Ether that was sent to the governor contract by mistake. Note that if the executor is simply the governor itself, use of `relay` is redundant." - }, - "setManifesto(string)": { - "params": { - "newManifesto": "New manifesto CID" - } - }, - "setProposalThreshold(uint256)": { - "params": { - "newProposalThreshold": "New proposal threshold value" - } - }, - "setVotingDelay(uint48)": { - "params": { - "newVotingDelay": "New voting delay value" - } - }, - "setVotingPeriod(uint32)": { - "params": { - "newVotingPeriod": "New voting period value" - } - }, - "state(uint256)": { - "details": "See {IGovernor-state}." - }, - "supportsInterface(bytes4)": { - "details": "See {IERC165-supportsInterface}." - }, - "token()": { - "details": "The token that voting power is sourced from." - }, - "updateQuorumNumerator(uint256)": { - "params": { - "newQuorumNumerator": "New quorum numerator value" - } - }, - "version()": { - "details": "See {IGovernor-version}." - } - }, - "title": "Cross-chain Governance Contract", - "version": 1 - }, - "userdoc": { - "events": { - "GovernanceParameterUpdated(uint8,uint256,uint256,uint256)": { - "notice": "Emitted when a governance parameter is updated" - }, - "ManifestoUpdated(string,string,uint256)": { - "notice": "Emitted when the manifesto is updated" - } - }, - "kind": "user", - "methods": { - "claimParameterUpdate(bytes)": { - "notice": "Claims a parameter update on a foreign chain" - }, - "constructor": { - "notice": "Initializes the governance contract" - }, - "generateParameterProof(uint8,bytes)": { - "notice": "Generates proof for parameter updates" - }, - "home()": { - "notice": "Chain ID where this contract was originally deployed" - }, - "manifesto()": { - "notice": "IPFS CID of the DAO's manifesto" - }, - "setManifesto(string)": { - "notice": "Updates the DAO's manifesto on the home chain" - }, - "setProposalThreshold(uint256)": { - "notice": "Updates the proposal threshold parameter on the home chain" - }, - "setVotingDelay(uint48)": { - "notice": "Updates the voting delay parameter on the home chain" - }, - "setVotingPeriod(uint32)": { - "notice": "Updates the voting period parameter on the home chain" - }, - "updateQuorumNumerator(uint256)": { - "notice": "Updates the quorum numerator on the home chain" - } - }, - "notice": "Implementation of a DAO with secure cross-chain synchronization capabilities", - "version": 1 - }, - "storageLayout": { - "storage": [ - { - "astId": 7382, - "contract": "contracts/variants/crosschain/Gov.sol:Gov", - "label": "_nameFallback", - "offset": 0, - "slot": "0", - "type": "t_string_storage" - }, - { - "astId": 7384, - "contract": "contracts/variants/crosschain/Gov.sol:Gov", - "label": "_versionFallback", - "offset": 0, - "slot": "1", - "type": "t_string_storage" - }, - { - "astId": 6230, - "contract": "contracts/variants/crosschain/Gov.sol:Gov", - "label": "_nonces", - "offset": 0, - "slot": "2", - "type": "t_mapping(t_address,t_uint256)" - }, - { - "astId": 237, - "contract": "contracts/variants/crosschain/Gov.sol:Gov", - "label": "_name", - "offset": 0, - "slot": "3", - "type": "t_string_storage" - }, - { - "astId": 242, - "contract": "contracts/variants/crosschain/Gov.sol:Gov", - "label": "_proposals", - "offset": 0, - "slot": "4", - "type": "t_mapping(t_uint256,t_struct(ProposalCore)215_storage)" - }, - { - "astId": 245, - "contract": "contracts/variants/crosschain/Gov.sol:Gov", - "label": "_governanceCall", - "offset": 0, - "slot": "5", - "type": "t_struct(Bytes32Deque)12901_storage" - }, - { - "astId": 2663, - "contract": "contracts/variants/crosschain/Gov.sol:Gov", - "label": "_proposalThreshold", - "offset": 0, - "slot": "7", - "type": "t_uint256" - }, - { - "astId": 2665, - "contract": "contracts/variants/crosschain/Gov.sol:Gov", - "label": "_votingDelay", - "offset": 0, - "slot": "8", - "type": "t_uint48" - }, - { - "astId": 2667, - "contract": "contracts/variants/crosschain/Gov.sol:Gov", - "label": "_votingPeriod", - "offset": 6, - "slot": "8", - "type": "t_uint32" - }, - { - "astId": 2450, - "contract": "contracts/variants/crosschain/Gov.sol:Gov", - "label": "_proposalVotes", - "offset": 0, - "slot": "9", - "type": "t_mapping(t_uint256,t_struct(ProposalVote)2445_storage)" - }, - { - "astId": 2969, - "contract": "contracts/variants/crosschain/Gov.sol:Gov", - "label": "_quorumNumeratorHistory", - "offset": 0, - "slot": "10", - "type": "t_struct(Trace208)11842_storage" - }, - { - "astId": 13540, - "contract": "contracts/variants/crosschain/Gov.sol:Gov", - "label": "manifesto", - "offset": 0, - "slot": "11", - "type": "t_string_storage" - }, - { - "astId": 13544, - "contract": "contracts/variants/crosschain/Gov.sol:Gov", - "label": "_proofStorage", - "offset": 0, - "slot": "12", - "type": "t_struct(ProofStorage)14687_storage" - } - ], - "types": { - "t_address": { - "encoding": "inplace", - "label": "address", - "numberOfBytes": "20" - }, - "t_array(t_struct(Checkpoint208)11847_storage)dyn_storage": { - "base": "t_struct(Checkpoint208)11847_storage", - "encoding": "dynamic_array", - "label": "struct Checkpoints.Checkpoint208[]", - "numberOfBytes": "32" - }, - "t_bool": { - "encoding": "inplace", - "label": "bool", - "numberOfBytes": "1" - }, - "t_bytes32": { - "encoding": "inplace", - "label": "bytes32", - "numberOfBytes": "32" - }, - "t_mapping(t_address,t_bool)": { - "encoding": "mapping", - "key": "t_address", - "label": "mapping(address => bool)", - "numberOfBytes": "32", - "value": "t_bool" - }, - "t_mapping(t_address,t_uint256)": { - "encoding": "mapping", - "key": "t_address", - "label": "mapping(address => uint256)", - "numberOfBytes": "32", - "value": "t_uint256" - }, - "t_mapping(t_bytes32,t_bool)": { - "encoding": "mapping", - "key": "t_bytes32", - "label": "mapping(bytes32 => bool)", - "numberOfBytes": "32", - "value": "t_bool" - }, - "t_mapping(t_uint128,t_bytes32)": { - "encoding": "mapping", - "key": "t_uint128", - "label": "mapping(uint128 => bytes32)", - "numberOfBytes": "32", - "value": "t_bytes32" - }, - "t_mapping(t_uint256,t_struct(ProposalCore)215_storage)": { - "encoding": "mapping", - "key": "t_uint256", - "label": "mapping(uint256 => struct Governor.ProposalCore)", - "numberOfBytes": "32", - "value": "t_struct(ProposalCore)215_storage" - }, - "t_mapping(t_uint256,t_struct(ProposalVote)2445_storage)": { - "encoding": "mapping", - "key": "t_uint256", - "label": "mapping(uint256 => struct GovernorCountingSimple.ProposalVote)", - "numberOfBytes": "32", - "value": "t_struct(ProposalVote)2445_storage" - }, - "t_mapping(t_uint8,t_uint256)": { - "encoding": "mapping", - "key": "t_uint8", - "label": "mapping(uint8 => uint256)", - "numberOfBytes": "32", - "value": "t_uint256" - }, - "t_string_storage": { - "encoding": "bytes", - "label": "string", - "numberOfBytes": "32" - }, - "t_struct(Bytes32Deque)12901_storage": { - "encoding": "inplace", - "label": "struct DoubleEndedQueue.Bytes32Deque", - "members": [ - { - "astId": 12894, - "contract": "contracts/variants/crosschain/Gov.sol:Gov", - "label": "_begin", - "offset": 0, - "slot": "0", - "type": "t_uint128" - }, - { - "astId": 12896, - "contract": "contracts/variants/crosschain/Gov.sol:Gov", - "label": "_end", - "offset": 16, - "slot": "0", - "type": "t_uint128" - }, - { - "astId": 12900, - "contract": "contracts/variants/crosschain/Gov.sol:Gov", - "label": "_data", - "offset": 0, - "slot": "1", - "type": "t_mapping(t_uint128,t_bytes32)" - } - ], - "numberOfBytes": "64" - }, - "t_struct(Checkpoint208)11847_storage": { - "encoding": "inplace", - "label": "struct Checkpoints.Checkpoint208", - "members": [ - { - "astId": 11844, - "contract": "contracts/variants/crosschain/Gov.sol:Gov", - "label": "_key", - "offset": 0, - "slot": "0", - "type": "t_uint48" - }, - { - "astId": 11846, - "contract": "contracts/variants/crosschain/Gov.sol:Gov", - "label": "_value", - "offset": 6, - "slot": "0", - "type": "t_uint208" - } - ], - "numberOfBytes": "32" - }, - "t_struct(ProofStorage)14687_storage": { - "encoding": "inplace", - "label": "struct ProofHandler.ProofStorage", - "members": [ - { - "astId": 14682, - "contract": "contracts/variants/crosschain/Gov.sol:Gov", - "label": "updateAppliedOnChain", - "offset": 0, - "slot": "0", - "type": "t_mapping(t_bytes32,t_bool)" - }, - { - "astId": 14686, - "contract": "contracts/variants/crosschain/Gov.sol:Gov", - "label": "currentNonce", - "offset": 0, - "slot": "1", - "type": "t_mapping(t_uint8,t_uint256)" - } - ], - "numberOfBytes": "64" - }, - "t_struct(ProposalCore)215_storage": { - "encoding": "inplace", - "label": "struct Governor.ProposalCore", - "members": [ - { - "astId": 204, - "contract": "contracts/variants/crosschain/Gov.sol:Gov", - "label": "proposer", - "offset": 0, - "slot": "0", - "type": "t_address" - }, - { - "astId": 206, - "contract": "contracts/variants/crosschain/Gov.sol:Gov", - "label": "voteStart", - "offset": 20, - "slot": "0", - "type": "t_uint48" - }, - { - "astId": 208, - "contract": "contracts/variants/crosschain/Gov.sol:Gov", - "label": "voteDuration", - "offset": 26, - "slot": "0", - "type": "t_uint32" - }, - { - "astId": 210, - "contract": "contracts/variants/crosschain/Gov.sol:Gov", - "label": "executed", - "offset": 30, - "slot": "0", - "type": "t_bool" - }, - { - "astId": 212, - "contract": "contracts/variants/crosschain/Gov.sol:Gov", - "label": "canceled", - "offset": 31, - "slot": "0", - "type": "t_bool" - }, - { - "astId": 214, - "contract": "contracts/variants/crosschain/Gov.sol:Gov", - "label": "etaSeconds", - "offset": 0, - "slot": "1", - "type": "t_uint48" - } - ], - "numberOfBytes": "64" - }, - "t_struct(ProposalVote)2445_storage": { - "encoding": "inplace", - "label": "struct GovernorCountingSimple.ProposalVote", - "members": [ - { - "astId": 2436, - "contract": "contracts/variants/crosschain/Gov.sol:Gov", - "label": "againstVotes", - "offset": 0, - "slot": "0", - "type": "t_uint256" - }, - { - "astId": 2438, - "contract": "contracts/variants/crosschain/Gov.sol:Gov", - "label": "forVotes", - "offset": 0, - "slot": "1", - "type": "t_uint256" - }, - { - "astId": 2440, - "contract": "contracts/variants/crosschain/Gov.sol:Gov", - "label": "abstainVotes", - "offset": 0, - "slot": "2", - "type": "t_uint256" - }, - { - "astId": 2444, - "contract": "contracts/variants/crosschain/Gov.sol:Gov", - "label": "hasVoted", - "offset": 0, - "slot": "3", - "type": "t_mapping(t_address,t_bool)" - } - ], - "numberOfBytes": "128" - }, - "t_struct(Trace208)11842_storage": { - "encoding": "inplace", - "label": "struct Checkpoints.Trace208", - "members": [ - { - "astId": 11841, - "contract": "contracts/variants/crosschain/Gov.sol:Gov", - "label": "_checkpoints", - "offset": 0, - "slot": "0", - "type": "t_array(t_struct(Checkpoint208)11847_storage)dyn_storage" - } - ], - "numberOfBytes": "32" - }, - "t_uint128": { - "encoding": "inplace", - "label": "uint128", - "numberOfBytes": "16" - }, - "t_uint208": { - "encoding": "inplace", - "label": "uint208", - "numberOfBytes": "26" - }, - "t_uint256": { - "encoding": "inplace", - "label": "uint256", - "numberOfBytes": "32" - }, - "t_uint32": { - "encoding": "inplace", - "label": "uint32", - "numberOfBytes": "4" - }, - "t_uint48": { - "encoding": "inplace", - "label": "uint48", - "numberOfBytes": "6" - }, - "t_uint8": { - "encoding": "inplace", - "label": "uint8", - "numberOfBytes": "1" - } - } - } -} \ No newline at end of file diff --git a/deployments/op-sepolia/CrosschainNFT.json b/deployments/op-sepolia/CrosschainNFT.json deleted file mode 100644 index 48c1453..0000000 --- a/deployments/op-sepolia/CrosschainNFT.json +++ /dev/null @@ -1,2050 +0,0 @@ -{ - "address": "0xe74bC6A3Ee4ED824708DD88465BD2CdD6b869620", - "abi": [ - { - "inputs": [ - { - "internalType": "uint256", - "name": "_home", - "type": "uint256" - }, - { - "internalType": "address", - "name": "initialOwner", - "type": "address" - }, - { - "internalType": "address[]", - "name": "_firstMembers", - "type": "address[]" - }, - { - "internalType": "string", - "name": "_uri", - "type": "string" - }, - { - "internalType": "string", - "name": "_name", - "type": "string" - }, - { - "internalType": "string", - "name": "_symbol", - "type": "string" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "inputs": [], - "name": "CheckpointUnorderedInsertion", - "type": "error" - }, - { - "inputs": [], - "name": "ECDSAInvalidSignature", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "length", - "type": "uint256" - } - ], - "name": "ECDSAInvalidSignatureLength", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "s", - "type": "bytes32" - } - ], - "name": "ECDSAInvalidSignatureS", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "timepoint", - "type": "uint256" - }, - { - "internalType": "uint48", - "name": "clock", - "type": "uint48" - } - ], - "name": "ERC5805FutureLookup", - "type": "error" - }, - { - "inputs": [], - "name": "ERC6372InconsistentClock", - "type": "error" - }, - { - "inputs": [], - "name": "ERC721EnumerableForbiddenBatchMint", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "sender", - "type": "address" - }, - { - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - } - ], - "name": "ERC721IncorrectOwner", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "operator", - "type": "address" - }, - { - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - } - ], - "name": "ERC721InsufficientApproval", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "approver", - "type": "address" - } - ], - "name": "ERC721InvalidApprover", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "operator", - "type": "address" - } - ], - "name": "ERC721InvalidOperator", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "owner", - "type": "address" - } - ], - "name": "ERC721InvalidOwner", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "receiver", - "type": "address" - } - ], - "name": "ERC721InvalidReceiver", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "ERC721InvalidSender", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - } - ], - "name": "ERC721NonexistentToken", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "uint256", - "name": "index", - "type": "uint256" - } - ], - "name": "ERC721OutOfBoundsIndex", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "internalType": "uint256", - "name": "currentNonce", - "type": "uint256" - } - ], - "name": "InvalidAccountNonce", - "type": "error" - }, - { - "inputs": [], - "name": "InvalidShortString", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "owner", - "type": "address" - } - ], - "name": "OwnableInvalidOwner", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "OwnableUnauthorizedAccount", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint8", - "name": "bits", - "type": "uint8" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - } - ], - "name": "SafeCastOverflowedUintDowncast", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "str", - "type": "string" - } - ], - "name": "StringTooLong", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "expiry", - "type": "uint256" - } - ], - "name": "VotesExpiredSignature", - "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": [ - { - "indexed": false, - "internalType": "uint256", - "name": "_fromTokenId", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "_toTokenId", - "type": "uint256" - } - ], - "name": "BatchMetadataUpdate", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "delegator", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "fromDelegate", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "toDelegate", - "type": "address" - } - ], - "name": "DelegateChanged", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "delegate", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "previousVotes", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "newVotes", - "type": "uint256" - } - ], - "name": "DelegateVotesChanged", - "type": "event" - }, - { - "anonymous": false, - "inputs": [], - "name": "EIP712DomainChanged", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - }, - { - "indexed": true, - "internalType": "address", - "name": "member", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "nonce", - "type": "uint256" - } - ], - "name": "MembershipClaimed", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - }, - { - "indexed": true, - "internalType": "address", - "name": "member", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "nonce", - "type": "uint256" - } - ], - "name": "MembershipRevoked", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "_tokenId", - "type": "uint256" - } - ], - "name": "MetadataUpdate", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "string", - "name": "newUri", - "type": "string" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "nonce", - "type": "uint256" - } - ], - "name": "MetadataUpdated", - "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": 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": "CLOCK_MODE", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "pure", - "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": [ - { - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - } - ], - "name": "burn", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes", - "name": "proof", - "type": "bytes" - } - ], - "name": "claimOperation", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "clock", - "outputs": [ - { - "internalType": "uint48", - "name": "", - "type": "uint48" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "delegatee", - "type": "address" - } - ], - "name": "delegate", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "delegatee", - "type": "address" - }, - { - "internalType": "uint256", - "name": "nonce", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "expiry", - "type": "uint256" - }, - { - "internalType": "uint8", - "name": "v", - "type": "uint8" - }, - { - "internalType": "bytes32", - "name": "r", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "s", - "type": "bytes32" - } - ], - "name": "delegateBySig", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "delegates", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "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": [ - { - "internalType": "uint8", - "name": "operationType", - "type": "uint8" - }, - { - "internalType": "bytes", - "name": "params", - "type": "bytes" - } - ], - "name": "generateOperationProof", - "outputs": [ - { - "internalType": "bytes", - "name": "", - "type": "bytes" - } - ], - "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": "uint256", - "name": "timepoint", - "type": "uint256" - } - ], - "name": "getPastTotalSupply", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "internalType": "uint256", - "name": "timepoint", - "type": "uint256" - } - ], - "name": "getPastVotes", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "getVotes", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - } - ], - "name": "govBurn", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "home", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "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": [], - "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": [], - "name": "owner", - "outputs": [ - { - "internalType": "address", - "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": [], - "name": "renounceOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "string", - "name": "uri", - "type": "string" - } - ], - "name": "safeMint", - "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": [ - { - "internalType": "address", - "name": "operator", - "type": "address" - }, - { - "internalType": "bool", - "name": "approved", - "type": "bool" - } - ], - "name": "setApprovalForAll", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - }, - { - "internalType": "string", - "name": "uri", - "type": "string" - } - ], - "name": "setMetadata", - "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": "index", - "type": "uint256" - } - ], - "name": "tokenByIndex", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "uint256", - "name": "index", - "type": "uint256" - } - ], - "name": "tokenOfOwnerByIndex", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "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" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "transferOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - } - ], - "transactionHash": "0xa38f95cbfed5aca4e692ec7030d396aac15922e3ba86d6a7b593e7752c9f5de0", - "receipt": { - "to": "0x4e59b44847b379578588920cA78FbF26c0B4956C", - "from": "0x27292E1a901E3E0bE7d144aDba4CAD07da2d8a42", - "contractAddress": null, - "transactionIndex": 3, - "gasUsed": "3590483", - "logsBloom": "0x00000000008000000000000000000000000000000001000000800000000000000000400000000000000004000000000000000000000000000000000000040000000000000008000000000008000000000101000000040000800000000000000000000000020000000000000000000800000000000000000040000010000000400000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000002000000000000000000000000000008002000002000000000000000000000000000000000000000000000000000060000000000000000000200000002000000000000000000000000000000000004000", - "blockHash": "0x3839198393e3f9125e1c58437a4030dd5e83d356086c4be99d5b7a16ca7c74f4", - "transactionHash": "0xa38f95cbfed5aca4e692ec7030d396aac15922e3ba86d6a7b593e7752c9f5de0", - "logs": [ - { - "transactionIndex": 3, - "blockNumber": 20641666, - "transactionHash": "0xa38f95cbfed5aca4e692ec7030d396aac15922e3ba86d6a7b593e7752c9f5de0", - "address": "0xe74bC6A3Ee4ED824708DD88465BD2CdD6b869620", - "topics": [ - "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x00000000000000000000000027292e1a901e3e0be7d144adba4cad07da2d8a42" - ], - "data": "0x", - "logIndex": 6, - "blockHash": "0x3839198393e3f9125e1c58437a4030dd5e83d356086c4be99d5b7a16ca7c74f4" - }, - { - "transactionIndex": 3, - "blockNumber": 20641666, - "transactionHash": "0xa38f95cbfed5aca4e692ec7030d396aac15922e3ba86d6a7b593e7752c9f5de0", - "address": "0xe74bC6A3Ee4ED824708DD88465BD2CdD6b869620", - "topics": [ - "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x000000000000000000000000d8a394e7d7894bdf2c57139ff17e5cbaa29dd977", - "0x0000000000000000000000000000000000000000000000000000000000000000" - ], - "data": "0x", - "logIndex": 7, - "blockHash": "0x3839198393e3f9125e1c58437a4030dd5e83d356086c4be99d5b7a16ca7c74f4" - }, - { - "transactionIndex": 3, - "blockNumber": 20641666, - "transactionHash": "0xa38f95cbfed5aca4e692ec7030d396aac15922e3ba86d6a7b593e7752c9f5de0", - "address": "0xe74bC6A3Ee4ED824708DD88465BD2CdD6b869620", - "topics": [ - "0xf8e1a15aba9398e019f0b49df1a4fde98ee17ae345cb5f6b5e2c27f5033e8ce7" - ], - "data": "0x0000000000000000000000000000000000000000000000000000000000000000", - "logIndex": 8, - "blockHash": "0x3839198393e3f9125e1c58437a4030dd5e83d356086c4be99d5b7a16ca7c74f4" - }, - { - "transactionIndex": 3, - "blockNumber": 20641666, - "transactionHash": "0xa38f95cbfed5aca4e692ec7030d396aac15922e3ba86d6a7b593e7752c9f5de0", - "address": "0xe74bC6A3Ee4ED824708DD88465BD2CdD6b869620", - "topics": [ - "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x000000000000000000000000e61a1a5278290b6520f0cef3f2c71ba70cf5cf4c", - "0x0000000000000000000000000000000000000000000000000000000000000001" - ], - "data": "0x", - "logIndex": 9, - "blockHash": "0x3839198393e3f9125e1c58437a4030dd5e83d356086c4be99d5b7a16ca7c74f4" - }, - { - "transactionIndex": 3, - "blockNumber": 20641666, - "transactionHash": "0xa38f95cbfed5aca4e692ec7030d396aac15922e3ba86d6a7b593e7752c9f5de0", - "address": "0xe74bC6A3Ee4ED824708DD88465BD2CdD6b869620", - "topics": [ - "0xf8e1a15aba9398e019f0b49df1a4fde98ee17ae345cb5f6b5e2c27f5033e8ce7" - ], - "data": "0x0000000000000000000000000000000000000000000000000000000000000001", - "logIndex": 10, - "blockHash": "0x3839198393e3f9125e1c58437a4030dd5e83d356086c4be99d5b7a16ca7c74f4" - } - ], - "blockNumber": 20641666, - "cumulativeGasUsed": "3783419", - "status": 1, - "byzantium": true - }, - "args": [ - 11155111, - "0x27292E1a901E3E0bE7d144aDba4CAD07da2d8a42", - [ - "0xD8a394e7d7894bDF2C57139fF17e5CBAa29Dd977", - "0xe61A1a5278290B6520f0CEf3F2c71Ba70CF5cf4C" - ], - "https://bafkreicj62l5xu6pk2xx7x7n6b7rpunxb4ehlh7fevyjapid3556smuz4y.ipfs.w3s.link/", - "Membership NFT", - "MEMBER" - ], - "numDeployments": 1, - "solcInputHash": "96a9008abeaccbd30a9b75989ce7f0fd", - "metadata": "{\"compiler\":{\"version\":\"0.8.20+commit.a1b79de6\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_home\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"initialOwner\",\"type\":\"address\"},{\"internalType\":\"address[]\",\"name\":\"_firstMembers\",\"type\":\"address[]\"},{\"internalType\":\"string\",\"name\":\"_uri\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"_name\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"_symbol\",\"type\":\"string\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"CheckpointUnorderedInsertion\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ECDSAInvalidSignature\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"length\",\"type\":\"uint256\"}],\"name\":\"ECDSAInvalidSignatureLength\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"name\":\"ECDSAInvalidSignatureS\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"timepoint\",\"type\":\"uint256\"},{\"internalType\":\"uint48\",\"name\":\"clock\",\"type\":\"uint48\"}],\"name\":\"ERC5805FutureLookup\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ERC6372InconsistentClock\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ERC721EnumerableForbiddenBatchMint\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"ERC721IncorrectOwner\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"ERC721InsufficientApproval\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"approver\",\"type\":\"address\"}],\"name\":\"ERC721InvalidApprover\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"}],\"name\":\"ERC721InvalidOperator\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"ERC721InvalidOwner\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"}],\"name\":\"ERC721InvalidReceiver\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"ERC721InvalidSender\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"ERC721NonexistentToken\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"index\",\"type\":\"uint256\"}],\"name\":\"ERC721OutOfBoundsIndex\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"currentNonce\",\"type\":\"uint256\"}],\"name\":\"InvalidAccountNonce\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidShortString\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"OwnableInvalidOwner\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"OwnableUnauthorizedAccount\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint8\",\"name\":\"bits\",\"type\":\"uint8\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"SafeCastOverflowedUintDowncast\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"str\",\"type\":\"string\"}],\"name\":\"StringTooLong\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expiry\",\"type\":\"uint256\"}],\"name\":\"VotesExpiredSignature\",\"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\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_fromTokenId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_toTokenId\",\"type\":\"uint256\"}],\"name\":\"BatchMetadataUpdate\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"delegator\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"fromDelegate\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"toDelegate\",\"type\":\"address\"}],\"name\":\"DelegateChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"delegate\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"previousVotes\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newVotes\",\"type\":\"uint256\"}],\"name\":\"DelegateVotesChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[],\"name\":\"EIP712DomainChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"member\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"}],\"name\":\"MembershipClaimed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"member\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"}],\"name\":\"MembershipRevoked\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_tokenId\",\"type\":\"uint256\"}],\"name\":\"MetadataUpdate\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"newUri\",\"type\":\"string\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"}],\"name\":\"MetadataUpdated\",\"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\":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\":\"CLOCK_MODE\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"pure\",\"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\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"burn\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"proof\",\"type\":\"bytes\"}],\"name\":\"claimOperation\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"clock\",\"outputs\":[{\"internalType\":\"uint48\",\"name\":\"\",\"type\":\"uint48\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"delegatee\",\"type\":\"address\"}],\"name\":\"delegate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"delegatee\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expiry\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"name\":\"delegateBySig\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"delegates\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"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\":[{\"internalType\":\"uint8\",\"name\":\"operationType\",\"type\":\"uint8\"},{\"internalType\":\"bytes\",\"name\":\"params\",\"type\":\"bytes\"}],\"name\":\"generateOperationProof\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"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\":\"uint256\",\"name\":\"timepoint\",\"type\":\"uint256\"}],\"name\":\"getPastTotalSupply\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"timepoint\",\"type\":\"uint256\"}],\"name\":\"getPastVotes\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"getVotes\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"govBurn\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"home\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"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\":[],\"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\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"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\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"uri\",\"type\":\"string\"}],\"name\":\"safeMint\",\"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\":[{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"approved\",\"type\":\"bool\"}],\"name\":\"setApprovalForAll\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"string\",\"name\":\"uri\",\"type\":\"string\"}],\"name\":\"setMetadata\",\"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\":\"index\",\"type\":\"uint256\"}],\"name\":\"tokenByIndex\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"index\",\"type\":\"uint256\"}],\"name\":\"tokenOfOwnerByIndex\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"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\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"author\":\"Web3 Hackers Collective\",\"custom:security-contact\":\"julien@strat.cc\",\"details\":\"Uses ProofHandler library for cross-chain proof management\",\"errors\":{\"CheckpointUnorderedInsertion()\":[{\"details\":\"A value was attempted to be inserted on a past checkpoint.\"}],\"ECDSAInvalidSignature()\":[{\"details\":\"The signature derives the `address(0)`.\"}],\"ECDSAInvalidSignatureLength(uint256)\":[{\"details\":\"The signature has an invalid length.\"}],\"ECDSAInvalidSignatureS(bytes32)\":[{\"details\":\"The signature has an S value that is in the upper half order.\"}],\"ERC5805FutureLookup(uint256,uint48)\":[{\"details\":\"Lookup to future votes is not available.\"}],\"ERC6372InconsistentClock()\":[{\"details\":\"The clock was incorrectly modified.\"}],\"ERC721EnumerableForbiddenBatchMint()\":[{\"details\":\"Batch mint is not allowed.\"}],\"ERC721IncorrectOwner(address,uint256,address)\":[{\"details\":\"Indicates an error related to the ownership over a particular token. Used in transfers.\",\"params\":{\"owner\":\"Address of the current owner of a token.\",\"sender\":\"Address whose tokens are being transferred.\",\"tokenId\":\"Identifier number of a token.\"}}],\"ERC721InsufficientApproval(address,uint256)\":[{\"details\":\"Indicates a failure with the `operator`\\u2019s approval. Used in transfers.\",\"params\":{\"operator\":\"Address that may be allowed to operate on tokens without being their owner.\",\"tokenId\":\"Identifier number of a token.\"}}],\"ERC721InvalidApprover(address)\":[{\"details\":\"Indicates a failure with the `approver` of a token to be approved. Used in approvals.\",\"params\":{\"approver\":\"Address initiating an approval operation.\"}}],\"ERC721InvalidOperator(address)\":[{\"details\":\"Indicates a failure with the `operator` to be approved. Used in approvals.\",\"params\":{\"operator\":\"Address that may be allowed to operate on tokens without being their owner.\"}}],\"ERC721InvalidOwner(address)\":[{\"details\":\"Indicates that an address can't be an owner. For example, `address(0)` is a forbidden owner in ERC-20. Used in balance queries.\",\"params\":{\"owner\":\"Address of the current owner of a token.\"}}],\"ERC721InvalidReceiver(address)\":[{\"details\":\"Indicates a failure with the token `receiver`. Used in transfers.\",\"params\":{\"receiver\":\"Address to which tokens are being transferred.\"}}],\"ERC721InvalidSender(address)\":[{\"details\":\"Indicates a failure with the token `sender`. Used in transfers.\",\"params\":{\"sender\":\"Address whose tokens are being transferred.\"}}],\"ERC721NonexistentToken(uint256)\":[{\"details\":\"Indicates a `tokenId` whose `owner` is the zero address.\",\"params\":{\"tokenId\":\"Identifier number of a token.\"}}],\"ERC721OutOfBoundsIndex(address,uint256)\":[{\"details\":\"An `owner`'s token query was out of bounds for `index`. NOTE: The owner being `address(0)` indicates a global out of bounds index.\"}],\"InvalidAccountNonce(address,uint256)\":[{\"details\":\"The nonce used for an `account` is not the expected current nonce.\"}],\"OwnableInvalidOwner(address)\":[{\"details\":\"The owner is not a valid owner account. (eg. `address(0)`)\"}],\"OwnableUnauthorizedAccount(address)\":[{\"details\":\"The caller account is not authorized to perform an operation.\"}],\"SafeCastOverflowedUintDowncast(uint8,uint256)\":[{\"details\":\"Value doesn't fit in an uint of `bits` size.\"}],\"VotesExpiredSignature(uint256)\":[{\"details\":\"The signature used has expired.\"}]},\"events\":{\"Approval(address,address,uint256)\":{\"details\":\"Emitted when `owner` enables `approved` to manage the `tokenId` token.\"},\"ApprovalForAll(address,address,bool)\":{\"details\":\"Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.\"},\"BatchMetadataUpdate(uint256,uint256)\":{\"details\":\"This event emits when the metadata of a range of tokens is changed. So that the third-party platforms such as NFT market could timely update the images and related attributes of the NFTs.\"},\"DelegateChanged(address,address,address)\":{\"details\":\"Emitted when an account changes their delegate.\"},\"DelegateVotesChanged(address,uint256,uint256)\":{\"details\":\"Emitted when a token transfer or delegate change results in changes to a delegate's number of voting units.\"},\"EIP712DomainChanged()\":{\"details\":\"MAY be emitted to signal that the domain could have changed.\"},\"MembershipClaimed(uint256,address,uint256)\":{\"params\":{\"member\":\"The address receiving the membership\",\"nonce\":\"Operation sequence number\",\"tokenId\":\"The ID of the claimed token\"}},\"MembershipRevoked(uint256,address,uint256)\":{\"params\":{\"member\":\"The address losing membership\",\"nonce\":\"Operation sequence number\",\"tokenId\":\"The ID of the revoked token\"}},\"MetadataUpdate(uint256)\":{\"details\":\"This event emits when the metadata of a token is changed. So that the third-party platforms such as NFT market could timely update the images and related attributes of the NFT.\"},\"MetadataUpdated(uint256,string,uint256)\":{\"params\":{\"newUri\":\"The new metadata URI\",\"nonce\":\"Operation sequence number\",\"tokenId\":\"The ID of the updated token\"}},\"Transfer(address,address,uint256)\":{\"details\":\"Emitted when `tokenId` token is transferred from `from` to `to`.\"}},\"kind\":\"dev\",\"methods\":{\"CLOCK_MODE()\":{\"details\":\"Machine-readable description of the clock as specified in ERC-6372.\"},\"approve(address,uint256)\":{\"details\":\"See {IERC721-approve}.\"},\"balanceOf(address)\":{\"details\":\"See {IERC721-balanceOf}.\"},\"burn(uint256)\":{\"details\":\"Burns `tokenId`. See {ERC721-_burn}. Requirements: - The caller must own `tokenId` or be an approved operator.\"},\"claimOperation(bytes)\":{\"params\":{\"proof\":\"Proof generated by home chain\"}},\"clock()\":{\"details\":\"Clock used for flagging checkpoints. Can be overridden to implement timestamp based checkpoints (and voting), in which case {CLOCK_MODE} should be overridden as well to match.\"},\"constructor\":{\"params\":{\"_firstMembers\":\"Array of initial member addresses\",\"_home\":\"Chain ID where contract is considered home\",\"_name\":\"Token collection name\",\"_symbol\":\"Token collection symbol\",\"_uri\":\"Initial token URI\",\"initialOwner\":\"Initial contract owner\"}},\"delegate(address)\":{\"details\":\"Delegates votes from the sender to `delegatee`.\"},\"delegateBySig(address,uint256,uint256,uint8,bytes32,bytes32)\":{\"details\":\"Delegates votes from signer to `delegatee`.\"},\"delegates(address)\":{\"details\":\"Returns the delegate that `account` has chosen.\"},\"eip712Domain()\":{\"details\":\"See {IERC-5267}.\"},\"generateOperationProof(uint8,bytes)\":{\"params\":{\"operationType\":\"Type of operation\",\"params\":\"Operation parameters\"},\"returns\":{\"_0\":\"Encoded proof data\"}},\"getApproved(uint256)\":{\"details\":\"See {IERC721-getApproved}.\"},\"getPastTotalSupply(uint256)\":{\"details\":\"Returns the total supply of votes available at a specific moment in the past. If the `clock()` is configured to use block numbers, this will return the value at the end of the corresponding block. NOTE: This value is the sum of all available votes, which is not necessarily the sum of all delegated votes. Votes that have not been delegated are still part of total supply, even though they would not participate in a vote. Requirements: - `timepoint` must be in the past. If operating using block numbers, the block must be already mined.\"},\"getPastVotes(address,uint256)\":{\"details\":\"Returns the amount of votes that `account` had at a specific moment in the past. If the `clock()` is configured to use block numbers, this will return the value at the end of the corresponding block. Requirements: - `timepoint` must be in the past. If operating using block numbers, the block must be already mined.\"},\"getVotes(address)\":{\"details\":\"Returns the current amount of votes that `account` has.\"},\"govBurn(uint256)\":{\"details\":\"Only callable by owner (governance) on home chain\",\"params\":{\"tokenId\":\"ID of token to burn\"}},\"isApprovedForAll(address,address)\":{\"details\":\"See {IERC721-isApprovedForAll}.\"},\"name()\":{\"details\":\"See {IERC721Metadata-name}.\"},\"nonces(address)\":{\"details\":\"Returns the next unused nonce for an address.\"},\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"ownerOf(uint256)\":{\"details\":\"See {IERC721-ownerOf}.\"},\"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.\"},\"safeMint(address,string)\":{\"details\":\"Only callable by owner (governance) on home chain\",\"params\":{\"to\":\"Address to mint token to\",\"uri\":\"Token metadata URI\"}},\"safeTransferFrom(address,address,uint256)\":{\"details\":\"See {IERC721-safeTransferFrom}.\"},\"safeTransferFrom(address,address,uint256,bytes)\":{\"details\":\"See {IERC721-safeTransferFrom}.\"},\"setApprovalForAll(address,bool)\":{\"details\":\"See {IERC721-setApprovalForAll}.\"},\"setMetadata(uint256,string)\":{\"details\":\"Only callable by owner (governance) on home chain\",\"params\":{\"tokenId\":\"ID of token to update\",\"uri\":\"New metadata URI\"}},\"symbol()\":{\"details\":\"See {IERC721Metadata-symbol}.\"},\"tokenByIndex(uint256)\":{\"details\":\"See {IERC721Enumerable-tokenByIndex}.\"},\"tokenOfOwnerByIndex(address,uint256)\":{\"details\":\"See {IERC721Enumerable-tokenOfOwnerByIndex}.\"},\"totalSupply()\":{\"details\":\"See {IERC721Enumerable-totalSupply}.\"},\"transferFrom(address,address,uint256)\":{\"details\":\"See {IERC721-transferFrom}.\"},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.\"}},\"title\":\"Cross-chain Membership NFT Contract\",\"version\":1},\"userdoc\":{\"events\":{\"MembershipClaimed(uint256,address,uint256)\":{\"notice\":\"Emitted when a membership is claimed\"},\"MembershipRevoked(uint256,address,uint256)\":{\"notice\":\"Emitted when a membership is revoked\"},\"MetadataUpdated(uint256,string,uint256)\":{\"notice\":\"Emitted when metadata is updated\"}},\"kind\":\"user\",\"methods\":{\"claimOperation(bytes)\":{\"notice\":\"Claims an NFT operation on a foreign chain\"},\"constructor\":{\"notice\":\"Initializes the NFT contract\"},\"generateOperationProof(uint8,bytes)\":{\"notice\":\"Generates proof for NFT operations\"},\"govBurn(uint256)\":{\"notice\":\"Burns token on home chain\"},\"home()\":{\"notice\":\"Chain ID where contract was originally deployed\"},\"safeMint(address,string)\":{\"notice\":\"Adds a new member on home chain\"},\"setMetadata(uint256,string)\":{\"notice\":\"Updates token metadata on home chain\"}},\"notice\":\"Non-transferable NFT implementation for DAO membership with cross-chain capabilities\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/variants/crosschain/NFT.sol\":\"NFT\"},\"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 v5.0.0) (access/Ownable.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {Context} from \\\"../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 * The initial owner is set to the address provided by the deployer. This can\\n * 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 /**\\n * @dev The caller account is not authorized to perform an operation.\\n */\\n error OwnableUnauthorizedAccount(address account);\\n\\n /**\\n * @dev The owner is not a valid owner account. (eg. `address(0)`)\\n */\\n error OwnableInvalidOwner(address owner);\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the address provided by the deployer as the initial owner.\\n */\\n constructor(address initialOwner) {\\n if (initialOwner == address(0)) {\\n revert OwnableInvalidOwner(address(0));\\n }\\n _transferOwnership(initialOwner);\\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 if (owner() != _msgSender()) {\\n revert OwnableUnauthorizedAccount(_msgSender());\\n }\\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 if (newOwner == address(0)) {\\n revert OwnableInvalidOwner(address(0));\\n }\\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\":\"0xff6d0bb2e285473e5311d9d3caacb525ae3538a80758c10649a4d61029b017bb\",\"license\":\"MIT\"},\"@openzeppelin/contracts/governance/utils/IVotes.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (governance/utils/IVotes.sol)\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Common interface for {ERC20Votes}, {ERC721Votes}, and other {Votes}-enabled contracts.\\n */\\ninterface IVotes {\\n /**\\n * @dev The signature used has expired.\\n */\\n error VotesExpiredSignature(uint256 expiry);\\n\\n /**\\n * @dev Emitted when an account changes their delegate.\\n */\\n event DelegateChanged(address indexed delegator, address indexed fromDelegate, address indexed toDelegate);\\n\\n /**\\n * @dev Emitted when a token transfer or delegate change results in changes to a delegate's number of voting units.\\n */\\n event DelegateVotesChanged(address indexed delegate, uint256 previousVotes, uint256 newVotes);\\n\\n /**\\n * @dev Returns the current amount of votes that `account` has.\\n */\\n function getVotes(address account) external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of votes that `account` had at a specific moment in the past. If the `clock()` is\\n * configured to use block numbers, this will return the value at the end of the corresponding block.\\n */\\n function getPastVotes(address account, uint256 timepoint) external view returns (uint256);\\n\\n /**\\n * @dev Returns the total supply of votes available at a specific moment in the past. If the `clock()` is\\n * configured to use block numbers, this will return the value at the end of the corresponding block.\\n *\\n * NOTE: This value is the sum of all available votes, which is not necessarily the sum of all delegated votes.\\n * Votes that have not been delegated are still part of total supply, even though they would not participate in a\\n * vote.\\n */\\n function getPastTotalSupply(uint256 timepoint) external view returns (uint256);\\n\\n /**\\n * @dev Returns the delegate that `account` has chosen.\\n */\\n function delegates(address account) external view returns (address);\\n\\n /**\\n * @dev Delegates votes from the sender to `delegatee`.\\n */\\n function delegate(address delegatee) external;\\n\\n /**\\n * @dev Delegates votes from signer to `delegatee`.\\n */\\n function delegateBySig(address delegatee, uint256 nonce, uint256 expiry, uint8 v, bytes32 r, bytes32 s) external;\\n}\\n\",\"keccak256\":\"0x5e2b397ae88fd5c68e4f6762eb9f65f65c36702eb57796495f471d024ce70947\",\"license\":\"MIT\"},\"@openzeppelin/contracts/governance/utils/Votes.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (governance/utils/Votes.sol)\\npragma solidity ^0.8.20;\\n\\nimport {IERC5805} from \\\"../../interfaces/IERC5805.sol\\\";\\nimport {Context} from \\\"../../utils/Context.sol\\\";\\nimport {Nonces} from \\\"../../utils/Nonces.sol\\\";\\nimport {EIP712} from \\\"../../utils/cryptography/EIP712.sol\\\";\\nimport {Checkpoints} from \\\"../../utils/structs/Checkpoints.sol\\\";\\nimport {SafeCast} from \\\"../../utils/math/SafeCast.sol\\\";\\nimport {ECDSA} from \\\"../../utils/cryptography/ECDSA.sol\\\";\\nimport {Time} from \\\"../../utils/types/Time.sol\\\";\\n\\n/**\\n * @dev This is a base abstract contract that tracks voting units, which are a measure of voting power that can be\\n * transferred, and provides a system of vote delegation, where an account can delegate its voting units to a sort of\\n * \\\"representative\\\" that will pool delegated voting units from different accounts and can then use it to vote in\\n * decisions. In fact, voting units _must_ be delegated in order to count as actual votes, and an account has to\\n * delegate those votes to itself if it wishes to participate in decisions and does not have a trusted representative.\\n *\\n * This contract is often combined with a token contract such that voting units correspond to token units. For an\\n * example, see {ERC721Votes}.\\n *\\n * The full history of delegate votes is tracked on-chain so that governance protocols can consider votes as distributed\\n * at a particular block number to protect against flash loans and double voting. The opt-in delegate system makes the\\n * cost of this history tracking optional.\\n *\\n * When using this module the derived contract must implement {_getVotingUnits} (for example, make it return\\n * {ERC721-balanceOf}), and can use {_transferVotingUnits} to track a change in the distribution of those units (in the\\n * previous example, it would be included in {ERC721-_update}).\\n */\\nabstract contract Votes is Context, EIP712, Nonces, IERC5805 {\\n using Checkpoints for Checkpoints.Trace208;\\n\\n bytes32 private constant DELEGATION_TYPEHASH =\\n keccak256(\\\"Delegation(address delegatee,uint256 nonce,uint256 expiry)\\\");\\n\\n mapping(address account => address) private _delegatee;\\n\\n mapping(address delegatee => Checkpoints.Trace208) private _delegateCheckpoints;\\n\\n Checkpoints.Trace208 private _totalCheckpoints;\\n\\n /**\\n * @dev The clock was incorrectly modified.\\n */\\n error ERC6372InconsistentClock();\\n\\n /**\\n * @dev Lookup to future votes is not available.\\n */\\n error ERC5805FutureLookup(uint256 timepoint, uint48 clock);\\n\\n /**\\n * @dev Clock used for flagging checkpoints. Can be overridden to implement timestamp based\\n * checkpoints (and voting), in which case {CLOCK_MODE} should be overridden as well to match.\\n */\\n function clock() public view virtual returns (uint48) {\\n return Time.blockNumber();\\n }\\n\\n /**\\n * @dev Machine-readable description of the clock as specified in ERC-6372.\\n */\\n // solhint-disable-next-line func-name-mixedcase\\n function CLOCK_MODE() public view virtual returns (string memory) {\\n // Check that the clock was not modified\\n if (clock() != Time.blockNumber()) {\\n revert ERC6372InconsistentClock();\\n }\\n return \\\"mode=blocknumber&from=default\\\";\\n }\\n\\n /**\\n * @dev Returns the current amount of votes that `account` has.\\n */\\n function getVotes(address account) public view virtual returns (uint256) {\\n return _delegateCheckpoints[account].latest();\\n }\\n\\n /**\\n * @dev Returns the amount of votes that `account` had at a specific moment in the past. If the `clock()` is\\n * configured to use block numbers, this will return the value at the end of the corresponding block.\\n *\\n * Requirements:\\n *\\n * - `timepoint` must be in the past. If operating using block numbers, the block must be already mined.\\n */\\n function getPastVotes(address account, uint256 timepoint) public view virtual returns (uint256) {\\n uint48 currentTimepoint = clock();\\n if (timepoint >= currentTimepoint) {\\n revert ERC5805FutureLookup(timepoint, currentTimepoint);\\n }\\n return _delegateCheckpoints[account].upperLookupRecent(SafeCast.toUint48(timepoint));\\n }\\n\\n /**\\n * @dev Returns the total supply of votes available at a specific moment in the past. If the `clock()` is\\n * configured to use block numbers, this will return the value at the end of the corresponding block.\\n *\\n * NOTE: This value is the sum of all available votes, which is not necessarily the sum of all delegated votes.\\n * Votes that have not been delegated are still part of total supply, even though they would not participate in a\\n * vote.\\n *\\n * Requirements:\\n *\\n * - `timepoint` must be in the past. If operating using block numbers, the block must be already mined.\\n */\\n function getPastTotalSupply(uint256 timepoint) public view virtual returns (uint256) {\\n uint48 currentTimepoint = clock();\\n if (timepoint >= currentTimepoint) {\\n revert ERC5805FutureLookup(timepoint, currentTimepoint);\\n }\\n return _totalCheckpoints.upperLookupRecent(SafeCast.toUint48(timepoint));\\n }\\n\\n /**\\n * @dev Returns the current total supply of votes.\\n */\\n function _getTotalSupply() internal view virtual returns (uint256) {\\n return _totalCheckpoints.latest();\\n }\\n\\n /**\\n * @dev Returns the delegate that `account` has chosen.\\n */\\n function delegates(address account) public view virtual returns (address) {\\n return _delegatee[account];\\n }\\n\\n /**\\n * @dev Delegates votes from the sender to `delegatee`.\\n */\\n function delegate(address delegatee) public virtual {\\n address account = _msgSender();\\n _delegate(account, delegatee);\\n }\\n\\n /**\\n * @dev Delegates votes from signer to `delegatee`.\\n */\\n function delegateBySig(\\n address delegatee,\\n uint256 nonce,\\n uint256 expiry,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) public virtual {\\n if (block.timestamp > expiry) {\\n revert VotesExpiredSignature(expiry);\\n }\\n address signer = ECDSA.recover(\\n _hashTypedDataV4(keccak256(abi.encode(DELEGATION_TYPEHASH, delegatee, nonce, expiry))),\\n v,\\n r,\\n s\\n );\\n _useCheckedNonce(signer, nonce);\\n _delegate(signer, delegatee);\\n }\\n\\n /**\\n * @dev Delegate all of `account`'s voting units to `delegatee`.\\n *\\n * Emits events {IVotes-DelegateChanged} and {IVotes-DelegateVotesChanged}.\\n */\\n function _delegate(address account, address delegatee) internal virtual {\\n address oldDelegate = delegates(account);\\n _delegatee[account] = delegatee;\\n\\n emit DelegateChanged(account, oldDelegate, delegatee);\\n _moveDelegateVotes(oldDelegate, delegatee, _getVotingUnits(account));\\n }\\n\\n /**\\n * @dev Transfers, mints, or burns voting units. To register a mint, `from` should be zero. To register a burn, `to`\\n * should be zero. Total supply of voting units will be adjusted with mints and burns.\\n */\\n function _transferVotingUnits(address from, address to, uint256 amount) internal virtual {\\n if (from == address(0)) {\\n _push(_totalCheckpoints, _add, SafeCast.toUint208(amount));\\n }\\n if (to == address(0)) {\\n _push(_totalCheckpoints, _subtract, SafeCast.toUint208(amount));\\n }\\n _moveDelegateVotes(delegates(from), delegates(to), amount);\\n }\\n\\n /**\\n * @dev Moves delegated votes from one delegate to another.\\n */\\n function _moveDelegateVotes(address from, address to, uint256 amount) internal virtual {\\n if (from != to && amount > 0) {\\n if (from != address(0)) {\\n (uint256 oldValue, uint256 newValue) = _push(\\n _delegateCheckpoints[from],\\n _subtract,\\n SafeCast.toUint208(amount)\\n );\\n emit DelegateVotesChanged(from, oldValue, newValue);\\n }\\n if (to != address(0)) {\\n (uint256 oldValue, uint256 newValue) = _push(\\n _delegateCheckpoints[to],\\n _add,\\n SafeCast.toUint208(amount)\\n );\\n emit DelegateVotesChanged(to, oldValue, newValue);\\n }\\n }\\n }\\n\\n /**\\n * @dev Get number of checkpoints for `account`.\\n */\\n function _numCheckpoints(address account) internal view virtual returns (uint32) {\\n return SafeCast.toUint32(_delegateCheckpoints[account].length());\\n }\\n\\n /**\\n * @dev Get the `pos`-th checkpoint for `account`.\\n */\\n function _checkpoints(\\n address account,\\n uint32 pos\\n ) internal view virtual returns (Checkpoints.Checkpoint208 memory) {\\n return _delegateCheckpoints[account].at(pos);\\n }\\n\\n function _push(\\n Checkpoints.Trace208 storage store,\\n function(uint208, uint208) view returns (uint208) op,\\n uint208 delta\\n ) private returns (uint208 oldValue, uint208 newValue) {\\n return store.push(clock(), op(store.latest(), delta));\\n }\\n\\n function _add(uint208 a, uint208 b) private pure returns (uint208) {\\n return a + b;\\n }\\n\\n function _subtract(uint208 a, uint208 b) private pure returns (uint208) {\\n return a - b;\\n }\\n\\n /**\\n * @dev Must return the voting units held by an account.\\n */\\n function _getVotingUnits(address) internal view virtual returns (uint256);\\n}\\n\",\"keccak256\":\"0x9128a324d265044430e5fa4a6a2853e92d6a62a2a5a69c2fc623f5b7b8cf3f34\",\"license\":\"MIT\"},\"@openzeppelin/contracts/interfaces/IERC165.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC165.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {IERC165} from \\\"../utils/introspection/IERC165.sol\\\";\\n\",\"keccak256\":\"0xde7e9fd9aee8d4f40772f96bb3b58836cbc6dfc0227014a061947f8821ea9724\",\"license\":\"MIT\"},\"@openzeppelin/contracts/interfaces/IERC4906.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (interfaces/IERC4906.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {IERC165} from \\\"./IERC165.sol\\\";\\nimport {IERC721} from \\\"./IERC721.sol\\\";\\n\\n/// @title ERC-721 Metadata Update Extension\\ninterface IERC4906 is IERC165, IERC721 {\\n /// @dev This event emits when the metadata of a token is changed.\\n /// So that the third-party platforms such as NFT market could\\n /// timely update the images and related attributes of the NFT.\\n event MetadataUpdate(uint256 _tokenId);\\n\\n /// @dev This event emits when the metadata of a range of tokens is changed.\\n /// So that the third-party platforms such as NFT market could\\n /// timely update the images and related attributes of the NFTs.\\n event BatchMetadataUpdate(uint256 _fromTokenId, uint256 _toTokenId);\\n}\\n\",\"keccak256\":\"0x1b8691e244f6e11d987459993671db0af33e6a29f7805eac6a9925cc6b601957\",\"license\":\"MIT\"},\"@openzeppelin/contracts/interfaces/IERC5267.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC5267.sol)\\n\\npragma solidity ^0.8.20;\\n\\ninterface IERC5267 {\\n /**\\n * @dev MAY be emitted to signal that the domain could have changed.\\n */\\n event EIP712DomainChanged();\\n\\n /**\\n * @dev returns the fields and values that describe the domain separator used by this contract for EIP-712\\n * signature.\\n */\\n function eip712Domain()\\n external\\n view\\n returns (\\n bytes1 fields,\\n string memory name,\\n string memory version,\\n uint256 chainId,\\n address verifyingContract,\\n bytes32 salt,\\n uint256[] memory extensions\\n );\\n}\\n\",\"keccak256\":\"0x92aa1df62dc3d33f1656d63bede0923e0df0b706ad4137c8b10b0a8fe549fd92\",\"license\":\"MIT\"},\"@openzeppelin/contracts/interfaces/IERC5805.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC5805.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {IVotes} from \\\"../governance/utils/IVotes.sol\\\";\\nimport {IERC6372} from \\\"./IERC6372.sol\\\";\\n\\ninterface IERC5805 is IERC6372, IVotes {}\\n\",\"keccak256\":\"0x4b9b89f91adbb7d3574f85394754cfb08c5b4eafca8a7061e2094a019ab8f818\",\"license\":\"MIT\"},\"@openzeppelin/contracts/interfaces/IERC6372.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC6372.sol)\\n\\npragma solidity ^0.8.20;\\n\\ninterface IERC6372 {\\n /**\\n * @dev Clock used for flagging checkpoints. Can be overridden to implement timestamp based checkpoints (and voting).\\n */\\n function clock() external view returns (uint48);\\n\\n /**\\n * @dev Description of the clock\\n */\\n // solhint-disable-next-line func-name-mixedcase\\n function CLOCK_MODE() external view returns (string memory);\\n}\\n\",\"keccak256\":\"0xeb2857b7dafb7e0d8526dbfe794e6c047df2851c9e6ee91dc4a55f3c34af5d33\",\"license\":\"MIT\"},\"@openzeppelin/contracts/interfaces/IERC721.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC721.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {IERC721} from \\\"../token/ERC721/IERC721.sol\\\";\\n\",\"keccak256\":\"0xc4d7ebf63eb2f6bf3fee1b6c0ee775efa9f31b4843a5511d07eea147e212932d\",\"license\":\"MIT\"},\"@openzeppelin/contracts/interfaces/draft-IERC6093.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (interfaces/draft-IERC6093.sol)\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Standard ERC-20 Errors\\n * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC-20 tokens.\\n */\\ninterface IERC20Errors {\\n /**\\n * @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers.\\n * @param sender Address whose tokens are being transferred.\\n * @param balance Current balance for the interacting account.\\n * @param needed Minimum amount required to perform a transfer.\\n */\\n error ERC20InsufficientBalance(address sender, uint256 balance, uint256 needed);\\n\\n /**\\n * @dev Indicates a failure with the token `sender`. Used in transfers.\\n * @param sender Address whose tokens are being transferred.\\n */\\n error ERC20InvalidSender(address sender);\\n\\n /**\\n * @dev Indicates a failure with the token `receiver`. Used in transfers.\\n * @param receiver Address to which tokens are being transferred.\\n */\\n error ERC20InvalidReceiver(address receiver);\\n\\n /**\\n * @dev Indicates a failure with the `spender`\\u2019s `allowance`. Used in transfers.\\n * @param spender Address that may be allowed to operate on tokens without being their owner.\\n * @param allowance Amount of tokens a `spender` is allowed to operate with.\\n * @param needed Minimum amount required to perform a transfer.\\n */\\n error ERC20InsufficientAllowance(address spender, uint256 allowance, uint256 needed);\\n\\n /**\\n * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.\\n * @param approver Address initiating an approval operation.\\n */\\n error ERC20InvalidApprover(address approver);\\n\\n /**\\n * @dev Indicates a failure with the `spender` to be approved. Used in approvals.\\n * @param spender Address that may be allowed to operate on tokens without being their owner.\\n */\\n error ERC20InvalidSpender(address spender);\\n}\\n\\n/**\\n * @dev Standard ERC-721 Errors\\n * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC-721 tokens.\\n */\\ninterface IERC721Errors {\\n /**\\n * @dev Indicates that an address can't be an owner. For example, `address(0)` is a forbidden owner in ERC-20.\\n * Used in balance queries.\\n * @param owner Address of the current owner of a token.\\n */\\n error ERC721InvalidOwner(address owner);\\n\\n /**\\n * @dev Indicates a `tokenId` whose `owner` is the zero address.\\n * @param tokenId Identifier number of a token.\\n */\\n error ERC721NonexistentToken(uint256 tokenId);\\n\\n /**\\n * @dev Indicates an error related to the ownership over a particular token. Used in transfers.\\n * @param sender Address whose tokens are being transferred.\\n * @param tokenId Identifier number of a token.\\n * @param owner Address of the current owner of a token.\\n */\\n error ERC721IncorrectOwner(address sender, uint256 tokenId, address owner);\\n\\n /**\\n * @dev Indicates a failure with the token `sender`. Used in transfers.\\n * @param sender Address whose tokens are being transferred.\\n */\\n error ERC721InvalidSender(address sender);\\n\\n /**\\n * @dev Indicates a failure with the token `receiver`. Used in transfers.\\n * @param receiver Address to which tokens are being transferred.\\n */\\n error ERC721InvalidReceiver(address receiver);\\n\\n /**\\n * @dev Indicates a failure with the `operator`\\u2019s approval. Used in transfers.\\n * @param operator Address that may be allowed to operate on tokens without being their owner.\\n * @param tokenId Identifier number of a token.\\n */\\n error ERC721InsufficientApproval(address operator, uint256 tokenId);\\n\\n /**\\n * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.\\n * @param approver Address initiating an approval operation.\\n */\\n error ERC721InvalidApprover(address approver);\\n\\n /**\\n * @dev Indicates a failure with the `operator` to be approved. Used in approvals.\\n * @param operator Address that may be allowed to operate on tokens without being their owner.\\n */\\n error ERC721InvalidOperator(address operator);\\n}\\n\\n/**\\n * @dev Standard ERC-1155 Errors\\n * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC-1155 tokens.\\n */\\ninterface IERC1155Errors {\\n /**\\n * @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers.\\n * @param sender Address whose tokens are being transferred.\\n * @param balance Current balance for the interacting account.\\n * @param needed Minimum amount required to perform a transfer.\\n * @param tokenId Identifier number of a token.\\n */\\n error ERC1155InsufficientBalance(address sender, uint256 balance, uint256 needed, uint256 tokenId);\\n\\n /**\\n * @dev Indicates a failure with the token `sender`. Used in transfers.\\n * @param sender Address whose tokens are being transferred.\\n */\\n error ERC1155InvalidSender(address sender);\\n\\n /**\\n * @dev Indicates a failure with the token `receiver`. Used in transfers.\\n * @param receiver Address to which tokens are being transferred.\\n */\\n error ERC1155InvalidReceiver(address receiver);\\n\\n /**\\n * @dev Indicates a failure with the `operator`\\u2019s approval. Used in transfers.\\n * @param operator Address that may be allowed to operate on tokens without being their owner.\\n * @param owner Address of the current owner of a token.\\n */\\n error ERC1155MissingApprovalForAll(address operator, address owner);\\n\\n /**\\n * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.\\n * @param approver Address initiating an approval operation.\\n */\\n error ERC1155InvalidApprover(address approver);\\n\\n /**\\n * @dev Indicates a failure with the `operator` to be approved. Used in approvals.\\n * @param operator Address that may be allowed to operate on tokens without being their owner.\\n */\\n error ERC1155InvalidOperator(address operator);\\n\\n /**\\n * @dev Indicates an array length mismatch between ids and values in a safeBatchTransferFrom operation.\\n * Used in batch transfers.\\n * @param idsLength Length of the array of token identifiers\\n * @param valuesLength Length of the array of token amounts\\n */\\n error ERC1155InvalidArrayLength(uint256 idsLength, uint256 valuesLength);\\n}\\n\",\"keccak256\":\"0x880da465c203cec76b10d72dbd87c80f387df4102274f23eea1f9c9b0918792b\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC721/ERC721.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC721/ERC721.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {IERC721} from \\\"./IERC721.sol\\\";\\nimport {IERC721Metadata} from \\\"./extensions/IERC721Metadata.sol\\\";\\nimport {ERC721Utils} from \\\"./utils/ERC721Utils.sol\\\";\\nimport {Context} from \\\"../../utils/Context.sol\\\";\\nimport {Strings} from \\\"../../utils/Strings.sol\\\";\\nimport {IERC165, ERC165} from \\\"../../utils/introspection/ERC165.sol\\\";\\nimport {IERC721Errors} from \\\"../../interfaces/draft-IERC6093.sol\\\";\\n\\n/**\\n * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC-721] Non-Fungible Token Standard, including\\n * the Metadata extension, but not including the Enumerable extension, which is available separately as\\n * {ERC721Enumerable}.\\n */\\nabstract contract ERC721 is Context, ERC165, IERC721, IERC721Metadata, IERC721Errors {\\n using Strings for uint256;\\n\\n // Token name\\n string private _name;\\n\\n // Token symbol\\n string private _symbol;\\n\\n mapping(uint256 tokenId => address) private _owners;\\n\\n mapping(address owner => uint256) private _balances;\\n\\n mapping(uint256 tokenId => address) private _tokenApprovals;\\n\\n mapping(address owner => mapping(address operator => bool)) private _operatorApprovals;\\n\\n /**\\n * @dev Initializes the contract by setting a `name` and a `symbol` to the token collection.\\n */\\n constructor(string memory name_, string memory symbol_) {\\n _name = name_;\\n _symbol = symbol_;\\n }\\n\\n /**\\n * @dev See {IERC165-supportsInterface}.\\n */\\n function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {\\n return\\n interfaceId == type(IERC721).interfaceId ||\\n interfaceId == type(IERC721Metadata).interfaceId ||\\n super.supportsInterface(interfaceId);\\n }\\n\\n /**\\n * @dev See {IERC721-balanceOf}.\\n */\\n function balanceOf(address owner) public view virtual returns (uint256) {\\n if (owner == address(0)) {\\n revert ERC721InvalidOwner(address(0));\\n }\\n return _balances[owner];\\n }\\n\\n /**\\n * @dev See {IERC721-ownerOf}.\\n */\\n function ownerOf(uint256 tokenId) public view virtual returns (address) {\\n return _requireOwned(tokenId);\\n }\\n\\n /**\\n * @dev See {IERC721Metadata-name}.\\n */\\n function name() public view virtual returns (string memory) {\\n return _name;\\n }\\n\\n /**\\n * @dev See {IERC721Metadata-symbol}.\\n */\\n function symbol() public view virtual returns (string memory) {\\n return _symbol;\\n }\\n\\n /**\\n * @dev See {IERC721Metadata-tokenURI}.\\n */\\n function tokenURI(uint256 tokenId) public view virtual returns (string memory) {\\n _requireOwned(tokenId);\\n\\n string memory baseURI = _baseURI();\\n return bytes(baseURI).length > 0 ? string.concat(baseURI, tokenId.toString()) : \\\"\\\";\\n }\\n\\n /**\\n * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each\\n * token will be the concatenation of the `baseURI` and the `tokenId`. Empty\\n * by default, can be overridden in child contracts.\\n */\\n function _baseURI() internal view virtual returns (string memory) {\\n return \\\"\\\";\\n }\\n\\n /**\\n * @dev See {IERC721-approve}.\\n */\\n function approve(address to, uint256 tokenId) public virtual {\\n _approve(to, tokenId, _msgSender());\\n }\\n\\n /**\\n * @dev See {IERC721-getApproved}.\\n */\\n function getApproved(uint256 tokenId) public view virtual returns (address) {\\n _requireOwned(tokenId);\\n\\n return _getApproved(tokenId);\\n }\\n\\n /**\\n * @dev See {IERC721-setApprovalForAll}.\\n */\\n function setApprovalForAll(address operator, bool approved) public virtual {\\n _setApprovalForAll(_msgSender(), operator, approved);\\n }\\n\\n /**\\n * @dev See {IERC721-isApprovedForAll}.\\n */\\n function isApprovedForAll(address owner, address operator) public view virtual returns (bool) {\\n return _operatorApprovals[owner][operator];\\n }\\n\\n /**\\n * @dev See {IERC721-transferFrom}.\\n */\\n function transferFrom(address from, address to, uint256 tokenId) public virtual {\\n if (to == address(0)) {\\n revert ERC721InvalidReceiver(address(0));\\n }\\n // Setting an \\\"auth\\\" arguments enables the `_isAuthorized` check which verifies that the token exists\\n // (from != 0). Therefore, it is not needed to verify that the return value is not 0 here.\\n address previousOwner = _update(to, tokenId, _msgSender());\\n if (previousOwner != from) {\\n revert ERC721IncorrectOwner(from, tokenId, previousOwner);\\n }\\n }\\n\\n /**\\n * @dev See {IERC721-safeTransferFrom}.\\n */\\n function safeTransferFrom(address from, address to, uint256 tokenId) public {\\n safeTransferFrom(from, to, tokenId, \\\"\\\");\\n }\\n\\n /**\\n * @dev See {IERC721-safeTransferFrom}.\\n */\\n function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory data) public virtual {\\n transferFrom(from, to, tokenId);\\n ERC721Utils.checkOnERC721Received(_msgSender(), from, to, tokenId, data);\\n }\\n\\n /**\\n * @dev Returns the owner of the `tokenId`. Does NOT revert if token doesn't exist\\n *\\n * IMPORTANT: Any overrides to this function that add ownership of tokens not tracked by the\\n * core ERC-721 logic MUST be matched with the use of {_increaseBalance} to keep balances\\n * consistent with ownership. The invariant to preserve is that for any address `a` the value returned by\\n * `balanceOf(a)` must be equal to the number of tokens such that `_ownerOf(tokenId)` is `a`.\\n */\\n function _ownerOf(uint256 tokenId) internal view virtual returns (address) {\\n return _owners[tokenId];\\n }\\n\\n /**\\n * @dev Returns the approved address for `tokenId`. Returns 0 if `tokenId` is not minted.\\n */\\n function _getApproved(uint256 tokenId) internal view virtual returns (address) {\\n return _tokenApprovals[tokenId];\\n }\\n\\n /**\\n * @dev Returns whether `spender` is allowed to manage `owner`'s tokens, or `tokenId` in\\n * particular (ignoring whether it is owned by `owner`).\\n *\\n * WARNING: This function assumes that `owner` is the actual owner of `tokenId` and does not verify this\\n * assumption.\\n */\\n function _isAuthorized(address owner, address spender, uint256 tokenId) internal view virtual returns (bool) {\\n return\\n spender != address(0) &&\\n (owner == spender || isApprovedForAll(owner, spender) || _getApproved(tokenId) == spender);\\n }\\n\\n /**\\n * @dev Checks if `spender` can operate on `tokenId`, assuming the provided `owner` is the actual owner.\\n * Reverts if:\\n * - `spender` does not have approval from `owner` for `tokenId`.\\n * - `spender` does not have approval to manage all of `owner`'s assets.\\n *\\n * WARNING: This function assumes that `owner` is the actual owner of `tokenId` and does not verify this\\n * assumption.\\n */\\n function _checkAuthorized(address owner, address spender, uint256 tokenId) internal view virtual {\\n if (!_isAuthorized(owner, spender, tokenId)) {\\n if (owner == address(0)) {\\n revert ERC721NonexistentToken(tokenId);\\n } else {\\n revert ERC721InsufficientApproval(spender, tokenId);\\n }\\n }\\n }\\n\\n /**\\n * @dev Unsafe write access to the balances, used by extensions that \\\"mint\\\" tokens using an {ownerOf} override.\\n *\\n * NOTE: the value is limited to type(uint128).max. This protect against _balance overflow. It is unrealistic that\\n * a uint256 would ever overflow from increments when these increments are bounded to uint128 values.\\n *\\n * WARNING: Increasing an account's balance using this function tends to be paired with an override of the\\n * {_ownerOf} function to resolve the ownership of the corresponding tokens so that balances and ownership\\n * remain consistent with one another.\\n */\\n function _increaseBalance(address account, uint128 value) internal virtual {\\n unchecked {\\n _balances[account] += value;\\n }\\n }\\n\\n /**\\n * @dev Transfers `tokenId` from its current owner to `to`, or alternatively mints (or burns) if the current owner\\n * (or `to`) is the zero address. Returns the owner of the `tokenId` before the update.\\n *\\n * The `auth` argument is optional. If the value passed is non 0, then this function will check that\\n * `auth` is either the owner of the token, or approved to operate on the token (by the owner).\\n *\\n * Emits a {Transfer} event.\\n *\\n * NOTE: If overriding this function in a way that tracks balances, see also {_increaseBalance}.\\n */\\n function _update(address to, uint256 tokenId, address auth) internal virtual returns (address) {\\n address from = _ownerOf(tokenId);\\n\\n // Perform (optional) operator check\\n if (auth != address(0)) {\\n _checkAuthorized(from, auth, tokenId);\\n }\\n\\n // Execute the update\\n if (from != address(0)) {\\n // Clear approval. No need to re-authorize or emit the Approval event\\n _approve(address(0), tokenId, address(0), false);\\n\\n unchecked {\\n _balances[from] -= 1;\\n }\\n }\\n\\n if (to != address(0)) {\\n unchecked {\\n _balances[to] += 1;\\n }\\n }\\n\\n _owners[tokenId] = to;\\n\\n emit Transfer(from, to, tokenId);\\n\\n return from;\\n }\\n\\n /**\\n * @dev Mints `tokenId` and transfers it to `to`.\\n *\\n * WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible\\n *\\n * Requirements:\\n *\\n * - `tokenId` must not exist.\\n * - `to` cannot be the zero address.\\n *\\n * Emits a {Transfer} event.\\n */\\n function _mint(address to, uint256 tokenId) internal {\\n if (to == address(0)) {\\n revert ERC721InvalidReceiver(address(0));\\n }\\n address previousOwner = _update(to, tokenId, address(0));\\n if (previousOwner != address(0)) {\\n revert ERC721InvalidSender(address(0));\\n }\\n }\\n\\n /**\\n * @dev Mints `tokenId`, transfers it to `to` and checks for `to` acceptance.\\n *\\n * Requirements:\\n *\\n * - `tokenId` must not exist.\\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\\n *\\n * Emits a {Transfer} event.\\n */\\n function _safeMint(address to, uint256 tokenId) internal {\\n _safeMint(to, tokenId, \\\"\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is\\n * forwarded in {IERC721Receiver-onERC721Received} to contract recipients.\\n */\\n function _safeMint(address to, uint256 tokenId, bytes memory data) internal virtual {\\n _mint(to, tokenId);\\n ERC721Utils.checkOnERC721Received(_msgSender(), address(0), to, tokenId, data);\\n }\\n\\n /**\\n * @dev Destroys `tokenId`.\\n * The approval is cleared when the token is burned.\\n * This is an internal function that does not check if the sender is authorized to operate on the token.\\n *\\n * Requirements:\\n *\\n * - `tokenId` must exist.\\n *\\n * Emits a {Transfer} event.\\n */\\n function _burn(uint256 tokenId) internal {\\n address previousOwner = _update(address(0), tokenId, address(0));\\n if (previousOwner == address(0)) {\\n revert ERC721NonexistentToken(tokenId);\\n }\\n }\\n\\n /**\\n * @dev Transfers `tokenId` from `from` to `to`.\\n * As opposed to {transferFrom}, this imposes no restrictions on msg.sender.\\n *\\n * Requirements:\\n *\\n * - `to` cannot be the zero address.\\n * - `tokenId` token must be owned by `from`.\\n *\\n * Emits a {Transfer} event.\\n */\\n function _transfer(address from, address to, uint256 tokenId) internal {\\n if (to == address(0)) {\\n revert ERC721InvalidReceiver(address(0));\\n }\\n address previousOwner = _update(to, tokenId, address(0));\\n if (previousOwner == address(0)) {\\n revert ERC721NonexistentToken(tokenId);\\n } else if (previousOwner != from) {\\n revert ERC721IncorrectOwner(from, tokenId, previousOwner);\\n }\\n }\\n\\n /**\\n * @dev Safely transfers `tokenId` token from `from` to `to`, checking that contract recipients\\n * are aware of the ERC-721 standard to prevent tokens from being forever locked.\\n *\\n * `data` is additional data, it has no specified format and it is sent in call to `to`.\\n *\\n * This internal function is like {safeTransferFrom} in the sense that it invokes\\n * {IERC721Receiver-onERC721Received} on the receiver, and can be used to e.g.\\n * implement alternative mechanisms to perform token transfer, such as signature-based.\\n *\\n * Requirements:\\n *\\n * - `tokenId` token must exist and be owned by `from`.\\n * - `to` cannot be the zero address.\\n * - `from` cannot be the zero address.\\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\\n *\\n * Emits a {Transfer} event.\\n */\\n function _safeTransfer(address from, address to, uint256 tokenId) internal {\\n _safeTransfer(from, to, tokenId, \\\"\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-ERC721-_safeTransfer-address-address-uint256-}[`_safeTransfer`], with an additional `data` parameter which is\\n * forwarded in {IERC721Receiver-onERC721Received} to contract recipients.\\n */\\n function _safeTransfer(address from, address to, uint256 tokenId, bytes memory data) internal virtual {\\n _transfer(from, to, tokenId);\\n ERC721Utils.checkOnERC721Received(_msgSender(), from, to, tokenId, data);\\n }\\n\\n /**\\n * @dev Approve `to` to operate on `tokenId`\\n *\\n * The `auth` argument is optional. If the value passed is non 0, then this function will check that `auth` is\\n * either the owner of the token, or approved to operate on all tokens held by this owner.\\n *\\n * Emits an {Approval} event.\\n *\\n * Overrides to this logic should be done to the variant with an additional `bool emitEvent` argument.\\n */\\n function _approve(address to, uint256 tokenId, address auth) internal {\\n _approve(to, tokenId, auth, true);\\n }\\n\\n /**\\n * @dev Variant of `_approve` with an optional flag to enable or disable the {Approval} event. The event is not\\n * emitted in the context of transfers.\\n */\\n function _approve(address to, uint256 tokenId, address auth, bool emitEvent) internal virtual {\\n // Avoid reading the owner unless necessary\\n if (emitEvent || auth != address(0)) {\\n address owner = _requireOwned(tokenId);\\n\\n // We do not use _isAuthorized because single-token approvals should not be able to call approve\\n if (auth != address(0) && owner != auth && !isApprovedForAll(owner, auth)) {\\n revert ERC721InvalidApprover(auth);\\n }\\n\\n if (emitEvent) {\\n emit Approval(owner, to, tokenId);\\n }\\n }\\n\\n _tokenApprovals[tokenId] = to;\\n }\\n\\n /**\\n * @dev Approve `operator` to operate on all of `owner` tokens\\n *\\n * Requirements:\\n * - operator can't be the address zero.\\n *\\n * Emits an {ApprovalForAll} event.\\n */\\n function _setApprovalForAll(address owner, address operator, bool approved) internal virtual {\\n if (operator == address(0)) {\\n revert ERC721InvalidOperator(operator);\\n }\\n _operatorApprovals[owner][operator] = approved;\\n emit ApprovalForAll(owner, operator, approved);\\n }\\n\\n /**\\n * @dev Reverts if the `tokenId` doesn't have a current owner (it hasn't been minted, or it has been burned).\\n * Returns the owner.\\n *\\n * Overrides to ownership logic should be done to {_ownerOf}.\\n */\\n function _requireOwned(uint256 tokenId) internal view returns (address) {\\n address owner = _ownerOf(tokenId);\\n if (owner == address(0)) {\\n revert ERC721NonexistentToken(tokenId);\\n }\\n return owner;\\n }\\n}\\n\",\"keccak256\":\"0x39ed367e54765186281efcfe83e47cf0ad62cc879f10e191360712507125f29a\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC721/IERC721.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC721/IERC721.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {IERC165} from \\\"../../utils/introspection/IERC165.sol\\\";\\n\\n/**\\n * @dev Required interface of an ERC-721 compliant contract.\\n */\\ninterface IERC721 is IERC165 {\\n /**\\n * @dev Emitted when `tokenId` token is transferred from `from` to `to`.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);\\n\\n /**\\n * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.\\n */\\n event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);\\n\\n /**\\n * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.\\n */\\n event ApprovalForAll(address indexed owner, address indexed operator, bool approved);\\n\\n /**\\n * @dev Returns the number of tokens in ``owner``'s account.\\n */\\n function balanceOf(address owner) external view returns (uint256 balance);\\n\\n /**\\n * @dev Returns the owner of the `tokenId` token.\\n *\\n * Requirements:\\n *\\n * - `tokenId` must exist.\\n */\\n function ownerOf(uint256 tokenId) external view returns (address owner);\\n\\n /**\\n * @dev Safely transfers `tokenId` token from `from` to `to`.\\n *\\n * Requirements:\\n *\\n * - `from` cannot be the zero address.\\n * - `to` cannot be the zero address.\\n * - `tokenId` token must exist and be owned by `from`.\\n * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.\\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon\\n * a safe transfer.\\n *\\n * Emits a {Transfer} event.\\n */\\n function safeTransferFrom(address from, address to, uint256 tokenId, bytes calldata data) external;\\n\\n /**\\n * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients\\n * are aware of the ERC-721 protocol to prevent tokens from being forever locked.\\n *\\n * Requirements:\\n *\\n * - `from` cannot be the zero address.\\n * - `to` cannot be the zero address.\\n * - `tokenId` token must exist and be owned by `from`.\\n * - If the caller is not `from`, it must have been allowed to move this token by either {approve} or\\n * {setApprovalForAll}.\\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon\\n * a safe transfer.\\n *\\n * Emits a {Transfer} event.\\n */\\n function safeTransferFrom(address from, address to, uint256 tokenId) external;\\n\\n /**\\n * @dev Transfers `tokenId` token from `from` to `to`.\\n *\\n * WARNING: Note that the caller is responsible to confirm that the recipient is capable of receiving ERC-721\\n * or else they may be permanently lost. Usage of {safeTransferFrom} prevents loss, though the caller must\\n * understand this adds an external call which potentially creates a reentrancy vulnerability.\\n *\\n * Requirements:\\n *\\n * - `from` cannot be the zero address.\\n * - `to` cannot be the zero address.\\n * - `tokenId` token must be owned by `from`.\\n * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(address from, address to, uint256 tokenId) external;\\n\\n /**\\n * @dev Gives permission to `to` to transfer `tokenId` token to another account.\\n * The approval is cleared when the token is transferred.\\n *\\n * Only a single account can be approved at a time, so approving the zero address clears previous approvals.\\n *\\n * Requirements:\\n *\\n * - The caller must own the token or be an approved operator.\\n * - `tokenId` must exist.\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address to, uint256 tokenId) external;\\n\\n /**\\n * @dev Approve or remove `operator` as an operator for the caller.\\n * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.\\n *\\n * Requirements:\\n *\\n * - The `operator` cannot be the address zero.\\n *\\n * Emits an {ApprovalForAll} event.\\n */\\n function setApprovalForAll(address operator, bool approved) external;\\n\\n /**\\n * @dev Returns the account approved for `tokenId` token.\\n *\\n * Requirements:\\n *\\n * - `tokenId` must exist.\\n */\\n function getApproved(uint256 tokenId) external view returns (address operator);\\n\\n /**\\n * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.\\n *\\n * See {setApprovalForAll}\\n */\\n function isApprovedForAll(address owner, address operator) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x5dc63d1c6a12fe1b17793e1745877b2fcbe1964c3edfd0a482fac21ca8f18261\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC721/IERC721Receiver.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @title ERC-721 token receiver interface\\n * @dev Interface for any contract that wants to support safeTransfers\\n * from ERC-721 asset contracts.\\n */\\ninterface IERC721Receiver {\\n /**\\n * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom}\\n * by `operator` from `from`, this function is called.\\n *\\n * It must return its Solidity selector to confirm the token transfer.\\n * If any other value is returned or the interface is not implemented by the recipient, the transfer will be\\n * reverted.\\n *\\n * The selector can be obtained in Solidity with `IERC721Receiver.onERC721Received.selector`.\\n */\\n function onERC721Received(\\n address operator,\\n address from,\\n uint256 tokenId,\\n bytes calldata data\\n ) external returns (bytes4);\\n}\\n\",\"keccak256\":\"0xb5afb8e8eebc4d1c6404df2f5e1e6d2c3d24fd01e5dfc855314951ecfaae462d\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC721/extensions/ERC721Burnable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC721/extensions/ERC721Burnable.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {ERC721} from \\\"../ERC721.sol\\\";\\nimport {Context} from \\\"../../../utils/Context.sol\\\";\\n\\n/**\\n * @title ERC-721 Burnable Token\\n * @dev ERC-721 Token that can be burned (destroyed).\\n */\\nabstract contract ERC721Burnable is Context, ERC721 {\\n /**\\n * @dev Burns `tokenId`. See {ERC721-_burn}.\\n *\\n * Requirements:\\n *\\n * - The caller must own `tokenId` or be an approved operator.\\n */\\n function burn(uint256 tokenId) public virtual {\\n // Setting an \\\"auth\\\" arguments enables the `_isAuthorized` check which verifies that the token exists\\n // (from != 0). Therefore, it is not needed to verify that the return value is not 0 here.\\n _update(address(0), tokenId, _msgSender());\\n }\\n}\\n\",\"keccak256\":\"0xdee1ff07172e443c6600581fc4f11e7830a6d33e4e551752935b835d52a09404\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC721/extensions/ERC721Enumerable.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {ERC721} from \\\"../ERC721.sol\\\";\\nimport {IERC721Enumerable} from \\\"./IERC721Enumerable.sol\\\";\\nimport {IERC165} from \\\"../../../utils/introspection/ERC165.sol\\\";\\n\\n/**\\n * @dev This implements an optional extension of {ERC721} defined in the ERC that adds enumerability\\n * of all the token ids in the contract as well as all token ids owned by each account.\\n *\\n * CAUTION: {ERC721} extensions that implement custom `balanceOf` logic, such as {ERC721Consecutive},\\n * interfere with enumerability and should not be used together with {ERC721Enumerable}.\\n */\\nabstract contract ERC721Enumerable is ERC721, IERC721Enumerable {\\n mapping(address owner => mapping(uint256 index => uint256)) private _ownedTokens;\\n mapping(uint256 tokenId => uint256) private _ownedTokensIndex;\\n\\n uint256[] private _allTokens;\\n mapping(uint256 tokenId => uint256) private _allTokensIndex;\\n\\n /**\\n * @dev An `owner`'s token query was out of bounds for `index`.\\n *\\n * NOTE: The owner being `address(0)` indicates a global out of bounds index.\\n */\\n error ERC721OutOfBoundsIndex(address owner, uint256 index);\\n\\n /**\\n * @dev Batch mint is not allowed.\\n */\\n error ERC721EnumerableForbiddenBatchMint();\\n\\n /**\\n * @dev See {IERC165-supportsInterface}.\\n */\\n function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165, ERC721) returns (bool) {\\n return interfaceId == type(IERC721Enumerable).interfaceId || super.supportsInterface(interfaceId);\\n }\\n\\n /**\\n * @dev See {IERC721Enumerable-tokenOfOwnerByIndex}.\\n */\\n function tokenOfOwnerByIndex(address owner, uint256 index) public view virtual returns (uint256) {\\n if (index >= balanceOf(owner)) {\\n revert ERC721OutOfBoundsIndex(owner, index);\\n }\\n return _ownedTokens[owner][index];\\n }\\n\\n /**\\n * @dev See {IERC721Enumerable-totalSupply}.\\n */\\n function totalSupply() public view virtual returns (uint256) {\\n return _allTokens.length;\\n }\\n\\n /**\\n * @dev See {IERC721Enumerable-tokenByIndex}.\\n */\\n function tokenByIndex(uint256 index) public view virtual returns (uint256) {\\n if (index >= totalSupply()) {\\n revert ERC721OutOfBoundsIndex(address(0), index);\\n }\\n return _allTokens[index];\\n }\\n\\n /**\\n * @dev See {ERC721-_update}.\\n */\\n function _update(address to, uint256 tokenId, address auth) internal virtual override returns (address) {\\n address previousOwner = super._update(to, tokenId, auth);\\n\\n if (previousOwner == address(0)) {\\n _addTokenToAllTokensEnumeration(tokenId);\\n } else if (previousOwner != to) {\\n _removeTokenFromOwnerEnumeration(previousOwner, tokenId);\\n }\\n if (to == address(0)) {\\n _removeTokenFromAllTokensEnumeration(tokenId);\\n } else if (previousOwner != to) {\\n _addTokenToOwnerEnumeration(to, tokenId);\\n }\\n\\n return previousOwner;\\n }\\n\\n /**\\n * @dev Private function to add a token to this extension's ownership-tracking data structures.\\n * @param to address representing the new owner of the given token ID\\n * @param tokenId uint256 ID of the token to be added to the tokens list of the given address\\n */\\n function _addTokenToOwnerEnumeration(address to, uint256 tokenId) private {\\n uint256 length = balanceOf(to) - 1;\\n _ownedTokens[to][length] = tokenId;\\n _ownedTokensIndex[tokenId] = length;\\n }\\n\\n /**\\n * @dev Private function to add a token to this extension's token tracking data structures.\\n * @param tokenId uint256 ID of the token to be added to the tokens list\\n */\\n function _addTokenToAllTokensEnumeration(uint256 tokenId) private {\\n _allTokensIndex[tokenId] = _allTokens.length;\\n _allTokens.push(tokenId);\\n }\\n\\n /**\\n * @dev Private function to remove a token from this extension's ownership-tracking data structures. Note that\\n * while the token is not assigned a new owner, the `_ownedTokensIndex` mapping is _not_ updated: this allows for\\n * gas optimizations e.g. when performing a transfer operation (avoiding double writes).\\n * This has O(1) time complexity, but alters the order of the _ownedTokens array.\\n * @param from address representing the previous owner of the given token ID\\n * @param tokenId uint256 ID of the token to be removed from the tokens list of the given address\\n */\\n function _removeTokenFromOwnerEnumeration(address from, uint256 tokenId) private {\\n // To prevent a gap in from's tokens array, we store the last token in the index of the token to delete, and\\n // then delete the last slot (swap and pop).\\n\\n uint256 lastTokenIndex = balanceOf(from);\\n uint256 tokenIndex = _ownedTokensIndex[tokenId];\\n\\n mapping(uint256 index => uint256) storage _ownedTokensByOwner = _ownedTokens[from];\\n\\n // When the token to delete is the last token, the swap operation is unnecessary\\n if (tokenIndex != lastTokenIndex) {\\n uint256 lastTokenId = _ownedTokensByOwner[lastTokenIndex];\\n\\n _ownedTokensByOwner[tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token\\n _ownedTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index\\n }\\n\\n // This also deletes the contents at the last position of the array\\n delete _ownedTokensIndex[tokenId];\\n delete _ownedTokensByOwner[lastTokenIndex];\\n }\\n\\n /**\\n * @dev Private function to remove a token from this extension's token tracking data structures.\\n * This has O(1) time complexity, but alters the order of the _allTokens array.\\n * @param tokenId uint256 ID of the token to be removed from the tokens list\\n */\\n function _removeTokenFromAllTokensEnumeration(uint256 tokenId) private {\\n // To prevent a gap in the tokens array, we store the last token in the index of the token to delete, and\\n // then delete the last slot (swap and pop).\\n\\n uint256 lastTokenIndex = _allTokens.length - 1;\\n uint256 tokenIndex = _allTokensIndex[tokenId];\\n\\n // When the token to delete is the last token, the swap operation is unnecessary. However, since this occurs so\\n // rarely (when the last minted token is burnt) that we still do the swap here to avoid the gas cost of adding\\n // an 'if' statement (like in _removeTokenFromOwnerEnumeration)\\n uint256 lastTokenId = _allTokens[lastTokenIndex];\\n\\n _allTokens[tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token\\n _allTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index\\n\\n // This also deletes the contents at the last position of the array\\n delete _allTokensIndex[tokenId];\\n _allTokens.pop();\\n }\\n\\n /**\\n * See {ERC721-_increaseBalance}. We need that to account tokens that were minted in batch\\n */\\n function _increaseBalance(address account, uint128 amount) internal virtual override {\\n if (amount > 0) {\\n revert ERC721EnumerableForbiddenBatchMint();\\n }\\n super._increaseBalance(account, amount);\\n }\\n}\\n\",\"keccak256\":\"0x5191f783af281c75b7de0f1e3e36cdc6ac5cb2358d929584c4953fd02fa2b5eb\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC721/extensions/ERC721URIStorage.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {ERC721} from \\\"../ERC721.sol\\\";\\nimport {Strings} from \\\"../../../utils/Strings.sol\\\";\\nimport {IERC4906} from \\\"../../../interfaces/IERC4906.sol\\\";\\nimport {IERC165} from \\\"../../../interfaces/IERC165.sol\\\";\\n\\n/**\\n * @dev ERC-721 token with storage based token URI management.\\n */\\nabstract contract ERC721URIStorage is IERC4906, ERC721 {\\n using Strings for uint256;\\n\\n // Interface ID as defined in ERC-4906. This does not correspond to a traditional interface ID as ERC-4906 only\\n // defines events and does not include any external function.\\n bytes4 private constant ERC4906_INTERFACE_ID = bytes4(0x49064906);\\n\\n // Optional mapping for token URIs\\n mapping(uint256 tokenId => string) private _tokenURIs;\\n\\n /**\\n * @dev See {IERC165-supportsInterface}\\n */\\n function supportsInterface(bytes4 interfaceId) public view virtual override(ERC721, IERC165) returns (bool) {\\n return interfaceId == ERC4906_INTERFACE_ID || super.supportsInterface(interfaceId);\\n }\\n\\n /**\\n * @dev See {IERC721Metadata-tokenURI}.\\n */\\n function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {\\n _requireOwned(tokenId);\\n\\n string memory _tokenURI = _tokenURIs[tokenId];\\n string memory base = _baseURI();\\n\\n // If there is no base URI, return the token URI.\\n if (bytes(base).length == 0) {\\n return _tokenURI;\\n }\\n // If both are set, concatenate the baseURI and tokenURI (via string.concat).\\n if (bytes(_tokenURI).length > 0) {\\n return string.concat(base, _tokenURI);\\n }\\n\\n return super.tokenURI(tokenId);\\n }\\n\\n /**\\n * @dev Sets `_tokenURI` as the tokenURI of `tokenId`.\\n *\\n * Emits {MetadataUpdate}.\\n */\\n function _setTokenURI(uint256 tokenId, string memory _tokenURI) internal virtual {\\n _tokenURIs[tokenId] = _tokenURI;\\n emit MetadataUpdate(tokenId);\\n }\\n}\\n\",\"keccak256\":\"0xe52813067c6d5838eeb34e1da8beb2514371a7d778266013b04ca3be1dda7100\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC721/extensions/ERC721Votes.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC721/extensions/ERC721Votes.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {ERC721} from \\\"../ERC721.sol\\\";\\nimport {Votes} from \\\"../../../governance/utils/Votes.sol\\\";\\n\\n/**\\n * @dev Extension of ERC-721 to support voting and delegation as implemented by {Votes}, where each individual NFT counts\\n * as 1 vote unit.\\n *\\n * Tokens do not count as votes until they are delegated, because votes must be tracked which incurs an additional cost\\n * on every transfer. Token holders can either delegate to a trusted representative who will decide how to make use of\\n * the votes in governance decisions, or they can delegate to themselves to be their own representative.\\n */\\nabstract contract ERC721Votes is ERC721, Votes {\\n /**\\n * @dev See {ERC721-_update}. Adjusts votes when tokens are transferred.\\n *\\n * Emits a {IVotes-DelegateVotesChanged} event.\\n */\\n function _update(address to, uint256 tokenId, address auth) internal virtual override returns (address) {\\n address previousOwner = super._update(to, tokenId, auth);\\n\\n _transferVotingUnits(previousOwner, to, 1);\\n\\n return previousOwner;\\n }\\n\\n /**\\n * @dev Returns the balance of `account`.\\n *\\n * WARNING: Overriding this function will likely result in incorrect vote tracking.\\n */\\n function _getVotingUnits(address account) internal view virtual override returns (uint256) {\\n return balanceOf(account);\\n }\\n\\n /**\\n * @dev See {ERC721-_increaseBalance}. We need that to account tokens that were minted in batch.\\n */\\n function _increaseBalance(address account, uint128 amount) internal virtual override {\\n super._increaseBalance(account, amount);\\n _transferVotingUnits(address(0), account, amount);\\n }\\n}\\n\",\"keccak256\":\"0x8b245d62f3ce9596d3a52c7b6c738cd95a40fe8dba898e90fcce18bb7a2d8239\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC721/extensions/IERC721Enumerable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC721/extensions/IERC721Enumerable.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {IERC721} from \\\"../IERC721.sol\\\";\\n\\n/**\\n * @title ERC-721 Non-Fungible Token Standard, optional enumeration extension\\n * @dev See https://eips.ethereum.org/EIPS/eip-721\\n */\\ninterface IERC721Enumerable is IERC721 {\\n /**\\n * @dev Returns the total amount of tokens stored by the contract.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns a token ID owned by `owner` at a given `index` of its token list.\\n * Use along with {balanceOf} to enumerate all of ``owner``'s tokens.\\n */\\n function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256);\\n\\n /**\\n * @dev Returns a token ID at a given `index` of all the tokens stored by the contract.\\n * Use along with {totalSupply} to enumerate all tokens.\\n */\\n function tokenByIndex(uint256 index) external view returns (uint256);\\n}\\n\",\"keccak256\":\"0x3d6954a93ac198a2ffa384fa58ccf18e7e235263e051a394328002eff4e073de\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC721/extensions/IERC721Metadata.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {IERC721} from \\\"../IERC721.sol\\\";\\n\\n/**\\n * @title ERC-721 Non-Fungible Token Standard, optional metadata extension\\n * @dev See https://eips.ethereum.org/EIPS/eip-721\\n */\\ninterface IERC721Metadata is IERC721 {\\n /**\\n * @dev Returns the token collection name.\\n */\\n function name() external view returns (string memory);\\n\\n /**\\n * @dev Returns the token collection symbol.\\n */\\n function symbol() external view returns (string memory);\\n\\n /**\\n * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token.\\n */\\n function tokenURI(uint256 tokenId) external view returns (string memory);\\n}\\n\",\"keccak256\":\"0x37d1aaaa5a2908a09e9dcf56a26ddf762ecf295afb5964695937344fc6802ce1\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC721/utils/ERC721Utils.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC721/utils/ERC721Utils.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {IERC721Receiver} from \\\"../IERC721Receiver.sol\\\";\\nimport {IERC721Errors} from \\\"../../../interfaces/draft-IERC6093.sol\\\";\\n\\n/**\\n * @dev Library that provide common ERC-721 utility functions.\\n *\\n * See https://eips.ethereum.org/EIPS/eip-721[ERC-721].\\n *\\n * _Available since v5.1._\\n */\\nlibrary ERC721Utils {\\n /**\\n * @dev Performs an acceptance check for the provided `operator` by calling {IERC721-onERC721Received}\\n * on the `to` address. The `operator` is generally the address that initiated the token transfer (i.e. `msg.sender`).\\n *\\n * The acceptance call is not executed and treated as a no-op if the target address doesn't contain code (i.e. an EOA).\\n * Otherwise, the recipient must implement {IERC721Receiver-onERC721Received} and return the acceptance magic value to accept\\n * the transfer.\\n */\\n function checkOnERC721Received(\\n address operator,\\n address from,\\n address to,\\n uint256 tokenId,\\n bytes memory data\\n ) internal {\\n if (to.code.length > 0) {\\n try IERC721Receiver(to).onERC721Received(operator, from, tokenId, data) returns (bytes4 retval) {\\n if (retval != IERC721Receiver.onERC721Received.selector) {\\n // Token rejected\\n revert IERC721Errors.ERC721InvalidReceiver(to);\\n }\\n } catch (bytes memory reason) {\\n if (reason.length == 0) {\\n // non-IERC721Receiver implementer\\n revert IERC721Errors.ERC721InvalidReceiver(to);\\n } else {\\n assembly (\\\"memory-safe\\\") {\\n revert(add(32, reason), mload(reason))\\n }\\n }\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x40399695922383778f9f540a620bec475a2f8e0f08d41f0005682842e28a9855\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)\\n\\npragma solidity ^0.8.20;\\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\":\"0x493033a8d1b176a037b2cc6a04dad01a5c157722049bbecf632ca876224dd4b2\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Nonces.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/Nonces.sol)\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Provides tracking nonces for addresses. Nonces will only increment.\\n */\\nabstract contract Nonces {\\n /**\\n * @dev The nonce used for an `account` is not the expected current nonce.\\n */\\n error InvalidAccountNonce(address account, uint256 currentNonce);\\n\\n mapping(address account => uint256) private _nonces;\\n\\n /**\\n * @dev Returns the next unused nonce for an address.\\n */\\n function nonces(address owner) public view virtual returns (uint256) {\\n return _nonces[owner];\\n }\\n\\n /**\\n * @dev Consumes a nonce.\\n *\\n * Returns the current value and increments nonce.\\n */\\n function _useNonce(address owner) internal virtual returns (uint256) {\\n // For each account, the nonce has an initial value of 0, can only be incremented by one, and cannot be\\n // decremented or reset. This guarantees that the nonce never overflows.\\n unchecked {\\n // It is important to do x++ and not ++x here.\\n return _nonces[owner]++;\\n }\\n }\\n\\n /**\\n * @dev Same as {_useNonce} but checking that `nonce` is the next valid for `owner`.\\n */\\n function _useCheckedNonce(address owner, uint256 nonce) internal virtual {\\n uint256 current = _useNonce(owner);\\n if (nonce != current) {\\n revert InvalidAccountNonce(owner, current);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x0082767004fca261c332e9ad100868327a863a88ef724e844857128845ab350f\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Panic.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/Panic.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Helper library for emitting standardized panic codes.\\n *\\n * ```solidity\\n * contract Example {\\n * using Panic for uint256;\\n *\\n * // Use any of the declared internal constants\\n * function foo() { Panic.GENERIC.panic(); }\\n *\\n * // Alternatively\\n * function foo() { Panic.panic(Panic.GENERIC); }\\n * }\\n * ```\\n *\\n * Follows the list from https://github.com/ethereum/solidity/blob/v0.8.24/libsolutil/ErrorCodes.h[libsolutil].\\n *\\n * _Available since v5.1._\\n */\\n// slither-disable-next-line unused-state\\nlibrary Panic {\\n /// @dev generic / unspecified error\\n uint256 internal constant GENERIC = 0x00;\\n /// @dev used by the assert() builtin\\n uint256 internal constant ASSERT = 0x01;\\n /// @dev arithmetic underflow or overflow\\n uint256 internal constant UNDER_OVERFLOW = 0x11;\\n /// @dev division or modulo by zero\\n uint256 internal constant DIVISION_BY_ZERO = 0x12;\\n /// @dev enum conversion error\\n uint256 internal constant ENUM_CONVERSION_ERROR = 0x21;\\n /// @dev invalid encoding in storage\\n uint256 internal constant STORAGE_ENCODING_ERROR = 0x22;\\n /// @dev empty array pop\\n uint256 internal constant EMPTY_ARRAY_POP = 0x31;\\n /// @dev array out of bounds access\\n uint256 internal constant ARRAY_OUT_OF_BOUNDS = 0x32;\\n /// @dev resource error (too large allocation or too large array)\\n uint256 internal constant RESOURCE_ERROR = 0x41;\\n /// @dev calling invalid internal function\\n uint256 internal constant INVALID_INTERNAL_FUNCTION = 0x51;\\n\\n /// @dev Reverts with a panic code. Recommended to use with\\n /// the internal constants with predefined codes.\\n function panic(uint256 code) internal pure {\\n assembly (\\\"memory-safe\\\") {\\n mstore(0x00, 0x4e487b71)\\n mstore(0x20, code)\\n revert(0x1c, 0x24)\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf7fe324703a64fc51702311dc51562d5cb1497734f074e4f483bfb6717572d7a\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/ShortStrings.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/ShortStrings.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {StorageSlot} from \\\"./StorageSlot.sol\\\";\\n\\n// | string | 0xAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA |\\n// | length | 0x BB |\\ntype ShortString is bytes32;\\n\\n/**\\n * @dev This library provides functions to convert short memory strings\\n * into a `ShortString` type that can be used as an immutable variable.\\n *\\n * Strings of arbitrary length can be optimized using this library if\\n * they are short enough (up to 31 bytes) by packing them with their\\n * length (1 byte) in a single EVM word (32 bytes). Additionally, a\\n * fallback mechanism can be used for every other case.\\n *\\n * Usage example:\\n *\\n * ```solidity\\n * contract Named {\\n * using ShortStrings for *;\\n *\\n * ShortString private immutable _name;\\n * string private _nameFallback;\\n *\\n * constructor(string memory contractName) {\\n * _name = contractName.toShortStringWithFallback(_nameFallback);\\n * }\\n *\\n * function name() external view returns (string memory) {\\n * return _name.toStringWithFallback(_nameFallback);\\n * }\\n * }\\n * ```\\n */\\nlibrary ShortStrings {\\n // Used as an identifier for strings longer than 31 bytes.\\n bytes32 private constant FALLBACK_SENTINEL = 0x00000000000000000000000000000000000000000000000000000000000000FF;\\n\\n error StringTooLong(string str);\\n error InvalidShortString();\\n\\n /**\\n * @dev Encode a string of at most 31 chars into a `ShortString`.\\n *\\n * This will trigger a `StringTooLong` error is the input string is too long.\\n */\\n function toShortString(string memory str) internal pure returns (ShortString) {\\n bytes memory bstr = bytes(str);\\n if (bstr.length > 31) {\\n revert StringTooLong(str);\\n }\\n return ShortString.wrap(bytes32(uint256(bytes32(bstr)) | bstr.length));\\n }\\n\\n /**\\n * @dev Decode a `ShortString` back to a \\\"normal\\\" string.\\n */\\n function toString(ShortString sstr) internal pure returns (string memory) {\\n uint256 len = byteLength(sstr);\\n // using `new string(len)` would work locally but is not memory safe.\\n string memory str = new string(32);\\n assembly (\\\"memory-safe\\\") {\\n mstore(str, len)\\n mstore(add(str, 0x20), sstr)\\n }\\n return str;\\n }\\n\\n /**\\n * @dev Return the length of a `ShortString`.\\n */\\n function byteLength(ShortString sstr) internal pure returns (uint256) {\\n uint256 result = uint256(ShortString.unwrap(sstr)) & 0xFF;\\n if (result > 31) {\\n revert InvalidShortString();\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Encode a string into a `ShortString`, or write it to storage if it is too long.\\n */\\n function toShortStringWithFallback(string memory value, string storage store) internal returns (ShortString) {\\n if (bytes(value).length < 32) {\\n return toShortString(value);\\n } else {\\n StorageSlot.getStringSlot(store).value = value;\\n return ShortString.wrap(FALLBACK_SENTINEL);\\n }\\n }\\n\\n /**\\n * @dev Decode a string that was encoded to `ShortString` or written to storage using {setWithFallback}.\\n */\\n function toStringWithFallback(ShortString value, string storage store) internal pure returns (string memory) {\\n if (ShortString.unwrap(value) != FALLBACK_SENTINEL) {\\n return toString(value);\\n } else {\\n return store;\\n }\\n }\\n\\n /**\\n * @dev Return the length of a string that was encoded to `ShortString` or written to storage using\\n * {setWithFallback}.\\n *\\n * WARNING: This will return the \\\"byte length\\\" of the string. This may not reflect the actual length in terms of\\n * actual characters as the UTF-8 encoding of a single character can span over multiple bytes.\\n */\\n function byteLengthWithFallback(ShortString value, string storage store) internal view returns (uint256) {\\n if (ShortString.unwrap(value) != FALLBACK_SENTINEL) {\\n return byteLength(value);\\n } else {\\n return bytes(store).length;\\n }\\n }\\n}\\n\",\"keccak256\":\"0x7d94fa0af099a2172eb01f9c8a8a443cbe7e0e43654841563e4e09968efdb549\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/StorageSlot.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/StorageSlot.sol)\\n// This file was procedurally generated from scripts/generate/templates/StorageSlot.js.\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Library for reading and writing primitive types to specific storage slots.\\n *\\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\\n * This library helps with reading and writing to such slots without the need for inline assembly.\\n *\\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\\n *\\n * Example usage to set ERC-1967 implementation slot:\\n * ```solidity\\n * contract ERC1967 {\\n * // Define the slot. Alternatively, use the SlotDerivation library to derive the slot.\\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n *\\n * function _getImplementation() internal view returns (address) {\\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n * }\\n *\\n * function _setImplementation(address newImplementation) internal {\\n * require(newImplementation.code.length > 0);\\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n * }\\n * }\\n * ```\\n *\\n * TIP: Consider using this library along with {SlotDerivation}.\\n */\\nlibrary StorageSlot {\\n struct AddressSlot {\\n address value;\\n }\\n\\n struct BooleanSlot {\\n bool value;\\n }\\n\\n struct Bytes32Slot {\\n bytes32 value;\\n }\\n\\n struct Uint256Slot {\\n uint256 value;\\n }\\n\\n struct Int256Slot {\\n int256 value;\\n }\\n\\n struct StringSlot {\\n string value;\\n }\\n\\n struct BytesSlot {\\n bytes value;\\n }\\n\\n /**\\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\\n */\\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\\n assembly (\\\"memory-safe\\\") {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns a `BooleanSlot` with member `value` located at `slot`.\\n */\\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\\n assembly (\\\"memory-safe\\\") {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns a `Bytes32Slot` with member `value` located at `slot`.\\n */\\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\\n assembly (\\\"memory-safe\\\") {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns a `Uint256Slot` with member `value` located at `slot`.\\n */\\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\\n assembly (\\\"memory-safe\\\") {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns a `Int256Slot` with member `value` located at `slot`.\\n */\\n function getInt256Slot(bytes32 slot) internal pure returns (Int256Slot storage r) {\\n assembly (\\\"memory-safe\\\") {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns a `StringSlot` with member `value` located at `slot`.\\n */\\n function getStringSlot(bytes32 slot) internal pure returns (StringSlot storage r) {\\n assembly (\\\"memory-safe\\\") {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `StringSlot` representation of the string storage pointer `store`.\\n */\\n function getStringSlot(string storage store) internal pure returns (StringSlot storage r) {\\n assembly (\\\"memory-safe\\\") {\\n r.slot := store.slot\\n }\\n }\\n\\n /**\\n * @dev Returns a `BytesSlot` with member `value` located at `slot`.\\n */\\n function getBytesSlot(bytes32 slot) internal pure returns (BytesSlot storage r) {\\n assembly (\\\"memory-safe\\\") {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `BytesSlot` representation of the bytes storage pointer `store`.\\n */\\n function getBytesSlot(bytes storage store) internal pure returns (BytesSlot storage r) {\\n assembly (\\\"memory-safe\\\") {\\n r.slot := store.slot\\n }\\n }\\n}\\n\",\"keccak256\":\"0xcf74f855663ce2ae00ed8352666b7935f6cddea2932fdf2c3ecd30a9b1cd0e97\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Strings.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/Strings.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {Math} from \\\"./math/Math.sol\\\";\\nimport {SignedMath} from \\\"./math/SignedMath.sol\\\";\\n\\n/**\\n * @dev String operations.\\n */\\nlibrary Strings {\\n bytes16 private constant HEX_DIGITS = \\\"0123456789abcdef\\\";\\n uint8 private constant ADDRESS_LENGTH = 20;\\n\\n /**\\n * @dev The `value` string doesn't fit in the specified `length`.\\n */\\n error StringsInsufficientHexLength(uint256 value, uint256 length);\\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 assembly (\\\"memory-safe\\\") {\\n ptr := add(buffer, add(32, length))\\n }\\n while (true) {\\n ptr--;\\n assembly (\\\"memory-safe\\\") {\\n mstore8(ptr, byte(mod(value, 10), HEX_DIGITS))\\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 toStringSigned(int256 value) internal pure returns (string memory) {\\n return string.concat(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 uint256 localValue = value;\\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] = HEX_DIGITS[localValue & 0xf];\\n localValue >>= 4;\\n }\\n if (localValue != 0) {\\n revert StringsInsufficientHexLength(value, length);\\n }\\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\\n * 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 Converts an `address` with fixed length of 20 bytes to its checksummed ASCII `string` hexadecimal\\n * representation, according to EIP-55.\\n */\\n function toChecksumHexString(address addr) internal pure returns (string memory) {\\n bytes memory buffer = bytes(toHexString(addr));\\n\\n // hash the hex part of buffer (skip length + 2 bytes, length 40)\\n uint256 hashValue;\\n assembly (\\\"memory-safe\\\") {\\n hashValue := shr(96, keccak256(add(buffer, 0x22), 40))\\n }\\n\\n for (uint256 i = 41; i > 1; --i) {\\n // possible values for buffer[i] are 48 (0) to 57 (9) and 97 (a) to 102 (f)\\n if (hashValue & 0xf > 7 && uint8(buffer[i]) > 96) {\\n // case shift by xoring with 0x20\\n buffer[i] ^= 0x20;\\n }\\n hashValue >>= 4;\\n }\\n return string(buffer);\\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 bytes(a).length == bytes(b).length && keccak256(bytes(a)) == keccak256(bytes(b));\\n }\\n}\\n\",\"keccak256\":\"0x725209b582291bb83058e3078624b53d15a133f7401c30295e7f3704181d2aed\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/cryptography/ECDSA.sol)\\n\\npragma solidity ^0.8.20;\\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 }\\n\\n /**\\n * @dev The signature derives the `address(0)`.\\n */\\n error ECDSAInvalidSignature();\\n\\n /**\\n * @dev The signature has an invalid length.\\n */\\n error ECDSAInvalidSignatureLength(uint256 length);\\n\\n /**\\n * @dev The signature has an S value that is in the upper half order.\\n */\\n error ECDSAInvalidSignatureS(bytes32 s);\\n\\n /**\\n * @dev Returns the address that signed a hashed message (`hash`) with `signature` or an error. This will not\\n * return address(0) without also returning an error description. Errors are documented using an enum (error type)\\n * and a bytes32 providing additional information about the error.\\n *\\n * If no error is returned, then the address can be used for verification purposes.\\n *\\n * The `ecrecover` EVM precompile 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 {MessageHashUtils-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 function tryRecover(\\n bytes32 hash,\\n bytes memory signature\\n ) internal pure returns (address recovered, RecoverError err, bytes32 errArg) {\\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 assembly (\\\"memory-safe\\\") {\\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, bytes32(signature.length));\\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 precompile 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 {MessageHashUtils-toEthSignedMessageHash} on it.\\n */\\n function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {\\n (address recovered, RecoverError error, bytes32 errorArg) = tryRecover(hash, signature);\\n _throwError(error, errorArg);\\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[ERC-2098 short signatures]\\n */\\n function tryRecover(\\n bytes32 hash,\\n bytes32 r,\\n bytes32 vs\\n ) internal pure returns (address recovered, RecoverError err, bytes32 errArg) {\\n unchecked {\\n bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff);\\n // We do not check for an overflow here since the shift operation results in 0 or 1.\\n uint8 v = uint8((uint256(vs) >> 255) + 27);\\n return tryRecover(hash, v, r, s);\\n }\\n }\\n\\n /**\\n * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately.\\n */\\n function recover(bytes32 hash, bytes32 r, bytes32 vs) internal pure returns (address) {\\n (address recovered, RecoverError error, bytes32 errorArg) = tryRecover(hash, r, vs);\\n _throwError(error, errorArg);\\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 function tryRecover(\\n bytes32 hash,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) internal pure returns (address recovered, RecoverError err, bytes32 errArg) {\\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, s);\\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, bytes32(0));\\n }\\n\\n return (signer, RecoverError.NoError, bytes32(0));\\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, bytes32 errorArg) = tryRecover(hash, v, r, s);\\n _throwError(error, errorArg);\\n return recovered;\\n }\\n\\n /**\\n * @dev Optionally reverts with the corresponding custom error according to the `error` argument provided.\\n */\\n function _throwError(RecoverError error, bytes32 errorArg) private pure {\\n if (error == RecoverError.NoError) {\\n return; // no error: do nothing\\n } else if (error == RecoverError.InvalidSignature) {\\n revert ECDSAInvalidSignature();\\n } else if (error == RecoverError.InvalidSignatureLength) {\\n revert ECDSAInvalidSignatureLength(uint256(errorArg));\\n } else if (error == RecoverError.InvalidSignatureS) {\\n revert ECDSAInvalidSignatureS(errorArg);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x69f54c02b7d81d505910ec198c11ed4c6a728418a868b906b4a0cf29946fda84\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/cryptography/EIP712.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/cryptography/EIP712.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {MessageHashUtils} from \\\"./MessageHashUtils.sol\\\";\\nimport {ShortStrings, ShortString} from \\\"../ShortStrings.sol\\\";\\nimport {IERC5267} from \\\"../../interfaces/IERC5267.sol\\\";\\n\\n/**\\n * @dev https://eips.ethereum.org/EIPS/eip-712[EIP-712] is a standard for hashing and signing of typed structured data.\\n *\\n * The encoding scheme specified in the EIP requires a domain separator and a hash of the typed structured data, whose\\n * encoding is very generic and therefore its implementation in Solidity is not feasible, thus this contract\\n * does not implement the encoding itself. Protocols need to implement the type-specific encoding they need in order to\\n * produce the hash of their typed data using a combination of `abi.encode` and `keccak256`.\\n *\\n * This contract implements the EIP-712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding\\n * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA\\n * ({_hashTypedDataV4}).\\n *\\n * The implementation of the domain separator was designed to be as efficient as possible while still properly updating\\n * the chain id to protect against replay attacks on an eventual fork of the chain.\\n *\\n * NOTE: This contract implements the version of the encoding known as \\\"v4\\\", as implemented by the JSON RPC method\\n * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask].\\n *\\n * NOTE: In the upgradeable version of this contract, the cached values will correspond to the address, and the domain\\n * separator of the implementation contract. This will cause the {_domainSeparatorV4} function to always rebuild the\\n * separator from the immutable values, which is cheaper than accessing a cached version in cold storage.\\n *\\n * @custom:oz-upgrades-unsafe-allow state-variable-immutable\\n */\\nabstract contract EIP712 is IERC5267 {\\n using ShortStrings for *;\\n\\n bytes32 private constant TYPE_HASH =\\n keccak256(\\\"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)\\\");\\n\\n // Cache the domain separator as an immutable value, but also store the chain id that it corresponds to, in order to\\n // invalidate the cached domain separator if the chain id changes.\\n bytes32 private immutable _cachedDomainSeparator;\\n uint256 private immutable _cachedChainId;\\n address private immutable _cachedThis;\\n\\n bytes32 private immutable _hashedName;\\n bytes32 private immutable _hashedVersion;\\n\\n ShortString private immutable _name;\\n ShortString private immutable _version;\\n string private _nameFallback;\\n string private _versionFallback;\\n\\n /**\\n * @dev Initializes the domain separator and parameter caches.\\n *\\n * The meaning of `name` and `version` is specified in\\n * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP-712]:\\n *\\n * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol.\\n * - `version`: the current major version of the signing domain.\\n *\\n * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart\\n * contract upgrade].\\n */\\n constructor(string memory name, string memory version) {\\n _name = name.toShortStringWithFallback(_nameFallback);\\n _version = version.toShortStringWithFallback(_versionFallback);\\n _hashedName = keccak256(bytes(name));\\n _hashedVersion = keccak256(bytes(version));\\n\\n _cachedChainId = block.chainid;\\n _cachedDomainSeparator = _buildDomainSeparator();\\n _cachedThis = address(this);\\n }\\n\\n /**\\n * @dev Returns the domain separator for the current chain.\\n */\\n function _domainSeparatorV4() internal view returns (bytes32) {\\n if (address(this) == _cachedThis && block.chainid == _cachedChainId) {\\n return _cachedDomainSeparator;\\n } else {\\n return _buildDomainSeparator();\\n }\\n }\\n\\n function _buildDomainSeparator() private view returns (bytes32) {\\n return keccak256(abi.encode(TYPE_HASH, _hashedName, _hashedVersion, block.chainid, address(this)));\\n }\\n\\n /**\\n * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this\\n * function returns the hash of the fully encoded EIP712 message for this domain.\\n *\\n * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example:\\n *\\n * ```solidity\\n * bytes32 digest = _hashTypedDataV4(keccak256(abi.encode(\\n * keccak256(\\\"Mail(address to,string contents)\\\"),\\n * mailTo,\\n * keccak256(bytes(mailContents))\\n * )));\\n * address signer = ECDSA.recover(digest, signature);\\n * ```\\n */\\n function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) {\\n return MessageHashUtils.toTypedDataHash(_domainSeparatorV4(), structHash);\\n }\\n\\n /**\\n * @dev See {IERC-5267}.\\n */\\n function eip712Domain()\\n public\\n view\\n virtual\\n returns (\\n bytes1 fields,\\n string memory name,\\n string memory version,\\n uint256 chainId,\\n address verifyingContract,\\n bytes32 salt,\\n uint256[] memory extensions\\n )\\n {\\n return (\\n hex\\\"0f\\\", // 01111\\n _EIP712Name(),\\n _EIP712Version(),\\n block.chainid,\\n address(this),\\n bytes32(0),\\n new uint256[](0)\\n );\\n }\\n\\n /**\\n * @dev The name parameter for the EIP712 domain.\\n *\\n * NOTE: By default this function reads _name which is an immutable value.\\n * It only reads from storage if necessary (in case the value is too large to fit in a ShortString).\\n */\\n // solhint-disable-next-line func-name-mixedcase\\n function _EIP712Name() internal view returns (string memory) {\\n return _name.toStringWithFallback(_nameFallback);\\n }\\n\\n /**\\n * @dev The version parameter for the EIP712 domain.\\n *\\n * NOTE: By default this function reads _version which is an immutable value.\\n * It only reads from storage if necessary (in case the value is too large to fit in a ShortString).\\n */\\n // solhint-disable-next-line func-name-mixedcase\\n function _EIP712Version() internal view returns (string memory) {\\n return _version.toStringWithFallback(_versionFallback);\\n }\\n}\\n\",\"keccak256\":\"0x10eb97d047f8d84fe263a02bb4a656ac6674f6679d74532cc37546289e073a9d\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/cryptography/MessageHashUtils.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/cryptography/MessageHashUtils.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {Strings} from \\\"../Strings.sol\\\";\\n\\n/**\\n * @dev Signature message hash utilities for producing digests to be consumed by {ECDSA} recovery or signing.\\n *\\n * The library provides methods for generating a hash of a message that conforms to the\\n * https://eips.ethereum.org/EIPS/eip-191[ERC-191] and https://eips.ethereum.org/EIPS/eip-712[EIP 712]\\n * specifications.\\n */\\nlibrary MessageHashUtils {\\n /**\\n * @dev Returns the keccak256 digest of an ERC-191 signed data with version\\n * `0x45` (`personal_sign` messages).\\n *\\n * The digest is calculated by prefixing a bytes32 `messageHash` with\\n * `\\\"\\\\x19Ethereum Signed Message:\\\\n32\\\"` and hashing the result. It corresponds with the\\n * hash signed when using the https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] JSON-RPC method.\\n *\\n * NOTE: The `messageHash` parameter is intended to be the result of hashing a raw message with\\n * keccak256, although any bytes32 value can be safely used because the final digest will\\n * be re-hashed.\\n *\\n * See {ECDSA-recover}.\\n */\\n function toEthSignedMessageHash(bytes32 messageHash) internal pure returns (bytes32 digest) {\\n assembly (\\\"memory-safe\\\") {\\n mstore(0x00, \\\"\\\\x19Ethereum Signed Message:\\\\n32\\\") // 32 is the bytes-length of messageHash\\n mstore(0x1c, messageHash) // 0x1c (28) is the length of the prefix\\n digest := keccak256(0x00, 0x3c) // 0x3c is the length of the prefix (0x1c) + messageHash (0x20)\\n }\\n }\\n\\n /**\\n * @dev Returns the keccak256 digest of an ERC-191 signed data with version\\n * `0x45` (`personal_sign` messages).\\n *\\n * The digest is calculated by prefixing an arbitrary `message` with\\n * `\\\"\\\\x19Ethereum Signed Message:\\\\n\\\" + len(message)` and hashing the result. It corresponds with the\\n * hash signed when using the https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] JSON-RPC method.\\n *\\n * See {ECDSA-recover}.\\n */\\n function toEthSignedMessageHash(bytes memory message) internal pure returns (bytes32) {\\n return\\n keccak256(bytes.concat(\\\"\\\\x19Ethereum Signed Message:\\\\n\\\", bytes(Strings.toString(message.length)), message));\\n }\\n\\n /**\\n * @dev Returns the keccak256 digest of an ERC-191 signed data with version\\n * `0x00` (data with intended validator).\\n *\\n * The digest is calculated by prefixing an arbitrary `data` with `\\\"\\\\x19\\\\x00\\\"` and the intended\\n * `validator` address. Then hashing the result.\\n *\\n * See {ECDSA-recover}.\\n */\\n function toDataWithIntendedValidatorHash(address validator, bytes memory data) internal pure returns (bytes32) {\\n return keccak256(abi.encodePacked(hex\\\"19_00\\\", validator, data));\\n }\\n\\n /**\\n * @dev Returns the keccak256 digest of an EIP-712 typed data (ERC-191 version `0x01`).\\n *\\n * The digest is calculated from a `domainSeparator` and a `structHash`, by prefixing them with\\n * `\\\\x19\\\\x01` and hashing the result. It corresponds to the hash signed by the\\n * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`] JSON-RPC method as part of EIP-712.\\n *\\n * See {ECDSA-recover}.\\n */\\n function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32 digest) {\\n assembly (\\\"memory-safe\\\") {\\n let ptr := mload(0x40)\\n mstore(ptr, hex\\\"19_01\\\")\\n mstore(add(ptr, 0x02), domainSeparator)\\n mstore(add(ptr, 0x22), structHash)\\n digest := keccak256(ptr, 0x42)\\n }\\n }\\n}\\n\",\"keccak256\":\"0x4515543bc4c78561f6bea83ecfdfc3dead55bd59858287d682045b11de1ae575\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/introspection/ERC165.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/introspection/ERC165.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {IERC165} from \\\"./IERC165.sol\\\";\\n\\n/**\\n * @dev Implementation of the {IERC165} interface.\\n *\\n * Contracts that want to implement ERC-165 should inherit from this contract and override {supportsInterface} to check\\n * for the additional interface id that will be supported. For example:\\n *\\n * ```solidity\\n * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\\n * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);\\n * }\\n * ```\\n */\\nabstract contract ERC165 is IERC165 {\\n /**\\n * @dev See {IERC165-supportsInterface}.\\n */\\n function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) {\\n return interfaceId == type(IERC165).interfaceId;\\n }\\n}\\n\",\"keccak256\":\"0xddce8e17e3d3f9ed818b4f4c4478a8262aab8b11ed322f1bf5ed705bb4bd97fa\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/introspection/IERC165.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/introspection/IERC165.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Interface of the ERC-165 standard, as defined in the\\n * https://eips.ethereum.org/EIPS/eip-165[ERC].\\n *\\n * Implementers can declare support of contract interfaces, which can then be\\n * queried by others ({ERC165Checker}).\\n *\\n * For an implementation, see {ERC165}.\\n */\\ninterface IERC165 {\\n /**\\n * @dev Returns true if this contract implements the interface defined by\\n * `interfaceId`. See the corresponding\\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[ERC section]\\n * to learn more about how these ids are created.\\n *\\n * This function call must use less than 30 000 gas.\\n */\\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x79796192ec90263f21b464d5bc90b777a525971d3de8232be80d9c4f9fb353b8\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/math/Math.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/math/Math.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {Panic} from \\\"../Panic.sol\\\";\\nimport {SafeCast} from \\\"./SafeCast.sol\\\";\\n\\n/**\\n * @dev Standard math utilities missing in the Solidity language.\\n */\\nlibrary Math {\\n enum Rounding {\\n Floor, // Toward negative infinity\\n Ceil, // Toward positive infinity\\n Trunc, // Toward zero\\n Expand // Away from zero\\n }\\n\\n /**\\n * @dev Returns the addition of two unsigned integers, with an success flag (no overflow).\\n */\\n function tryAdd(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\\n unchecked {\\n uint256 c = a + b;\\n if (c < a) return (false, 0);\\n return (true, c);\\n }\\n }\\n\\n /**\\n * @dev Returns the subtraction of two unsigned integers, with an success flag (no overflow).\\n */\\n function trySub(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\\n unchecked {\\n if (b > a) return (false, 0);\\n return (true, a - b);\\n }\\n }\\n\\n /**\\n * @dev Returns the multiplication of two unsigned integers, with an success flag (no overflow).\\n */\\n function tryMul(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\\n unchecked {\\n // Gas optimization: this is cheaper than requiring 'a' not being zero, but the\\n // benefit is lost if 'b' is also tested.\\n // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522\\n if (a == 0) return (true, 0);\\n uint256 c = a * b;\\n if (c / a != b) return (false, 0);\\n return (true, c);\\n }\\n }\\n\\n /**\\n * @dev Returns the division of two unsigned integers, with a success flag (no division by zero).\\n */\\n function tryDiv(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\\n unchecked {\\n if (b == 0) return (false, 0);\\n return (true, a / b);\\n }\\n }\\n\\n /**\\n * @dev Returns the remainder of dividing two unsigned integers, with a success flag (no division by zero).\\n */\\n function tryMod(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\\n unchecked {\\n if (b == 0) return (false, 0);\\n return (true, a % b);\\n }\\n }\\n\\n /**\\n * @dev Branchless ternary evaluation for `a ? b : c`. Gas costs are constant.\\n *\\n * IMPORTANT: This function may reduce bytecode size and consume less gas when used standalone.\\n * However, the compiler may optimize Solidity ternary operations (i.e. `a ? b : c`) to only compute\\n * one branch when needed, making this function more expensive.\\n */\\n function ternary(bool condition, uint256 a, uint256 b) internal pure returns (uint256) {\\n unchecked {\\n // branchless ternary works because:\\n // b ^ (a ^ b) == a\\n // b ^ 0 == b\\n return b ^ ((a ^ b) * SafeCast.toUint(condition));\\n }\\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 ternary(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 ternary(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 towards infinity instead\\n * of rounding towards zero.\\n */\\n function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {\\n if (b == 0) {\\n // Guarantee the same behavior as in a regular Solidity division.\\n Panic.panic(Panic.DIVISION_BY_ZERO);\\n }\\n\\n // The following calculation ensures accurate ceiling division without overflow.\\n // Since a is non-zero, (a - 1) / b will not overflow.\\n // The largest possible result occurs when (a - 1) / b is type(uint256).max,\\n // but the largest value we can obtain is type(uint256).max - 1, which happens\\n // when a = type(uint256).max and b = 1.\\n unchecked {\\n return SafeCast.toUint(a > 0) * ((a - 1) / b + 1);\\n }\\n }\\n\\n /**\\n * @dev Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or\\n * denominator == 0.\\n *\\n * Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv) with further edits by\\n * 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\\u00b2\\u2075\\u2076 and mod 2\\u00b2\\u2075\\u2076 - 1, then use\\n // the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256\\n // variables such that product = prod1 * 2\\u00b2\\u2075\\u2076 + prod0.\\n uint256 prod0 = x * y; // 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 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\\u00b2\\u2075\\u2076. Also prevents denominator == 0.\\n if (denominator <= prod1) {\\n Panic.panic(ternary(denominator == 0, Panic.DIVISION_BY_ZERO, Panic.UNDER_OVERFLOW));\\n }\\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.\\n // Always >= 1. See https://cs.stackexchange.com/q/138556/92363.\\n\\n uint256 twos = denominator & (0 - denominator);\\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\\u00b2\\u2075\\u2076 / 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\\u00b2\\u2075\\u2076. Now that denominator is an odd number, it has an inverse modulo 2\\u00b2\\u2075\\u2076 such\\n // that denominator * inv \\u2261 1 mod 2\\u00b2\\u2075\\u2076. Compute the inverse by starting with a seed that is correct for\\n // four bits. That is, denominator * inv \\u2261 1 mod 2\\u2074.\\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\\n // works in modular arithmetic, doubling the correct bits in each step.\\n inverse *= 2 - denominator * inverse; // inverse mod 2\\u2078\\n inverse *= 2 - denominator * inverse; // inverse mod 2\\u00b9\\u2076\\n inverse *= 2 - denominator * inverse; // inverse mod 2\\u00b3\\u00b2\\n inverse *= 2 - denominator * inverse; // inverse mod 2\\u2076\\u2074\\n inverse *= 2 - denominator * inverse; // inverse mod 2\\u00b9\\u00b2\\u2078\\n inverse *= 2 - denominator * inverse; // inverse mod 2\\u00b2\\u2075\\u2076\\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\\u00b2\\u2075\\u2076. Since the preconditions guarantee that the outcome is\\n // less than 2\\u00b2\\u2075\\u2076, 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 * @dev 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 return mulDiv(x, y, denominator) + SafeCast.toUint(unsignedRoundsUp(rounding) && mulmod(x, y, denominator) > 0);\\n }\\n\\n /**\\n * @dev Calculate the modular multiplicative inverse of a number in Z/nZ.\\n *\\n * If n is a prime, then Z/nZ is a field. In that case all elements are inversible, except 0.\\n * If n is not a prime, then Z/nZ is not a field, and some elements might not be inversible.\\n *\\n * If the input value is not inversible, 0 is returned.\\n *\\n * NOTE: If you know for sure that n is (big) a prime, it may be cheaper to use Fermat's little theorem and get the\\n * inverse using `Math.modExp(a, n - 2, n)`. See {invModPrime}.\\n */\\n function invMod(uint256 a, uint256 n) internal pure returns (uint256) {\\n unchecked {\\n if (n == 0) return 0;\\n\\n // The inverse modulo is calculated using the Extended Euclidean Algorithm (iterative version)\\n // Used to compute integers x and y such that: ax + ny = gcd(a, n).\\n // When the gcd is 1, then the inverse of a modulo n exists and it's x.\\n // ax + ny = 1\\n // ax = 1 + (-y)n\\n // ax \\u2261 1 (mod n) # x is the inverse of a modulo n\\n\\n // If the remainder is 0 the gcd is n right away.\\n uint256 remainder = a % n;\\n uint256 gcd = n;\\n\\n // Therefore the initial coefficients are:\\n // ax + ny = gcd(a, n) = n\\n // 0a + 1n = n\\n int256 x = 0;\\n int256 y = 1;\\n\\n while (remainder != 0) {\\n uint256 quotient = gcd / remainder;\\n\\n (gcd, remainder) = (\\n // The old remainder is the next gcd to try.\\n remainder,\\n // Compute the next remainder.\\n // Can't overflow given that (a % gcd) * (gcd // (a % gcd)) <= gcd\\n // where gcd is at most n (capped to type(uint256).max)\\n gcd - remainder * quotient\\n );\\n\\n (x, y) = (\\n // Increment the coefficient of a.\\n y,\\n // Decrement the coefficient of n.\\n // Can overflow, but the result is casted to uint256 so that the\\n // next value of y is \\\"wrapped around\\\" to a value between 0 and n - 1.\\n x - y * int256(quotient)\\n );\\n }\\n\\n if (gcd != 1) return 0; // No inverse exists.\\n return ternary(x < 0, n - uint256(-x), uint256(x)); // Wrap the result if it's negative.\\n }\\n }\\n\\n /**\\n * @dev Variant of {invMod}. More efficient, but only works if `p` is known to be a prime greater than `2`.\\n *\\n * From https://en.wikipedia.org/wiki/Fermat%27s_little_theorem[Fermat's little theorem], we know that if p is\\n * prime, then `a**(p-1) \\u2261 1 mod p`. As a consequence, we have `a * a**(p-2) \\u2261 1 mod p`, which means that\\n * `a**(p-2)` is the modular multiplicative inverse of a in Fp.\\n *\\n * NOTE: this function does NOT check that `p` is a prime greater than `2`.\\n */\\n function invModPrime(uint256 a, uint256 p) internal view returns (uint256) {\\n unchecked {\\n return Math.modExp(a, p - 2, p);\\n }\\n }\\n\\n /**\\n * @dev Returns the modular exponentiation of the specified base, exponent and modulus (b ** e % m)\\n *\\n * Requirements:\\n * - modulus can't be zero\\n * - underlying staticcall to precompile must succeed\\n *\\n * IMPORTANT: The result is only valid if the underlying call succeeds. When using this function, make\\n * sure the chain you're using it on supports the precompiled contract for modular exponentiation\\n * at address 0x05 as specified in https://eips.ethereum.org/EIPS/eip-198[EIP-198]. Otherwise,\\n * the underlying function will succeed given the lack of a revert, but the result may be incorrectly\\n * interpreted as 0.\\n */\\n function modExp(uint256 b, uint256 e, uint256 m) internal view returns (uint256) {\\n (bool success, uint256 result) = tryModExp(b, e, m);\\n if (!success) {\\n Panic.panic(Panic.DIVISION_BY_ZERO);\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Returns the modular exponentiation of the specified base, exponent and modulus (b ** e % m).\\n * It includes a success flag indicating if the operation succeeded. Operation will be marked as failed if trying\\n * to operate modulo 0 or if the underlying precompile reverted.\\n *\\n * IMPORTANT: The result is only valid if the success flag is true. When using this function, make sure the chain\\n * you're using it on supports the precompiled contract for modular exponentiation at address 0x05 as specified in\\n * https://eips.ethereum.org/EIPS/eip-198[EIP-198]. Otherwise, the underlying function will succeed given the lack\\n * of a revert, but the result may be incorrectly interpreted as 0.\\n */\\n function tryModExp(uint256 b, uint256 e, uint256 m) internal view returns (bool success, uint256 result) {\\n if (m == 0) return (false, 0);\\n assembly (\\\"memory-safe\\\") {\\n let ptr := mload(0x40)\\n // | Offset | Content | Content (Hex) |\\n // |-----------|------------|--------------------------------------------------------------------|\\n // | 0x00:0x1f | size of b | 0x0000000000000000000000000000000000000000000000000000000000000020 |\\n // | 0x20:0x3f | size of e | 0x0000000000000000000000000000000000000000000000000000000000000020 |\\n // | 0x40:0x5f | size of m | 0x0000000000000000000000000000000000000000000000000000000000000020 |\\n // | 0x60:0x7f | value of b | 0x<.............................................................b> |\\n // | 0x80:0x9f | value of e | 0x<.............................................................e> |\\n // | 0xa0:0xbf | value of m | 0x<.............................................................m> |\\n mstore(ptr, 0x20)\\n mstore(add(ptr, 0x20), 0x20)\\n mstore(add(ptr, 0x40), 0x20)\\n mstore(add(ptr, 0x60), b)\\n mstore(add(ptr, 0x80), e)\\n mstore(add(ptr, 0xa0), m)\\n\\n // Given the result < m, it's guaranteed to fit in 32 bytes,\\n // so we can use the memory scratch space located at offset 0.\\n success := staticcall(gas(), 0x05, ptr, 0xc0, 0x00, 0x20)\\n result := mload(0x00)\\n }\\n }\\n\\n /**\\n * @dev Variant of {modExp} that supports inputs of arbitrary length.\\n */\\n function modExp(bytes memory b, bytes memory e, bytes memory m) internal view returns (bytes memory) {\\n (bool success, bytes memory result) = tryModExp(b, e, m);\\n if (!success) {\\n Panic.panic(Panic.DIVISION_BY_ZERO);\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Variant of {tryModExp} that supports inputs of arbitrary length.\\n */\\n function tryModExp(\\n bytes memory b,\\n bytes memory e,\\n bytes memory m\\n ) internal view returns (bool success, bytes memory result) {\\n if (_zeroBytes(m)) return (false, new bytes(0));\\n\\n uint256 mLen = m.length;\\n\\n // Encode call args in result and move the free memory pointer\\n result = abi.encodePacked(b.length, e.length, mLen, b, e, m);\\n\\n assembly (\\\"memory-safe\\\") {\\n let dataPtr := add(result, 0x20)\\n // Write result on top of args to avoid allocating extra memory.\\n success := staticcall(gas(), 0x05, dataPtr, mload(result), dataPtr, mLen)\\n // Overwrite the length.\\n // result.length > returndatasize() is guaranteed because returndatasize() == m.length\\n mstore(result, mLen)\\n // Set the memory pointer after the returned data.\\n mstore(0x40, add(dataPtr, mLen))\\n }\\n }\\n\\n /**\\n * @dev Returns whether the provided byte array is zero.\\n */\\n function _zeroBytes(bytes memory byteArray) private pure returns (bool) {\\n for (uint256 i = 0; i < byteArray.length; ++i) {\\n if (byteArray[i] != 0) {\\n return false;\\n }\\n }\\n return true;\\n }\\n\\n /**\\n * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded\\n * towards zero.\\n *\\n * This method is based on Newton's method for computing square roots; the algorithm is restricted to only\\n * using integer operations.\\n */\\n function sqrt(uint256 a) internal pure returns (uint256) {\\n unchecked {\\n // Take care of easy edge cases when a == 0 or a == 1\\n if (a <= 1) {\\n return a;\\n }\\n\\n // In this function, we use Newton's method to get a root of `f(x) := x\\u00b2 - a`. It involves building a\\n // sequence x_n that converges toward sqrt(a). For each iteration x_n, we also define the error between\\n // the current value as `\\u03b5_n = | x_n - sqrt(a) |`.\\n //\\n // For our first estimation, we consider `e` the smallest power of 2 which is bigger than the square root\\n // of the target. (i.e. `2**(e-1) \\u2264 sqrt(a) < 2**e`). We know that `e \\u2264 128` because `(2\\u00b9\\u00b2\\u2078)\\u00b2 = 2\\u00b2\\u2075\\u2076` is\\n // bigger than any uint256.\\n //\\n // By noticing that\\n // `2**(e-1) \\u2264 sqrt(a) < 2**e \\u2192 (2**(e-1))\\u00b2 \\u2264 a < (2**e)\\u00b2 \\u2192 2**(2*e-2) \\u2264 a < 2**(2*e)`\\n // we can deduce that `e - 1` is `log2(a) / 2`. We can thus compute `x_n = 2**(e-1)` using a method similar\\n // to the msb function.\\n uint256 aa = a;\\n uint256 xn = 1;\\n\\n if (aa >= (1 << 128)) {\\n aa >>= 128;\\n xn <<= 64;\\n }\\n if (aa >= (1 << 64)) {\\n aa >>= 64;\\n xn <<= 32;\\n }\\n if (aa >= (1 << 32)) {\\n aa >>= 32;\\n xn <<= 16;\\n }\\n if (aa >= (1 << 16)) {\\n aa >>= 16;\\n xn <<= 8;\\n }\\n if (aa >= (1 << 8)) {\\n aa >>= 8;\\n xn <<= 4;\\n }\\n if (aa >= (1 << 4)) {\\n aa >>= 4;\\n xn <<= 2;\\n }\\n if (aa >= (1 << 2)) {\\n xn <<= 1;\\n }\\n\\n // We now have x_n such that `x_n = 2**(e-1) \\u2264 sqrt(a) < 2**e = 2 * x_n`. This implies \\u03b5_n \\u2264 2**(e-1).\\n //\\n // We can refine our estimation by noticing that the middle of that interval minimizes the error.\\n // If we move x_n to equal 2**(e-1) + 2**(e-2), then we reduce the error to \\u03b5_n \\u2264 2**(e-2).\\n // This is going to be our x_0 (and \\u03b5_0)\\n xn = (3 * xn) >> 1; // \\u03b5_0 := | x_0 - sqrt(a) | \\u2264 2**(e-2)\\n\\n // From here, Newton's method give us:\\n // x_{n+1} = (x_n + a / x_n) / 2\\n //\\n // One should note that:\\n // x_{n+1}\\u00b2 - a = ((x_n + a / x_n) / 2)\\u00b2 - a\\n // = ((x_n\\u00b2 + a) / (2 * x_n))\\u00b2 - a\\n // = (x_n\\u2074 + 2 * a * x_n\\u00b2 + a\\u00b2) / (4 * x_n\\u00b2) - a\\n // = (x_n\\u2074 + 2 * a * x_n\\u00b2 + a\\u00b2 - 4 * a * x_n\\u00b2) / (4 * x_n\\u00b2)\\n // = (x_n\\u2074 - 2 * a * x_n\\u00b2 + a\\u00b2) / (4 * x_n\\u00b2)\\n // = (x_n\\u00b2 - a)\\u00b2 / (2 * x_n)\\u00b2\\n // = ((x_n\\u00b2 - a) / (2 * x_n))\\u00b2\\n // \\u2265 0\\n // Which proves that for all n \\u2265 1, sqrt(a) \\u2264 x_n\\n //\\n // This gives us the proof of quadratic convergence of the sequence:\\n // \\u03b5_{n+1} = | x_{n+1} - sqrt(a) |\\n // = | (x_n + a / x_n) / 2 - sqrt(a) |\\n // = | (x_n\\u00b2 + a - 2*x_n*sqrt(a)) / (2 * x_n) |\\n // = | (x_n - sqrt(a))\\u00b2 / (2 * x_n) |\\n // = | \\u03b5_n\\u00b2 / (2 * x_n) |\\n // = \\u03b5_n\\u00b2 / | (2 * x_n) |\\n //\\n // For the first iteration, we have a special case where x_0 is known:\\n // \\u03b5_1 = \\u03b5_0\\u00b2 / | (2 * x_0) |\\n // \\u2264 (2**(e-2))\\u00b2 / (2 * (2**(e-1) + 2**(e-2)))\\n // \\u2264 2**(2*e-4) / (3 * 2**(e-1))\\n // \\u2264 2**(e-3) / 3\\n // \\u2264 2**(e-3-log2(3))\\n // \\u2264 2**(e-4.5)\\n //\\n // For the following iterations, we use the fact that, 2**(e-1) \\u2264 sqrt(a) \\u2264 x_n:\\n // \\u03b5_{n+1} = \\u03b5_n\\u00b2 / | (2 * x_n) |\\n // \\u2264 (2**(e-k))\\u00b2 / (2 * 2**(e-1))\\n // \\u2264 2**(2*e-2*k) / 2**e\\n // \\u2264 2**(e-2*k)\\n xn = (xn + a / xn) >> 1; // \\u03b5_1 := | x_1 - sqrt(a) | \\u2264 2**(e-4.5) -- special case, see above\\n xn = (xn + a / xn) >> 1; // \\u03b5_2 := | x_2 - sqrt(a) | \\u2264 2**(e-9) -- general case with k = 4.5\\n xn = (xn + a / xn) >> 1; // \\u03b5_3 := | x_3 - sqrt(a) | \\u2264 2**(e-18) -- general case with k = 9\\n xn = (xn + a / xn) >> 1; // \\u03b5_4 := | x_4 - sqrt(a) | \\u2264 2**(e-36) -- general case with k = 18\\n xn = (xn + a / xn) >> 1; // \\u03b5_5 := | x_5 - sqrt(a) | \\u2264 2**(e-72) -- general case with k = 36\\n xn = (xn + a / xn) >> 1; // \\u03b5_6 := | x_6 - sqrt(a) | \\u2264 2**(e-144) -- general case with k = 72\\n\\n // Because e \\u2264 128 (as discussed during the first estimation phase), we know have reached a precision\\n // \\u03b5_6 \\u2264 2**(e-144) < 1. Given we're operating on integers, then we can ensure that xn is now either\\n // sqrt(a) or sqrt(a) + 1.\\n return xn - SafeCast.toUint(xn > a / xn);\\n }\\n }\\n\\n /**\\n * @dev 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 + SafeCast.toUint(unsignedRoundsUp(rounding) && result * result < a);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 2 of a positive value rounded towards zero.\\n * Returns 0 if given 0.\\n */\\n function log2(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n uint256 exp;\\n unchecked {\\n exp = 128 * SafeCast.toUint(value > (1 << 128) - 1);\\n value >>= exp;\\n result += exp;\\n\\n exp = 64 * SafeCast.toUint(value > (1 << 64) - 1);\\n value >>= exp;\\n result += exp;\\n\\n exp = 32 * SafeCast.toUint(value > (1 << 32) - 1);\\n value >>= exp;\\n result += exp;\\n\\n exp = 16 * SafeCast.toUint(value > (1 << 16) - 1);\\n value >>= exp;\\n result += exp;\\n\\n exp = 8 * SafeCast.toUint(value > (1 << 8) - 1);\\n value >>= exp;\\n result += exp;\\n\\n exp = 4 * SafeCast.toUint(value > (1 << 4) - 1);\\n value >>= exp;\\n result += exp;\\n\\n exp = 2 * SafeCast.toUint(value > (1 << 2) - 1);\\n value >>= exp;\\n result += exp;\\n\\n result += SafeCast.toUint(value > 1);\\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 + SafeCast.toUint(unsignedRoundsUp(rounding) && 1 << result < value);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 10 of a positive value rounded towards zero.\\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 + SafeCast.toUint(unsignedRoundsUp(rounding) && 10 ** result < value);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 256 of a positive value rounded towards zero.\\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 uint256 isGt;\\n unchecked {\\n isGt = SafeCast.toUint(value > (1 << 128) - 1);\\n value >>= isGt * 128;\\n result += isGt * 16;\\n\\n isGt = SafeCast.toUint(value > (1 << 64) - 1);\\n value >>= isGt * 64;\\n result += isGt * 8;\\n\\n isGt = SafeCast.toUint(value > (1 << 32) - 1);\\n value >>= isGt * 32;\\n result += isGt * 4;\\n\\n isGt = SafeCast.toUint(value > (1 << 16) - 1);\\n value >>= isGt * 16;\\n result += isGt * 2;\\n\\n result += SafeCast.toUint(value > (1 << 8) - 1);\\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 + SafeCast.toUint(unsignedRoundsUp(rounding) && 1 << (result << 3) < value);\\n }\\n }\\n\\n /**\\n * @dev Returns whether a provided rounding mode is considered rounding up for unsigned integers.\\n */\\n function unsignedRoundsUp(Rounding rounding) internal pure returns (bool) {\\n return uint8(rounding) % 2 == 1;\\n }\\n}\\n\",\"keccak256\":\"0xa00be322d7db5786750ce0ac7e2f5b633ac30a5ed5fa1ced1e74acfc19acecea\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/math/SafeCast.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/math/SafeCast.sol)\\n// This file was procedurally generated from scripts/generate/templates/SafeCast.js.\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Wrappers over Solidity's uintXX/intXX/bool casting operators with added overflow\\n * checks.\\n *\\n * Downcasting from uint256/int256 in Solidity does not revert on overflow. This can\\n * easily result in undesired exploitation or bugs, since developers usually\\n * assume that overflows raise errors. `SafeCast` restores this intuition by\\n * reverting the transaction when such an operation overflows.\\n *\\n * Using this library instead of the unchecked operations eliminates an entire\\n * class of bugs, so it's recommended to use it always.\\n */\\nlibrary SafeCast {\\n /**\\n * @dev Value doesn't fit in an uint of `bits` size.\\n */\\n error SafeCastOverflowedUintDowncast(uint8 bits, uint256 value);\\n\\n /**\\n * @dev An int value doesn't fit in an uint of `bits` size.\\n */\\n error SafeCastOverflowedIntToUint(int256 value);\\n\\n /**\\n * @dev Value doesn't fit in an int of `bits` size.\\n */\\n error SafeCastOverflowedIntDowncast(uint8 bits, int256 value);\\n\\n /**\\n * @dev An uint value doesn't fit in an int of `bits` size.\\n */\\n error SafeCastOverflowedUintToInt(uint256 value);\\n\\n /**\\n * @dev Returns the downcasted uint248 from uint256, reverting on\\n * overflow (when the input is greater than largest uint248).\\n *\\n * Counterpart to Solidity's `uint248` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 248 bits\\n */\\n function toUint248(uint256 value) internal pure returns (uint248) {\\n if (value > type(uint248).max) {\\n revert SafeCastOverflowedUintDowncast(248, value);\\n }\\n return uint248(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint240 from uint256, reverting on\\n * overflow (when the input is greater than largest uint240).\\n *\\n * Counterpart to Solidity's `uint240` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 240 bits\\n */\\n function toUint240(uint256 value) internal pure returns (uint240) {\\n if (value > type(uint240).max) {\\n revert SafeCastOverflowedUintDowncast(240, value);\\n }\\n return uint240(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint232 from uint256, reverting on\\n * overflow (when the input is greater than largest uint232).\\n *\\n * Counterpart to Solidity's `uint232` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 232 bits\\n */\\n function toUint232(uint256 value) internal pure returns (uint232) {\\n if (value > type(uint232).max) {\\n revert SafeCastOverflowedUintDowncast(232, value);\\n }\\n return uint232(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint224 from uint256, reverting on\\n * overflow (when the input is greater than largest uint224).\\n *\\n * Counterpart to Solidity's `uint224` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 224 bits\\n */\\n function toUint224(uint256 value) internal pure returns (uint224) {\\n if (value > type(uint224).max) {\\n revert SafeCastOverflowedUintDowncast(224, value);\\n }\\n return uint224(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint216 from uint256, reverting on\\n * overflow (when the input is greater than largest uint216).\\n *\\n * Counterpart to Solidity's `uint216` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 216 bits\\n */\\n function toUint216(uint256 value) internal pure returns (uint216) {\\n if (value > type(uint216).max) {\\n revert SafeCastOverflowedUintDowncast(216, value);\\n }\\n return uint216(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint208 from uint256, reverting on\\n * overflow (when the input is greater than largest uint208).\\n *\\n * Counterpart to Solidity's `uint208` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 208 bits\\n */\\n function toUint208(uint256 value) internal pure returns (uint208) {\\n if (value > type(uint208).max) {\\n revert SafeCastOverflowedUintDowncast(208, value);\\n }\\n return uint208(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint200 from uint256, reverting on\\n * overflow (when the input is greater than largest uint200).\\n *\\n * Counterpart to Solidity's `uint200` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 200 bits\\n */\\n function toUint200(uint256 value) internal pure returns (uint200) {\\n if (value > type(uint200).max) {\\n revert SafeCastOverflowedUintDowncast(200, value);\\n }\\n return uint200(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint192 from uint256, reverting on\\n * overflow (when the input is greater than largest uint192).\\n *\\n * Counterpart to Solidity's `uint192` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 192 bits\\n */\\n function toUint192(uint256 value) internal pure returns (uint192) {\\n if (value > type(uint192).max) {\\n revert SafeCastOverflowedUintDowncast(192, value);\\n }\\n return uint192(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint184 from uint256, reverting on\\n * overflow (when the input is greater than largest uint184).\\n *\\n * Counterpart to Solidity's `uint184` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 184 bits\\n */\\n function toUint184(uint256 value) internal pure returns (uint184) {\\n if (value > type(uint184).max) {\\n revert SafeCastOverflowedUintDowncast(184, value);\\n }\\n return uint184(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint176 from uint256, reverting on\\n * overflow (when the input is greater than largest uint176).\\n *\\n * Counterpart to Solidity's `uint176` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 176 bits\\n */\\n function toUint176(uint256 value) internal pure returns (uint176) {\\n if (value > type(uint176).max) {\\n revert SafeCastOverflowedUintDowncast(176, value);\\n }\\n return uint176(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint168 from uint256, reverting on\\n * overflow (when the input is greater than largest uint168).\\n *\\n * Counterpart to Solidity's `uint168` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 168 bits\\n */\\n function toUint168(uint256 value) internal pure returns (uint168) {\\n if (value > type(uint168).max) {\\n revert SafeCastOverflowedUintDowncast(168, value);\\n }\\n return uint168(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint160 from uint256, reverting on\\n * overflow (when the input is greater than largest uint160).\\n *\\n * Counterpart to Solidity's `uint160` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 160 bits\\n */\\n function toUint160(uint256 value) internal pure returns (uint160) {\\n if (value > type(uint160).max) {\\n revert SafeCastOverflowedUintDowncast(160, value);\\n }\\n return uint160(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint152 from uint256, reverting on\\n * overflow (when the input is greater than largest uint152).\\n *\\n * Counterpart to Solidity's `uint152` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 152 bits\\n */\\n function toUint152(uint256 value) internal pure returns (uint152) {\\n if (value > type(uint152).max) {\\n revert SafeCastOverflowedUintDowncast(152, value);\\n }\\n return uint152(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint144 from uint256, reverting on\\n * overflow (when the input is greater than largest uint144).\\n *\\n * Counterpart to Solidity's `uint144` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 144 bits\\n */\\n function toUint144(uint256 value) internal pure returns (uint144) {\\n if (value > type(uint144).max) {\\n revert SafeCastOverflowedUintDowncast(144, value);\\n }\\n return uint144(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint136 from uint256, reverting on\\n * overflow (when the input is greater than largest uint136).\\n *\\n * Counterpart to Solidity's `uint136` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 136 bits\\n */\\n function toUint136(uint256 value) internal pure returns (uint136) {\\n if (value > type(uint136).max) {\\n revert SafeCastOverflowedUintDowncast(136, value);\\n }\\n return uint136(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint128 from uint256, reverting on\\n * overflow (when the input is greater than largest uint128).\\n *\\n * Counterpart to Solidity's `uint128` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 128 bits\\n */\\n function toUint128(uint256 value) internal pure returns (uint128) {\\n if (value > type(uint128).max) {\\n revert SafeCastOverflowedUintDowncast(128, value);\\n }\\n return uint128(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint120 from uint256, reverting on\\n * overflow (when the input is greater than largest uint120).\\n *\\n * Counterpart to Solidity's `uint120` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 120 bits\\n */\\n function toUint120(uint256 value) internal pure returns (uint120) {\\n if (value > type(uint120).max) {\\n revert SafeCastOverflowedUintDowncast(120, value);\\n }\\n return uint120(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint112 from uint256, reverting on\\n * overflow (when the input is greater than largest uint112).\\n *\\n * Counterpart to Solidity's `uint112` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 112 bits\\n */\\n function toUint112(uint256 value) internal pure returns (uint112) {\\n if (value > type(uint112).max) {\\n revert SafeCastOverflowedUintDowncast(112, value);\\n }\\n return uint112(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint104 from uint256, reverting on\\n * overflow (when the input is greater than largest uint104).\\n *\\n * Counterpart to Solidity's `uint104` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 104 bits\\n */\\n function toUint104(uint256 value) internal pure returns (uint104) {\\n if (value > type(uint104).max) {\\n revert SafeCastOverflowedUintDowncast(104, value);\\n }\\n return uint104(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint96 from uint256, reverting on\\n * overflow (when the input is greater than largest uint96).\\n *\\n * Counterpart to Solidity's `uint96` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 96 bits\\n */\\n function toUint96(uint256 value) internal pure returns (uint96) {\\n if (value > type(uint96).max) {\\n revert SafeCastOverflowedUintDowncast(96, value);\\n }\\n return uint96(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint88 from uint256, reverting on\\n * overflow (when the input is greater than largest uint88).\\n *\\n * Counterpart to Solidity's `uint88` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 88 bits\\n */\\n function toUint88(uint256 value) internal pure returns (uint88) {\\n if (value > type(uint88).max) {\\n revert SafeCastOverflowedUintDowncast(88, value);\\n }\\n return uint88(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint80 from uint256, reverting on\\n * overflow (when the input is greater than largest uint80).\\n *\\n * Counterpart to Solidity's `uint80` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 80 bits\\n */\\n function toUint80(uint256 value) internal pure returns (uint80) {\\n if (value > type(uint80).max) {\\n revert SafeCastOverflowedUintDowncast(80, value);\\n }\\n return uint80(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint72 from uint256, reverting on\\n * overflow (when the input is greater than largest uint72).\\n *\\n * Counterpart to Solidity's `uint72` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 72 bits\\n */\\n function toUint72(uint256 value) internal pure returns (uint72) {\\n if (value > type(uint72).max) {\\n revert SafeCastOverflowedUintDowncast(72, value);\\n }\\n return uint72(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint64 from uint256, reverting on\\n * overflow (when the input is greater than largest uint64).\\n *\\n * Counterpart to Solidity's `uint64` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 64 bits\\n */\\n function toUint64(uint256 value) internal pure returns (uint64) {\\n if (value > type(uint64).max) {\\n revert SafeCastOverflowedUintDowncast(64, value);\\n }\\n return uint64(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint56 from uint256, reverting on\\n * overflow (when the input is greater than largest uint56).\\n *\\n * Counterpart to Solidity's `uint56` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 56 bits\\n */\\n function toUint56(uint256 value) internal pure returns (uint56) {\\n if (value > type(uint56).max) {\\n revert SafeCastOverflowedUintDowncast(56, value);\\n }\\n return uint56(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint48 from uint256, reverting on\\n * overflow (when the input is greater than largest uint48).\\n *\\n * Counterpart to Solidity's `uint48` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 48 bits\\n */\\n function toUint48(uint256 value) internal pure returns (uint48) {\\n if (value > type(uint48).max) {\\n revert SafeCastOverflowedUintDowncast(48, value);\\n }\\n return uint48(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint40 from uint256, reverting on\\n * overflow (when the input is greater than largest uint40).\\n *\\n * Counterpart to Solidity's `uint40` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 40 bits\\n */\\n function toUint40(uint256 value) internal pure returns (uint40) {\\n if (value > type(uint40).max) {\\n revert SafeCastOverflowedUintDowncast(40, value);\\n }\\n return uint40(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint32 from uint256, reverting on\\n * overflow (when the input is greater than largest uint32).\\n *\\n * Counterpart to Solidity's `uint32` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 32 bits\\n */\\n function toUint32(uint256 value) internal pure returns (uint32) {\\n if (value > type(uint32).max) {\\n revert SafeCastOverflowedUintDowncast(32, value);\\n }\\n return uint32(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint24 from uint256, reverting on\\n * overflow (when the input is greater than largest uint24).\\n *\\n * Counterpart to Solidity's `uint24` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 24 bits\\n */\\n function toUint24(uint256 value) internal pure returns (uint24) {\\n if (value > type(uint24).max) {\\n revert SafeCastOverflowedUintDowncast(24, value);\\n }\\n return uint24(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint16 from uint256, reverting on\\n * overflow (when the input is greater than largest uint16).\\n *\\n * Counterpart to Solidity's `uint16` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 16 bits\\n */\\n function toUint16(uint256 value) internal pure returns (uint16) {\\n if (value > type(uint16).max) {\\n revert SafeCastOverflowedUintDowncast(16, value);\\n }\\n return uint16(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint8 from uint256, reverting on\\n * overflow (when the input is greater than largest uint8).\\n *\\n * Counterpart to Solidity's `uint8` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 8 bits\\n */\\n function toUint8(uint256 value) internal pure returns (uint8) {\\n if (value > type(uint8).max) {\\n revert SafeCastOverflowedUintDowncast(8, value);\\n }\\n return uint8(value);\\n }\\n\\n /**\\n * @dev Converts a signed int256 into an unsigned uint256.\\n *\\n * Requirements:\\n *\\n * - input must be greater than or equal to 0.\\n */\\n function toUint256(int256 value) internal pure returns (uint256) {\\n if (value < 0) {\\n revert SafeCastOverflowedIntToUint(value);\\n }\\n return uint256(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted int248 from int256, reverting on\\n * overflow (when the input is less than smallest int248 or\\n * greater than largest int248).\\n *\\n * Counterpart to Solidity's `int248` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 248 bits\\n */\\n function toInt248(int256 value) internal pure returns (int248 downcasted) {\\n downcasted = int248(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(248, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int240 from int256, reverting on\\n * overflow (when the input is less than smallest int240 or\\n * greater than largest int240).\\n *\\n * Counterpart to Solidity's `int240` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 240 bits\\n */\\n function toInt240(int256 value) internal pure returns (int240 downcasted) {\\n downcasted = int240(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(240, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int232 from int256, reverting on\\n * overflow (when the input is less than smallest int232 or\\n * greater than largest int232).\\n *\\n * Counterpart to Solidity's `int232` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 232 bits\\n */\\n function toInt232(int256 value) internal pure returns (int232 downcasted) {\\n downcasted = int232(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(232, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int224 from int256, reverting on\\n * overflow (when the input is less than smallest int224 or\\n * greater than largest int224).\\n *\\n * Counterpart to Solidity's `int224` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 224 bits\\n */\\n function toInt224(int256 value) internal pure returns (int224 downcasted) {\\n downcasted = int224(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(224, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int216 from int256, reverting on\\n * overflow (when the input is less than smallest int216 or\\n * greater than largest int216).\\n *\\n * Counterpart to Solidity's `int216` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 216 bits\\n */\\n function toInt216(int256 value) internal pure returns (int216 downcasted) {\\n downcasted = int216(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(216, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int208 from int256, reverting on\\n * overflow (when the input is less than smallest int208 or\\n * greater than largest int208).\\n *\\n * Counterpart to Solidity's `int208` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 208 bits\\n */\\n function toInt208(int256 value) internal pure returns (int208 downcasted) {\\n downcasted = int208(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(208, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int200 from int256, reverting on\\n * overflow (when the input is less than smallest int200 or\\n * greater than largest int200).\\n *\\n * Counterpart to Solidity's `int200` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 200 bits\\n */\\n function toInt200(int256 value) internal pure returns (int200 downcasted) {\\n downcasted = int200(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(200, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int192 from int256, reverting on\\n * overflow (when the input is less than smallest int192 or\\n * greater than largest int192).\\n *\\n * Counterpart to Solidity's `int192` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 192 bits\\n */\\n function toInt192(int256 value) internal pure returns (int192 downcasted) {\\n downcasted = int192(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(192, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int184 from int256, reverting on\\n * overflow (when the input is less than smallest int184 or\\n * greater than largest int184).\\n *\\n * Counterpart to Solidity's `int184` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 184 bits\\n */\\n function toInt184(int256 value) internal pure returns (int184 downcasted) {\\n downcasted = int184(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(184, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int176 from int256, reverting on\\n * overflow (when the input is less than smallest int176 or\\n * greater than largest int176).\\n *\\n * Counterpart to Solidity's `int176` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 176 bits\\n */\\n function toInt176(int256 value) internal pure returns (int176 downcasted) {\\n downcasted = int176(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(176, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int168 from int256, reverting on\\n * overflow (when the input is less than smallest int168 or\\n * greater than largest int168).\\n *\\n * Counterpart to Solidity's `int168` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 168 bits\\n */\\n function toInt168(int256 value) internal pure returns (int168 downcasted) {\\n downcasted = int168(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(168, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int160 from int256, reverting on\\n * overflow (when the input is less than smallest int160 or\\n * greater than largest int160).\\n *\\n * Counterpart to Solidity's `int160` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 160 bits\\n */\\n function toInt160(int256 value) internal pure returns (int160 downcasted) {\\n downcasted = int160(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(160, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int152 from int256, reverting on\\n * overflow (when the input is less than smallest int152 or\\n * greater than largest int152).\\n *\\n * Counterpart to Solidity's `int152` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 152 bits\\n */\\n function toInt152(int256 value) internal pure returns (int152 downcasted) {\\n downcasted = int152(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(152, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int144 from int256, reverting on\\n * overflow (when the input is less than smallest int144 or\\n * greater than largest int144).\\n *\\n * Counterpart to Solidity's `int144` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 144 bits\\n */\\n function toInt144(int256 value) internal pure returns (int144 downcasted) {\\n downcasted = int144(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(144, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int136 from int256, reverting on\\n * overflow (when the input is less than smallest int136 or\\n * greater than largest int136).\\n *\\n * Counterpart to Solidity's `int136` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 136 bits\\n */\\n function toInt136(int256 value) internal pure returns (int136 downcasted) {\\n downcasted = int136(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(136, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int128 from int256, reverting on\\n * overflow (when the input is less than smallest int128 or\\n * greater than largest int128).\\n *\\n * Counterpart to Solidity's `int128` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 128 bits\\n */\\n function toInt128(int256 value) internal pure returns (int128 downcasted) {\\n downcasted = int128(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(128, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int120 from int256, reverting on\\n * overflow (when the input is less than smallest int120 or\\n * greater than largest int120).\\n *\\n * Counterpart to Solidity's `int120` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 120 bits\\n */\\n function toInt120(int256 value) internal pure returns (int120 downcasted) {\\n downcasted = int120(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(120, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int112 from int256, reverting on\\n * overflow (when the input is less than smallest int112 or\\n * greater than largest int112).\\n *\\n * Counterpart to Solidity's `int112` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 112 bits\\n */\\n function toInt112(int256 value) internal pure returns (int112 downcasted) {\\n downcasted = int112(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(112, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int104 from int256, reverting on\\n * overflow (when the input is less than smallest int104 or\\n * greater than largest int104).\\n *\\n * Counterpart to Solidity's `int104` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 104 bits\\n */\\n function toInt104(int256 value) internal pure returns (int104 downcasted) {\\n downcasted = int104(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(104, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int96 from int256, reverting on\\n * overflow (when the input is less than smallest int96 or\\n * greater than largest int96).\\n *\\n * Counterpart to Solidity's `int96` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 96 bits\\n */\\n function toInt96(int256 value) internal pure returns (int96 downcasted) {\\n downcasted = int96(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(96, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int88 from int256, reverting on\\n * overflow (when the input is less than smallest int88 or\\n * greater than largest int88).\\n *\\n * Counterpart to Solidity's `int88` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 88 bits\\n */\\n function toInt88(int256 value) internal pure returns (int88 downcasted) {\\n downcasted = int88(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(88, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int80 from int256, reverting on\\n * overflow (when the input is less than smallest int80 or\\n * greater than largest int80).\\n *\\n * Counterpart to Solidity's `int80` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 80 bits\\n */\\n function toInt80(int256 value) internal pure returns (int80 downcasted) {\\n downcasted = int80(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(80, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int72 from int256, reverting on\\n * overflow (when the input is less than smallest int72 or\\n * greater than largest int72).\\n *\\n * Counterpart to Solidity's `int72` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 72 bits\\n */\\n function toInt72(int256 value) internal pure returns (int72 downcasted) {\\n downcasted = int72(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(72, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int64 from int256, reverting on\\n * overflow (when the input is less than smallest int64 or\\n * greater than largest int64).\\n *\\n * Counterpart to Solidity's `int64` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 64 bits\\n */\\n function toInt64(int256 value) internal pure returns (int64 downcasted) {\\n downcasted = int64(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(64, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int56 from int256, reverting on\\n * overflow (when the input is less than smallest int56 or\\n * greater than largest int56).\\n *\\n * Counterpart to Solidity's `int56` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 56 bits\\n */\\n function toInt56(int256 value) internal pure returns (int56 downcasted) {\\n downcasted = int56(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(56, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int48 from int256, reverting on\\n * overflow (when the input is less than smallest int48 or\\n * greater than largest int48).\\n *\\n * Counterpart to Solidity's `int48` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 48 bits\\n */\\n function toInt48(int256 value) internal pure returns (int48 downcasted) {\\n downcasted = int48(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(48, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int40 from int256, reverting on\\n * overflow (when the input is less than smallest int40 or\\n * greater than largest int40).\\n *\\n * Counterpart to Solidity's `int40` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 40 bits\\n */\\n function toInt40(int256 value) internal pure returns (int40 downcasted) {\\n downcasted = int40(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(40, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int32 from int256, reverting on\\n * overflow (when the input is less than smallest int32 or\\n * greater than largest int32).\\n *\\n * Counterpart to Solidity's `int32` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 32 bits\\n */\\n function toInt32(int256 value) internal pure returns (int32 downcasted) {\\n downcasted = int32(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(32, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int24 from int256, reverting on\\n * overflow (when the input is less than smallest int24 or\\n * greater than largest int24).\\n *\\n * Counterpart to Solidity's `int24` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 24 bits\\n */\\n function toInt24(int256 value) internal pure returns (int24 downcasted) {\\n downcasted = int24(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(24, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int16 from int256, reverting on\\n * overflow (when the input is less than smallest int16 or\\n * greater than largest int16).\\n *\\n * Counterpart to Solidity's `int16` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 16 bits\\n */\\n function toInt16(int256 value) internal pure returns (int16 downcasted) {\\n downcasted = int16(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(16, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int8 from int256, reverting on\\n * overflow (when the input is less than smallest int8 or\\n * greater than largest int8).\\n *\\n * Counterpart to Solidity's `int8` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 8 bits\\n */\\n function toInt8(int256 value) internal pure returns (int8 downcasted) {\\n downcasted = int8(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(8, value);\\n }\\n }\\n\\n /**\\n * @dev Converts an unsigned uint256 into a signed int256.\\n *\\n * Requirements:\\n *\\n * - input must be less than or equal to maxInt256.\\n */\\n function toInt256(uint256 value) internal pure returns (int256) {\\n // Note: Unsafe cast below is okay because `type(int256).max` is guaranteed to be positive\\n if (value > uint256(type(int256).max)) {\\n revert SafeCastOverflowedUintToInt(value);\\n }\\n return int256(value);\\n }\\n\\n /**\\n * @dev Cast a boolean (false or true) to a uint256 (0 or 1) with no jump.\\n */\\n function toUint(bool b) internal pure returns (uint256 u) {\\n assembly (\\\"memory-safe\\\") {\\n u := iszero(iszero(b))\\n }\\n }\\n}\\n\",\"keccak256\":\"0x195533c86d0ef72bcc06456a4f66a9b941f38eb403739b00f21fd7c1abd1ae54\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/math/SignedMath.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/math/SignedMath.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {SafeCast} from \\\"./SafeCast.sol\\\";\\n\\n/**\\n * @dev Standard signed math utilities missing in the Solidity language.\\n */\\nlibrary SignedMath {\\n /**\\n * @dev Branchless ternary evaluation for `a ? b : c`. Gas costs are constant.\\n *\\n * IMPORTANT: This function may reduce bytecode size and consume less gas when used standalone.\\n * However, the compiler may optimize Solidity ternary operations (i.e. `a ? b : c`) to only compute\\n * one branch when needed, making this function more expensive.\\n */\\n function ternary(bool condition, int256 a, int256 b) internal pure returns (int256) {\\n unchecked {\\n // branchless ternary works because:\\n // b ^ (a ^ b) == a\\n // b ^ 0 == b\\n return b ^ ((a ^ b) * int256(SafeCast.toUint(condition)));\\n }\\n }\\n\\n /**\\n * @dev Returns the largest of two signed numbers.\\n */\\n function max(int256 a, int256 b) internal pure returns (int256) {\\n return ternary(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 ternary(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 // Formula from the \\\"Bit Twiddling Hacks\\\" by Sean Eron Anderson.\\n // Since `n` is a signed integer, the generated bytecode will use the SAR opcode to perform the right shift,\\n // taking advantage of the most significant (or \\\"sign\\\" bit) in two's complement representation.\\n // This opcode adds new most significant bits set to the value of the previous most significant bit. As a result,\\n // the mask will either be `bytes32(0)` (if n is positive) or `~bytes32(0)` (if n is negative).\\n int256 mask = n >> 255;\\n\\n // A `bytes32(0)` mask leaves the input unchanged, while a `~bytes32(0)` mask complements it.\\n return uint256((n + mask) ^ mask);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xb1970fac7b64e6c09611e6691791e848d5e3fe410fa5899e7df2e0afd77a99e3\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/structs/Checkpoints.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/structs/Checkpoints.sol)\\n// This file was procedurally generated from scripts/generate/templates/Checkpoints.js.\\n\\npragma solidity ^0.8.20;\\n\\nimport {Math} from \\\"../math/Math.sol\\\";\\n\\n/**\\n * @dev This library defines the `Trace*` struct, for checkpointing values as they change at different points in\\n * time, and later looking up past values by block number. See {Votes} as an example.\\n *\\n * To create a history of checkpoints define a variable type `Checkpoints.Trace*` in your contract, and store a new\\n * checkpoint for the current transaction block using the {push} function.\\n */\\nlibrary Checkpoints {\\n /**\\n * @dev A value was attempted to be inserted on a past checkpoint.\\n */\\n error CheckpointUnorderedInsertion();\\n\\n struct Trace224 {\\n Checkpoint224[] _checkpoints;\\n }\\n\\n struct Checkpoint224 {\\n uint32 _key;\\n uint224 _value;\\n }\\n\\n /**\\n * @dev Pushes a (`key`, `value`) pair into a Trace224 so that it is stored as the checkpoint.\\n *\\n * Returns previous value and new value.\\n *\\n * IMPORTANT: Never accept `key` as a user input, since an arbitrary `type(uint32).max` key set will disable the\\n * library.\\n */\\n function push(\\n Trace224 storage self,\\n uint32 key,\\n uint224 value\\n ) internal returns (uint224 oldValue, uint224 newValue) {\\n return _insert(self._checkpoints, key, value);\\n }\\n\\n /**\\n * @dev Returns the value in the first (oldest) checkpoint with key greater or equal than the search key, or zero if\\n * there is none.\\n */\\n function lowerLookup(Trace224 storage self, uint32 key) internal view returns (uint224) {\\n uint256 len = self._checkpoints.length;\\n uint256 pos = _lowerBinaryLookup(self._checkpoints, key, 0, len);\\n return pos == len ? 0 : _unsafeAccess(self._checkpoints, pos)._value;\\n }\\n\\n /**\\n * @dev Returns the value in the last (most recent) checkpoint with key lower or equal than the search key, or zero\\n * if there is none.\\n */\\n function upperLookup(Trace224 storage self, uint32 key) internal view returns (uint224) {\\n uint256 len = self._checkpoints.length;\\n uint256 pos = _upperBinaryLookup(self._checkpoints, key, 0, len);\\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\\n }\\n\\n /**\\n * @dev Returns the value in the last (most recent) checkpoint with key lower or equal than the search key, or zero\\n * if there is none.\\n *\\n * NOTE: This is a variant of {upperLookup} that is optimised to find \\\"recent\\\" checkpoint (checkpoints with high\\n * keys).\\n */\\n function upperLookupRecent(Trace224 storage self, uint32 key) internal view returns (uint224) {\\n uint256 len = self._checkpoints.length;\\n\\n uint256 low = 0;\\n uint256 high = len;\\n\\n if (len > 5) {\\n uint256 mid = len - Math.sqrt(len);\\n if (key < _unsafeAccess(self._checkpoints, mid)._key) {\\n high = mid;\\n } else {\\n low = mid + 1;\\n }\\n }\\n\\n uint256 pos = _upperBinaryLookup(self._checkpoints, key, low, high);\\n\\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\\n }\\n\\n /**\\n * @dev Returns the value in the most recent checkpoint, or zero if there are no checkpoints.\\n */\\n function latest(Trace224 storage self) internal view returns (uint224) {\\n uint256 pos = self._checkpoints.length;\\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\\n }\\n\\n /**\\n * @dev Returns whether there is a checkpoint in the structure (i.e. it is not empty), and if so the key and value\\n * in the most recent checkpoint.\\n */\\n function latestCheckpoint(Trace224 storage self) internal view returns (bool exists, uint32 _key, uint224 _value) {\\n uint256 pos = self._checkpoints.length;\\n if (pos == 0) {\\n return (false, 0, 0);\\n } else {\\n Checkpoint224 storage ckpt = _unsafeAccess(self._checkpoints, pos - 1);\\n return (true, ckpt._key, ckpt._value);\\n }\\n }\\n\\n /**\\n * @dev Returns the number of checkpoint.\\n */\\n function length(Trace224 storage self) internal view returns (uint256) {\\n return self._checkpoints.length;\\n }\\n\\n /**\\n * @dev Returns checkpoint at given position.\\n */\\n function at(Trace224 storage self, uint32 pos) internal view returns (Checkpoint224 memory) {\\n return self._checkpoints[pos];\\n }\\n\\n /**\\n * @dev Pushes a (`key`, `value`) pair into an ordered list of checkpoints, either by inserting a new checkpoint,\\n * or by updating the last one.\\n */\\n function _insert(\\n Checkpoint224[] storage self,\\n uint32 key,\\n uint224 value\\n ) private returns (uint224 oldValue, uint224 newValue) {\\n uint256 pos = self.length;\\n\\n if (pos > 0) {\\n Checkpoint224 storage last = _unsafeAccess(self, pos - 1);\\n uint32 lastKey = last._key;\\n uint224 lastValue = last._value;\\n\\n // Checkpoint keys must be non-decreasing.\\n if (lastKey > key) {\\n revert CheckpointUnorderedInsertion();\\n }\\n\\n // Update or push new checkpoint\\n if (lastKey == key) {\\n last._value = value;\\n } else {\\n self.push(Checkpoint224({_key: key, _value: value}));\\n }\\n return (lastValue, value);\\n } else {\\n self.push(Checkpoint224({_key: key, _value: value}));\\n return (0, value);\\n }\\n }\\n\\n /**\\n * @dev Return the index of the first (oldest) checkpoint with key strictly bigger than the search key, or `high`\\n * if there is none. `low` and `high` define a section where to do the search, with inclusive `low` and exclusive\\n * `high`.\\n *\\n * WARNING: `high` should not be greater than the array's length.\\n */\\n function _upperBinaryLookup(\\n Checkpoint224[] storage self,\\n uint32 key,\\n uint256 low,\\n uint256 high\\n ) private view returns (uint256) {\\n while (low < high) {\\n uint256 mid = Math.average(low, high);\\n if (_unsafeAccess(self, mid)._key > key) {\\n high = mid;\\n } else {\\n low = mid + 1;\\n }\\n }\\n return high;\\n }\\n\\n /**\\n * @dev Return the index of the first (oldest) checkpoint with key greater or equal than the search key, or `high`\\n * if there is none. `low` and `high` define a section where to do the search, with inclusive `low` and exclusive\\n * `high`.\\n *\\n * WARNING: `high` should not be greater than the array's length.\\n */\\n function _lowerBinaryLookup(\\n Checkpoint224[] storage self,\\n uint32 key,\\n uint256 low,\\n uint256 high\\n ) private view returns (uint256) {\\n while (low < high) {\\n uint256 mid = Math.average(low, high);\\n if (_unsafeAccess(self, mid)._key < key) {\\n low = mid + 1;\\n } else {\\n high = mid;\\n }\\n }\\n return high;\\n }\\n\\n /**\\n * @dev Access an element of the array without performing bounds check. The position is assumed to be within bounds.\\n */\\n function _unsafeAccess(\\n Checkpoint224[] storage self,\\n uint256 pos\\n ) private pure returns (Checkpoint224 storage result) {\\n assembly {\\n mstore(0, self.slot)\\n result.slot := add(keccak256(0, 0x20), pos)\\n }\\n }\\n\\n struct Trace208 {\\n Checkpoint208[] _checkpoints;\\n }\\n\\n struct Checkpoint208 {\\n uint48 _key;\\n uint208 _value;\\n }\\n\\n /**\\n * @dev Pushes a (`key`, `value`) pair into a Trace208 so that it is stored as the checkpoint.\\n *\\n * Returns previous value and new value.\\n *\\n * IMPORTANT: Never accept `key` as a user input, since an arbitrary `type(uint48).max` key set will disable the\\n * library.\\n */\\n function push(\\n Trace208 storage self,\\n uint48 key,\\n uint208 value\\n ) internal returns (uint208 oldValue, uint208 newValue) {\\n return _insert(self._checkpoints, key, value);\\n }\\n\\n /**\\n * @dev Returns the value in the first (oldest) checkpoint with key greater or equal than the search key, or zero if\\n * there is none.\\n */\\n function lowerLookup(Trace208 storage self, uint48 key) internal view returns (uint208) {\\n uint256 len = self._checkpoints.length;\\n uint256 pos = _lowerBinaryLookup(self._checkpoints, key, 0, len);\\n return pos == len ? 0 : _unsafeAccess(self._checkpoints, pos)._value;\\n }\\n\\n /**\\n * @dev Returns the value in the last (most recent) checkpoint with key lower or equal than the search key, or zero\\n * if there is none.\\n */\\n function upperLookup(Trace208 storage self, uint48 key) internal view returns (uint208) {\\n uint256 len = self._checkpoints.length;\\n uint256 pos = _upperBinaryLookup(self._checkpoints, key, 0, len);\\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\\n }\\n\\n /**\\n * @dev Returns the value in the last (most recent) checkpoint with key lower or equal than the search key, or zero\\n * if there is none.\\n *\\n * NOTE: This is a variant of {upperLookup} that is optimised to find \\\"recent\\\" checkpoint (checkpoints with high\\n * keys).\\n */\\n function upperLookupRecent(Trace208 storage self, uint48 key) internal view returns (uint208) {\\n uint256 len = self._checkpoints.length;\\n\\n uint256 low = 0;\\n uint256 high = len;\\n\\n if (len > 5) {\\n uint256 mid = len - Math.sqrt(len);\\n if (key < _unsafeAccess(self._checkpoints, mid)._key) {\\n high = mid;\\n } else {\\n low = mid + 1;\\n }\\n }\\n\\n uint256 pos = _upperBinaryLookup(self._checkpoints, key, low, high);\\n\\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\\n }\\n\\n /**\\n * @dev Returns the value in the most recent checkpoint, or zero if there are no checkpoints.\\n */\\n function latest(Trace208 storage self) internal view returns (uint208) {\\n uint256 pos = self._checkpoints.length;\\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\\n }\\n\\n /**\\n * @dev Returns whether there is a checkpoint in the structure (i.e. it is not empty), and if so the key and value\\n * in the most recent checkpoint.\\n */\\n function latestCheckpoint(Trace208 storage self) internal view returns (bool exists, uint48 _key, uint208 _value) {\\n uint256 pos = self._checkpoints.length;\\n if (pos == 0) {\\n return (false, 0, 0);\\n } else {\\n Checkpoint208 storage ckpt = _unsafeAccess(self._checkpoints, pos - 1);\\n return (true, ckpt._key, ckpt._value);\\n }\\n }\\n\\n /**\\n * @dev Returns the number of checkpoint.\\n */\\n function length(Trace208 storage self) internal view returns (uint256) {\\n return self._checkpoints.length;\\n }\\n\\n /**\\n * @dev Returns checkpoint at given position.\\n */\\n function at(Trace208 storage self, uint32 pos) internal view returns (Checkpoint208 memory) {\\n return self._checkpoints[pos];\\n }\\n\\n /**\\n * @dev Pushes a (`key`, `value`) pair into an ordered list of checkpoints, either by inserting a new checkpoint,\\n * or by updating the last one.\\n */\\n function _insert(\\n Checkpoint208[] storage self,\\n uint48 key,\\n uint208 value\\n ) private returns (uint208 oldValue, uint208 newValue) {\\n uint256 pos = self.length;\\n\\n if (pos > 0) {\\n Checkpoint208 storage last = _unsafeAccess(self, pos - 1);\\n uint48 lastKey = last._key;\\n uint208 lastValue = last._value;\\n\\n // Checkpoint keys must be non-decreasing.\\n if (lastKey > key) {\\n revert CheckpointUnorderedInsertion();\\n }\\n\\n // Update or push new checkpoint\\n if (lastKey == key) {\\n last._value = value;\\n } else {\\n self.push(Checkpoint208({_key: key, _value: value}));\\n }\\n return (lastValue, value);\\n } else {\\n self.push(Checkpoint208({_key: key, _value: value}));\\n return (0, value);\\n }\\n }\\n\\n /**\\n * @dev Return the index of the first (oldest) checkpoint with key strictly bigger than the search key, or `high`\\n * if there is none. `low` and `high` define a section where to do the search, with inclusive `low` and exclusive\\n * `high`.\\n *\\n * WARNING: `high` should not be greater than the array's length.\\n */\\n function _upperBinaryLookup(\\n Checkpoint208[] storage self,\\n uint48 key,\\n uint256 low,\\n uint256 high\\n ) private view returns (uint256) {\\n while (low < high) {\\n uint256 mid = Math.average(low, high);\\n if (_unsafeAccess(self, mid)._key > key) {\\n high = mid;\\n } else {\\n low = mid + 1;\\n }\\n }\\n return high;\\n }\\n\\n /**\\n * @dev Return the index of the first (oldest) checkpoint with key greater or equal than the search key, or `high`\\n * if there is none. `low` and `high` define a section where to do the search, with inclusive `low` and exclusive\\n * `high`.\\n *\\n * WARNING: `high` should not be greater than the array's length.\\n */\\n function _lowerBinaryLookup(\\n Checkpoint208[] storage self,\\n uint48 key,\\n uint256 low,\\n uint256 high\\n ) private view returns (uint256) {\\n while (low < high) {\\n uint256 mid = Math.average(low, high);\\n if (_unsafeAccess(self, mid)._key < key) {\\n low = mid + 1;\\n } else {\\n high = mid;\\n }\\n }\\n return high;\\n }\\n\\n /**\\n * @dev Access an element of the array without performing bounds check. The position is assumed to be within bounds.\\n */\\n function _unsafeAccess(\\n Checkpoint208[] storage self,\\n uint256 pos\\n ) private pure returns (Checkpoint208 storage result) {\\n assembly {\\n mstore(0, self.slot)\\n result.slot := add(keccak256(0, 0x20), pos)\\n }\\n }\\n\\n struct Trace160 {\\n Checkpoint160[] _checkpoints;\\n }\\n\\n struct Checkpoint160 {\\n uint96 _key;\\n uint160 _value;\\n }\\n\\n /**\\n * @dev Pushes a (`key`, `value`) pair into a Trace160 so that it is stored as the checkpoint.\\n *\\n * Returns previous value and new value.\\n *\\n * IMPORTANT: Never accept `key` as a user input, since an arbitrary `type(uint96).max` key set will disable the\\n * library.\\n */\\n function push(\\n Trace160 storage self,\\n uint96 key,\\n uint160 value\\n ) internal returns (uint160 oldValue, uint160 newValue) {\\n return _insert(self._checkpoints, key, value);\\n }\\n\\n /**\\n * @dev Returns the value in the first (oldest) checkpoint with key greater or equal than the search key, or zero if\\n * there is none.\\n */\\n function lowerLookup(Trace160 storage self, uint96 key) internal view returns (uint160) {\\n uint256 len = self._checkpoints.length;\\n uint256 pos = _lowerBinaryLookup(self._checkpoints, key, 0, len);\\n return pos == len ? 0 : _unsafeAccess(self._checkpoints, pos)._value;\\n }\\n\\n /**\\n * @dev Returns the value in the last (most recent) checkpoint with key lower or equal than the search key, or zero\\n * if there is none.\\n */\\n function upperLookup(Trace160 storage self, uint96 key) internal view returns (uint160) {\\n uint256 len = self._checkpoints.length;\\n uint256 pos = _upperBinaryLookup(self._checkpoints, key, 0, len);\\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\\n }\\n\\n /**\\n * @dev Returns the value in the last (most recent) checkpoint with key lower or equal than the search key, or zero\\n * if there is none.\\n *\\n * NOTE: This is a variant of {upperLookup} that is optimised to find \\\"recent\\\" checkpoint (checkpoints with high\\n * keys).\\n */\\n function upperLookupRecent(Trace160 storage self, uint96 key) internal view returns (uint160) {\\n uint256 len = self._checkpoints.length;\\n\\n uint256 low = 0;\\n uint256 high = len;\\n\\n if (len > 5) {\\n uint256 mid = len - Math.sqrt(len);\\n if (key < _unsafeAccess(self._checkpoints, mid)._key) {\\n high = mid;\\n } else {\\n low = mid + 1;\\n }\\n }\\n\\n uint256 pos = _upperBinaryLookup(self._checkpoints, key, low, high);\\n\\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\\n }\\n\\n /**\\n * @dev Returns the value in the most recent checkpoint, or zero if there are no checkpoints.\\n */\\n function latest(Trace160 storage self) internal view returns (uint160) {\\n uint256 pos = self._checkpoints.length;\\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\\n }\\n\\n /**\\n * @dev Returns whether there is a checkpoint in the structure (i.e. it is not empty), and if so the key and value\\n * in the most recent checkpoint.\\n */\\n function latestCheckpoint(Trace160 storage self) internal view returns (bool exists, uint96 _key, uint160 _value) {\\n uint256 pos = self._checkpoints.length;\\n if (pos == 0) {\\n return (false, 0, 0);\\n } else {\\n Checkpoint160 storage ckpt = _unsafeAccess(self._checkpoints, pos - 1);\\n return (true, ckpt._key, ckpt._value);\\n }\\n }\\n\\n /**\\n * @dev Returns the number of checkpoint.\\n */\\n function length(Trace160 storage self) internal view returns (uint256) {\\n return self._checkpoints.length;\\n }\\n\\n /**\\n * @dev Returns checkpoint at given position.\\n */\\n function at(Trace160 storage self, uint32 pos) internal view returns (Checkpoint160 memory) {\\n return self._checkpoints[pos];\\n }\\n\\n /**\\n * @dev Pushes a (`key`, `value`) pair into an ordered list of checkpoints, either by inserting a new checkpoint,\\n * or by updating the last one.\\n */\\n function _insert(\\n Checkpoint160[] storage self,\\n uint96 key,\\n uint160 value\\n ) private returns (uint160 oldValue, uint160 newValue) {\\n uint256 pos = self.length;\\n\\n if (pos > 0) {\\n Checkpoint160 storage last = _unsafeAccess(self, pos - 1);\\n uint96 lastKey = last._key;\\n uint160 lastValue = last._value;\\n\\n // Checkpoint keys must be non-decreasing.\\n if (lastKey > key) {\\n revert CheckpointUnorderedInsertion();\\n }\\n\\n // Update or push new checkpoint\\n if (lastKey == key) {\\n last._value = value;\\n } else {\\n self.push(Checkpoint160({_key: key, _value: value}));\\n }\\n return (lastValue, value);\\n } else {\\n self.push(Checkpoint160({_key: key, _value: value}));\\n return (0, value);\\n }\\n }\\n\\n /**\\n * @dev Return the index of the first (oldest) checkpoint with key strictly bigger than the search key, or `high`\\n * if there is none. `low` and `high` define a section where to do the search, with inclusive `low` and exclusive\\n * `high`.\\n *\\n * WARNING: `high` should not be greater than the array's length.\\n */\\n function _upperBinaryLookup(\\n Checkpoint160[] storage self,\\n uint96 key,\\n uint256 low,\\n uint256 high\\n ) private view returns (uint256) {\\n while (low < high) {\\n uint256 mid = Math.average(low, high);\\n if (_unsafeAccess(self, mid)._key > key) {\\n high = mid;\\n } else {\\n low = mid + 1;\\n }\\n }\\n return high;\\n }\\n\\n /**\\n * @dev Return the index of the first (oldest) checkpoint with key greater or equal than the search key, or `high`\\n * if there is none. `low` and `high` define a section where to do the search, with inclusive `low` and exclusive\\n * `high`.\\n *\\n * WARNING: `high` should not be greater than the array's length.\\n */\\n function _lowerBinaryLookup(\\n Checkpoint160[] storage self,\\n uint96 key,\\n uint256 low,\\n uint256 high\\n ) private view returns (uint256) {\\n while (low < high) {\\n uint256 mid = Math.average(low, high);\\n if (_unsafeAccess(self, mid)._key < key) {\\n low = mid + 1;\\n } else {\\n high = mid;\\n }\\n }\\n return high;\\n }\\n\\n /**\\n * @dev Access an element of the array without performing bounds check. The position is assumed to be within bounds.\\n */\\n function _unsafeAccess(\\n Checkpoint160[] storage self,\\n uint256 pos\\n ) private pure returns (Checkpoint160 storage result) {\\n assembly {\\n mstore(0, self.slot)\\n result.slot := add(keccak256(0, 0x20), pos)\\n }\\n }\\n}\\n\",\"keccak256\":\"0x66364cd3247ea71cdb58f080f5d5ed6732433a8001413139661841535494692f\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/types/Time.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/types/Time.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {Math} from \\\"../math/Math.sol\\\";\\nimport {SafeCast} from \\\"../math/SafeCast.sol\\\";\\n\\n/**\\n * @dev This library provides helpers for manipulating time-related objects.\\n *\\n * It uses the following types:\\n * - `uint48` for timepoints\\n * - `uint32` for durations\\n *\\n * While the library doesn't provide specific types for timepoints and duration, it does provide:\\n * - a `Delay` type to represent duration that can be programmed to change value automatically at a given point\\n * - additional helper functions\\n */\\nlibrary Time {\\n using Time for *;\\n\\n /**\\n * @dev Get the block timestamp as a Timepoint.\\n */\\n function timestamp() internal view returns (uint48) {\\n return SafeCast.toUint48(block.timestamp);\\n }\\n\\n /**\\n * @dev Get the block number as a Timepoint.\\n */\\n function blockNumber() internal view returns (uint48) {\\n return SafeCast.toUint48(block.number);\\n }\\n\\n // ==================================================== Delay =====================================================\\n /**\\n * @dev A `Delay` is a uint32 duration that can be programmed to change value automatically at a given point in the\\n * future. The \\\"effect\\\" timepoint describes when the transitions happens from the \\\"old\\\" value to the \\\"new\\\" value.\\n * This allows updating the delay applied to some operation while keeping some guarantees.\\n *\\n * In particular, the {update} function guarantees that if the delay is reduced, the old delay still applies for\\n * some time. For example if the delay is currently 7 days to do an upgrade, the admin should not be able to set\\n * the delay to 0 and upgrade immediately. If the admin wants to reduce the delay, the old delay (7 days) should\\n * still apply for some time.\\n *\\n *\\n * The `Delay` type is 112 bits long, and packs the following:\\n *\\n * ```\\n * | [uint48]: effect date (timepoint)\\n * | | [uint32]: value before (duration)\\n * \\u2193 \\u2193 \\u2193 [uint32]: value after (duration)\\n * 0xAAAAAAAAAAAABBBBBBBBCCCCCCCC\\n * ```\\n *\\n * NOTE: The {get} and {withUpdate} functions operate using timestamps. Block number based delays are not currently\\n * supported.\\n */\\n type Delay is uint112;\\n\\n /**\\n * @dev Wrap a duration into a Delay to add the one-step \\\"update in the future\\\" feature\\n */\\n function toDelay(uint32 duration) internal pure returns (Delay) {\\n return Delay.wrap(duration);\\n }\\n\\n /**\\n * @dev Get the value at a given timepoint plus the pending value and effect timepoint if there is a scheduled\\n * change after this timepoint. If the effect timepoint is 0, then the pending value should not be considered.\\n */\\n function _getFullAt(\\n Delay self,\\n uint48 timepoint\\n ) private pure returns (uint32 valueBefore, uint32 valueAfter, uint48 effect) {\\n (valueBefore, valueAfter, effect) = self.unpack();\\n return effect <= timepoint ? (valueAfter, 0, 0) : (valueBefore, valueAfter, effect);\\n }\\n\\n /**\\n * @dev Get the current value plus the pending value and effect timepoint if there is a scheduled change. If the\\n * effect timepoint is 0, then the pending value should not be considered.\\n */\\n function getFull(Delay self) internal view returns (uint32 valueBefore, uint32 valueAfter, uint48 effect) {\\n return _getFullAt(self, timestamp());\\n }\\n\\n /**\\n * @dev Get the current value.\\n */\\n function get(Delay self) internal view returns (uint32) {\\n (uint32 delay, , ) = self.getFull();\\n return delay;\\n }\\n\\n /**\\n * @dev Update a Delay object so that it takes a new duration after a timepoint that is automatically computed to\\n * enforce the old delay at the moment of the update. Returns the updated Delay object and the timestamp when the\\n * new delay becomes effective.\\n */\\n function withUpdate(\\n Delay self,\\n uint32 newValue,\\n uint32 minSetback\\n ) internal view returns (Delay updatedDelay, uint48 effect) {\\n uint32 value = self.get();\\n uint32 setback = uint32(Math.max(minSetback, value > newValue ? value - newValue : 0));\\n effect = timestamp() + setback;\\n return (pack(value, newValue, effect), effect);\\n }\\n\\n /**\\n * @dev Split a delay into its components: valueBefore, valueAfter and effect (transition timepoint).\\n */\\n function unpack(Delay self) internal pure returns (uint32 valueBefore, uint32 valueAfter, uint48 effect) {\\n uint112 raw = Delay.unwrap(self);\\n\\n valueAfter = uint32(raw);\\n valueBefore = uint32(raw >> 32);\\n effect = uint48(raw >> 64);\\n\\n return (valueBefore, valueAfter, effect);\\n }\\n\\n /**\\n * @dev pack the components into a Delay object.\\n */\\n function pack(uint32 valueBefore, uint32 valueAfter, uint48 effect) internal pure returns (Delay) {\\n return Delay.wrap((uint112(effect) << 64) | (uint112(valueBefore) << 32) | uint112(valueAfter));\\n }\\n}\\n\",\"keccak256\":\"0x36776530f012618bc7526ceb28e77b85e582cb12d9b9466a71d4bd6bf952e4cc\",\"license\":\"MIT\"},\"contracts/variants/crosschain/NFT.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity ^0.8.20;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC721/ERC721.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC721/extensions/ERC721Burnable.sol\\\";\\nimport \\\"@openzeppelin/contracts/access/Ownable.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/cryptography/EIP712.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC721/extensions/ERC721Votes.sol\\\";\\nimport \\\"./ProofHandler.sol\\\";\\n\\n/**\\n * @title Cross-chain Membership NFT Contract\\n * @author Web3 Hackers Collective\\n * @notice Non-transferable NFT implementation for DAO membership with cross-chain capabilities\\n * @dev Uses ProofHandler library for cross-chain proof management\\n * @custom:security-contact julien@strat.cc\\n */\\ncontract NFT is\\n ERC721,\\n ERC721Enumerable,\\n ERC721URIStorage,\\n ERC721Burnable,\\n Ownable,\\n EIP712,\\n ERC721Votes\\n{\\n using ProofHandler for ProofHandler.ProofStorage;\\n\\n /// @notice Chain ID where contract was originally deployed\\n uint256 public immutable home;\\n\\n /// @notice Next token ID to be minted\\n uint256 private _nextTokenId;\\n\\n /// @notice Storage for proof handling\\n ProofHandler.ProofStorage private _proofStorage;\\n\\n /// @notice Types of operations that can be synchronized across chains\\n enum OperationType {\\n MINT,\\n BURN,\\n SET_METADATA\\n }\\n\\n /// @notice Emitted when a membership is claimed\\n /// @param tokenId The ID of the claimed token\\n /// @param member The address receiving the membership\\n /// @param nonce Operation sequence number\\n event MembershipClaimed(uint256 indexed tokenId, address indexed member, uint256 nonce);\\n\\n /// @notice Emitted when a membership is revoked\\n /// @param tokenId The ID of the revoked token\\n /// @param member The address losing membership\\n /// @param nonce Operation sequence number\\n event MembershipRevoked(uint256 indexed tokenId, address indexed member, uint256 nonce);\\n\\n /// @notice Emitted when metadata is updated\\n /// @param tokenId The ID of the updated token\\n /// @param newUri The new metadata URI\\n /// @param nonce Operation sequence number\\n event MetadataUpdated(uint256 indexed tokenId, string newUri, uint256 nonce);\\n\\n /// @notice Restricts functions to home chain\\n modifier onlyHomeChain() {\\n require(block.chainid == home, \\\"Operation only allowed on home chain\\\");\\n _;\\n }\\n\\n /**\\n * @notice Initializes the NFT contract\\n * @param _home Chain ID where contract is considered home\\n * @param initialOwner Initial contract owner\\n * @param _firstMembers Array of initial member addresses\\n * @param _uri Initial token URI\\n * @param _name Token collection name\\n * @param _symbol Token collection symbol\\n */\\n constructor(\\n uint256 _home,\\n address initialOwner,\\n address[] memory _firstMembers,\\n string memory _uri,\\n string memory _name,\\n string memory _symbol\\n ) ERC721(_name, _symbol) Ownable(initialOwner) EIP712(_name, \\\"1\\\") {\\n home = _home;\\n for (uint i; i < _firstMembers.length; i++) {\\n _govMint(_firstMembers[i], _uri);\\n }\\n }\\n\\n /**\\n * @notice Adds a new member on home chain\\n * @dev Only callable by owner (governance) on home chain\\n * @param to Address to mint token to\\n * @param uri Token metadata URI\\n */\\n function safeMint(address to, string memory uri) public onlyOwner onlyHomeChain {\\n uint256 nonce = _proofStorage.incrementNonce(uint8(OperationType.MINT));\\n _govMint(to, uri);\\n emit MembershipClaimed(_nextTokenId - 1, to, nonce);\\n }\\n\\n /**\\n * @notice Burns token on home chain\\n * @dev Only callable by owner (governance) on home chain\\n * @param tokenId ID of token to burn\\n */\\n function govBurn(uint256 tokenId) public onlyOwner onlyHomeChain {\\n uint256 nonce = _proofStorage.incrementNonce(uint8(OperationType.BURN));\\n address owner = ownerOf(tokenId);\\n _burn(tokenId);\\n emit MembershipRevoked(tokenId, owner, nonce);\\n }\\n\\n /**\\n * @notice Updates token metadata on home chain\\n * @dev Only callable by owner (governance) on home chain\\n * @param tokenId ID of token to update\\n * @param uri New metadata URI\\n */\\n function setMetadata(uint256 tokenId, string memory uri) public onlyOwner onlyHomeChain {\\n uint256 nonce = _proofStorage.incrementNonce(uint8(OperationType.SET_METADATA));\\n _setTokenURI(tokenId, uri);\\n emit MetadataUpdated(tokenId, uri, nonce);\\n }\\n\\n /**\\n * @notice Generates proof for NFT operations\\n * @param operationType Type of operation\\n * @param params Operation parameters\\n * @return Encoded proof data\\n */\\n function generateOperationProof(\\n uint8 operationType,\\n bytes memory params\\n ) external view returns (bytes memory) {\\n require(block.chainid == home, \\\"Proofs only generated on home chain\\\");\\n uint256 nextNonce = _proofStorage.getNextNonce(operationType);\\n return ProofHandler.generateProof(address(this), operationType, params, nextNonce);\\n }\\n\\n /**\\n * @notice Claims an NFT operation on a foreign chain\\n * @param proof Proof generated by home chain\\n */\\n function claimOperation(bytes memory proof) external {\\n (uint8 operationType, bytes memory params, uint256 nonce) = ProofHandler\\n .verifyAndClaimProof(proof, address(this), _proofStorage);\\n\\n if (operationType == uint8(OperationType.MINT)) {\\n (address to, string memory uri) = abi.decode(params, (address, string));\\n _govMint(to, uri);\\n emit MembershipClaimed(_nextTokenId - 1, to, nonce);\\n } else if (operationType == uint8(OperationType.BURN)) {\\n uint256 tokenId = abi.decode(params, (uint256));\\n address owner = ownerOf(tokenId);\\n _burn(tokenId);\\n emit MembershipRevoked(tokenId, owner, nonce);\\n } else if (operationType == uint8(OperationType.SET_METADATA)) {\\n (uint256 tokenId, string memory uri) = abi.decode(params, (uint256, string));\\n _setTokenURI(tokenId, uri);\\n emit MetadataUpdated(tokenId, uri, nonce);\\n }\\n }\\n\\n /**\\n * @notice Internal function for minting without proof verification\\n * @param to Address to receive token\\n * @param uri Token metadata URI\\n */\\n function _govMint(address to, string memory uri) internal {\\n uint256 tokenId = _nextTokenId++;\\n _safeMint(to, tokenId);\\n _setTokenURI(tokenId, uri);\\n }\\n\\n // Required overrides\\n\\n function _update(\\n address to,\\n uint256 tokenId,\\n address auth\\n ) internal override(ERC721, ERC721Enumerable, ERC721Votes) returns (address) {\\n require(auth == address(0) || to == address(0), \\\"NFT is not transferable\\\");\\n return super._update(to, tokenId, auth);\\n }\\n\\n function _increaseBalance(\\n address account,\\n uint128 value\\n ) internal override(ERC721, ERC721Enumerable, ERC721Votes) {\\n super._increaseBalance(account, value);\\n }\\n\\n function tokenURI(\\n uint256 tokenId\\n ) public view override(ERC721, ERC721URIStorage) returns (string memory) {\\n return super.tokenURI(tokenId);\\n }\\n\\n function supportsInterface(\\n bytes4 interfaceId\\n ) public view override(ERC721, ERC721Enumerable, ERC721URIStorage) returns (bool) {\\n return super.supportsInterface(interfaceId);\\n }\\n\\n function clock() public view override returns (uint48) {\\n return uint48(block.timestamp);\\n }\\n\\n function CLOCK_MODE() public pure override returns (string memory) {\\n return \\\"mode=timestamp\\\";\\n }\\n}\\n\",\"keccak256\":\"0xb95201b1f50faa8e4e791b37460dfdf54d2fde419b85e14a6cfad4e410438296\",\"license\":\"GPL-3.0\"},\"contracts/variants/crosschain/ProofHandler.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity ^0.8.20;\\n\\n/**\\n * @title Proof Handler Library\\n * @author Web3 Hackers Collective\\n * @notice Library for standardized cross-chain proof generation and verification\\n * @dev Handles proof generation, verification, and tracking for cross-chain operations\\n * @custom:security-contact julien@strat.cc\\n */\\nlibrary ProofHandler {\\n /// @notice Tracks which proofs have been applied on each chain\\n struct ProofStorage {\\n mapping(bytes32 => bool) updateAppliedOnChain;\\n mapping(uint8 => uint256) currentNonce;\\n }\\n\\n /// @dev Emitted when a proof is claimed\\n event ProofClaimed(uint8 indexed operationType, bytes params, uint256 nonce);\\n\\n /**\\n * @notice Generates a proof for cross-chain operations\\n * @param contractAddress Address of contract generating the proof\\n * @param operationType Type of operation being performed\\n * @param params Operation parameters\\n * @param nonce Current nonce for this operation type\\n * @return proof Encoded proof data\\n */\\n function generateProof(\\n address contractAddress,\\n uint8 operationType,\\n bytes memory params,\\n uint256 nonce\\n ) public pure returns (bytes memory proof) {\\n bytes32 message = keccak256(\\n abi.encodePacked(contractAddress, operationType, params, nonce)\\n );\\n bytes32 digest = keccak256(abi.encodePacked(\\\"\\\\x19Ethereum Signed Message:\\\\n32\\\", message));\\n\\n return abi.encode(operationType, params, nonce, digest);\\n }\\n\\n /**\\n * @notice Verifies and claims a proof\\n * @param proof Proof to verify and claim\\n * @param contractAddress Address of contract claiming the proof\\n * @param storage_ Proof storage struct\\n * @return operationType The type of operation being performed\\n * @return params The operation parameters\\n * @return nonce The operation sequence number\\n */\\n function verifyAndClaimProof(\\n bytes memory proof,\\n address contractAddress,\\n ProofStorage storage storage_\\n ) public returns (uint8 operationType, bytes memory params, uint256 nonce) {\\n bytes32 digest;\\n (operationType, params, nonce, digest) = abi.decode(\\n proof,\\n (uint8, bytes, uint256, bytes32)\\n );\\n\\n bytes32 proofHash = keccak256(proof);\\n require(!storage_.updateAppliedOnChain[proofHash], \\\"Proof already claimed\\\");\\n require(nonce == storage_.currentNonce[operationType] + 1, \\\"Invalid nonce\\\");\\n\\n bytes32 message = keccak256(\\n abi.encodePacked(contractAddress, operationType, params, nonce)\\n );\\n bytes32 expectedDigest = keccak256(\\n abi.encodePacked(\\\"\\\\x19Ethereum Signed Message:\\\\n32\\\", message)\\n );\\n require(digest == expectedDigest, \\\"Invalid proof\\\");\\n\\n storage_.updateAppliedOnChain[proofHash] = true;\\n storage_.currentNonce[operationType] = nonce;\\n\\n emit ProofClaimed(operationType, params, nonce);\\n\\n return (operationType, params, nonce);\\n }\\n\\n /**\\n * @notice Gets the next nonce for an operation type\\n * @param storage_ Proof storage struct\\n * @param operationType Type of operation\\n * @return nonce Next nonce value\\n */\\n function getNextNonce(\\n ProofStorage storage storage_,\\n uint8 operationType\\n ) public view returns (uint256 nonce) {\\n return storage_.currentNonce[operationType] + 1;\\n }\\n\\n /**\\n * @notice Increments the nonce for an operation type\\n * @param storage_ Proof storage struct\\n * @param operationType Type of operation\\n * @return nonce New nonce value\\n */\\n function incrementNonce(\\n ProofStorage storage storage_,\\n uint8 operationType\\n ) public returns (uint256 nonce) {\\n storage_.currentNonce[operationType]++;\\n return storage_.currentNonce[operationType];\\n }\\n}\\n\",\"keccak256\":\"0x3719e47c508f29977d48842c5c1d27cce7cb289cbb592526f170f98135ff41a7\",\"license\":\"GPL-3.0\"}},\"version\":1}", - "bytecode": "0x6101806040523480156200001257600080fd5b5060405162004aa138038062004aa1833981016040819052620000359162001194565b6040805180820190915260018152603160f81b602082015282908682846000620000608382620012ef565b5060016200006f8282620012ef565b5050506001600160a01b038116620000a257604051631e4fbdf760e01b8152600060048201526024015b60405180910390fd5b620000ad81620001c6565b50620000bb82600c62000218565b61012052620000cc81600d62000218565b61014052815160208084019190912060e052815190820120610100524660a0526200015a60e05161010051604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f60208201529081019290925260608201524660808201523060a082015260009060c00160405160208183030381529060405280519060200120905090565b60805250503060c05261016086905260005b8451811015620001b957620001a48582815181106200018f576200018f620013bb565b6020026020010151856200025160201b60201c565b80620001b081620013e7565b9150506200016c565b505050505050506200154f565b600b80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60006020835110156200023857620002308362000287565b90506200024b565b81620002458482620012ef565b5060ff90505b92915050565b60128054600091826200026483620013e7565b909155509050620002768382620002ca565b620002828183620002f0565b505050565b600080829050601f81511115620002b5578260405163305a27a960e01b815260040162000099919062001431565b8051620002c28262001446565b179392505050565b620002ec8282604051806020016040528060008152506200034260201b60201c565b5050565b6000828152600a602052604090206200030a8282620012ef565b506040518281527ff8e1a15aba9398e019f0b49df1a4fde98ee17ae345cb5f6b5e2c27f5033e8ce79060200160405180910390a15050565b6200034e83836200035e565b62000282336000858585620003c8565b6001600160a01b0382166200038a57604051633250574960e11b81526000600482015260240162000099565b60006200039983838362000500565b90506001600160a01b0381161562000282576040516339e3563760e11b81526000600482015260240162000099565b6001600160a01b0383163b15620004f957604051630a85bd0160e11b81526001600160a01b0384169063150b7a02906200040d9088908890879087906004016200146b565b6020604051808303816000875af19250505080156200044b575060408051601f3d908101601f191682019092526200044891810190620014aa565b60015b620004b9573d8080156200047c576040519150601f19603f3d011682016040523d82523d6000602084013e62000481565b606091505b508051600003620004b157604051633250574960e11b81526001600160a01b038516600482015260240162000099565b805181602001fd5b6001600160e01b03198116630a85bd0160e11b14620004f757604051633250574960e11b81526001600160a01b038516600482015260240162000099565b505b5050505050565b60006001600160a01b03821615806200052057506001600160a01b038416155b6200056e5760405162461bcd60e51b815260206004820152601760248201527f4e4654206973206e6f74207472616e7366657261626c65000000000000000000604482015260640162000099565b6200057b84848462000583565b949350505050565b60008062000593858585620005a3565b90506200057b818660016200067f565b600080620005b385858562000717565b90506001600160a01b03811662000613576200060d84600880546000838152600960205260408120829055600182018355919091527ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee30155565b62000639565b846001600160a01b0316816001600160a01b031614620006395762000639818562000816565b6001600160a01b038516620006595762000653846200089a565b6200057b565b846001600160a01b0316816001600160a01b0316146200057b576200057b858562000954565b6001600160a01b038316620006b457620006b1601162001195620009a860201b17620006ab84620009bd565b620009f7565b50505b6001600160a01b038216620006e357620006e06011620011a862000a2b60201b17620006ab84620009bd565b50505b6001600160a01b038381166000908152600f6020526040808220548584168352912054620002829291821691168362000a39565b6000828152600260205260408120546001600160a01b039081169083161562000747576200074781848662000ba0565b6001600160a01b03811615620007875762000766600085818062000c0a565b6001600160a01b038116600090815260036020526040902080546000190190555b6001600160a01b03851615620007b7576001600160a01b0385166000908152600360205260409020805460010190555b60008481526002602052604080822080546001600160a01b0319166001600160a01b0389811691821790925591518793918516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4949350505050565b6000620008238362000d38565b6000838152600760209081526040808320546001600160a01b03881684526006909252909120919250908183146200087b57600083815260208281526040808320548584528184208190558352600790915290208290555b6000938452600760209081526040808620869055938552525081205550565b600854600090620008ae90600190620014d6565b60008381526009602052604081205460088054939450909284908110620008d957620008d9620013bb565b906000526020600020015490508060088381548110620008fd57620008fd620013bb565b6000918252602080832090910192909255828152600990915260408082208490558582528120556008805480620009385762000938620014ec565b6001900381819060005260206000200160009055905550505050565b60006001620009638462000d38565b6200096f9190620014d6565b6001600160a01b039093166000908152600660209081526040808320868452825280832085905593825260079052919091209190915550565b6000620009b6828462001502565b9392505050565b60006001600160d01b03821115620009f3576040516306dfcc6560e41b815260d060048201526024810183905260440162000099565b5090565b60008062000a1e4262000a1562000a0e8862000d82565b868860201c565b87919062000dd1565b915091505b935093915050565b6000620009b682846200152c565b816001600160a01b0316836001600160a01b03161415801562000a5c5750600081115b1562000282576001600160a01b0383161562000aff576001600160a01b03831660009081526010602090815260408220829162000aaa919062000a2b901b620011a817620006ab86620009bd565b6001600160d01b031691506001600160d01b03169150846001600160a01b031660008051602062004a81833981519152838360405162000af4929190918252602082015260400190565b60405180910390a250505b6001600160a01b0382161562000282576001600160a01b03821660009081526010602090815260408220829162000b479190620009a8901b6200119517620006ab86620009bd565b6001600160d01b031691506001600160d01b03169150836001600160a01b031660008051602062004a81833981519152838360405162000b91929190918252602082015260400190565b60405180910390a25050505050565b62000bad83838362000de1565b62000282576001600160a01b03831662000bde57604051637e27328960e01b81526004810182905260240162000099565b60405163177e802f60e01b81526001600160a01b03831660048201526024810182905260440162000099565b808062000c1f57506001600160a01b03821615155b1562000d0857600062000c328462000e67565b90506001600160a01b0383161580159062000c5f5750826001600160a01b0316816001600160a01b031614155b801562000c9257506001600160a01b0380821660009081526005602090815260408083209387168352929052205460ff16155b1562000cbd5760405163a9fbf51f60e01b81526001600160a01b038416600482015260240162000099565b811562000d065783856001600160a01b0316826001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45b505b5050600090815260046020526040902080546001600160a01b0319166001600160a01b0392909216919091179055565b60006001600160a01b03821662000d66576040516322718ad960e21b81526000600482015260240162000099565b506001600160a01b031660009081526003602052604090205490565b8054600090801562000dc85762000dae8362000da0600184620014d6565b600091825260209091200190565b54660100000000000090046001600160d01b0316620009b6565b60009392505050565b60008062000a1e85858562000ea2565b60006001600160a01b038316158015906200057b5750826001600160a01b0316846001600160a01b0316148062000e3d57506001600160a01b0380851660009081526005602090815260408083209387168352929052205460ff165b806200057b5750506000908152600460205260409020546001600160a01b03908116911614919050565b6000818152600260205260408120546001600160a01b0316806200024b57604051637e27328960e01b81526004810184905260240162000099565b82546000908190801562000fac57600062000ec48762000da0600185620014d6565b805490915065ffffffffffff80821691660100000000000090046001600160d01b031690881682111562000f0b57604051632520601d60e01b815260040160405180910390fd5b8765ffffffffffff168265ffffffffffff160362000f4957825465ffffffffffff1666010000000000006001600160d01b0389160217835562000f9d565b6040805180820190915265ffffffffffff808a1682526001600160d01b03808a1660208085019182528d54600181018f5560008f815291909120945191519092166601000000000000029216919091179101555b945085935062000a2392505050565b50506040805180820190915265ffffffffffff80851682526001600160d01b0380851660208085019182528854600181018a5560008a815291822095519251909316660100000000000002919093161792019190915590508162000a23565b80516001600160a01b03811681146200102357600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b038111828210171562001069576200106962001028565b604052919050565b600082601f8301126200108357600080fd5b815160206001600160401b03821115620010a157620010a162001028565b8160051b620010b28282016200103e565b9283528481018201928281019087851115620010cd57600080fd5b83870192505b84831015620010f757620010e7836200100b565b82529183019190830190620010d3565b979650505050505050565b60005b838110156200111f57818101518382015260200162001105565b50506000910152565b600082601f8301126200113a57600080fd5b81516001600160401b0381111562001156576200115662001028565b6200116b601f8201601f19166020016200103e565b8181528460208386010111156200118157600080fd5b6200057b82602083016020870162001102565b60008060008060008060c08789031215620011ae57600080fd5b86519550620011c0602088016200100b565b60408801519095506001600160401b0380821115620011de57600080fd5b620011ec8a838b0162001071565b955060608901519150808211156200120357600080fd5b620012118a838b0162001128565b945060808901519150808211156200122857600080fd5b620012368a838b0162001128565b935060a08901519150808211156200124d57600080fd5b506200125c89828a0162001128565b9150509295509295509295565b600181811c908216806200127e57607f821691505b6020821081036200129f57634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200028257600081815260208120601f850160051c81016020861015620012ce5750805b601f850160051c820191505b81811015620004f757828155600101620012da565b81516001600160401b038111156200130b576200130b62001028565b62001323816200131c845462001269565b84620012a5565b602080601f8311600181146200135b5760008415620013425750858301515b600019600386901b1c1916600185901b178555620004f7565b600085815260208120601f198616915b828110156200138c578886015182559484019460019091019084016200136b565b5085821015620013ab5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060018201620013fc57620013fc620013d1565b5060010190565b600081518084526200141d81602086016020860162001102565b601f01601f19169290920160200192915050565b602081526000620009b6602083018462001403565b805160208083015191908110156200129f5760001960209190910360031b1b16919050565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090620014a09083018462001403565b9695505050505050565b600060208284031215620014bd57600080fd5b81516001600160e01b031981168114620009b657600080fd5b818103818111156200024b576200024b620013d1565b634e487b7160e01b600052603160045260246000fd5b6001600160d01b03818116838216019080821115620015255762001525620013d1565b5092915050565b6001600160d01b03828116828216039080821115620015255762001525620013d1565b60805160a05160c05160e051610100516101205161014051610160516134b0620015d1600039600081816104a3015281816106bf015281816108e701528181610ad00152611019015260006115620152600061153001526000611f5201526000611f2a01526000611e8501526000611eaf01526000611ed901526134b06000f3fe608060405234801561001057600080fd5b506004361061021c5760003560e01c806370a08231116101255780639ab24eb0116100ad578063c3cda5201161007c578063c3cda520146104eb578063c87b56dd146104fe578063d204c45e14610511578063e985e9c514610524578063f2fde38b1461053757600080fd5b80639ab24eb01461048b5780639fa92f9d1461049e578063a22cb465146104c5578063b88d4fde146104d857600080fd5b806384b0196e116100f457806384b0196e1461042e5780638da5cb5b146104495780638e539e8c1461045a57806391ddadf41461046d57806395d89b411461048357600080fd5b806370a08231146103d7578063715018a6146103ea5780637ecebe00146103f257806381b620861461041b57600080fd5b806342842e0e116101a85780634f6ccce7116101775780634f6ccce71461035f578063587cde1e14610372578063593aa2831461039e5780635c19a95c146103b15780636352211e146103c457600080fd5b806342842e0e146102fc57806342966c681461030f578063482ffa5e146103225780634bf5d7e91461033557600080fd5b806318160ddd116101ef57806318160ddd1461029e57806323b872dd146102b057806326926d46146102c35780632f745c59146102d65780633a46b1a8146102e957600080fd5b806301ffc9a71461022157806306fdde0314610249578063081812fc1461025e578063095ea7b314610289575b600080fd5b61023461022f366004612aba565b61054a565b60405190151581526020015b60405180910390f35b61025161055b565b6040516102409190612b27565b61027161026c366004612b3a565b6105ed565b6040516001600160a01b039091168152602001610240565b61029c610297366004612b68565b610616565b005b6008545b604051908152602001610240565b61029c6102be366004612b94565b610625565b61029c6102d1366004612b3a565b6106b5565b6102a26102e4366004612b68565b6107db565b6102a26102f7366004612b68565b610840565b61029c61030a366004612b94565b6108b7565b61029c61031d366004612b3a565b6108d7565b610251610330366004612ca9565b6108e3565b60408051808201909152600e81526d06d6f64653d74696d657374616d760941b6020820152610251565b6102a261036d366004612b3a565b610a6d565b610271610380366004612cf9565b6001600160a01b039081166000908152600f60205260409020541690565b61029c6103ac366004612d16565b610ac6565b61029c6103bf366004612cf9565b610bd6565b6102716103d2366004612b3a565b610be1565b6102a26103e5366004612cf9565b610bec565b61029c610c34565b6102a2610400366004612cf9565b6001600160a01b03166000908152600e602052604090205490565b61029c610429366004612d47565b610c48565b610436610e3f565b6040516102409796959493929190612d7c565b600b546001600160a01b0316610271565b6102a2610468366004612b3a565b610e85565b60405165ffffffffffff42168152602001610240565b610251610ee5565b6102a2610499366004612cf9565b610ef4565b6102a27f000000000000000000000000000000000000000000000000000000000000000081565b61029c6104d3366004612e12565b610f24565b61029c6104e6366004612e50565b610f2f565b61029c6104f9366004612ebc565b610f47565b61025161050c366004612b3a565b611004565b61029c61051f366004612f18565b61100f565b610234610532366004612f36565b611129565b61029c610545366004612cf9565b611157565b6000610555826111b4565b92915050565b60606000805461056a90612f64565b80601f016020809104026020016040519081016040528092919081815260200182805461059690612f64565b80156105e35780601f106105b8576101008083540402835291602001916105e3565b820191906000526020600020905b8154815290600101906020018083116105c657829003601f168201915b5050505050905090565b60006105f8826111d9565b506000828152600460205260409020546001600160a01b0316610555565b610621828233611212565b5050565b6001600160a01b03821661065457604051633250574960e11b8152600060048201526024015b60405180910390fd5b600061066183833361121f565b9050836001600160a01b0316816001600160a01b0316146106af576040516364283d7b60e01b81526001600160a01b038086166004830152602482018490528216604482015260640161064b565b50505050565b6106bd611295565b7f000000000000000000000000000000000000000000000000000000000000000046146106fc5760405162461bcd60e51b815260040161064b90612f9e565b604051633b0d4dd760e01b81526013600482015260016024820152600090730152ee45780385dACCCCB128D816031CfFe5F36B90633b0d4dd790604401602060405180830381865af4158015610756573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061077a9190612ff8565b9050600061078783610be1565b9050610792836112c2565b806001600160a01b0316837f81c00ee14a307a39bcddd8f17801cf3101f1c49c8dea9ee90ec0c04a61b5a007846040516107ce91815260200190565b60405180910390a3505050565b60006107e683610bec565b82106108175760405163295f44f760e21b81526001600160a01b03841660048201526024810183905260440161064b565b506001600160a01b03919091166000908152600660209081526040808320938352929052205490565b60004265ffffffffffff8116831061087c57604051637669fc0f60e11b81526004810184905265ffffffffffff8216602482015260440161064b565b6108a6610888846112fd565b6001600160a01b038616600090815260106020526040902090611334565b6001600160d01b0316949350505050565b6108d283838360405180602001604052806000815250610f2f565b505050565b6106216000823361121f565b60607f000000000000000000000000000000000000000000000000000000000000000046146109605760405162461bcd60e51b815260206004820152602360248201527f50726f6f6673206f6e6c792067656e657261746564206f6e20686f6d6520636860448201526230b4b760e91b606482015260840161064b565b604051630564edeb60e31b81526013600482015260ff84166024820152600090730152ee45780385dACCCCB128D816031CfFe5F36B90632b276f5890604401602060405180830381865af41580156109bc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109e09190612ff8565b604051637352178160e01b8152909150730152ee45780385dACCCCB128D816031CfFe5F36B90637352178190610a20903090889088908790600401613011565b600060405180830381865af4158015610a3d573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610a659190810190613094565b949350505050565b6000610a7860085490565b8210610aa15760405163295f44f760e21b8152600060048201526024810183905260440161064b565b60088281548110610ab457610ab46130c9565b90600052602060002001549050919050565b610ace611295565b7f00000000000000000000000000000000000000000000000000000000000000004614610b0d5760405162461bcd60e51b815260040161064b90612f9e565b604051633b0d4dd760e01b81526013600482015260026024820152600090730152ee45780385dACCCCB128D816031CfFe5F36B90633b0d4dd790604401602060405180830381865af4158015610b67573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b8b9190612ff8565b9050610b9783836113ea565b827faef83f88d7b64742932e336e35ec4ebdbf35e2824c4cc154007911e95b72367e8383604051610bc99291906130df565b60405180910390a2505050565b33610621818361143a565b6000610555826111d9565b60006001600160a01b038216610c18576040516322718ad960e21b81526000600482015260240161064b565b506001600160a01b031660009081526003602052604090205490565b610c3c611295565b610c4660006114ac565b565b6000806000730152ee45780385dACCCCB128D816031CfFe5F36B63c0af6591853060136040518463ffffffff1660e01b8152600401610c8993929190613101565b600060405180830381865af4158015610ca6573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610cce919081019061312f565b9194509250905060ff8316610d565760008083806020019051810190610cf49190613189565b91509150610d0282826114fe565b816001600160a01b03166001601254610d1b91906131e6565b6040518581527f22ef8ac73166382773e470f8f887ac4c54dcf377f397431fe0ac6f60261fabaf906020015b60405180910390a350506106af565b60001960ff841601610dcc57600082806020019051810190610d789190612ff8565b90506000610d8582610be1565b9050610d90826112c2565b806001600160a01b0316827f81c00ee14a307a39bcddd8f17801cf3101f1c49c8dea9ee90ec0c04a61b5a00785604051610d4791815260200190565b60011960ff8416016106af5760008083806020019051810190610def91906131f9565b91509150610dfd82826113ea565b817faef83f88d7b64742932e336e35ec4ebdbf35e2824c4cc154007911e95b72367e8285604051610e2f9291906130df565b60405180910390a2505050505050565b600060608060008060006060610e53611529565b610e5b61155b565b60408051600080825260208201909252600f60f81b9b939a50919850469750309650945092509050565b60004265ffffffffffff81168310610ec157604051637669fc0f60e11b81526004810184905265ffffffffffff8216602482015260440161064b565b610ed5610ecd846112fd565b601190611334565b6001600160d01b03169392505050565b60606001805461056a90612f64565b6001600160a01b0381166000908152601060205260408120610f1590611588565b6001600160d01b031692915050565b6106213383836115c1565b610f3a848484610625565b6106af3385858585611658565b83421115610f6b57604051632341d78760e11b81526004810185905260240161064b565b604080517fe48329057bfd03d55e49b547132e39cffd9c1820ad7b9d4c5307691425d15adf60208201526001600160a01b038816918101919091526060810186905260808101859052600090610fe590610fdd9060a00160405160208183030381529060405280519060200120611783565b8585856117b0565b9050610ff181876117de565b610ffb818861143a565b50505050505050565b606061055582611831565b611017611295565b7f000000000000000000000000000000000000000000000000000000000000000046146110565760405162461bcd60e51b815260040161064b90612f9e565b604051633b0d4dd760e01b81526013600482015260006024820181905290730152ee45780385dACCCCB128D816031CfFe5F36B90633b0d4dd790604401602060405180830381865af41580156110b0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110d49190612ff8565b90506110e083836114fe565b826001600160a01b031660016012546110f991906131e6565b6040518381527f22ef8ac73166382773e470f8f887ac4c54dcf377f397431fe0ac6f60261fabaf906020016107ce565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205460ff1690565b61115f611295565b6001600160a01b03811661118957604051631e4fbdf760e01b81526000600482015260240161064b565b611192816114ac565b50565b60006111a1828461322a565b9392505050565b60006111a18284613251565b60006001600160e01b03198216632483248360e11b148061055557506105558261193a565b6000818152600260205260408120546001600160a01b03168061055557604051637e27328960e01b81526004810184905260240161064b565b6108d2838383600161195f565b60006001600160a01b038216158061123e57506001600160a01b038416155b61128a5760405162461bcd60e51b815260206004820152601760248201527f4e4654206973206e6f74207472616e7366657261626c65000000000000000000604482015260640161064b565b610a65848484611a65565b600b546001600160a01b03163314610c465760405163118cdaa760e01b815233600482015260240161064b565b60006112d1600083600061121f565b90506001600160a01b03811661062157604051637e27328960e01b81526004810183905260240161064b565b600065ffffffffffff821115611330576040516306dfcc6560e41b8152603060048201526024810183905260440161064b565b5090565b81546000908181600581111561139357600061134f84611a81565b61135990856131e6565b60008881526020902090915081015465ffffffffffff908116908716101561138357809150611391565b61138e816001613271565b92505b505b60006113a187878585611bda565b905080156113dc576113c6876113b86001846131e6565b600091825260209091200190565b54600160301b90046001600160d01b03166113df565b60005b979650505050505050565b6000828152600a6020526040902061140282826132ca565b506040518281527ff8e1a15aba9398e019f0b49df1a4fde98ee17ae345cb5f6b5e2c27f5033e8ce79060200160405180910390a15050565b6001600160a01b038281166000818152600f602052604080822080548686166001600160a01b0319821681179092559151919094169392849290917f3134e8a2e6d97e929a7e54011ea5485d7d196dd5f0ba4d4ef95803e8e3fc257f9190a46108d281836114a786611c3c565b611c47565b600b80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b601280546000918261150f8361338a565b91905055905061151f8382611db3565b6108d281836113ea565b60606115567f0000000000000000000000000000000000000000000000000000000000000000600c611dcd565b905090565b60606115567f0000000000000000000000000000000000000000000000000000000000000000600d611dcd565b805460009080156115b8576115a2836113b86001846131e6565b54600160301b90046001600160d01b03166111a1565b60009392505050565b6001600160a01b0382166115f357604051630b61174360e31b81526001600160a01b038316600482015260240161064b565b6001600160a01b03838116600081815260056020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3191016107ce565b6001600160a01b0383163b1561177c57604051630a85bd0160e11b81526001600160a01b0384169063150b7a029061169a9088908890879087906004016133a3565b6020604051808303816000875af19250505080156116d5575060408051601f3d908101601f191682019092526116d2918101906133e0565b60015b61173e573d808015611703576040519150601f19603f3d011682016040523d82523d6000602084013e611708565b606091505b50805160000361173657604051633250574960e11b81526001600160a01b038516600482015260240161064b565b805181602001fd5b6001600160e01b03198116630a85bd0160e11b1461177a57604051633250574960e11b81526001600160a01b038516600482015260240161064b565b505b5050505050565b6000610555611790611e78565b8360405161190160f01b8152600281019290925260228201526042902090565b6000806000806117c288888888611fa3565b9250925092506117d28282612072565b50909695505050505050565b6001600160a01b0382166000908152600e602052604090208054600181019091558181146108d2576040516301d4b62360e61b81526001600160a01b03841660048201526024810182905260440161064b565b606061183c826111d9565b506000828152600a60205260408120805461185690612f64565b80601f016020809104026020016040519081016040528092919081815260200182805461188290612f64565b80156118cf5780601f106118a4576101008083540402835291602001916118cf565b820191906000526020600020905b8154815290600101906020018083116118b257829003601f168201915b5050505050905060006118ed60408051602081019091526000815290565b905080516000036118ff575092915050565b8151156119315780826040516020016119199291906133fd565b60405160208183030381529060405292505050919050565b610a658461212b565b60006001600160e01b0319821663780e9d6360e01b148061055557506105558261219f565b808061197357506001600160a01b03821615155b15611a35576000611983846111d9565b90506001600160a01b038316158015906119af5750826001600160a01b0316816001600160a01b031614155b80156119c257506119c08184611129565b155b156119eb5760405163a9fbf51f60e01b81526001600160a01b038416600482015260240161064b565b8115611a335783856001600160a01b0316826001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45b505b5050600090815260046020526040902080546001600160a01b0319166001600160a01b0392909216919091179055565b600080611a738585856121ef565b9050610a65818660016122bc565b600060018211611a8f575090565b816001600160801b8210611aa85760809190911c9060401b5b680100000000000000008210611ac35760409190911c9060201b5b6401000000008210611ada5760209190911c9060101b5b620100008210611aef5760109190911c9060081b5b6101008210611b035760089190911c9060041b5b60108210611b165760049190911c9060021b5b60048210611b225760011b5b600302600190811c90818581611b3a57611b3a61342c565b048201901c90506001818581611b5257611b5261342c565b048201901c90506001818581611b6a57611b6a61342c565b048201901c90506001818581611b8257611b8261342c565b048201901c90506001818581611b9a57611b9a61342c565b048201901c90506001818581611bb257611bb261342c565b048201901c9050611bd1818581611bcb57611bcb61342c565b04821190565b90039392505050565b60005b81831015611c34576000611bf18484612332565b60008781526020902090915065ffffffffffff86169082015465ffffffffffff161115611c2057809250611c2e565b611c2b816001613271565b93505b50611bdd565b509392505050565b600061055582610bec565b816001600160a01b0316836001600160a01b031614158015611c695750600081115b156108d2576001600160a01b03831615611d11576001600160a01b03831660009081526010602052604081208190611cac906111a8611ca78661234d565b612381565b6001600160d01b031691506001600160d01b03169150846001600160a01b03167fdec2bacdd2f05b59de34da9b523dff8be42e5e38e818c82fdb0bae774387a7248383604051611d06929190918252602082015260400190565b60405180910390a250505b6001600160a01b038216156108d2576001600160a01b03821660009081526010602052604081208190611d4a90611195611ca78661234d565b6001600160d01b031691506001600160d01b03169150836001600160a01b03167fdec2bacdd2f05b59de34da9b523dff8be42e5e38e818c82fdb0bae774387a7248383604051611da4929190918252602082015260400190565b60405180910390a25050505050565b6106218282604051806020016040528060008152506123b3565b606060ff8314611de757611de0836123cb565b9050610555565b818054611df390612f64565b80601f0160208091040260200160405190810160405280929190818152602001828054611e1f90612f64565b8015611e6c5780601f10611e4157610100808354040283529160200191611e6c565b820191906000526020600020905b815481529060010190602001808311611e4f57829003601f168201915b50505050509050610555565b6000306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016148015611ed157507f000000000000000000000000000000000000000000000000000000000000000046145b15611efb57507f000000000000000000000000000000000000000000000000000000000000000090565b611556604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f60208201527f0000000000000000000000000000000000000000000000000000000000000000918101919091527f000000000000000000000000000000000000000000000000000000000000000060608201524660808201523060a082015260009060c00160405160208183030381529060405280519060200120905090565b600080807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0841115611fde5750600091506003905082612068565b604080516000808252602082018084528a905260ff891692820192909252606081018790526080810186905260019060a0016020604051602081039080840390855afa158015612032573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b03811661205e57506000925060019150829050612068565b9250600091508190505b9450945094915050565b600082600381111561208657612086612fe2565b0361208f575050565b60018260038111156120a3576120a3612fe2565b036120c15760405163f645eedf60e01b815260040160405180910390fd5b60028260038111156120d5576120d5612fe2565b036120f65760405163fce698f760e01b81526004810182905260240161064b565b600382600381111561210a5761210a612fe2565b03610621576040516335e2f38360e21b81526004810182905260240161064b565b6060612136826111d9565b50600061214e60408051602081019091526000815290565b9050600081511161216e57604051806020016040528060008152506111a1565b806121788461240a565b6040516020016121899291906133fd565b6040516020818303038152906040529392505050565b60006001600160e01b031982166380ac58cd60e01b14806121d057506001600160e01b03198216635b5e139f60e01b145b8061055557506301ffc9a760e01b6001600160e01b0319831614610555565b6000806121fd85858561249d565b90506001600160a01b03811661225a5761225584600880546000838152600960205260408120829055600182018355919091527ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee30155565b61227d565b846001600160a01b0316816001600160a01b03161461227d5761227d8185612596565b6001600160a01b0385166122995761229484612617565b610a65565b846001600160a01b0316816001600160a01b031614610a6557610a6585856126c6565b6001600160a01b0383166122de576122db6011611195611ca78461234d565b50505b6001600160a01b038216612300576122fd60116111a8611ca78461234d565b50505b6001600160a01b038381166000908152600f60205260408082205485841683529120546108d292918216911683611c47565b60006123416002848418613442565b6111a190848416613271565b60006001600160d01b03821115611330576040516306dfcc6560e41b815260d060048201526024810183905260440161064b565b6000806123a64261239e61239488611588565b868863ffffffff16565b879190612716565b915091505b935093915050565b6123bd8383612724565b6108d2336000858585611658565b606060006123d883612789565b604080516020808252818301909252919250600091906020820181803683375050509182525060208101929092525090565b60606000612417836127b1565b600101905060008167ffffffffffffffff81111561243757612437612be4565b6040519080825280601f01601f191660200182016040528015612461576020820181803683370190505b5090508181016020015b600019016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a850494508461246b57509392505050565b6000828152600260205260408120546001600160a01b03908116908316156124ca576124ca818486612889565b6001600160a01b03811615612508576124e760008560008061195f565b6001600160a01b038116600090815260036020526040902080546000190190555b6001600160a01b03851615612537576001600160a01b0385166000908152600360205260409020805460010190555b60008481526002602052604080822080546001600160a01b0319166001600160a01b0389811691821790925591518793918516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4949350505050565b60006125a183610bec565b6000838152600760209081526040808320546001600160a01b03881684526006909252909120919250908183146125f857600083815260208281526040808320548584528184208190558352600790915290208290555b6000938452600760209081526040808620869055938552525081205550565b600854600090612629906001906131e6565b60008381526009602052604081205460088054939450909284908110612651576126516130c9565b906000526020600020015490508060088381548110612672576126726130c9565b60009182526020808320909101929092558281526009909152604080822084905585825281205560088054806126aa576126aa613464565b6001900381819060005260206000200160009055905550505050565b600060016126d384610bec565b6126dd91906131e6565b6001600160a01b039093166000908152600660209081526040808320868452825280832085905593825260079052919091209190915550565b6000806123a68585856128ed565b6001600160a01b03821661274e57604051633250574960e11b81526000600482015260240161064b565b600061275c8383600061121f565b90506001600160a01b038116156108d2576040516339e3563760e11b81526000600482015260240161064b565b600060ff8216601f81111561055557604051632cd44ac360e21b815260040160405180910390fd5b60008072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b83106127f05772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6d04ee2d6d415b85acef8100000000831061281c576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc10000831061283a57662386f26fc10000830492506010015b6305f5e1008310612852576305f5e100830492506008015b612710831061286657612710830492506004015b60648310612878576064830492506002015b600a83106105555760010192915050565b612894838383612a41565b6108d2576001600160a01b0383166128c257604051637e27328960e01b81526004810182905260240161064b565b60405163177e802f60e01b81526001600160a01b03831660048201526024810182905260440161064b565b8254600090819080156129e657600061290b876113b86001856131e6565b805490915065ffffffffffff80821691600160301b90046001600160d01b031690881682111561294e57604051632520601d60e01b815260040160405180910390fd5b8765ffffffffffff168265ffffffffffff160361298757825465ffffffffffff16600160301b6001600160d01b038916021783556129d8565b6040805180820190915265ffffffffffff808a1682526001600160d01b03808a1660208085019182528d54600181018f5560008f81529190912094519151909216600160301b029216919091179101555b94508593506123ab92505050565b50506040805180820190915265ffffffffffff80851682526001600160d01b0380851660208085019182528854600181018a5560008a815291822095519251909316600160301b0291909316179201919091559050816123ab565b60006001600160a01b03831615801590610a655750826001600160a01b0316846001600160a01b03161480612a7b5750612a7b8484611129565b80610a655750506000908152600460205260409020546001600160a01b03908116911614919050565b6001600160e01b03198116811461119257600080fd5b600060208284031215612acc57600080fd5b81356111a181612aa4565b60005b83811015612af2578181015183820152602001612ada565b50506000910152565b60008151808452612b13816020860160208601612ad7565b601f01601f19169290920160200192915050565b6020815260006111a16020830184612afb565b600060208284031215612b4c57600080fd5b5035919050565b6001600160a01b038116811461119257600080fd5b60008060408385031215612b7b57600080fd5b8235612b8681612b53565b946020939093013593505050565b600080600060608486031215612ba957600080fd5b8335612bb481612b53565b92506020840135612bc481612b53565b929592945050506040919091013590565b60ff8116811461119257600080fd5b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715612c2357612c23612be4565b604052919050565b600067ffffffffffffffff821115612c4557612c45612be4565b50601f01601f191660200190565b600082601f830112612c6457600080fd5b8135612c77612c7282612c2b565b612bfa565b818152846020838601011115612c8c57600080fd5b816020850160208301376000918101602001919091529392505050565b60008060408385031215612cbc57600080fd5b8235612cc781612bd5565b9150602083013567ffffffffffffffff811115612ce357600080fd5b612cef85828601612c53565b9150509250929050565b600060208284031215612d0b57600080fd5b81356111a181612b53565b60008060408385031215612d2957600080fd5b82359150602083013567ffffffffffffffff811115612ce357600080fd5b600060208284031215612d5957600080fd5b813567ffffffffffffffff811115612d7057600080fd5b610a6584828501612c53565b60ff60f81b881681526000602060e081840152612d9c60e084018a612afb565b8381036040850152612dae818a612afb565b606085018990526001600160a01b038816608086015260a0850187905284810360c0860152855180825283870192509083019060005b81811015612e0057835183529284019291840191600101612de4565b50909c9b505050505050505050505050565b60008060408385031215612e2557600080fd5b8235612e3081612b53565b915060208301358015158114612e4557600080fd5b809150509250929050565b60008060008060808587031215612e6657600080fd5b8435612e7181612b53565b93506020850135612e8181612b53565b925060408501359150606085013567ffffffffffffffff811115612ea457600080fd5b612eb087828801612c53565b91505092959194509250565b60008060008060008060c08789031215612ed557600080fd5b8635612ee081612b53565b955060208701359450604087013593506060870135612efe81612bd5565b9598949750929560808101359460a0909101359350915050565b60008060408385031215612f2b57600080fd5b8235612cc781612b53565b60008060408385031215612f4957600080fd5b8235612f5481612b53565b91506020830135612e4581612b53565b600181811c90821680612f7857607f821691505b602082108103612f9857634e487b7160e01b600052602260045260246000fd5b50919050565b60208082526024908201527f4f7065726174696f6e206f6e6c7920616c6c6f776564206f6e20686f6d6520636040820152633430b4b760e11b606082015260800190565b634e487b7160e01b600052602160045260246000fd5b60006020828403121561300a57600080fd5b5051919050565b6001600160a01b038516815260ff8416602082015260806040820181905260009061303e90830185612afb565b905082606083015295945050505050565b600082601f83011261306057600080fd5b815161306e612c7282612c2b565b81815284602083860101111561308357600080fd5b610a65826020830160208701612ad7565b6000602082840312156130a657600080fd5b815167ffffffffffffffff8111156130bd57600080fd5b610a658482850161304f565b634e487b7160e01b600052603260045260246000fd5b6040815260006130f26040830185612afb565b90508260208301529392505050565b6060815260006131146060830186612afb565b6001600160a01b039490941660208301525060400152919050565b60008060006060848603121561314457600080fd5b835161314f81612bd5565b602085015190935067ffffffffffffffff81111561316c57600080fd5b6131788682870161304f565b925050604084015190509250925092565b6000806040838503121561319c57600080fd5b82516131a781612b53565b602084015190925067ffffffffffffffff8111156131c457600080fd5b612cef8582860161304f565b634e487b7160e01b600052601160045260246000fd5b81810381811115610555576105556131d0565b6000806040838503121561320c57600080fd5b82519150602083015167ffffffffffffffff8111156131c457600080fd5b6001600160d01b0381811683821601908082111561324a5761324a6131d0565b5092915050565b6001600160d01b0382811682821603908082111561324a5761324a6131d0565b80820180821115610555576105556131d0565b601f8211156108d257600081815260208120601f850160051c810160208610156132ab5750805b601f850160051c820191505b8181101561177a578281556001016132b7565b815167ffffffffffffffff8111156132e4576132e4612be4565b6132f8816132f28454612f64565b84613284565b602080601f83116001811461332d57600084156133155750858301515b600019600386901b1c1916600185901b17855561177a565b600085815260208120601f198616915b8281101561335c5788860151825594840194600190910190840161333d565b508582101561337a5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60006001820161339c5761339c6131d0565b5060010190565b6001600160a01b03858116825284166020820152604081018390526080606082018190526000906133d690830184612afb565b9695505050505050565b6000602082840312156133f257600080fd5b81516111a181612aa4565b6000835161340f818460208801612ad7565b835190830190613423818360208801612ad7565b01949350505050565b634e487b7160e01b600052601260045260246000fd5b60008261345f57634e487b7160e01b600052601260045260246000fd5b500490565b634e487b7160e01b600052603160045260246000fdfea2646970667358221220475c666cec4a3d76929fe66f5295dec6d6b51ca7f07599a948d05aff52993ba064736f6c63430008140033dec2bacdd2f05b59de34da9b523dff8be42e5e38e818c82fdb0bae774387a724", - "deployedBytecode": "0x608060405234801561001057600080fd5b506004361061021c5760003560e01c806370a08231116101255780639ab24eb0116100ad578063c3cda5201161007c578063c3cda520146104eb578063c87b56dd146104fe578063d204c45e14610511578063e985e9c514610524578063f2fde38b1461053757600080fd5b80639ab24eb01461048b5780639fa92f9d1461049e578063a22cb465146104c5578063b88d4fde146104d857600080fd5b806384b0196e116100f457806384b0196e1461042e5780638da5cb5b146104495780638e539e8c1461045a57806391ddadf41461046d57806395d89b411461048357600080fd5b806370a08231146103d7578063715018a6146103ea5780637ecebe00146103f257806381b620861461041b57600080fd5b806342842e0e116101a85780634f6ccce7116101775780634f6ccce71461035f578063587cde1e14610372578063593aa2831461039e5780635c19a95c146103b15780636352211e146103c457600080fd5b806342842e0e146102fc57806342966c681461030f578063482ffa5e146103225780634bf5d7e91461033557600080fd5b806318160ddd116101ef57806318160ddd1461029e57806323b872dd146102b057806326926d46146102c35780632f745c59146102d65780633a46b1a8146102e957600080fd5b806301ffc9a71461022157806306fdde0314610249578063081812fc1461025e578063095ea7b314610289575b600080fd5b61023461022f366004612aba565b61054a565b60405190151581526020015b60405180910390f35b61025161055b565b6040516102409190612b27565b61027161026c366004612b3a565b6105ed565b6040516001600160a01b039091168152602001610240565b61029c610297366004612b68565b610616565b005b6008545b604051908152602001610240565b61029c6102be366004612b94565b610625565b61029c6102d1366004612b3a565b6106b5565b6102a26102e4366004612b68565b6107db565b6102a26102f7366004612b68565b610840565b61029c61030a366004612b94565b6108b7565b61029c61031d366004612b3a565b6108d7565b610251610330366004612ca9565b6108e3565b60408051808201909152600e81526d06d6f64653d74696d657374616d760941b6020820152610251565b6102a261036d366004612b3a565b610a6d565b610271610380366004612cf9565b6001600160a01b039081166000908152600f60205260409020541690565b61029c6103ac366004612d16565b610ac6565b61029c6103bf366004612cf9565b610bd6565b6102716103d2366004612b3a565b610be1565b6102a26103e5366004612cf9565b610bec565b61029c610c34565b6102a2610400366004612cf9565b6001600160a01b03166000908152600e602052604090205490565b61029c610429366004612d47565b610c48565b610436610e3f565b6040516102409796959493929190612d7c565b600b546001600160a01b0316610271565b6102a2610468366004612b3a565b610e85565b60405165ffffffffffff42168152602001610240565b610251610ee5565b6102a2610499366004612cf9565b610ef4565b6102a27f000000000000000000000000000000000000000000000000000000000000000081565b61029c6104d3366004612e12565b610f24565b61029c6104e6366004612e50565b610f2f565b61029c6104f9366004612ebc565b610f47565b61025161050c366004612b3a565b611004565b61029c61051f366004612f18565b61100f565b610234610532366004612f36565b611129565b61029c610545366004612cf9565b611157565b6000610555826111b4565b92915050565b60606000805461056a90612f64565b80601f016020809104026020016040519081016040528092919081815260200182805461059690612f64565b80156105e35780601f106105b8576101008083540402835291602001916105e3565b820191906000526020600020905b8154815290600101906020018083116105c657829003601f168201915b5050505050905090565b60006105f8826111d9565b506000828152600460205260409020546001600160a01b0316610555565b610621828233611212565b5050565b6001600160a01b03821661065457604051633250574960e11b8152600060048201526024015b60405180910390fd5b600061066183833361121f565b9050836001600160a01b0316816001600160a01b0316146106af576040516364283d7b60e01b81526001600160a01b038086166004830152602482018490528216604482015260640161064b565b50505050565b6106bd611295565b7f000000000000000000000000000000000000000000000000000000000000000046146106fc5760405162461bcd60e51b815260040161064b90612f9e565b604051633b0d4dd760e01b8152601360048201526001602482015260009073__$b1c1335e68417b4234016f4aa58fdfac77$__90633b0d4dd790604401602060405180830381865af4158015610756573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061077a9190612ff8565b9050600061078783610be1565b9050610792836112c2565b806001600160a01b0316837f81c00ee14a307a39bcddd8f17801cf3101f1c49c8dea9ee90ec0c04a61b5a007846040516107ce91815260200190565b60405180910390a3505050565b60006107e683610bec565b82106108175760405163295f44f760e21b81526001600160a01b03841660048201526024810183905260440161064b565b506001600160a01b03919091166000908152600660209081526040808320938352929052205490565b60004265ffffffffffff8116831061087c57604051637669fc0f60e11b81526004810184905265ffffffffffff8216602482015260440161064b565b6108a6610888846112fd565b6001600160a01b038616600090815260106020526040902090611334565b6001600160d01b0316949350505050565b6108d283838360405180602001604052806000815250610f2f565b505050565b6106216000823361121f565b60607f000000000000000000000000000000000000000000000000000000000000000046146109605760405162461bcd60e51b815260206004820152602360248201527f50726f6f6673206f6e6c792067656e657261746564206f6e20686f6d6520636860448201526230b4b760e91b606482015260840161064b565b604051630564edeb60e31b81526013600482015260ff8416602482015260009073__$b1c1335e68417b4234016f4aa58fdfac77$__90632b276f5890604401602060405180830381865af41580156109bc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109e09190612ff8565b604051637352178160e01b815290915073__$b1c1335e68417b4234016f4aa58fdfac77$__90637352178190610a20903090889088908790600401613011565b600060405180830381865af4158015610a3d573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610a659190810190613094565b949350505050565b6000610a7860085490565b8210610aa15760405163295f44f760e21b8152600060048201526024810183905260440161064b565b60088281548110610ab457610ab46130c9565b90600052602060002001549050919050565b610ace611295565b7f00000000000000000000000000000000000000000000000000000000000000004614610b0d5760405162461bcd60e51b815260040161064b90612f9e565b604051633b0d4dd760e01b8152601360048201526002602482015260009073__$b1c1335e68417b4234016f4aa58fdfac77$__90633b0d4dd790604401602060405180830381865af4158015610b67573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b8b9190612ff8565b9050610b9783836113ea565b827faef83f88d7b64742932e336e35ec4ebdbf35e2824c4cc154007911e95b72367e8383604051610bc99291906130df565b60405180910390a2505050565b33610621818361143a565b6000610555826111d9565b60006001600160a01b038216610c18576040516322718ad960e21b81526000600482015260240161064b565b506001600160a01b031660009081526003602052604090205490565b610c3c611295565b610c4660006114ac565b565b600080600073__$b1c1335e68417b4234016f4aa58fdfac77$__63c0af6591853060136040518463ffffffff1660e01b8152600401610c8993929190613101565b600060405180830381865af4158015610ca6573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610cce919081019061312f565b9194509250905060ff8316610d565760008083806020019051810190610cf49190613189565b91509150610d0282826114fe565b816001600160a01b03166001601254610d1b91906131e6565b6040518581527f22ef8ac73166382773e470f8f887ac4c54dcf377f397431fe0ac6f60261fabaf906020015b60405180910390a350506106af565b60001960ff841601610dcc57600082806020019051810190610d789190612ff8565b90506000610d8582610be1565b9050610d90826112c2565b806001600160a01b0316827f81c00ee14a307a39bcddd8f17801cf3101f1c49c8dea9ee90ec0c04a61b5a00785604051610d4791815260200190565b60011960ff8416016106af5760008083806020019051810190610def91906131f9565b91509150610dfd82826113ea565b817faef83f88d7b64742932e336e35ec4ebdbf35e2824c4cc154007911e95b72367e8285604051610e2f9291906130df565b60405180910390a2505050505050565b600060608060008060006060610e53611529565b610e5b61155b565b60408051600080825260208201909252600f60f81b9b939a50919850469750309650945092509050565b60004265ffffffffffff81168310610ec157604051637669fc0f60e11b81526004810184905265ffffffffffff8216602482015260440161064b565b610ed5610ecd846112fd565b601190611334565b6001600160d01b03169392505050565b60606001805461056a90612f64565b6001600160a01b0381166000908152601060205260408120610f1590611588565b6001600160d01b031692915050565b6106213383836115c1565b610f3a848484610625565b6106af3385858585611658565b83421115610f6b57604051632341d78760e11b81526004810185905260240161064b565b604080517fe48329057bfd03d55e49b547132e39cffd9c1820ad7b9d4c5307691425d15adf60208201526001600160a01b038816918101919091526060810186905260808101859052600090610fe590610fdd9060a00160405160208183030381529060405280519060200120611783565b8585856117b0565b9050610ff181876117de565b610ffb818861143a565b50505050505050565b606061055582611831565b611017611295565b7f000000000000000000000000000000000000000000000000000000000000000046146110565760405162461bcd60e51b815260040161064b90612f9e565b604051633b0d4dd760e01b8152601360048201526000602482018190529073__$b1c1335e68417b4234016f4aa58fdfac77$__90633b0d4dd790604401602060405180830381865af41580156110b0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110d49190612ff8565b90506110e083836114fe565b826001600160a01b031660016012546110f991906131e6565b6040518381527f22ef8ac73166382773e470f8f887ac4c54dcf377f397431fe0ac6f60261fabaf906020016107ce565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205460ff1690565b61115f611295565b6001600160a01b03811661118957604051631e4fbdf760e01b81526000600482015260240161064b565b611192816114ac565b50565b60006111a1828461322a565b9392505050565b60006111a18284613251565b60006001600160e01b03198216632483248360e11b148061055557506105558261193a565b6000818152600260205260408120546001600160a01b03168061055557604051637e27328960e01b81526004810184905260240161064b565b6108d2838383600161195f565b60006001600160a01b038216158061123e57506001600160a01b038416155b61128a5760405162461bcd60e51b815260206004820152601760248201527f4e4654206973206e6f74207472616e7366657261626c65000000000000000000604482015260640161064b565b610a65848484611a65565b600b546001600160a01b03163314610c465760405163118cdaa760e01b815233600482015260240161064b565b60006112d1600083600061121f565b90506001600160a01b03811661062157604051637e27328960e01b81526004810183905260240161064b565b600065ffffffffffff821115611330576040516306dfcc6560e41b8152603060048201526024810183905260440161064b565b5090565b81546000908181600581111561139357600061134f84611a81565b61135990856131e6565b60008881526020902090915081015465ffffffffffff908116908716101561138357809150611391565b61138e816001613271565b92505b505b60006113a187878585611bda565b905080156113dc576113c6876113b86001846131e6565b600091825260209091200190565b54600160301b90046001600160d01b03166113df565b60005b979650505050505050565b6000828152600a6020526040902061140282826132ca565b506040518281527ff8e1a15aba9398e019f0b49df1a4fde98ee17ae345cb5f6b5e2c27f5033e8ce79060200160405180910390a15050565b6001600160a01b038281166000818152600f602052604080822080548686166001600160a01b0319821681179092559151919094169392849290917f3134e8a2e6d97e929a7e54011ea5485d7d196dd5f0ba4d4ef95803e8e3fc257f9190a46108d281836114a786611c3c565b611c47565b600b80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b601280546000918261150f8361338a565b91905055905061151f8382611db3565b6108d281836113ea565b60606115567f0000000000000000000000000000000000000000000000000000000000000000600c611dcd565b905090565b60606115567f0000000000000000000000000000000000000000000000000000000000000000600d611dcd565b805460009080156115b8576115a2836113b86001846131e6565b54600160301b90046001600160d01b03166111a1565b60009392505050565b6001600160a01b0382166115f357604051630b61174360e31b81526001600160a01b038316600482015260240161064b565b6001600160a01b03838116600081815260056020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3191016107ce565b6001600160a01b0383163b1561177c57604051630a85bd0160e11b81526001600160a01b0384169063150b7a029061169a9088908890879087906004016133a3565b6020604051808303816000875af19250505080156116d5575060408051601f3d908101601f191682019092526116d2918101906133e0565b60015b61173e573d808015611703576040519150601f19603f3d011682016040523d82523d6000602084013e611708565b606091505b50805160000361173657604051633250574960e11b81526001600160a01b038516600482015260240161064b565b805181602001fd5b6001600160e01b03198116630a85bd0160e11b1461177a57604051633250574960e11b81526001600160a01b038516600482015260240161064b565b505b5050505050565b6000610555611790611e78565b8360405161190160f01b8152600281019290925260228201526042902090565b6000806000806117c288888888611fa3565b9250925092506117d28282612072565b50909695505050505050565b6001600160a01b0382166000908152600e602052604090208054600181019091558181146108d2576040516301d4b62360e61b81526001600160a01b03841660048201526024810182905260440161064b565b606061183c826111d9565b506000828152600a60205260408120805461185690612f64565b80601f016020809104026020016040519081016040528092919081815260200182805461188290612f64565b80156118cf5780601f106118a4576101008083540402835291602001916118cf565b820191906000526020600020905b8154815290600101906020018083116118b257829003601f168201915b5050505050905060006118ed60408051602081019091526000815290565b905080516000036118ff575092915050565b8151156119315780826040516020016119199291906133fd565b60405160208183030381529060405292505050919050565b610a658461212b565b60006001600160e01b0319821663780e9d6360e01b148061055557506105558261219f565b808061197357506001600160a01b03821615155b15611a35576000611983846111d9565b90506001600160a01b038316158015906119af5750826001600160a01b0316816001600160a01b031614155b80156119c257506119c08184611129565b155b156119eb5760405163a9fbf51f60e01b81526001600160a01b038416600482015260240161064b565b8115611a335783856001600160a01b0316826001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45b505b5050600090815260046020526040902080546001600160a01b0319166001600160a01b0392909216919091179055565b600080611a738585856121ef565b9050610a65818660016122bc565b600060018211611a8f575090565b816001600160801b8210611aa85760809190911c9060401b5b680100000000000000008210611ac35760409190911c9060201b5b6401000000008210611ada5760209190911c9060101b5b620100008210611aef5760109190911c9060081b5b6101008210611b035760089190911c9060041b5b60108210611b165760049190911c9060021b5b60048210611b225760011b5b600302600190811c90818581611b3a57611b3a61342c565b048201901c90506001818581611b5257611b5261342c565b048201901c90506001818581611b6a57611b6a61342c565b048201901c90506001818581611b8257611b8261342c565b048201901c90506001818581611b9a57611b9a61342c565b048201901c90506001818581611bb257611bb261342c565b048201901c9050611bd1818581611bcb57611bcb61342c565b04821190565b90039392505050565b60005b81831015611c34576000611bf18484612332565b60008781526020902090915065ffffffffffff86169082015465ffffffffffff161115611c2057809250611c2e565b611c2b816001613271565b93505b50611bdd565b509392505050565b600061055582610bec565b816001600160a01b0316836001600160a01b031614158015611c695750600081115b156108d2576001600160a01b03831615611d11576001600160a01b03831660009081526010602052604081208190611cac906111a8611ca78661234d565b612381565b6001600160d01b031691506001600160d01b03169150846001600160a01b03167fdec2bacdd2f05b59de34da9b523dff8be42e5e38e818c82fdb0bae774387a7248383604051611d06929190918252602082015260400190565b60405180910390a250505b6001600160a01b038216156108d2576001600160a01b03821660009081526010602052604081208190611d4a90611195611ca78661234d565b6001600160d01b031691506001600160d01b03169150836001600160a01b03167fdec2bacdd2f05b59de34da9b523dff8be42e5e38e818c82fdb0bae774387a7248383604051611da4929190918252602082015260400190565b60405180910390a25050505050565b6106218282604051806020016040528060008152506123b3565b606060ff8314611de757611de0836123cb565b9050610555565b818054611df390612f64565b80601f0160208091040260200160405190810160405280929190818152602001828054611e1f90612f64565b8015611e6c5780601f10611e4157610100808354040283529160200191611e6c565b820191906000526020600020905b815481529060010190602001808311611e4f57829003601f168201915b50505050509050610555565b6000306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016148015611ed157507f000000000000000000000000000000000000000000000000000000000000000046145b15611efb57507f000000000000000000000000000000000000000000000000000000000000000090565b611556604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f60208201527f0000000000000000000000000000000000000000000000000000000000000000918101919091527f000000000000000000000000000000000000000000000000000000000000000060608201524660808201523060a082015260009060c00160405160208183030381529060405280519060200120905090565b600080807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0841115611fde5750600091506003905082612068565b604080516000808252602082018084528a905260ff891692820192909252606081018790526080810186905260019060a0016020604051602081039080840390855afa158015612032573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b03811661205e57506000925060019150829050612068565b9250600091508190505b9450945094915050565b600082600381111561208657612086612fe2565b0361208f575050565b60018260038111156120a3576120a3612fe2565b036120c15760405163f645eedf60e01b815260040160405180910390fd5b60028260038111156120d5576120d5612fe2565b036120f65760405163fce698f760e01b81526004810182905260240161064b565b600382600381111561210a5761210a612fe2565b03610621576040516335e2f38360e21b81526004810182905260240161064b565b6060612136826111d9565b50600061214e60408051602081019091526000815290565b9050600081511161216e57604051806020016040528060008152506111a1565b806121788461240a565b6040516020016121899291906133fd565b6040516020818303038152906040529392505050565b60006001600160e01b031982166380ac58cd60e01b14806121d057506001600160e01b03198216635b5e139f60e01b145b8061055557506301ffc9a760e01b6001600160e01b0319831614610555565b6000806121fd85858561249d565b90506001600160a01b03811661225a5761225584600880546000838152600960205260408120829055600182018355919091527ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee30155565b61227d565b846001600160a01b0316816001600160a01b03161461227d5761227d8185612596565b6001600160a01b0385166122995761229484612617565b610a65565b846001600160a01b0316816001600160a01b031614610a6557610a6585856126c6565b6001600160a01b0383166122de576122db6011611195611ca78461234d565b50505b6001600160a01b038216612300576122fd60116111a8611ca78461234d565b50505b6001600160a01b038381166000908152600f60205260408082205485841683529120546108d292918216911683611c47565b60006123416002848418613442565b6111a190848416613271565b60006001600160d01b03821115611330576040516306dfcc6560e41b815260d060048201526024810183905260440161064b565b6000806123a64261239e61239488611588565b868863ffffffff16565b879190612716565b915091505b935093915050565b6123bd8383612724565b6108d2336000858585611658565b606060006123d883612789565b604080516020808252818301909252919250600091906020820181803683375050509182525060208101929092525090565b60606000612417836127b1565b600101905060008167ffffffffffffffff81111561243757612437612be4565b6040519080825280601f01601f191660200182016040528015612461576020820181803683370190505b5090508181016020015b600019016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a850494508461246b57509392505050565b6000828152600260205260408120546001600160a01b03908116908316156124ca576124ca818486612889565b6001600160a01b03811615612508576124e760008560008061195f565b6001600160a01b038116600090815260036020526040902080546000190190555b6001600160a01b03851615612537576001600160a01b0385166000908152600360205260409020805460010190555b60008481526002602052604080822080546001600160a01b0319166001600160a01b0389811691821790925591518793918516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4949350505050565b60006125a183610bec565b6000838152600760209081526040808320546001600160a01b03881684526006909252909120919250908183146125f857600083815260208281526040808320548584528184208190558352600790915290208290555b6000938452600760209081526040808620869055938552525081205550565b600854600090612629906001906131e6565b60008381526009602052604081205460088054939450909284908110612651576126516130c9565b906000526020600020015490508060088381548110612672576126726130c9565b60009182526020808320909101929092558281526009909152604080822084905585825281205560088054806126aa576126aa613464565b6001900381819060005260206000200160009055905550505050565b600060016126d384610bec565b6126dd91906131e6565b6001600160a01b039093166000908152600660209081526040808320868452825280832085905593825260079052919091209190915550565b6000806123a68585856128ed565b6001600160a01b03821661274e57604051633250574960e11b81526000600482015260240161064b565b600061275c8383600061121f565b90506001600160a01b038116156108d2576040516339e3563760e11b81526000600482015260240161064b565b600060ff8216601f81111561055557604051632cd44ac360e21b815260040160405180910390fd5b60008072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b83106127f05772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6d04ee2d6d415b85acef8100000000831061281c576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc10000831061283a57662386f26fc10000830492506010015b6305f5e1008310612852576305f5e100830492506008015b612710831061286657612710830492506004015b60648310612878576064830492506002015b600a83106105555760010192915050565b612894838383612a41565b6108d2576001600160a01b0383166128c257604051637e27328960e01b81526004810182905260240161064b565b60405163177e802f60e01b81526001600160a01b03831660048201526024810182905260440161064b565b8254600090819080156129e657600061290b876113b86001856131e6565b805490915065ffffffffffff80821691600160301b90046001600160d01b031690881682111561294e57604051632520601d60e01b815260040160405180910390fd5b8765ffffffffffff168265ffffffffffff160361298757825465ffffffffffff16600160301b6001600160d01b038916021783556129d8565b6040805180820190915265ffffffffffff808a1682526001600160d01b03808a1660208085019182528d54600181018f5560008f81529190912094519151909216600160301b029216919091179101555b94508593506123ab92505050565b50506040805180820190915265ffffffffffff80851682526001600160d01b0380851660208085019182528854600181018a5560008a815291822095519251909316600160301b0291909316179201919091559050816123ab565b60006001600160a01b03831615801590610a655750826001600160a01b0316846001600160a01b03161480612a7b5750612a7b8484611129565b80610a655750506000908152600460205260409020546001600160a01b03908116911614919050565b6001600160e01b03198116811461119257600080fd5b600060208284031215612acc57600080fd5b81356111a181612aa4565b60005b83811015612af2578181015183820152602001612ada565b50506000910152565b60008151808452612b13816020860160208601612ad7565b601f01601f19169290920160200192915050565b6020815260006111a16020830184612afb565b600060208284031215612b4c57600080fd5b5035919050565b6001600160a01b038116811461119257600080fd5b60008060408385031215612b7b57600080fd5b8235612b8681612b53565b946020939093013593505050565b600080600060608486031215612ba957600080fd5b8335612bb481612b53565b92506020840135612bc481612b53565b929592945050506040919091013590565b60ff8116811461119257600080fd5b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715612c2357612c23612be4565b604052919050565b600067ffffffffffffffff821115612c4557612c45612be4565b50601f01601f191660200190565b600082601f830112612c6457600080fd5b8135612c77612c7282612c2b565b612bfa565b818152846020838601011115612c8c57600080fd5b816020850160208301376000918101602001919091529392505050565b60008060408385031215612cbc57600080fd5b8235612cc781612bd5565b9150602083013567ffffffffffffffff811115612ce357600080fd5b612cef85828601612c53565b9150509250929050565b600060208284031215612d0b57600080fd5b81356111a181612b53565b60008060408385031215612d2957600080fd5b82359150602083013567ffffffffffffffff811115612ce357600080fd5b600060208284031215612d5957600080fd5b813567ffffffffffffffff811115612d7057600080fd5b610a6584828501612c53565b60ff60f81b881681526000602060e081840152612d9c60e084018a612afb565b8381036040850152612dae818a612afb565b606085018990526001600160a01b038816608086015260a0850187905284810360c0860152855180825283870192509083019060005b81811015612e0057835183529284019291840191600101612de4565b50909c9b505050505050505050505050565b60008060408385031215612e2557600080fd5b8235612e3081612b53565b915060208301358015158114612e4557600080fd5b809150509250929050565b60008060008060808587031215612e6657600080fd5b8435612e7181612b53565b93506020850135612e8181612b53565b925060408501359150606085013567ffffffffffffffff811115612ea457600080fd5b612eb087828801612c53565b91505092959194509250565b60008060008060008060c08789031215612ed557600080fd5b8635612ee081612b53565b955060208701359450604087013593506060870135612efe81612bd5565b9598949750929560808101359460a0909101359350915050565b60008060408385031215612f2b57600080fd5b8235612cc781612b53565b60008060408385031215612f4957600080fd5b8235612f5481612b53565b91506020830135612e4581612b53565b600181811c90821680612f7857607f821691505b602082108103612f9857634e487b7160e01b600052602260045260246000fd5b50919050565b60208082526024908201527f4f7065726174696f6e206f6e6c7920616c6c6f776564206f6e20686f6d6520636040820152633430b4b760e11b606082015260800190565b634e487b7160e01b600052602160045260246000fd5b60006020828403121561300a57600080fd5b5051919050565b6001600160a01b038516815260ff8416602082015260806040820181905260009061303e90830185612afb565b905082606083015295945050505050565b600082601f83011261306057600080fd5b815161306e612c7282612c2b565b81815284602083860101111561308357600080fd5b610a65826020830160208701612ad7565b6000602082840312156130a657600080fd5b815167ffffffffffffffff8111156130bd57600080fd5b610a658482850161304f565b634e487b7160e01b600052603260045260246000fd5b6040815260006130f26040830185612afb565b90508260208301529392505050565b6060815260006131146060830186612afb565b6001600160a01b039490941660208301525060400152919050565b60008060006060848603121561314457600080fd5b835161314f81612bd5565b602085015190935067ffffffffffffffff81111561316c57600080fd5b6131788682870161304f565b925050604084015190509250925092565b6000806040838503121561319c57600080fd5b82516131a781612b53565b602084015190925067ffffffffffffffff8111156131c457600080fd5b612cef8582860161304f565b634e487b7160e01b600052601160045260246000fd5b81810381811115610555576105556131d0565b6000806040838503121561320c57600080fd5b82519150602083015167ffffffffffffffff8111156131c457600080fd5b6001600160d01b0381811683821601908082111561324a5761324a6131d0565b5092915050565b6001600160d01b0382811682821603908082111561324a5761324a6131d0565b80820180821115610555576105556131d0565b601f8211156108d257600081815260208120601f850160051c810160208610156132ab5750805b601f850160051c820191505b8181101561177a578281556001016132b7565b815167ffffffffffffffff8111156132e4576132e4612be4565b6132f8816132f28454612f64565b84613284565b602080601f83116001811461332d57600084156133155750858301515b600019600386901b1c1916600185901b17855561177a565b600085815260208120601f198616915b8281101561335c5788860151825594840194600190910190840161333d565b508582101561337a5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60006001820161339c5761339c6131d0565b5060010190565b6001600160a01b03858116825284166020820152604081018390526080606082018190526000906133d690830184612afb565b9695505050505050565b6000602082840312156133f257600080fd5b81516111a181612aa4565b6000835161340f818460208801612ad7565b835190830190613423818360208801612ad7565b01949350505050565b634e487b7160e01b600052601260045260246000fd5b60008261345f57634e487b7160e01b600052601260045260246000fd5b500490565b634e487b7160e01b600052603160045260246000fdfea2646970667358221220475c666cec4a3d76929fe66f5295dec6d6b51ca7f07599a948d05aff52993ba064736f6c63430008140033", - "libraries": { - "ProofHandler": "0x0152ee45780385dACCCCB128D816031CfFe5F36B" - }, - "devdoc": { - "author": "Web3 Hackers Collective", - "custom:security-contact": "julien@strat.cc", - "details": "Uses ProofHandler library for cross-chain proof management", - "errors": { - "CheckpointUnorderedInsertion()": [ - { - "details": "A value was attempted to be inserted on a past checkpoint." - } - ], - "ECDSAInvalidSignature()": [ - { - "details": "The signature derives the `address(0)`." - } - ], - "ECDSAInvalidSignatureLength(uint256)": [ - { - "details": "The signature has an invalid length." - } - ], - "ECDSAInvalidSignatureS(bytes32)": [ - { - "details": "The signature has an S value that is in the upper half order." - } - ], - "ERC5805FutureLookup(uint256,uint48)": [ - { - "details": "Lookup to future votes is not available." - } - ], - "ERC6372InconsistentClock()": [ - { - "details": "The clock was incorrectly modified." - } - ], - "ERC721EnumerableForbiddenBatchMint()": [ - { - "details": "Batch mint is not allowed." - } - ], - "ERC721IncorrectOwner(address,uint256,address)": [ - { - "details": "Indicates an error related to the ownership over a particular token. Used in transfers.", - "params": { - "owner": "Address of the current owner of a token.", - "sender": "Address whose tokens are being transferred.", - "tokenId": "Identifier number of a token." - } - } - ], - "ERC721InsufficientApproval(address,uint256)": [ - { - "details": "Indicates a failure with the `operator`’s approval. Used in transfers.", - "params": { - "operator": "Address that may be allowed to operate on tokens without being their owner.", - "tokenId": "Identifier number of a token." - } - } - ], - "ERC721InvalidApprover(address)": [ - { - "details": "Indicates a failure with the `approver` of a token to be approved. Used in approvals.", - "params": { - "approver": "Address initiating an approval operation." - } - } - ], - "ERC721InvalidOperator(address)": [ - { - "details": "Indicates a failure with the `operator` to be approved. Used in approvals.", - "params": { - "operator": "Address that may be allowed to operate on tokens without being their owner." - } - } - ], - "ERC721InvalidOwner(address)": [ - { - "details": "Indicates that an address can't be an owner. For example, `address(0)` is a forbidden owner in ERC-20. Used in balance queries.", - "params": { - "owner": "Address of the current owner of a token." - } - } - ], - "ERC721InvalidReceiver(address)": [ - { - "details": "Indicates a failure with the token `receiver`. Used in transfers.", - "params": { - "receiver": "Address to which tokens are being transferred." - } - } - ], - "ERC721InvalidSender(address)": [ - { - "details": "Indicates a failure with the token `sender`. Used in transfers.", - "params": { - "sender": "Address whose tokens are being transferred." - } - } - ], - "ERC721NonexistentToken(uint256)": [ - { - "details": "Indicates a `tokenId` whose `owner` is the zero address.", - "params": { - "tokenId": "Identifier number of a token." - } - } - ], - "ERC721OutOfBoundsIndex(address,uint256)": [ - { - "details": "An `owner`'s token query was out of bounds for `index`. NOTE: The owner being `address(0)` indicates a global out of bounds index." - } - ], - "InvalidAccountNonce(address,uint256)": [ - { - "details": "The nonce used for an `account` is not the expected current nonce." - } - ], - "OwnableInvalidOwner(address)": [ - { - "details": "The owner is not a valid owner account. (eg. `address(0)`)" - } - ], - "OwnableUnauthorizedAccount(address)": [ - { - "details": "The caller account is not authorized to perform an operation." - } - ], - "SafeCastOverflowedUintDowncast(uint8,uint256)": [ - { - "details": "Value doesn't fit in an uint of `bits` size." - } - ], - "VotesExpiredSignature(uint256)": [ - { - "details": "The signature used has expired." - } - ] - }, - "events": { - "Approval(address,address,uint256)": { - "details": "Emitted when `owner` enables `approved` to manage the `tokenId` token." - }, - "ApprovalForAll(address,address,bool)": { - "details": "Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets." - }, - "BatchMetadataUpdate(uint256,uint256)": { - "details": "This event emits when the metadata of a range of tokens is changed. So that the third-party platforms such as NFT market could timely update the images and related attributes of the NFTs." - }, - "DelegateChanged(address,address,address)": { - "details": "Emitted when an account changes their delegate." - }, - "DelegateVotesChanged(address,uint256,uint256)": { - "details": "Emitted when a token transfer or delegate change results in changes to a delegate's number of voting units." - }, - "EIP712DomainChanged()": { - "details": "MAY be emitted to signal that the domain could have changed." - }, - "MembershipClaimed(uint256,address,uint256)": { - "params": { - "member": "The address receiving the membership", - "nonce": "Operation sequence number", - "tokenId": "The ID of the claimed token" - } - }, - "MembershipRevoked(uint256,address,uint256)": { - "params": { - "member": "The address losing membership", - "nonce": "Operation sequence number", - "tokenId": "The ID of the revoked token" - } - }, - "MetadataUpdate(uint256)": { - "details": "This event emits when the metadata of a token is changed. So that the third-party platforms such as NFT market could timely update the images and related attributes of the NFT." - }, - "MetadataUpdated(uint256,string,uint256)": { - "params": { - "newUri": "The new metadata URI", - "nonce": "Operation sequence number", - "tokenId": "The ID of the updated token" - } - }, - "Transfer(address,address,uint256)": { - "details": "Emitted when `tokenId` token is transferred from `from` to `to`." - } - }, - "kind": "dev", - "methods": { - "CLOCK_MODE()": { - "details": "Machine-readable description of the clock as specified in ERC-6372." - }, - "approve(address,uint256)": { - "details": "See {IERC721-approve}." - }, - "balanceOf(address)": { - "details": "See {IERC721-balanceOf}." - }, - "burn(uint256)": { - "details": "Burns `tokenId`. See {ERC721-_burn}. Requirements: - The caller must own `tokenId` or be an approved operator." - }, - "claimOperation(bytes)": { - "params": { - "proof": "Proof generated by home chain" - } - }, - "clock()": { - "details": "Clock used for flagging checkpoints. Can be overridden to implement timestamp based checkpoints (and voting), in which case {CLOCK_MODE} should be overridden as well to match." - }, - "constructor": { - "params": { - "_firstMembers": "Array of initial member addresses", - "_home": "Chain ID where contract is considered home", - "_name": "Token collection name", - "_symbol": "Token collection symbol", - "_uri": "Initial token URI", - "initialOwner": "Initial contract owner" - } - }, - "delegate(address)": { - "details": "Delegates votes from the sender to `delegatee`." - }, - "delegateBySig(address,uint256,uint256,uint8,bytes32,bytes32)": { - "details": "Delegates votes from signer to `delegatee`." - }, - "delegates(address)": { - "details": "Returns the delegate that `account` has chosen." - }, - "eip712Domain()": { - "details": "See {IERC-5267}." - }, - "generateOperationProof(uint8,bytes)": { - "params": { - "operationType": "Type of operation", - "params": "Operation parameters" - }, - "returns": { - "_0": "Encoded proof data" - } - }, - "getApproved(uint256)": { - "details": "See {IERC721-getApproved}." - }, - "getPastTotalSupply(uint256)": { - "details": "Returns the total supply of votes available at a specific moment in the past. If the `clock()` is configured to use block numbers, this will return the value at the end of the corresponding block. NOTE: This value is the sum of all available votes, which is not necessarily the sum of all delegated votes. Votes that have not been delegated are still part of total supply, even though they would not participate in a vote. Requirements: - `timepoint` must be in the past. If operating using block numbers, the block must be already mined." - }, - "getPastVotes(address,uint256)": { - "details": "Returns the amount of votes that `account` had at a specific moment in the past. If the `clock()` is configured to use block numbers, this will return the value at the end of the corresponding block. Requirements: - `timepoint` must be in the past. If operating using block numbers, the block must be already mined." - }, - "getVotes(address)": { - "details": "Returns the current amount of votes that `account` has." - }, - "govBurn(uint256)": { - "details": "Only callable by owner (governance) on home chain", - "params": { - "tokenId": "ID of token to burn" - } - }, - "isApprovedForAll(address,address)": { - "details": "See {IERC721-isApprovedForAll}." - }, - "name()": { - "details": "See {IERC721Metadata-name}." - }, - "nonces(address)": { - "details": "Returns the next unused nonce for an address." - }, - "owner()": { - "details": "Returns the address of the current owner." - }, - "ownerOf(uint256)": { - "details": "See {IERC721-ownerOf}." - }, - "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." - }, - "safeMint(address,string)": { - "details": "Only callable by owner (governance) on home chain", - "params": { - "to": "Address to mint token to", - "uri": "Token metadata URI" - } - }, - "safeTransferFrom(address,address,uint256)": { - "details": "See {IERC721-safeTransferFrom}." - }, - "safeTransferFrom(address,address,uint256,bytes)": { - "details": "See {IERC721-safeTransferFrom}." - }, - "setApprovalForAll(address,bool)": { - "details": "See {IERC721-setApprovalForAll}." - }, - "setMetadata(uint256,string)": { - "details": "Only callable by owner (governance) on home chain", - "params": { - "tokenId": "ID of token to update", - "uri": "New metadata URI" - } - }, - "symbol()": { - "details": "See {IERC721Metadata-symbol}." - }, - "tokenByIndex(uint256)": { - "details": "See {IERC721Enumerable-tokenByIndex}." - }, - "tokenOfOwnerByIndex(address,uint256)": { - "details": "See {IERC721Enumerable-tokenOfOwnerByIndex}." - }, - "totalSupply()": { - "details": "See {IERC721Enumerable-totalSupply}." - }, - "transferFrom(address,address,uint256)": { - "details": "See {IERC721-transferFrom}." - }, - "transferOwnership(address)": { - "details": "Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner." - } - }, - "title": "Cross-chain Membership NFT Contract", - "version": 1 - }, - "userdoc": { - "events": { - "MembershipClaimed(uint256,address,uint256)": { - "notice": "Emitted when a membership is claimed" - }, - "MembershipRevoked(uint256,address,uint256)": { - "notice": "Emitted when a membership is revoked" - }, - "MetadataUpdated(uint256,string,uint256)": { - "notice": "Emitted when metadata is updated" - } - }, - "kind": "user", - "methods": { - "claimOperation(bytes)": { - "notice": "Claims an NFT operation on a foreign chain" - }, - "constructor": { - "notice": "Initializes the NFT contract" - }, - "generateOperationProof(uint8,bytes)": { - "notice": "Generates proof for NFT operations" - }, - "govBurn(uint256)": { - "notice": "Burns token on home chain" - }, - "home()": { - "notice": "Chain ID where contract was originally deployed" - }, - "safeMint(address,string)": { - "notice": "Adds a new member on home chain" - }, - "setMetadata(uint256,string)": { - "notice": "Updates token metadata on home chain" - } - }, - "notice": "Non-transferable NFT implementation for DAO membership with cross-chain capabilities", - "version": 1 - }, - "storageLayout": { - "storage": [ - { - "astId": 4085, - "contract": "contracts/variants/crosschain/NFT.sol:NFT", - "label": "_name", - "offset": 0, - "slot": "0", - "type": "t_string_storage" - }, - { - "astId": 4087, - "contract": "contracts/variants/crosschain/NFT.sol:NFT", - "label": "_symbol", - "offset": 0, - "slot": "1", - "type": "t_string_storage" - }, - { - "astId": 4091, - "contract": "contracts/variants/crosschain/NFT.sol:NFT", - "label": "_owners", - "offset": 0, - "slot": "2", - "type": "t_mapping(t_uint256,t_address)" - }, - { - "astId": 4095, - "contract": "contracts/variants/crosschain/NFT.sol:NFT", - "label": "_balances", - "offset": 0, - "slot": "3", - "type": "t_mapping(t_address,t_uint256)" - }, - { - "astId": 4099, - "contract": "contracts/variants/crosschain/NFT.sol:NFT", - "label": "_tokenApprovals", - "offset": 0, - "slot": "4", - "type": "t_mapping(t_uint256,t_address)" - }, - { - "astId": 4105, - "contract": "contracts/variants/crosschain/NFT.sol:NFT", - "label": "_operatorApprovals", - "offset": 0, - "slot": "5", - "type": "t_mapping(t_address,t_mapping(t_address,t_bool))" - }, - { - "astId": 5192, - "contract": "contracts/variants/crosschain/NFT.sol:NFT", - "label": "_ownedTokens", - "offset": 0, - "slot": "6", - "type": "t_mapping(t_address,t_mapping(t_uint256,t_uint256))" - }, - { - "astId": 5196, - "contract": "contracts/variants/crosschain/NFT.sol:NFT", - "label": "_ownedTokensIndex", - "offset": 0, - "slot": "7", - "type": "t_mapping(t_uint256,t_uint256)" - }, - { - "astId": 5199, - "contract": "contracts/variants/crosschain/NFT.sol:NFT", - "label": "_allTokens", - "offset": 0, - "slot": "8", - "type": "t_array(t_uint256)dyn_storage" - }, - { - "astId": 5203, - "contract": "contracts/variants/crosschain/NFT.sol:NFT", - "label": "_allTokensIndex", - "offset": 0, - "slot": "9", - "type": "t_mapping(t_uint256,t_uint256)" - }, - { - "astId": 5587, - "contract": "contracts/variants/crosschain/NFT.sol:NFT", - "label": "_tokenURIs", - "offset": 0, - "slot": "10", - "type": "t_mapping(t_uint256,t_string_storage)" - }, - { - "astId": 8, - "contract": "contracts/variants/crosschain/NFT.sol:NFT", - "label": "_owner", - "offset": 0, - "slot": "11", - "type": "t_address" - }, - { - "astId": 7382, - "contract": "contracts/variants/crosschain/NFT.sol:NFT", - "label": "_nameFallback", - "offset": 0, - "slot": "12", - "type": "t_string_storage" - }, - { - "astId": 7384, - "contract": "contracts/variants/crosschain/NFT.sol:NFT", - "label": "_versionFallback", - "offset": 0, - "slot": "13", - "type": "t_string_storage" - }, - { - "astId": 6230, - "contract": "contracts/variants/crosschain/NFT.sol:NFT", - "label": "_nonces", - "offset": 0, - "slot": "14", - "type": "t_mapping(t_address,t_uint256)" - }, - { - "astId": 3269, - "contract": "contracts/variants/crosschain/NFT.sol:NFT", - "label": "_delegatee", - "offset": 0, - "slot": "15", - "type": "t_mapping(t_address,t_address)" - }, - { - "astId": 3274, - "contract": "contracts/variants/crosschain/NFT.sol:NFT", - "label": "_delegateCheckpoints", - "offset": 0, - "slot": "16", - "type": "t_mapping(t_address,t_struct(Trace208)11842_storage)" - }, - { - "astId": 3277, - "contract": "contracts/variants/crosschain/NFT.sol:NFT", - "label": "_totalCheckpoints", - "offset": 0, - "slot": "17", - "type": "t_struct(Trace208)11842_storage" - }, - { - "astId": 14159, - "contract": "contracts/variants/crosschain/NFT.sol:NFT", - "label": "_nextTokenId", - "offset": 0, - "slot": "18", - "type": "t_uint256" - }, - { - "astId": 14163, - "contract": "contracts/variants/crosschain/NFT.sol:NFT", - "label": "_proofStorage", - "offset": 0, - "slot": "19", - "type": "t_struct(ProofStorage)14687_storage" - } - ], - "types": { - "t_address": { - "encoding": "inplace", - "label": "address", - "numberOfBytes": "20" - }, - "t_array(t_struct(Checkpoint208)11847_storage)dyn_storage": { - "base": "t_struct(Checkpoint208)11847_storage", - "encoding": "dynamic_array", - "label": "struct Checkpoints.Checkpoint208[]", - "numberOfBytes": "32" - }, - "t_array(t_uint256)dyn_storage": { - "base": "t_uint256", - "encoding": "dynamic_array", - "label": "uint256[]", - "numberOfBytes": "32" - }, - "t_bool": { - "encoding": "inplace", - "label": "bool", - "numberOfBytes": "1" - }, - "t_bytes32": { - "encoding": "inplace", - "label": "bytes32", - "numberOfBytes": "32" - }, - "t_mapping(t_address,t_address)": { - "encoding": "mapping", - "key": "t_address", - "label": "mapping(address => address)", - "numberOfBytes": "32", - "value": "t_address" - }, - "t_mapping(t_address,t_bool)": { - "encoding": "mapping", - "key": "t_address", - "label": "mapping(address => bool)", - "numberOfBytes": "32", - "value": "t_bool" - }, - "t_mapping(t_address,t_mapping(t_address,t_bool))": { - "encoding": "mapping", - "key": "t_address", - "label": "mapping(address => mapping(address => bool))", - "numberOfBytes": "32", - "value": "t_mapping(t_address,t_bool)" - }, - "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_address,t_struct(Trace208)11842_storage)": { - "encoding": "mapping", - "key": "t_address", - "label": "mapping(address => struct Checkpoints.Trace208)", - "numberOfBytes": "32", - "value": "t_struct(Trace208)11842_storage" - }, - "t_mapping(t_address,t_uint256)": { - "encoding": "mapping", - "key": "t_address", - "label": "mapping(address => uint256)", - "numberOfBytes": "32", - "value": "t_uint256" - }, - "t_mapping(t_bytes32,t_bool)": { - "encoding": "mapping", - "key": "t_bytes32", - "label": "mapping(bytes32 => bool)", - "numberOfBytes": "32", - "value": "t_bool" - }, - "t_mapping(t_uint256,t_address)": { - "encoding": "mapping", - "key": "t_uint256", - "label": "mapping(uint256 => address)", - "numberOfBytes": "32", - "value": "t_address" - }, - "t_mapping(t_uint256,t_string_storage)": { - "encoding": "mapping", - "key": "t_uint256", - "label": "mapping(uint256 => string)", - "numberOfBytes": "32", - "value": "t_string_storage" - }, - "t_mapping(t_uint256,t_uint256)": { - "encoding": "mapping", - "key": "t_uint256", - "label": "mapping(uint256 => uint256)", - "numberOfBytes": "32", - "value": "t_uint256" - }, - "t_mapping(t_uint8,t_uint256)": { - "encoding": "mapping", - "key": "t_uint8", - "label": "mapping(uint8 => uint256)", - "numberOfBytes": "32", - "value": "t_uint256" - }, - "t_string_storage": { - "encoding": "bytes", - "label": "string", - "numberOfBytes": "32" - }, - "t_struct(Checkpoint208)11847_storage": { - "encoding": "inplace", - "label": "struct Checkpoints.Checkpoint208", - "members": [ - { - "astId": 11844, - "contract": "contracts/variants/crosschain/NFT.sol:NFT", - "label": "_key", - "offset": 0, - "slot": "0", - "type": "t_uint48" - }, - { - "astId": 11846, - "contract": "contracts/variants/crosschain/NFT.sol:NFT", - "label": "_value", - "offset": 6, - "slot": "0", - "type": "t_uint208" - } - ], - "numberOfBytes": "32" - }, - "t_struct(ProofStorage)14687_storage": { - "encoding": "inplace", - "label": "struct ProofHandler.ProofStorage", - "members": [ - { - "astId": 14682, - "contract": "contracts/variants/crosschain/NFT.sol:NFT", - "label": "updateAppliedOnChain", - "offset": 0, - "slot": "0", - "type": "t_mapping(t_bytes32,t_bool)" - }, - { - "astId": 14686, - "contract": "contracts/variants/crosschain/NFT.sol:NFT", - "label": "currentNonce", - "offset": 0, - "slot": "1", - "type": "t_mapping(t_uint8,t_uint256)" - } - ], - "numberOfBytes": "64" - }, - "t_struct(Trace208)11842_storage": { - "encoding": "inplace", - "label": "struct Checkpoints.Trace208", - "members": [ - { - "astId": 11841, - "contract": "contracts/variants/crosschain/NFT.sol:NFT", - "label": "_checkpoints", - "offset": 0, - "slot": "0", - "type": "t_array(t_struct(Checkpoint208)11847_storage)dyn_storage" - } - ], - "numberOfBytes": "32" - }, - "t_uint208": { - "encoding": "inplace", - "label": "uint208", - "numberOfBytes": "26" - }, - "t_uint256": { - "encoding": "inplace", - "label": "uint256", - "numberOfBytes": "32" - }, - "t_uint48": { - "encoding": "inplace", - "label": "uint48", - "numberOfBytes": "6" - }, - "t_uint8": { - "encoding": "inplace", - "label": "uint8", - "numberOfBytes": "1" - } - } - } -} \ No newline at end of file diff --git a/deployments/op-sepolia/.chainId b/deployments/opSepolia/.chainId similarity index 100% rename from deployments/op-sepolia/.chainId rename to deployments/opSepolia/.chainId diff --git a/deployments/opSepolia/CrosschainGov.json b/deployments/opSepolia/CrosschainGov.json new file mode 100644 index 0000000..94e470b --- /dev/null +++ b/deployments/opSepolia/CrosschainGov.json @@ -0,0 +1,2520 @@ +{ + "address": "0x3F92DdC0c99d9B873C424f4066F252adb72192D9", + "abi": [ + { + "inputs": [ + { + "internalType": "uint256", + "name": "_home", + "type": "uint256" + }, + { + "internalType": "contract IVotes", + "name": "_token", + "type": "address" + }, + { + "internalType": "string", + "name": "_manifestoCid", + "type": "string" + }, + { + "internalType": "string", + "name": "_name", + "type": "string" + }, + { + "internalType": "uint48", + "name": "_votingDelay", + "type": "uint48" + }, + { + "internalType": "uint32", + "name": "_votingPeriod", + "type": "uint32" + }, + { + "internalType": "uint256", + "name": "_proposalThreshold", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_quorum", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [], + "name": "CheckpointUnorderedInsertion", + "type": "error" + }, + { + "inputs": [], + "name": "FailedCall", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "voter", + "type": "address" + } + ], + "name": "GovernorAlreadyCastVote", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "proposalId", + "type": "uint256" + } + ], + "name": "GovernorAlreadyQueuedProposal", + "type": "error" + }, + { + "inputs": [], + "name": "GovernorDisabledDeposit", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "proposer", + "type": "address" + }, + { + "internalType": "uint256", + "name": "votes", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "threshold", + "type": "uint256" + } + ], + "name": "GovernorInsufficientProposerVotes", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "targets", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "calldatas", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "values", + "type": "uint256" + } + ], + "name": "GovernorInvalidProposalLength", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "quorumNumerator", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "quorumDenominator", + "type": "uint256" + } + ], + "name": "GovernorInvalidQuorumFraction", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "voter", + "type": "address" + } + ], + "name": "GovernorInvalidSignature", + "type": "error" + }, + { + "inputs": [], + "name": "GovernorInvalidVoteParams", + "type": "error" + }, + { + "inputs": [], + "name": "GovernorInvalidVoteType", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "votingPeriod", + "type": "uint256" + } + ], + "name": "GovernorInvalidVotingPeriod", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "proposalId", + "type": "uint256" + } + ], + "name": "GovernorNonexistentProposal", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "proposalId", + "type": "uint256" + } + ], + "name": "GovernorNotQueuedProposal", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "GovernorOnlyExecutor", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "GovernorOnlyProposer", + "type": "error" + }, + { + "inputs": [], + "name": "GovernorQueueNotImplemented", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "proposer", + "type": "address" + } + ], + "name": "GovernorRestrictedProposer", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "proposalId", + "type": "uint256" + }, + { + "internalType": "enum IGovernor.ProposalState", + "name": "current", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "expectedStates", + "type": "bytes32" + } + ], + "name": "GovernorUnexpectedProposalState", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "currentNonce", + "type": "uint256" + } + ], + "name": "InvalidAccountNonce", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidShortString", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint8", + "name": "bits", + "type": "uint8" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "SafeCastOverflowedUintDowncast", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "str", + "type": "string" + } + ], + "name": "StringTooLong", + "type": "error" + }, + { + "anonymous": false, + "inputs": [], + "name": "EIP712DomainChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "enum Gov.OperationType", + "name": "operationType", + "type": "uint8" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "oldValue", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newValue", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + } + ], + "name": "GovernanceParameterUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "string", + "name": "oldManifesto", + "type": "string" + }, + { + "indexed": false, + "internalType": "string", + "name": "newManifesto", + "type": "string" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + } + ], + "name": "ManifestoUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "proposalId", + "type": "uint256" + } + ], + "name": "ProposalCanceled", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "proposalId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "address", + "name": "proposer", + "type": "address" + }, + { + "indexed": false, + "internalType": "address[]", + "name": "targets", + "type": "address[]" + }, + { + "indexed": false, + "internalType": "uint256[]", + "name": "values", + "type": "uint256[]" + }, + { + "indexed": false, + "internalType": "string[]", + "name": "signatures", + "type": "string[]" + }, + { + "indexed": false, + "internalType": "bytes[]", + "name": "calldatas", + "type": "bytes[]" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "voteStart", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "voteEnd", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "string", + "name": "description", + "type": "string" + } + ], + "name": "ProposalCreated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "proposalId", + "type": "uint256" + } + ], + "name": "ProposalExecuted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "proposalId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "etaSeconds", + "type": "uint256" + } + ], + "name": "ProposalQueued", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "oldProposalThreshold", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newProposalThreshold", + "type": "uint256" + } + ], + "name": "ProposalThresholdSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "oldQuorumNumerator", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newQuorumNumerator", + "type": "uint256" + } + ], + "name": "QuorumNumeratorUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "voter", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "proposalId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint8", + "name": "support", + "type": "uint8" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "weight", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "string", + "name": "reason", + "type": "string" + } + ], + "name": "VoteCast", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "voter", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "proposalId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint8", + "name": "support", + "type": "uint8" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "weight", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "string", + "name": "reason", + "type": "string" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "params", + "type": "bytes" + } + ], + "name": "VoteCastWithParams", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "oldVotingDelay", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newVotingDelay", + "type": "uint256" + } + ], + "name": "VotingDelaySet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "oldVotingPeriod", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newVotingPeriod", + "type": "uint256" + } + ], + "name": "VotingPeriodSet", + "type": "event" + }, + { + "inputs": [], + "name": "BALLOT_TYPEHASH", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "CLOCK_MODE", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "COUNTING_MODE", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [], + "name": "EXTENDED_BALLOT_TYPEHASH", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "targets", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "values", + "type": "uint256[]" + }, + { + "internalType": "bytes[]", + "name": "calldatas", + "type": "bytes[]" + }, + { + "internalType": "bytes32", + "name": "descriptionHash", + "type": "bytes32" + } + ], + "name": "cancel", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "proposalId", + "type": "uint256" + }, + { + "internalType": "uint8", + "name": "support", + "type": "uint8" + } + ], + "name": "castVote", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "proposalId", + "type": "uint256" + }, + { + "internalType": "uint8", + "name": "support", + "type": "uint8" + }, + { + "internalType": "address", + "name": "voter", + "type": "address" + }, + { + "internalType": "bytes", + "name": "signature", + "type": "bytes" + } + ], + "name": "castVoteBySig", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "proposalId", + "type": "uint256" + }, + { + "internalType": "uint8", + "name": "support", + "type": "uint8" + }, + { + "internalType": "string", + "name": "reason", + "type": "string" + } + ], + "name": "castVoteWithReason", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "proposalId", + "type": "uint256" + }, + { + "internalType": "uint8", + "name": "support", + "type": "uint8" + }, + { + "internalType": "string", + "name": "reason", + "type": "string" + }, + { + "internalType": "bytes", + "name": "params", + "type": "bytes" + } + ], + "name": "castVoteWithReasonAndParams", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "proposalId", + "type": "uint256" + }, + { + "internalType": "uint8", + "name": "support", + "type": "uint8" + }, + { + "internalType": "address", + "name": "voter", + "type": "address" + }, + { + "internalType": "string", + "name": "reason", + "type": "string" + }, + { + "internalType": "bytes", + "name": "params", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "signature", + "type": "bytes" + } + ], + "name": "castVoteWithReasonAndParamsBySig", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "proof", + "type": "bytes" + } + ], + "name": "claimParameterUpdate", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "clock", + "outputs": [ + { + "internalType": "uint48", + "name": "", + "type": "uint48" + } + ], + "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": [ + { + "internalType": "address[]", + "name": "targets", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "values", + "type": "uint256[]" + }, + { + "internalType": "bytes[]", + "name": "calldatas", + "type": "bytes[]" + }, + { + "internalType": "bytes32", + "name": "descriptionHash", + "type": "bytes32" + } + ], + "name": "execute", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint8", + "name": "operationType", + "type": "uint8" + }, + { + "internalType": "bytes", + "name": "value", + "type": "bytes" + } + ], + "name": "generateParameterProof", + "outputs": [ + { + "internalType": "bytes", + "name": "proof", + "type": "bytes" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "timepoint", + "type": "uint256" + } + ], + "name": "getVotes", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "timepoint", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "params", + "type": "bytes" + } + ], + "name": "getVotesWithParams", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "proposalId", + "type": "uint256" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "hasVoted", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "targets", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "values", + "type": "uint256[]" + }, + { + "internalType": "bytes[]", + "name": "calldatas", + "type": "bytes[]" + }, + { + "internalType": "bytes32", + "name": "descriptionHash", + "type": "bytes32" + } + ], + "name": "hashProposal", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [], + "name": "home", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "manifesto", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "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": "", + "type": "address" + }, + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "uint256[]", + "name": "", + "type": "uint256[]" + }, + { + "internalType": "uint256[]", + "name": "", + "type": "uint256[]" + }, + { + "internalType": "bytes", + "name": "", + "type": "bytes" + } + ], + "name": "onERC1155BatchReceived", + "outputs": [ + { + "internalType": "bytes4", + "name": "", + "type": "bytes4" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "", + "type": "bytes" + } + ], + "name": "onERC1155Received", + "outputs": [ + { + "internalType": "bytes4", + "name": "", + "type": "bytes4" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "", + "type": "bytes" + } + ], + "name": "onERC721Received", + "outputs": [ + { + "internalType": "bytes4", + "name": "", + "type": "bytes4" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "proposalId", + "type": "uint256" + } + ], + "name": "proposalDeadline", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "proposalId", + "type": "uint256" + } + ], + "name": "proposalEta", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "proposalNeedsQueuing", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "proposalId", + "type": "uint256" + } + ], + "name": "proposalProposer", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "proposalId", + "type": "uint256" + } + ], + "name": "proposalSnapshot", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "proposalThreshold", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "proposalId", + "type": "uint256" + } + ], + "name": "proposalVotes", + "outputs": [ + { + "internalType": "uint256", + "name": "againstVotes", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "forVotes", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "abstainVotes", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "targets", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "values", + "type": "uint256[]" + }, + { + "internalType": "bytes[]", + "name": "calldatas", + "type": "bytes[]" + }, + { + "internalType": "string", + "name": "description", + "type": "string" + } + ], + "name": "propose", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "targets", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "values", + "type": "uint256[]" + }, + { + "internalType": "bytes[]", + "name": "calldatas", + "type": "bytes[]" + }, + { + "internalType": "bytes32", + "name": "descriptionHash", + "type": "bytes32" + } + ], + "name": "queue", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "blockNumber", + "type": "uint256" + } + ], + "name": "quorum", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "quorumDenominator", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "timepoint", + "type": "uint256" + } + ], + "name": "quorumNumerator", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "quorumNumerator", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "target", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "relay", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "newManifesto", + "type": "string" + } + ], + "name": "setManifesto", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "newProposalThreshold", + "type": "uint256" + } + ], + "name": "setProposalThreshold", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint48", + "name": "newVotingDelay", + "type": "uint48" + } + ], + "name": "setVotingDelay", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "newVotingPeriod", + "type": "uint32" + } + ], + "name": "setVotingPeriod", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "proposalId", + "type": "uint256" + } + ], + "name": "state", + "outputs": [ + { + "internalType": "enum IGovernor.ProposalState", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "interfaceId", + "type": "bytes4" + } + ], + "name": "supportsInterface", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "token", + "outputs": [ + { + "internalType": "contract IERC5805", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "newQuorumNumerator", + "type": "uint256" + } + ], + "name": "updateQuorumNumerator", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "version", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "votingDelay", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "votingPeriod", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "stateMutability": "payable", + "type": "receive" + } + ], + "args": [ + 11155111, + "0x8583CEbA0d2C5cAe1a1BCff975Faa97063D14953", + "https://bafkreifnnreoxxgkhty7v2w3qwiie6cfxpv3vcco2xldekfvbiem3nm6dm.ipfs.w3s.link/", + "Test DAO", + 0, + 200, + 1, + 5 + ], + "numDeployments": 1, + "solcInputHash": "77ec5f062950e8c4875fd27ffb65d267", + "metadata": "{\"compiler\":{\"version\":\"0.8.20+commit.a1b79de6\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_home\",\"type\":\"uint256\"},{\"internalType\":\"contract IVotes\",\"name\":\"_token\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"_manifestoCid\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"_name\",\"type\":\"string\"},{\"internalType\":\"uint48\",\"name\":\"_votingDelay\",\"type\":\"uint48\"},{\"internalType\":\"uint32\",\"name\":\"_votingPeriod\",\"type\":\"uint32\"},{\"internalType\":\"uint256\",\"name\":\"_proposalThreshold\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_quorum\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"CheckpointUnorderedInsertion\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"FailedCall\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"voter\",\"type\":\"address\"}],\"name\":\"GovernorAlreadyCastVote\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"proposalId\",\"type\":\"uint256\"}],\"name\":\"GovernorAlreadyQueuedProposal\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"GovernorDisabledDeposit\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"proposer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"votes\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"threshold\",\"type\":\"uint256\"}],\"name\":\"GovernorInsufficientProposerVotes\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"targets\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"calldatas\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"values\",\"type\":\"uint256\"}],\"name\":\"GovernorInvalidProposalLength\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"quorumNumerator\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"quorumDenominator\",\"type\":\"uint256\"}],\"name\":\"GovernorInvalidQuorumFraction\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"voter\",\"type\":\"address\"}],\"name\":\"GovernorInvalidSignature\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"GovernorInvalidVoteParams\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"GovernorInvalidVoteType\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"votingPeriod\",\"type\":\"uint256\"}],\"name\":\"GovernorInvalidVotingPeriod\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"proposalId\",\"type\":\"uint256\"}],\"name\":\"GovernorNonexistentProposal\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"proposalId\",\"type\":\"uint256\"}],\"name\":\"GovernorNotQueuedProposal\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"GovernorOnlyExecutor\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"GovernorOnlyProposer\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"GovernorQueueNotImplemented\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"proposer\",\"type\":\"address\"}],\"name\":\"GovernorRestrictedProposer\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"proposalId\",\"type\":\"uint256\"},{\"internalType\":\"enum IGovernor.ProposalState\",\"name\":\"current\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"expectedStates\",\"type\":\"bytes32\"}],\"name\":\"GovernorUnexpectedProposalState\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"currentNonce\",\"type\":\"uint256\"}],\"name\":\"InvalidAccountNonce\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidShortString\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint8\",\"name\":\"bits\",\"type\":\"uint8\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"SafeCastOverflowedUintDowncast\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"str\",\"type\":\"string\"}],\"name\":\"StringTooLong\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[],\"name\":\"EIP712DomainChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"enum Gov.OperationType\",\"name\":\"operationType\",\"type\":\"uint8\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"oldValue\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newValue\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"}],\"name\":\"GovernanceParameterUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"string\",\"name\":\"oldManifesto\",\"type\":\"string\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"newManifesto\",\"type\":\"string\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"}],\"name\":\"ManifestoUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"proposalId\",\"type\":\"uint256\"}],\"name\":\"ProposalCanceled\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"proposalId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"proposer\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address[]\",\"name\":\"targets\",\"type\":\"address[]\"},{\"indexed\":false,\"internalType\":\"uint256[]\",\"name\":\"values\",\"type\":\"uint256[]\"},{\"indexed\":false,\"internalType\":\"string[]\",\"name\":\"signatures\",\"type\":\"string[]\"},{\"indexed\":false,\"internalType\":\"bytes[]\",\"name\":\"calldatas\",\"type\":\"bytes[]\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"voteStart\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"voteEnd\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"description\",\"type\":\"string\"}],\"name\":\"ProposalCreated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"proposalId\",\"type\":\"uint256\"}],\"name\":\"ProposalExecuted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"proposalId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"etaSeconds\",\"type\":\"uint256\"}],\"name\":\"ProposalQueued\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"oldProposalThreshold\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newProposalThreshold\",\"type\":\"uint256\"}],\"name\":\"ProposalThresholdSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"oldQuorumNumerator\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newQuorumNumerator\",\"type\":\"uint256\"}],\"name\":\"QuorumNumeratorUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"voter\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"proposalId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"support\",\"type\":\"uint8\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"weight\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"reason\",\"type\":\"string\"}],\"name\":\"VoteCast\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"voter\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"proposalId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"support\",\"type\":\"uint8\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"weight\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"reason\",\"type\":\"string\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"params\",\"type\":\"bytes\"}],\"name\":\"VoteCastWithParams\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"oldVotingDelay\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newVotingDelay\",\"type\":\"uint256\"}],\"name\":\"VotingDelaySet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"oldVotingPeriod\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newVotingPeriod\",\"type\":\"uint256\"}],\"name\":\"VotingPeriodSet\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"BALLOT_TYPEHASH\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"CLOCK_MODE\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"COUNTING_MODE\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"EXTENDED_BALLOT_TYPEHASH\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"targets\",\"type\":\"address[]\"},{\"internalType\":\"uint256[]\",\"name\":\"values\",\"type\":\"uint256[]\"},{\"internalType\":\"bytes[]\",\"name\":\"calldatas\",\"type\":\"bytes[]\"},{\"internalType\":\"bytes32\",\"name\":\"descriptionHash\",\"type\":\"bytes32\"}],\"name\":\"cancel\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"proposalId\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"support\",\"type\":\"uint8\"}],\"name\":\"castVote\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"proposalId\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"support\",\"type\":\"uint8\"},{\"internalType\":\"address\",\"name\":\"voter\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"signature\",\"type\":\"bytes\"}],\"name\":\"castVoteBySig\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"proposalId\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"support\",\"type\":\"uint8\"},{\"internalType\":\"string\",\"name\":\"reason\",\"type\":\"string\"}],\"name\":\"castVoteWithReason\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"proposalId\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"support\",\"type\":\"uint8\"},{\"internalType\":\"string\",\"name\":\"reason\",\"type\":\"string\"},{\"internalType\":\"bytes\",\"name\":\"params\",\"type\":\"bytes\"}],\"name\":\"castVoteWithReasonAndParams\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"proposalId\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"support\",\"type\":\"uint8\"},{\"internalType\":\"address\",\"name\":\"voter\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"reason\",\"type\":\"string\"},{\"internalType\":\"bytes\",\"name\":\"params\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"signature\",\"type\":\"bytes\"}],\"name\":\"castVoteWithReasonAndParamsBySig\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"proof\",\"type\":\"bytes\"}],\"name\":\"claimParameterUpdate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"clock\",\"outputs\":[{\"internalType\":\"uint48\",\"name\":\"\",\"type\":\"uint48\"}],\"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\":[{\"internalType\":\"address[]\",\"name\":\"targets\",\"type\":\"address[]\"},{\"internalType\":\"uint256[]\",\"name\":\"values\",\"type\":\"uint256[]\"},{\"internalType\":\"bytes[]\",\"name\":\"calldatas\",\"type\":\"bytes[]\"},{\"internalType\":\"bytes32\",\"name\":\"descriptionHash\",\"type\":\"bytes32\"}],\"name\":\"execute\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint8\",\"name\":\"operationType\",\"type\":\"uint8\"},{\"internalType\":\"bytes\",\"name\":\"value\",\"type\":\"bytes\"}],\"name\":\"generateParameterProof\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"proof\",\"type\":\"bytes\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"timepoint\",\"type\":\"uint256\"}],\"name\":\"getVotes\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"timepoint\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"params\",\"type\":\"bytes\"}],\"name\":\"getVotesWithParams\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"proposalId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"hasVoted\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"targets\",\"type\":\"address[]\"},{\"internalType\":\"uint256[]\",\"name\":\"values\",\"type\":\"uint256[]\"},{\"internalType\":\"bytes[]\",\"name\":\"calldatas\",\"type\":\"bytes[]\"},{\"internalType\":\"bytes32\",\"name\":\"descriptionHash\",\"type\":\"bytes32\"}],\"name\":\"hashProposal\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"home\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"manifesto\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"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\":\"\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"uint256[]\",\"name\":\"\",\"type\":\"uint256[]\"},{\"internalType\":\"uint256[]\",\"name\":\"\",\"type\":\"uint256[]\"},{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"name\":\"onERC1155BatchReceived\",\"outputs\":[{\"internalType\":\"bytes4\",\"name\":\"\",\"type\":\"bytes4\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"name\":\"onERC1155Received\",\"outputs\":[{\"internalType\":\"bytes4\",\"name\":\"\",\"type\":\"bytes4\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"name\":\"onERC721Received\",\"outputs\":[{\"internalType\":\"bytes4\",\"name\":\"\",\"type\":\"bytes4\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"proposalId\",\"type\":\"uint256\"}],\"name\":\"proposalDeadline\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"proposalId\",\"type\":\"uint256\"}],\"name\":\"proposalEta\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"proposalNeedsQueuing\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"proposalId\",\"type\":\"uint256\"}],\"name\":\"proposalProposer\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"proposalId\",\"type\":\"uint256\"}],\"name\":\"proposalSnapshot\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"proposalThreshold\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"proposalId\",\"type\":\"uint256\"}],\"name\":\"proposalVotes\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"againstVotes\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"forVotes\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"abstainVotes\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"targets\",\"type\":\"address[]\"},{\"internalType\":\"uint256[]\",\"name\":\"values\",\"type\":\"uint256[]\"},{\"internalType\":\"bytes[]\",\"name\":\"calldatas\",\"type\":\"bytes[]\"},{\"internalType\":\"string\",\"name\":\"description\",\"type\":\"string\"}],\"name\":\"propose\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"targets\",\"type\":\"address[]\"},{\"internalType\":\"uint256[]\",\"name\":\"values\",\"type\":\"uint256[]\"},{\"internalType\":\"bytes[]\",\"name\":\"calldatas\",\"type\":\"bytes[]\"},{\"internalType\":\"bytes32\",\"name\":\"descriptionHash\",\"type\":\"bytes32\"}],\"name\":\"queue\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"blockNumber\",\"type\":\"uint256\"}],\"name\":\"quorum\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"quorumDenominator\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"timepoint\",\"type\":\"uint256\"}],\"name\":\"quorumNumerator\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"quorumNumerator\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"target\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"relay\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"newManifesto\",\"type\":\"string\"}],\"name\":\"setManifesto\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"newProposalThreshold\",\"type\":\"uint256\"}],\"name\":\"setProposalThreshold\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint48\",\"name\":\"newVotingDelay\",\"type\":\"uint48\"}],\"name\":\"setVotingDelay\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"newVotingPeriod\",\"type\":\"uint32\"}],\"name\":\"setVotingPeriod\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"proposalId\",\"type\":\"uint256\"}],\"name\":\"state\",\"outputs\":[{\"internalType\":\"enum IGovernor.ProposalState\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"interfaceId\",\"type\":\"bytes4\"}],\"name\":\"supportsInterface\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"token\",\"outputs\":[{\"internalType\":\"contract IERC5805\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"newQuorumNumerator\",\"type\":\"uint256\"}],\"name\":\"updateQuorumNumerator\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"version\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"votingDelay\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"votingPeriod\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"author\":\"Web3 Hackers Collective\",\"custom:security-contact\":\"julien@strat.cc\",\"details\":\"Extends OpenZeppelin's Governor contract with cross-chain parameter updates\",\"errors\":{\"CheckpointUnorderedInsertion()\":[{\"details\":\"A value was attempted to be inserted on a past checkpoint.\"}],\"FailedCall()\":[{\"details\":\"A call to an address target failed. The target may have reverted.\"}],\"GovernorAlreadyCastVote(address)\":[{\"details\":\"The vote was already cast.\"}],\"GovernorAlreadyQueuedProposal(uint256)\":[{\"details\":\"The proposal has already been queued.\"}],\"GovernorDisabledDeposit()\":[{\"details\":\"Token deposits are disabled in this contract.\"}],\"GovernorInsufficientProposerVotes(address,uint256,uint256)\":[{\"details\":\"The `proposer` does not have the required votes to create a proposal.\"}],\"GovernorInvalidProposalLength(uint256,uint256,uint256)\":[{\"details\":\"Empty proposal or a mismatch between the parameters length for a proposal call.\"}],\"GovernorInvalidQuorumFraction(uint256,uint256)\":[{\"details\":\"The quorum set is not a valid fraction.\"}],\"GovernorInvalidSignature(address)\":[{\"details\":\"The provided signature is not valid for the expected `voter`. If the `voter` is a contract, the signature is not valid using {IERC1271-isValidSignature}.\"}],\"GovernorInvalidVoteParams()\":[{\"details\":\"The provided params buffer is not supported by the counting module.\"}],\"GovernorInvalidVoteType()\":[{\"details\":\"The vote type used is not valid for the corresponding counting module.\"}],\"GovernorInvalidVotingPeriod(uint256)\":[{\"details\":\"The voting period set is not a valid period.\"}],\"GovernorNonexistentProposal(uint256)\":[{\"details\":\"The `proposalId` doesn't exist.\"}],\"GovernorNotQueuedProposal(uint256)\":[{\"details\":\"The proposal hasn't been queued yet.\"}],\"GovernorOnlyExecutor(address)\":[{\"details\":\"The `account` is not the governance executor.\"}],\"GovernorOnlyProposer(address)\":[{\"details\":\"The `account` is not a proposer.\"}],\"GovernorQueueNotImplemented()\":[{\"details\":\"Queue operation is not implemented for this governor. Execute should be called directly.\"}],\"GovernorRestrictedProposer(address)\":[{\"details\":\"The `proposer` is not allowed to create a proposal.\"}],\"GovernorUnexpectedProposalState(uint256,uint8,bytes32)\":[{\"details\":\"The current state of a proposal is not the required for performing an operation. The `expectedStates` is a bitmap with the bits enabled for each ProposalState enum position counting from right to left. NOTE: If `expectedState` is `bytes32(0)`, the proposal is expected to not be in any state (i.e. not exist). This is the case when a proposal that is expected to be unset is already initiated (the proposal is duplicated). See {Governor-_encodeStateBitmap}.\"}],\"InvalidAccountNonce(address,uint256)\":[{\"details\":\"The nonce used for an `account` is not the expected current nonce.\"}],\"SafeCastOverflowedUintDowncast(uint8,uint256)\":[{\"details\":\"Value doesn't fit in an uint of `bits` size.\"}]},\"events\":{\"EIP712DomainChanged()\":{\"details\":\"MAY be emitted to signal that the domain could have changed.\"},\"GovernanceParameterUpdated(uint8,uint256,uint256,uint256)\":{\"params\":{\"newValue\":\"New value\",\"nonce\":\"Update sequence number\",\"oldValue\":\"Previous value\",\"operationType\":\"Type of parameter updated\"}},\"ManifestoUpdated(string,string,uint256)\":{\"params\":{\"newManifesto\":\"New manifesto CID\",\"nonce\":\"Update sequence number\",\"oldManifesto\":\"Previous manifesto CID\"}},\"ProposalCanceled(uint256)\":{\"details\":\"Emitted when a proposal is canceled.\"},\"ProposalCreated(uint256,address,address[],uint256[],string[],bytes[],uint256,uint256,string)\":{\"details\":\"Emitted when a proposal is created.\"},\"ProposalExecuted(uint256)\":{\"details\":\"Emitted when a proposal is executed.\"},\"ProposalQueued(uint256,uint256)\":{\"details\":\"Emitted when a proposal is queued.\"},\"VoteCast(address,uint256,uint8,uint256,string)\":{\"details\":\"Emitted when a vote is cast without params. Note: `support` values should be seen as buckets. Their interpretation depends on the voting module used.\"},\"VoteCastWithParams(address,uint256,uint8,uint256,string,bytes)\":{\"details\":\"Emitted when a vote is cast with params. Note: `support` values should be seen as buckets. Their interpretation depends on the voting module used. `params` are additional encoded parameters. Their interpretation also depends on the voting module used.\"}},\"kind\":\"dev\",\"methods\":{\"CLOCK_MODE()\":{\"details\":\"Machine-readable description of the clock as specified in ERC-6372.\"},\"COUNTING_MODE()\":{\"details\":\"See {IGovernor-COUNTING_MODE}.\"},\"cancel(address[],uint256[],bytes[],bytes32)\":{\"details\":\"See {IGovernor-cancel}.\"},\"castVote(uint256,uint8)\":{\"details\":\"See {IGovernor-castVote}.\"},\"castVoteBySig(uint256,uint8,address,bytes)\":{\"details\":\"See {IGovernor-castVoteBySig}.\"},\"castVoteWithReason(uint256,uint8,string)\":{\"details\":\"See {IGovernor-castVoteWithReason}.\"},\"castVoteWithReasonAndParams(uint256,uint8,string,bytes)\":{\"details\":\"See {IGovernor-castVoteWithReasonAndParams}.\"},\"castVoteWithReasonAndParamsBySig(uint256,uint8,address,string,bytes,bytes)\":{\"details\":\"See {IGovernor-castVoteWithReasonAndParamsBySig}.\"},\"claimParameterUpdate(bytes)\":{\"params\":{\"proof\":\"Proof generated by home chain\"}},\"clock()\":{\"details\":\"Clock (as specified in ERC-6372) is set to match the token's clock. Fallback to block numbers if the token does not implement ERC-6372.\"},\"constructor\":{\"details\":\"Sets up initial governance parameters and manifesto\",\"params\":{\"_home\":\"Chain ID where this contract is considered home\",\"_manifestoCid\":\"Initial manifesto CID\",\"_name\":\"Name of the governance contract\",\"_proposalThreshold\":\"Minimum votes needed to create a proposal\",\"_quorum\":\"Minimum participation percentage required\",\"_token\":\"The voting token contract address\",\"_votingDelay\":\"Time before voting begins\",\"_votingPeriod\":\"Duration of voting period\"}},\"eip712Domain()\":{\"details\":\"See {IERC-5267}.\"},\"execute(address[],uint256[],bytes[],bytes32)\":{\"details\":\"See {IGovernor-execute}.\"},\"generateParameterProof(uint8,bytes)\":{\"params\":{\"operationType\":\"Type of parameter being updated\",\"value\":\"Encoded parameter value\"},\"returns\":{\"proof\":\"Encoded proof data\"}},\"getVotes(address,uint256)\":{\"details\":\"See {IGovernor-getVotes}.\"},\"getVotesWithParams(address,uint256,bytes)\":{\"details\":\"See {IGovernor-getVotesWithParams}.\"},\"hasVoted(uint256,address)\":{\"details\":\"See {IGovernor-hasVoted}.\"},\"hashProposal(address[],uint256[],bytes[],bytes32)\":{\"details\":\"See {IGovernor-hashProposal}. The proposal id is produced by hashing the ABI encoded `targets` array, the `values` array, the `calldatas` array and the descriptionHash (bytes32 which itself is the keccak256 hash of the description string). This proposal id can be produced from the proposal data which is part of the {ProposalCreated} event. It can even be computed in advance, before the proposal is submitted. Note that the chainId and the governor address are not part of the proposal id computation. Consequently, the same proposal (with same operation and same description) will have the same id if submitted on multiple governors across multiple networks. This also means that in order to execute the same operation twice (on the same governor) the proposer will have to change the description in order to avoid proposal id conflicts.\"},\"name()\":{\"details\":\"See {IGovernor-name}.\"},\"nonces(address)\":{\"details\":\"Returns the next unused nonce for an address.\"},\"onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)\":{\"details\":\"See {IERC1155Receiver-onERC1155BatchReceived}. Receiving tokens is disabled if the governance executor is other than the governor itself (eg. when using with a timelock).\"},\"onERC1155Received(address,address,uint256,uint256,bytes)\":{\"details\":\"See {IERC1155Receiver-onERC1155Received}. Receiving tokens is disabled if the governance executor is other than the governor itself (eg. when using with a timelock).\"},\"onERC721Received(address,address,uint256,bytes)\":{\"details\":\"See {IERC721Receiver-onERC721Received}. Receiving tokens is disabled if the governance executor is other than the governor itself (eg. when using with a timelock).\"},\"proposalDeadline(uint256)\":{\"details\":\"See {IGovernor-proposalDeadline}.\"},\"proposalEta(uint256)\":{\"details\":\"See {IGovernor-proposalEta}.\"},\"proposalNeedsQueuing(uint256)\":{\"details\":\"See {IGovernor-proposalNeedsQueuing}.\"},\"proposalProposer(uint256)\":{\"details\":\"See {IGovernor-proposalProposer}.\"},\"proposalSnapshot(uint256)\":{\"details\":\"See {IGovernor-proposalSnapshot}.\"},\"proposalVotes(uint256)\":{\"details\":\"Accessor to the internal vote counts.\"},\"propose(address[],uint256[],bytes[],string)\":{\"details\":\"See {IGovernor-propose}. This function has opt-in frontrunning protection, described in {_isValidDescriptionForProposer}.\"},\"queue(address[],uint256[],bytes[],bytes32)\":{\"details\":\"See {IGovernor-queue}.\"},\"quorumDenominator()\":{\"details\":\"Returns the quorum denominator. Defaults to 100, but may be overridden.\"},\"quorumNumerator()\":{\"details\":\"Returns the current quorum numerator. See {quorumDenominator}.\"},\"quorumNumerator(uint256)\":{\"details\":\"Returns the quorum numerator at a specific timepoint. See {quorumDenominator}.\"},\"relay(address,uint256,bytes)\":{\"details\":\"Relays a transaction or function call to an arbitrary target. In cases where the governance executor is some contract other than the governor itself, like when using a timelock, this function can be invoked in a governance proposal to recover tokens or Ether that was sent to the governor contract by mistake. Note that if the executor is simply the governor itself, use of `relay` is redundant.\"},\"setManifesto(string)\":{\"params\":{\"newManifesto\":\"New manifesto CID\"}},\"setProposalThreshold(uint256)\":{\"params\":{\"newProposalThreshold\":\"New proposal threshold value\"}},\"setVotingDelay(uint48)\":{\"params\":{\"newVotingDelay\":\"New voting delay value\"}},\"setVotingPeriod(uint32)\":{\"params\":{\"newVotingPeriod\":\"New voting period value\"}},\"state(uint256)\":{\"details\":\"See {IGovernor-state}.\"},\"supportsInterface(bytes4)\":{\"details\":\"See {IERC165-supportsInterface}.\"},\"token()\":{\"details\":\"The token that voting power is sourced from.\"},\"updateQuorumNumerator(uint256)\":{\"params\":{\"newQuorumNumerator\":\"New quorum numerator value\"}},\"version()\":{\"details\":\"See {IGovernor-version}.\"}},\"title\":\"Cross-chain Governance Contract\",\"version\":1},\"userdoc\":{\"events\":{\"GovernanceParameterUpdated(uint8,uint256,uint256,uint256)\":{\"notice\":\"Emitted when a governance parameter is updated\"},\"ManifestoUpdated(string,string,uint256)\":{\"notice\":\"Emitted when the manifesto is updated\"}},\"kind\":\"user\",\"methods\":{\"claimParameterUpdate(bytes)\":{\"notice\":\"Claims a parameter update on a foreign chain\"},\"constructor\":{\"notice\":\"Initializes the governance contract\"},\"generateParameterProof(uint8,bytes)\":{\"notice\":\"Generates proof for parameter updates\"},\"home()\":{\"notice\":\"Chain ID where this contract was originally deployed\"},\"manifesto()\":{\"notice\":\"IPFS CID of the DAO's manifesto\"},\"setManifesto(string)\":{\"notice\":\"Updates the DAO's manifesto on the home chain\"},\"setProposalThreshold(uint256)\":{\"notice\":\"Updates the proposal threshold parameter on the home chain\"},\"setVotingDelay(uint48)\":{\"notice\":\"Updates the voting delay parameter on the home chain\"},\"setVotingPeriod(uint32)\":{\"notice\":\"Updates the voting period parameter on the home chain\"},\"updateQuorumNumerator(uint256)\":{\"notice\":\"Updates the quorum numerator on the home chain\"}},\"notice\":\"Implementation of a DAO with cross-chain synchronization capabilities\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/variants/crosschain/Gov.sol\":\"Gov\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/governance/Governor.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (governance/Governor.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {IERC721Receiver} from \\\"../token/ERC721/IERC721Receiver.sol\\\";\\nimport {IERC1155Receiver} from \\\"../token/ERC1155/IERC1155Receiver.sol\\\";\\nimport {EIP712} from \\\"../utils/cryptography/EIP712.sol\\\";\\nimport {SignatureChecker} from \\\"../utils/cryptography/SignatureChecker.sol\\\";\\nimport {IERC165, ERC165} from \\\"../utils/introspection/ERC165.sol\\\";\\nimport {SafeCast} from \\\"../utils/math/SafeCast.sol\\\";\\nimport {DoubleEndedQueue} from \\\"../utils/structs/DoubleEndedQueue.sol\\\";\\nimport {Address} from \\\"../utils/Address.sol\\\";\\nimport {Context} from \\\"../utils/Context.sol\\\";\\nimport {Nonces} from \\\"../utils/Nonces.sol\\\";\\nimport {IGovernor, IERC6372} from \\\"./IGovernor.sol\\\";\\n\\n/**\\n * @dev Core of the governance system, designed to be extended through various modules.\\n *\\n * This contract is abstract and requires several functions to be implemented in various modules:\\n *\\n * - A counting module must implement {quorum}, {_quorumReached}, {_voteSucceeded} and {_countVote}\\n * - A voting module must implement {_getVotes}\\n * - Additionally, {votingPeriod} must also be implemented\\n */\\nabstract contract Governor is Context, ERC165, EIP712, Nonces, IGovernor, IERC721Receiver, IERC1155Receiver {\\n using DoubleEndedQueue for DoubleEndedQueue.Bytes32Deque;\\n\\n bytes32 public constant BALLOT_TYPEHASH =\\n keccak256(\\\"Ballot(uint256 proposalId,uint8 support,address voter,uint256 nonce)\\\");\\n bytes32 public constant EXTENDED_BALLOT_TYPEHASH =\\n keccak256(\\n \\\"ExtendedBallot(uint256 proposalId,uint8 support,address voter,uint256 nonce,string reason,bytes params)\\\"\\n );\\n\\n struct ProposalCore {\\n address proposer;\\n uint48 voteStart;\\n uint32 voteDuration;\\n bool executed;\\n bool canceled;\\n uint48 etaSeconds;\\n }\\n\\n bytes32 private constant ALL_PROPOSAL_STATES_BITMAP = bytes32((2 ** (uint8(type(ProposalState).max) + 1)) - 1);\\n string private _name;\\n\\n mapping(uint256 proposalId => ProposalCore) private _proposals;\\n\\n // This queue keeps track of the governor operating on itself. Calls to functions protected by the {onlyGovernance}\\n // modifier needs to be whitelisted in this queue. Whitelisting is set in {execute}, consumed by the\\n // {onlyGovernance} modifier and eventually reset after {_executeOperations} completes. This ensures that the\\n // execution of {onlyGovernance} protected calls can only be achieved through successful proposals.\\n DoubleEndedQueue.Bytes32Deque private _governanceCall;\\n\\n /**\\n * @dev Restricts a function so it can only be executed through governance proposals. For example, governance\\n * parameter setters in {GovernorSettings} are protected using this modifier.\\n *\\n * The governance executing address may be different from the Governor's own address, for example it could be a\\n * timelock. This can be customized by modules by overriding {_executor}. The executor is only able to invoke these\\n * functions during the execution of the governor's {execute} function, and not under any other circumstances. Thus,\\n * for example, additional timelock proposers are not able to change governance parameters without going through the\\n * governance protocol (since v4.6).\\n */\\n modifier onlyGovernance() {\\n _checkGovernance();\\n _;\\n }\\n\\n /**\\n * @dev Sets the value for {name} and {version}\\n */\\n constructor(string memory name_) EIP712(name_, version()) {\\n _name = name_;\\n }\\n\\n /**\\n * @dev Function to receive ETH that will be handled by the governor (disabled if executor is a third party contract)\\n */\\n receive() external payable virtual {\\n if (_executor() != address(this)) {\\n revert GovernorDisabledDeposit();\\n }\\n }\\n\\n /**\\n * @dev See {IERC165-supportsInterface}.\\n */\\n function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165, ERC165) returns (bool) {\\n return\\n interfaceId == type(IGovernor).interfaceId ||\\n interfaceId == type(IERC1155Receiver).interfaceId ||\\n super.supportsInterface(interfaceId);\\n }\\n\\n /**\\n * @dev See {IGovernor-name}.\\n */\\n function name() public view virtual returns (string memory) {\\n return _name;\\n }\\n\\n /**\\n * @dev See {IGovernor-version}.\\n */\\n function version() public view virtual returns (string memory) {\\n return \\\"1\\\";\\n }\\n\\n /**\\n * @dev See {IGovernor-hashProposal}.\\n *\\n * The proposal id is produced by hashing the ABI encoded `targets` array, the `values` array, the `calldatas` array\\n * and the descriptionHash (bytes32 which itself is the keccak256 hash of the description string). This proposal id\\n * can be produced from the proposal data which is part of the {ProposalCreated} event. It can even be computed in\\n * advance, before the proposal is submitted.\\n *\\n * Note that the chainId and the governor address are not part of the proposal id computation. Consequently, the\\n * same proposal (with same operation and same description) will have the same id if submitted on multiple governors\\n * across multiple networks. This also means that in order to execute the same operation twice (on the same\\n * governor) the proposer will have to change the description in order to avoid proposal id conflicts.\\n */\\n function hashProposal(\\n address[] memory targets,\\n uint256[] memory values,\\n bytes[] memory calldatas,\\n bytes32 descriptionHash\\n ) public pure virtual returns (uint256) {\\n return uint256(keccak256(abi.encode(targets, values, calldatas, descriptionHash)));\\n }\\n\\n /**\\n * @dev See {IGovernor-state}.\\n */\\n function state(uint256 proposalId) public view virtual returns (ProposalState) {\\n // We read the struct fields into the stack at once so Solidity emits a single SLOAD\\n ProposalCore storage proposal = _proposals[proposalId];\\n bool proposalExecuted = proposal.executed;\\n bool proposalCanceled = proposal.canceled;\\n\\n if (proposalExecuted) {\\n return ProposalState.Executed;\\n }\\n\\n if (proposalCanceled) {\\n return ProposalState.Canceled;\\n }\\n\\n uint256 snapshot = proposalSnapshot(proposalId);\\n\\n if (snapshot == 0) {\\n revert GovernorNonexistentProposal(proposalId);\\n }\\n\\n uint256 currentTimepoint = clock();\\n\\n if (snapshot >= currentTimepoint) {\\n return ProposalState.Pending;\\n }\\n\\n uint256 deadline = proposalDeadline(proposalId);\\n\\n if (deadline >= currentTimepoint) {\\n return ProposalState.Active;\\n } else if (!_quorumReached(proposalId) || !_voteSucceeded(proposalId)) {\\n return ProposalState.Defeated;\\n } else if (proposalEta(proposalId) == 0) {\\n return ProposalState.Succeeded;\\n } else {\\n return ProposalState.Queued;\\n }\\n }\\n\\n /**\\n * @dev See {IGovernor-proposalThreshold}.\\n */\\n function proposalThreshold() public view virtual returns (uint256) {\\n return 0;\\n }\\n\\n /**\\n * @dev See {IGovernor-proposalSnapshot}.\\n */\\n function proposalSnapshot(uint256 proposalId) public view virtual returns (uint256) {\\n return _proposals[proposalId].voteStart;\\n }\\n\\n /**\\n * @dev See {IGovernor-proposalDeadline}.\\n */\\n function proposalDeadline(uint256 proposalId) public view virtual returns (uint256) {\\n return _proposals[proposalId].voteStart + _proposals[proposalId].voteDuration;\\n }\\n\\n /**\\n * @dev See {IGovernor-proposalProposer}.\\n */\\n function proposalProposer(uint256 proposalId) public view virtual returns (address) {\\n return _proposals[proposalId].proposer;\\n }\\n\\n /**\\n * @dev See {IGovernor-proposalEta}.\\n */\\n function proposalEta(uint256 proposalId) public view virtual returns (uint256) {\\n return _proposals[proposalId].etaSeconds;\\n }\\n\\n /**\\n * @dev See {IGovernor-proposalNeedsQueuing}.\\n */\\n function proposalNeedsQueuing(uint256) public view virtual returns (bool) {\\n return false;\\n }\\n\\n /**\\n * @dev Reverts if the `msg.sender` is not the executor. In case the executor is not this contract\\n * itself, the function reverts if `msg.data` is not whitelisted as a result of an {execute}\\n * operation. See {onlyGovernance}.\\n */\\n function _checkGovernance() internal virtual {\\n if (_executor() != _msgSender()) {\\n revert GovernorOnlyExecutor(_msgSender());\\n }\\n if (_executor() != address(this)) {\\n bytes32 msgDataHash = keccak256(_msgData());\\n // loop until popping the expected operation - throw if deque is empty (operation not authorized)\\n while (_governanceCall.popFront() != msgDataHash) {}\\n }\\n }\\n\\n /**\\n * @dev Amount of votes already cast passes the threshold limit.\\n */\\n function _quorumReached(uint256 proposalId) internal view virtual returns (bool);\\n\\n /**\\n * @dev Is the proposal successful or not.\\n */\\n function _voteSucceeded(uint256 proposalId) internal view virtual returns (bool);\\n\\n /**\\n * @dev Get the voting weight of `account` at a specific `timepoint`, for a vote as described by `params`.\\n */\\n function _getVotes(address account, uint256 timepoint, bytes memory params) internal view virtual returns (uint256);\\n\\n /**\\n * @dev Register a vote for `proposalId` by `account` with a given `support`, voting `weight` and voting `params`.\\n *\\n * Note: Support is generic and can represent various things depending on the voting system used.\\n */\\n function _countVote(\\n uint256 proposalId,\\n address account,\\n uint8 support,\\n uint256 totalWeight,\\n bytes memory params\\n ) internal virtual returns (uint256);\\n\\n /**\\n * @dev Default additional encoded parameters used by castVote methods that don't include them\\n *\\n * Note: Should be overridden by specific implementations to use an appropriate value, the\\n * meaning of the additional params, in the context of that implementation\\n */\\n function _defaultParams() internal view virtual returns (bytes memory) {\\n return \\\"\\\";\\n }\\n\\n /**\\n * @dev See {IGovernor-propose}. This function has opt-in frontrunning protection, described in {_isValidDescriptionForProposer}.\\n */\\n function propose(\\n address[] memory targets,\\n uint256[] memory values,\\n bytes[] memory calldatas,\\n string memory description\\n ) public virtual returns (uint256) {\\n address proposer = _msgSender();\\n\\n // check description restriction\\n if (!_isValidDescriptionForProposer(proposer, description)) {\\n revert GovernorRestrictedProposer(proposer);\\n }\\n\\n // check proposal threshold\\n uint256 votesThreshold = proposalThreshold();\\n if (votesThreshold > 0) {\\n uint256 proposerVotes = getVotes(proposer, clock() - 1);\\n if (proposerVotes < votesThreshold) {\\n revert GovernorInsufficientProposerVotes(proposer, proposerVotes, votesThreshold);\\n }\\n }\\n\\n return _propose(targets, values, calldatas, description, proposer);\\n }\\n\\n /**\\n * @dev Internal propose mechanism. Can be overridden to add more logic on proposal creation.\\n *\\n * Emits a {IGovernor-ProposalCreated} event.\\n */\\n function _propose(\\n address[] memory targets,\\n uint256[] memory values,\\n bytes[] memory calldatas,\\n string memory description,\\n address proposer\\n ) internal virtual returns (uint256 proposalId) {\\n proposalId = hashProposal(targets, values, calldatas, keccak256(bytes(description)));\\n\\n if (targets.length != values.length || targets.length != calldatas.length || targets.length == 0) {\\n revert GovernorInvalidProposalLength(targets.length, calldatas.length, values.length);\\n }\\n if (_proposals[proposalId].voteStart != 0) {\\n revert GovernorUnexpectedProposalState(proposalId, state(proposalId), bytes32(0));\\n }\\n\\n uint256 snapshot = clock() + votingDelay();\\n uint256 duration = votingPeriod();\\n\\n ProposalCore storage proposal = _proposals[proposalId];\\n proposal.proposer = proposer;\\n proposal.voteStart = SafeCast.toUint48(snapshot);\\n proposal.voteDuration = SafeCast.toUint32(duration);\\n\\n emit ProposalCreated(\\n proposalId,\\n proposer,\\n targets,\\n values,\\n new string[](targets.length),\\n calldatas,\\n snapshot,\\n snapshot + duration,\\n description\\n );\\n\\n // Using a named return variable to avoid stack too deep errors\\n }\\n\\n /**\\n * @dev See {IGovernor-queue}.\\n */\\n function queue(\\n address[] memory targets,\\n uint256[] memory values,\\n bytes[] memory calldatas,\\n bytes32 descriptionHash\\n ) public virtual returns (uint256) {\\n uint256 proposalId = hashProposal(targets, values, calldatas, descriptionHash);\\n\\n _validateStateBitmap(proposalId, _encodeStateBitmap(ProposalState.Succeeded));\\n\\n uint48 etaSeconds = _queueOperations(proposalId, targets, values, calldatas, descriptionHash);\\n\\n if (etaSeconds != 0) {\\n _proposals[proposalId].etaSeconds = etaSeconds;\\n emit ProposalQueued(proposalId, etaSeconds);\\n } else {\\n revert GovernorQueueNotImplemented();\\n }\\n\\n return proposalId;\\n }\\n\\n /**\\n * @dev Internal queuing mechanism. Can be overridden (without a super call) to modify the way queuing is\\n * performed (for example adding a vault/timelock).\\n *\\n * This is empty by default, and must be overridden to implement queuing.\\n *\\n * This function returns a timestamp that describes the expected ETA for execution. If the returned value is 0\\n * (which is the default value), the core will consider queueing did not succeed, and the public {queue} function\\n * will revert.\\n *\\n * NOTE: Calling this function directly will NOT check the current state of the proposal, or emit the\\n * `ProposalQueued` event. Queuing a proposal should be done using {queue}.\\n */\\n function _queueOperations(\\n uint256 /*proposalId*/,\\n address[] memory /*targets*/,\\n uint256[] memory /*values*/,\\n bytes[] memory /*calldatas*/,\\n bytes32 /*descriptionHash*/\\n ) internal virtual returns (uint48) {\\n return 0;\\n }\\n\\n /**\\n * @dev See {IGovernor-execute}.\\n */\\n function execute(\\n address[] memory targets,\\n uint256[] memory values,\\n bytes[] memory calldatas,\\n bytes32 descriptionHash\\n ) public payable virtual returns (uint256) {\\n uint256 proposalId = hashProposal(targets, values, calldatas, descriptionHash);\\n\\n _validateStateBitmap(\\n proposalId,\\n _encodeStateBitmap(ProposalState.Succeeded) | _encodeStateBitmap(ProposalState.Queued)\\n );\\n\\n // mark as executed before calls to avoid reentrancy\\n _proposals[proposalId].executed = true;\\n\\n // before execute: register governance call in queue.\\n if (_executor() != address(this)) {\\n for (uint256 i = 0; i < targets.length; ++i) {\\n if (targets[i] == address(this)) {\\n _governanceCall.pushBack(keccak256(calldatas[i]));\\n }\\n }\\n }\\n\\n _executeOperations(proposalId, targets, values, calldatas, descriptionHash);\\n\\n // after execute: cleanup governance call queue.\\n if (_executor() != address(this) && !_governanceCall.empty()) {\\n _governanceCall.clear();\\n }\\n\\n emit ProposalExecuted(proposalId);\\n\\n return proposalId;\\n }\\n\\n /**\\n * @dev Internal execution mechanism. Can be overridden (without a super call) to modify the way execution is\\n * performed (for example adding a vault/timelock).\\n *\\n * NOTE: Calling this function directly will NOT check the current state of the proposal, set the executed flag to\\n * true or emit the `ProposalExecuted` event. Executing a proposal should be done using {execute} or {_execute}.\\n */\\n function _executeOperations(\\n uint256 /* proposalId */,\\n address[] memory targets,\\n uint256[] memory values,\\n bytes[] memory calldatas,\\n bytes32 /*descriptionHash*/\\n ) internal virtual {\\n for (uint256 i = 0; i < targets.length; ++i) {\\n (bool success, bytes memory returndata) = targets[i].call{value: values[i]}(calldatas[i]);\\n Address.verifyCallResult(success, returndata);\\n }\\n }\\n\\n /**\\n * @dev See {IGovernor-cancel}.\\n */\\n function cancel(\\n address[] memory targets,\\n uint256[] memory values,\\n bytes[] memory calldatas,\\n bytes32 descriptionHash\\n ) public virtual returns (uint256) {\\n // The proposalId will be recomputed in the `_cancel` call further down. However we need the value before we\\n // do the internal call, because we need to check the proposal state BEFORE the internal `_cancel` call\\n // changes it. The `hashProposal` duplication has a cost that is limited, and that we accept.\\n uint256 proposalId = hashProposal(targets, values, calldatas, descriptionHash);\\n\\n // public cancel restrictions (on top of existing _cancel restrictions).\\n _validateStateBitmap(proposalId, _encodeStateBitmap(ProposalState.Pending));\\n if (_msgSender() != proposalProposer(proposalId)) {\\n revert GovernorOnlyProposer(_msgSender());\\n }\\n\\n return _cancel(targets, values, calldatas, descriptionHash);\\n }\\n\\n /**\\n * @dev Internal cancel mechanism with minimal restrictions. A proposal can be cancelled in any state other than\\n * Canceled, Expired, or Executed. Once cancelled a proposal can't be re-submitted.\\n *\\n * Emits a {IGovernor-ProposalCanceled} event.\\n */\\n function _cancel(\\n address[] memory targets,\\n uint256[] memory values,\\n bytes[] memory calldatas,\\n bytes32 descriptionHash\\n ) internal virtual returns (uint256) {\\n uint256 proposalId = hashProposal(targets, values, calldatas, descriptionHash);\\n\\n _validateStateBitmap(\\n proposalId,\\n ALL_PROPOSAL_STATES_BITMAP ^\\n _encodeStateBitmap(ProposalState.Canceled) ^\\n _encodeStateBitmap(ProposalState.Expired) ^\\n _encodeStateBitmap(ProposalState.Executed)\\n );\\n\\n _proposals[proposalId].canceled = true;\\n emit ProposalCanceled(proposalId);\\n\\n return proposalId;\\n }\\n\\n /**\\n * @dev See {IGovernor-getVotes}.\\n */\\n function getVotes(address account, uint256 timepoint) public view virtual returns (uint256) {\\n return _getVotes(account, timepoint, _defaultParams());\\n }\\n\\n /**\\n * @dev See {IGovernor-getVotesWithParams}.\\n */\\n function getVotesWithParams(\\n address account,\\n uint256 timepoint,\\n bytes memory params\\n ) public view virtual returns (uint256) {\\n return _getVotes(account, timepoint, params);\\n }\\n\\n /**\\n * @dev See {IGovernor-castVote}.\\n */\\n function castVote(uint256 proposalId, uint8 support) public virtual returns (uint256) {\\n address voter = _msgSender();\\n return _castVote(proposalId, voter, support, \\\"\\\");\\n }\\n\\n /**\\n * @dev See {IGovernor-castVoteWithReason}.\\n */\\n function castVoteWithReason(\\n uint256 proposalId,\\n uint8 support,\\n string calldata reason\\n ) public virtual returns (uint256) {\\n address voter = _msgSender();\\n return _castVote(proposalId, voter, support, reason);\\n }\\n\\n /**\\n * @dev See {IGovernor-castVoteWithReasonAndParams}.\\n */\\n function castVoteWithReasonAndParams(\\n uint256 proposalId,\\n uint8 support,\\n string calldata reason,\\n bytes memory params\\n ) public virtual returns (uint256) {\\n address voter = _msgSender();\\n return _castVote(proposalId, voter, support, reason, params);\\n }\\n\\n /**\\n * @dev See {IGovernor-castVoteBySig}.\\n */\\n function castVoteBySig(\\n uint256 proposalId,\\n uint8 support,\\n address voter,\\n bytes memory signature\\n ) public virtual returns (uint256) {\\n bool valid = SignatureChecker.isValidSignatureNow(\\n voter,\\n _hashTypedDataV4(keccak256(abi.encode(BALLOT_TYPEHASH, proposalId, support, voter, _useNonce(voter)))),\\n signature\\n );\\n\\n if (!valid) {\\n revert GovernorInvalidSignature(voter);\\n }\\n\\n return _castVote(proposalId, voter, support, \\\"\\\");\\n }\\n\\n /**\\n * @dev See {IGovernor-castVoteWithReasonAndParamsBySig}.\\n */\\n function castVoteWithReasonAndParamsBySig(\\n uint256 proposalId,\\n uint8 support,\\n address voter,\\n string calldata reason,\\n bytes memory params,\\n bytes memory signature\\n ) public virtual returns (uint256) {\\n bool valid = SignatureChecker.isValidSignatureNow(\\n voter,\\n _hashTypedDataV4(\\n keccak256(\\n abi.encode(\\n EXTENDED_BALLOT_TYPEHASH,\\n proposalId,\\n support,\\n voter,\\n _useNonce(voter),\\n keccak256(bytes(reason)),\\n keccak256(params)\\n )\\n )\\n ),\\n signature\\n );\\n\\n if (!valid) {\\n revert GovernorInvalidSignature(voter);\\n }\\n\\n return _castVote(proposalId, voter, support, reason, params);\\n }\\n\\n /**\\n * @dev Internal vote casting mechanism: Check that the vote is pending, that it has not been cast yet, retrieve\\n * voting weight using {IGovernor-getVotes} and call the {_countVote} internal function. Uses the _defaultParams().\\n *\\n * Emits a {IGovernor-VoteCast} event.\\n */\\n function _castVote(\\n uint256 proposalId,\\n address account,\\n uint8 support,\\n string memory reason\\n ) internal virtual returns (uint256) {\\n return _castVote(proposalId, account, support, reason, _defaultParams());\\n }\\n\\n /**\\n * @dev Internal vote casting mechanism: Check that the vote is pending, that it has not been cast yet, retrieve\\n * voting weight using {IGovernor-getVotes} and call the {_countVote} internal function.\\n *\\n * Emits a {IGovernor-VoteCast} event.\\n */\\n function _castVote(\\n uint256 proposalId,\\n address account,\\n uint8 support,\\n string memory reason,\\n bytes memory params\\n ) internal virtual returns (uint256) {\\n _validateStateBitmap(proposalId, _encodeStateBitmap(ProposalState.Active));\\n\\n uint256 totalWeight = _getVotes(account, proposalSnapshot(proposalId), params);\\n uint256 votedWeight = _countVote(proposalId, account, support, totalWeight, params);\\n\\n if (params.length == 0) {\\n emit VoteCast(account, proposalId, support, votedWeight, reason);\\n } else {\\n emit VoteCastWithParams(account, proposalId, support, votedWeight, reason, params);\\n }\\n\\n return votedWeight;\\n }\\n\\n /**\\n * @dev Relays a transaction or function call to an arbitrary target. In cases where the governance executor\\n * is some contract other than the governor itself, like when using a timelock, this function can be invoked\\n * in a governance proposal to recover tokens or Ether that was sent to the governor contract by mistake.\\n * Note that if the executor is simply the governor itself, use of `relay` is redundant.\\n */\\n function relay(address target, uint256 value, bytes calldata data) external payable virtual onlyGovernance {\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n Address.verifyCallResult(success, returndata);\\n }\\n\\n /**\\n * @dev Address through which the governor executes action. Will be overloaded by module that execute actions\\n * through another contract such as a timelock.\\n */\\n function _executor() internal view virtual returns (address) {\\n return address(this);\\n }\\n\\n /**\\n * @dev See {IERC721Receiver-onERC721Received}.\\n * Receiving tokens is disabled if the governance executor is other than the governor itself (eg. when using with a timelock).\\n */\\n function onERC721Received(address, address, uint256, bytes memory) public virtual returns (bytes4) {\\n if (_executor() != address(this)) {\\n revert GovernorDisabledDeposit();\\n }\\n return this.onERC721Received.selector;\\n }\\n\\n /**\\n * @dev See {IERC1155Receiver-onERC1155Received}.\\n * Receiving tokens is disabled if the governance executor is other than the governor itself (eg. when using with a timelock).\\n */\\n function onERC1155Received(address, address, uint256, uint256, bytes memory) public virtual returns (bytes4) {\\n if (_executor() != address(this)) {\\n revert GovernorDisabledDeposit();\\n }\\n return this.onERC1155Received.selector;\\n }\\n\\n /**\\n * @dev See {IERC1155Receiver-onERC1155BatchReceived}.\\n * Receiving tokens is disabled if the governance executor is other than the governor itself (eg. when using with a timelock).\\n */\\n function onERC1155BatchReceived(\\n address,\\n address,\\n uint256[] memory,\\n uint256[] memory,\\n bytes memory\\n ) public virtual returns (bytes4) {\\n if (_executor() != address(this)) {\\n revert GovernorDisabledDeposit();\\n }\\n return this.onERC1155BatchReceived.selector;\\n }\\n\\n /**\\n * @dev Encodes a `ProposalState` into a `bytes32` representation where each bit enabled corresponds to\\n * the underlying position in the `ProposalState` enum. For example:\\n *\\n * 0x000...10000\\n * ^^^^^^------ ...\\n * ^----- Succeeded\\n * ^---- Defeated\\n * ^--- Canceled\\n * ^-- Active\\n * ^- Pending\\n */\\n function _encodeStateBitmap(ProposalState proposalState) internal pure returns (bytes32) {\\n return bytes32(1 << uint8(proposalState));\\n }\\n\\n /**\\n * @dev Check that the current state of a proposal matches the requirements described by the `allowedStates` bitmap.\\n * This bitmap should be built using `_encodeStateBitmap`.\\n *\\n * If requirements are not met, reverts with a {GovernorUnexpectedProposalState} error.\\n */\\n function _validateStateBitmap(uint256 proposalId, bytes32 allowedStates) private view returns (ProposalState) {\\n ProposalState currentState = state(proposalId);\\n if (_encodeStateBitmap(currentState) & allowedStates == bytes32(0)) {\\n revert GovernorUnexpectedProposalState(proposalId, currentState, allowedStates);\\n }\\n return currentState;\\n }\\n\\n /*\\n * @dev Check if the proposer is authorized to submit a proposal with the given description.\\n *\\n * If the proposal description ends with `#proposer=0x???`, where `0x???` is an address written as a hex string\\n * (case insensitive), then the submission of this proposal will only be authorized to said address.\\n *\\n * This is used for frontrunning protection. By adding this pattern at the end of their proposal, one can ensure\\n * that no other address can submit the same proposal. An attacker would have to either remove or change that part,\\n * which would result in a different proposal id.\\n *\\n * If the description does not match this pattern, it is unrestricted and anyone can submit it. This includes:\\n * - If the `0x???` part is not a valid hex string.\\n * - If the `0x???` part is a valid hex string, but does not contain exactly 40 hex digits.\\n * - If it ends with the expected suffix followed by newlines or other whitespace.\\n * - If it ends with some other similar suffix, e.g. `#other=abc`.\\n * - If it does not end with any such suffix.\\n */\\n function _isValidDescriptionForProposer(\\n address proposer,\\n string memory description\\n ) internal view virtual returns (bool) {\\n uint256 len = bytes(description).length;\\n\\n // Length is too short to contain a valid proposer suffix\\n if (len < 52) {\\n return true;\\n }\\n\\n // Extract what would be the `#proposer=0x` marker beginning the suffix\\n bytes12 marker;\\n assembly (\\\"memory-safe\\\") {\\n // - Start of the string contents in memory = description + 32\\n // - First character of the marker = len - 52\\n // - Length of \\\"#proposer=0x0000000000000000000000000000000000000000\\\" = 52\\n // - We read the memory word starting at the first character of the marker:\\n // - (description + 32) + (len - 52) = description + (len - 20)\\n // - Note: Solidity will ignore anything past the first 12 bytes\\n marker := mload(add(description, sub(len, 20)))\\n }\\n\\n // If the marker is not found, there is no proposer suffix to check\\n if (marker != bytes12(\\\"#proposer=0x\\\")) {\\n return true;\\n }\\n\\n // Parse the 40 characters following the marker as uint160\\n uint160 recovered = 0;\\n for (uint256 i = len - 40; i < len; ++i) {\\n (bool isHex, uint8 value) = _tryHexToUint(bytes(description)[i]);\\n // If any of the characters is not a hex digit, ignore the suffix entirely\\n if (!isHex) {\\n return true;\\n }\\n recovered = (recovered << 4) | value;\\n }\\n\\n return recovered == uint160(proposer);\\n }\\n\\n /**\\n * @dev Try to parse a character from a string as a hex value. Returns `(true, value)` if the char is in\\n * `[0-9a-fA-F]` and `(false, 0)` otherwise. Value is guaranteed to be in the range `0 <= value < 16`\\n */\\n function _tryHexToUint(bytes1 char) private pure returns (bool isHex, uint8 value) {\\n uint8 c = uint8(char);\\n unchecked {\\n // Case 0-9\\n if (47 < c && c < 58) {\\n return (true, c - 48);\\n }\\n // Case A-F\\n else if (64 < c && c < 71) {\\n return (true, c - 55);\\n }\\n // Case a-f\\n else if (96 < c && c < 103) {\\n return (true, c - 87);\\n }\\n // Else: not a hex char\\n else {\\n return (false, 0);\\n }\\n }\\n }\\n\\n /**\\n * @inheritdoc IERC6372\\n */\\n function clock() public view virtual returns (uint48);\\n\\n /**\\n * @inheritdoc IERC6372\\n */\\n // solhint-disable-next-line func-name-mixedcase\\n function CLOCK_MODE() public view virtual returns (string memory);\\n\\n /**\\n * @inheritdoc IGovernor\\n */\\n function votingDelay() public view virtual returns (uint256);\\n\\n /**\\n * @inheritdoc IGovernor\\n */\\n function votingPeriod() public view virtual returns (uint256);\\n\\n /**\\n * @inheritdoc IGovernor\\n */\\n function quorum(uint256 timepoint) public view virtual returns (uint256);\\n}\\n\",\"keccak256\":\"0xe0f387e99c7dfcb1d3e7d2f36e408ab59a851a5e0502d21889568466a2a491bc\",\"license\":\"MIT\"},\"@openzeppelin/contracts/governance/IGovernor.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (governance/IGovernor.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {IERC165} from \\\"../interfaces/IERC165.sol\\\";\\nimport {IERC6372} from \\\"../interfaces/IERC6372.sol\\\";\\n\\n/**\\n * @dev Interface of the {Governor} core.\\n *\\n * NOTE: Event parameters lack the `indexed` keyword for compatibility with GovernorBravo events.\\n * Making event parameters `indexed` affects how events are decoded, potentially breaking existing indexers.\\n */\\ninterface IGovernor is IERC165, IERC6372 {\\n enum ProposalState {\\n Pending,\\n Active,\\n Canceled,\\n Defeated,\\n Succeeded,\\n Queued,\\n Expired,\\n Executed\\n }\\n\\n /**\\n * @dev Empty proposal or a mismatch between the parameters length for a proposal call.\\n */\\n error GovernorInvalidProposalLength(uint256 targets, uint256 calldatas, uint256 values);\\n\\n /**\\n * @dev The vote was already cast.\\n */\\n error GovernorAlreadyCastVote(address voter);\\n\\n /**\\n * @dev Token deposits are disabled in this contract.\\n */\\n error GovernorDisabledDeposit();\\n\\n /**\\n * @dev The `account` is not a proposer.\\n */\\n error GovernorOnlyProposer(address account);\\n\\n /**\\n * @dev The `account` is not the governance executor.\\n */\\n error GovernorOnlyExecutor(address account);\\n\\n /**\\n * @dev The `proposalId` doesn't exist.\\n */\\n error GovernorNonexistentProposal(uint256 proposalId);\\n\\n /**\\n * @dev The current state of a proposal is not the required for performing an operation.\\n * The `expectedStates` is a bitmap with the bits enabled for each ProposalState enum position\\n * counting from right to left.\\n *\\n * NOTE: If `expectedState` is `bytes32(0)`, the proposal is expected to not be in any state (i.e. not exist).\\n * This is the case when a proposal that is expected to be unset is already initiated (the proposal is duplicated).\\n *\\n * See {Governor-_encodeStateBitmap}.\\n */\\n error GovernorUnexpectedProposalState(uint256 proposalId, ProposalState current, bytes32 expectedStates);\\n\\n /**\\n * @dev The voting period set is not a valid period.\\n */\\n error GovernorInvalidVotingPeriod(uint256 votingPeriod);\\n\\n /**\\n * @dev The `proposer` does not have the required votes to create a proposal.\\n */\\n error GovernorInsufficientProposerVotes(address proposer, uint256 votes, uint256 threshold);\\n\\n /**\\n * @dev The `proposer` is not allowed to create a proposal.\\n */\\n error GovernorRestrictedProposer(address proposer);\\n\\n /**\\n * @dev The vote type used is not valid for the corresponding counting module.\\n */\\n error GovernorInvalidVoteType();\\n\\n /**\\n * @dev The provided params buffer is not supported by the counting module.\\n */\\n error GovernorInvalidVoteParams();\\n\\n /**\\n * @dev Queue operation is not implemented for this governor. Execute should be called directly.\\n */\\n error GovernorQueueNotImplemented();\\n\\n /**\\n * @dev The proposal hasn't been queued yet.\\n */\\n error GovernorNotQueuedProposal(uint256 proposalId);\\n\\n /**\\n * @dev The proposal has already been queued.\\n */\\n error GovernorAlreadyQueuedProposal(uint256 proposalId);\\n\\n /**\\n * @dev The provided signature is not valid for the expected `voter`.\\n * If the `voter` is a contract, the signature is not valid using {IERC1271-isValidSignature}.\\n */\\n error GovernorInvalidSignature(address voter);\\n\\n /**\\n * @dev Emitted when a proposal is created.\\n */\\n event ProposalCreated(\\n uint256 proposalId,\\n address proposer,\\n address[] targets,\\n uint256[] values,\\n string[] signatures,\\n bytes[] calldatas,\\n uint256 voteStart,\\n uint256 voteEnd,\\n string description\\n );\\n\\n /**\\n * @dev Emitted when a proposal is queued.\\n */\\n event ProposalQueued(uint256 proposalId, uint256 etaSeconds);\\n\\n /**\\n * @dev Emitted when a proposal is executed.\\n */\\n event ProposalExecuted(uint256 proposalId);\\n\\n /**\\n * @dev Emitted when a proposal is canceled.\\n */\\n event ProposalCanceled(uint256 proposalId);\\n\\n /**\\n * @dev Emitted when a vote is cast without params.\\n *\\n * Note: `support` values should be seen as buckets. Their interpretation depends on the voting module used.\\n */\\n event VoteCast(address indexed voter, uint256 proposalId, uint8 support, uint256 weight, string reason);\\n\\n /**\\n * @dev Emitted when a vote is cast with params.\\n *\\n * Note: `support` values should be seen as buckets. Their interpretation depends on the voting module used.\\n * `params` are additional encoded parameters. Their interpretation also depends on the voting module used.\\n */\\n event VoteCastWithParams(\\n address indexed voter,\\n uint256 proposalId,\\n uint8 support,\\n uint256 weight,\\n string reason,\\n bytes params\\n );\\n\\n /**\\n * @notice module:core\\n * @dev Name of the governor instance (used in building the EIP-712 domain separator).\\n */\\n function name() external view returns (string memory);\\n\\n /**\\n * @notice module:core\\n * @dev Version of the governor instance (used in building the EIP-712 domain separator). Default: \\\"1\\\"\\n */\\n function version() external view returns (string memory);\\n\\n /**\\n * @notice module:voting\\n * @dev A description of the possible `support` values for {castVote} and the way these votes are counted, meant to\\n * be consumed by UIs to show correct vote options and interpret the results. The string is a URL-encoded sequence of\\n * key-value pairs that each describe one aspect, for example `support=bravo&quorum=for,abstain`.\\n *\\n * There are 2 standard keys: `support` and `quorum`.\\n *\\n * - `support=bravo` refers to the vote options 0 = Against, 1 = For, 2 = Abstain, as in `GovernorBravo`.\\n * - `quorum=bravo` means that only For votes are counted towards quorum.\\n * - `quorum=for,abstain` means that both For and Abstain votes are counted towards quorum.\\n *\\n * If a counting module makes use of encoded `params`, it should include this under a `params` key with a unique\\n * name that describes the behavior. For example:\\n *\\n * - `params=fractional` might refer to a scheme where votes are divided fractionally between for/against/abstain.\\n * - `params=erc721` might refer to a scheme where specific NFTs are delegated to vote.\\n *\\n * NOTE: The string can be decoded by the standard\\n * https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams[`URLSearchParams`]\\n * JavaScript class.\\n */\\n // solhint-disable-next-line func-name-mixedcase\\n function COUNTING_MODE() external view returns (string memory);\\n\\n /**\\n * @notice module:core\\n * @dev Hashing function used to (re)build the proposal id from the proposal details..\\n */\\n function hashProposal(\\n address[] memory targets,\\n uint256[] memory values,\\n bytes[] memory calldatas,\\n bytes32 descriptionHash\\n ) external pure returns (uint256);\\n\\n /**\\n * @notice module:core\\n * @dev Current state of a proposal, following Compound's convention\\n */\\n function state(uint256 proposalId) external view returns (ProposalState);\\n\\n /**\\n * @notice module:core\\n * @dev The number of votes required in order for a voter to become a proposer.\\n */\\n function proposalThreshold() external view returns (uint256);\\n\\n /**\\n * @notice module:core\\n * @dev Timepoint used to retrieve user's votes and quorum. If using block number (as per Compound's Comp), the\\n * snapshot is performed at the end of this block. Hence, voting for this proposal starts at the beginning of the\\n * following block.\\n */\\n function proposalSnapshot(uint256 proposalId) external view returns (uint256);\\n\\n /**\\n * @notice module:core\\n * @dev Timepoint at which votes close. If using block number, votes close at the end of this block, so it is\\n * possible to cast a vote during this block.\\n */\\n function proposalDeadline(uint256 proposalId) external view returns (uint256);\\n\\n /**\\n * @notice module:core\\n * @dev The account that created a proposal.\\n */\\n function proposalProposer(uint256 proposalId) external view returns (address);\\n\\n /**\\n * @notice module:core\\n * @dev The time when a queued proposal becomes executable (\\\"ETA\\\"). Unlike {proposalSnapshot} and\\n * {proposalDeadline}, this doesn't use the governor clock, and instead relies on the executor's clock which may be\\n * different. In most cases this will be a timestamp.\\n */\\n function proposalEta(uint256 proposalId) external view returns (uint256);\\n\\n /**\\n * @notice module:core\\n * @dev Whether a proposal needs to be queued before execution.\\n */\\n function proposalNeedsQueuing(uint256 proposalId) external view returns (bool);\\n\\n /**\\n * @notice module:user-config\\n * @dev Delay, between the proposal is created and the vote starts. The unit this duration is expressed in depends\\n * on the clock (see ERC-6372) this contract uses.\\n *\\n * This can be increased to leave time for users to buy voting power, or delegate it, before the voting of a\\n * proposal starts.\\n *\\n * NOTE: While this interface returns a uint256, timepoints are stored as uint48 following the ERC-6372 clock type.\\n * Consequently this value must fit in a uint48 (when added to the current clock). See {IERC6372-clock}.\\n */\\n function votingDelay() external view returns (uint256);\\n\\n /**\\n * @notice module:user-config\\n * @dev Delay between the vote start and vote end. The unit this duration is expressed in depends on the clock\\n * (see ERC-6372) this contract uses.\\n *\\n * NOTE: The {votingDelay} can delay the start of the vote. This must be considered when setting the voting\\n * duration compared to the voting delay.\\n *\\n * NOTE: This value is stored when the proposal is submitted so that possible changes to the value do not affect\\n * proposals that have already been submitted. The type used to save it is a uint32. Consequently, while this\\n * interface returns a uint256, the value it returns should fit in a uint32.\\n */\\n function votingPeriod() external view returns (uint256);\\n\\n /**\\n * @notice module:user-config\\n * @dev Minimum number of cast voted required for a proposal to be successful.\\n *\\n * NOTE: The `timepoint` parameter corresponds to the snapshot used for counting vote. This allows to scale the\\n * quorum depending on values such as the totalSupply of a token at this timepoint (see {ERC20Votes}).\\n */\\n function quorum(uint256 timepoint) external view returns (uint256);\\n\\n /**\\n * @notice module:reputation\\n * @dev Voting power of an `account` at a specific `timepoint`.\\n *\\n * Note: this can be implemented in a number of ways, for example by reading the delegated balance from one (or\\n * multiple), {ERC20Votes} tokens.\\n */\\n function getVotes(address account, uint256 timepoint) external view returns (uint256);\\n\\n /**\\n * @notice module:reputation\\n * @dev Voting power of an `account` at a specific `timepoint` given additional encoded parameters.\\n */\\n function getVotesWithParams(\\n address account,\\n uint256 timepoint,\\n bytes memory params\\n ) external view returns (uint256);\\n\\n /**\\n * @notice module:voting\\n * @dev Returns whether `account` has cast a vote on `proposalId`.\\n */\\n function hasVoted(uint256 proposalId, address account) external view returns (bool);\\n\\n /**\\n * @dev Create a new proposal. Vote start after a delay specified by {IGovernor-votingDelay} and lasts for a\\n * duration specified by {IGovernor-votingPeriod}.\\n *\\n * Emits a {ProposalCreated} event.\\n *\\n * NOTE: The state of the Governor and `targets` may change between the proposal creation and its execution.\\n * This may be the result of third party actions on the targeted contracts, or other governor proposals.\\n * For example, the balance of this contract could be updated or its access control permissions may be modified,\\n * possibly compromising the proposal's ability to execute successfully (e.g. the governor doesn't have enough\\n * value to cover a proposal with multiple transfers).\\n */\\n function propose(\\n address[] memory targets,\\n uint256[] memory values,\\n bytes[] memory calldatas,\\n string memory description\\n ) external returns (uint256 proposalId);\\n\\n /**\\n * @dev Queue a proposal. Some governors require this step to be performed before execution can happen. If queuing\\n * is not necessary, this function may revert.\\n * Queuing a proposal requires the quorum to be reached, the vote to be successful, and the deadline to be reached.\\n *\\n * Emits a {ProposalQueued} event.\\n */\\n function queue(\\n address[] memory targets,\\n uint256[] memory values,\\n bytes[] memory calldatas,\\n bytes32 descriptionHash\\n ) external returns (uint256 proposalId);\\n\\n /**\\n * @dev Execute a successful proposal. This requires the quorum to be reached, the vote to be successful, and the\\n * deadline to be reached. Depending on the governor it might also be required that the proposal was queued and\\n * that some delay passed.\\n *\\n * Emits a {ProposalExecuted} event.\\n *\\n * NOTE: Some modules can modify the requirements for execution, for example by adding an additional timelock.\\n */\\n function execute(\\n address[] memory targets,\\n uint256[] memory values,\\n bytes[] memory calldatas,\\n bytes32 descriptionHash\\n ) external payable returns (uint256 proposalId);\\n\\n /**\\n * @dev Cancel a proposal. A proposal is cancellable by the proposer, but only while it is Pending state, i.e.\\n * before the vote starts.\\n *\\n * Emits a {ProposalCanceled} event.\\n */\\n function cancel(\\n address[] memory targets,\\n uint256[] memory values,\\n bytes[] memory calldatas,\\n bytes32 descriptionHash\\n ) external returns (uint256 proposalId);\\n\\n /**\\n * @dev Cast a vote\\n *\\n * Emits a {VoteCast} event.\\n */\\n function castVote(uint256 proposalId, uint8 support) external returns (uint256 balance);\\n\\n /**\\n * @dev Cast a vote with a reason\\n *\\n * Emits a {VoteCast} event.\\n */\\n function castVoteWithReason(\\n uint256 proposalId,\\n uint8 support,\\n string calldata reason\\n ) external returns (uint256 balance);\\n\\n /**\\n * @dev Cast a vote with a reason and additional encoded parameters\\n *\\n * Emits a {VoteCast} or {VoteCastWithParams} event depending on the length of params.\\n */\\n function castVoteWithReasonAndParams(\\n uint256 proposalId,\\n uint8 support,\\n string calldata reason,\\n bytes memory params\\n ) external returns (uint256 balance);\\n\\n /**\\n * @dev Cast a vote using the voter's signature, including ERC-1271 signature support.\\n *\\n * Emits a {VoteCast} event.\\n */\\n function castVoteBySig(\\n uint256 proposalId,\\n uint8 support,\\n address voter,\\n bytes memory signature\\n ) external returns (uint256 balance);\\n\\n /**\\n * @dev Cast a vote with a reason and additional encoded parameters using the voter's signature,\\n * including ERC-1271 signature support.\\n *\\n * Emits a {VoteCast} or {VoteCastWithParams} event depending on the length of params.\\n */\\n function castVoteWithReasonAndParamsBySig(\\n uint256 proposalId,\\n uint8 support,\\n address voter,\\n string calldata reason,\\n bytes memory params,\\n bytes memory signature\\n ) external returns (uint256 balance);\\n}\\n\",\"keccak256\":\"0x9406604436e6925413ab70149fec16f3b28cc9e492b2baaa09c0acefd315b2a7\",\"license\":\"MIT\"},\"@openzeppelin/contracts/governance/extensions/GovernorCountingSimple.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (governance/extensions/GovernorCountingSimple.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {Governor} from \\\"../Governor.sol\\\";\\n\\n/**\\n * @dev Extension of {Governor} for simple, 3 options, vote counting.\\n */\\nabstract contract GovernorCountingSimple is Governor {\\n /**\\n * @dev Supported vote types. Matches Governor Bravo ordering.\\n */\\n enum VoteType {\\n Against,\\n For,\\n Abstain\\n }\\n\\n struct ProposalVote {\\n uint256 againstVotes;\\n uint256 forVotes;\\n uint256 abstainVotes;\\n mapping(address voter => bool) hasVoted;\\n }\\n\\n mapping(uint256 proposalId => ProposalVote) private _proposalVotes;\\n\\n /**\\n * @dev See {IGovernor-COUNTING_MODE}.\\n */\\n // solhint-disable-next-line func-name-mixedcase\\n function COUNTING_MODE() public pure virtual override returns (string memory) {\\n return \\\"support=bravo&quorum=for,abstain\\\";\\n }\\n\\n /**\\n * @dev See {IGovernor-hasVoted}.\\n */\\n function hasVoted(uint256 proposalId, address account) public view virtual override returns (bool) {\\n return _proposalVotes[proposalId].hasVoted[account];\\n }\\n\\n /**\\n * @dev Accessor to the internal vote counts.\\n */\\n function proposalVotes(\\n uint256 proposalId\\n ) public view virtual returns (uint256 againstVotes, uint256 forVotes, uint256 abstainVotes) {\\n ProposalVote storage proposalVote = _proposalVotes[proposalId];\\n return (proposalVote.againstVotes, proposalVote.forVotes, proposalVote.abstainVotes);\\n }\\n\\n /**\\n * @dev See {Governor-_quorumReached}.\\n */\\n function _quorumReached(uint256 proposalId) internal view virtual override returns (bool) {\\n ProposalVote storage proposalVote = _proposalVotes[proposalId];\\n\\n return quorum(proposalSnapshot(proposalId)) <= proposalVote.forVotes + proposalVote.abstainVotes;\\n }\\n\\n /**\\n * @dev See {Governor-_voteSucceeded}. In this module, the forVotes must be strictly over the againstVotes.\\n */\\n function _voteSucceeded(uint256 proposalId) internal view virtual override returns (bool) {\\n ProposalVote storage proposalVote = _proposalVotes[proposalId];\\n\\n return proposalVote.forVotes > proposalVote.againstVotes;\\n }\\n\\n /**\\n * @dev See {Governor-_countVote}. In this module, the support follows the `VoteType` enum (from Governor Bravo).\\n */\\n function _countVote(\\n uint256 proposalId,\\n address account,\\n uint8 support,\\n uint256 totalWeight,\\n bytes memory // params\\n ) internal virtual override returns (uint256) {\\n ProposalVote storage proposalVote = _proposalVotes[proposalId];\\n\\n if (proposalVote.hasVoted[account]) {\\n revert GovernorAlreadyCastVote(account);\\n }\\n proposalVote.hasVoted[account] = true;\\n\\n if (support == uint8(VoteType.Against)) {\\n proposalVote.againstVotes += totalWeight;\\n } else if (support == uint8(VoteType.For)) {\\n proposalVote.forVotes += totalWeight;\\n } else if (support == uint8(VoteType.Abstain)) {\\n proposalVote.abstainVotes += totalWeight;\\n } else {\\n revert GovernorInvalidVoteType();\\n }\\n\\n return totalWeight;\\n }\\n}\\n\",\"keccak256\":\"0xdc21c15a8582ca58529bf4b63209718a86fd944cbb206a492687333fe8cce0ff\",\"license\":\"MIT\"},\"@openzeppelin/contracts/governance/extensions/GovernorSettings.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (governance/extensions/GovernorSettings.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {Governor} from \\\"../Governor.sol\\\";\\n\\n/**\\n * @dev Extension of {Governor} for settings updatable through governance.\\n */\\nabstract contract GovernorSettings is Governor {\\n // amount of token\\n uint256 private _proposalThreshold;\\n // timepoint: limited to uint48 in core (same as clock() type)\\n uint48 private _votingDelay;\\n // duration: limited to uint32 in core\\n uint32 private _votingPeriod;\\n\\n event VotingDelaySet(uint256 oldVotingDelay, uint256 newVotingDelay);\\n event VotingPeriodSet(uint256 oldVotingPeriod, uint256 newVotingPeriod);\\n event ProposalThresholdSet(uint256 oldProposalThreshold, uint256 newProposalThreshold);\\n\\n /**\\n * @dev Initialize the governance parameters.\\n */\\n constructor(uint48 initialVotingDelay, uint32 initialVotingPeriod, uint256 initialProposalThreshold) {\\n _setVotingDelay(initialVotingDelay);\\n _setVotingPeriod(initialVotingPeriod);\\n _setProposalThreshold(initialProposalThreshold);\\n }\\n\\n /**\\n * @dev See {IGovernor-votingDelay}.\\n */\\n function votingDelay() public view virtual override returns (uint256) {\\n return _votingDelay;\\n }\\n\\n /**\\n * @dev See {IGovernor-votingPeriod}.\\n */\\n function votingPeriod() public view virtual override returns (uint256) {\\n return _votingPeriod;\\n }\\n\\n /**\\n * @dev See {Governor-proposalThreshold}.\\n */\\n function proposalThreshold() public view virtual override returns (uint256) {\\n return _proposalThreshold;\\n }\\n\\n /**\\n * @dev Update the voting delay. This operation can only be performed through a governance proposal.\\n *\\n * Emits a {VotingDelaySet} event.\\n */\\n function setVotingDelay(uint48 newVotingDelay) public virtual onlyGovernance {\\n _setVotingDelay(newVotingDelay);\\n }\\n\\n /**\\n * @dev Update the voting period. This operation can only be performed through a governance proposal.\\n *\\n * Emits a {VotingPeriodSet} event.\\n */\\n function setVotingPeriod(uint32 newVotingPeriod) public virtual onlyGovernance {\\n _setVotingPeriod(newVotingPeriod);\\n }\\n\\n /**\\n * @dev Update the proposal threshold. This operation can only be performed through a governance proposal.\\n *\\n * Emits a {ProposalThresholdSet} event.\\n */\\n function setProposalThreshold(uint256 newProposalThreshold) public virtual onlyGovernance {\\n _setProposalThreshold(newProposalThreshold);\\n }\\n\\n /**\\n * @dev Internal setter for the voting delay.\\n *\\n * Emits a {VotingDelaySet} event.\\n */\\n function _setVotingDelay(uint48 newVotingDelay) internal virtual {\\n emit VotingDelaySet(_votingDelay, newVotingDelay);\\n _votingDelay = newVotingDelay;\\n }\\n\\n /**\\n * @dev Internal setter for the voting period.\\n *\\n * Emits a {VotingPeriodSet} event.\\n */\\n function _setVotingPeriod(uint32 newVotingPeriod) internal virtual {\\n if (newVotingPeriod == 0) {\\n revert GovernorInvalidVotingPeriod(0);\\n }\\n emit VotingPeriodSet(_votingPeriod, newVotingPeriod);\\n _votingPeriod = newVotingPeriod;\\n }\\n\\n /**\\n * @dev Internal setter for the proposal threshold.\\n *\\n * Emits a {ProposalThresholdSet} event.\\n */\\n function _setProposalThreshold(uint256 newProposalThreshold) internal virtual {\\n emit ProposalThresholdSet(_proposalThreshold, newProposalThreshold);\\n _proposalThreshold = newProposalThreshold;\\n }\\n}\\n\",\"keccak256\":\"0x1e0810708b8f5de8d3db73240ccee2d36a305cb904aa5acd4588834ebce6acce\",\"license\":\"MIT\"},\"@openzeppelin/contracts/governance/extensions/GovernorVotes.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (governance/extensions/GovernorVotes.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {Governor} from \\\"../Governor.sol\\\";\\nimport {IVotes} from \\\"../utils/IVotes.sol\\\";\\nimport {IERC5805} from \\\"../../interfaces/IERC5805.sol\\\";\\nimport {SafeCast} from \\\"../../utils/math/SafeCast.sol\\\";\\nimport {Time} from \\\"../../utils/types/Time.sol\\\";\\n\\n/**\\n * @dev Extension of {Governor} for voting weight extraction from an {ERC20Votes} token, or since v4.5 an {ERC721Votes}\\n * token.\\n */\\nabstract contract GovernorVotes is Governor {\\n IERC5805 private immutable _token;\\n\\n constructor(IVotes tokenAddress) {\\n _token = IERC5805(address(tokenAddress));\\n }\\n\\n /**\\n * @dev The token that voting power is sourced from.\\n */\\n function token() public view virtual returns (IERC5805) {\\n return _token;\\n }\\n\\n /**\\n * @dev Clock (as specified in ERC-6372) is set to match the token's clock. Fallback to block numbers if the token\\n * does not implement ERC-6372.\\n */\\n function clock() public view virtual override returns (uint48) {\\n try token().clock() returns (uint48 timepoint) {\\n return timepoint;\\n } catch {\\n return Time.blockNumber();\\n }\\n }\\n\\n /**\\n * @dev Machine-readable description of the clock as specified in ERC-6372.\\n */\\n // solhint-disable-next-line func-name-mixedcase\\n function CLOCK_MODE() public view virtual override returns (string memory) {\\n try token().CLOCK_MODE() returns (string memory clockmode) {\\n return clockmode;\\n } catch {\\n return \\\"mode=blocknumber&from=default\\\";\\n }\\n }\\n\\n /**\\n * Read the voting weight from the token's built in snapshot mechanism (see {Governor-_getVotes}).\\n */\\n function _getVotes(\\n address account,\\n uint256 timepoint,\\n bytes memory /*params*/\\n ) internal view virtual override returns (uint256) {\\n return token().getPastVotes(account, timepoint);\\n }\\n}\\n\",\"keccak256\":\"0x6fc0e9e0c3ed137dc2281a120cdc01b92010a26e6fd5fc4e6af08fc0f28bdb9e\",\"license\":\"MIT\"},\"@openzeppelin/contracts/governance/extensions/GovernorVotesQuorumFraction.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (governance/extensions/GovernorVotesQuorumFraction.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {GovernorVotes} from \\\"./GovernorVotes.sol\\\";\\nimport {SafeCast} from \\\"../../utils/math/SafeCast.sol\\\";\\nimport {Checkpoints} from \\\"../../utils/structs/Checkpoints.sol\\\";\\n\\n/**\\n * @dev Extension of {Governor} for voting weight extraction from an {ERC20Votes} token and a quorum expressed as a\\n * fraction of the total supply.\\n */\\nabstract contract GovernorVotesQuorumFraction is GovernorVotes {\\n using Checkpoints for Checkpoints.Trace208;\\n\\n Checkpoints.Trace208 private _quorumNumeratorHistory;\\n\\n event QuorumNumeratorUpdated(uint256 oldQuorumNumerator, uint256 newQuorumNumerator);\\n\\n /**\\n * @dev The quorum set is not a valid fraction.\\n */\\n error GovernorInvalidQuorumFraction(uint256 quorumNumerator, uint256 quorumDenominator);\\n\\n /**\\n * @dev Initialize quorum as a fraction of the token's total supply.\\n *\\n * The fraction is specified as `numerator / denominator`. By default the denominator is 100, so quorum is\\n * specified as a percent: a numerator of 10 corresponds to quorum being 10% of total supply. The denominator can be\\n * customized by overriding {quorumDenominator}.\\n */\\n constructor(uint256 quorumNumeratorValue) {\\n _updateQuorumNumerator(quorumNumeratorValue);\\n }\\n\\n /**\\n * @dev Returns the current quorum numerator. See {quorumDenominator}.\\n */\\n function quorumNumerator() public view virtual returns (uint256) {\\n return _quorumNumeratorHistory.latest();\\n }\\n\\n /**\\n * @dev Returns the quorum numerator at a specific timepoint. See {quorumDenominator}.\\n */\\n function quorumNumerator(uint256 timepoint) public view virtual returns (uint256) {\\n uint256 length = _quorumNumeratorHistory._checkpoints.length;\\n\\n // Optimistic search, check the latest checkpoint\\n Checkpoints.Checkpoint208 storage latest = _quorumNumeratorHistory._checkpoints[length - 1];\\n uint48 latestKey = latest._key;\\n uint208 latestValue = latest._value;\\n if (latestKey <= timepoint) {\\n return latestValue;\\n }\\n\\n // Otherwise, do the binary search\\n return _quorumNumeratorHistory.upperLookupRecent(SafeCast.toUint48(timepoint));\\n }\\n\\n /**\\n * @dev Returns the quorum denominator. Defaults to 100, but may be overridden.\\n */\\n function quorumDenominator() public view virtual returns (uint256) {\\n return 100;\\n }\\n\\n /**\\n * @dev Returns the quorum for a timepoint, in terms of number of votes: `supply * numerator / denominator`.\\n */\\n function quorum(uint256 timepoint) public view virtual override returns (uint256) {\\n return (token().getPastTotalSupply(timepoint) * quorumNumerator(timepoint)) / quorumDenominator();\\n }\\n\\n /**\\n * @dev Changes the quorum numerator.\\n *\\n * Emits a {QuorumNumeratorUpdated} event.\\n *\\n * Requirements:\\n *\\n * - Must be called through a governance proposal.\\n * - New numerator must be smaller or equal to the denominator.\\n */\\n function updateQuorumNumerator(uint256 newQuorumNumerator) external virtual onlyGovernance {\\n _updateQuorumNumerator(newQuorumNumerator);\\n }\\n\\n /**\\n * @dev Changes the quorum numerator.\\n *\\n * Emits a {QuorumNumeratorUpdated} event.\\n *\\n * Requirements:\\n *\\n * - New numerator must be smaller or equal to the denominator.\\n */\\n function _updateQuorumNumerator(uint256 newQuorumNumerator) internal virtual {\\n uint256 denominator = quorumDenominator();\\n if (newQuorumNumerator > denominator) {\\n revert GovernorInvalidQuorumFraction(newQuorumNumerator, denominator);\\n }\\n\\n uint256 oldQuorumNumerator = quorumNumerator();\\n _quorumNumeratorHistory.push(clock(), SafeCast.toUint208(newQuorumNumerator));\\n\\n emit QuorumNumeratorUpdated(oldQuorumNumerator, newQuorumNumerator);\\n }\\n}\\n\",\"keccak256\":\"0x5b5cdb361ed018c0162942d673c17e187c1a52ded2ce4f41e8a3f3f5d1656e00\",\"license\":\"MIT\"},\"@openzeppelin/contracts/governance/utils/IVotes.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (governance/utils/IVotes.sol)\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Common interface for {ERC20Votes}, {ERC721Votes}, and other {Votes}-enabled contracts.\\n */\\ninterface IVotes {\\n /**\\n * @dev The signature used has expired.\\n */\\n error VotesExpiredSignature(uint256 expiry);\\n\\n /**\\n * @dev Emitted when an account changes their delegate.\\n */\\n event DelegateChanged(address indexed delegator, address indexed fromDelegate, address indexed toDelegate);\\n\\n /**\\n * @dev Emitted when a token transfer or delegate change results in changes to a delegate's number of voting units.\\n */\\n event DelegateVotesChanged(address indexed delegate, uint256 previousVotes, uint256 newVotes);\\n\\n /**\\n * @dev Returns the current amount of votes that `account` has.\\n */\\n function getVotes(address account) external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of votes that `account` had at a specific moment in the past. If the `clock()` is\\n * configured to use block numbers, this will return the value at the end of the corresponding block.\\n */\\n function getPastVotes(address account, uint256 timepoint) external view returns (uint256);\\n\\n /**\\n * @dev Returns the total supply of votes available at a specific moment in the past. If the `clock()` is\\n * configured to use block numbers, this will return the value at the end of the corresponding block.\\n *\\n * NOTE: This value is the sum of all available votes, which is not necessarily the sum of all delegated votes.\\n * Votes that have not been delegated are still part of total supply, even though they would not participate in a\\n * vote.\\n */\\n function getPastTotalSupply(uint256 timepoint) external view returns (uint256);\\n\\n /**\\n * @dev Returns the delegate that `account` has chosen.\\n */\\n function delegates(address account) external view returns (address);\\n\\n /**\\n * @dev Delegates votes from the sender to `delegatee`.\\n */\\n function delegate(address delegatee) external;\\n\\n /**\\n * @dev Delegates votes from signer to `delegatee`.\\n */\\n function delegateBySig(address delegatee, uint256 nonce, uint256 expiry, uint8 v, bytes32 r, bytes32 s) external;\\n}\\n\",\"keccak256\":\"0x5e2b397ae88fd5c68e4f6762eb9f65f65c36702eb57796495f471d024ce70947\",\"license\":\"MIT\"},\"@openzeppelin/contracts/interfaces/IERC1271.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (interfaces/IERC1271.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Interface of the ERC-1271 standard signature validation method for\\n * contracts as defined in https://eips.ethereum.org/EIPS/eip-1271[ERC-1271].\\n */\\ninterface IERC1271 {\\n /**\\n * @dev Should return whether the signature provided is valid for the provided data\\n * @param hash Hash of the data to be signed\\n * @param signature Signature byte array associated with _data\\n */\\n function isValidSignature(bytes32 hash, bytes memory signature) external view returns (bytes4 magicValue);\\n}\\n\",\"keccak256\":\"0x4aaaf1c0737dd16e81f0d2b9833c549747a5ede6873bf1444bc72aa572d03e98\",\"license\":\"MIT\"},\"@openzeppelin/contracts/interfaces/IERC165.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC165.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {IERC165} from \\\"../utils/introspection/IERC165.sol\\\";\\n\",\"keccak256\":\"0xde7e9fd9aee8d4f40772f96bb3b58836cbc6dfc0227014a061947f8821ea9724\",\"license\":\"MIT\"},\"@openzeppelin/contracts/interfaces/IERC5267.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC5267.sol)\\n\\npragma solidity ^0.8.20;\\n\\ninterface IERC5267 {\\n /**\\n * @dev MAY be emitted to signal that the domain could have changed.\\n */\\n event EIP712DomainChanged();\\n\\n /**\\n * @dev returns the fields and values that describe the domain separator used by this contract for EIP-712\\n * signature.\\n */\\n function eip712Domain()\\n external\\n view\\n returns (\\n bytes1 fields,\\n string memory name,\\n string memory version,\\n uint256 chainId,\\n address verifyingContract,\\n bytes32 salt,\\n uint256[] memory extensions\\n );\\n}\\n\",\"keccak256\":\"0x92aa1df62dc3d33f1656d63bede0923e0df0b706ad4137c8b10b0a8fe549fd92\",\"license\":\"MIT\"},\"@openzeppelin/contracts/interfaces/IERC5805.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC5805.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {IVotes} from \\\"../governance/utils/IVotes.sol\\\";\\nimport {IERC6372} from \\\"./IERC6372.sol\\\";\\n\\ninterface IERC5805 is IERC6372, IVotes {}\\n\",\"keccak256\":\"0x4b9b89f91adbb7d3574f85394754cfb08c5b4eafca8a7061e2094a019ab8f818\",\"license\":\"MIT\"},\"@openzeppelin/contracts/interfaces/IERC6372.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC6372.sol)\\n\\npragma solidity ^0.8.20;\\n\\ninterface IERC6372 {\\n /**\\n * @dev Clock used for flagging checkpoints. Can be overridden to implement timestamp based checkpoints (and voting).\\n */\\n function clock() external view returns (uint48);\\n\\n /**\\n * @dev Description of the clock\\n */\\n // solhint-disable-next-line func-name-mixedcase\\n function CLOCK_MODE() external view returns (string memory);\\n}\\n\",\"keccak256\":\"0xeb2857b7dafb7e0d8526dbfe794e6c047df2851c9e6ee91dc4a55f3c34af5d33\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC1155/IERC1155Receiver.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC1155/IERC1155Receiver.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {IERC165} from \\\"../../utils/introspection/IERC165.sol\\\";\\n\\n/**\\n * @dev Interface that must be implemented by smart contracts in order to receive\\n * ERC-1155 token transfers.\\n */\\ninterface IERC1155Receiver is IERC165 {\\n /**\\n * @dev Handles the receipt of a single ERC-1155 token type. This function is\\n * called at the end of a `safeTransferFrom` after the balance has been updated.\\n *\\n * NOTE: To accept the transfer, this must return\\n * `bytes4(keccak256(\\\"onERC1155Received(address,address,uint256,uint256,bytes)\\\"))`\\n * (i.e. 0xf23a6e61, or its own function selector).\\n *\\n * @param operator The address which initiated the transfer (i.e. msg.sender)\\n * @param from The address which previously owned the token\\n * @param id The ID of the token being transferred\\n * @param value The amount of tokens being transferred\\n * @param data Additional data with no specified format\\n * @return `bytes4(keccak256(\\\"onERC1155Received(address,address,uint256,uint256,bytes)\\\"))` if transfer is allowed\\n */\\n function onERC1155Received(\\n address operator,\\n address from,\\n uint256 id,\\n uint256 value,\\n bytes calldata data\\n ) external returns (bytes4);\\n\\n /**\\n * @dev Handles the receipt of a multiple ERC-1155 token types. This function\\n * is called at the end of a `safeBatchTransferFrom` after the balances have\\n * been updated.\\n *\\n * NOTE: To accept the transfer(s), this must return\\n * `bytes4(keccak256(\\\"onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)\\\"))`\\n * (i.e. 0xbc197c81, or its own function selector).\\n *\\n * @param operator The address which initiated the batch transfer (i.e. msg.sender)\\n * @param from The address which previously owned the token\\n * @param ids An array containing ids of each token being transferred (order and length must match values array)\\n * @param values An array containing amounts of each token being transferred (order and length must match ids array)\\n * @param data Additional data with no specified format\\n * @return `bytes4(keccak256(\\\"onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)\\\"))` if transfer is allowed\\n */\\n function onERC1155BatchReceived(\\n address operator,\\n address from,\\n uint256[] calldata ids,\\n uint256[] calldata values,\\n bytes calldata data\\n ) external returns (bytes4);\\n}\\n\",\"keccak256\":\"0x61a23d601c2ab69dd726ac55058604cbda98e1d728ba31a51c379a3f9eeea715\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC721/IERC721Receiver.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @title ERC-721 token receiver interface\\n * @dev Interface for any contract that wants to support safeTransfers\\n * from ERC-721 asset contracts.\\n */\\ninterface IERC721Receiver {\\n /**\\n * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom}\\n * by `operator` from `from`, this function is called.\\n *\\n * It must return its Solidity selector to confirm the token transfer.\\n * If any other value is returned or the interface is not implemented by the recipient, the transfer will be\\n * reverted.\\n *\\n * The selector can be obtained in Solidity with `IERC721Receiver.onERC721Received.selector`.\\n */\\n function onERC721Received(\\n address operator,\\n address from,\\n uint256 tokenId,\\n bytes calldata data\\n ) external returns (bytes4);\\n}\\n\",\"keccak256\":\"0xb5afb8e8eebc4d1c6404df2f5e1e6d2c3d24fd01e5dfc855314951ecfaae462d\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {Errors} from \\\"./Errors.sol\\\";\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev There's no code at `target` (it is not a contract).\\n */\\n error AddressEmptyCode(address target);\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.8.20/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n if (address(this).balance < amount) {\\n revert Errors.InsufficientBalance(address(this).balance, amount);\\n }\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n if (!success) {\\n revert Errors.FailedCall();\\n }\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason or custom error, it is bubbled\\n * up by this function (like regular Solidity function calls). However, if\\n * the call reverted with no returned reason, this function reverts with a\\n * {Errors.FailedCall} error.\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n */\\n function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {\\n if (address(this).balance < value) {\\n revert Errors.InsufficientBalance(address(this).balance, value);\\n }\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResultFromTarget(target, success, returndata);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResultFromTarget(target, success, returndata);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResultFromTarget(target, success, returndata);\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call to smart-contract was successful, and reverts if the target\\n * was not a contract or bubbling up the revert reason (falling back to {Errors.FailedCall}) in case\\n * of an unsuccessful call.\\n */\\n function verifyCallResultFromTarget(\\n address target,\\n bool success,\\n bytes memory returndata\\n ) internal view returns (bytes memory) {\\n if (!success) {\\n _revert(returndata);\\n } else {\\n // only check if target is a contract if the call was successful and the return data is empty\\n // otherwise we already know that it was a contract\\n if (returndata.length == 0 && target.code.length == 0) {\\n revert AddressEmptyCode(target);\\n }\\n return returndata;\\n }\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call was successful, and reverts if it wasn't, either by bubbling the\\n * revert reason or with a default {Errors.FailedCall} error.\\n */\\n function verifyCallResult(bool success, bytes memory returndata) internal pure returns (bytes memory) {\\n if (!success) {\\n _revert(returndata);\\n } else {\\n return returndata;\\n }\\n }\\n\\n /**\\n * @dev Reverts with returndata if present. Otherwise reverts with {Errors.FailedCall}.\\n */\\n function _revert(bytes memory returndata) private pure {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n assembly (\\\"memory-safe\\\") {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert Errors.FailedCall();\\n }\\n }\\n}\\n\",\"keccak256\":\"0x9d8da059267bac779a2dbbb9a26c2acf00ca83085e105d62d5d4ef96054a47f5\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)\\n\\npragma solidity ^0.8.20;\\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\":\"0x493033a8d1b176a037b2cc6a04dad01a5c157722049bbecf632ca876224dd4b2\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Errors.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/Errors.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Collection of common custom errors used in multiple contracts\\n *\\n * IMPORTANT: Backwards compatibility is not guaranteed in future versions of the library.\\n * It is recommended to avoid relying on the error API for critical functionality.\\n *\\n * _Available since v5.1._\\n */\\nlibrary Errors {\\n /**\\n * @dev The ETH balance of the account is not enough to perform the operation.\\n */\\n error InsufficientBalance(uint256 balance, uint256 needed);\\n\\n /**\\n * @dev A call to an address target failed. The target may have reverted.\\n */\\n error FailedCall();\\n\\n /**\\n * @dev The deployment failed.\\n */\\n error FailedDeployment();\\n\\n /**\\n * @dev A necessary precompile is missing.\\n */\\n error MissingPrecompile(address);\\n}\\n\",\"keccak256\":\"0x6afa713bfd42cf0f7656efa91201007ac465e42049d7de1d50753a373648c123\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Nonces.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/Nonces.sol)\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Provides tracking nonces for addresses. Nonces will only increment.\\n */\\nabstract contract Nonces {\\n /**\\n * @dev The nonce used for an `account` is not the expected current nonce.\\n */\\n error InvalidAccountNonce(address account, uint256 currentNonce);\\n\\n mapping(address account => uint256) private _nonces;\\n\\n /**\\n * @dev Returns the next unused nonce for an address.\\n */\\n function nonces(address owner) public view virtual returns (uint256) {\\n return _nonces[owner];\\n }\\n\\n /**\\n * @dev Consumes a nonce.\\n *\\n * Returns the current value and increments nonce.\\n */\\n function _useNonce(address owner) internal virtual returns (uint256) {\\n // For each account, the nonce has an initial value of 0, can only be incremented by one, and cannot be\\n // decremented or reset. This guarantees that the nonce never overflows.\\n unchecked {\\n // It is important to do x++ and not ++x here.\\n return _nonces[owner]++;\\n }\\n }\\n\\n /**\\n * @dev Same as {_useNonce} but checking that `nonce` is the next valid for `owner`.\\n */\\n function _useCheckedNonce(address owner, uint256 nonce) internal virtual {\\n uint256 current = _useNonce(owner);\\n if (nonce != current) {\\n revert InvalidAccountNonce(owner, current);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x0082767004fca261c332e9ad100868327a863a88ef724e844857128845ab350f\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Panic.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/Panic.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Helper library for emitting standardized panic codes.\\n *\\n * ```solidity\\n * contract Example {\\n * using Panic for uint256;\\n *\\n * // Use any of the declared internal constants\\n * function foo() { Panic.GENERIC.panic(); }\\n *\\n * // Alternatively\\n * function foo() { Panic.panic(Panic.GENERIC); }\\n * }\\n * ```\\n *\\n * Follows the list from https://github.com/ethereum/solidity/blob/v0.8.24/libsolutil/ErrorCodes.h[libsolutil].\\n *\\n * _Available since v5.1._\\n */\\n// slither-disable-next-line unused-state\\nlibrary Panic {\\n /// @dev generic / unspecified error\\n uint256 internal constant GENERIC = 0x00;\\n /// @dev used by the assert() builtin\\n uint256 internal constant ASSERT = 0x01;\\n /// @dev arithmetic underflow or overflow\\n uint256 internal constant UNDER_OVERFLOW = 0x11;\\n /// @dev division or modulo by zero\\n uint256 internal constant DIVISION_BY_ZERO = 0x12;\\n /// @dev enum conversion error\\n uint256 internal constant ENUM_CONVERSION_ERROR = 0x21;\\n /// @dev invalid encoding in storage\\n uint256 internal constant STORAGE_ENCODING_ERROR = 0x22;\\n /// @dev empty array pop\\n uint256 internal constant EMPTY_ARRAY_POP = 0x31;\\n /// @dev array out of bounds access\\n uint256 internal constant ARRAY_OUT_OF_BOUNDS = 0x32;\\n /// @dev resource error (too large allocation or too large array)\\n uint256 internal constant RESOURCE_ERROR = 0x41;\\n /// @dev calling invalid internal function\\n uint256 internal constant INVALID_INTERNAL_FUNCTION = 0x51;\\n\\n /// @dev Reverts with a panic code. Recommended to use with\\n /// the internal constants with predefined codes.\\n function panic(uint256 code) internal pure {\\n assembly (\\\"memory-safe\\\") {\\n mstore(0x00, 0x4e487b71)\\n mstore(0x20, code)\\n revert(0x1c, 0x24)\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf7fe324703a64fc51702311dc51562d5cb1497734f074e4f483bfb6717572d7a\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/ShortStrings.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/ShortStrings.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {StorageSlot} from \\\"./StorageSlot.sol\\\";\\n\\n// | string | 0xAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA |\\n// | length | 0x BB |\\ntype ShortString is bytes32;\\n\\n/**\\n * @dev This library provides functions to convert short memory strings\\n * into a `ShortString` type that can be used as an immutable variable.\\n *\\n * Strings of arbitrary length can be optimized using this library if\\n * they are short enough (up to 31 bytes) by packing them with their\\n * length (1 byte) in a single EVM word (32 bytes). Additionally, a\\n * fallback mechanism can be used for every other case.\\n *\\n * Usage example:\\n *\\n * ```solidity\\n * contract Named {\\n * using ShortStrings for *;\\n *\\n * ShortString private immutable _name;\\n * string private _nameFallback;\\n *\\n * constructor(string memory contractName) {\\n * _name = contractName.toShortStringWithFallback(_nameFallback);\\n * }\\n *\\n * function name() external view returns (string memory) {\\n * return _name.toStringWithFallback(_nameFallback);\\n * }\\n * }\\n * ```\\n */\\nlibrary ShortStrings {\\n // Used as an identifier for strings longer than 31 bytes.\\n bytes32 private constant FALLBACK_SENTINEL = 0x00000000000000000000000000000000000000000000000000000000000000FF;\\n\\n error StringTooLong(string str);\\n error InvalidShortString();\\n\\n /**\\n * @dev Encode a string of at most 31 chars into a `ShortString`.\\n *\\n * This will trigger a `StringTooLong` error is the input string is too long.\\n */\\n function toShortString(string memory str) internal pure returns (ShortString) {\\n bytes memory bstr = bytes(str);\\n if (bstr.length > 31) {\\n revert StringTooLong(str);\\n }\\n return ShortString.wrap(bytes32(uint256(bytes32(bstr)) | bstr.length));\\n }\\n\\n /**\\n * @dev Decode a `ShortString` back to a \\\"normal\\\" string.\\n */\\n function toString(ShortString sstr) internal pure returns (string memory) {\\n uint256 len = byteLength(sstr);\\n // using `new string(len)` would work locally but is not memory safe.\\n string memory str = new string(32);\\n assembly (\\\"memory-safe\\\") {\\n mstore(str, len)\\n mstore(add(str, 0x20), sstr)\\n }\\n return str;\\n }\\n\\n /**\\n * @dev Return the length of a `ShortString`.\\n */\\n function byteLength(ShortString sstr) internal pure returns (uint256) {\\n uint256 result = uint256(ShortString.unwrap(sstr)) & 0xFF;\\n if (result > 31) {\\n revert InvalidShortString();\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Encode a string into a `ShortString`, or write it to storage if it is too long.\\n */\\n function toShortStringWithFallback(string memory value, string storage store) internal returns (ShortString) {\\n if (bytes(value).length < 32) {\\n return toShortString(value);\\n } else {\\n StorageSlot.getStringSlot(store).value = value;\\n return ShortString.wrap(FALLBACK_SENTINEL);\\n }\\n }\\n\\n /**\\n * @dev Decode a string that was encoded to `ShortString` or written to storage using {setWithFallback}.\\n */\\n function toStringWithFallback(ShortString value, string storage store) internal pure returns (string memory) {\\n if (ShortString.unwrap(value) != FALLBACK_SENTINEL) {\\n return toString(value);\\n } else {\\n return store;\\n }\\n }\\n\\n /**\\n * @dev Return the length of a string that was encoded to `ShortString` or written to storage using\\n * {setWithFallback}.\\n *\\n * WARNING: This will return the \\\"byte length\\\" of the string. This may not reflect the actual length in terms of\\n * actual characters as the UTF-8 encoding of a single character can span over multiple bytes.\\n */\\n function byteLengthWithFallback(ShortString value, string storage store) internal view returns (uint256) {\\n if (ShortString.unwrap(value) != FALLBACK_SENTINEL) {\\n return byteLength(value);\\n } else {\\n return bytes(store).length;\\n }\\n }\\n}\\n\",\"keccak256\":\"0x7d94fa0af099a2172eb01f9c8a8a443cbe7e0e43654841563e4e09968efdb549\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/StorageSlot.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/StorageSlot.sol)\\n// This file was procedurally generated from scripts/generate/templates/StorageSlot.js.\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Library for reading and writing primitive types to specific storage slots.\\n *\\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\\n * This library helps with reading and writing to such slots without the need for inline assembly.\\n *\\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\\n *\\n * Example usage to set ERC-1967 implementation slot:\\n * ```solidity\\n * contract ERC1967 {\\n * // Define the slot. Alternatively, use the SlotDerivation library to derive the slot.\\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n *\\n * function _getImplementation() internal view returns (address) {\\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n * }\\n *\\n * function _setImplementation(address newImplementation) internal {\\n * require(newImplementation.code.length > 0);\\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n * }\\n * }\\n * ```\\n *\\n * TIP: Consider using this library along with {SlotDerivation}.\\n */\\nlibrary StorageSlot {\\n struct AddressSlot {\\n address value;\\n }\\n\\n struct BooleanSlot {\\n bool value;\\n }\\n\\n struct Bytes32Slot {\\n bytes32 value;\\n }\\n\\n struct Uint256Slot {\\n uint256 value;\\n }\\n\\n struct Int256Slot {\\n int256 value;\\n }\\n\\n struct StringSlot {\\n string value;\\n }\\n\\n struct BytesSlot {\\n bytes value;\\n }\\n\\n /**\\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\\n */\\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\\n assembly (\\\"memory-safe\\\") {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns a `BooleanSlot` with member `value` located at `slot`.\\n */\\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\\n assembly (\\\"memory-safe\\\") {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns a `Bytes32Slot` with member `value` located at `slot`.\\n */\\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\\n assembly (\\\"memory-safe\\\") {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns a `Uint256Slot` with member `value` located at `slot`.\\n */\\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\\n assembly (\\\"memory-safe\\\") {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns a `Int256Slot` with member `value` located at `slot`.\\n */\\n function getInt256Slot(bytes32 slot) internal pure returns (Int256Slot storage r) {\\n assembly (\\\"memory-safe\\\") {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns a `StringSlot` with member `value` located at `slot`.\\n */\\n function getStringSlot(bytes32 slot) internal pure returns (StringSlot storage r) {\\n assembly (\\\"memory-safe\\\") {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `StringSlot` representation of the string storage pointer `store`.\\n */\\n function getStringSlot(string storage store) internal pure returns (StringSlot storage r) {\\n assembly (\\\"memory-safe\\\") {\\n r.slot := store.slot\\n }\\n }\\n\\n /**\\n * @dev Returns a `BytesSlot` with member `value` located at `slot`.\\n */\\n function getBytesSlot(bytes32 slot) internal pure returns (BytesSlot storage r) {\\n assembly (\\\"memory-safe\\\") {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `BytesSlot` representation of the bytes storage pointer `store`.\\n */\\n function getBytesSlot(bytes storage store) internal pure returns (BytesSlot storage r) {\\n assembly (\\\"memory-safe\\\") {\\n r.slot := store.slot\\n }\\n }\\n}\\n\",\"keccak256\":\"0xcf74f855663ce2ae00ed8352666b7935f6cddea2932fdf2c3ecd30a9b1cd0e97\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Strings.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/Strings.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {Math} from \\\"./math/Math.sol\\\";\\nimport {SignedMath} from \\\"./math/SignedMath.sol\\\";\\n\\n/**\\n * @dev String operations.\\n */\\nlibrary Strings {\\n bytes16 private constant HEX_DIGITS = \\\"0123456789abcdef\\\";\\n uint8 private constant ADDRESS_LENGTH = 20;\\n\\n /**\\n * @dev The `value` string doesn't fit in the specified `length`.\\n */\\n error StringsInsufficientHexLength(uint256 value, uint256 length);\\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 assembly (\\\"memory-safe\\\") {\\n ptr := add(buffer, add(32, length))\\n }\\n while (true) {\\n ptr--;\\n assembly (\\\"memory-safe\\\") {\\n mstore8(ptr, byte(mod(value, 10), HEX_DIGITS))\\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 toStringSigned(int256 value) internal pure returns (string memory) {\\n return string.concat(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 uint256 localValue = value;\\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] = HEX_DIGITS[localValue & 0xf];\\n localValue >>= 4;\\n }\\n if (localValue != 0) {\\n revert StringsInsufficientHexLength(value, length);\\n }\\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\\n * 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 Converts an `address` with fixed length of 20 bytes to its checksummed ASCII `string` hexadecimal\\n * representation, according to EIP-55.\\n */\\n function toChecksumHexString(address addr) internal pure returns (string memory) {\\n bytes memory buffer = bytes(toHexString(addr));\\n\\n // hash the hex part of buffer (skip length + 2 bytes, length 40)\\n uint256 hashValue;\\n assembly (\\\"memory-safe\\\") {\\n hashValue := shr(96, keccak256(add(buffer, 0x22), 40))\\n }\\n\\n for (uint256 i = 41; i > 1; --i) {\\n // possible values for buffer[i] are 48 (0) to 57 (9) and 97 (a) to 102 (f)\\n if (hashValue & 0xf > 7 && uint8(buffer[i]) > 96) {\\n // case shift by xoring with 0x20\\n buffer[i] ^= 0x20;\\n }\\n hashValue >>= 4;\\n }\\n return string(buffer);\\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 bytes(a).length == bytes(b).length && keccak256(bytes(a)) == keccak256(bytes(b));\\n }\\n}\\n\",\"keccak256\":\"0x725209b582291bb83058e3078624b53d15a133f7401c30295e7f3704181d2aed\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/cryptography/ECDSA.sol)\\n\\npragma solidity ^0.8.20;\\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 }\\n\\n /**\\n * @dev The signature derives the `address(0)`.\\n */\\n error ECDSAInvalidSignature();\\n\\n /**\\n * @dev The signature has an invalid length.\\n */\\n error ECDSAInvalidSignatureLength(uint256 length);\\n\\n /**\\n * @dev The signature has an S value that is in the upper half order.\\n */\\n error ECDSAInvalidSignatureS(bytes32 s);\\n\\n /**\\n * @dev Returns the address that signed a hashed message (`hash`) with `signature` or an error. This will not\\n * return address(0) without also returning an error description. Errors are documented using an enum (error type)\\n * and a bytes32 providing additional information about the error.\\n *\\n * If no error is returned, then the address can be used for verification purposes.\\n *\\n * The `ecrecover` EVM precompile 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 {MessageHashUtils-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 function tryRecover(\\n bytes32 hash,\\n bytes memory signature\\n ) internal pure returns (address recovered, RecoverError err, bytes32 errArg) {\\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 assembly (\\\"memory-safe\\\") {\\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, bytes32(signature.length));\\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 precompile 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 {MessageHashUtils-toEthSignedMessageHash} on it.\\n */\\n function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {\\n (address recovered, RecoverError error, bytes32 errorArg) = tryRecover(hash, signature);\\n _throwError(error, errorArg);\\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[ERC-2098 short signatures]\\n */\\n function tryRecover(\\n bytes32 hash,\\n bytes32 r,\\n bytes32 vs\\n ) internal pure returns (address recovered, RecoverError err, bytes32 errArg) {\\n unchecked {\\n bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff);\\n // We do not check for an overflow here since the shift operation results in 0 or 1.\\n uint8 v = uint8((uint256(vs) >> 255) + 27);\\n return tryRecover(hash, v, r, s);\\n }\\n }\\n\\n /**\\n * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately.\\n */\\n function recover(bytes32 hash, bytes32 r, bytes32 vs) internal pure returns (address) {\\n (address recovered, RecoverError error, bytes32 errorArg) = tryRecover(hash, r, vs);\\n _throwError(error, errorArg);\\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 function tryRecover(\\n bytes32 hash,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) internal pure returns (address recovered, RecoverError err, bytes32 errArg) {\\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, s);\\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, bytes32(0));\\n }\\n\\n return (signer, RecoverError.NoError, bytes32(0));\\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, bytes32 errorArg) = tryRecover(hash, v, r, s);\\n _throwError(error, errorArg);\\n return recovered;\\n }\\n\\n /**\\n * @dev Optionally reverts with the corresponding custom error according to the `error` argument provided.\\n */\\n function _throwError(RecoverError error, bytes32 errorArg) private pure {\\n if (error == RecoverError.NoError) {\\n return; // no error: do nothing\\n } else if (error == RecoverError.InvalidSignature) {\\n revert ECDSAInvalidSignature();\\n } else if (error == RecoverError.InvalidSignatureLength) {\\n revert ECDSAInvalidSignatureLength(uint256(errorArg));\\n } else if (error == RecoverError.InvalidSignatureS) {\\n revert ECDSAInvalidSignatureS(errorArg);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x69f54c02b7d81d505910ec198c11ed4c6a728418a868b906b4a0cf29946fda84\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/cryptography/EIP712.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/cryptography/EIP712.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {MessageHashUtils} from \\\"./MessageHashUtils.sol\\\";\\nimport {ShortStrings, ShortString} from \\\"../ShortStrings.sol\\\";\\nimport {IERC5267} from \\\"../../interfaces/IERC5267.sol\\\";\\n\\n/**\\n * @dev https://eips.ethereum.org/EIPS/eip-712[EIP-712] is a standard for hashing and signing of typed structured data.\\n *\\n * The encoding scheme specified in the EIP requires a domain separator and a hash of the typed structured data, whose\\n * encoding is very generic and therefore its implementation in Solidity is not feasible, thus this contract\\n * does not implement the encoding itself. Protocols need to implement the type-specific encoding they need in order to\\n * produce the hash of their typed data using a combination of `abi.encode` and `keccak256`.\\n *\\n * This contract implements the EIP-712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding\\n * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA\\n * ({_hashTypedDataV4}).\\n *\\n * The implementation of the domain separator was designed to be as efficient as possible while still properly updating\\n * the chain id to protect against replay attacks on an eventual fork of the chain.\\n *\\n * NOTE: This contract implements the version of the encoding known as \\\"v4\\\", as implemented by the JSON RPC method\\n * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask].\\n *\\n * NOTE: In the upgradeable version of this contract, the cached values will correspond to the address, and the domain\\n * separator of the implementation contract. This will cause the {_domainSeparatorV4} function to always rebuild the\\n * separator from the immutable values, which is cheaper than accessing a cached version in cold storage.\\n *\\n * @custom:oz-upgrades-unsafe-allow state-variable-immutable\\n */\\nabstract contract EIP712 is IERC5267 {\\n using ShortStrings for *;\\n\\n bytes32 private constant TYPE_HASH =\\n keccak256(\\\"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)\\\");\\n\\n // Cache the domain separator as an immutable value, but also store the chain id that it corresponds to, in order to\\n // invalidate the cached domain separator if the chain id changes.\\n bytes32 private immutable _cachedDomainSeparator;\\n uint256 private immutable _cachedChainId;\\n address private immutable _cachedThis;\\n\\n bytes32 private immutable _hashedName;\\n bytes32 private immutable _hashedVersion;\\n\\n ShortString private immutable _name;\\n ShortString private immutable _version;\\n string private _nameFallback;\\n string private _versionFallback;\\n\\n /**\\n * @dev Initializes the domain separator and parameter caches.\\n *\\n * The meaning of `name` and `version` is specified in\\n * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP-712]:\\n *\\n * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol.\\n * - `version`: the current major version of the signing domain.\\n *\\n * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart\\n * contract upgrade].\\n */\\n constructor(string memory name, string memory version) {\\n _name = name.toShortStringWithFallback(_nameFallback);\\n _version = version.toShortStringWithFallback(_versionFallback);\\n _hashedName = keccak256(bytes(name));\\n _hashedVersion = keccak256(bytes(version));\\n\\n _cachedChainId = block.chainid;\\n _cachedDomainSeparator = _buildDomainSeparator();\\n _cachedThis = address(this);\\n }\\n\\n /**\\n * @dev Returns the domain separator for the current chain.\\n */\\n function _domainSeparatorV4() internal view returns (bytes32) {\\n if (address(this) == _cachedThis && block.chainid == _cachedChainId) {\\n return _cachedDomainSeparator;\\n } else {\\n return _buildDomainSeparator();\\n }\\n }\\n\\n function _buildDomainSeparator() private view returns (bytes32) {\\n return keccak256(abi.encode(TYPE_HASH, _hashedName, _hashedVersion, block.chainid, address(this)));\\n }\\n\\n /**\\n * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this\\n * function returns the hash of the fully encoded EIP712 message for this domain.\\n *\\n * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example:\\n *\\n * ```solidity\\n * bytes32 digest = _hashTypedDataV4(keccak256(abi.encode(\\n * keccak256(\\\"Mail(address to,string contents)\\\"),\\n * mailTo,\\n * keccak256(bytes(mailContents))\\n * )));\\n * address signer = ECDSA.recover(digest, signature);\\n * ```\\n */\\n function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) {\\n return MessageHashUtils.toTypedDataHash(_domainSeparatorV4(), structHash);\\n }\\n\\n /**\\n * @dev See {IERC-5267}.\\n */\\n function eip712Domain()\\n public\\n view\\n virtual\\n returns (\\n bytes1 fields,\\n string memory name,\\n string memory version,\\n uint256 chainId,\\n address verifyingContract,\\n bytes32 salt,\\n uint256[] memory extensions\\n )\\n {\\n return (\\n hex\\\"0f\\\", // 01111\\n _EIP712Name(),\\n _EIP712Version(),\\n block.chainid,\\n address(this),\\n bytes32(0),\\n new uint256[](0)\\n );\\n }\\n\\n /**\\n * @dev The name parameter for the EIP712 domain.\\n *\\n * NOTE: By default this function reads _name which is an immutable value.\\n * It only reads from storage if necessary (in case the value is too large to fit in a ShortString).\\n */\\n // solhint-disable-next-line func-name-mixedcase\\n function _EIP712Name() internal view returns (string memory) {\\n return _name.toStringWithFallback(_nameFallback);\\n }\\n\\n /**\\n * @dev The version parameter for the EIP712 domain.\\n *\\n * NOTE: By default this function reads _version which is an immutable value.\\n * It only reads from storage if necessary (in case the value is too large to fit in a ShortString).\\n */\\n // solhint-disable-next-line func-name-mixedcase\\n function _EIP712Version() internal view returns (string memory) {\\n return _version.toStringWithFallback(_versionFallback);\\n }\\n}\\n\",\"keccak256\":\"0x10eb97d047f8d84fe263a02bb4a656ac6674f6679d74532cc37546289e073a9d\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/cryptography/MessageHashUtils.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/cryptography/MessageHashUtils.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {Strings} from \\\"../Strings.sol\\\";\\n\\n/**\\n * @dev Signature message hash utilities for producing digests to be consumed by {ECDSA} recovery or signing.\\n *\\n * The library provides methods for generating a hash of a message that conforms to the\\n * https://eips.ethereum.org/EIPS/eip-191[ERC-191] and https://eips.ethereum.org/EIPS/eip-712[EIP 712]\\n * specifications.\\n */\\nlibrary MessageHashUtils {\\n /**\\n * @dev Returns the keccak256 digest of an ERC-191 signed data with version\\n * `0x45` (`personal_sign` messages).\\n *\\n * The digest is calculated by prefixing a bytes32 `messageHash` with\\n * `\\\"\\\\x19Ethereum Signed Message:\\\\n32\\\"` and hashing the result. It corresponds with the\\n * hash signed when using the https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] JSON-RPC method.\\n *\\n * NOTE: The `messageHash` parameter is intended to be the result of hashing a raw message with\\n * keccak256, although any bytes32 value can be safely used because the final digest will\\n * be re-hashed.\\n *\\n * See {ECDSA-recover}.\\n */\\n function toEthSignedMessageHash(bytes32 messageHash) internal pure returns (bytes32 digest) {\\n assembly (\\\"memory-safe\\\") {\\n mstore(0x00, \\\"\\\\x19Ethereum Signed Message:\\\\n32\\\") // 32 is the bytes-length of messageHash\\n mstore(0x1c, messageHash) // 0x1c (28) is the length of the prefix\\n digest := keccak256(0x00, 0x3c) // 0x3c is the length of the prefix (0x1c) + messageHash (0x20)\\n }\\n }\\n\\n /**\\n * @dev Returns the keccak256 digest of an ERC-191 signed data with version\\n * `0x45` (`personal_sign` messages).\\n *\\n * The digest is calculated by prefixing an arbitrary `message` with\\n * `\\\"\\\\x19Ethereum Signed Message:\\\\n\\\" + len(message)` and hashing the result. It corresponds with the\\n * hash signed when using the https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] JSON-RPC method.\\n *\\n * See {ECDSA-recover}.\\n */\\n function toEthSignedMessageHash(bytes memory message) internal pure returns (bytes32) {\\n return\\n keccak256(bytes.concat(\\\"\\\\x19Ethereum Signed Message:\\\\n\\\", bytes(Strings.toString(message.length)), message));\\n }\\n\\n /**\\n * @dev Returns the keccak256 digest of an ERC-191 signed data with version\\n * `0x00` (data with intended validator).\\n *\\n * The digest is calculated by prefixing an arbitrary `data` with `\\\"\\\\x19\\\\x00\\\"` and the intended\\n * `validator` address. Then hashing the result.\\n *\\n * See {ECDSA-recover}.\\n */\\n function toDataWithIntendedValidatorHash(address validator, bytes memory data) internal pure returns (bytes32) {\\n return keccak256(abi.encodePacked(hex\\\"19_00\\\", validator, data));\\n }\\n\\n /**\\n * @dev Returns the keccak256 digest of an EIP-712 typed data (ERC-191 version `0x01`).\\n *\\n * The digest is calculated from a `domainSeparator` and a `structHash`, by prefixing them with\\n * `\\\\x19\\\\x01` and hashing the result. It corresponds to the hash signed by the\\n * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`] JSON-RPC method as part of EIP-712.\\n *\\n * See {ECDSA-recover}.\\n */\\n function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32 digest) {\\n assembly (\\\"memory-safe\\\") {\\n let ptr := mload(0x40)\\n mstore(ptr, hex\\\"19_01\\\")\\n mstore(add(ptr, 0x02), domainSeparator)\\n mstore(add(ptr, 0x22), structHash)\\n digest := keccak256(ptr, 0x42)\\n }\\n }\\n}\\n\",\"keccak256\":\"0x4515543bc4c78561f6bea83ecfdfc3dead55bd59858287d682045b11de1ae575\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/cryptography/SignatureChecker.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/cryptography/SignatureChecker.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {ECDSA} from \\\"./ECDSA.sol\\\";\\nimport {IERC1271} from \\\"../../interfaces/IERC1271.sol\\\";\\n\\n/**\\n * @dev Signature verification helper that can be used instead of `ECDSA.recover` to seamlessly support both ECDSA\\n * signatures from externally owned accounts (EOAs) as well as ERC-1271 signatures from smart contract wallets like\\n * Argent and Safe Wallet (previously Gnosis Safe).\\n */\\nlibrary SignatureChecker {\\n /**\\n * @dev Checks if a signature is valid for a given signer and data hash. If the signer is a smart contract, the\\n * signature is validated against that smart contract using ERC-1271, otherwise it's validated using `ECDSA.recover`.\\n *\\n * NOTE: Unlike ECDSA signatures, contract signatures are revocable, and the outcome of this function can thus\\n * change through time. It could return true at block N and false at block N+1 (or the opposite).\\n */\\n function isValidSignatureNow(address signer, bytes32 hash, bytes memory signature) internal view returns (bool) {\\n if (signer.code.length == 0) {\\n (address recovered, ECDSA.RecoverError err, ) = ECDSA.tryRecover(hash, signature);\\n return err == ECDSA.RecoverError.NoError && recovered == signer;\\n } else {\\n return isValidERC1271SignatureNow(signer, hash, signature);\\n }\\n }\\n\\n /**\\n * @dev Checks if a signature is valid for a given signer and data hash. The signature is validated\\n * against the signer smart contract using ERC-1271.\\n *\\n * NOTE: Unlike ECDSA signatures, contract signatures are revocable, and the outcome of this function can thus\\n * change through time. It could return true at block N and false at block N+1 (or the opposite).\\n */\\n function isValidERC1271SignatureNow(\\n address signer,\\n bytes32 hash,\\n bytes memory signature\\n ) internal view returns (bool) {\\n (bool success, bytes memory result) = signer.staticcall(\\n abi.encodeCall(IERC1271.isValidSignature, (hash, signature))\\n );\\n return (success &&\\n result.length >= 32 &&\\n abi.decode(result, (bytes32)) == bytes32(IERC1271.isValidSignature.selector));\\n }\\n}\\n\",\"keccak256\":\"0xbdc3bb48ccedb818cd75a6d74a16df55a822e9f6d3cc54c59f576f10aab67b5f\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/introspection/ERC165.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/introspection/ERC165.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {IERC165} from \\\"./IERC165.sol\\\";\\n\\n/**\\n * @dev Implementation of the {IERC165} interface.\\n *\\n * Contracts that want to implement ERC-165 should inherit from this contract and override {supportsInterface} to check\\n * for the additional interface id that will be supported. For example:\\n *\\n * ```solidity\\n * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\\n * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);\\n * }\\n * ```\\n */\\nabstract contract ERC165 is IERC165 {\\n /**\\n * @dev See {IERC165-supportsInterface}.\\n */\\n function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) {\\n return interfaceId == type(IERC165).interfaceId;\\n }\\n}\\n\",\"keccak256\":\"0xddce8e17e3d3f9ed818b4f4c4478a8262aab8b11ed322f1bf5ed705bb4bd97fa\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/introspection/IERC165.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/introspection/IERC165.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Interface of the ERC-165 standard, as defined in the\\n * https://eips.ethereum.org/EIPS/eip-165[ERC].\\n *\\n * Implementers can declare support of contract interfaces, which can then be\\n * queried by others ({ERC165Checker}).\\n *\\n * For an implementation, see {ERC165}.\\n */\\ninterface IERC165 {\\n /**\\n * @dev Returns true if this contract implements the interface defined by\\n * `interfaceId`. See the corresponding\\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[ERC section]\\n * to learn more about how these ids are created.\\n *\\n * This function call must use less than 30 000 gas.\\n */\\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x79796192ec90263f21b464d5bc90b777a525971d3de8232be80d9c4f9fb353b8\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/math/Math.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/math/Math.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {Panic} from \\\"../Panic.sol\\\";\\nimport {SafeCast} from \\\"./SafeCast.sol\\\";\\n\\n/**\\n * @dev Standard math utilities missing in the Solidity language.\\n */\\nlibrary Math {\\n enum Rounding {\\n Floor, // Toward negative infinity\\n Ceil, // Toward positive infinity\\n Trunc, // Toward zero\\n Expand // Away from zero\\n }\\n\\n /**\\n * @dev Returns the addition of two unsigned integers, with an success flag (no overflow).\\n */\\n function tryAdd(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\\n unchecked {\\n uint256 c = a + b;\\n if (c < a) return (false, 0);\\n return (true, c);\\n }\\n }\\n\\n /**\\n * @dev Returns the subtraction of two unsigned integers, with an success flag (no overflow).\\n */\\n function trySub(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\\n unchecked {\\n if (b > a) return (false, 0);\\n return (true, a - b);\\n }\\n }\\n\\n /**\\n * @dev Returns the multiplication of two unsigned integers, with an success flag (no overflow).\\n */\\n function tryMul(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\\n unchecked {\\n // Gas optimization: this is cheaper than requiring 'a' not being zero, but the\\n // benefit is lost if 'b' is also tested.\\n // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522\\n if (a == 0) return (true, 0);\\n uint256 c = a * b;\\n if (c / a != b) return (false, 0);\\n return (true, c);\\n }\\n }\\n\\n /**\\n * @dev Returns the division of two unsigned integers, with a success flag (no division by zero).\\n */\\n function tryDiv(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\\n unchecked {\\n if (b == 0) return (false, 0);\\n return (true, a / b);\\n }\\n }\\n\\n /**\\n * @dev Returns the remainder of dividing two unsigned integers, with a success flag (no division by zero).\\n */\\n function tryMod(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\\n unchecked {\\n if (b == 0) return (false, 0);\\n return (true, a % b);\\n }\\n }\\n\\n /**\\n * @dev Branchless ternary evaluation for `a ? b : c`. Gas costs are constant.\\n *\\n * IMPORTANT: This function may reduce bytecode size and consume less gas when used standalone.\\n * However, the compiler may optimize Solidity ternary operations (i.e. `a ? b : c`) to only compute\\n * one branch when needed, making this function more expensive.\\n */\\n function ternary(bool condition, uint256 a, uint256 b) internal pure returns (uint256) {\\n unchecked {\\n // branchless ternary works because:\\n // b ^ (a ^ b) == a\\n // b ^ 0 == b\\n return b ^ ((a ^ b) * SafeCast.toUint(condition));\\n }\\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 ternary(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 ternary(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 towards infinity instead\\n * of rounding towards zero.\\n */\\n function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {\\n if (b == 0) {\\n // Guarantee the same behavior as in a regular Solidity division.\\n Panic.panic(Panic.DIVISION_BY_ZERO);\\n }\\n\\n // The following calculation ensures accurate ceiling division without overflow.\\n // Since a is non-zero, (a - 1) / b will not overflow.\\n // The largest possible result occurs when (a - 1) / b is type(uint256).max,\\n // but the largest value we can obtain is type(uint256).max - 1, which happens\\n // when a = type(uint256).max and b = 1.\\n unchecked {\\n return SafeCast.toUint(a > 0) * ((a - 1) / b + 1);\\n }\\n }\\n\\n /**\\n * @dev Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or\\n * denominator == 0.\\n *\\n * Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv) with further edits by\\n * 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\\u00b2\\u2075\\u2076 and mod 2\\u00b2\\u2075\\u2076 - 1, then use\\n // the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256\\n // variables such that product = prod1 * 2\\u00b2\\u2075\\u2076 + prod0.\\n uint256 prod0 = x * y; // 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 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\\u00b2\\u2075\\u2076. Also prevents denominator == 0.\\n if (denominator <= prod1) {\\n Panic.panic(ternary(denominator == 0, Panic.DIVISION_BY_ZERO, Panic.UNDER_OVERFLOW));\\n }\\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.\\n // Always >= 1. See https://cs.stackexchange.com/q/138556/92363.\\n\\n uint256 twos = denominator & (0 - denominator);\\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\\u00b2\\u2075\\u2076 / 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\\u00b2\\u2075\\u2076. Now that denominator is an odd number, it has an inverse modulo 2\\u00b2\\u2075\\u2076 such\\n // that denominator * inv \\u2261 1 mod 2\\u00b2\\u2075\\u2076. Compute the inverse by starting with a seed that is correct for\\n // four bits. That is, denominator * inv \\u2261 1 mod 2\\u2074.\\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\\n // works in modular arithmetic, doubling the correct bits in each step.\\n inverse *= 2 - denominator * inverse; // inverse mod 2\\u2078\\n inverse *= 2 - denominator * inverse; // inverse mod 2\\u00b9\\u2076\\n inverse *= 2 - denominator * inverse; // inverse mod 2\\u00b3\\u00b2\\n inverse *= 2 - denominator * inverse; // inverse mod 2\\u2076\\u2074\\n inverse *= 2 - denominator * inverse; // inverse mod 2\\u00b9\\u00b2\\u2078\\n inverse *= 2 - denominator * inverse; // inverse mod 2\\u00b2\\u2075\\u2076\\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\\u00b2\\u2075\\u2076. Since the preconditions guarantee that the outcome is\\n // less than 2\\u00b2\\u2075\\u2076, 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 * @dev 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 return mulDiv(x, y, denominator) + SafeCast.toUint(unsignedRoundsUp(rounding) && mulmod(x, y, denominator) > 0);\\n }\\n\\n /**\\n * @dev Calculate the modular multiplicative inverse of a number in Z/nZ.\\n *\\n * If n is a prime, then Z/nZ is a field. In that case all elements are inversible, except 0.\\n * If n is not a prime, then Z/nZ is not a field, and some elements might not be inversible.\\n *\\n * If the input value is not inversible, 0 is returned.\\n *\\n * NOTE: If you know for sure that n is (big) a prime, it may be cheaper to use Fermat's little theorem and get the\\n * inverse using `Math.modExp(a, n - 2, n)`. See {invModPrime}.\\n */\\n function invMod(uint256 a, uint256 n) internal pure returns (uint256) {\\n unchecked {\\n if (n == 0) return 0;\\n\\n // The inverse modulo is calculated using the Extended Euclidean Algorithm (iterative version)\\n // Used to compute integers x and y such that: ax + ny = gcd(a, n).\\n // When the gcd is 1, then the inverse of a modulo n exists and it's x.\\n // ax + ny = 1\\n // ax = 1 + (-y)n\\n // ax \\u2261 1 (mod n) # x is the inverse of a modulo n\\n\\n // If the remainder is 0 the gcd is n right away.\\n uint256 remainder = a % n;\\n uint256 gcd = n;\\n\\n // Therefore the initial coefficients are:\\n // ax + ny = gcd(a, n) = n\\n // 0a + 1n = n\\n int256 x = 0;\\n int256 y = 1;\\n\\n while (remainder != 0) {\\n uint256 quotient = gcd / remainder;\\n\\n (gcd, remainder) = (\\n // The old remainder is the next gcd to try.\\n remainder,\\n // Compute the next remainder.\\n // Can't overflow given that (a % gcd) * (gcd // (a % gcd)) <= gcd\\n // where gcd is at most n (capped to type(uint256).max)\\n gcd - remainder * quotient\\n );\\n\\n (x, y) = (\\n // Increment the coefficient of a.\\n y,\\n // Decrement the coefficient of n.\\n // Can overflow, but the result is casted to uint256 so that the\\n // next value of y is \\\"wrapped around\\\" to a value between 0 and n - 1.\\n x - y * int256(quotient)\\n );\\n }\\n\\n if (gcd != 1) return 0; // No inverse exists.\\n return ternary(x < 0, n - uint256(-x), uint256(x)); // Wrap the result if it's negative.\\n }\\n }\\n\\n /**\\n * @dev Variant of {invMod}. More efficient, but only works if `p` is known to be a prime greater than `2`.\\n *\\n * From https://en.wikipedia.org/wiki/Fermat%27s_little_theorem[Fermat's little theorem], we know that if p is\\n * prime, then `a**(p-1) \\u2261 1 mod p`. As a consequence, we have `a * a**(p-2) \\u2261 1 mod p`, which means that\\n * `a**(p-2)` is the modular multiplicative inverse of a in Fp.\\n *\\n * NOTE: this function does NOT check that `p` is a prime greater than `2`.\\n */\\n function invModPrime(uint256 a, uint256 p) internal view returns (uint256) {\\n unchecked {\\n return Math.modExp(a, p - 2, p);\\n }\\n }\\n\\n /**\\n * @dev Returns the modular exponentiation of the specified base, exponent and modulus (b ** e % m)\\n *\\n * Requirements:\\n * - modulus can't be zero\\n * - underlying staticcall to precompile must succeed\\n *\\n * IMPORTANT: The result is only valid if the underlying call succeeds. When using this function, make\\n * sure the chain you're using it on supports the precompiled contract for modular exponentiation\\n * at address 0x05 as specified in https://eips.ethereum.org/EIPS/eip-198[EIP-198]. Otherwise,\\n * the underlying function will succeed given the lack of a revert, but the result may be incorrectly\\n * interpreted as 0.\\n */\\n function modExp(uint256 b, uint256 e, uint256 m) internal view returns (uint256) {\\n (bool success, uint256 result) = tryModExp(b, e, m);\\n if (!success) {\\n Panic.panic(Panic.DIVISION_BY_ZERO);\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Returns the modular exponentiation of the specified base, exponent and modulus (b ** e % m).\\n * It includes a success flag indicating if the operation succeeded. Operation will be marked as failed if trying\\n * to operate modulo 0 or if the underlying precompile reverted.\\n *\\n * IMPORTANT: The result is only valid if the success flag is true. When using this function, make sure the chain\\n * you're using it on supports the precompiled contract for modular exponentiation at address 0x05 as specified in\\n * https://eips.ethereum.org/EIPS/eip-198[EIP-198]. Otherwise, the underlying function will succeed given the lack\\n * of a revert, but the result may be incorrectly interpreted as 0.\\n */\\n function tryModExp(uint256 b, uint256 e, uint256 m) internal view returns (bool success, uint256 result) {\\n if (m == 0) return (false, 0);\\n assembly (\\\"memory-safe\\\") {\\n let ptr := mload(0x40)\\n // | Offset | Content | Content (Hex) |\\n // |-----------|------------|--------------------------------------------------------------------|\\n // | 0x00:0x1f | size of b | 0x0000000000000000000000000000000000000000000000000000000000000020 |\\n // | 0x20:0x3f | size of e | 0x0000000000000000000000000000000000000000000000000000000000000020 |\\n // | 0x40:0x5f | size of m | 0x0000000000000000000000000000000000000000000000000000000000000020 |\\n // | 0x60:0x7f | value of b | 0x<.............................................................b> |\\n // | 0x80:0x9f | value of e | 0x<.............................................................e> |\\n // | 0xa0:0xbf | value of m | 0x<.............................................................m> |\\n mstore(ptr, 0x20)\\n mstore(add(ptr, 0x20), 0x20)\\n mstore(add(ptr, 0x40), 0x20)\\n mstore(add(ptr, 0x60), b)\\n mstore(add(ptr, 0x80), e)\\n mstore(add(ptr, 0xa0), m)\\n\\n // Given the result < m, it's guaranteed to fit in 32 bytes,\\n // so we can use the memory scratch space located at offset 0.\\n success := staticcall(gas(), 0x05, ptr, 0xc0, 0x00, 0x20)\\n result := mload(0x00)\\n }\\n }\\n\\n /**\\n * @dev Variant of {modExp} that supports inputs of arbitrary length.\\n */\\n function modExp(bytes memory b, bytes memory e, bytes memory m) internal view returns (bytes memory) {\\n (bool success, bytes memory result) = tryModExp(b, e, m);\\n if (!success) {\\n Panic.panic(Panic.DIVISION_BY_ZERO);\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Variant of {tryModExp} that supports inputs of arbitrary length.\\n */\\n function tryModExp(\\n bytes memory b,\\n bytes memory e,\\n bytes memory m\\n ) internal view returns (bool success, bytes memory result) {\\n if (_zeroBytes(m)) return (false, new bytes(0));\\n\\n uint256 mLen = m.length;\\n\\n // Encode call args in result and move the free memory pointer\\n result = abi.encodePacked(b.length, e.length, mLen, b, e, m);\\n\\n assembly (\\\"memory-safe\\\") {\\n let dataPtr := add(result, 0x20)\\n // Write result on top of args to avoid allocating extra memory.\\n success := staticcall(gas(), 0x05, dataPtr, mload(result), dataPtr, mLen)\\n // Overwrite the length.\\n // result.length > returndatasize() is guaranteed because returndatasize() == m.length\\n mstore(result, mLen)\\n // Set the memory pointer after the returned data.\\n mstore(0x40, add(dataPtr, mLen))\\n }\\n }\\n\\n /**\\n * @dev Returns whether the provided byte array is zero.\\n */\\n function _zeroBytes(bytes memory byteArray) private pure returns (bool) {\\n for (uint256 i = 0; i < byteArray.length; ++i) {\\n if (byteArray[i] != 0) {\\n return false;\\n }\\n }\\n return true;\\n }\\n\\n /**\\n * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded\\n * towards zero.\\n *\\n * This method is based on Newton's method for computing square roots; the algorithm is restricted to only\\n * using integer operations.\\n */\\n function sqrt(uint256 a) internal pure returns (uint256) {\\n unchecked {\\n // Take care of easy edge cases when a == 0 or a == 1\\n if (a <= 1) {\\n return a;\\n }\\n\\n // In this function, we use Newton's method to get a root of `f(x) := x\\u00b2 - a`. It involves building a\\n // sequence x_n that converges toward sqrt(a). For each iteration x_n, we also define the error between\\n // the current value as `\\u03b5_n = | x_n - sqrt(a) |`.\\n //\\n // For our first estimation, we consider `e` the smallest power of 2 which is bigger than the square root\\n // of the target. (i.e. `2**(e-1) \\u2264 sqrt(a) < 2**e`). We know that `e \\u2264 128` because `(2\\u00b9\\u00b2\\u2078)\\u00b2 = 2\\u00b2\\u2075\\u2076` is\\n // bigger than any uint256.\\n //\\n // By noticing that\\n // `2**(e-1) \\u2264 sqrt(a) < 2**e \\u2192 (2**(e-1))\\u00b2 \\u2264 a < (2**e)\\u00b2 \\u2192 2**(2*e-2) \\u2264 a < 2**(2*e)`\\n // we can deduce that `e - 1` is `log2(a) / 2`. We can thus compute `x_n = 2**(e-1)` using a method similar\\n // to the msb function.\\n uint256 aa = a;\\n uint256 xn = 1;\\n\\n if (aa >= (1 << 128)) {\\n aa >>= 128;\\n xn <<= 64;\\n }\\n if (aa >= (1 << 64)) {\\n aa >>= 64;\\n xn <<= 32;\\n }\\n if (aa >= (1 << 32)) {\\n aa >>= 32;\\n xn <<= 16;\\n }\\n if (aa >= (1 << 16)) {\\n aa >>= 16;\\n xn <<= 8;\\n }\\n if (aa >= (1 << 8)) {\\n aa >>= 8;\\n xn <<= 4;\\n }\\n if (aa >= (1 << 4)) {\\n aa >>= 4;\\n xn <<= 2;\\n }\\n if (aa >= (1 << 2)) {\\n xn <<= 1;\\n }\\n\\n // We now have x_n such that `x_n = 2**(e-1) \\u2264 sqrt(a) < 2**e = 2 * x_n`. This implies \\u03b5_n \\u2264 2**(e-1).\\n //\\n // We can refine our estimation by noticing that the middle of that interval minimizes the error.\\n // If we move x_n to equal 2**(e-1) + 2**(e-2), then we reduce the error to \\u03b5_n \\u2264 2**(e-2).\\n // This is going to be our x_0 (and \\u03b5_0)\\n xn = (3 * xn) >> 1; // \\u03b5_0 := | x_0 - sqrt(a) | \\u2264 2**(e-2)\\n\\n // From here, Newton's method give us:\\n // x_{n+1} = (x_n + a / x_n) / 2\\n //\\n // One should note that:\\n // x_{n+1}\\u00b2 - a = ((x_n + a / x_n) / 2)\\u00b2 - a\\n // = ((x_n\\u00b2 + a) / (2 * x_n))\\u00b2 - a\\n // = (x_n\\u2074 + 2 * a * x_n\\u00b2 + a\\u00b2) / (4 * x_n\\u00b2) - a\\n // = (x_n\\u2074 + 2 * a * x_n\\u00b2 + a\\u00b2 - 4 * a * x_n\\u00b2) / (4 * x_n\\u00b2)\\n // = (x_n\\u2074 - 2 * a * x_n\\u00b2 + a\\u00b2) / (4 * x_n\\u00b2)\\n // = (x_n\\u00b2 - a)\\u00b2 / (2 * x_n)\\u00b2\\n // = ((x_n\\u00b2 - a) / (2 * x_n))\\u00b2\\n // \\u2265 0\\n // Which proves that for all n \\u2265 1, sqrt(a) \\u2264 x_n\\n //\\n // This gives us the proof of quadratic convergence of the sequence:\\n // \\u03b5_{n+1} = | x_{n+1} - sqrt(a) |\\n // = | (x_n + a / x_n) / 2 - sqrt(a) |\\n // = | (x_n\\u00b2 + a - 2*x_n*sqrt(a)) / (2 * x_n) |\\n // = | (x_n - sqrt(a))\\u00b2 / (2 * x_n) |\\n // = | \\u03b5_n\\u00b2 / (2 * x_n) |\\n // = \\u03b5_n\\u00b2 / | (2 * x_n) |\\n //\\n // For the first iteration, we have a special case where x_0 is known:\\n // \\u03b5_1 = \\u03b5_0\\u00b2 / | (2 * x_0) |\\n // \\u2264 (2**(e-2))\\u00b2 / (2 * (2**(e-1) + 2**(e-2)))\\n // \\u2264 2**(2*e-4) / (3 * 2**(e-1))\\n // \\u2264 2**(e-3) / 3\\n // \\u2264 2**(e-3-log2(3))\\n // \\u2264 2**(e-4.5)\\n //\\n // For the following iterations, we use the fact that, 2**(e-1) \\u2264 sqrt(a) \\u2264 x_n:\\n // \\u03b5_{n+1} = \\u03b5_n\\u00b2 / | (2 * x_n) |\\n // \\u2264 (2**(e-k))\\u00b2 / (2 * 2**(e-1))\\n // \\u2264 2**(2*e-2*k) / 2**e\\n // \\u2264 2**(e-2*k)\\n xn = (xn + a / xn) >> 1; // \\u03b5_1 := | x_1 - sqrt(a) | \\u2264 2**(e-4.5) -- special case, see above\\n xn = (xn + a / xn) >> 1; // \\u03b5_2 := | x_2 - sqrt(a) | \\u2264 2**(e-9) -- general case with k = 4.5\\n xn = (xn + a / xn) >> 1; // \\u03b5_3 := | x_3 - sqrt(a) | \\u2264 2**(e-18) -- general case with k = 9\\n xn = (xn + a / xn) >> 1; // \\u03b5_4 := | x_4 - sqrt(a) | \\u2264 2**(e-36) -- general case with k = 18\\n xn = (xn + a / xn) >> 1; // \\u03b5_5 := | x_5 - sqrt(a) | \\u2264 2**(e-72) -- general case with k = 36\\n xn = (xn + a / xn) >> 1; // \\u03b5_6 := | x_6 - sqrt(a) | \\u2264 2**(e-144) -- general case with k = 72\\n\\n // Because e \\u2264 128 (as discussed during the first estimation phase), we know have reached a precision\\n // \\u03b5_6 \\u2264 2**(e-144) < 1. Given we're operating on integers, then we can ensure that xn is now either\\n // sqrt(a) or sqrt(a) + 1.\\n return xn - SafeCast.toUint(xn > a / xn);\\n }\\n }\\n\\n /**\\n * @dev 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 + SafeCast.toUint(unsignedRoundsUp(rounding) && result * result < a);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 2 of a positive value rounded towards zero.\\n * Returns 0 if given 0.\\n */\\n function log2(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n uint256 exp;\\n unchecked {\\n exp = 128 * SafeCast.toUint(value > (1 << 128) - 1);\\n value >>= exp;\\n result += exp;\\n\\n exp = 64 * SafeCast.toUint(value > (1 << 64) - 1);\\n value >>= exp;\\n result += exp;\\n\\n exp = 32 * SafeCast.toUint(value > (1 << 32) - 1);\\n value >>= exp;\\n result += exp;\\n\\n exp = 16 * SafeCast.toUint(value > (1 << 16) - 1);\\n value >>= exp;\\n result += exp;\\n\\n exp = 8 * SafeCast.toUint(value > (1 << 8) - 1);\\n value >>= exp;\\n result += exp;\\n\\n exp = 4 * SafeCast.toUint(value > (1 << 4) - 1);\\n value >>= exp;\\n result += exp;\\n\\n exp = 2 * SafeCast.toUint(value > (1 << 2) - 1);\\n value >>= exp;\\n result += exp;\\n\\n result += SafeCast.toUint(value > 1);\\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 + SafeCast.toUint(unsignedRoundsUp(rounding) && 1 << result < value);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 10 of a positive value rounded towards zero.\\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 + SafeCast.toUint(unsignedRoundsUp(rounding) && 10 ** result < value);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 256 of a positive value rounded towards zero.\\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 uint256 isGt;\\n unchecked {\\n isGt = SafeCast.toUint(value > (1 << 128) - 1);\\n value >>= isGt * 128;\\n result += isGt * 16;\\n\\n isGt = SafeCast.toUint(value > (1 << 64) - 1);\\n value >>= isGt * 64;\\n result += isGt * 8;\\n\\n isGt = SafeCast.toUint(value > (1 << 32) - 1);\\n value >>= isGt * 32;\\n result += isGt * 4;\\n\\n isGt = SafeCast.toUint(value > (1 << 16) - 1);\\n value >>= isGt * 16;\\n result += isGt * 2;\\n\\n result += SafeCast.toUint(value > (1 << 8) - 1);\\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 + SafeCast.toUint(unsignedRoundsUp(rounding) && 1 << (result << 3) < value);\\n }\\n }\\n\\n /**\\n * @dev Returns whether a provided rounding mode is considered rounding up for unsigned integers.\\n */\\n function unsignedRoundsUp(Rounding rounding) internal pure returns (bool) {\\n return uint8(rounding) % 2 == 1;\\n }\\n}\\n\",\"keccak256\":\"0xa00be322d7db5786750ce0ac7e2f5b633ac30a5ed5fa1ced1e74acfc19acecea\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/math/SafeCast.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/math/SafeCast.sol)\\n// This file was procedurally generated from scripts/generate/templates/SafeCast.js.\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Wrappers over Solidity's uintXX/intXX/bool casting operators with added overflow\\n * checks.\\n *\\n * Downcasting from uint256/int256 in Solidity does not revert on overflow. This can\\n * easily result in undesired exploitation or bugs, since developers usually\\n * assume that overflows raise errors. `SafeCast` restores this intuition by\\n * reverting the transaction when such an operation overflows.\\n *\\n * Using this library instead of the unchecked operations eliminates an entire\\n * class of bugs, so it's recommended to use it always.\\n */\\nlibrary SafeCast {\\n /**\\n * @dev Value doesn't fit in an uint of `bits` size.\\n */\\n error SafeCastOverflowedUintDowncast(uint8 bits, uint256 value);\\n\\n /**\\n * @dev An int value doesn't fit in an uint of `bits` size.\\n */\\n error SafeCastOverflowedIntToUint(int256 value);\\n\\n /**\\n * @dev Value doesn't fit in an int of `bits` size.\\n */\\n error SafeCastOverflowedIntDowncast(uint8 bits, int256 value);\\n\\n /**\\n * @dev An uint value doesn't fit in an int of `bits` size.\\n */\\n error SafeCastOverflowedUintToInt(uint256 value);\\n\\n /**\\n * @dev Returns the downcasted uint248 from uint256, reverting on\\n * overflow (when the input is greater than largest uint248).\\n *\\n * Counterpart to Solidity's `uint248` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 248 bits\\n */\\n function toUint248(uint256 value) internal pure returns (uint248) {\\n if (value > type(uint248).max) {\\n revert SafeCastOverflowedUintDowncast(248, value);\\n }\\n return uint248(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint240 from uint256, reverting on\\n * overflow (when the input is greater than largest uint240).\\n *\\n * Counterpart to Solidity's `uint240` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 240 bits\\n */\\n function toUint240(uint256 value) internal pure returns (uint240) {\\n if (value > type(uint240).max) {\\n revert SafeCastOverflowedUintDowncast(240, value);\\n }\\n return uint240(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint232 from uint256, reverting on\\n * overflow (when the input is greater than largest uint232).\\n *\\n * Counterpart to Solidity's `uint232` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 232 bits\\n */\\n function toUint232(uint256 value) internal pure returns (uint232) {\\n if (value > type(uint232).max) {\\n revert SafeCastOverflowedUintDowncast(232, value);\\n }\\n return uint232(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint224 from uint256, reverting on\\n * overflow (when the input is greater than largest uint224).\\n *\\n * Counterpart to Solidity's `uint224` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 224 bits\\n */\\n function toUint224(uint256 value) internal pure returns (uint224) {\\n if (value > type(uint224).max) {\\n revert SafeCastOverflowedUintDowncast(224, value);\\n }\\n return uint224(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint216 from uint256, reverting on\\n * overflow (when the input is greater than largest uint216).\\n *\\n * Counterpart to Solidity's `uint216` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 216 bits\\n */\\n function toUint216(uint256 value) internal pure returns (uint216) {\\n if (value > type(uint216).max) {\\n revert SafeCastOverflowedUintDowncast(216, value);\\n }\\n return uint216(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint208 from uint256, reverting on\\n * overflow (when the input is greater than largest uint208).\\n *\\n * Counterpart to Solidity's `uint208` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 208 bits\\n */\\n function toUint208(uint256 value) internal pure returns (uint208) {\\n if (value > type(uint208).max) {\\n revert SafeCastOverflowedUintDowncast(208, value);\\n }\\n return uint208(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint200 from uint256, reverting on\\n * overflow (when the input is greater than largest uint200).\\n *\\n * Counterpart to Solidity's `uint200` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 200 bits\\n */\\n function toUint200(uint256 value) internal pure returns (uint200) {\\n if (value > type(uint200).max) {\\n revert SafeCastOverflowedUintDowncast(200, value);\\n }\\n return uint200(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint192 from uint256, reverting on\\n * overflow (when the input is greater than largest uint192).\\n *\\n * Counterpart to Solidity's `uint192` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 192 bits\\n */\\n function toUint192(uint256 value) internal pure returns (uint192) {\\n if (value > type(uint192).max) {\\n revert SafeCastOverflowedUintDowncast(192, value);\\n }\\n return uint192(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint184 from uint256, reverting on\\n * overflow (when the input is greater than largest uint184).\\n *\\n * Counterpart to Solidity's `uint184` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 184 bits\\n */\\n function toUint184(uint256 value) internal pure returns (uint184) {\\n if (value > type(uint184).max) {\\n revert SafeCastOverflowedUintDowncast(184, value);\\n }\\n return uint184(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint176 from uint256, reverting on\\n * overflow (when the input is greater than largest uint176).\\n *\\n * Counterpart to Solidity's `uint176` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 176 bits\\n */\\n function toUint176(uint256 value) internal pure returns (uint176) {\\n if (value > type(uint176).max) {\\n revert SafeCastOverflowedUintDowncast(176, value);\\n }\\n return uint176(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint168 from uint256, reverting on\\n * overflow (when the input is greater than largest uint168).\\n *\\n * Counterpart to Solidity's `uint168` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 168 bits\\n */\\n function toUint168(uint256 value) internal pure returns (uint168) {\\n if (value > type(uint168).max) {\\n revert SafeCastOverflowedUintDowncast(168, value);\\n }\\n return uint168(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint160 from uint256, reverting on\\n * overflow (when the input is greater than largest uint160).\\n *\\n * Counterpart to Solidity's `uint160` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 160 bits\\n */\\n function toUint160(uint256 value) internal pure returns (uint160) {\\n if (value > type(uint160).max) {\\n revert SafeCastOverflowedUintDowncast(160, value);\\n }\\n return uint160(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint152 from uint256, reverting on\\n * overflow (when the input is greater than largest uint152).\\n *\\n * Counterpart to Solidity's `uint152` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 152 bits\\n */\\n function toUint152(uint256 value) internal pure returns (uint152) {\\n if (value > type(uint152).max) {\\n revert SafeCastOverflowedUintDowncast(152, value);\\n }\\n return uint152(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint144 from uint256, reverting on\\n * overflow (when the input is greater than largest uint144).\\n *\\n * Counterpart to Solidity's `uint144` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 144 bits\\n */\\n function toUint144(uint256 value) internal pure returns (uint144) {\\n if (value > type(uint144).max) {\\n revert SafeCastOverflowedUintDowncast(144, value);\\n }\\n return uint144(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint136 from uint256, reverting on\\n * overflow (when the input is greater than largest uint136).\\n *\\n * Counterpart to Solidity's `uint136` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 136 bits\\n */\\n function toUint136(uint256 value) internal pure returns (uint136) {\\n if (value > type(uint136).max) {\\n revert SafeCastOverflowedUintDowncast(136, value);\\n }\\n return uint136(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint128 from uint256, reverting on\\n * overflow (when the input is greater than largest uint128).\\n *\\n * Counterpart to Solidity's `uint128` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 128 bits\\n */\\n function toUint128(uint256 value) internal pure returns (uint128) {\\n if (value > type(uint128).max) {\\n revert SafeCastOverflowedUintDowncast(128, value);\\n }\\n return uint128(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint120 from uint256, reverting on\\n * overflow (when the input is greater than largest uint120).\\n *\\n * Counterpart to Solidity's `uint120` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 120 bits\\n */\\n function toUint120(uint256 value) internal pure returns (uint120) {\\n if (value > type(uint120).max) {\\n revert SafeCastOverflowedUintDowncast(120, value);\\n }\\n return uint120(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint112 from uint256, reverting on\\n * overflow (when the input is greater than largest uint112).\\n *\\n * Counterpart to Solidity's `uint112` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 112 bits\\n */\\n function toUint112(uint256 value) internal pure returns (uint112) {\\n if (value > type(uint112).max) {\\n revert SafeCastOverflowedUintDowncast(112, value);\\n }\\n return uint112(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint104 from uint256, reverting on\\n * overflow (when the input is greater than largest uint104).\\n *\\n * Counterpart to Solidity's `uint104` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 104 bits\\n */\\n function toUint104(uint256 value) internal pure returns (uint104) {\\n if (value > type(uint104).max) {\\n revert SafeCastOverflowedUintDowncast(104, value);\\n }\\n return uint104(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint96 from uint256, reverting on\\n * overflow (when the input is greater than largest uint96).\\n *\\n * Counterpart to Solidity's `uint96` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 96 bits\\n */\\n function toUint96(uint256 value) internal pure returns (uint96) {\\n if (value > type(uint96).max) {\\n revert SafeCastOverflowedUintDowncast(96, value);\\n }\\n return uint96(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint88 from uint256, reverting on\\n * overflow (when the input is greater than largest uint88).\\n *\\n * Counterpart to Solidity's `uint88` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 88 bits\\n */\\n function toUint88(uint256 value) internal pure returns (uint88) {\\n if (value > type(uint88).max) {\\n revert SafeCastOverflowedUintDowncast(88, value);\\n }\\n return uint88(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint80 from uint256, reverting on\\n * overflow (when the input is greater than largest uint80).\\n *\\n * Counterpart to Solidity's `uint80` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 80 bits\\n */\\n function toUint80(uint256 value) internal pure returns (uint80) {\\n if (value > type(uint80).max) {\\n revert SafeCastOverflowedUintDowncast(80, value);\\n }\\n return uint80(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint72 from uint256, reverting on\\n * overflow (when the input is greater than largest uint72).\\n *\\n * Counterpart to Solidity's `uint72` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 72 bits\\n */\\n function toUint72(uint256 value) internal pure returns (uint72) {\\n if (value > type(uint72).max) {\\n revert SafeCastOverflowedUintDowncast(72, value);\\n }\\n return uint72(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint64 from uint256, reverting on\\n * overflow (when the input is greater than largest uint64).\\n *\\n * Counterpart to Solidity's `uint64` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 64 bits\\n */\\n function toUint64(uint256 value) internal pure returns (uint64) {\\n if (value > type(uint64).max) {\\n revert SafeCastOverflowedUintDowncast(64, value);\\n }\\n return uint64(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint56 from uint256, reverting on\\n * overflow (when the input is greater than largest uint56).\\n *\\n * Counterpart to Solidity's `uint56` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 56 bits\\n */\\n function toUint56(uint256 value) internal pure returns (uint56) {\\n if (value > type(uint56).max) {\\n revert SafeCastOverflowedUintDowncast(56, value);\\n }\\n return uint56(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint48 from uint256, reverting on\\n * overflow (when the input is greater than largest uint48).\\n *\\n * Counterpart to Solidity's `uint48` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 48 bits\\n */\\n function toUint48(uint256 value) internal pure returns (uint48) {\\n if (value > type(uint48).max) {\\n revert SafeCastOverflowedUintDowncast(48, value);\\n }\\n return uint48(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint40 from uint256, reverting on\\n * overflow (when the input is greater than largest uint40).\\n *\\n * Counterpart to Solidity's `uint40` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 40 bits\\n */\\n function toUint40(uint256 value) internal pure returns (uint40) {\\n if (value > type(uint40).max) {\\n revert SafeCastOverflowedUintDowncast(40, value);\\n }\\n return uint40(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint32 from uint256, reverting on\\n * overflow (when the input is greater than largest uint32).\\n *\\n * Counterpart to Solidity's `uint32` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 32 bits\\n */\\n function toUint32(uint256 value) internal pure returns (uint32) {\\n if (value > type(uint32).max) {\\n revert SafeCastOverflowedUintDowncast(32, value);\\n }\\n return uint32(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint24 from uint256, reverting on\\n * overflow (when the input is greater than largest uint24).\\n *\\n * Counterpart to Solidity's `uint24` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 24 bits\\n */\\n function toUint24(uint256 value) internal pure returns (uint24) {\\n if (value > type(uint24).max) {\\n revert SafeCastOverflowedUintDowncast(24, value);\\n }\\n return uint24(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint16 from uint256, reverting on\\n * overflow (when the input is greater than largest uint16).\\n *\\n * Counterpart to Solidity's `uint16` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 16 bits\\n */\\n function toUint16(uint256 value) internal pure returns (uint16) {\\n if (value > type(uint16).max) {\\n revert SafeCastOverflowedUintDowncast(16, value);\\n }\\n return uint16(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint8 from uint256, reverting on\\n * overflow (when the input is greater than largest uint8).\\n *\\n * Counterpart to Solidity's `uint8` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 8 bits\\n */\\n function toUint8(uint256 value) internal pure returns (uint8) {\\n if (value > type(uint8).max) {\\n revert SafeCastOverflowedUintDowncast(8, value);\\n }\\n return uint8(value);\\n }\\n\\n /**\\n * @dev Converts a signed int256 into an unsigned uint256.\\n *\\n * Requirements:\\n *\\n * - input must be greater than or equal to 0.\\n */\\n function toUint256(int256 value) internal pure returns (uint256) {\\n if (value < 0) {\\n revert SafeCastOverflowedIntToUint(value);\\n }\\n return uint256(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted int248 from int256, reverting on\\n * overflow (when the input is less than smallest int248 or\\n * greater than largest int248).\\n *\\n * Counterpart to Solidity's `int248` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 248 bits\\n */\\n function toInt248(int256 value) internal pure returns (int248 downcasted) {\\n downcasted = int248(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(248, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int240 from int256, reverting on\\n * overflow (when the input is less than smallest int240 or\\n * greater than largest int240).\\n *\\n * Counterpart to Solidity's `int240` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 240 bits\\n */\\n function toInt240(int256 value) internal pure returns (int240 downcasted) {\\n downcasted = int240(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(240, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int232 from int256, reverting on\\n * overflow (when the input is less than smallest int232 or\\n * greater than largest int232).\\n *\\n * Counterpart to Solidity's `int232` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 232 bits\\n */\\n function toInt232(int256 value) internal pure returns (int232 downcasted) {\\n downcasted = int232(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(232, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int224 from int256, reverting on\\n * overflow (when the input is less than smallest int224 or\\n * greater than largest int224).\\n *\\n * Counterpart to Solidity's `int224` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 224 bits\\n */\\n function toInt224(int256 value) internal pure returns (int224 downcasted) {\\n downcasted = int224(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(224, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int216 from int256, reverting on\\n * overflow (when the input is less than smallest int216 or\\n * greater than largest int216).\\n *\\n * Counterpart to Solidity's `int216` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 216 bits\\n */\\n function toInt216(int256 value) internal pure returns (int216 downcasted) {\\n downcasted = int216(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(216, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int208 from int256, reverting on\\n * overflow (when the input is less than smallest int208 or\\n * greater than largest int208).\\n *\\n * Counterpart to Solidity's `int208` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 208 bits\\n */\\n function toInt208(int256 value) internal pure returns (int208 downcasted) {\\n downcasted = int208(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(208, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int200 from int256, reverting on\\n * overflow (when the input is less than smallest int200 or\\n * greater than largest int200).\\n *\\n * Counterpart to Solidity's `int200` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 200 bits\\n */\\n function toInt200(int256 value) internal pure returns (int200 downcasted) {\\n downcasted = int200(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(200, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int192 from int256, reverting on\\n * overflow (when the input is less than smallest int192 or\\n * greater than largest int192).\\n *\\n * Counterpart to Solidity's `int192` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 192 bits\\n */\\n function toInt192(int256 value) internal pure returns (int192 downcasted) {\\n downcasted = int192(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(192, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int184 from int256, reverting on\\n * overflow (when the input is less than smallest int184 or\\n * greater than largest int184).\\n *\\n * Counterpart to Solidity's `int184` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 184 bits\\n */\\n function toInt184(int256 value) internal pure returns (int184 downcasted) {\\n downcasted = int184(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(184, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int176 from int256, reverting on\\n * overflow (when the input is less than smallest int176 or\\n * greater than largest int176).\\n *\\n * Counterpart to Solidity's `int176` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 176 bits\\n */\\n function toInt176(int256 value) internal pure returns (int176 downcasted) {\\n downcasted = int176(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(176, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int168 from int256, reverting on\\n * overflow (when the input is less than smallest int168 or\\n * greater than largest int168).\\n *\\n * Counterpart to Solidity's `int168` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 168 bits\\n */\\n function toInt168(int256 value) internal pure returns (int168 downcasted) {\\n downcasted = int168(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(168, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int160 from int256, reverting on\\n * overflow (when the input is less than smallest int160 or\\n * greater than largest int160).\\n *\\n * Counterpart to Solidity's `int160` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 160 bits\\n */\\n function toInt160(int256 value) internal pure returns (int160 downcasted) {\\n downcasted = int160(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(160, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int152 from int256, reverting on\\n * overflow (when the input is less than smallest int152 or\\n * greater than largest int152).\\n *\\n * Counterpart to Solidity's `int152` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 152 bits\\n */\\n function toInt152(int256 value) internal pure returns (int152 downcasted) {\\n downcasted = int152(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(152, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int144 from int256, reverting on\\n * overflow (when the input is less than smallest int144 or\\n * greater than largest int144).\\n *\\n * Counterpart to Solidity's `int144` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 144 bits\\n */\\n function toInt144(int256 value) internal pure returns (int144 downcasted) {\\n downcasted = int144(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(144, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int136 from int256, reverting on\\n * overflow (when the input is less than smallest int136 or\\n * greater than largest int136).\\n *\\n * Counterpart to Solidity's `int136` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 136 bits\\n */\\n function toInt136(int256 value) internal pure returns (int136 downcasted) {\\n downcasted = int136(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(136, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int128 from int256, reverting on\\n * overflow (when the input is less than smallest int128 or\\n * greater than largest int128).\\n *\\n * Counterpart to Solidity's `int128` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 128 bits\\n */\\n function toInt128(int256 value) internal pure returns (int128 downcasted) {\\n downcasted = int128(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(128, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int120 from int256, reverting on\\n * overflow (when the input is less than smallest int120 or\\n * greater than largest int120).\\n *\\n * Counterpart to Solidity's `int120` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 120 bits\\n */\\n function toInt120(int256 value) internal pure returns (int120 downcasted) {\\n downcasted = int120(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(120, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int112 from int256, reverting on\\n * overflow (when the input is less than smallest int112 or\\n * greater than largest int112).\\n *\\n * Counterpart to Solidity's `int112` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 112 bits\\n */\\n function toInt112(int256 value) internal pure returns (int112 downcasted) {\\n downcasted = int112(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(112, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int104 from int256, reverting on\\n * overflow (when the input is less than smallest int104 or\\n * greater than largest int104).\\n *\\n * Counterpart to Solidity's `int104` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 104 bits\\n */\\n function toInt104(int256 value) internal pure returns (int104 downcasted) {\\n downcasted = int104(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(104, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int96 from int256, reverting on\\n * overflow (when the input is less than smallest int96 or\\n * greater than largest int96).\\n *\\n * Counterpart to Solidity's `int96` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 96 bits\\n */\\n function toInt96(int256 value) internal pure returns (int96 downcasted) {\\n downcasted = int96(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(96, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int88 from int256, reverting on\\n * overflow (when the input is less than smallest int88 or\\n * greater than largest int88).\\n *\\n * Counterpart to Solidity's `int88` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 88 bits\\n */\\n function toInt88(int256 value) internal pure returns (int88 downcasted) {\\n downcasted = int88(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(88, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int80 from int256, reverting on\\n * overflow (when the input is less than smallest int80 or\\n * greater than largest int80).\\n *\\n * Counterpart to Solidity's `int80` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 80 bits\\n */\\n function toInt80(int256 value) internal pure returns (int80 downcasted) {\\n downcasted = int80(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(80, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int72 from int256, reverting on\\n * overflow (when the input is less than smallest int72 or\\n * greater than largest int72).\\n *\\n * Counterpart to Solidity's `int72` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 72 bits\\n */\\n function toInt72(int256 value) internal pure returns (int72 downcasted) {\\n downcasted = int72(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(72, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int64 from int256, reverting on\\n * overflow (when the input is less than smallest int64 or\\n * greater than largest int64).\\n *\\n * Counterpart to Solidity's `int64` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 64 bits\\n */\\n function toInt64(int256 value) internal pure returns (int64 downcasted) {\\n downcasted = int64(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(64, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int56 from int256, reverting on\\n * overflow (when the input is less than smallest int56 or\\n * greater than largest int56).\\n *\\n * Counterpart to Solidity's `int56` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 56 bits\\n */\\n function toInt56(int256 value) internal pure returns (int56 downcasted) {\\n downcasted = int56(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(56, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int48 from int256, reverting on\\n * overflow (when the input is less than smallest int48 or\\n * greater than largest int48).\\n *\\n * Counterpart to Solidity's `int48` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 48 bits\\n */\\n function toInt48(int256 value) internal pure returns (int48 downcasted) {\\n downcasted = int48(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(48, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int40 from int256, reverting on\\n * overflow (when the input is less than smallest int40 or\\n * greater than largest int40).\\n *\\n * Counterpart to Solidity's `int40` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 40 bits\\n */\\n function toInt40(int256 value) internal pure returns (int40 downcasted) {\\n downcasted = int40(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(40, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int32 from int256, reverting on\\n * overflow (when the input is less than smallest int32 or\\n * greater than largest int32).\\n *\\n * Counterpart to Solidity's `int32` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 32 bits\\n */\\n function toInt32(int256 value) internal pure returns (int32 downcasted) {\\n downcasted = int32(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(32, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int24 from int256, reverting on\\n * overflow (when the input is less than smallest int24 or\\n * greater than largest int24).\\n *\\n * Counterpart to Solidity's `int24` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 24 bits\\n */\\n function toInt24(int256 value) internal pure returns (int24 downcasted) {\\n downcasted = int24(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(24, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int16 from int256, reverting on\\n * overflow (when the input is less than smallest int16 or\\n * greater than largest int16).\\n *\\n * Counterpart to Solidity's `int16` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 16 bits\\n */\\n function toInt16(int256 value) internal pure returns (int16 downcasted) {\\n downcasted = int16(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(16, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int8 from int256, reverting on\\n * overflow (when the input is less than smallest int8 or\\n * greater than largest int8).\\n *\\n * Counterpart to Solidity's `int8` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 8 bits\\n */\\n function toInt8(int256 value) internal pure returns (int8 downcasted) {\\n downcasted = int8(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(8, value);\\n }\\n }\\n\\n /**\\n * @dev Converts an unsigned uint256 into a signed int256.\\n *\\n * Requirements:\\n *\\n * - input must be less than or equal to maxInt256.\\n */\\n function toInt256(uint256 value) internal pure returns (int256) {\\n // Note: Unsafe cast below is okay because `type(int256).max` is guaranteed to be positive\\n if (value > uint256(type(int256).max)) {\\n revert SafeCastOverflowedUintToInt(value);\\n }\\n return int256(value);\\n }\\n\\n /**\\n * @dev Cast a boolean (false or true) to a uint256 (0 or 1) with no jump.\\n */\\n function toUint(bool b) internal pure returns (uint256 u) {\\n assembly (\\\"memory-safe\\\") {\\n u := iszero(iszero(b))\\n }\\n }\\n}\\n\",\"keccak256\":\"0x195533c86d0ef72bcc06456a4f66a9b941f38eb403739b00f21fd7c1abd1ae54\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/math/SignedMath.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/math/SignedMath.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {SafeCast} from \\\"./SafeCast.sol\\\";\\n\\n/**\\n * @dev Standard signed math utilities missing in the Solidity language.\\n */\\nlibrary SignedMath {\\n /**\\n * @dev Branchless ternary evaluation for `a ? b : c`. Gas costs are constant.\\n *\\n * IMPORTANT: This function may reduce bytecode size and consume less gas when used standalone.\\n * However, the compiler may optimize Solidity ternary operations (i.e. `a ? b : c`) to only compute\\n * one branch when needed, making this function more expensive.\\n */\\n function ternary(bool condition, int256 a, int256 b) internal pure returns (int256) {\\n unchecked {\\n // branchless ternary works because:\\n // b ^ (a ^ b) == a\\n // b ^ 0 == b\\n return b ^ ((a ^ b) * int256(SafeCast.toUint(condition)));\\n }\\n }\\n\\n /**\\n * @dev Returns the largest of two signed numbers.\\n */\\n function max(int256 a, int256 b) internal pure returns (int256) {\\n return ternary(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 ternary(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 // Formula from the \\\"Bit Twiddling Hacks\\\" by Sean Eron Anderson.\\n // Since `n` is a signed integer, the generated bytecode will use the SAR opcode to perform the right shift,\\n // taking advantage of the most significant (or \\\"sign\\\" bit) in two's complement representation.\\n // This opcode adds new most significant bits set to the value of the previous most significant bit. As a result,\\n // the mask will either be `bytes32(0)` (if n is positive) or `~bytes32(0)` (if n is negative).\\n int256 mask = n >> 255;\\n\\n // A `bytes32(0)` mask leaves the input unchanged, while a `~bytes32(0)` mask complements it.\\n return uint256((n + mask) ^ mask);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xb1970fac7b64e6c09611e6691791e848d5e3fe410fa5899e7df2e0afd77a99e3\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/structs/Checkpoints.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/structs/Checkpoints.sol)\\n// This file was procedurally generated from scripts/generate/templates/Checkpoints.js.\\n\\npragma solidity ^0.8.20;\\n\\nimport {Math} from \\\"../math/Math.sol\\\";\\n\\n/**\\n * @dev This library defines the `Trace*` struct, for checkpointing values as they change at different points in\\n * time, and later looking up past values by block number. See {Votes} as an example.\\n *\\n * To create a history of checkpoints define a variable type `Checkpoints.Trace*` in your contract, and store a new\\n * checkpoint for the current transaction block using the {push} function.\\n */\\nlibrary Checkpoints {\\n /**\\n * @dev A value was attempted to be inserted on a past checkpoint.\\n */\\n error CheckpointUnorderedInsertion();\\n\\n struct Trace224 {\\n Checkpoint224[] _checkpoints;\\n }\\n\\n struct Checkpoint224 {\\n uint32 _key;\\n uint224 _value;\\n }\\n\\n /**\\n * @dev Pushes a (`key`, `value`) pair into a Trace224 so that it is stored as the checkpoint.\\n *\\n * Returns previous value and new value.\\n *\\n * IMPORTANT: Never accept `key` as a user input, since an arbitrary `type(uint32).max` key set will disable the\\n * library.\\n */\\n function push(\\n Trace224 storage self,\\n uint32 key,\\n uint224 value\\n ) internal returns (uint224 oldValue, uint224 newValue) {\\n return _insert(self._checkpoints, key, value);\\n }\\n\\n /**\\n * @dev Returns the value in the first (oldest) checkpoint with key greater or equal than the search key, or zero if\\n * there is none.\\n */\\n function lowerLookup(Trace224 storage self, uint32 key) internal view returns (uint224) {\\n uint256 len = self._checkpoints.length;\\n uint256 pos = _lowerBinaryLookup(self._checkpoints, key, 0, len);\\n return pos == len ? 0 : _unsafeAccess(self._checkpoints, pos)._value;\\n }\\n\\n /**\\n * @dev Returns the value in the last (most recent) checkpoint with key lower or equal than the search key, or zero\\n * if there is none.\\n */\\n function upperLookup(Trace224 storage self, uint32 key) internal view returns (uint224) {\\n uint256 len = self._checkpoints.length;\\n uint256 pos = _upperBinaryLookup(self._checkpoints, key, 0, len);\\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\\n }\\n\\n /**\\n * @dev Returns the value in the last (most recent) checkpoint with key lower or equal than the search key, or zero\\n * if there is none.\\n *\\n * NOTE: This is a variant of {upperLookup} that is optimised to find \\\"recent\\\" checkpoint (checkpoints with high\\n * keys).\\n */\\n function upperLookupRecent(Trace224 storage self, uint32 key) internal view returns (uint224) {\\n uint256 len = self._checkpoints.length;\\n\\n uint256 low = 0;\\n uint256 high = len;\\n\\n if (len > 5) {\\n uint256 mid = len - Math.sqrt(len);\\n if (key < _unsafeAccess(self._checkpoints, mid)._key) {\\n high = mid;\\n } else {\\n low = mid + 1;\\n }\\n }\\n\\n uint256 pos = _upperBinaryLookup(self._checkpoints, key, low, high);\\n\\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\\n }\\n\\n /**\\n * @dev Returns the value in the most recent checkpoint, or zero if there are no checkpoints.\\n */\\n function latest(Trace224 storage self) internal view returns (uint224) {\\n uint256 pos = self._checkpoints.length;\\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\\n }\\n\\n /**\\n * @dev Returns whether there is a checkpoint in the structure (i.e. it is not empty), and if so the key and value\\n * in the most recent checkpoint.\\n */\\n function latestCheckpoint(Trace224 storage self) internal view returns (bool exists, uint32 _key, uint224 _value) {\\n uint256 pos = self._checkpoints.length;\\n if (pos == 0) {\\n return (false, 0, 0);\\n } else {\\n Checkpoint224 storage ckpt = _unsafeAccess(self._checkpoints, pos - 1);\\n return (true, ckpt._key, ckpt._value);\\n }\\n }\\n\\n /**\\n * @dev Returns the number of checkpoint.\\n */\\n function length(Trace224 storage self) internal view returns (uint256) {\\n return self._checkpoints.length;\\n }\\n\\n /**\\n * @dev Returns checkpoint at given position.\\n */\\n function at(Trace224 storage self, uint32 pos) internal view returns (Checkpoint224 memory) {\\n return self._checkpoints[pos];\\n }\\n\\n /**\\n * @dev Pushes a (`key`, `value`) pair into an ordered list of checkpoints, either by inserting a new checkpoint,\\n * or by updating the last one.\\n */\\n function _insert(\\n Checkpoint224[] storage self,\\n uint32 key,\\n uint224 value\\n ) private returns (uint224 oldValue, uint224 newValue) {\\n uint256 pos = self.length;\\n\\n if (pos > 0) {\\n Checkpoint224 storage last = _unsafeAccess(self, pos - 1);\\n uint32 lastKey = last._key;\\n uint224 lastValue = last._value;\\n\\n // Checkpoint keys must be non-decreasing.\\n if (lastKey > key) {\\n revert CheckpointUnorderedInsertion();\\n }\\n\\n // Update or push new checkpoint\\n if (lastKey == key) {\\n last._value = value;\\n } else {\\n self.push(Checkpoint224({_key: key, _value: value}));\\n }\\n return (lastValue, value);\\n } else {\\n self.push(Checkpoint224({_key: key, _value: value}));\\n return (0, value);\\n }\\n }\\n\\n /**\\n * @dev Return the index of the first (oldest) checkpoint with key strictly bigger than the search key, or `high`\\n * if there is none. `low` and `high` define a section where to do the search, with inclusive `low` and exclusive\\n * `high`.\\n *\\n * WARNING: `high` should not be greater than the array's length.\\n */\\n function _upperBinaryLookup(\\n Checkpoint224[] storage self,\\n uint32 key,\\n uint256 low,\\n uint256 high\\n ) private view returns (uint256) {\\n while (low < high) {\\n uint256 mid = Math.average(low, high);\\n if (_unsafeAccess(self, mid)._key > key) {\\n high = mid;\\n } else {\\n low = mid + 1;\\n }\\n }\\n return high;\\n }\\n\\n /**\\n * @dev Return the index of the first (oldest) checkpoint with key greater or equal than the search key, or `high`\\n * if there is none. `low` and `high` define a section where to do the search, with inclusive `low` and exclusive\\n * `high`.\\n *\\n * WARNING: `high` should not be greater than the array's length.\\n */\\n function _lowerBinaryLookup(\\n Checkpoint224[] storage self,\\n uint32 key,\\n uint256 low,\\n uint256 high\\n ) private view returns (uint256) {\\n while (low < high) {\\n uint256 mid = Math.average(low, high);\\n if (_unsafeAccess(self, mid)._key < key) {\\n low = mid + 1;\\n } else {\\n high = mid;\\n }\\n }\\n return high;\\n }\\n\\n /**\\n * @dev Access an element of the array without performing bounds check. The position is assumed to be within bounds.\\n */\\n function _unsafeAccess(\\n Checkpoint224[] storage self,\\n uint256 pos\\n ) private pure returns (Checkpoint224 storage result) {\\n assembly {\\n mstore(0, self.slot)\\n result.slot := add(keccak256(0, 0x20), pos)\\n }\\n }\\n\\n struct Trace208 {\\n Checkpoint208[] _checkpoints;\\n }\\n\\n struct Checkpoint208 {\\n uint48 _key;\\n uint208 _value;\\n }\\n\\n /**\\n * @dev Pushes a (`key`, `value`) pair into a Trace208 so that it is stored as the checkpoint.\\n *\\n * Returns previous value and new value.\\n *\\n * IMPORTANT: Never accept `key` as a user input, since an arbitrary `type(uint48).max` key set will disable the\\n * library.\\n */\\n function push(\\n Trace208 storage self,\\n uint48 key,\\n uint208 value\\n ) internal returns (uint208 oldValue, uint208 newValue) {\\n return _insert(self._checkpoints, key, value);\\n }\\n\\n /**\\n * @dev Returns the value in the first (oldest) checkpoint with key greater or equal than the search key, or zero if\\n * there is none.\\n */\\n function lowerLookup(Trace208 storage self, uint48 key) internal view returns (uint208) {\\n uint256 len = self._checkpoints.length;\\n uint256 pos = _lowerBinaryLookup(self._checkpoints, key, 0, len);\\n return pos == len ? 0 : _unsafeAccess(self._checkpoints, pos)._value;\\n }\\n\\n /**\\n * @dev Returns the value in the last (most recent) checkpoint with key lower or equal than the search key, or zero\\n * if there is none.\\n */\\n function upperLookup(Trace208 storage self, uint48 key) internal view returns (uint208) {\\n uint256 len = self._checkpoints.length;\\n uint256 pos = _upperBinaryLookup(self._checkpoints, key, 0, len);\\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\\n }\\n\\n /**\\n * @dev Returns the value in the last (most recent) checkpoint with key lower or equal than the search key, or zero\\n * if there is none.\\n *\\n * NOTE: This is a variant of {upperLookup} that is optimised to find \\\"recent\\\" checkpoint (checkpoints with high\\n * keys).\\n */\\n function upperLookupRecent(Trace208 storage self, uint48 key) internal view returns (uint208) {\\n uint256 len = self._checkpoints.length;\\n\\n uint256 low = 0;\\n uint256 high = len;\\n\\n if (len > 5) {\\n uint256 mid = len - Math.sqrt(len);\\n if (key < _unsafeAccess(self._checkpoints, mid)._key) {\\n high = mid;\\n } else {\\n low = mid + 1;\\n }\\n }\\n\\n uint256 pos = _upperBinaryLookup(self._checkpoints, key, low, high);\\n\\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\\n }\\n\\n /**\\n * @dev Returns the value in the most recent checkpoint, or zero if there are no checkpoints.\\n */\\n function latest(Trace208 storage self) internal view returns (uint208) {\\n uint256 pos = self._checkpoints.length;\\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\\n }\\n\\n /**\\n * @dev Returns whether there is a checkpoint in the structure (i.e. it is not empty), and if so the key and value\\n * in the most recent checkpoint.\\n */\\n function latestCheckpoint(Trace208 storage self) internal view returns (bool exists, uint48 _key, uint208 _value) {\\n uint256 pos = self._checkpoints.length;\\n if (pos == 0) {\\n return (false, 0, 0);\\n } else {\\n Checkpoint208 storage ckpt = _unsafeAccess(self._checkpoints, pos - 1);\\n return (true, ckpt._key, ckpt._value);\\n }\\n }\\n\\n /**\\n * @dev Returns the number of checkpoint.\\n */\\n function length(Trace208 storage self) internal view returns (uint256) {\\n return self._checkpoints.length;\\n }\\n\\n /**\\n * @dev Returns checkpoint at given position.\\n */\\n function at(Trace208 storage self, uint32 pos) internal view returns (Checkpoint208 memory) {\\n return self._checkpoints[pos];\\n }\\n\\n /**\\n * @dev Pushes a (`key`, `value`) pair into an ordered list of checkpoints, either by inserting a new checkpoint,\\n * or by updating the last one.\\n */\\n function _insert(\\n Checkpoint208[] storage self,\\n uint48 key,\\n uint208 value\\n ) private returns (uint208 oldValue, uint208 newValue) {\\n uint256 pos = self.length;\\n\\n if (pos > 0) {\\n Checkpoint208 storage last = _unsafeAccess(self, pos - 1);\\n uint48 lastKey = last._key;\\n uint208 lastValue = last._value;\\n\\n // Checkpoint keys must be non-decreasing.\\n if (lastKey > key) {\\n revert CheckpointUnorderedInsertion();\\n }\\n\\n // Update or push new checkpoint\\n if (lastKey == key) {\\n last._value = value;\\n } else {\\n self.push(Checkpoint208({_key: key, _value: value}));\\n }\\n return (lastValue, value);\\n } else {\\n self.push(Checkpoint208({_key: key, _value: value}));\\n return (0, value);\\n }\\n }\\n\\n /**\\n * @dev Return the index of the first (oldest) checkpoint with key strictly bigger than the search key, or `high`\\n * if there is none. `low` and `high` define a section where to do the search, with inclusive `low` and exclusive\\n * `high`.\\n *\\n * WARNING: `high` should not be greater than the array's length.\\n */\\n function _upperBinaryLookup(\\n Checkpoint208[] storage self,\\n uint48 key,\\n uint256 low,\\n uint256 high\\n ) private view returns (uint256) {\\n while (low < high) {\\n uint256 mid = Math.average(low, high);\\n if (_unsafeAccess(self, mid)._key > key) {\\n high = mid;\\n } else {\\n low = mid + 1;\\n }\\n }\\n return high;\\n }\\n\\n /**\\n * @dev Return the index of the first (oldest) checkpoint with key greater or equal than the search key, or `high`\\n * if there is none. `low` and `high` define a section where to do the search, with inclusive `low` and exclusive\\n * `high`.\\n *\\n * WARNING: `high` should not be greater than the array's length.\\n */\\n function _lowerBinaryLookup(\\n Checkpoint208[] storage self,\\n uint48 key,\\n uint256 low,\\n uint256 high\\n ) private view returns (uint256) {\\n while (low < high) {\\n uint256 mid = Math.average(low, high);\\n if (_unsafeAccess(self, mid)._key < key) {\\n low = mid + 1;\\n } else {\\n high = mid;\\n }\\n }\\n return high;\\n }\\n\\n /**\\n * @dev Access an element of the array without performing bounds check. The position is assumed to be within bounds.\\n */\\n function _unsafeAccess(\\n Checkpoint208[] storage self,\\n uint256 pos\\n ) private pure returns (Checkpoint208 storage result) {\\n assembly {\\n mstore(0, self.slot)\\n result.slot := add(keccak256(0, 0x20), pos)\\n }\\n }\\n\\n struct Trace160 {\\n Checkpoint160[] _checkpoints;\\n }\\n\\n struct Checkpoint160 {\\n uint96 _key;\\n uint160 _value;\\n }\\n\\n /**\\n * @dev Pushes a (`key`, `value`) pair into a Trace160 so that it is stored as the checkpoint.\\n *\\n * Returns previous value and new value.\\n *\\n * IMPORTANT: Never accept `key` as a user input, since an arbitrary `type(uint96).max` key set will disable the\\n * library.\\n */\\n function push(\\n Trace160 storage self,\\n uint96 key,\\n uint160 value\\n ) internal returns (uint160 oldValue, uint160 newValue) {\\n return _insert(self._checkpoints, key, value);\\n }\\n\\n /**\\n * @dev Returns the value in the first (oldest) checkpoint with key greater or equal than the search key, or zero if\\n * there is none.\\n */\\n function lowerLookup(Trace160 storage self, uint96 key) internal view returns (uint160) {\\n uint256 len = self._checkpoints.length;\\n uint256 pos = _lowerBinaryLookup(self._checkpoints, key, 0, len);\\n return pos == len ? 0 : _unsafeAccess(self._checkpoints, pos)._value;\\n }\\n\\n /**\\n * @dev Returns the value in the last (most recent) checkpoint with key lower or equal than the search key, or zero\\n * if there is none.\\n */\\n function upperLookup(Trace160 storage self, uint96 key) internal view returns (uint160) {\\n uint256 len = self._checkpoints.length;\\n uint256 pos = _upperBinaryLookup(self._checkpoints, key, 0, len);\\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\\n }\\n\\n /**\\n * @dev Returns the value in the last (most recent) checkpoint with key lower or equal than the search key, or zero\\n * if there is none.\\n *\\n * NOTE: This is a variant of {upperLookup} that is optimised to find \\\"recent\\\" checkpoint (checkpoints with high\\n * keys).\\n */\\n function upperLookupRecent(Trace160 storage self, uint96 key) internal view returns (uint160) {\\n uint256 len = self._checkpoints.length;\\n\\n uint256 low = 0;\\n uint256 high = len;\\n\\n if (len > 5) {\\n uint256 mid = len - Math.sqrt(len);\\n if (key < _unsafeAccess(self._checkpoints, mid)._key) {\\n high = mid;\\n } else {\\n low = mid + 1;\\n }\\n }\\n\\n uint256 pos = _upperBinaryLookup(self._checkpoints, key, low, high);\\n\\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\\n }\\n\\n /**\\n * @dev Returns the value in the most recent checkpoint, or zero if there are no checkpoints.\\n */\\n function latest(Trace160 storage self) internal view returns (uint160) {\\n uint256 pos = self._checkpoints.length;\\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\\n }\\n\\n /**\\n * @dev Returns whether there is a checkpoint in the structure (i.e. it is not empty), and if so the key and value\\n * in the most recent checkpoint.\\n */\\n function latestCheckpoint(Trace160 storage self) internal view returns (bool exists, uint96 _key, uint160 _value) {\\n uint256 pos = self._checkpoints.length;\\n if (pos == 0) {\\n return (false, 0, 0);\\n } else {\\n Checkpoint160 storage ckpt = _unsafeAccess(self._checkpoints, pos - 1);\\n return (true, ckpt._key, ckpt._value);\\n }\\n }\\n\\n /**\\n * @dev Returns the number of checkpoint.\\n */\\n function length(Trace160 storage self) internal view returns (uint256) {\\n return self._checkpoints.length;\\n }\\n\\n /**\\n * @dev Returns checkpoint at given position.\\n */\\n function at(Trace160 storage self, uint32 pos) internal view returns (Checkpoint160 memory) {\\n return self._checkpoints[pos];\\n }\\n\\n /**\\n * @dev Pushes a (`key`, `value`) pair into an ordered list of checkpoints, either by inserting a new checkpoint,\\n * or by updating the last one.\\n */\\n function _insert(\\n Checkpoint160[] storage self,\\n uint96 key,\\n uint160 value\\n ) private returns (uint160 oldValue, uint160 newValue) {\\n uint256 pos = self.length;\\n\\n if (pos > 0) {\\n Checkpoint160 storage last = _unsafeAccess(self, pos - 1);\\n uint96 lastKey = last._key;\\n uint160 lastValue = last._value;\\n\\n // Checkpoint keys must be non-decreasing.\\n if (lastKey > key) {\\n revert CheckpointUnorderedInsertion();\\n }\\n\\n // Update or push new checkpoint\\n if (lastKey == key) {\\n last._value = value;\\n } else {\\n self.push(Checkpoint160({_key: key, _value: value}));\\n }\\n return (lastValue, value);\\n } else {\\n self.push(Checkpoint160({_key: key, _value: value}));\\n return (0, value);\\n }\\n }\\n\\n /**\\n * @dev Return the index of the first (oldest) checkpoint with key strictly bigger than the search key, or `high`\\n * if there is none. `low` and `high` define a section where to do the search, with inclusive `low` and exclusive\\n * `high`.\\n *\\n * WARNING: `high` should not be greater than the array's length.\\n */\\n function _upperBinaryLookup(\\n Checkpoint160[] storage self,\\n uint96 key,\\n uint256 low,\\n uint256 high\\n ) private view returns (uint256) {\\n while (low < high) {\\n uint256 mid = Math.average(low, high);\\n if (_unsafeAccess(self, mid)._key > key) {\\n high = mid;\\n } else {\\n low = mid + 1;\\n }\\n }\\n return high;\\n }\\n\\n /**\\n * @dev Return the index of the first (oldest) checkpoint with key greater or equal than the search key, or `high`\\n * if there is none. `low` and `high` define a section where to do the search, with inclusive `low` and exclusive\\n * `high`.\\n *\\n * WARNING: `high` should not be greater than the array's length.\\n */\\n function _lowerBinaryLookup(\\n Checkpoint160[] storage self,\\n uint96 key,\\n uint256 low,\\n uint256 high\\n ) private view returns (uint256) {\\n while (low < high) {\\n uint256 mid = Math.average(low, high);\\n if (_unsafeAccess(self, mid)._key < key) {\\n low = mid + 1;\\n } else {\\n high = mid;\\n }\\n }\\n return high;\\n }\\n\\n /**\\n * @dev Access an element of the array without performing bounds check. The position is assumed to be within bounds.\\n */\\n function _unsafeAccess(\\n Checkpoint160[] storage self,\\n uint256 pos\\n ) private pure returns (Checkpoint160 storage result) {\\n assembly {\\n mstore(0, self.slot)\\n result.slot := add(keccak256(0, 0x20), pos)\\n }\\n }\\n}\\n\",\"keccak256\":\"0x66364cd3247ea71cdb58f080f5d5ed6732433a8001413139661841535494692f\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/structs/DoubleEndedQueue.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/structs/DoubleEndedQueue.sol)\\npragma solidity ^0.8.20;\\n\\nimport {Panic} from \\\"../Panic.sol\\\";\\n\\n/**\\n * @dev A sequence of items with the ability to efficiently push and pop items (i.e. insert and remove) on both ends of\\n * the sequence (called front and back). Among other access patterns, it can be used to implement efficient LIFO and\\n * FIFO queues. Storage use is optimized, and all operations are O(1) constant time. This includes {clear}, given that\\n * the existing queue contents are left in storage.\\n *\\n * The struct is called `Bytes32Deque`. Other types can be cast to and from `bytes32`. This data structure can only be\\n * used in storage, and not in memory.\\n * ```solidity\\n * DoubleEndedQueue.Bytes32Deque queue;\\n * ```\\n */\\nlibrary DoubleEndedQueue {\\n /**\\n * @dev Indices are 128 bits so begin and end are packed in a single storage slot for efficient access.\\n *\\n * Struct members have an underscore prefix indicating that they are \\\"private\\\" and should not be read or written to\\n * directly. Use the functions provided below instead. Modifying the struct manually may violate assumptions and\\n * lead to unexpected behavior.\\n *\\n * The first item is at data[begin] and the last item is at data[end - 1]. This range can wrap around.\\n */\\n struct Bytes32Deque {\\n uint128 _begin;\\n uint128 _end;\\n mapping(uint128 index => bytes32) _data;\\n }\\n\\n /**\\n * @dev Inserts an item at the end of the queue.\\n *\\n * Reverts with {Panic-RESOURCE_ERROR} if the queue is full.\\n */\\n function pushBack(Bytes32Deque storage deque, bytes32 value) internal {\\n unchecked {\\n uint128 backIndex = deque._end;\\n if (backIndex + 1 == deque._begin) Panic.panic(Panic.RESOURCE_ERROR);\\n deque._data[backIndex] = value;\\n deque._end = backIndex + 1;\\n }\\n }\\n\\n /**\\n * @dev Removes the item at the end of the queue and returns it.\\n *\\n * Reverts with {Panic-EMPTY_ARRAY_POP} if the queue is empty.\\n */\\n function popBack(Bytes32Deque storage deque) internal returns (bytes32 value) {\\n unchecked {\\n uint128 backIndex = deque._end;\\n if (backIndex == deque._begin) Panic.panic(Panic.EMPTY_ARRAY_POP);\\n --backIndex;\\n value = deque._data[backIndex];\\n delete deque._data[backIndex];\\n deque._end = backIndex;\\n }\\n }\\n\\n /**\\n * @dev Inserts an item at the beginning of the queue.\\n *\\n * Reverts with {Panic-RESOURCE_ERROR} if the queue is full.\\n */\\n function pushFront(Bytes32Deque storage deque, bytes32 value) internal {\\n unchecked {\\n uint128 frontIndex = deque._begin - 1;\\n if (frontIndex == deque._end) Panic.panic(Panic.RESOURCE_ERROR);\\n deque._data[frontIndex] = value;\\n deque._begin = frontIndex;\\n }\\n }\\n\\n /**\\n * @dev Removes the item at the beginning of the queue and returns it.\\n *\\n * Reverts with {Panic-EMPTY_ARRAY_POP} if the queue is empty.\\n */\\n function popFront(Bytes32Deque storage deque) internal returns (bytes32 value) {\\n unchecked {\\n uint128 frontIndex = deque._begin;\\n if (frontIndex == deque._end) Panic.panic(Panic.EMPTY_ARRAY_POP);\\n value = deque._data[frontIndex];\\n delete deque._data[frontIndex];\\n deque._begin = frontIndex + 1;\\n }\\n }\\n\\n /**\\n * @dev Returns the item at the beginning of the queue.\\n *\\n * Reverts with {Panic-ARRAY_OUT_OF_BOUNDS} if the queue is empty.\\n */\\n function front(Bytes32Deque storage deque) internal view returns (bytes32 value) {\\n if (empty(deque)) Panic.panic(Panic.ARRAY_OUT_OF_BOUNDS);\\n return deque._data[deque._begin];\\n }\\n\\n /**\\n * @dev Returns the item at the end of the queue.\\n *\\n * Reverts with {Panic-ARRAY_OUT_OF_BOUNDS} if the queue is empty.\\n */\\n function back(Bytes32Deque storage deque) internal view returns (bytes32 value) {\\n if (empty(deque)) Panic.panic(Panic.ARRAY_OUT_OF_BOUNDS);\\n unchecked {\\n return deque._data[deque._end - 1];\\n }\\n }\\n\\n /**\\n * @dev Return the item at a position in the queue given by `index`, with the first item at 0 and last item at\\n * `length(deque) - 1`.\\n *\\n * Reverts with {Panic-ARRAY_OUT_OF_BOUNDS} if the index is out of bounds.\\n */\\n function at(Bytes32Deque storage deque, uint256 index) internal view returns (bytes32 value) {\\n if (index >= length(deque)) Panic.panic(Panic.ARRAY_OUT_OF_BOUNDS);\\n // By construction, length is a uint128, so the check above ensures that index can be safely downcast to uint128\\n unchecked {\\n return deque._data[deque._begin + uint128(index)];\\n }\\n }\\n\\n /**\\n * @dev Resets the queue back to being empty.\\n *\\n * NOTE: The current items are left behind in storage. This does not affect the functioning of the queue, but misses\\n * out on potential gas refunds.\\n */\\n function clear(Bytes32Deque storage deque) internal {\\n deque._begin = 0;\\n deque._end = 0;\\n }\\n\\n /**\\n * @dev Returns the number of items in the queue.\\n */\\n function length(Bytes32Deque storage deque) internal view returns (uint256) {\\n unchecked {\\n return uint256(deque._end - deque._begin);\\n }\\n }\\n\\n /**\\n * @dev Returns true if the queue is empty.\\n */\\n function empty(Bytes32Deque storage deque) internal view returns (bool) {\\n return deque._end == deque._begin;\\n }\\n}\\n\",\"keccak256\":\"0x1e1d74658d7f4eab3d4f8fb0c6c5953bc5f629d9425e978d557dabff7b58b217\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/types/Time.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/types/Time.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {Math} from \\\"../math/Math.sol\\\";\\nimport {SafeCast} from \\\"../math/SafeCast.sol\\\";\\n\\n/**\\n * @dev This library provides helpers for manipulating time-related objects.\\n *\\n * It uses the following types:\\n * - `uint48` for timepoints\\n * - `uint32` for durations\\n *\\n * While the library doesn't provide specific types for timepoints and duration, it does provide:\\n * - a `Delay` type to represent duration that can be programmed to change value automatically at a given point\\n * - additional helper functions\\n */\\nlibrary Time {\\n using Time for *;\\n\\n /**\\n * @dev Get the block timestamp as a Timepoint.\\n */\\n function timestamp() internal view returns (uint48) {\\n return SafeCast.toUint48(block.timestamp);\\n }\\n\\n /**\\n * @dev Get the block number as a Timepoint.\\n */\\n function blockNumber() internal view returns (uint48) {\\n return SafeCast.toUint48(block.number);\\n }\\n\\n // ==================================================== Delay =====================================================\\n /**\\n * @dev A `Delay` is a uint32 duration that can be programmed to change value automatically at a given point in the\\n * future. The \\\"effect\\\" timepoint describes when the transitions happens from the \\\"old\\\" value to the \\\"new\\\" value.\\n * This allows updating the delay applied to some operation while keeping some guarantees.\\n *\\n * In particular, the {update} function guarantees that if the delay is reduced, the old delay still applies for\\n * some time. For example if the delay is currently 7 days to do an upgrade, the admin should not be able to set\\n * the delay to 0 and upgrade immediately. If the admin wants to reduce the delay, the old delay (7 days) should\\n * still apply for some time.\\n *\\n *\\n * The `Delay` type is 112 bits long, and packs the following:\\n *\\n * ```\\n * | [uint48]: effect date (timepoint)\\n * | | [uint32]: value before (duration)\\n * \\u2193 \\u2193 \\u2193 [uint32]: value after (duration)\\n * 0xAAAAAAAAAAAABBBBBBBBCCCCCCCC\\n * ```\\n *\\n * NOTE: The {get} and {withUpdate} functions operate using timestamps. Block number based delays are not currently\\n * supported.\\n */\\n type Delay is uint112;\\n\\n /**\\n * @dev Wrap a duration into a Delay to add the one-step \\\"update in the future\\\" feature\\n */\\n function toDelay(uint32 duration) internal pure returns (Delay) {\\n return Delay.wrap(duration);\\n }\\n\\n /**\\n * @dev Get the value at a given timepoint plus the pending value and effect timepoint if there is a scheduled\\n * change after this timepoint. If the effect timepoint is 0, then the pending value should not be considered.\\n */\\n function _getFullAt(\\n Delay self,\\n uint48 timepoint\\n ) private pure returns (uint32 valueBefore, uint32 valueAfter, uint48 effect) {\\n (valueBefore, valueAfter, effect) = self.unpack();\\n return effect <= timepoint ? (valueAfter, 0, 0) : (valueBefore, valueAfter, effect);\\n }\\n\\n /**\\n * @dev Get the current value plus the pending value and effect timepoint if there is a scheduled change. If the\\n * effect timepoint is 0, then the pending value should not be considered.\\n */\\n function getFull(Delay self) internal view returns (uint32 valueBefore, uint32 valueAfter, uint48 effect) {\\n return _getFullAt(self, timestamp());\\n }\\n\\n /**\\n * @dev Get the current value.\\n */\\n function get(Delay self) internal view returns (uint32) {\\n (uint32 delay, , ) = self.getFull();\\n return delay;\\n }\\n\\n /**\\n * @dev Update a Delay object so that it takes a new duration after a timepoint that is automatically computed to\\n * enforce the old delay at the moment of the update. Returns the updated Delay object and the timestamp when the\\n * new delay becomes effective.\\n */\\n function withUpdate(\\n Delay self,\\n uint32 newValue,\\n uint32 minSetback\\n ) internal view returns (Delay updatedDelay, uint48 effect) {\\n uint32 value = self.get();\\n uint32 setback = uint32(Math.max(minSetback, value > newValue ? value - newValue : 0));\\n effect = timestamp() + setback;\\n return (pack(value, newValue, effect), effect);\\n }\\n\\n /**\\n * @dev Split a delay into its components: valueBefore, valueAfter and effect (transition timepoint).\\n */\\n function unpack(Delay self) internal pure returns (uint32 valueBefore, uint32 valueAfter, uint48 effect) {\\n uint112 raw = Delay.unwrap(self);\\n\\n valueAfter = uint32(raw);\\n valueBefore = uint32(raw >> 32);\\n effect = uint48(raw >> 64);\\n\\n return (valueBefore, valueAfter, effect);\\n }\\n\\n /**\\n * @dev pack the components into a Delay object.\\n */\\n function pack(uint32 valueBefore, uint32 valueAfter, uint48 effect) internal pure returns (Delay) {\\n return Delay.wrap((uint112(effect) << 64) | (uint112(valueBefore) << 32) | uint112(valueAfter));\\n }\\n}\\n\",\"keccak256\":\"0x36776530f012618bc7526ceb28e77b85e582cb12d9b9466a71d4bd6bf952e4cc\",\"license\":\"MIT\"},\"contracts/variants/crosschain/Gov.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity ^0.8.20;\\n\\nimport \\\"@openzeppelin/contracts/governance/Governor.sol\\\";\\nimport \\\"@openzeppelin/contracts/governance/extensions/GovernorSettings.sol\\\";\\nimport \\\"@openzeppelin/contracts/governance/extensions/GovernorCountingSimple.sol\\\";\\nimport \\\"@openzeppelin/contracts/governance/extensions/GovernorVotes.sol\\\";\\nimport \\\"@openzeppelin/contracts/governance/extensions/GovernorVotesQuorumFraction.sol\\\";\\nimport \\\"./ProofHandler.sol\\\";\\n\\n/**\\n * @title Cross-chain Governance Contract\\n * @author Web3 Hackers Collective\\n * @notice Implementation of a DAO with cross-chain synchronization capabilities\\n * @dev Extends OpenZeppelin's Governor contract with cross-chain parameter updates\\n * @custom:security-contact julien@strat.cc\\n */\\ncontract Gov is\\n Governor,\\n GovernorSettings,\\n GovernorCountingSimple,\\n GovernorVotes,\\n GovernorVotesQuorumFraction\\n{\\n /// @notice Chain ID where this contract was originally deployed\\n uint256 public immutable home;\\n\\n /// @notice IPFS CID of the DAO's manifesto\\n string public manifesto;\\n\\n /// @notice Storage for proof handling\\n ProofHandler.ProofStorage private _proofStorage;\\n\\n /// @notice Types of operations that can be synchronized across chains\\n enum OperationType {\\n SET_MANIFESTO,\\n UPDATE_VOTING_DELAY,\\n UPDATE_VOTING_PERIOD,\\n UPDATE_PROPOSAL_THRESHOLD,\\n UPDATE_QUORUM\\n }\\n\\n /// @notice Emitted when the manifesto is updated\\n /// @param oldManifesto Previous manifesto CID\\n /// @param newManifesto New manifesto CID\\n /// @param nonce Update sequence number\\n event ManifestoUpdated(string oldManifesto, string newManifesto, uint256 nonce);\\n\\n /// @notice Emitted when a governance parameter is updated\\n /// @param operationType Type of parameter updated\\n /// @param oldValue Previous value\\n /// @param newValue New value\\n /// @param nonce Update sequence number\\n event GovernanceParameterUpdated(\\n OperationType indexed operationType,\\n uint256 oldValue,\\n uint256 newValue,\\n uint256 nonce\\n );\\n\\n /// @notice Restricts functions to be called only on the home chain\\n modifier onlyHomeChain() {\\n require(block.chainid == home, \\\"Operation only allowed on home chain\\\");\\n _;\\n }\\n\\n /**\\n * @notice Initializes the governance contract\\n * @dev Sets up initial governance parameters and manifesto\\n * @param _home Chain ID where this contract is considered home\\n * @param _token The voting token contract address\\n * @param _manifestoCid Initial manifesto CID\\n * @param _name Name of the governance contract\\n * @param _votingDelay Time before voting begins\\n * @param _votingPeriod Duration of voting period\\n * @param _proposalThreshold Minimum votes needed to create a proposal\\n * @param _quorum Minimum participation percentage required\\n */\\n constructor(\\n uint256 _home,\\n IVotes _token,\\n string memory _manifestoCid,\\n string memory _name,\\n uint48 _votingDelay,\\n uint32 _votingPeriod,\\n uint256 _proposalThreshold,\\n uint256 _quorum\\n )\\n Governor(_name)\\n GovernorSettings(_votingDelay, _votingPeriod, _proposalThreshold)\\n GovernorVotes(_token)\\n GovernorVotesQuorumFraction(_quorum)\\n {\\n home = _home;\\n manifesto = _manifestoCid;\\n }\\n\\n /**\\n * @notice Updates the DAO's manifesto on the home chain\\n * @param newManifesto New manifesto CID\\n */\\n function setManifesto(string memory newManifesto) public onlyGovernance onlyHomeChain {\\n uint256 nonce = ProofHandler.incrementNonce(\\n _proofStorage,\\n uint8(OperationType.SET_MANIFESTO)\\n );\\n string memory oldManifesto = manifesto;\\n manifesto = newManifesto;\\n emit ManifestoUpdated(oldManifesto, newManifesto, nonce);\\n }\\n\\n /**\\n * @notice Updates the voting delay parameter on the home chain\\n * @param newVotingDelay New voting delay value\\n */\\n function setVotingDelay(\\n uint48 newVotingDelay\\n ) public virtual override onlyGovernance onlyHomeChain {\\n uint256 nonce = ProofHandler.incrementNonce(\\n _proofStorage,\\n uint8(OperationType.UPDATE_VOTING_DELAY)\\n );\\n uint256 oldValue = votingDelay();\\n _setVotingDelay(newVotingDelay);\\n emit GovernanceParameterUpdated(\\n OperationType.UPDATE_VOTING_DELAY,\\n oldValue,\\n newVotingDelay,\\n nonce\\n );\\n }\\n\\n /**\\n * @notice Updates the voting period parameter on the home chain\\n * @param newVotingPeriod New voting period value\\n */\\n function setVotingPeriod(\\n uint32 newVotingPeriod\\n ) public virtual override onlyGovernance onlyHomeChain {\\n uint256 nonce = ProofHandler.incrementNonce(\\n _proofStorage,\\n uint8(OperationType.UPDATE_VOTING_PERIOD)\\n );\\n uint256 oldValue = votingPeriod();\\n _setVotingPeriod(newVotingPeriod);\\n emit GovernanceParameterUpdated(\\n OperationType.UPDATE_VOTING_PERIOD,\\n oldValue,\\n newVotingPeriod,\\n nonce\\n );\\n }\\n\\n /**\\n * @notice Updates the proposal threshold parameter on the home chain\\n * @param newProposalThreshold New proposal threshold value\\n */\\n function setProposalThreshold(\\n uint256 newProposalThreshold\\n ) public virtual override onlyGovernance onlyHomeChain {\\n uint256 nonce = ProofHandler.incrementNonce(\\n _proofStorage,\\n uint8(OperationType.UPDATE_PROPOSAL_THRESHOLD)\\n );\\n uint256 oldValue = proposalThreshold();\\n _setProposalThreshold(newProposalThreshold);\\n emit GovernanceParameterUpdated(\\n OperationType.UPDATE_PROPOSAL_THRESHOLD,\\n oldValue,\\n newProposalThreshold,\\n nonce\\n );\\n }\\n\\n /**\\n * @notice Updates the quorum numerator on the home chain\\n * @param newQuorumNumerator New quorum numerator value\\n */\\n function updateQuorumNumerator(\\n uint256 newQuorumNumerator\\n ) public virtual override onlyGovernance onlyHomeChain {\\n uint256 nonce = ProofHandler.incrementNonce(\\n _proofStorage,\\n uint8(OperationType.UPDATE_QUORUM)\\n );\\n uint256 oldValue = quorumNumerator();\\n _updateQuorumNumerator(newQuorumNumerator);\\n emit GovernanceParameterUpdated(\\n OperationType.UPDATE_QUORUM,\\n oldValue,\\n newQuorumNumerator,\\n nonce\\n );\\n }\\n\\n /**\\n * @notice Generates proof for parameter updates\\n * @param operationType Type of parameter being updated\\n * @param value Encoded parameter value\\n * @return proof Encoded proof data\\n */\\n function generateParameterProof(\\n uint8 operationType,\\n bytes memory value\\n ) external view returns (bytes memory proof) {\\n require(block.chainid == home, \\\"Proofs only generated on home chain\\\");\\n uint256 nextNonce = ProofHandler.getNextNonce(_proofStorage, operationType);\\n return ProofHandler.generateProof(address(this), operationType, value, nextNonce);\\n }\\n\\n /**\\n * @notice Claims a parameter update on a foreign chain\\n * @param proof Proof generated by home chain\\n */\\n function claimParameterUpdate(bytes memory proof) external {\\n (uint8 operationType, bytes memory value, uint256 nonce) = ProofHandler.verifyAndClaimProof(\\n proof,\\n address(this),\\n _proofStorage\\n );\\n\\n if (operationType == uint8(OperationType.SET_MANIFESTO)) {\\n string memory newManifesto = abi.decode(value, (string));\\n string memory oldManifesto = manifesto;\\n manifesto = newManifesto;\\n emit ManifestoUpdated(oldManifesto, newManifesto, nonce);\\n } else if (operationType == uint8(OperationType.UPDATE_VOTING_DELAY)) {\\n uint48 newValue = uint48(bytes6(value));\\n uint256 oldValue = votingDelay();\\n _setVotingDelay(newValue);\\n emit GovernanceParameterUpdated(\\n OperationType.UPDATE_VOTING_DELAY,\\n oldValue,\\n newValue,\\n nonce\\n );\\n } else if (operationType == uint8(OperationType.UPDATE_VOTING_PERIOD)) {\\n uint32 newValue = uint32(bytes4(value));\\n uint256 oldValue = votingPeriod();\\n _setVotingPeriod(newValue);\\n emit GovernanceParameterUpdated(\\n OperationType.UPDATE_VOTING_PERIOD,\\n oldValue,\\n newValue,\\n nonce\\n );\\n } else if (operationType == uint8(OperationType.UPDATE_PROPOSAL_THRESHOLD)) {\\n uint256 newValue = abi.decode(value, (uint256));\\n uint256 oldValue = proposalThreshold();\\n _setProposalThreshold(newValue);\\n emit GovernanceParameterUpdated(\\n OperationType.UPDATE_PROPOSAL_THRESHOLD,\\n oldValue,\\n newValue,\\n nonce\\n );\\n } else if (operationType == uint8(OperationType.UPDATE_QUORUM)) {\\n uint256 newValue = abi.decode(value, (uint256));\\n uint256 oldValue = quorumNumerator();\\n _updateQuorumNumerator(newValue);\\n emit GovernanceParameterUpdated(OperationType.UPDATE_QUORUM, oldValue, newValue, nonce);\\n }\\n }\\n\\n // Required overrides\\n\\n function votingDelay() public view override(Governor, GovernorSettings) returns (uint256) {\\n return super.votingDelay();\\n }\\n\\n function votingPeriod() public view override(Governor, GovernorSettings) returns (uint256) {\\n return super.votingPeriod();\\n }\\n\\n function quorum(\\n uint256 blockNumber\\n ) public view override(Governor, GovernorVotesQuorumFraction) returns (uint256) {\\n return super.quorum(blockNumber);\\n }\\n\\n function proposalThreshold()\\n public\\n view\\n override(Governor, GovernorSettings)\\n returns (uint256)\\n {\\n return super.proposalThreshold();\\n }\\n}\\n\",\"keccak256\":\"0x9c3d392f452d79e03804790803c0f295a48390537eba2be45250a71219800bcc\",\"license\":\"GPL-3.0\"},\"contracts/variants/crosschain/ProofHandler.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity ^0.8.20;\\n\\n/**\\n * @title Proof Handler Library\\n * @author Web3 Hackers Collective\\n * @notice Library for standardized cross-chain proof generation and verification\\n * @dev Handles proof generation, verification, and tracking for cross-chain operations\\n * @custom:security-contact julien@strat.cc\\n */\\nlibrary ProofHandler {\\n /// @notice Tracks which proofs have been applied on each chain\\n struct ProofStorage {\\n mapping(bytes32 => bool) updateAppliedOnChain;\\n mapping(uint8 => uint256) currentNonce;\\n }\\n\\n /// @dev Emitted when a proof is claimed\\n event ProofClaimed(uint8 indexed operationType, bytes params, uint256 nonce);\\n\\n /**\\n * @notice Generates a proof for cross-chain operations\\n * @param contractAddress Address of contract generating the proof\\n * @param operationType Type of operation being performed\\n * @param params Operation parameters\\n * @param nonce Current nonce for this operation type\\n * @return proof Encoded proof data\\n */\\n function generateProof(\\n address contractAddress,\\n uint8 operationType,\\n bytes memory params,\\n uint256 nonce\\n ) public pure returns (bytes memory proof) {\\n bytes32 message = keccak256(\\n abi.encodePacked(contractAddress, operationType, params, nonce)\\n );\\n bytes32 digest = keccak256(abi.encodePacked(\\\"\\\\x19Ethereum Signed Message:\\\\n32\\\", message));\\n\\n return abi.encode(operationType, params, nonce, digest);\\n }\\n\\n /**\\n * @notice Verifies and claims a proof\\n * @param proof Proof to verify and claim\\n * @param contractAddress Address of contract claiming the proof\\n * @param storage_ Proof storage struct\\n * @return operationType The type of operation being performed\\n * @return params The operation parameters\\n * @return nonce The operation sequence number\\n */\\n function verifyAndClaimProof(\\n bytes memory proof,\\n address contractAddress,\\n ProofStorage storage storage_\\n ) public returns (uint8 operationType, bytes memory params, uint256 nonce) {\\n bytes32 digest;\\n (operationType, params, nonce, digest) = abi.decode(\\n proof,\\n (uint8, bytes, uint256, bytes32)\\n );\\n\\n bytes32 proofHash = keccak256(proof);\\n require(!storage_.updateAppliedOnChain[proofHash], \\\"Proof already claimed\\\");\\n require(nonce == storage_.currentNonce[operationType] + 1, \\\"Invalid nonce\\\");\\n\\n bytes32 message = keccak256(\\n abi.encodePacked(contractAddress, operationType, params, nonce)\\n );\\n bytes32 expectedDigest = keccak256(\\n abi.encodePacked(\\\"\\\\x19Ethereum Signed Message:\\\\n32\\\", message)\\n );\\n require(digest == expectedDigest, \\\"Invalid proof\\\");\\n\\n storage_.updateAppliedOnChain[proofHash] = true;\\n storage_.currentNonce[operationType] = nonce;\\n\\n emit ProofClaimed(operationType, params, nonce);\\n\\n return (operationType, params, nonce);\\n }\\n\\n /**\\n * @notice Gets the next nonce for an operation type\\n * @param storage_ Proof storage struct\\n * @param operationType Type of operation\\n * @return nonce Next nonce value\\n */\\n function getNextNonce(\\n ProofStorage storage storage_,\\n uint8 operationType\\n ) public view returns (uint256 nonce) {\\n return storage_.currentNonce[operationType] + 1;\\n }\\n\\n /**\\n * @notice Increments the nonce for an operation type\\n * @param storage_ Proof storage struct\\n * @param operationType Type of operation\\n * @return nonce New nonce value\\n */\\n function incrementNonce(\\n ProofStorage storage storage_,\\n uint8 operationType\\n ) public returns (uint256 nonce) {\\n storage_.currentNonce[operationType]++;\\n return storage_.currentNonce[operationType];\\n }\\n}\\n\",\"keccak256\":\"0x3719e47c508f29977d48842c5c1d27cce7cb289cbb592526f170f98135ff41a7\",\"license\":\"GPL-3.0\"}},\"version\":1}", + "bytecode": "0x6101a06040523480156200001257600080fd5b5060405162005684380380620056848339810160408190526200003591620007d4565b808785858589806200005b6040805180820190915260018152603160f81b602082015290565b6200006882600062000181565b610120526200007981600162000181565b61014052815160208084019190912060e052815190820120610100524660a0526200010760e05161010051604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f60208201529081019290925260608201524660808201523060a082015260009060c00160405160208183030381529060405280519060200120905090565b60805250503060c05260036200011e828262000930565b506200012c905083620001ba565b620001378262000220565b6200014281620002c7565b5050506001600160a01b0316610160526200015d8162000308565b50610180889052600b62000172878262000930565b50505050505050505062000a96565b6000602083511015620001a1576200019983620003a8565b9050620001b4565b81620001ae848262000930565b5060ff90505b92915050565b6008546040805165ffffffffffff928316815291831660208301527fc565b045403dc03c2eea82b81a0465edad9e2e7fc4d97e11421c209da93d7a93910160405180910390a16008805465ffffffffffff191665ffffffffffff92909216919091179055565b8063ffffffff16600003620002505760405163f1cfbf0560e01b8152600060048201526024015b60405180910390fd5b6008546040805163ffffffff66010000000000009093048316815291831660208301527f7e3f7f0708a84de9203036abaa450dccc85ad5ff52f78c170f3edb55cf5e8828910160405180910390a16008805463ffffffff90921666010000000000000263ffffffff60301b19909216919091179055565b60075460408051918252602082018390527fccb45da8d5717e6c4544694297c4ba5cf151d455c9bb0ed4fc7a38411bc05461910160405180910390a1600755565b606480821115620003375760405163243e544560e01b8152600481018390526024810182905260440162000247565b600062000343620003eb565b9050620003686200035362000407565b6200035e8562000489565b600a9190620004c3565b505060408051828152602081018590527f0553476bf02ef2726e8ce5ced78d63e26e602e4a2257b1f559418e24b4633997910160405180910390a1505050565b600080829050601f81511115620003d6578260405163305a27a960e01b8152600401620002479190620009fc565b8051620003e38262000a31565b179392505050565b6000620003f9600a620004e0565b6001600160d01b0316905090565b6000620004146101605190565b6001600160a01b03166391ddadf46040518163ffffffff1660e01b8152600401602060405180830381865afa92505050801562000470575060408051601f3d908101601f191682019092526200046d9181019062000a56565b60015b62000484576200047f62000530565b905090565b919050565b60006001600160d01b03821115620004bf576040516306dfcc6560e41b815260d060048201526024810183905260440162000247565b5090565b600080620004d38585856200053d565b915091505b935093915050565b8054600090801562000526576200050c83620004fe60018462000a74565b600091825260209091200190565b54660100000000000090046001600160d01b031662000529565b60005b9392505050565b60006200047f43620006a6565b825460009081908015620006475760006200055f87620004fe60018562000a74565b805490915065ffffffffffff80821691660100000000000090046001600160d01b0316908816821115620005a657604051632520601d60e01b815260040160405180910390fd5b8765ffffffffffff168265ffffffffffff1603620005e457825465ffffffffffff1666010000000000006001600160d01b0389160217835562000638565b6040805180820190915265ffffffffffff808a1682526001600160d01b03808a1660208085019182528d54600181018f5560008f815291909120945191519092166601000000000000029216919091179101555b9450859350620004d892505050565b50506040805180820190915265ffffffffffff80851682526001600160d01b0380851660208085019182528854600181018a5560008a8152918220955192519093166601000000000000029190931617920191909155905081620004d8565b600065ffffffffffff821115620004bf576040516306dfcc6560e41b8152603060048201526024810183905260440162000247565b634e487b7160e01b600052604160045260246000fd5b60005b838110156200070e578181015183820152602001620006f4565b50506000910152565b600082601f8301126200072957600080fd5b81516001600160401b0380821115620007465762000746620006db565b604051601f8301601f19908116603f01168101908282118183101715620007715762000771620006db565b816040528381528660208588010111156200078b57600080fd5b6200079e846020830160208901620006f1565b9695505050505050565b805165ffffffffffff811681146200048457600080fd5b805163ffffffff811681146200048457600080fd5b600080600080600080600080610100898b031215620007f257600080fd5b885160208a01519098506001600160a01b03811681146200081257600080fd5b60408a01519097506001600160401b03808211156200083057600080fd5b6200083e8c838d0162000717565b975060608b01519150808211156200085557600080fd5b50620008648b828c0162000717565b9550506200087560808a01620007a8565b93506200088560a08a01620007bf565b60c08a015160e0909a0151989b979a5095989497939692505050565b600181811c90821680620008b657607f821691505b602082108103620008d757634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200092b57600081815260208120601f850160051c81016020861015620009065750805b601f850160051c820191505b81811015620009275782815560010162000912565b5050505b505050565b81516001600160401b038111156200094c576200094c620006db565b62000964816200095d8454620008a1565b84620008dd565b602080601f8311600181146200099c5760008415620009835750858301515b600019600386901b1c1916600185901b17855562000927565b600085815260208120601f198616915b82811015620009cd57888601518255948401946001909101908401620009ac565b5085821015620009ec5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b602081526000825180602084015262000a1d816040850160208701620006f1565b601f01601f19169190910160400192915050565b80516020808301519190811015620008d75760001960209190910360031b1b16919050565b60006020828403121562000a6957600080fd5b6200052982620007a8565b81810381811115620001b457634e487b7160e01b600052601160045260246000fd5b60805160a05160c05160e0516101005161012051610140516101605161018051614b3762000b4d600039600081816107e201528181610b1501528181610d06015281816114e901528181611d1a01528181611f30015261206f015260008181610a90015281816111b60152818161180d01528181612b200152612d1101526000612aeb01526000612abe01526000612f3a01526000612f1201526000612e6d01526000612e9701526000612ec10152614b376000f3fe6080604052600436106102e85760003560e01c80637ecebe0011610190578063c01f9e37116100dc578063e2f3dce011610095578063ece40cc11161006f578063ece40cc114610a15578063f23a6e6114610a35578063f8ce560a14610a61578063fc0c546a14610a8157600080fd5b8063e2f3dce0146109c0578063e540d01d146109d5578063eb9019d4146109f557600080fd5b8063c01f9e37146108d3578063c28bc2fa146108f3578063c59057e414610906578063cc31491c14610926578063dd4e2ba514610946578063deaaa7cc1461098c57600080fd5b80639fa92f9d11610149578063ab58fb8e11610123578063ab58fb8e1461083a578063b47a321814610872578063b58131b014610892578063bc197c81146108a757600080fd5b80639fa92f9d146107d0578063a7713a7014610804578063a9a952941461081957600080fd5b80637ecebe00146106f257806384b0196e146107285780638ff262e31461075057806391ddadf41461077057806397c3d3341461079c5780639a802a6d146107b057600080fd5b80633e4f49e61161024f578063567813881161020857806360c4247f116101e257806360c4247f1461067257806379051887146106925780637b3c71d3146106b25780637d5e81e2146106d257600080fd5b806356781388146106125780635b8d0e0d146106325780635f398a141461065257600080fd5b80633e4f49e6146104e75780634385963214610514578063452115d61461055e5780634bf5d7e91461057e578063544ffc9c1461059357806354fd4d50146105e857600080fd5b8063160cbed7116102a1578063160cbed71461042b5780631985ba761461044b5780632656227d1461046b5780632d63f6931461047e5780632fe3e2611461049e5780633932abb1146104d257600080fd5b806301ffc9a7146102f657806302a251a31461032b57806306f3f9e61461035757806306fdde0314610377578063143489d014610399578063150b7a02146103e757600080fd5b366102f157005b005b600080fd5b34801561030257600080fd5b506103166103113660046137ad565b610ab4565b60405190151581526020015b60405180910390f35b34801561033757600080fd5b50600854600160301b900463ffffffff165b604051908152602001610322565b34801561036357600080fd5b506102ef6103723660046137d7565b610b0b565b34801561038357600080fd5b5061038c610c2a565b6040516103229190613840565b3480156103a557600080fd5b506103cf6103b43660046137d7565b6000908152600460205260409020546001600160a01b031690565b6040516001600160a01b039091168152602001610322565b3480156103f357600080fd5b5061041261040236600461392d565b630a85bd0160e11b949350505050565b6040516001600160e01b03199091168152602001610322565b34801561043757600080fd5b50610349610446366004613afe565b610cbc565b34801561045757600080fd5b506102ef610466366004613b8d565b610cfc565b610349610479366004613afe565b610ea2565b34801561048a57600080fd5b506103496104993660046137d7565b610fd5565b3480156104aa57600080fd5b506103497f3e83946653575f9a39005e1545185629e92736b7528ab20ca3816f315424a81181565b3480156104de57600080fd5b50610349610ff6565b3480156104f357600080fd5b506105076105023660046137d7565b611009565b6040516103229190613bf9565b34801561052057600080fd5b5061031661052f366004613c07565b60008281526009602090815260408083206001600160a01b038516845260030190915290205460ff1692915050565b34801561056a57600080fd5b50610349610579366004613afe565b611143565b34801561058a57600080fd5b5061038c6111b2565b34801561059f57600080fd5b506105cd6105ae3660046137d7565b6000908152600960205260409020805460018201546002909201549092565b60408051938452602084019290925290820152606001610322565b3480156105f457600080fd5b506040805180820190915260018152603160f81b602082015261038c565b34801561061e57600080fd5b5061034961062d366004613c42565b611274565b34801561063e57600080fd5b5061034961064d366004613cba565b61129d565b34801561065e57600080fd5b5061034961066d366004613d74565b6113fc565b34801561067e57600080fd5b5061034961068d3660046137d7565b611451565b34801561069e57600080fd5b506102ef6106ad366004613e0d565b6114df565b3480156106be57600080fd5b506103496106cd366004613e2a565b6115f0565b3480156106de57600080fd5b506103496106ed366004613e85565b611638565b3480156106fe57600080fd5b5061034961070d366004613f25565b6001600160a01b031660009081526002602052604090205490565b34801561073457600080fd5b5061073d6116f1565b6040516103229796959493929190613f7b565b34801561075c57600080fd5b5061034961076b366004613feb565b611737565b34801561077c57600080fd5b50610785611809565b60405165ffffffffffff9091168152602001610322565b3480156107a857600080fd5b506064610349565b3480156107bc57600080fd5b506103496107cb36600461403c565b611891565b3480156107dc57600080fd5b506103497f000000000000000000000000000000000000000000000000000000000000000081565b34801561081057600080fd5b506103496118a8565b34801561082557600080fd5b506103166108343660046137d7565b50600090565b34801561084657600080fd5b506103496108553660046137d7565b60009081526004602052604090206001015465ffffffffffff1690565b34801561087e57600080fd5b506102ef61088d366004613b8d565b6118c2565b34801561089e57600080fd5b50610349611c0e565b3480156108b357600080fd5b506104126108c2366004614092565b63bc197c8160e01b95945050505050565b3480156108df57600080fd5b506103496108ee3660046137d7565b611c19565b6102ef610901366004614121565b611c5c565b34801561091257600080fd5b50610349610921366004613afe565b611cdc565b34801561093257600080fd5b5061038c610941366004614162565b611d16565b34801561095257600080fd5b506040805180820190915260208082527f737570706f72743d627261766f2671756f72756d3d666f722c6162737461696e9082015261038c565b34801561099857600080fd5b506103497ff2aad550cf55f045cb27e9c559f9889fdfb6e6cdaa032301d6ea397784ae51d781565b3480156109cc57600080fd5b5061038c611e98565b3480156109e157600080fd5b506102ef6109f03660046141b1565b611f26565b348015610a0157600080fd5b50610349610a103660046141d7565b612044565b348015610a2157600080fd5b506102ef610a303660046137d7565b612065565b348015610a4157600080fd5b50610412610a50366004614201565b63f23a6e6160e01b95945050505050565b348015610a6d57600080fd5b50610349610a7c3660046137d7565b612148565b348015610a8d57600080fd5b507f00000000000000000000000000000000000000000000000000000000000000006103cf565b60006001600160e01b031982166332a2ad4360e11b1480610ae557506001600160e01b03198216630271189760e51b145b80610b0057506301ffc9a760e01b6001600160e01b03198316145b92915050565b905090565b610b13612153565b7f00000000000000000000000000000000000000000000000000000000000000004614610b5b5760405162461bcd60e51b8152600401610b5290614265565b60405180910390fd5b604051633b0d4dd760e01b8152600c600482810191909152602482015260009073__$b1c1335e68417b4234016f4aa58fdfac77$__90633b0d4dd790604401602060405180830381865af4158015610bb7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bdb91906142a9565b90506000610be76118a8565b9050610bf28361218b565b60045b6040805183815260208101869052908101849052600080516020614ae2833981519152906060015b60405180910390a2505050565b606060038054610c39906142c2565b80601f0160208091040260200160405190810160405280929190818152602001828054610c65906142c2565b8015610cb25780601f10610c8757610100808354040283529160200191610cb2565b820191906000526020600020905b815481529060010190602001808311610c9557829003601f168201915b5050505050905090565b600080610ccb86868686611cdc565b9050610ce081610cdb6004612219565b61223c565b506000604051634844252360e11b815260040160405180910390fd5b610d04612153565b7f00000000000000000000000000000000000000000000000000000000000000004614610d435760405162461bcd60e51b8152600401610b5290614265565b604051633b0d4dd760e01b8152600c60048201526000602482018190529073__$b1c1335e68417b4234016f4aa58fdfac77$__90633b0d4dd790604401602060405180830381865af4158015610d9d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dc191906142a9565b90506000600b8054610dd2906142c2565b80601f0160208091040260200160405190810160405280929190818152602001828054610dfe906142c2565b8015610e4b5780601f10610e2057610100808354040283529160200191610e4b565b820191906000526020600020905b815481529060010190602001808311610e2e57829003601f168201915b5050505050905082600b9081610e619190614347565b507f67c6aa39e9b4a701119ddc2f40a18145fff9b6f4fa224d5f29c28755f719ffb2818484604051610e9593929190614406565b60405180910390a1505050565b600080610eb186868686611cdc565b9050610ed181610ec16005612219565b610ecb6004612219565b1761223c565b506000818152600460205260409020805460ff60f01b1916600160f01b17905530610ef93090565b6001600160a01b031614610f8b5760005b8651811015610f8957306001600160a01b0316878281518110610f2f57610f2f61443c565b60200260200101516001600160a01b031603610f7957610f79858281518110610f5a57610f5a61443c565b602002602001015180519060200120600561227b90919063ffffffff16565b610f8281614468565b9050610f0a565b505b610f9881878787876122dd565b6040518181527f712ae1383f79ac853f8d882153778e0260ef8f03b504e2866e0593e04d2b291f906020015b60405180910390a195945050505050565b600090815260046020526040902054600160a01b900465ffffffffffff1690565b6000610b0660085465ffffffffffff1690565b6000818152600460205260408120805460ff600160f01b8204811691600160f81b900416811561103e57506007949350505050565b801561104f57506002949350505050565b600061105a86610fd5565b90508060000361108057604051636ad0607560e01b815260048101879052602401610b52565b600061108a611809565b65ffffffffffff1690508082106110a8575060009695505050505050565b60006110b388611c19565b90508181106110ca57506001979650505050505050565b6110d3886123bd565b15806110f357506000888152600960205260409020805460019091015411155b1561110657506003979650505050505050565b60008881526004602052604090206001015465ffffffffffff1660000361113557506004979650505050505050565b506005979650505050505050565b60008061115286868686611cdc565b905061116281610cdb6000612219565b506000818152600460205260409020546001600160a01b0316331461119c5760405163233d98e360e01b8152336004820152602401610b52565b6111a8868686866123f4565b9695505050505050565b60607f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316634bf5d7e96040518163ffffffff1660e01b8152600401600060405180830381865afa92505050801561123357506040513d6000823e601f3d908101601f1916820160405261123091908101906144b1565b60015b61126f575060408051808201909152601d81527f6d6f64653d626c6f636b6e756d6265722666726f6d3d64656661756c74000000602082015290565b919050565b600080339050611295848285604051806020016040528060008152506124a5565b949350505050565b6000806113808761137a7f3e83946653575f9a39005e1545185629e92736b7528ab20ca3816f315424a8118c8c8c6112f28e6001600160a01b0316600090815260026020526040902080546001810190915590565b8d8d6040516113029291906144f9565b60405180910390208c8051906020012060405160200161135f9796959493929190968752602087019590955260ff9390931660408601526001600160a01b03919091166060850152608084015260a083015260c082015260e00190565b604051602081830303815290604052805190602001206124d1565b856124fe565b9050806113ab576040516394ab6c0760e01b81526001600160a01b0388166004820152602401610b52565b6113ef89888a89898080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508b9250612572915050565b9998505050505050505050565b60008033905061144687828888888080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508a9250612572915050565b979650505050505050565b600a80546000918290611465600184614509565b815481106114755761147561443c565b6000918252602090912001805490915065ffffffffffff811690600160301b90046001600160d01b03168582116114b8576001600160d01b031695945050505050565b6114cc6114c487612654565b600a9061268b565b6001600160d01b03169695505050505050565b6114e7612153565b7f000000000000000000000000000000000000000000000000000000000000000046146115265760405162461bcd60e51b8152600401610b5290614265565b604051633b0d4dd760e01b8152600c60048201526001602482015260009073__$b1c1335e68417b4234016f4aa58fdfac77$__90633b0d4dd790604401602060405180830381865af4158015611580573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115a491906142a9565b905060006115b0610ff6565b90506115bb83612740565b60016040805183815265ffffffffffff86166020820152908101849052600080516020614ae283398151915290606001610c1d565b6000803390506111a886828787878080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506124a592505050565b60003361164581846127a6565b61166d5760405163d9b3955760e01b81526001600160a01b0382166004820152602401610b52565b6000611677611c0e565b905080156116e45760006116a683600161168f611809565b611699919061451c565b65ffffffffffff16612044565b9050818110156116e257604051636121770b60e11b81526001600160a01b03841660048201526024810182905260448101839052606401610b52565b505b6114468787878786612897565b600060608060008060006060611705612ab7565b61170d612ae4565b60408051600080825260208201909252600f60f81b9b939a50919850469750309650945092509050565b6000806117c38461137a7ff2aad550cf55f045cb27e9c559f9889fdfb6e6cdaa032301d6ea397784ae51d789898961178c8b6001600160a01b0316600090815260026020526040902080546001810190915590565b60408051602081019690965285019390935260ff90911660608401526001600160a01b0316608083015260a082015260c00161135f565b9050806117ee576040516394ab6c0760e01b81526001600160a01b0385166004820152602401610b52565b6111a8868587604051806020016040528060008152506124a5565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166391ddadf46040518163ffffffff1660e01b8152600401602060405180830381865afa925050508015611885575060408051601f3d908101601f1916820190925261188291810190614542565b60015b61126f57610b06612b11565b600061189e848484612b1c565b90505b9392505050565b60006118b4600a612bb2565b6001600160d01b0316905090565b600080600073__$b1c1335e68417b4234016f4aa58fdfac77$__63c0af65918530600c6040518463ffffffff1660e01b81526004016119039392919061455f565b600060405180830381865af4158015611920573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261194891908101906145ad565b9194509250905060ff8316611a505760008280602001905181019061196d91906144b1565b90506000600b805461197e906142c2565b80601f01602080910402602001604051908101604052809291908181526020018280546119aa906142c2565b80156119f75780601f106119cc576101008083540402835291602001916119f7565b820191906000526020600020905b8154815290600101906020018083116119da57829003601f168201915b5050505050905081600b9081611a0d9190614347565b507f67c6aa39e9b4a701119ddc2f40a18145fff9b6f4fa224d5f29c28755f719ffb2818385604051611a4193929190614406565b60405180910390a15050611c08565b60001960ff841601611ac1576000611a6783614606565b60d01c90506000611a76610ff6565b9050611a8182612740565b60016040805183815265ffffffffffff85166020820152908101859052600080516020614ae2833981519152906060015b60405180910390a25050611c08565b60011960ff841601611b34576000611ad88361463d565b60e01c90506000611af660085463ffffffff600160301b9091041690565b9050611b0182612beb565b60026040805183815263ffffffff85166020820152908101859052600080516020614ae283398151915290606001611ab2565b60021960ff841601611b9b57600082806020019051810190611b5691906142a9565b90506000611b62611c0e565b9050611b6d82612c89565b60036040805183815260208101859052908101859052600080516020614ae283398151915290606001611ab2565b60031960ff841601611c0857600082806020019051810190611bbd91906142a9565b90506000611bc96118a8565b9050611bd48261218b565b60046040805183815260208101859052908101859052600080516020614ae28339815191529060600160405180910390a250505b50505050565b6000610b0660075490565b600081815260046020526040812054611c4e90600160d01b810463ffffffff1690600160a01b900465ffffffffffff16614670565b65ffffffffffff1692915050565b611c64612153565b600080856001600160a01b0316858585604051611c829291906144f9565b60006040518083038185875af1925050503d8060008114611cbf576040519150601f19603f3d011682016040523d82523d6000602084013e611cc4565b606091505b5091509150611cd38282612cca565b50505050505050565b600084848484604051602001611cf5949392919061471a565b60408051601f19818403018152919052805160209091012095945050505050565b60607f00000000000000000000000000000000000000000000000000000000000000004614611d935760405162461bcd60e51b815260206004820152602360248201527f50726f6f6673206f6e6c792067656e657261746564206f6e20686f6d6520636860448201526230b4b760e91b6064820152608401610b52565b604051630564edeb60e31b8152600c600482015260ff8416602482015260009073__$b1c1335e68417b4234016f4aa58fdfac77$__90632b276f5890604401602060405180830381865af4158015611def573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e1391906142a9565b604051637352178160e01b815290915073__$b1c1335e68417b4234016f4aa58fdfac77$__90637352178190611e53903090889088908790600401614765565b600060405180830381865af4158015611e70573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261129591908101906147a3565b600b8054611ea5906142c2565b80601f0160208091040260200160405190810160405280929190818152602001828054611ed1906142c2565b8015611f1e5780601f10611ef357610100808354040283529160200191611f1e565b820191906000526020600020905b815481529060010190602001808311611f0157829003601f168201915b505050505081565b611f2e612153565b7f00000000000000000000000000000000000000000000000000000000000000004614611f6d5760405162461bcd60e51b8152600401610b5290614265565b604051633b0d4dd760e01b8152600c60048201526002602482015260009073__$b1c1335e68417b4234016f4aa58fdfac77$__90633b0d4dd790604401602060405180830381865af4158015611fc7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611feb91906142a9565b9050600061200660085463ffffffff600160301b9091041690565b905061201183612beb565b60026040805183815263ffffffff86166020820152908101849052600080516020614ae283398151915290606001610c1d565b60006118a1838361206060408051602081019091526000815290565b612b1c565b61206d612153565b7f000000000000000000000000000000000000000000000000000000000000000046146120ac5760405162461bcd60e51b8152600401610b5290614265565b604051633b0d4dd760e01b8152600c60048201526003602482015260009073__$b1c1335e68417b4234016f4aa58fdfac77$__90633b0d4dd790604401602060405180830381865af4158015612106573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061212a91906142a9565b90506000612136611c0e565b905061214183612c89565b6003610bf5565b6000610b0082612ce6565b303314612175576040516347096e4760e01b8152336004820152602401610b52565b565b806121826005612d90565b03612177575b50565b6064808211156121b85760405163243e544560e01b81526004810183905260248101829052604401610b52565b60006121c26118a8565b90506121e16121cf611809565b6121d885612dff565b600a9190612e33565b505060408051828152602081018590527f0553476bf02ef2726e8ce5ced78d63e26e602e4a2257b1f559418e24b46339979101610e95565b600081600781111561222d5761222d613bc1565b600160ff919091161b92915050565b60008061224884611009565b905060008361225683612219565b16036118a1578381846040516331b75e4d60e01b8152600401610b52939291906147d7565b81546001600160801b03600160801b8204811691811660018301909116036122a7576122a76041612e4e565b6001600160801b03808216600090815260018086016020526040909120939093558354919092018216600160801b029116179055565b60005b84518110156123b5576000808683815181106122fe576122fe61443c565b60200260200101516001600160a01b03168684815181106123215761232161443c565b602002602001015186858151811061233b5761233b61443c565b602002602001015160405161235091906147f9565b60006040518083038185875af1925050503d806000811461238d576040519150601f19603f3d011682016040523d82523d6000602084013e612392565b606091505b50915091506123a18282612cca565b505050806123ae90614468565b90506122e0565b505050505050565b6000818152600960205260408120600281015460018201546123df9190614815565b6123eb610a7c85610fd5565b11159392505050565b60008061240386868686611cdc565b9050612451816124136007612219565b61241d6006612219565b6124276002612219565b6001612434600782614828565b61243f906002614925565b6124499190614509565b18181861223c565b506000818152600460205260409081902080546001600160f81b0316600160f81b179055517f789cf55be980739dad1d0699b93b58e806b51c9d96619bfa8fe0a28abaa7b30c90610fc49083815260200190565b60006124c8858585856124c360408051602081019091526000815290565b612572565b95945050505050565b6000610b006124de612e60565b8360405161190160f01b8152600281019290925260228201526042902090565b6000836001600160a01b03163b6000036125605760008061251f8585612f8b565b509092509050600081600381111561253957612539613bc1565b1480156125575750856001600160a01b0316826001600160a01b0316145b925050506118a1565b61256b848484612fd8565b90506118a1565b600061258286610cdb6001612219565b5060006125988661259289610fd5565b85612b1c565b905060006125a988888885886130b3565b9050835160000361260057866001600160a01b03167fb8e138887d0aa13bab447e82de9d5c1777041ecd21ca36ba824ff1e6c07ddda4898884896040516125f39493929190614934565b60405180910390a2611446565b866001600160a01b03167fe2babfbac5889a709b63bb7f598b324e08bc5a4fb9ec647fb3cbc9ec07eb8712898884898960405161264195949392919061495c565b60405180910390a2979650505050505050565b600065ffffffffffff821115612687576040516306dfcc6560e41b81526030600482015260248101839052604401610b52565b5090565b8154600090818160058111156126ea5760006126a6846131b6565b6126b09085614509565b60008881526020902090915081015465ffffffffffff90811690871610156126da578091506126e8565b6126e5816001614815565b92505b505b60006126f88787858561330f565b905080156127335761271d8761270f600184614509565b600091825260209091200190565b54600160301b90046001600160d01b0316611446565b6000979650505050505050565b6008546040805165ffffffffffff928316815291831660208301527fc565b045403dc03c2eea82b81a0465edad9e2e7fc4d97e11421c209da93d7a93910160405180910390a16008805465ffffffffffff191665ffffffffffff92909216919091179055565b805160009060348110156127be576001915050610b00565b82810160131901516001600160a01b031981166b046e0e4dee0dee6cae47a60f60a31b146127f157600192505050610b00565b6000806127ff602885614509565b90505b83811015612876576000806128368884815181106128225761282261443c565b01602001516001600160f81b031916613371565b915091508161284e5760019650505050505050610b00565b8060ff166004856001600160a01b0316901b17935050508061286f90614468565b9050612802565b50856001600160a01b0316816001600160a01b031614935050505092915050565b60006128ac8686868680519060200120611cdc565b9050845186511415806128c157508351865114155b806128cb57508551155b1561290057855184518651604051630447b05d60e41b8152600481019390935260248301919091526044820152606401610b52565b600081815260046020526040902054600160a01b900465ffffffffffff161561294b578061292d82611009565b6040516331b75e4d60e01b8152610b529291906000906004016147d7565b6000612955610ff6565b61295d611809565b65ffffffffffff1661296f9190614815565b9050600061298a60085463ffffffff600160301b9091041690565b600084815260046020526040902080546001600160a01b0319166001600160a01b0387161781559091506129bd83612654565b815465ffffffffffff91909116600160a01b0265ffffffffffff60a01b199091161781556129ea82613403565b815463ffffffff91909116600160d01b0263ffffffff60d01b1990911617815588517f7d84a6263ae0d98d3329bd7b46bb4e8d6f98cd35a7adb45c274c8b7fd5ebd5e090859087908c908c906001600160401b03811115612a4d57612a4d61386a565b604051908082528060200260200182016040528015612a8057816020015b6060815260200190600190039081612a6b5790505b508c89612a8d8a82614815565b8e604051612aa3999897969594939291906149a2565b60405180910390a150505095945050505050565b6060610b067f00000000000000000000000000000000000000000000000000000000000000006000613434565b6060610b067f00000000000000000000000000000000000000000000000000000000000000006001613434565b6000610b0643612654565b60007f0000000000000000000000000000000000000000000000000000000000000000604051630748d63560e31b81526001600160a01b038681166004830152602482018690529190911690633a46b1a890604401602060405180830381865afa158015612b8e573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061189e91906142a9565b80546000908015612be257612bcc8361270f600184614509565b54600160301b90046001600160d01b03166118a1565b60009392505050565b8063ffffffff16600003612c155760405163f1cfbf0560e01b815260006004820152602401610b52565b6008546040805163ffffffff600160301b9093048316815291831660208301527f7e3f7f0708a84de9203036abaa450dccc85ad5ff52f78c170f3edb55cf5e8828910160405180910390a16008805463ffffffff909216600160301b0269ffffffff00000000000019909216919091179055565b60075460408051918252602082018390527fccb45da8d5717e6c4544694297c4ba5cf151d455c9bb0ed4fc7a38411bc05461910160405180910390a1600755565b606082612cdf57612cda826134df565b610b00565b5080610b00565b60006064612cf383611451565b604051632394e7a360e21b8152600481018590526001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001690638e539e8c90602401602060405180830381865afa158015612d58573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612d7c91906142a9565b612d869190614a79565b610b009190614aa6565b80546000906001600160801b0380821691600160801b9004168103612db957612db96031612e4e565b6001600160801b038181166000908152600185810160205260408220805492905585546fffffffffffffffffffffffffffffffff19169301909116919091179092555090565b60006001600160d01b03821115612687576040516306dfcc6560e41b815260d0600482015260248101839052604401610b52565b600080612e41858585613508565b915091505b935093915050565b634e487b71600052806020526024601cfd5b6000306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016148015612eb957507f000000000000000000000000000000000000000000000000000000000000000046145b15612ee357507f000000000000000000000000000000000000000000000000000000000000000090565b610b06604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f60208201527f0000000000000000000000000000000000000000000000000000000000000000918101919091527f000000000000000000000000000000000000000000000000000000000000000060608201524660808201523060a082015260009060c00160405160208183030381529060405280519060200120905090565b60008060008351604103612fc55760208401516040850151606086015160001a612fb78882858561365c565b955095509550505050612fd1565b50508151600091506002905b9250925092565b6000806000856001600160a01b03168585604051602401612ffa929190614ac8565b60408051601f198184030181529181526020820180516001600160e01b0316630b135d3f60e11b1790525161302f91906147f9565b600060405180830381855afa9150503d806000811461306a576040519150601f19603f3d011682016040523d82523d6000602084013e61306f565b606091505b509150915081801561308357506020815110155b80156111a857508051630b135d3f60e11b906130a890830160209081019084016142a9565b149695505050505050565b60008581526009602090815260408083206001600160a01b03881684526003810190925282205460ff1615613106576040516371c6af4960e01b81526001600160a01b0387166004820152602401610b52565b6001600160a01b03861660009081526003820160205260409020805460ff1916600117905560ff851661315257838160000160008282546131479190614815565b909155506131ab9050565b60001960ff86160161317257838160010160008282546131479190614815565b60011960ff86160161319257838160020160008282546131479190614815565b6040516303599be160e11b815260040160405180910390fd5b509195945050505050565b6000600182116131c4575090565b816001600160801b82106131dd5760809190911c9060401b5b6801000000000000000082106131f85760409190911c9060201b5b640100000000821061320f5760209190911c9060101b5b6201000082106132245760109190911c9060081b5b61010082106132385760089190911c9060041b5b6010821061324b5760049190911c9060021b5b600482106132575760011b5b600302600190811c9081858161326f5761326f614a90565b048201901c9050600181858161328757613287614a90565b048201901c9050600181858161329f5761329f614a90565b048201901c905060018185816132b7576132b7614a90565b048201901c905060018185816132cf576132cf614a90565b048201901c905060018185816132e7576132e7614a90565b048201901c905061330681858161330057613300614a90565b04821190565b90039392505050565b60005b81831015613369576000613326848461372b565b60008781526020902090915065ffffffffffff86169082015465ffffffffffff16111561335557809250613363565b613360816001614815565b93505b50613312565b509392505050565b60008060f883901c602f8111801561338c5750603a8160ff16105b156133a157600194602f199091019350915050565b8060ff1660401080156133b7575060478160ff16105b156133cc576001946036199091019350915050565b8060ff1660601080156133e2575060678160ff16105b156133f7576001946056199091019350915050565b50600093849350915050565b600063ffffffff821115612687576040516306dfcc6560e41b81526020600482015260248101839052604401610b52565b606060ff831461344e5761344783613746565b9050610b00565b81805461345a906142c2565b80601f0160208091040260200160405190810160405280929190818152602001828054613486906142c2565b80156134d35780601f106134a8576101008083540402835291602001916134d3565b820191906000526020600020905b8154815290600101906020018083116134b657829003601f168201915b50505050509050610b00565b8051156134ef5780518082602001fd5b60405163d6bda27560e01b815260040160405180910390fd5b8254600090819080156136015760006135268761270f600185614509565b805490915065ffffffffffff80821691600160301b90046001600160d01b031690881682111561356957604051632520601d60e01b815260040160405180910390fd5b8765ffffffffffff168265ffffffffffff16036135a257825465ffffffffffff16600160301b6001600160d01b038916021783556135f3565b6040805180820190915265ffffffffffff808a1682526001600160d01b03808a1660208085019182528d54600181018f5560008f81529190912094519151909216600160301b029216919091179101555b9450859350612e4692505050565b50506040805180820190915265ffffffffffff80851682526001600160d01b0380851660208085019182528854600181018a5560008a815291822095519251909316600160301b029190931617920191909155905081612e46565b600080807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08411156136975750600091506003905082613721565b604080516000808252602082018084528a905260ff891692820192909252606081018790526080810186905260019060a0016020604051602081039080840390855afa1580156136eb573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b03811661371757506000925060019150829050613721565b9250600091508190505b9450945094915050565b600061373a6002848418614aa6565b6118a190848416614815565b6060600061375383613785565b604080516020808252818301909252919250600091906020820181803683375050509182525060208101929092525090565b600060ff8216601f811115610b0057604051632cd44ac360e21b815260040160405180910390fd5b6000602082840312156137bf57600080fd5b81356001600160e01b0319811681146118a157600080fd5b6000602082840312156137e957600080fd5b5035919050565b60005b8381101561380b5781810151838201526020016137f3565b50506000910152565b6000815180845261382c8160208601602086016137f0565b601f01601f19169290920160200192915050565b6020815260006118a16020830184613814565b80356001600160a01b038116811461126f57600080fd5b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b03811182821017156138a8576138a861386a565b604052919050565b60006001600160401b038211156138c9576138c961386a565b50601f01601f191660200190565b600082601f8301126138e857600080fd5b81356138fb6138f6826138b0565b613880565b81815284602083860101111561391057600080fd5b816020850160208301376000918101602001919091529392505050565b6000806000806080858703121561394357600080fd5b61394c85613853565b935061395a60208601613853565b92506040850135915060608501356001600160401b0381111561397c57600080fd5b613988878288016138d7565b91505092959194509250565b60006001600160401b038211156139ad576139ad61386a565b5060051b60200190565b600082601f8301126139c857600080fd5b813560206139d86138f683613994565b82815260059290921b840181019181810190868411156139f757600080fd5b8286015b84811015613a1957613a0c81613853565b83529183019183016139fb565b509695505050505050565b600082601f830112613a3557600080fd5b81356020613a456138f683613994565b82815260059290921b84018101918181019086841115613a6457600080fd5b8286015b84811015613a195780358352918301918301613a68565b600082601f830112613a9057600080fd5b81356020613aa06138f683613994565b82815260059290921b84018101918181019086841115613abf57600080fd5b8286015b84811015613a195780356001600160401b03811115613ae25760008081fd5b613af08986838b01016138d7565b845250918301918301613ac3565b60008060008060808587031215613b1457600080fd5b84356001600160401b0380821115613b2b57600080fd5b613b37888389016139b7565b95506020870135915080821115613b4d57600080fd5b613b5988838901613a24565b94506040870135915080821115613b6f57600080fd5b50613b7c87828801613a7f565b949793965093946060013593505050565b600060208284031215613b9f57600080fd5b81356001600160401b03811115613bb557600080fd5b611295848285016138d7565b634e487b7160e01b600052602160045260246000fd5b60088110613bf557634e487b7160e01b600052602160045260246000fd5b9052565b60208101610b008284613bd7565b60008060408385031215613c1a57600080fd5b82359150613c2a60208401613853565b90509250929050565b60ff8116811461218857600080fd5b60008060408385031215613c5557600080fd5b823591506020830135613c6781613c33565b809150509250929050565b60008083601f840112613c8457600080fd5b5081356001600160401b03811115613c9b57600080fd5b602083019150836020828501011115613cb357600080fd5b9250929050565b600080600080600080600060c0888a031215613cd557600080fd5b873596506020880135613ce781613c33565b9550613cf560408901613853565b945060608801356001600160401b0380821115613d1157600080fd5b613d1d8b838c01613c72565b909650945060808a0135915080821115613d3657600080fd5b613d428b838c016138d7565b935060a08a0135915080821115613d5857600080fd5b50613d658a828b016138d7565b91505092959891949750929550565b600080600080600060808688031215613d8c57600080fd5b853594506020860135613d9e81613c33565b935060408601356001600160401b0380821115613dba57600080fd5b613dc689838a01613c72565b90955093506060880135915080821115613ddf57600080fd5b50613dec888289016138d7565b9150509295509295909350565b65ffffffffffff8116811461218857600080fd5b600060208284031215613e1f57600080fd5b81356118a181613df9565b60008060008060608587031215613e4057600080fd5b843593506020850135613e5281613c33565b925060408501356001600160401b03811115613e6d57600080fd5b613e7987828801613c72565b95989497509550505050565b60008060008060808587031215613e9b57600080fd5b84356001600160401b0380821115613eb257600080fd5b613ebe888389016139b7565b95506020870135915080821115613ed457600080fd5b613ee088838901613a24565b94506040870135915080821115613ef657600080fd5b613f0288838901613a7f565b93506060870135915080821115613f1857600080fd5b50613988878288016138d7565b600060208284031215613f3757600080fd5b6118a182613853565b600081518084526020808501945080840160005b83811015613f7057815187529582019590820190600101613f54565b509495945050505050565b60ff60f81b8816815260e060208201526000613f9a60e0830189613814565b8281036040840152613fac8189613814565b606084018890526001600160a01b038716608085015260a0840186905283810360c08501529050613fdd8185613f40565b9a9950505050505050505050565b6000806000806080858703121561400157600080fd5b84359350602085013561401381613c33565b925061402160408601613853565b915060608501356001600160401b0381111561397c57600080fd5b60008060006060848603121561405157600080fd5b61405a84613853565b92506020840135915060408401356001600160401b0381111561407c57600080fd5b614088868287016138d7565b9150509250925092565b600080600080600060a086880312156140aa57600080fd5b6140b386613853565b94506140c160208701613853565b935060408601356001600160401b03808211156140dd57600080fd5b6140e989838a01613a24565b945060608801359150808211156140ff57600080fd5b61410b89838a01613a24565b93506080880135915080821115613ddf57600080fd5b6000806000806060858703121561413757600080fd5b61414085613853565b93506020850135925060408501356001600160401b03811115613e6d57600080fd5b6000806040838503121561417557600080fd5b823561418081613c33565b915060208301356001600160401b0381111561419b57600080fd5b6141a7858286016138d7565b9150509250929050565b6000602082840312156141c357600080fd5b813563ffffffff811681146118a157600080fd5b600080604083850312156141ea57600080fd5b6141f383613853565b946020939093013593505050565b600080600080600060a0868803121561421957600080fd5b61422286613853565b945061423060208701613853565b9350604086013592506060860135915060808601356001600160401b0381111561425957600080fd5b613dec888289016138d7565b60208082526024908201527f4f7065726174696f6e206f6e6c7920616c6c6f776564206f6e20686f6d6520636040820152633430b4b760e11b606082015260800190565b6000602082840312156142bb57600080fd5b5051919050565b600181811c908216806142d657607f821691505b6020821081036142f657634e487b7160e01b600052602260045260246000fd5b50919050565b601f82111561434257600081815260208120601f850160051c810160208610156143235750805b601f850160051c820191505b818110156123b55782815560010161432f565b505050565b81516001600160401b038111156143605761436061386a565b6143748161436e84546142c2565b846142fc565b602080601f8311600181146143a957600084156143915750858301515b600019600386901b1c1916600185901b1785556123b5565b600085815260208120601f198616915b828110156143d8578886015182559484019460019091019084016143b9565b50858210156143f65787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6060815260006144196060830186613814565b828103602084015261442b8186613814565b915050826040830152949350505050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60006001820161447a5761447a614452565b5060010190565b600061448f6138f6846138b0565b90508281528383830111156144a357600080fd5b6118a18360208301846137f0565b6000602082840312156144c357600080fd5b81516001600160401b038111156144d957600080fd5b8201601f810184136144ea57600080fd5b61129584825160208401614481565b8183823760009101908152919050565b81810381811115610b0057610b00614452565b65ffffffffffff82811682821603908082111561453b5761453b614452565b5092915050565b60006020828403121561455457600080fd5b81516118a181613df9565b6060815260006145726060830186613814565b6001600160a01b039490941660208301525060400152919050565b600082601f83011261459e57600080fd5b6118a183835160208501614481565b6000806000606084860312156145c257600080fd5b83516145cd81613c33565b60208501519093506001600160401b038111156145e957600080fd5b6145f58682870161458d565b925050604084015190509250925092565b805160208201516001600160d01b031980821692919060068310156146355780818460060360031b1b83161693505b505050919050565b805160208201516001600160e01b031980821692919060048310156146355760049290920360031b82901b161692915050565b65ffffffffffff81811683821601908082111561453b5761453b614452565b600081518084526020808501945080840160005b83811015613f705781516001600160a01b0316875295820195908201906001016146a3565b6000815180845260208085019450848260051b860182860160005b8581101561470d5783830389526146fb838351613814565b988501989250908401906001016146e3565b5090979650505050505050565b60808152600061472d608083018761468f565b828103602084015261473f8187613f40565b9050828103604084015261475381866146c8565b91505082606083015295945050505050565b6001600160a01b038516815260ff8416602082015260806040820181905260009061479290830185613814565b905082606083015295945050505050565b6000602082840312156147b557600080fd5b81516001600160401b038111156147cb57600080fd5b6112958482850161458d565b838152606081016147eb6020830185613bd7565b826040830152949350505050565b6000825161480b8184602087016137f0565b9190910192915050565b80820180821115610b0057610b00614452565b60ff8181168382160190811115610b0057610b00614452565b600181815b8085111561487c57816000190482111561486257614862614452565b8085161561486f57918102915b93841c9390800290614846565b509250929050565b60008261489357506001610b00565b816148a057506000610b00565b81600181146148b657600281146148c0576148dc565b6001915050610b00565b60ff8411156148d1576148d1614452565b50506001821b610b00565b5060208310610133831016604e8410600b84101617156148ff575081810a610b00565b6149098383614841565b806000190482111561491d5761491d614452565b029392505050565b60006118a160ff841683614884565b84815260ff841660208201528260408201526080606082015260006111a86080830184613814565b85815260ff8516602082015283604082015260a06060820152600061498460a0830185613814565b82810360808401526149968185613814565b98975050505050505050565b60006101208b8352602060018060a01b038c16818501528160408501526149cb8285018c61468f565b915083820360608501526149df828b613f40565b915083820360808501528189518084528284019150828160051b850101838c0160005b83811015614a3057601f19878403018552614a1e838351613814565b94860194925090850190600101614a02565b505086810360a0880152614a44818c6146c8565b9450505050508560c08401528460e0840152828103610100840152614a698185613814565b9c9b505050505050505050505050565b8082028115828204841417610b0057610b00614452565b634e487b7160e01b600052601260045260246000fd5b600082614ac357634e487b7160e01b600052601260045260246000fd5b500490565b82815260406020820152600061189e604083018461381456fe80c51ad8a7db1a7a86cc355b77bd5cd7ea08f6071ea91d85a8f792734700a0eca26469706673582212205c5a83ff074db246f409ffc8bc5a5c810ce8a95783beb88564ba8a597a7cef8c64736f6c63430008140033", + "deployedBytecode": "0x6080604052600436106102e85760003560e01c80637ecebe0011610190578063c01f9e37116100dc578063e2f3dce011610095578063ece40cc11161006f578063ece40cc114610a15578063f23a6e6114610a35578063f8ce560a14610a61578063fc0c546a14610a8157600080fd5b8063e2f3dce0146109c0578063e540d01d146109d5578063eb9019d4146109f557600080fd5b8063c01f9e37146108d3578063c28bc2fa146108f3578063c59057e414610906578063cc31491c14610926578063dd4e2ba514610946578063deaaa7cc1461098c57600080fd5b80639fa92f9d11610149578063ab58fb8e11610123578063ab58fb8e1461083a578063b47a321814610872578063b58131b014610892578063bc197c81146108a757600080fd5b80639fa92f9d146107d0578063a7713a7014610804578063a9a952941461081957600080fd5b80637ecebe00146106f257806384b0196e146107285780638ff262e31461075057806391ddadf41461077057806397c3d3341461079c5780639a802a6d146107b057600080fd5b80633e4f49e61161024f578063567813881161020857806360c4247f116101e257806360c4247f1461067257806379051887146106925780637b3c71d3146106b25780637d5e81e2146106d257600080fd5b806356781388146106125780635b8d0e0d146106325780635f398a141461065257600080fd5b80633e4f49e6146104e75780634385963214610514578063452115d61461055e5780634bf5d7e91461057e578063544ffc9c1461059357806354fd4d50146105e857600080fd5b8063160cbed7116102a1578063160cbed71461042b5780631985ba761461044b5780632656227d1461046b5780632d63f6931461047e5780632fe3e2611461049e5780633932abb1146104d257600080fd5b806301ffc9a7146102f657806302a251a31461032b57806306f3f9e61461035757806306fdde0314610377578063143489d014610399578063150b7a02146103e757600080fd5b366102f157005b005b600080fd5b34801561030257600080fd5b506103166103113660046137ad565b610ab4565b60405190151581526020015b60405180910390f35b34801561033757600080fd5b50600854600160301b900463ffffffff165b604051908152602001610322565b34801561036357600080fd5b506102ef6103723660046137d7565b610b0b565b34801561038357600080fd5b5061038c610c2a565b6040516103229190613840565b3480156103a557600080fd5b506103cf6103b43660046137d7565b6000908152600460205260409020546001600160a01b031690565b6040516001600160a01b039091168152602001610322565b3480156103f357600080fd5b5061041261040236600461392d565b630a85bd0160e11b949350505050565b6040516001600160e01b03199091168152602001610322565b34801561043757600080fd5b50610349610446366004613afe565b610cbc565b34801561045757600080fd5b506102ef610466366004613b8d565b610cfc565b610349610479366004613afe565b610ea2565b34801561048a57600080fd5b506103496104993660046137d7565b610fd5565b3480156104aa57600080fd5b506103497f3e83946653575f9a39005e1545185629e92736b7528ab20ca3816f315424a81181565b3480156104de57600080fd5b50610349610ff6565b3480156104f357600080fd5b506105076105023660046137d7565b611009565b6040516103229190613bf9565b34801561052057600080fd5b5061031661052f366004613c07565b60008281526009602090815260408083206001600160a01b038516845260030190915290205460ff1692915050565b34801561056a57600080fd5b50610349610579366004613afe565b611143565b34801561058a57600080fd5b5061038c6111b2565b34801561059f57600080fd5b506105cd6105ae3660046137d7565b6000908152600960205260409020805460018201546002909201549092565b60408051938452602084019290925290820152606001610322565b3480156105f457600080fd5b506040805180820190915260018152603160f81b602082015261038c565b34801561061e57600080fd5b5061034961062d366004613c42565b611274565b34801561063e57600080fd5b5061034961064d366004613cba565b61129d565b34801561065e57600080fd5b5061034961066d366004613d74565b6113fc565b34801561067e57600080fd5b5061034961068d3660046137d7565b611451565b34801561069e57600080fd5b506102ef6106ad366004613e0d565b6114df565b3480156106be57600080fd5b506103496106cd366004613e2a565b6115f0565b3480156106de57600080fd5b506103496106ed366004613e85565b611638565b3480156106fe57600080fd5b5061034961070d366004613f25565b6001600160a01b031660009081526002602052604090205490565b34801561073457600080fd5b5061073d6116f1565b6040516103229796959493929190613f7b565b34801561075c57600080fd5b5061034961076b366004613feb565b611737565b34801561077c57600080fd5b50610785611809565b60405165ffffffffffff9091168152602001610322565b3480156107a857600080fd5b506064610349565b3480156107bc57600080fd5b506103496107cb36600461403c565b611891565b3480156107dc57600080fd5b506103497f000000000000000000000000000000000000000000000000000000000000000081565b34801561081057600080fd5b506103496118a8565b34801561082557600080fd5b506103166108343660046137d7565b50600090565b34801561084657600080fd5b506103496108553660046137d7565b60009081526004602052604090206001015465ffffffffffff1690565b34801561087e57600080fd5b506102ef61088d366004613b8d565b6118c2565b34801561089e57600080fd5b50610349611c0e565b3480156108b357600080fd5b506104126108c2366004614092565b63bc197c8160e01b95945050505050565b3480156108df57600080fd5b506103496108ee3660046137d7565b611c19565b6102ef610901366004614121565b611c5c565b34801561091257600080fd5b50610349610921366004613afe565b611cdc565b34801561093257600080fd5b5061038c610941366004614162565b611d16565b34801561095257600080fd5b506040805180820190915260208082527f737570706f72743d627261766f2671756f72756d3d666f722c6162737461696e9082015261038c565b34801561099857600080fd5b506103497ff2aad550cf55f045cb27e9c559f9889fdfb6e6cdaa032301d6ea397784ae51d781565b3480156109cc57600080fd5b5061038c611e98565b3480156109e157600080fd5b506102ef6109f03660046141b1565b611f26565b348015610a0157600080fd5b50610349610a103660046141d7565b612044565b348015610a2157600080fd5b506102ef610a303660046137d7565b612065565b348015610a4157600080fd5b50610412610a50366004614201565b63f23a6e6160e01b95945050505050565b348015610a6d57600080fd5b50610349610a7c3660046137d7565b612148565b348015610a8d57600080fd5b507f00000000000000000000000000000000000000000000000000000000000000006103cf565b60006001600160e01b031982166332a2ad4360e11b1480610ae557506001600160e01b03198216630271189760e51b145b80610b0057506301ffc9a760e01b6001600160e01b03198316145b92915050565b905090565b610b13612153565b7f00000000000000000000000000000000000000000000000000000000000000004614610b5b5760405162461bcd60e51b8152600401610b5290614265565b60405180910390fd5b604051633b0d4dd760e01b8152600c600482810191909152602482015260009073__$b1c1335e68417b4234016f4aa58fdfac77$__90633b0d4dd790604401602060405180830381865af4158015610bb7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bdb91906142a9565b90506000610be76118a8565b9050610bf28361218b565b60045b6040805183815260208101869052908101849052600080516020614ae2833981519152906060015b60405180910390a2505050565b606060038054610c39906142c2565b80601f0160208091040260200160405190810160405280929190818152602001828054610c65906142c2565b8015610cb25780601f10610c8757610100808354040283529160200191610cb2565b820191906000526020600020905b815481529060010190602001808311610c9557829003601f168201915b5050505050905090565b600080610ccb86868686611cdc565b9050610ce081610cdb6004612219565b61223c565b506000604051634844252360e11b815260040160405180910390fd5b610d04612153565b7f00000000000000000000000000000000000000000000000000000000000000004614610d435760405162461bcd60e51b8152600401610b5290614265565b604051633b0d4dd760e01b8152600c60048201526000602482018190529073__$b1c1335e68417b4234016f4aa58fdfac77$__90633b0d4dd790604401602060405180830381865af4158015610d9d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dc191906142a9565b90506000600b8054610dd2906142c2565b80601f0160208091040260200160405190810160405280929190818152602001828054610dfe906142c2565b8015610e4b5780601f10610e2057610100808354040283529160200191610e4b565b820191906000526020600020905b815481529060010190602001808311610e2e57829003601f168201915b5050505050905082600b9081610e619190614347565b507f67c6aa39e9b4a701119ddc2f40a18145fff9b6f4fa224d5f29c28755f719ffb2818484604051610e9593929190614406565b60405180910390a1505050565b600080610eb186868686611cdc565b9050610ed181610ec16005612219565b610ecb6004612219565b1761223c565b506000818152600460205260409020805460ff60f01b1916600160f01b17905530610ef93090565b6001600160a01b031614610f8b5760005b8651811015610f8957306001600160a01b0316878281518110610f2f57610f2f61443c565b60200260200101516001600160a01b031603610f7957610f79858281518110610f5a57610f5a61443c565b602002602001015180519060200120600561227b90919063ffffffff16565b610f8281614468565b9050610f0a565b505b610f9881878787876122dd565b6040518181527f712ae1383f79ac853f8d882153778e0260ef8f03b504e2866e0593e04d2b291f906020015b60405180910390a195945050505050565b600090815260046020526040902054600160a01b900465ffffffffffff1690565b6000610b0660085465ffffffffffff1690565b6000818152600460205260408120805460ff600160f01b8204811691600160f81b900416811561103e57506007949350505050565b801561104f57506002949350505050565b600061105a86610fd5565b90508060000361108057604051636ad0607560e01b815260048101879052602401610b52565b600061108a611809565b65ffffffffffff1690508082106110a8575060009695505050505050565b60006110b388611c19565b90508181106110ca57506001979650505050505050565b6110d3886123bd565b15806110f357506000888152600960205260409020805460019091015411155b1561110657506003979650505050505050565b60008881526004602052604090206001015465ffffffffffff1660000361113557506004979650505050505050565b506005979650505050505050565b60008061115286868686611cdc565b905061116281610cdb6000612219565b506000818152600460205260409020546001600160a01b0316331461119c5760405163233d98e360e01b8152336004820152602401610b52565b6111a8868686866123f4565b9695505050505050565b60607f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316634bf5d7e96040518163ffffffff1660e01b8152600401600060405180830381865afa92505050801561123357506040513d6000823e601f3d908101601f1916820160405261123091908101906144b1565b60015b61126f575060408051808201909152601d81527f6d6f64653d626c6f636b6e756d6265722666726f6d3d64656661756c74000000602082015290565b919050565b600080339050611295848285604051806020016040528060008152506124a5565b949350505050565b6000806113808761137a7f3e83946653575f9a39005e1545185629e92736b7528ab20ca3816f315424a8118c8c8c6112f28e6001600160a01b0316600090815260026020526040902080546001810190915590565b8d8d6040516113029291906144f9565b60405180910390208c8051906020012060405160200161135f9796959493929190968752602087019590955260ff9390931660408601526001600160a01b03919091166060850152608084015260a083015260c082015260e00190565b604051602081830303815290604052805190602001206124d1565b856124fe565b9050806113ab576040516394ab6c0760e01b81526001600160a01b0388166004820152602401610b52565b6113ef89888a89898080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508b9250612572915050565b9998505050505050505050565b60008033905061144687828888888080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508a9250612572915050565b979650505050505050565b600a80546000918290611465600184614509565b815481106114755761147561443c565b6000918252602090912001805490915065ffffffffffff811690600160301b90046001600160d01b03168582116114b8576001600160d01b031695945050505050565b6114cc6114c487612654565b600a9061268b565b6001600160d01b03169695505050505050565b6114e7612153565b7f000000000000000000000000000000000000000000000000000000000000000046146115265760405162461bcd60e51b8152600401610b5290614265565b604051633b0d4dd760e01b8152600c60048201526001602482015260009073__$b1c1335e68417b4234016f4aa58fdfac77$__90633b0d4dd790604401602060405180830381865af4158015611580573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115a491906142a9565b905060006115b0610ff6565b90506115bb83612740565b60016040805183815265ffffffffffff86166020820152908101849052600080516020614ae283398151915290606001610c1d565b6000803390506111a886828787878080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506124a592505050565b60003361164581846127a6565b61166d5760405163d9b3955760e01b81526001600160a01b0382166004820152602401610b52565b6000611677611c0e565b905080156116e45760006116a683600161168f611809565b611699919061451c565b65ffffffffffff16612044565b9050818110156116e257604051636121770b60e11b81526001600160a01b03841660048201526024810182905260448101839052606401610b52565b505b6114468787878786612897565b600060608060008060006060611705612ab7565b61170d612ae4565b60408051600080825260208201909252600f60f81b9b939a50919850469750309650945092509050565b6000806117c38461137a7ff2aad550cf55f045cb27e9c559f9889fdfb6e6cdaa032301d6ea397784ae51d789898961178c8b6001600160a01b0316600090815260026020526040902080546001810190915590565b60408051602081019690965285019390935260ff90911660608401526001600160a01b0316608083015260a082015260c00161135f565b9050806117ee576040516394ab6c0760e01b81526001600160a01b0385166004820152602401610b52565b6111a8868587604051806020016040528060008152506124a5565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166391ddadf46040518163ffffffff1660e01b8152600401602060405180830381865afa925050508015611885575060408051601f3d908101601f1916820190925261188291810190614542565b60015b61126f57610b06612b11565b600061189e848484612b1c565b90505b9392505050565b60006118b4600a612bb2565b6001600160d01b0316905090565b600080600073__$b1c1335e68417b4234016f4aa58fdfac77$__63c0af65918530600c6040518463ffffffff1660e01b81526004016119039392919061455f565b600060405180830381865af4158015611920573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261194891908101906145ad565b9194509250905060ff8316611a505760008280602001905181019061196d91906144b1565b90506000600b805461197e906142c2565b80601f01602080910402602001604051908101604052809291908181526020018280546119aa906142c2565b80156119f75780601f106119cc576101008083540402835291602001916119f7565b820191906000526020600020905b8154815290600101906020018083116119da57829003601f168201915b5050505050905081600b9081611a0d9190614347565b507f67c6aa39e9b4a701119ddc2f40a18145fff9b6f4fa224d5f29c28755f719ffb2818385604051611a4193929190614406565b60405180910390a15050611c08565b60001960ff841601611ac1576000611a6783614606565b60d01c90506000611a76610ff6565b9050611a8182612740565b60016040805183815265ffffffffffff85166020820152908101859052600080516020614ae2833981519152906060015b60405180910390a25050611c08565b60011960ff841601611b34576000611ad88361463d565b60e01c90506000611af660085463ffffffff600160301b9091041690565b9050611b0182612beb565b60026040805183815263ffffffff85166020820152908101859052600080516020614ae283398151915290606001611ab2565b60021960ff841601611b9b57600082806020019051810190611b5691906142a9565b90506000611b62611c0e565b9050611b6d82612c89565b60036040805183815260208101859052908101859052600080516020614ae283398151915290606001611ab2565b60031960ff841601611c0857600082806020019051810190611bbd91906142a9565b90506000611bc96118a8565b9050611bd48261218b565b60046040805183815260208101859052908101859052600080516020614ae28339815191529060600160405180910390a250505b50505050565b6000610b0660075490565b600081815260046020526040812054611c4e90600160d01b810463ffffffff1690600160a01b900465ffffffffffff16614670565b65ffffffffffff1692915050565b611c64612153565b600080856001600160a01b0316858585604051611c829291906144f9565b60006040518083038185875af1925050503d8060008114611cbf576040519150601f19603f3d011682016040523d82523d6000602084013e611cc4565b606091505b5091509150611cd38282612cca565b50505050505050565b600084848484604051602001611cf5949392919061471a565b60408051601f19818403018152919052805160209091012095945050505050565b60607f00000000000000000000000000000000000000000000000000000000000000004614611d935760405162461bcd60e51b815260206004820152602360248201527f50726f6f6673206f6e6c792067656e657261746564206f6e20686f6d6520636860448201526230b4b760e91b6064820152608401610b52565b604051630564edeb60e31b8152600c600482015260ff8416602482015260009073__$b1c1335e68417b4234016f4aa58fdfac77$__90632b276f5890604401602060405180830381865af4158015611def573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e1391906142a9565b604051637352178160e01b815290915073__$b1c1335e68417b4234016f4aa58fdfac77$__90637352178190611e53903090889088908790600401614765565b600060405180830381865af4158015611e70573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261129591908101906147a3565b600b8054611ea5906142c2565b80601f0160208091040260200160405190810160405280929190818152602001828054611ed1906142c2565b8015611f1e5780601f10611ef357610100808354040283529160200191611f1e565b820191906000526020600020905b815481529060010190602001808311611f0157829003601f168201915b505050505081565b611f2e612153565b7f00000000000000000000000000000000000000000000000000000000000000004614611f6d5760405162461bcd60e51b8152600401610b5290614265565b604051633b0d4dd760e01b8152600c60048201526002602482015260009073__$b1c1335e68417b4234016f4aa58fdfac77$__90633b0d4dd790604401602060405180830381865af4158015611fc7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611feb91906142a9565b9050600061200660085463ffffffff600160301b9091041690565b905061201183612beb565b60026040805183815263ffffffff86166020820152908101849052600080516020614ae283398151915290606001610c1d565b60006118a1838361206060408051602081019091526000815290565b612b1c565b61206d612153565b7f000000000000000000000000000000000000000000000000000000000000000046146120ac5760405162461bcd60e51b8152600401610b5290614265565b604051633b0d4dd760e01b8152600c60048201526003602482015260009073__$b1c1335e68417b4234016f4aa58fdfac77$__90633b0d4dd790604401602060405180830381865af4158015612106573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061212a91906142a9565b90506000612136611c0e565b905061214183612c89565b6003610bf5565b6000610b0082612ce6565b303314612175576040516347096e4760e01b8152336004820152602401610b52565b565b806121826005612d90565b03612177575b50565b6064808211156121b85760405163243e544560e01b81526004810183905260248101829052604401610b52565b60006121c26118a8565b90506121e16121cf611809565b6121d885612dff565b600a9190612e33565b505060408051828152602081018590527f0553476bf02ef2726e8ce5ced78d63e26e602e4a2257b1f559418e24b46339979101610e95565b600081600781111561222d5761222d613bc1565b600160ff919091161b92915050565b60008061224884611009565b905060008361225683612219565b16036118a1578381846040516331b75e4d60e01b8152600401610b52939291906147d7565b81546001600160801b03600160801b8204811691811660018301909116036122a7576122a76041612e4e565b6001600160801b03808216600090815260018086016020526040909120939093558354919092018216600160801b029116179055565b60005b84518110156123b5576000808683815181106122fe576122fe61443c565b60200260200101516001600160a01b03168684815181106123215761232161443c565b602002602001015186858151811061233b5761233b61443c565b602002602001015160405161235091906147f9565b60006040518083038185875af1925050503d806000811461238d576040519150601f19603f3d011682016040523d82523d6000602084013e612392565b606091505b50915091506123a18282612cca565b505050806123ae90614468565b90506122e0565b505050505050565b6000818152600960205260408120600281015460018201546123df9190614815565b6123eb610a7c85610fd5565b11159392505050565b60008061240386868686611cdc565b9050612451816124136007612219565b61241d6006612219565b6124276002612219565b6001612434600782614828565b61243f906002614925565b6124499190614509565b18181861223c565b506000818152600460205260409081902080546001600160f81b0316600160f81b179055517f789cf55be980739dad1d0699b93b58e806b51c9d96619bfa8fe0a28abaa7b30c90610fc49083815260200190565b60006124c8858585856124c360408051602081019091526000815290565b612572565b95945050505050565b6000610b006124de612e60565b8360405161190160f01b8152600281019290925260228201526042902090565b6000836001600160a01b03163b6000036125605760008061251f8585612f8b565b509092509050600081600381111561253957612539613bc1565b1480156125575750856001600160a01b0316826001600160a01b0316145b925050506118a1565b61256b848484612fd8565b90506118a1565b600061258286610cdb6001612219565b5060006125988661259289610fd5565b85612b1c565b905060006125a988888885886130b3565b9050835160000361260057866001600160a01b03167fb8e138887d0aa13bab447e82de9d5c1777041ecd21ca36ba824ff1e6c07ddda4898884896040516125f39493929190614934565b60405180910390a2611446565b866001600160a01b03167fe2babfbac5889a709b63bb7f598b324e08bc5a4fb9ec647fb3cbc9ec07eb8712898884898960405161264195949392919061495c565b60405180910390a2979650505050505050565b600065ffffffffffff821115612687576040516306dfcc6560e41b81526030600482015260248101839052604401610b52565b5090565b8154600090818160058111156126ea5760006126a6846131b6565b6126b09085614509565b60008881526020902090915081015465ffffffffffff90811690871610156126da578091506126e8565b6126e5816001614815565b92505b505b60006126f88787858561330f565b905080156127335761271d8761270f600184614509565b600091825260209091200190565b54600160301b90046001600160d01b0316611446565b6000979650505050505050565b6008546040805165ffffffffffff928316815291831660208301527fc565b045403dc03c2eea82b81a0465edad9e2e7fc4d97e11421c209da93d7a93910160405180910390a16008805465ffffffffffff191665ffffffffffff92909216919091179055565b805160009060348110156127be576001915050610b00565b82810160131901516001600160a01b031981166b046e0e4dee0dee6cae47a60f60a31b146127f157600192505050610b00565b6000806127ff602885614509565b90505b83811015612876576000806128368884815181106128225761282261443c565b01602001516001600160f81b031916613371565b915091508161284e5760019650505050505050610b00565b8060ff166004856001600160a01b0316901b17935050508061286f90614468565b9050612802565b50856001600160a01b0316816001600160a01b031614935050505092915050565b60006128ac8686868680519060200120611cdc565b9050845186511415806128c157508351865114155b806128cb57508551155b1561290057855184518651604051630447b05d60e41b8152600481019390935260248301919091526044820152606401610b52565b600081815260046020526040902054600160a01b900465ffffffffffff161561294b578061292d82611009565b6040516331b75e4d60e01b8152610b529291906000906004016147d7565b6000612955610ff6565b61295d611809565b65ffffffffffff1661296f9190614815565b9050600061298a60085463ffffffff600160301b9091041690565b600084815260046020526040902080546001600160a01b0319166001600160a01b0387161781559091506129bd83612654565b815465ffffffffffff91909116600160a01b0265ffffffffffff60a01b199091161781556129ea82613403565b815463ffffffff91909116600160d01b0263ffffffff60d01b1990911617815588517f7d84a6263ae0d98d3329bd7b46bb4e8d6f98cd35a7adb45c274c8b7fd5ebd5e090859087908c908c906001600160401b03811115612a4d57612a4d61386a565b604051908082528060200260200182016040528015612a8057816020015b6060815260200190600190039081612a6b5790505b508c89612a8d8a82614815565b8e604051612aa3999897969594939291906149a2565b60405180910390a150505095945050505050565b6060610b067f00000000000000000000000000000000000000000000000000000000000000006000613434565b6060610b067f00000000000000000000000000000000000000000000000000000000000000006001613434565b6000610b0643612654565b60007f0000000000000000000000000000000000000000000000000000000000000000604051630748d63560e31b81526001600160a01b038681166004830152602482018690529190911690633a46b1a890604401602060405180830381865afa158015612b8e573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061189e91906142a9565b80546000908015612be257612bcc8361270f600184614509565b54600160301b90046001600160d01b03166118a1565b60009392505050565b8063ffffffff16600003612c155760405163f1cfbf0560e01b815260006004820152602401610b52565b6008546040805163ffffffff600160301b9093048316815291831660208301527f7e3f7f0708a84de9203036abaa450dccc85ad5ff52f78c170f3edb55cf5e8828910160405180910390a16008805463ffffffff909216600160301b0269ffffffff00000000000019909216919091179055565b60075460408051918252602082018390527fccb45da8d5717e6c4544694297c4ba5cf151d455c9bb0ed4fc7a38411bc05461910160405180910390a1600755565b606082612cdf57612cda826134df565b610b00565b5080610b00565b60006064612cf383611451565b604051632394e7a360e21b8152600481018590526001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001690638e539e8c90602401602060405180830381865afa158015612d58573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612d7c91906142a9565b612d869190614a79565b610b009190614aa6565b80546000906001600160801b0380821691600160801b9004168103612db957612db96031612e4e565b6001600160801b038181166000908152600185810160205260408220805492905585546fffffffffffffffffffffffffffffffff19169301909116919091179092555090565b60006001600160d01b03821115612687576040516306dfcc6560e41b815260d0600482015260248101839052604401610b52565b600080612e41858585613508565b915091505b935093915050565b634e487b71600052806020526024601cfd5b6000306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016148015612eb957507f000000000000000000000000000000000000000000000000000000000000000046145b15612ee357507f000000000000000000000000000000000000000000000000000000000000000090565b610b06604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f60208201527f0000000000000000000000000000000000000000000000000000000000000000918101919091527f000000000000000000000000000000000000000000000000000000000000000060608201524660808201523060a082015260009060c00160405160208183030381529060405280519060200120905090565b60008060008351604103612fc55760208401516040850151606086015160001a612fb78882858561365c565b955095509550505050612fd1565b50508151600091506002905b9250925092565b6000806000856001600160a01b03168585604051602401612ffa929190614ac8565b60408051601f198184030181529181526020820180516001600160e01b0316630b135d3f60e11b1790525161302f91906147f9565b600060405180830381855afa9150503d806000811461306a576040519150601f19603f3d011682016040523d82523d6000602084013e61306f565b606091505b509150915081801561308357506020815110155b80156111a857508051630b135d3f60e11b906130a890830160209081019084016142a9565b149695505050505050565b60008581526009602090815260408083206001600160a01b03881684526003810190925282205460ff1615613106576040516371c6af4960e01b81526001600160a01b0387166004820152602401610b52565b6001600160a01b03861660009081526003820160205260409020805460ff1916600117905560ff851661315257838160000160008282546131479190614815565b909155506131ab9050565b60001960ff86160161317257838160010160008282546131479190614815565b60011960ff86160161319257838160020160008282546131479190614815565b6040516303599be160e11b815260040160405180910390fd5b509195945050505050565b6000600182116131c4575090565b816001600160801b82106131dd5760809190911c9060401b5b6801000000000000000082106131f85760409190911c9060201b5b640100000000821061320f5760209190911c9060101b5b6201000082106132245760109190911c9060081b5b61010082106132385760089190911c9060041b5b6010821061324b5760049190911c9060021b5b600482106132575760011b5b600302600190811c9081858161326f5761326f614a90565b048201901c9050600181858161328757613287614a90565b048201901c9050600181858161329f5761329f614a90565b048201901c905060018185816132b7576132b7614a90565b048201901c905060018185816132cf576132cf614a90565b048201901c905060018185816132e7576132e7614a90565b048201901c905061330681858161330057613300614a90565b04821190565b90039392505050565b60005b81831015613369576000613326848461372b565b60008781526020902090915065ffffffffffff86169082015465ffffffffffff16111561335557809250613363565b613360816001614815565b93505b50613312565b509392505050565b60008060f883901c602f8111801561338c5750603a8160ff16105b156133a157600194602f199091019350915050565b8060ff1660401080156133b7575060478160ff16105b156133cc576001946036199091019350915050565b8060ff1660601080156133e2575060678160ff16105b156133f7576001946056199091019350915050565b50600093849350915050565b600063ffffffff821115612687576040516306dfcc6560e41b81526020600482015260248101839052604401610b52565b606060ff831461344e5761344783613746565b9050610b00565b81805461345a906142c2565b80601f0160208091040260200160405190810160405280929190818152602001828054613486906142c2565b80156134d35780601f106134a8576101008083540402835291602001916134d3565b820191906000526020600020905b8154815290600101906020018083116134b657829003601f168201915b50505050509050610b00565b8051156134ef5780518082602001fd5b60405163d6bda27560e01b815260040160405180910390fd5b8254600090819080156136015760006135268761270f600185614509565b805490915065ffffffffffff80821691600160301b90046001600160d01b031690881682111561356957604051632520601d60e01b815260040160405180910390fd5b8765ffffffffffff168265ffffffffffff16036135a257825465ffffffffffff16600160301b6001600160d01b038916021783556135f3565b6040805180820190915265ffffffffffff808a1682526001600160d01b03808a1660208085019182528d54600181018f5560008f81529190912094519151909216600160301b029216919091179101555b9450859350612e4692505050565b50506040805180820190915265ffffffffffff80851682526001600160d01b0380851660208085019182528854600181018a5560008a815291822095519251909316600160301b029190931617920191909155905081612e46565b600080807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08411156136975750600091506003905082613721565b604080516000808252602082018084528a905260ff891692820192909252606081018790526080810186905260019060a0016020604051602081039080840390855afa1580156136eb573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b03811661371757506000925060019150829050613721565b9250600091508190505b9450945094915050565b600061373a6002848418614aa6565b6118a190848416614815565b6060600061375383613785565b604080516020808252818301909252919250600091906020820181803683375050509182525060208101929092525090565b600060ff8216601f811115610b0057604051632cd44ac360e21b815260040160405180910390fd5b6000602082840312156137bf57600080fd5b81356001600160e01b0319811681146118a157600080fd5b6000602082840312156137e957600080fd5b5035919050565b60005b8381101561380b5781810151838201526020016137f3565b50506000910152565b6000815180845261382c8160208601602086016137f0565b601f01601f19169290920160200192915050565b6020815260006118a16020830184613814565b80356001600160a01b038116811461126f57600080fd5b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b03811182821017156138a8576138a861386a565b604052919050565b60006001600160401b038211156138c9576138c961386a565b50601f01601f191660200190565b600082601f8301126138e857600080fd5b81356138fb6138f6826138b0565b613880565b81815284602083860101111561391057600080fd5b816020850160208301376000918101602001919091529392505050565b6000806000806080858703121561394357600080fd5b61394c85613853565b935061395a60208601613853565b92506040850135915060608501356001600160401b0381111561397c57600080fd5b613988878288016138d7565b91505092959194509250565b60006001600160401b038211156139ad576139ad61386a565b5060051b60200190565b600082601f8301126139c857600080fd5b813560206139d86138f683613994565b82815260059290921b840181019181810190868411156139f757600080fd5b8286015b84811015613a1957613a0c81613853565b83529183019183016139fb565b509695505050505050565b600082601f830112613a3557600080fd5b81356020613a456138f683613994565b82815260059290921b84018101918181019086841115613a6457600080fd5b8286015b84811015613a195780358352918301918301613a68565b600082601f830112613a9057600080fd5b81356020613aa06138f683613994565b82815260059290921b84018101918181019086841115613abf57600080fd5b8286015b84811015613a195780356001600160401b03811115613ae25760008081fd5b613af08986838b01016138d7565b845250918301918301613ac3565b60008060008060808587031215613b1457600080fd5b84356001600160401b0380821115613b2b57600080fd5b613b37888389016139b7565b95506020870135915080821115613b4d57600080fd5b613b5988838901613a24565b94506040870135915080821115613b6f57600080fd5b50613b7c87828801613a7f565b949793965093946060013593505050565b600060208284031215613b9f57600080fd5b81356001600160401b03811115613bb557600080fd5b611295848285016138d7565b634e487b7160e01b600052602160045260246000fd5b60088110613bf557634e487b7160e01b600052602160045260246000fd5b9052565b60208101610b008284613bd7565b60008060408385031215613c1a57600080fd5b82359150613c2a60208401613853565b90509250929050565b60ff8116811461218857600080fd5b60008060408385031215613c5557600080fd5b823591506020830135613c6781613c33565b809150509250929050565b60008083601f840112613c8457600080fd5b5081356001600160401b03811115613c9b57600080fd5b602083019150836020828501011115613cb357600080fd5b9250929050565b600080600080600080600060c0888a031215613cd557600080fd5b873596506020880135613ce781613c33565b9550613cf560408901613853565b945060608801356001600160401b0380821115613d1157600080fd5b613d1d8b838c01613c72565b909650945060808a0135915080821115613d3657600080fd5b613d428b838c016138d7565b935060a08a0135915080821115613d5857600080fd5b50613d658a828b016138d7565b91505092959891949750929550565b600080600080600060808688031215613d8c57600080fd5b853594506020860135613d9e81613c33565b935060408601356001600160401b0380821115613dba57600080fd5b613dc689838a01613c72565b90955093506060880135915080821115613ddf57600080fd5b50613dec888289016138d7565b9150509295509295909350565b65ffffffffffff8116811461218857600080fd5b600060208284031215613e1f57600080fd5b81356118a181613df9565b60008060008060608587031215613e4057600080fd5b843593506020850135613e5281613c33565b925060408501356001600160401b03811115613e6d57600080fd5b613e7987828801613c72565b95989497509550505050565b60008060008060808587031215613e9b57600080fd5b84356001600160401b0380821115613eb257600080fd5b613ebe888389016139b7565b95506020870135915080821115613ed457600080fd5b613ee088838901613a24565b94506040870135915080821115613ef657600080fd5b613f0288838901613a7f565b93506060870135915080821115613f1857600080fd5b50613988878288016138d7565b600060208284031215613f3757600080fd5b6118a182613853565b600081518084526020808501945080840160005b83811015613f7057815187529582019590820190600101613f54565b509495945050505050565b60ff60f81b8816815260e060208201526000613f9a60e0830189613814565b8281036040840152613fac8189613814565b606084018890526001600160a01b038716608085015260a0840186905283810360c08501529050613fdd8185613f40565b9a9950505050505050505050565b6000806000806080858703121561400157600080fd5b84359350602085013561401381613c33565b925061402160408601613853565b915060608501356001600160401b0381111561397c57600080fd5b60008060006060848603121561405157600080fd5b61405a84613853565b92506020840135915060408401356001600160401b0381111561407c57600080fd5b614088868287016138d7565b9150509250925092565b600080600080600060a086880312156140aa57600080fd5b6140b386613853565b94506140c160208701613853565b935060408601356001600160401b03808211156140dd57600080fd5b6140e989838a01613a24565b945060608801359150808211156140ff57600080fd5b61410b89838a01613a24565b93506080880135915080821115613ddf57600080fd5b6000806000806060858703121561413757600080fd5b61414085613853565b93506020850135925060408501356001600160401b03811115613e6d57600080fd5b6000806040838503121561417557600080fd5b823561418081613c33565b915060208301356001600160401b0381111561419b57600080fd5b6141a7858286016138d7565b9150509250929050565b6000602082840312156141c357600080fd5b813563ffffffff811681146118a157600080fd5b600080604083850312156141ea57600080fd5b6141f383613853565b946020939093013593505050565b600080600080600060a0868803121561421957600080fd5b61422286613853565b945061423060208701613853565b9350604086013592506060860135915060808601356001600160401b0381111561425957600080fd5b613dec888289016138d7565b60208082526024908201527f4f7065726174696f6e206f6e6c7920616c6c6f776564206f6e20686f6d6520636040820152633430b4b760e11b606082015260800190565b6000602082840312156142bb57600080fd5b5051919050565b600181811c908216806142d657607f821691505b6020821081036142f657634e487b7160e01b600052602260045260246000fd5b50919050565b601f82111561434257600081815260208120601f850160051c810160208610156143235750805b601f850160051c820191505b818110156123b55782815560010161432f565b505050565b81516001600160401b038111156143605761436061386a565b6143748161436e84546142c2565b846142fc565b602080601f8311600181146143a957600084156143915750858301515b600019600386901b1c1916600185901b1785556123b5565b600085815260208120601f198616915b828110156143d8578886015182559484019460019091019084016143b9565b50858210156143f65787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6060815260006144196060830186613814565b828103602084015261442b8186613814565b915050826040830152949350505050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60006001820161447a5761447a614452565b5060010190565b600061448f6138f6846138b0565b90508281528383830111156144a357600080fd5b6118a18360208301846137f0565b6000602082840312156144c357600080fd5b81516001600160401b038111156144d957600080fd5b8201601f810184136144ea57600080fd5b61129584825160208401614481565b8183823760009101908152919050565b81810381811115610b0057610b00614452565b65ffffffffffff82811682821603908082111561453b5761453b614452565b5092915050565b60006020828403121561455457600080fd5b81516118a181613df9565b6060815260006145726060830186613814565b6001600160a01b039490941660208301525060400152919050565b600082601f83011261459e57600080fd5b6118a183835160208501614481565b6000806000606084860312156145c257600080fd5b83516145cd81613c33565b60208501519093506001600160401b038111156145e957600080fd5b6145f58682870161458d565b925050604084015190509250925092565b805160208201516001600160d01b031980821692919060068310156146355780818460060360031b1b83161693505b505050919050565b805160208201516001600160e01b031980821692919060048310156146355760049290920360031b82901b161692915050565b65ffffffffffff81811683821601908082111561453b5761453b614452565b600081518084526020808501945080840160005b83811015613f705781516001600160a01b0316875295820195908201906001016146a3565b6000815180845260208085019450848260051b860182860160005b8581101561470d5783830389526146fb838351613814565b988501989250908401906001016146e3565b5090979650505050505050565b60808152600061472d608083018761468f565b828103602084015261473f8187613f40565b9050828103604084015261475381866146c8565b91505082606083015295945050505050565b6001600160a01b038516815260ff8416602082015260806040820181905260009061479290830185613814565b905082606083015295945050505050565b6000602082840312156147b557600080fd5b81516001600160401b038111156147cb57600080fd5b6112958482850161458d565b838152606081016147eb6020830185613bd7565b826040830152949350505050565b6000825161480b8184602087016137f0565b9190910192915050565b80820180821115610b0057610b00614452565b60ff8181168382160190811115610b0057610b00614452565b600181815b8085111561487c57816000190482111561486257614862614452565b8085161561486f57918102915b93841c9390800290614846565b509250929050565b60008261489357506001610b00565b816148a057506000610b00565b81600181146148b657600281146148c0576148dc565b6001915050610b00565b60ff8411156148d1576148d1614452565b50506001821b610b00565b5060208310610133831016604e8410600b84101617156148ff575081810a610b00565b6149098383614841565b806000190482111561491d5761491d614452565b029392505050565b60006118a160ff841683614884565b84815260ff841660208201528260408201526080606082015260006111a86080830184613814565b85815260ff8516602082015283604082015260a06060820152600061498460a0830185613814565b82810360808401526149968185613814565b98975050505050505050565b60006101208b8352602060018060a01b038c16818501528160408501526149cb8285018c61468f565b915083820360608501526149df828b613f40565b915083820360808501528189518084528284019150828160051b850101838c0160005b83811015614a3057601f19878403018552614a1e838351613814565b94860194925090850190600101614a02565b505086810360a0880152614a44818c6146c8565b9450505050508560c08401528460e0840152828103610100840152614a698185613814565b9c9b505050505050505050505050565b8082028115828204841417610b0057610b00614452565b634e487b7160e01b600052601260045260246000fd5b600082614ac357634e487b7160e01b600052601260045260246000fd5b500490565b82815260406020820152600061189e604083018461381456fe80c51ad8a7db1a7a86cc355b77bd5cd7ea08f6071ea91d85a8f792734700a0eca26469706673582212205c5a83ff074db246f409ffc8bc5a5c810ce8a95783beb88564ba8a597a7cef8c64736f6c63430008140033", + "libraries": { + "ProofHandler": "0x0152ee45780385dACCCCB128D816031CfFe5F36B" + }, + "devdoc": { + "author": "Web3 Hackers Collective", + "custom:security-contact": "julien@strat.cc", + "details": "Extends OpenZeppelin's Governor contract with cross-chain parameter updates", + "errors": { + "CheckpointUnorderedInsertion()": [ + { + "details": "A value was attempted to be inserted on a past checkpoint." + } + ], + "FailedCall()": [ + { + "details": "A call to an address target failed. The target may have reverted." + } + ], + "GovernorAlreadyCastVote(address)": [ + { + "details": "The vote was already cast." + } + ], + "GovernorAlreadyQueuedProposal(uint256)": [ + { + "details": "The proposal has already been queued." + } + ], + "GovernorDisabledDeposit()": [ + { + "details": "Token deposits are disabled in this contract." + } + ], + "GovernorInsufficientProposerVotes(address,uint256,uint256)": [ + { + "details": "The `proposer` does not have the required votes to create a proposal." + } + ], + "GovernorInvalidProposalLength(uint256,uint256,uint256)": [ + { + "details": "Empty proposal or a mismatch between the parameters length for a proposal call." + } + ], + "GovernorInvalidQuorumFraction(uint256,uint256)": [ + { + "details": "The quorum set is not a valid fraction." + } + ], + "GovernorInvalidSignature(address)": [ + { + "details": "The provided signature is not valid for the expected `voter`. If the `voter` is a contract, the signature is not valid using {IERC1271-isValidSignature}." + } + ], + "GovernorInvalidVoteParams()": [ + { + "details": "The provided params buffer is not supported by the counting module." + } + ], + "GovernorInvalidVoteType()": [ + { + "details": "The vote type used is not valid for the corresponding counting module." + } + ], + "GovernorInvalidVotingPeriod(uint256)": [ + { + "details": "The voting period set is not a valid period." + } + ], + "GovernorNonexistentProposal(uint256)": [ + { + "details": "The `proposalId` doesn't exist." + } + ], + "GovernorNotQueuedProposal(uint256)": [ + { + "details": "The proposal hasn't been queued yet." + } + ], + "GovernorOnlyExecutor(address)": [ + { + "details": "The `account` is not the governance executor." + } + ], + "GovernorOnlyProposer(address)": [ + { + "details": "The `account` is not a proposer." + } + ], + "GovernorQueueNotImplemented()": [ + { + "details": "Queue operation is not implemented for this governor. Execute should be called directly." + } + ], + "GovernorRestrictedProposer(address)": [ + { + "details": "The `proposer` is not allowed to create a proposal." + } + ], + "GovernorUnexpectedProposalState(uint256,uint8,bytes32)": [ + { + "details": "The current state of a proposal is not the required for performing an operation. The `expectedStates` is a bitmap with the bits enabled for each ProposalState enum position counting from right to left. NOTE: If `expectedState` is `bytes32(0)`, the proposal is expected to not be in any state (i.e. not exist). This is the case when a proposal that is expected to be unset is already initiated (the proposal is duplicated). See {Governor-_encodeStateBitmap}." + } + ], + "InvalidAccountNonce(address,uint256)": [ + { + "details": "The nonce used for an `account` is not the expected current nonce." + } + ], + "SafeCastOverflowedUintDowncast(uint8,uint256)": [ + { + "details": "Value doesn't fit in an uint of `bits` size." + } + ] + }, + "events": { + "EIP712DomainChanged()": { + "details": "MAY be emitted to signal that the domain could have changed." + }, + "GovernanceParameterUpdated(uint8,uint256,uint256,uint256)": { + "params": { + "newValue": "New value", + "nonce": "Update sequence number", + "oldValue": "Previous value", + "operationType": "Type of parameter updated" + } + }, + "ManifestoUpdated(string,string,uint256)": { + "params": { + "newManifesto": "New manifesto CID", + "nonce": "Update sequence number", + "oldManifesto": "Previous manifesto CID" + } + }, + "ProposalCanceled(uint256)": { + "details": "Emitted when a proposal is canceled." + }, + "ProposalCreated(uint256,address,address[],uint256[],string[],bytes[],uint256,uint256,string)": { + "details": "Emitted when a proposal is created." + }, + "ProposalExecuted(uint256)": { + "details": "Emitted when a proposal is executed." + }, + "ProposalQueued(uint256,uint256)": { + "details": "Emitted when a proposal is queued." + }, + "VoteCast(address,uint256,uint8,uint256,string)": { + "details": "Emitted when a vote is cast without params. Note: `support` values should be seen as buckets. Their interpretation depends on the voting module used." + }, + "VoteCastWithParams(address,uint256,uint8,uint256,string,bytes)": { + "details": "Emitted when a vote is cast with params. Note: `support` values should be seen as buckets. Their interpretation depends on the voting module used. `params` are additional encoded parameters. Their interpretation also depends on the voting module used." + } + }, + "kind": "dev", + "methods": { + "CLOCK_MODE()": { + "details": "Machine-readable description of the clock as specified in ERC-6372." + }, + "COUNTING_MODE()": { + "details": "See {IGovernor-COUNTING_MODE}." + }, + "cancel(address[],uint256[],bytes[],bytes32)": { + "details": "See {IGovernor-cancel}." + }, + "castVote(uint256,uint8)": { + "details": "See {IGovernor-castVote}." + }, + "castVoteBySig(uint256,uint8,address,bytes)": { + "details": "See {IGovernor-castVoteBySig}." + }, + "castVoteWithReason(uint256,uint8,string)": { + "details": "See {IGovernor-castVoteWithReason}." + }, + "castVoteWithReasonAndParams(uint256,uint8,string,bytes)": { + "details": "See {IGovernor-castVoteWithReasonAndParams}." + }, + "castVoteWithReasonAndParamsBySig(uint256,uint8,address,string,bytes,bytes)": { + "details": "See {IGovernor-castVoteWithReasonAndParamsBySig}." + }, + "claimParameterUpdate(bytes)": { + "params": { + "proof": "Proof generated by home chain" + } + }, + "clock()": { + "details": "Clock (as specified in ERC-6372) is set to match the token's clock. Fallback to block numbers if the token does not implement ERC-6372." + }, + "constructor": { + "details": "Sets up initial governance parameters and manifesto", + "params": { + "_home": "Chain ID where this contract is considered home", + "_manifestoCid": "Initial manifesto CID", + "_name": "Name of the governance contract", + "_proposalThreshold": "Minimum votes needed to create a proposal", + "_quorum": "Minimum participation percentage required", + "_token": "The voting token contract address", + "_votingDelay": "Time before voting begins", + "_votingPeriod": "Duration of voting period" + } + }, + "eip712Domain()": { + "details": "See {IERC-5267}." + }, + "execute(address[],uint256[],bytes[],bytes32)": { + "details": "See {IGovernor-execute}." + }, + "generateParameterProof(uint8,bytes)": { + "params": { + "operationType": "Type of parameter being updated", + "value": "Encoded parameter value" + }, + "returns": { + "proof": "Encoded proof data" + } + }, + "getVotes(address,uint256)": { + "details": "See {IGovernor-getVotes}." + }, + "getVotesWithParams(address,uint256,bytes)": { + "details": "See {IGovernor-getVotesWithParams}." + }, + "hasVoted(uint256,address)": { + "details": "See {IGovernor-hasVoted}." + }, + "hashProposal(address[],uint256[],bytes[],bytes32)": { + "details": "See {IGovernor-hashProposal}. The proposal id is produced by hashing the ABI encoded `targets` array, the `values` array, the `calldatas` array and the descriptionHash (bytes32 which itself is the keccak256 hash of the description string). This proposal id can be produced from the proposal data which is part of the {ProposalCreated} event. It can even be computed in advance, before the proposal is submitted. Note that the chainId and the governor address are not part of the proposal id computation. Consequently, the same proposal (with same operation and same description) will have the same id if submitted on multiple governors across multiple networks. This also means that in order to execute the same operation twice (on the same governor) the proposer will have to change the description in order to avoid proposal id conflicts." + }, + "name()": { + "details": "See {IGovernor-name}." + }, + "nonces(address)": { + "details": "Returns the next unused nonce for an address." + }, + "onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)": { + "details": "See {IERC1155Receiver-onERC1155BatchReceived}. Receiving tokens is disabled if the governance executor is other than the governor itself (eg. when using with a timelock)." + }, + "onERC1155Received(address,address,uint256,uint256,bytes)": { + "details": "See {IERC1155Receiver-onERC1155Received}. Receiving tokens is disabled if the governance executor is other than the governor itself (eg. when using with a timelock)." + }, + "onERC721Received(address,address,uint256,bytes)": { + "details": "See {IERC721Receiver-onERC721Received}. Receiving tokens is disabled if the governance executor is other than the governor itself (eg. when using with a timelock)." + }, + "proposalDeadline(uint256)": { + "details": "See {IGovernor-proposalDeadline}." + }, + "proposalEta(uint256)": { + "details": "See {IGovernor-proposalEta}." + }, + "proposalNeedsQueuing(uint256)": { + "details": "See {IGovernor-proposalNeedsQueuing}." + }, + "proposalProposer(uint256)": { + "details": "See {IGovernor-proposalProposer}." + }, + "proposalSnapshot(uint256)": { + "details": "See {IGovernor-proposalSnapshot}." + }, + "proposalVotes(uint256)": { + "details": "Accessor to the internal vote counts." + }, + "propose(address[],uint256[],bytes[],string)": { + "details": "See {IGovernor-propose}. This function has opt-in frontrunning protection, described in {_isValidDescriptionForProposer}." + }, + "queue(address[],uint256[],bytes[],bytes32)": { + "details": "See {IGovernor-queue}." + }, + "quorumDenominator()": { + "details": "Returns the quorum denominator. Defaults to 100, but may be overridden." + }, + "quorumNumerator()": { + "details": "Returns the current quorum numerator. See {quorumDenominator}." + }, + "quorumNumerator(uint256)": { + "details": "Returns the quorum numerator at a specific timepoint. See {quorumDenominator}." + }, + "relay(address,uint256,bytes)": { + "details": "Relays a transaction or function call to an arbitrary target. In cases where the governance executor is some contract other than the governor itself, like when using a timelock, this function can be invoked in a governance proposal to recover tokens or Ether that was sent to the governor contract by mistake. Note that if the executor is simply the governor itself, use of `relay` is redundant." + }, + "setManifesto(string)": { + "params": { + "newManifesto": "New manifesto CID" + } + }, + "setProposalThreshold(uint256)": { + "params": { + "newProposalThreshold": "New proposal threshold value" + } + }, + "setVotingDelay(uint48)": { + "params": { + "newVotingDelay": "New voting delay value" + } + }, + "setVotingPeriod(uint32)": { + "params": { + "newVotingPeriod": "New voting period value" + } + }, + "state(uint256)": { + "details": "See {IGovernor-state}." + }, + "supportsInterface(bytes4)": { + "details": "See {IERC165-supportsInterface}." + }, + "token()": { + "details": "The token that voting power is sourced from." + }, + "updateQuorumNumerator(uint256)": { + "params": { + "newQuorumNumerator": "New quorum numerator value" + } + }, + "version()": { + "details": "See {IGovernor-version}." + } + }, + "title": "Cross-chain Governance Contract", + "version": 1 + }, + "userdoc": { + "events": { + "GovernanceParameterUpdated(uint8,uint256,uint256,uint256)": { + "notice": "Emitted when a governance parameter is updated" + }, + "ManifestoUpdated(string,string,uint256)": { + "notice": "Emitted when the manifesto is updated" + } + }, + "kind": "user", + "methods": { + "claimParameterUpdate(bytes)": { + "notice": "Claims a parameter update on a foreign chain" + }, + "constructor": { + "notice": "Initializes the governance contract" + }, + "generateParameterProof(uint8,bytes)": { + "notice": "Generates proof for parameter updates" + }, + "home()": { + "notice": "Chain ID where this contract was originally deployed" + }, + "manifesto()": { + "notice": "IPFS CID of the DAO's manifesto" + }, + "setManifesto(string)": { + "notice": "Updates the DAO's manifesto on the home chain" + }, + "setProposalThreshold(uint256)": { + "notice": "Updates the proposal threshold parameter on the home chain" + }, + "setVotingDelay(uint48)": { + "notice": "Updates the voting delay parameter on the home chain" + }, + "setVotingPeriod(uint32)": { + "notice": "Updates the voting period parameter on the home chain" + }, + "updateQuorumNumerator(uint256)": { + "notice": "Updates the quorum numerator on the home chain" + } + }, + "notice": "Implementation of a DAO with cross-chain synchronization capabilities", + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 7382, + "contract": "contracts/variants/crosschain/Gov.sol:Gov", + "label": "_nameFallback", + "offset": 0, + "slot": "0", + "type": "t_string_storage" + }, + { + "astId": 7384, + "contract": "contracts/variants/crosschain/Gov.sol:Gov", + "label": "_versionFallback", + "offset": 0, + "slot": "1", + "type": "t_string_storage" + }, + { + "astId": 6230, + "contract": "contracts/variants/crosschain/Gov.sol:Gov", + "label": "_nonces", + "offset": 0, + "slot": "2", + "type": "t_mapping(t_address,t_uint256)" + }, + { + "astId": 237, + "contract": "contracts/variants/crosschain/Gov.sol:Gov", + "label": "_name", + "offset": 0, + "slot": "3", + "type": "t_string_storage" + }, + { + "astId": 242, + "contract": "contracts/variants/crosschain/Gov.sol:Gov", + "label": "_proposals", + "offset": 0, + "slot": "4", + "type": "t_mapping(t_uint256,t_struct(ProposalCore)215_storage)" + }, + { + "astId": 245, + "contract": "contracts/variants/crosschain/Gov.sol:Gov", + "label": "_governanceCall", + "offset": 0, + "slot": "5", + "type": "t_struct(Bytes32Deque)12901_storage" + }, + { + "astId": 2663, + "contract": "contracts/variants/crosschain/Gov.sol:Gov", + "label": "_proposalThreshold", + "offset": 0, + "slot": "7", + "type": "t_uint256" + }, + { + "astId": 2665, + "contract": "contracts/variants/crosschain/Gov.sol:Gov", + "label": "_votingDelay", + "offset": 0, + "slot": "8", + "type": "t_uint48" + }, + { + "astId": 2667, + "contract": "contracts/variants/crosschain/Gov.sol:Gov", + "label": "_votingPeriod", + "offset": 6, + "slot": "8", + "type": "t_uint32" + }, + { + "astId": 2450, + "contract": "contracts/variants/crosschain/Gov.sol:Gov", + "label": "_proposalVotes", + "offset": 0, + "slot": "9", + "type": "t_mapping(t_uint256,t_struct(ProposalVote)2445_storage)" + }, + { + "astId": 2969, + "contract": "contracts/variants/crosschain/Gov.sol:Gov", + "label": "_quorumNumeratorHistory", + "offset": 0, + "slot": "10", + "type": "t_struct(Trace208)11842_storage" + }, + { + "astId": 13540, + "contract": "contracts/variants/crosschain/Gov.sol:Gov", + "label": "manifesto", + "offset": 0, + "slot": "11", + "type": "t_string_storage" + }, + { + "astId": 13544, + "contract": "contracts/variants/crosschain/Gov.sol:Gov", + "label": "_proofStorage", + "offset": 0, + "slot": "12", + "type": "t_struct(ProofStorage)14687_storage" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + }, + "t_array(t_struct(Checkpoint208)11847_storage)dyn_storage": { + "base": "t_struct(Checkpoint208)11847_storage", + "encoding": "dynamic_array", + "label": "struct Checkpoints.Checkpoint208[]", + "numberOfBytes": "32" + }, + "t_bool": { + "encoding": "inplace", + "label": "bool", + "numberOfBytes": "1" + }, + "t_bytes32": { + "encoding": "inplace", + "label": "bytes32", + "numberOfBytes": "32" + }, + "t_mapping(t_address,t_bool)": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => bool)", + "numberOfBytes": "32", + "value": "t_bool" + }, + "t_mapping(t_address,t_uint256)": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => uint256)", + "numberOfBytes": "32", + "value": "t_uint256" + }, + "t_mapping(t_bytes32,t_bool)": { + "encoding": "mapping", + "key": "t_bytes32", + "label": "mapping(bytes32 => bool)", + "numberOfBytes": "32", + "value": "t_bool" + }, + "t_mapping(t_uint128,t_bytes32)": { + "encoding": "mapping", + "key": "t_uint128", + "label": "mapping(uint128 => bytes32)", + "numberOfBytes": "32", + "value": "t_bytes32" + }, + "t_mapping(t_uint256,t_struct(ProposalCore)215_storage)": { + "encoding": "mapping", + "key": "t_uint256", + "label": "mapping(uint256 => struct Governor.ProposalCore)", + "numberOfBytes": "32", + "value": "t_struct(ProposalCore)215_storage" + }, + "t_mapping(t_uint256,t_struct(ProposalVote)2445_storage)": { + "encoding": "mapping", + "key": "t_uint256", + "label": "mapping(uint256 => struct GovernorCountingSimple.ProposalVote)", + "numberOfBytes": "32", + "value": "t_struct(ProposalVote)2445_storage" + }, + "t_mapping(t_uint8,t_uint256)": { + "encoding": "mapping", + "key": "t_uint8", + "label": "mapping(uint8 => uint256)", + "numberOfBytes": "32", + "value": "t_uint256" + }, + "t_string_storage": { + "encoding": "bytes", + "label": "string", + "numberOfBytes": "32" + }, + "t_struct(Bytes32Deque)12901_storage": { + "encoding": "inplace", + "label": "struct DoubleEndedQueue.Bytes32Deque", + "members": [ + { + "astId": 12894, + "contract": "contracts/variants/crosschain/Gov.sol:Gov", + "label": "_begin", + "offset": 0, + "slot": "0", + "type": "t_uint128" + }, + { + "astId": 12896, + "contract": "contracts/variants/crosschain/Gov.sol:Gov", + "label": "_end", + "offset": 16, + "slot": "0", + "type": "t_uint128" + }, + { + "astId": 12900, + "contract": "contracts/variants/crosschain/Gov.sol:Gov", + "label": "_data", + "offset": 0, + "slot": "1", + "type": "t_mapping(t_uint128,t_bytes32)" + } + ], + "numberOfBytes": "64" + }, + "t_struct(Checkpoint208)11847_storage": { + "encoding": "inplace", + "label": "struct Checkpoints.Checkpoint208", + "members": [ + { + "astId": 11844, + "contract": "contracts/variants/crosschain/Gov.sol:Gov", + "label": "_key", + "offset": 0, + "slot": "0", + "type": "t_uint48" + }, + { + "astId": 11846, + "contract": "contracts/variants/crosschain/Gov.sol:Gov", + "label": "_value", + "offset": 6, + "slot": "0", + "type": "t_uint208" + } + ], + "numberOfBytes": "32" + }, + "t_struct(ProofStorage)14687_storage": { + "encoding": "inplace", + "label": "struct ProofHandler.ProofStorage", + "members": [ + { + "astId": 14682, + "contract": "contracts/variants/crosschain/Gov.sol:Gov", + "label": "updateAppliedOnChain", + "offset": 0, + "slot": "0", + "type": "t_mapping(t_bytes32,t_bool)" + }, + { + "astId": 14686, + "contract": "contracts/variants/crosschain/Gov.sol:Gov", + "label": "currentNonce", + "offset": 0, + "slot": "1", + "type": "t_mapping(t_uint8,t_uint256)" + } + ], + "numberOfBytes": "64" + }, + "t_struct(ProposalCore)215_storage": { + "encoding": "inplace", + "label": "struct Governor.ProposalCore", + "members": [ + { + "astId": 204, + "contract": "contracts/variants/crosschain/Gov.sol:Gov", + "label": "proposer", + "offset": 0, + "slot": "0", + "type": "t_address" + }, + { + "astId": 206, + "contract": "contracts/variants/crosschain/Gov.sol:Gov", + "label": "voteStart", + "offset": 20, + "slot": "0", + "type": "t_uint48" + }, + { + "astId": 208, + "contract": "contracts/variants/crosschain/Gov.sol:Gov", + "label": "voteDuration", + "offset": 26, + "slot": "0", + "type": "t_uint32" + }, + { + "astId": 210, + "contract": "contracts/variants/crosschain/Gov.sol:Gov", + "label": "executed", + "offset": 30, + "slot": "0", + "type": "t_bool" + }, + { + "astId": 212, + "contract": "contracts/variants/crosschain/Gov.sol:Gov", + "label": "canceled", + "offset": 31, + "slot": "0", + "type": "t_bool" + }, + { + "astId": 214, + "contract": "contracts/variants/crosschain/Gov.sol:Gov", + "label": "etaSeconds", + "offset": 0, + "slot": "1", + "type": "t_uint48" + } + ], + "numberOfBytes": "64" + }, + "t_struct(ProposalVote)2445_storage": { + "encoding": "inplace", + "label": "struct GovernorCountingSimple.ProposalVote", + "members": [ + { + "astId": 2436, + "contract": "contracts/variants/crosschain/Gov.sol:Gov", + "label": "againstVotes", + "offset": 0, + "slot": "0", + "type": "t_uint256" + }, + { + "astId": 2438, + "contract": "contracts/variants/crosschain/Gov.sol:Gov", + "label": "forVotes", + "offset": 0, + "slot": "1", + "type": "t_uint256" + }, + { + "astId": 2440, + "contract": "contracts/variants/crosschain/Gov.sol:Gov", + "label": "abstainVotes", + "offset": 0, + "slot": "2", + "type": "t_uint256" + }, + { + "astId": 2444, + "contract": "contracts/variants/crosschain/Gov.sol:Gov", + "label": "hasVoted", + "offset": 0, + "slot": "3", + "type": "t_mapping(t_address,t_bool)" + } + ], + "numberOfBytes": "128" + }, + "t_struct(Trace208)11842_storage": { + "encoding": "inplace", + "label": "struct Checkpoints.Trace208", + "members": [ + { + "astId": 11841, + "contract": "contracts/variants/crosschain/Gov.sol:Gov", + "label": "_checkpoints", + "offset": 0, + "slot": "0", + "type": "t_array(t_struct(Checkpoint208)11847_storage)dyn_storage" + } + ], + "numberOfBytes": "32" + }, + "t_uint128": { + "encoding": "inplace", + "label": "uint128", + "numberOfBytes": "16" + }, + "t_uint208": { + "encoding": "inplace", + "label": "uint208", + "numberOfBytes": "26" + }, + "t_uint256": { + "encoding": "inplace", + "label": "uint256", + "numberOfBytes": "32" + }, + "t_uint32": { + "encoding": "inplace", + "label": "uint32", + "numberOfBytes": "4" + }, + "t_uint48": { + "encoding": "inplace", + "label": "uint48", + "numberOfBytes": "6" + }, + "t_uint8": { + "encoding": "inplace", + "label": "uint8", + "numberOfBytes": "1" + } + } + } +} \ No newline at end of file diff --git a/deployments/opSepolia/CrosschainNFT.json b/deployments/opSepolia/CrosschainNFT.json new file mode 100644 index 0000000..4ead327 --- /dev/null +++ b/deployments/opSepolia/CrosschainNFT.json @@ -0,0 +1,2098 @@ +{ + "address": "0x8583CEbA0d2C5cAe1a1BCff975Faa97063D14953", + "abi": [ + { + "inputs": [ + { + "internalType": "uint256", + "name": "_home", + "type": "uint256" + }, + { + "internalType": "address", + "name": "initialOwner", + "type": "address" + }, + { + "internalType": "address[]", + "name": "_firstMembers", + "type": "address[]" + }, + { + "internalType": "string", + "name": "_uri", + "type": "string" + }, + { + "internalType": "string", + "name": "_name", + "type": "string" + }, + { + "internalType": "string", + "name": "_symbol", + "type": "string" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [], + "name": "CheckpointUnorderedInsertion", + "type": "error" + }, + { + "inputs": [], + "name": "ECDSAInvalidSignature", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "length", + "type": "uint256" + } + ], + "name": "ECDSAInvalidSignatureLength", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + } + ], + "name": "ECDSAInvalidSignatureS", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "timepoint", + "type": "uint256" + }, + { + "internalType": "uint48", + "name": "clock", + "type": "uint48" + } + ], + "name": "ERC5805FutureLookup", + "type": "error" + }, + { + "inputs": [], + "name": "ERC6372InconsistentClock", + "type": "error" + }, + { + "inputs": [], + "name": "ERC721EnumerableForbiddenBatchMint", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + }, + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "ERC721IncorrectOwner", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "operator", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } + ], + "name": "ERC721InsufficientApproval", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "approver", + "type": "address" + } + ], + "name": "ERC721InvalidApprover", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "operator", + "type": "address" + } + ], + "name": "ERC721InvalidOperator", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "ERC721InvalidOwner", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "receiver", + "type": "address" + } + ], + "name": "ERC721InvalidReceiver", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "name": "ERC721InvalidSender", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } + ], + "name": "ERC721NonexistentToken", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "uint256", + "name": "index", + "type": "uint256" + } + ], + "name": "ERC721OutOfBoundsIndex", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "currentNonce", + "type": "uint256" + } + ], + "name": "InvalidAccountNonce", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidShortString", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "OwnableInvalidOwner", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "OwnableUnauthorizedAccount", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint8", + "name": "bits", + "type": "uint8" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "SafeCastOverflowedUintDowncast", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "str", + "type": "string" + } + ], + "name": "StringTooLong", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "expiry", + "type": "uint256" + } + ], + "name": "VotesExpiredSignature", + "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": [ + { + "indexed": false, + "internalType": "uint256", + "name": "_fromTokenId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "_toTokenId", + "type": "uint256" + } + ], + "name": "BatchMetadataUpdate", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "delegator", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "fromDelegate", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "toDelegate", + "type": "address" + } + ], + "name": "DelegateChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "delegate", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "previousVotes", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newVotes", + "type": "uint256" + } + ], + "name": "DelegateVotesChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "delegator", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "delegatee", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + } + ], + "name": "DelegationSynced", + "type": "event" + }, + { + "anonymous": false, + "inputs": [], + "name": "EIP712DomainChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "address", + "name": "member", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + } + ], + "name": "MembershipClaimed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "address", + "name": "member", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + } + ], + "name": "MembershipRevoked", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "_tokenId", + "type": "uint256" + } + ], + "name": "MetadataUpdate", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "string", + "name": "newUri", + "type": "string" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + } + ], + "name": "MetadataUpdated", + "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": 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": "CLOCK_MODE", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "pure", + "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": [ + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } + ], + "name": "burn", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "proof", + "type": "bytes" + } + ], + "name": "claimDelegation", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "proof", + "type": "bytes" + } + ], + "name": "claimOperation", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "clock", + "outputs": [ + { + "internalType": "uint48", + "name": "", + "type": "uint48" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "delegatee", + "type": "address" + } + ], + "name": "delegate", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "delegatee", + "type": "address" + }, + { + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "expiry", + "type": "uint256" + }, + { + "internalType": "uint8", + "name": "v", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "r", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + } + ], + "name": "delegateBySig", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "delegates", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "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": [ + { + "internalType": "address", + "name": "delegator", + "type": "address" + }, + { + "internalType": "address", + "name": "delegatee", + "type": "address" + } + ], + "name": "generateDelegationProof", + "outputs": [ + { + "internalType": "bytes", + "name": "", + "type": "bytes" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint8", + "name": "operationType", + "type": "uint8" + }, + { + "internalType": "bytes", + "name": "params", + "type": "bytes" + } + ], + "name": "generateOperationProof", + "outputs": [ + { + "internalType": "bytes", + "name": "", + "type": "bytes" + } + ], + "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": "uint256", + "name": "timepoint", + "type": "uint256" + } + ], + "name": "getPastTotalSupply", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "timepoint", + "type": "uint256" + } + ], + "name": "getPastVotes", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "getVotes", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + } + ], + "name": "govBurn", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "home", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "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": [], + "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": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "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": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "string", + "name": "uri", + "type": "string" + } + ], + "name": "safeMint", + "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": [ + { + "internalType": "address", + "name": "operator", + "type": "address" + }, + { + "internalType": "bool", + "name": "approved", + "type": "bool" + } + ], + "name": "setApprovalForAll", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + }, + { + "internalType": "string", + "name": "uri", + "type": "string" + } + ], + "name": "setMetadata", + "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": "index", + "type": "uint256" + } + ], + "name": "tokenByIndex", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "uint256", + "name": "index", + "type": "uint256" + } + ], + "name": "tokenOfOwnerByIndex", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "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" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "args": [ + 11155111, + "0x27292E1a901E3E0bE7d144aDba4CAD07da2d8a42", + [ + "0xD8a394e7d7894bDF2C57139fF17e5CBAa29Dd977", + "0xe61A1a5278290B6520f0CEf3F2c71Ba70CF5cf4C" + ], + "https://bafkreicj62l5xu6pk2xx7x7n6b7rpunxb4ehlh7fevyjapid3556smuz4y.ipfs.w3s.link/", + "Membership NFT", + "MEMBER" + ], + "numDeployments": 1, + "solcInputHash": "c27a34cff02617821c386fb97b476bc1", + "metadata": "{\"compiler\":{\"version\":\"0.8.20+commit.a1b79de6\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_home\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"initialOwner\",\"type\":\"address\"},{\"internalType\":\"address[]\",\"name\":\"_firstMembers\",\"type\":\"address[]\"},{\"internalType\":\"string\",\"name\":\"_uri\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"_name\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"_symbol\",\"type\":\"string\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"CheckpointUnorderedInsertion\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ECDSAInvalidSignature\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"length\",\"type\":\"uint256\"}],\"name\":\"ECDSAInvalidSignatureLength\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"name\":\"ECDSAInvalidSignatureS\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"timepoint\",\"type\":\"uint256\"},{\"internalType\":\"uint48\",\"name\":\"clock\",\"type\":\"uint48\"}],\"name\":\"ERC5805FutureLookup\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ERC6372InconsistentClock\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ERC721EnumerableForbiddenBatchMint\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"ERC721IncorrectOwner\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"ERC721InsufficientApproval\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"approver\",\"type\":\"address\"}],\"name\":\"ERC721InvalidApprover\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"}],\"name\":\"ERC721InvalidOperator\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"ERC721InvalidOwner\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"}],\"name\":\"ERC721InvalidReceiver\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"ERC721InvalidSender\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"ERC721NonexistentToken\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"index\",\"type\":\"uint256\"}],\"name\":\"ERC721OutOfBoundsIndex\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"currentNonce\",\"type\":\"uint256\"}],\"name\":\"InvalidAccountNonce\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidShortString\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"OwnableInvalidOwner\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"OwnableUnauthorizedAccount\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint8\",\"name\":\"bits\",\"type\":\"uint8\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"SafeCastOverflowedUintDowncast\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"str\",\"type\":\"string\"}],\"name\":\"StringTooLong\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expiry\",\"type\":\"uint256\"}],\"name\":\"VotesExpiredSignature\",\"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\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_fromTokenId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_toTokenId\",\"type\":\"uint256\"}],\"name\":\"BatchMetadataUpdate\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"delegator\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"fromDelegate\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"toDelegate\",\"type\":\"address\"}],\"name\":\"DelegateChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"delegate\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"previousVotes\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newVotes\",\"type\":\"uint256\"}],\"name\":\"DelegateVotesChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"delegator\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"delegatee\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"}],\"name\":\"DelegationSynced\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[],\"name\":\"EIP712DomainChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"member\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"}],\"name\":\"MembershipClaimed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"member\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"}],\"name\":\"MembershipRevoked\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_tokenId\",\"type\":\"uint256\"}],\"name\":\"MetadataUpdate\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"newUri\",\"type\":\"string\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"}],\"name\":\"MetadataUpdated\",\"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\":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\":\"CLOCK_MODE\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"pure\",\"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\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"burn\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"proof\",\"type\":\"bytes\"}],\"name\":\"claimDelegation\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"proof\",\"type\":\"bytes\"}],\"name\":\"claimOperation\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"clock\",\"outputs\":[{\"internalType\":\"uint48\",\"name\":\"\",\"type\":\"uint48\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"delegatee\",\"type\":\"address\"}],\"name\":\"delegate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"delegatee\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expiry\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"name\":\"delegateBySig\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"delegates\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"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\":[{\"internalType\":\"address\",\"name\":\"delegator\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"delegatee\",\"type\":\"address\"}],\"name\":\"generateDelegationProof\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint8\",\"name\":\"operationType\",\"type\":\"uint8\"},{\"internalType\":\"bytes\",\"name\":\"params\",\"type\":\"bytes\"}],\"name\":\"generateOperationProof\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"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\":\"uint256\",\"name\":\"timepoint\",\"type\":\"uint256\"}],\"name\":\"getPastTotalSupply\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"timepoint\",\"type\":\"uint256\"}],\"name\":\"getPastVotes\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"getVotes\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"govBurn\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"home\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"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\":[],\"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\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"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\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"uri\",\"type\":\"string\"}],\"name\":\"safeMint\",\"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\":[{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"approved\",\"type\":\"bool\"}],\"name\":\"setApprovalForAll\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"string\",\"name\":\"uri\",\"type\":\"string\"}],\"name\":\"setMetadata\",\"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\":\"index\",\"type\":\"uint256\"}],\"name\":\"tokenByIndex\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"index\",\"type\":\"uint256\"}],\"name\":\"tokenOfOwnerByIndex\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"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\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"author\":\"Web3 Hackers Collective\",\"custom:security-contact\":\"julien@strat.cc\",\"details\":\"Extends OpenZeppelin's NFT standards with cross-chain operation support and delegation\",\"errors\":{\"CheckpointUnorderedInsertion()\":[{\"details\":\"A value was attempted to be inserted on a past checkpoint.\"}],\"ECDSAInvalidSignature()\":[{\"details\":\"The signature derives the `address(0)`.\"}],\"ECDSAInvalidSignatureLength(uint256)\":[{\"details\":\"The signature has an invalid length.\"}],\"ECDSAInvalidSignatureS(bytes32)\":[{\"details\":\"The signature has an S value that is in the upper half order.\"}],\"ERC5805FutureLookup(uint256,uint48)\":[{\"details\":\"Lookup to future votes is not available.\"}],\"ERC6372InconsistentClock()\":[{\"details\":\"The clock was incorrectly modified.\"}],\"ERC721EnumerableForbiddenBatchMint()\":[{\"details\":\"Batch mint is not allowed.\"}],\"ERC721IncorrectOwner(address,uint256,address)\":[{\"details\":\"Indicates an error related to the ownership over a particular token. Used in transfers.\",\"params\":{\"owner\":\"Address of the current owner of a token.\",\"sender\":\"Address whose tokens are being transferred.\",\"tokenId\":\"Identifier number of a token.\"}}],\"ERC721InsufficientApproval(address,uint256)\":[{\"details\":\"Indicates a failure with the `operator`\\u2019s approval. Used in transfers.\",\"params\":{\"operator\":\"Address that may be allowed to operate on tokens without being their owner.\",\"tokenId\":\"Identifier number of a token.\"}}],\"ERC721InvalidApprover(address)\":[{\"details\":\"Indicates a failure with the `approver` of a token to be approved. Used in approvals.\",\"params\":{\"approver\":\"Address initiating an approval operation.\"}}],\"ERC721InvalidOperator(address)\":[{\"details\":\"Indicates a failure with the `operator` to be approved. Used in approvals.\",\"params\":{\"operator\":\"Address that may be allowed to operate on tokens without being their owner.\"}}],\"ERC721InvalidOwner(address)\":[{\"details\":\"Indicates that an address can't be an owner. For example, `address(0)` is a forbidden owner in ERC-20. Used in balance queries.\",\"params\":{\"owner\":\"Address of the current owner of a token.\"}}],\"ERC721InvalidReceiver(address)\":[{\"details\":\"Indicates a failure with the token `receiver`. Used in transfers.\",\"params\":{\"receiver\":\"Address to which tokens are being transferred.\"}}],\"ERC721InvalidSender(address)\":[{\"details\":\"Indicates a failure with the token `sender`. Used in transfers.\",\"params\":{\"sender\":\"Address whose tokens are being transferred.\"}}],\"ERC721NonexistentToken(uint256)\":[{\"details\":\"Indicates a `tokenId` whose `owner` is the zero address.\",\"params\":{\"tokenId\":\"Identifier number of a token.\"}}],\"ERC721OutOfBoundsIndex(address,uint256)\":[{\"details\":\"An `owner`'s token query was out of bounds for `index`. NOTE: The owner being `address(0)` indicates a global out of bounds index.\"}],\"InvalidAccountNonce(address,uint256)\":[{\"details\":\"The nonce used for an `account` is not the expected current nonce.\"}],\"OwnableInvalidOwner(address)\":[{\"details\":\"The owner is not a valid owner account. (eg. `address(0)`)\"}],\"OwnableUnauthorizedAccount(address)\":[{\"details\":\"The caller account is not authorized to perform an operation.\"}],\"SafeCastOverflowedUintDowncast(uint8,uint256)\":[{\"details\":\"Value doesn't fit in an uint of `bits` size.\"}],\"VotesExpiredSignature(uint256)\":[{\"details\":\"The signature used has expired.\"}]},\"events\":{\"Approval(address,address,uint256)\":{\"details\":\"Emitted when `owner` enables `approved` to manage the `tokenId` token.\"},\"ApprovalForAll(address,address,bool)\":{\"details\":\"Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.\"},\"BatchMetadataUpdate(uint256,uint256)\":{\"details\":\"This event emits when the metadata of a range of tokens is changed. So that the third-party platforms such as NFT market could timely update the images and related attributes of the NFTs.\"},\"DelegateChanged(address,address,address)\":{\"details\":\"Emitted when an account changes their delegate.\"},\"DelegateVotesChanged(address,uint256,uint256)\":{\"details\":\"Emitted when a token transfer or delegate change results in changes to a delegate's number of voting units.\"},\"DelegationSynced(address,address,uint256)\":{\"params\":{\"delegatee\":\"The address receiving the delegation\",\"delegator\":\"The address delegating their voting power\",\"nonce\":\"Operation sequence number\"}},\"EIP712DomainChanged()\":{\"details\":\"MAY be emitted to signal that the domain could have changed.\"},\"MembershipClaimed(uint256,address,uint256)\":{\"params\":{\"member\":\"The address receiving the membership\",\"nonce\":\"Operation sequence number\",\"tokenId\":\"The ID of the claimed token\"}},\"MembershipRevoked(uint256,address,uint256)\":{\"params\":{\"member\":\"The address losing membership\",\"nonce\":\"Operation sequence number\",\"tokenId\":\"The ID of the revoked token\"}},\"MetadataUpdate(uint256)\":{\"details\":\"This event emits when the metadata of a token is changed. So that the third-party platforms such as NFT market could timely update the images and related attributes of the NFT.\"},\"MetadataUpdated(uint256,string,uint256)\":{\"params\":{\"newUri\":\"The new metadata URI\",\"nonce\":\"Operation sequence number\",\"tokenId\":\"The ID of the updated token\"}},\"Transfer(address,address,uint256)\":{\"details\":\"Emitted when `tokenId` token is transferred from `from` to `to`.\"}},\"kind\":\"dev\",\"methods\":{\"CLOCK_MODE()\":{\"returns\":{\"_0\":\"String indicating timestamp-based voting\"}},\"approve(address,uint256)\":{\"details\":\"See {IERC721-approve}.\"},\"balanceOf(address)\":{\"details\":\"See {IERC721-balanceOf}.\"},\"burn(uint256)\":{\"details\":\"Burns `tokenId`. See {ERC721-_burn}. Requirements: - The caller must own `tokenId` or be an approved operator.\"},\"claimDelegation(bytes)\":{\"params\":{\"proof\":\"Proof generated by home chain\"}},\"claimOperation(bytes)\":{\"params\":{\"proof\":\"Proof generated by home chain\"}},\"clock()\":{\"details\":\"Used for voting snapshots\",\"returns\":{\"_0\":\"Current block timestamp\"}},\"constructor\":{\"params\":{\"_firstMembers\":\"Array of initial member addresses\",\"_home\":\"Chain ID where contract is considered home\",\"_name\":\"Token collection name\",\"_symbol\":\"Token collection symbol\",\"_uri\":\"Initial token URI\",\"initialOwner\":\"Initial contract owner\"}},\"delegate(address)\":{\"details\":\"Overrides ERC721Votes delegate function to add cross-chain functionality\",\"params\":{\"delegatee\":\"Address to delegate voting power to\"}},\"delegateBySig(address,uint256,uint256,uint8,bytes32,bytes32)\":{\"details\":\"Delegates votes from signer to `delegatee`.\"},\"delegates(address)\":{\"details\":\"Returns the delegate that `account` has chosen.\"},\"eip712Domain()\":{\"details\":\"See {IERC-5267}.\"},\"generateDelegationProof(address,address)\":{\"details\":\"Only callable on home chain\",\"params\":{\"delegatee\":\"Address receiving delegation\",\"delegator\":\"Address delegating voting power\"},\"returns\":{\"_0\":\"Encoded proof data\"}},\"generateOperationProof(uint8,bytes)\":{\"details\":\"Only callable on home chain\",\"params\":{\"operationType\":\"Type of operation\",\"params\":\"Operation parameters\"},\"returns\":{\"_0\":\"Encoded proof data\"}},\"getApproved(uint256)\":{\"details\":\"See {IERC721-getApproved}.\"},\"getPastTotalSupply(uint256)\":{\"details\":\"Returns the total supply of votes available at a specific moment in the past. If the `clock()` is configured to use block numbers, this will return the value at the end of the corresponding block. NOTE: This value is the sum of all available votes, which is not necessarily the sum of all delegated votes. Votes that have not been delegated are still part of total supply, even though they would not participate in a vote. Requirements: - `timepoint` must be in the past. If operating using block numbers, the block must be already mined.\"},\"getPastVotes(address,uint256)\":{\"details\":\"Returns the amount of votes that `account` had at a specific moment in the past. If the `clock()` is configured to use block numbers, this will return the value at the end of the corresponding block. Requirements: - `timepoint` must be in the past. If operating using block numbers, the block must be already mined.\"},\"getVotes(address)\":{\"details\":\"Returns the current amount of votes that `account` has.\"},\"govBurn(uint256)\":{\"details\":\"Only callable by owner (governance) on home chain\",\"params\":{\"tokenId\":\"ID of token to burn\"}},\"isApprovedForAll(address,address)\":{\"details\":\"See {IERC721-isApprovedForAll}.\"},\"name()\":{\"details\":\"See {IERC721Metadata-name}.\"},\"nonces(address)\":{\"details\":\"Returns the next unused nonce for an address.\"},\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"ownerOf(uint256)\":{\"details\":\"See {IERC721-ownerOf}.\"},\"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.\"},\"safeMint(address,string)\":{\"details\":\"Only callable by owner (governance) on home chain\",\"params\":{\"to\":\"Address to mint token to\",\"uri\":\"Token metadata URI\"}},\"safeTransferFrom(address,address,uint256)\":{\"details\":\"See {IERC721-safeTransferFrom}.\"},\"safeTransferFrom(address,address,uint256,bytes)\":{\"details\":\"See {IERC721-safeTransferFrom}.\"},\"setApprovalForAll(address,bool)\":{\"details\":\"See {IERC721-setApprovalForAll}.\"},\"setMetadata(uint256,string)\":{\"details\":\"Only callable by owner (governance) on home chain\",\"params\":{\"tokenId\":\"ID of token to update\",\"uri\":\"New metadata URI\"}},\"supportsInterface(bytes4)\":{\"params\":{\"interfaceId\":\"Interface identifier to check\"},\"returns\":{\"_0\":\"bool True if interface is supported\"}},\"symbol()\":{\"details\":\"See {IERC721Metadata-symbol}.\"},\"tokenByIndex(uint256)\":{\"details\":\"See {IERC721Enumerable-tokenByIndex}.\"},\"tokenOfOwnerByIndex(address,uint256)\":{\"details\":\"See {IERC721Enumerable-tokenOfOwnerByIndex}.\"},\"tokenURI(uint256)\":{\"params\":{\"tokenId\":\"Token ID to query\"},\"returns\":{\"_0\":\"URI string\"}},\"totalSupply()\":{\"details\":\"See {IERC721Enumerable-totalSupply}.\"},\"transferFrom(address,address,uint256)\":{\"details\":\"See {IERC721-transferFrom}.\"},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.\"}},\"title\":\"Cross-chain Membership NFT Contract\",\"version\":1},\"userdoc\":{\"events\":{\"DelegationSynced(address,address,uint256)\":{\"notice\":\"Emitted when delegation is synchronized across chains\"},\"MembershipClaimed(uint256,address,uint256)\":{\"notice\":\"Emitted when a membership is claimed\"},\"MembershipRevoked(uint256,address,uint256)\":{\"notice\":\"Emitted when a membership is revoked\"},\"MetadataUpdated(uint256,string,uint256)\":{\"notice\":\"Emitted when metadata is updated\"}},\"kind\":\"user\",\"methods\":{\"CLOCK_MODE()\":{\"notice\":\"Gets clock mode description\"},\"claimDelegation(bytes)\":{\"notice\":\"Claims a delegation operation on a foreign chain\"},\"claimOperation(bytes)\":{\"notice\":\"Claims an NFT operation on a foreign chain\"},\"clock()\":{\"notice\":\"Gets current timestamp\"},\"constructor\":{\"notice\":\"Initializes the NFT contract\"},\"delegate(address)\":{\"notice\":\"Delegates voting power to another address on home chain\"},\"generateDelegationProof(address,address)\":{\"notice\":\"Generates proof for delegation\"},\"generateOperationProof(uint8,bytes)\":{\"notice\":\"Generates proof for NFT operations\"},\"govBurn(uint256)\":{\"notice\":\"Burns token on home chain\"},\"home()\":{\"notice\":\"Chain ID where contract was originally deployed\"},\"safeMint(address,string)\":{\"notice\":\"Adds a new member on home chain\"},\"setMetadata(uint256,string)\":{\"notice\":\"Updates token metadata on home chain\"},\"supportsInterface(bytes4)\":{\"notice\":\"Checks interface support\"},\"tokenURI(uint256)\":{\"notice\":\"Gets token URI\"}},\"notice\":\"Non-transferable NFT implementation for DAO membership with cross-chain capabilities\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/variants/crosschain/NFT.sol\":\"NFT\"},\"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 v5.0.0) (access/Ownable.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {Context} from \\\"../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 * The initial owner is set to the address provided by the deployer. This can\\n * 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 /**\\n * @dev The caller account is not authorized to perform an operation.\\n */\\n error OwnableUnauthorizedAccount(address account);\\n\\n /**\\n * @dev The owner is not a valid owner account. (eg. `address(0)`)\\n */\\n error OwnableInvalidOwner(address owner);\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the address provided by the deployer as the initial owner.\\n */\\n constructor(address initialOwner) {\\n if (initialOwner == address(0)) {\\n revert OwnableInvalidOwner(address(0));\\n }\\n _transferOwnership(initialOwner);\\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 if (owner() != _msgSender()) {\\n revert OwnableUnauthorizedAccount(_msgSender());\\n }\\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 if (newOwner == address(0)) {\\n revert OwnableInvalidOwner(address(0));\\n }\\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\":\"0xff6d0bb2e285473e5311d9d3caacb525ae3538a80758c10649a4d61029b017bb\",\"license\":\"MIT\"},\"@openzeppelin/contracts/governance/utils/IVotes.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (governance/utils/IVotes.sol)\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Common interface for {ERC20Votes}, {ERC721Votes}, and other {Votes}-enabled contracts.\\n */\\ninterface IVotes {\\n /**\\n * @dev The signature used has expired.\\n */\\n error VotesExpiredSignature(uint256 expiry);\\n\\n /**\\n * @dev Emitted when an account changes their delegate.\\n */\\n event DelegateChanged(address indexed delegator, address indexed fromDelegate, address indexed toDelegate);\\n\\n /**\\n * @dev Emitted when a token transfer or delegate change results in changes to a delegate's number of voting units.\\n */\\n event DelegateVotesChanged(address indexed delegate, uint256 previousVotes, uint256 newVotes);\\n\\n /**\\n * @dev Returns the current amount of votes that `account` has.\\n */\\n function getVotes(address account) external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of votes that `account` had at a specific moment in the past. If the `clock()` is\\n * configured to use block numbers, this will return the value at the end of the corresponding block.\\n */\\n function getPastVotes(address account, uint256 timepoint) external view returns (uint256);\\n\\n /**\\n * @dev Returns the total supply of votes available at a specific moment in the past. If the `clock()` is\\n * configured to use block numbers, this will return the value at the end of the corresponding block.\\n *\\n * NOTE: This value is the sum of all available votes, which is not necessarily the sum of all delegated votes.\\n * Votes that have not been delegated are still part of total supply, even though they would not participate in a\\n * vote.\\n */\\n function getPastTotalSupply(uint256 timepoint) external view returns (uint256);\\n\\n /**\\n * @dev Returns the delegate that `account` has chosen.\\n */\\n function delegates(address account) external view returns (address);\\n\\n /**\\n * @dev Delegates votes from the sender to `delegatee`.\\n */\\n function delegate(address delegatee) external;\\n\\n /**\\n * @dev Delegates votes from signer to `delegatee`.\\n */\\n function delegateBySig(address delegatee, uint256 nonce, uint256 expiry, uint8 v, bytes32 r, bytes32 s) external;\\n}\\n\",\"keccak256\":\"0x5e2b397ae88fd5c68e4f6762eb9f65f65c36702eb57796495f471d024ce70947\",\"license\":\"MIT\"},\"@openzeppelin/contracts/governance/utils/Votes.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (governance/utils/Votes.sol)\\npragma solidity ^0.8.20;\\n\\nimport {IERC5805} from \\\"../../interfaces/IERC5805.sol\\\";\\nimport {Context} from \\\"../../utils/Context.sol\\\";\\nimport {Nonces} from \\\"../../utils/Nonces.sol\\\";\\nimport {EIP712} from \\\"../../utils/cryptography/EIP712.sol\\\";\\nimport {Checkpoints} from \\\"../../utils/structs/Checkpoints.sol\\\";\\nimport {SafeCast} from \\\"../../utils/math/SafeCast.sol\\\";\\nimport {ECDSA} from \\\"../../utils/cryptography/ECDSA.sol\\\";\\nimport {Time} from \\\"../../utils/types/Time.sol\\\";\\n\\n/**\\n * @dev This is a base abstract contract that tracks voting units, which are a measure of voting power that can be\\n * transferred, and provides a system of vote delegation, where an account can delegate its voting units to a sort of\\n * \\\"representative\\\" that will pool delegated voting units from different accounts and can then use it to vote in\\n * decisions. In fact, voting units _must_ be delegated in order to count as actual votes, and an account has to\\n * delegate those votes to itself if it wishes to participate in decisions and does not have a trusted representative.\\n *\\n * This contract is often combined with a token contract such that voting units correspond to token units. For an\\n * example, see {ERC721Votes}.\\n *\\n * The full history of delegate votes is tracked on-chain so that governance protocols can consider votes as distributed\\n * at a particular block number to protect against flash loans and double voting. The opt-in delegate system makes the\\n * cost of this history tracking optional.\\n *\\n * When using this module the derived contract must implement {_getVotingUnits} (for example, make it return\\n * {ERC721-balanceOf}), and can use {_transferVotingUnits} to track a change in the distribution of those units (in the\\n * previous example, it would be included in {ERC721-_update}).\\n */\\nabstract contract Votes is Context, EIP712, Nonces, IERC5805 {\\n using Checkpoints for Checkpoints.Trace208;\\n\\n bytes32 private constant DELEGATION_TYPEHASH =\\n keccak256(\\\"Delegation(address delegatee,uint256 nonce,uint256 expiry)\\\");\\n\\n mapping(address account => address) private _delegatee;\\n\\n mapping(address delegatee => Checkpoints.Trace208) private _delegateCheckpoints;\\n\\n Checkpoints.Trace208 private _totalCheckpoints;\\n\\n /**\\n * @dev The clock was incorrectly modified.\\n */\\n error ERC6372InconsistentClock();\\n\\n /**\\n * @dev Lookup to future votes is not available.\\n */\\n error ERC5805FutureLookup(uint256 timepoint, uint48 clock);\\n\\n /**\\n * @dev Clock used for flagging checkpoints. Can be overridden to implement timestamp based\\n * checkpoints (and voting), in which case {CLOCK_MODE} should be overridden as well to match.\\n */\\n function clock() public view virtual returns (uint48) {\\n return Time.blockNumber();\\n }\\n\\n /**\\n * @dev Machine-readable description of the clock as specified in ERC-6372.\\n */\\n // solhint-disable-next-line func-name-mixedcase\\n function CLOCK_MODE() public view virtual returns (string memory) {\\n // Check that the clock was not modified\\n if (clock() != Time.blockNumber()) {\\n revert ERC6372InconsistentClock();\\n }\\n return \\\"mode=blocknumber&from=default\\\";\\n }\\n\\n /**\\n * @dev Returns the current amount of votes that `account` has.\\n */\\n function getVotes(address account) public view virtual returns (uint256) {\\n return _delegateCheckpoints[account].latest();\\n }\\n\\n /**\\n * @dev Returns the amount of votes that `account` had at a specific moment in the past. If the `clock()` is\\n * configured to use block numbers, this will return the value at the end of the corresponding block.\\n *\\n * Requirements:\\n *\\n * - `timepoint` must be in the past. If operating using block numbers, the block must be already mined.\\n */\\n function getPastVotes(address account, uint256 timepoint) public view virtual returns (uint256) {\\n uint48 currentTimepoint = clock();\\n if (timepoint >= currentTimepoint) {\\n revert ERC5805FutureLookup(timepoint, currentTimepoint);\\n }\\n return _delegateCheckpoints[account].upperLookupRecent(SafeCast.toUint48(timepoint));\\n }\\n\\n /**\\n * @dev Returns the total supply of votes available at a specific moment in the past. If the `clock()` is\\n * configured to use block numbers, this will return the value at the end of the corresponding block.\\n *\\n * NOTE: This value is the sum of all available votes, which is not necessarily the sum of all delegated votes.\\n * Votes that have not been delegated are still part of total supply, even though they would not participate in a\\n * vote.\\n *\\n * Requirements:\\n *\\n * - `timepoint` must be in the past. If operating using block numbers, the block must be already mined.\\n */\\n function getPastTotalSupply(uint256 timepoint) public view virtual returns (uint256) {\\n uint48 currentTimepoint = clock();\\n if (timepoint >= currentTimepoint) {\\n revert ERC5805FutureLookup(timepoint, currentTimepoint);\\n }\\n return _totalCheckpoints.upperLookupRecent(SafeCast.toUint48(timepoint));\\n }\\n\\n /**\\n * @dev Returns the current total supply of votes.\\n */\\n function _getTotalSupply() internal view virtual returns (uint256) {\\n return _totalCheckpoints.latest();\\n }\\n\\n /**\\n * @dev Returns the delegate that `account` has chosen.\\n */\\n function delegates(address account) public view virtual returns (address) {\\n return _delegatee[account];\\n }\\n\\n /**\\n * @dev Delegates votes from the sender to `delegatee`.\\n */\\n function delegate(address delegatee) public virtual {\\n address account = _msgSender();\\n _delegate(account, delegatee);\\n }\\n\\n /**\\n * @dev Delegates votes from signer to `delegatee`.\\n */\\n function delegateBySig(\\n address delegatee,\\n uint256 nonce,\\n uint256 expiry,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) public virtual {\\n if (block.timestamp > expiry) {\\n revert VotesExpiredSignature(expiry);\\n }\\n address signer = ECDSA.recover(\\n _hashTypedDataV4(keccak256(abi.encode(DELEGATION_TYPEHASH, delegatee, nonce, expiry))),\\n v,\\n r,\\n s\\n );\\n _useCheckedNonce(signer, nonce);\\n _delegate(signer, delegatee);\\n }\\n\\n /**\\n * @dev Delegate all of `account`'s voting units to `delegatee`.\\n *\\n * Emits events {IVotes-DelegateChanged} and {IVotes-DelegateVotesChanged}.\\n */\\n function _delegate(address account, address delegatee) internal virtual {\\n address oldDelegate = delegates(account);\\n _delegatee[account] = delegatee;\\n\\n emit DelegateChanged(account, oldDelegate, delegatee);\\n _moveDelegateVotes(oldDelegate, delegatee, _getVotingUnits(account));\\n }\\n\\n /**\\n * @dev Transfers, mints, or burns voting units. To register a mint, `from` should be zero. To register a burn, `to`\\n * should be zero. Total supply of voting units will be adjusted with mints and burns.\\n */\\n function _transferVotingUnits(address from, address to, uint256 amount) internal virtual {\\n if (from == address(0)) {\\n _push(_totalCheckpoints, _add, SafeCast.toUint208(amount));\\n }\\n if (to == address(0)) {\\n _push(_totalCheckpoints, _subtract, SafeCast.toUint208(amount));\\n }\\n _moveDelegateVotes(delegates(from), delegates(to), amount);\\n }\\n\\n /**\\n * @dev Moves delegated votes from one delegate to another.\\n */\\n function _moveDelegateVotes(address from, address to, uint256 amount) internal virtual {\\n if (from != to && amount > 0) {\\n if (from != address(0)) {\\n (uint256 oldValue, uint256 newValue) = _push(\\n _delegateCheckpoints[from],\\n _subtract,\\n SafeCast.toUint208(amount)\\n );\\n emit DelegateVotesChanged(from, oldValue, newValue);\\n }\\n if (to != address(0)) {\\n (uint256 oldValue, uint256 newValue) = _push(\\n _delegateCheckpoints[to],\\n _add,\\n SafeCast.toUint208(amount)\\n );\\n emit DelegateVotesChanged(to, oldValue, newValue);\\n }\\n }\\n }\\n\\n /**\\n * @dev Get number of checkpoints for `account`.\\n */\\n function _numCheckpoints(address account) internal view virtual returns (uint32) {\\n return SafeCast.toUint32(_delegateCheckpoints[account].length());\\n }\\n\\n /**\\n * @dev Get the `pos`-th checkpoint for `account`.\\n */\\n function _checkpoints(\\n address account,\\n uint32 pos\\n ) internal view virtual returns (Checkpoints.Checkpoint208 memory) {\\n return _delegateCheckpoints[account].at(pos);\\n }\\n\\n function _push(\\n Checkpoints.Trace208 storage store,\\n function(uint208, uint208) view returns (uint208) op,\\n uint208 delta\\n ) private returns (uint208 oldValue, uint208 newValue) {\\n return store.push(clock(), op(store.latest(), delta));\\n }\\n\\n function _add(uint208 a, uint208 b) private pure returns (uint208) {\\n return a + b;\\n }\\n\\n function _subtract(uint208 a, uint208 b) private pure returns (uint208) {\\n return a - b;\\n }\\n\\n /**\\n * @dev Must return the voting units held by an account.\\n */\\n function _getVotingUnits(address) internal view virtual returns (uint256);\\n}\\n\",\"keccak256\":\"0x9128a324d265044430e5fa4a6a2853e92d6a62a2a5a69c2fc623f5b7b8cf3f34\",\"license\":\"MIT\"},\"@openzeppelin/contracts/interfaces/IERC165.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC165.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {IERC165} from \\\"../utils/introspection/IERC165.sol\\\";\\n\",\"keccak256\":\"0xde7e9fd9aee8d4f40772f96bb3b58836cbc6dfc0227014a061947f8821ea9724\",\"license\":\"MIT\"},\"@openzeppelin/contracts/interfaces/IERC4906.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (interfaces/IERC4906.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {IERC165} from \\\"./IERC165.sol\\\";\\nimport {IERC721} from \\\"./IERC721.sol\\\";\\n\\n/// @title ERC-721 Metadata Update Extension\\ninterface IERC4906 is IERC165, IERC721 {\\n /// @dev This event emits when the metadata of a token is changed.\\n /// So that the third-party platforms such as NFT market could\\n /// timely update the images and related attributes of the NFT.\\n event MetadataUpdate(uint256 _tokenId);\\n\\n /// @dev This event emits when the metadata of a range of tokens is changed.\\n /// So that the third-party platforms such as NFT market could\\n /// timely update the images and related attributes of the NFTs.\\n event BatchMetadataUpdate(uint256 _fromTokenId, uint256 _toTokenId);\\n}\\n\",\"keccak256\":\"0x1b8691e244f6e11d987459993671db0af33e6a29f7805eac6a9925cc6b601957\",\"license\":\"MIT\"},\"@openzeppelin/contracts/interfaces/IERC5267.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC5267.sol)\\n\\npragma solidity ^0.8.20;\\n\\ninterface IERC5267 {\\n /**\\n * @dev MAY be emitted to signal that the domain could have changed.\\n */\\n event EIP712DomainChanged();\\n\\n /**\\n * @dev returns the fields and values that describe the domain separator used by this contract for EIP-712\\n * signature.\\n */\\n function eip712Domain()\\n external\\n view\\n returns (\\n bytes1 fields,\\n string memory name,\\n string memory version,\\n uint256 chainId,\\n address verifyingContract,\\n bytes32 salt,\\n uint256[] memory extensions\\n );\\n}\\n\",\"keccak256\":\"0x92aa1df62dc3d33f1656d63bede0923e0df0b706ad4137c8b10b0a8fe549fd92\",\"license\":\"MIT\"},\"@openzeppelin/contracts/interfaces/IERC5805.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC5805.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {IVotes} from \\\"../governance/utils/IVotes.sol\\\";\\nimport {IERC6372} from \\\"./IERC6372.sol\\\";\\n\\ninterface IERC5805 is IERC6372, IVotes {}\\n\",\"keccak256\":\"0x4b9b89f91adbb7d3574f85394754cfb08c5b4eafca8a7061e2094a019ab8f818\",\"license\":\"MIT\"},\"@openzeppelin/contracts/interfaces/IERC6372.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC6372.sol)\\n\\npragma solidity ^0.8.20;\\n\\ninterface IERC6372 {\\n /**\\n * @dev Clock used for flagging checkpoints. Can be overridden to implement timestamp based checkpoints (and voting).\\n */\\n function clock() external view returns (uint48);\\n\\n /**\\n * @dev Description of the clock\\n */\\n // solhint-disable-next-line func-name-mixedcase\\n function CLOCK_MODE() external view returns (string memory);\\n}\\n\",\"keccak256\":\"0xeb2857b7dafb7e0d8526dbfe794e6c047df2851c9e6ee91dc4a55f3c34af5d33\",\"license\":\"MIT\"},\"@openzeppelin/contracts/interfaces/IERC721.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC721.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {IERC721} from \\\"../token/ERC721/IERC721.sol\\\";\\n\",\"keccak256\":\"0xc4d7ebf63eb2f6bf3fee1b6c0ee775efa9f31b4843a5511d07eea147e212932d\",\"license\":\"MIT\"},\"@openzeppelin/contracts/interfaces/draft-IERC6093.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (interfaces/draft-IERC6093.sol)\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Standard ERC-20 Errors\\n * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC-20 tokens.\\n */\\ninterface IERC20Errors {\\n /**\\n * @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers.\\n * @param sender Address whose tokens are being transferred.\\n * @param balance Current balance for the interacting account.\\n * @param needed Minimum amount required to perform a transfer.\\n */\\n error ERC20InsufficientBalance(address sender, uint256 balance, uint256 needed);\\n\\n /**\\n * @dev Indicates a failure with the token `sender`. Used in transfers.\\n * @param sender Address whose tokens are being transferred.\\n */\\n error ERC20InvalidSender(address sender);\\n\\n /**\\n * @dev Indicates a failure with the token `receiver`. Used in transfers.\\n * @param receiver Address to which tokens are being transferred.\\n */\\n error ERC20InvalidReceiver(address receiver);\\n\\n /**\\n * @dev Indicates a failure with the `spender`\\u2019s `allowance`. Used in transfers.\\n * @param spender Address that may be allowed to operate on tokens without being their owner.\\n * @param allowance Amount of tokens a `spender` is allowed to operate with.\\n * @param needed Minimum amount required to perform a transfer.\\n */\\n error ERC20InsufficientAllowance(address spender, uint256 allowance, uint256 needed);\\n\\n /**\\n * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.\\n * @param approver Address initiating an approval operation.\\n */\\n error ERC20InvalidApprover(address approver);\\n\\n /**\\n * @dev Indicates a failure with the `spender` to be approved. Used in approvals.\\n * @param spender Address that may be allowed to operate on tokens without being their owner.\\n */\\n error ERC20InvalidSpender(address spender);\\n}\\n\\n/**\\n * @dev Standard ERC-721 Errors\\n * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC-721 tokens.\\n */\\ninterface IERC721Errors {\\n /**\\n * @dev Indicates that an address can't be an owner. For example, `address(0)` is a forbidden owner in ERC-20.\\n * Used in balance queries.\\n * @param owner Address of the current owner of a token.\\n */\\n error ERC721InvalidOwner(address owner);\\n\\n /**\\n * @dev Indicates a `tokenId` whose `owner` is the zero address.\\n * @param tokenId Identifier number of a token.\\n */\\n error ERC721NonexistentToken(uint256 tokenId);\\n\\n /**\\n * @dev Indicates an error related to the ownership over a particular token. Used in transfers.\\n * @param sender Address whose tokens are being transferred.\\n * @param tokenId Identifier number of a token.\\n * @param owner Address of the current owner of a token.\\n */\\n error ERC721IncorrectOwner(address sender, uint256 tokenId, address owner);\\n\\n /**\\n * @dev Indicates a failure with the token `sender`. Used in transfers.\\n * @param sender Address whose tokens are being transferred.\\n */\\n error ERC721InvalidSender(address sender);\\n\\n /**\\n * @dev Indicates a failure with the token `receiver`. Used in transfers.\\n * @param receiver Address to which tokens are being transferred.\\n */\\n error ERC721InvalidReceiver(address receiver);\\n\\n /**\\n * @dev Indicates a failure with the `operator`\\u2019s approval. Used in transfers.\\n * @param operator Address that may be allowed to operate on tokens without being their owner.\\n * @param tokenId Identifier number of a token.\\n */\\n error ERC721InsufficientApproval(address operator, uint256 tokenId);\\n\\n /**\\n * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.\\n * @param approver Address initiating an approval operation.\\n */\\n error ERC721InvalidApprover(address approver);\\n\\n /**\\n * @dev Indicates a failure with the `operator` to be approved. Used in approvals.\\n * @param operator Address that may be allowed to operate on tokens without being their owner.\\n */\\n error ERC721InvalidOperator(address operator);\\n}\\n\\n/**\\n * @dev Standard ERC-1155 Errors\\n * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC-1155 tokens.\\n */\\ninterface IERC1155Errors {\\n /**\\n * @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers.\\n * @param sender Address whose tokens are being transferred.\\n * @param balance Current balance for the interacting account.\\n * @param needed Minimum amount required to perform a transfer.\\n * @param tokenId Identifier number of a token.\\n */\\n error ERC1155InsufficientBalance(address sender, uint256 balance, uint256 needed, uint256 tokenId);\\n\\n /**\\n * @dev Indicates a failure with the token `sender`. Used in transfers.\\n * @param sender Address whose tokens are being transferred.\\n */\\n error ERC1155InvalidSender(address sender);\\n\\n /**\\n * @dev Indicates a failure with the token `receiver`. Used in transfers.\\n * @param receiver Address to which tokens are being transferred.\\n */\\n error ERC1155InvalidReceiver(address receiver);\\n\\n /**\\n * @dev Indicates a failure with the `operator`\\u2019s approval. Used in transfers.\\n * @param operator Address that may be allowed to operate on tokens without being their owner.\\n * @param owner Address of the current owner of a token.\\n */\\n error ERC1155MissingApprovalForAll(address operator, address owner);\\n\\n /**\\n * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.\\n * @param approver Address initiating an approval operation.\\n */\\n error ERC1155InvalidApprover(address approver);\\n\\n /**\\n * @dev Indicates a failure with the `operator` to be approved. Used in approvals.\\n * @param operator Address that may be allowed to operate on tokens without being their owner.\\n */\\n error ERC1155InvalidOperator(address operator);\\n\\n /**\\n * @dev Indicates an array length mismatch between ids and values in a safeBatchTransferFrom operation.\\n * Used in batch transfers.\\n * @param idsLength Length of the array of token identifiers\\n * @param valuesLength Length of the array of token amounts\\n */\\n error ERC1155InvalidArrayLength(uint256 idsLength, uint256 valuesLength);\\n}\\n\",\"keccak256\":\"0x880da465c203cec76b10d72dbd87c80f387df4102274f23eea1f9c9b0918792b\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC721/ERC721.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC721/ERC721.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {IERC721} from \\\"./IERC721.sol\\\";\\nimport {IERC721Metadata} from \\\"./extensions/IERC721Metadata.sol\\\";\\nimport {ERC721Utils} from \\\"./utils/ERC721Utils.sol\\\";\\nimport {Context} from \\\"../../utils/Context.sol\\\";\\nimport {Strings} from \\\"../../utils/Strings.sol\\\";\\nimport {IERC165, ERC165} from \\\"../../utils/introspection/ERC165.sol\\\";\\nimport {IERC721Errors} from \\\"../../interfaces/draft-IERC6093.sol\\\";\\n\\n/**\\n * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC-721] Non-Fungible Token Standard, including\\n * the Metadata extension, but not including the Enumerable extension, which is available separately as\\n * {ERC721Enumerable}.\\n */\\nabstract contract ERC721 is Context, ERC165, IERC721, IERC721Metadata, IERC721Errors {\\n using Strings for uint256;\\n\\n // Token name\\n string private _name;\\n\\n // Token symbol\\n string private _symbol;\\n\\n mapping(uint256 tokenId => address) private _owners;\\n\\n mapping(address owner => uint256) private _balances;\\n\\n mapping(uint256 tokenId => address) private _tokenApprovals;\\n\\n mapping(address owner => mapping(address operator => bool)) private _operatorApprovals;\\n\\n /**\\n * @dev Initializes the contract by setting a `name` and a `symbol` to the token collection.\\n */\\n constructor(string memory name_, string memory symbol_) {\\n _name = name_;\\n _symbol = symbol_;\\n }\\n\\n /**\\n * @dev See {IERC165-supportsInterface}.\\n */\\n function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {\\n return\\n interfaceId == type(IERC721).interfaceId ||\\n interfaceId == type(IERC721Metadata).interfaceId ||\\n super.supportsInterface(interfaceId);\\n }\\n\\n /**\\n * @dev See {IERC721-balanceOf}.\\n */\\n function balanceOf(address owner) public view virtual returns (uint256) {\\n if (owner == address(0)) {\\n revert ERC721InvalidOwner(address(0));\\n }\\n return _balances[owner];\\n }\\n\\n /**\\n * @dev See {IERC721-ownerOf}.\\n */\\n function ownerOf(uint256 tokenId) public view virtual returns (address) {\\n return _requireOwned(tokenId);\\n }\\n\\n /**\\n * @dev See {IERC721Metadata-name}.\\n */\\n function name() public view virtual returns (string memory) {\\n return _name;\\n }\\n\\n /**\\n * @dev See {IERC721Metadata-symbol}.\\n */\\n function symbol() public view virtual returns (string memory) {\\n return _symbol;\\n }\\n\\n /**\\n * @dev See {IERC721Metadata-tokenURI}.\\n */\\n function tokenURI(uint256 tokenId) public view virtual returns (string memory) {\\n _requireOwned(tokenId);\\n\\n string memory baseURI = _baseURI();\\n return bytes(baseURI).length > 0 ? string.concat(baseURI, tokenId.toString()) : \\\"\\\";\\n }\\n\\n /**\\n * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each\\n * token will be the concatenation of the `baseURI` and the `tokenId`. Empty\\n * by default, can be overridden in child contracts.\\n */\\n function _baseURI() internal view virtual returns (string memory) {\\n return \\\"\\\";\\n }\\n\\n /**\\n * @dev See {IERC721-approve}.\\n */\\n function approve(address to, uint256 tokenId) public virtual {\\n _approve(to, tokenId, _msgSender());\\n }\\n\\n /**\\n * @dev See {IERC721-getApproved}.\\n */\\n function getApproved(uint256 tokenId) public view virtual returns (address) {\\n _requireOwned(tokenId);\\n\\n return _getApproved(tokenId);\\n }\\n\\n /**\\n * @dev See {IERC721-setApprovalForAll}.\\n */\\n function setApprovalForAll(address operator, bool approved) public virtual {\\n _setApprovalForAll(_msgSender(), operator, approved);\\n }\\n\\n /**\\n * @dev See {IERC721-isApprovedForAll}.\\n */\\n function isApprovedForAll(address owner, address operator) public view virtual returns (bool) {\\n return _operatorApprovals[owner][operator];\\n }\\n\\n /**\\n * @dev See {IERC721-transferFrom}.\\n */\\n function transferFrom(address from, address to, uint256 tokenId) public virtual {\\n if (to == address(0)) {\\n revert ERC721InvalidReceiver(address(0));\\n }\\n // Setting an \\\"auth\\\" arguments enables the `_isAuthorized` check which verifies that the token exists\\n // (from != 0). Therefore, it is not needed to verify that the return value is not 0 here.\\n address previousOwner = _update(to, tokenId, _msgSender());\\n if (previousOwner != from) {\\n revert ERC721IncorrectOwner(from, tokenId, previousOwner);\\n }\\n }\\n\\n /**\\n * @dev See {IERC721-safeTransferFrom}.\\n */\\n function safeTransferFrom(address from, address to, uint256 tokenId) public {\\n safeTransferFrom(from, to, tokenId, \\\"\\\");\\n }\\n\\n /**\\n * @dev See {IERC721-safeTransferFrom}.\\n */\\n function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory data) public virtual {\\n transferFrom(from, to, tokenId);\\n ERC721Utils.checkOnERC721Received(_msgSender(), from, to, tokenId, data);\\n }\\n\\n /**\\n * @dev Returns the owner of the `tokenId`. Does NOT revert if token doesn't exist\\n *\\n * IMPORTANT: Any overrides to this function that add ownership of tokens not tracked by the\\n * core ERC-721 logic MUST be matched with the use of {_increaseBalance} to keep balances\\n * consistent with ownership. The invariant to preserve is that for any address `a` the value returned by\\n * `balanceOf(a)` must be equal to the number of tokens such that `_ownerOf(tokenId)` is `a`.\\n */\\n function _ownerOf(uint256 tokenId) internal view virtual returns (address) {\\n return _owners[tokenId];\\n }\\n\\n /**\\n * @dev Returns the approved address for `tokenId`. Returns 0 if `tokenId` is not minted.\\n */\\n function _getApproved(uint256 tokenId) internal view virtual returns (address) {\\n return _tokenApprovals[tokenId];\\n }\\n\\n /**\\n * @dev Returns whether `spender` is allowed to manage `owner`'s tokens, or `tokenId` in\\n * particular (ignoring whether it is owned by `owner`).\\n *\\n * WARNING: This function assumes that `owner` is the actual owner of `tokenId` and does not verify this\\n * assumption.\\n */\\n function _isAuthorized(address owner, address spender, uint256 tokenId) internal view virtual returns (bool) {\\n return\\n spender != address(0) &&\\n (owner == spender || isApprovedForAll(owner, spender) || _getApproved(tokenId) == spender);\\n }\\n\\n /**\\n * @dev Checks if `spender` can operate on `tokenId`, assuming the provided `owner` is the actual owner.\\n * Reverts if:\\n * - `spender` does not have approval from `owner` for `tokenId`.\\n * - `spender` does not have approval to manage all of `owner`'s assets.\\n *\\n * WARNING: This function assumes that `owner` is the actual owner of `tokenId` and does not verify this\\n * assumption.\\n */\\n function _checkAuthorized(address owner, address spender, uint256 tokenId) internal view virtual {\\n if (!_isAuthorized(owner, spender, tokenId)) {\\n if (owner == address(0)) {\\n revert ERC721NonexistentToken(tokenId);\\n } else {\\n revert ERC721InsufficientApproval(spender, tokenId);\\n }\\n }\\n }\\n\\n /**\\n * @dev Unsafe write access to the balances, used by extensions that \\\"mint\\\" tokens using an {ownerOf} override.\\n *\\n * NOTE: the value is limited to type(uint128).max. This protect against _balance overflow. It is unrealistic that\\n * a uint256 would ever overflow from increments when these increments are bounded to uint128 values.\\n *\\n * WARNING: Increasing an account's balance using this function tends to be paired with an override of the\\n * {_ownerOf} function to resolve the ownership of the corresponding tokens so that balances and ownership\\n * remain consistent with one another.\\n */\\n function _increaseBalance(address account, uint128 value) internal virtual {\\n unchecked {\\n _balances[account] += value;\\n }\\n }\\n\\n /**\\n * @dev Transfers `tokenId` from its current owner to `to`, or alternatively mints (or burns) if the current owner\\n * (or `to`) is the zero address. Returns the owner of the `tokenId` before the update.\\n *\\n * The `auth` argument is optional. If the value passed is non 0, then this function will check that\\n * `auth` is either the owner of the token, or approved to operate on the token (by the owner).\\n *\\n * Emits a {Transfer} event.\\n *\\n * NOTE: If overriding this function in a way that tracks balances, see also {_increaseBalance}.\\n */\\n function _update(address to, uint256 tokenId, address auth) internal virtual returns (address) {\\n address from = _ownerOf(tokenId);\\n\\n // Perform (optional) operator check\\n if (auth != address(0)) {\\n _checkAuthorized(from, auth, tokenId);\\n }\\n\\n // Execute the update\\n if (from != address(0)) {\\n // Clear approval. No need to re-authorize or emit the Approval event\\n _approve(address(0), tokenId, address(0), false);\\n\\n unchecked {\\n _balances[from] -= 1;\\n }\\n }\\n\\n if (to != address(0)) {\\n unchecked {\\n _balances[to] += 1;\\n }\\n }\\n\\n _owners[tokenId] = to;\\n\\n emit Transfer(from, to, tokenId);\\n\\n return from;\\n }\\n\\n /**\\n * @dev Mints `tokenId` and transfers it to `to`.\\n *\\n * WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible\\n *\\n * Requirements:\\n *\\n * - `tokenId` must not exist.\\n * - `to` cannot be the zero address.\\n *\\n * Emits a {Transfer} event.\\n */\\n function _mint(address to, uint256 tokenId) internal {\\n if (to == address(0)) {\\n revert ERC721InvalidReceiver(address(0));\\n }\\n address previousOwner = _update(to, tokenId, address(0));\\n if (previousOwner != address(0)) {\\n revert ERC721InvalidSender(address(0));\\n }\\n }\\n\\n /**\\n * @dev Mints `tokenId`, transfers it to `to` and checks for `to` acceptance.\\n *\\n * Requirements:\\n *\\n * - `tokenId` must not exist.\\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\\n *\\n * Emits a {Transfer} event.\\n */\\n function _safeMint(address to, uint256 tokenId) internal {\\n _safeMint(to, tokenId, \\\"\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is\\n * forwarded in {IERC721Receiver-onERC721Received} to contract recipients.\\n */\\n function _safeMint(address to, uint256 tokenId, bytes memory data) internal virtual {\\n _mint(to, tokenId);\\n ERC721Utils.checkOnERC721Received(_msgSender(), address(0), to, tokenId, data);\\n }\\n\\n /**\\n * @dev Destroys `tokenId`.\\n * The approval is cleared when the token is burned.\\n * This is an internal function that does not check if the sender is authorized to operate on the token.\\n *\\n * Requirements:\\n *\\n * - `tokenId` must exist.\\n *\\n * Emits a {Transfer} event.\\n */\\n function _burn(uint256 tokenId) internal {\\n address previousOwner = _update(address(0), tokenId, address(0));\\n if (previousOwner == address(0)) {\\n revert ERC721NonexistentToken(tokenId);\\n }\\n }\\n\\n /**\\n * @dev Transfers `tokenId` from `from` to `to`.\\n * As opposed to {transferFrom}, this imposes no restrictions on msg.sender.\\n *\\n * Requirements:\\n *\\n * - `to` cannot be the zero address.\\n * - `tokenId` token must be owned by `from`.\\n *\\n * Emits a {Transfer} event.\\n */\\n function _transfer(address from, address to, uint256 tokenId) internal {\\n if (to == address(0)) {\\n revert ERC721InvalidReceiver(address(0));\\n }\\n address previousOwner = _update(to, tokenId, address(0));\\n if (previousOwner == address(0)) {\\n revert ERC721NonexistentToken(tokenId);\\n } else if (previousOwner != from) {\\n revert ERC721IncorrectOwner(from, tokenId, previousOwner);\\n }\\n }\\n\\n /**\\n * @dev Safely transfers `tokenId` token from `from` to `to`, checking that contract recipients\\n * are aware of the ERC-721 standard to prevent tokens from being forever locked.\\n *\\n * `data` is additional data, it has no specified format and it is sent in call to `to`.\\n *\\n * This internal function is like {safeTransferFrom} in the sense that it invokes\\n * {IERC721Receiver-onERC721Received} on the receiver, and can be used to e.g.\\n * implement alternative mechanisms to perform token transfer, such as signature-based.\\n *\\n * Requirements:\\n *\\n * - `tokenId` token must exist and be owned by `from`.\\n * - `to` cannot be the zero address.\\n * - `from` cannot be the zero address.\\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\\n *\\n * Emits a {Transfer} event.\\n */\\n function _safeTransfer(address from, address to, uint256 tokenId) internal {\\n _safeTransfer(from, to, tokenId, \\\"\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-ERC721-_safeTransfer-address-address-uint256-}[`_safeTransfer`], with an additional `data` parameter which is\\n * forwarded in {IERC721Receiver-onERC721Received} to contract recipients.\\n */\\n function _safeTransfer(address from, address to, uint256 tokenId, bytes memory data) internal virtual {\\n _transfer(from, to, tokenId);\\n ERC721Utils.checkOnERC721Received(_msgSender(), from, to, tokenId, data);\\n }\\n\\n /**\\n * @dev Approve `to` to operate on `tokenId`\\n *\\n * The `auth` argument is optional. If the value passed is non 0, then this function will check that `auth` is\\n * either the owner of the token, or approved to operate on all tokens held by this owner.\\n *\\n * Emits an {Approval} event.\\n *\\n * Overrides to this logic should be done to the variant with an additional `bool emitEvent` argument.\\n */\\n function _approve(address to, uint256 tokenId, address auth) internal {\\n _approve(to, tokenId, auth, true);\\n }\\n\\n /**\\n * @dev Variant of `_approve` with an optional flag to enable or disable the {Approval} event. The event is not\\n * emitted in the context of transfers.\\n */\\n function _approve(address to, uint256 tokenId, address auth, bool emitEvent) internal virtual {\\n // Avoid reading the owner unless necessary\\n if (emitEvent || auth != address(0)) {\\n address owner = _requireOwned(tokenId);\\n\\n // We do not use _isAuthorized because single-token approvals should not be able to call approve\\n if (auth != address(0) && owner != auth && !isApprovedForAll(owner, auth)) {\\n revert ERC721InvalidApprover(auth);\\n }\\n\\n if (emitEvent) {\\n emit Approval(owner, to, tokenId);\\n }\\n }\\n\\n _tokenApprovals[tokenId] = to;\\n }\\n\\n /**\\n * @dev Approve `operator` to operate on all of `owner` tokens\\n *\\n * Requirements:\\n * - operator can't be the address zero.\\n *\\n * Emits an {ApprovalForAll} event.\\n */\\n function _setApprovalForAll(address owner, address operator, bool approved) internal virtual {\\n if (operator == address(0)) {\\n revert ERC721InvalidOperator(operator);\\n }\\n _operatorApprovals[owner][operator] = approved;\\n emit ApprovalForAll(owner, operator, approved);\\n }\\n\\n /**\\n * @dev Reverts if the `tokenId` doesn't have a current owner (it hasn't been minted, or it has been burned).\\n * Returns the owner.\\n *\\n * Overrides to ownership logic should be done to {_ownerOf}.\\n */\\n function _requireOwned(uint256 tokenId) internal view returns (address) {\\n address owner = _ownerOf(tokenId);\\n if (owner == address(0)) {\\n revert ERC721NonexistentToken(tokenId);\\n }\\n return owner;\\n }\\n}\\n\",\"keccak256\":\"0x39ed367e54765186281efcfe83e47cf0ad62cc879f10e191360712507125f29a\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC721/IERC721.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC721/IERC721.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {IERC165} from \\\"../../utils/introspection/IERC165.sol\\\";\\n\\n/**\\n * @dev Required interface of an ERC-721 compliant contract.\\n */\\ninterface IERC721 is IERC165 {\\n /**\\n * @dev Emitted when `tokenId` token is transferred from `from` to `to`.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);\\n\\n /**\\n * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.\\n */\\n event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);\\n\\n /**\\n * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.\\n */\\n event ApprovalForAll(address indexed owner, address indexed operator, bool approved);\\n\\n /**\\n * @dev Returns the number of tokens in ``owner``'s account.\\n */\\n function balanceOf(address owner) external view returns (uint256 balance);\\n\\n /**\\n * @dev Returns the owner of the `tokenId` token.\\n *\\n * Requirements:\\n *\\n * - `tokenId` must exist.\\n */\\n function ownerOf(uint256 tokenId) external view returns (address owner);\\n\\n /**\\n * @dev Safely transfers `tokenId` token from `from` to `to`.\\n *\\n * Requirements:\\n *\\n * - `from` cannot be the zero address.\\n * - `to` cannot be the zero address.\\n * - `tokenId` token must exist and be owned by `from`.\\n * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.\\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon\\n * a safe transfer.\\n *\\n * Emits a {Transfer} event.\\n */\\n function safeTransferFrom(address from, address to, uint256 tokenId, bytes calldata data) external;\\n\\n /**\\n * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients\\n * are aware of the ERC-721 protocol to prevent tokens from being forever locked.\\n *\\n * Requirements:\\n *\\n * - `from` cannot be the zero address.\\n * - `to` cannot be the zero address.\\n * - `tokenId` token must exist and be owned by `from`.\\n * - If the caller is not `from`, it must have been allowed to move this token by either {approve} or\\n * {setApprovalForAll}.\\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon\\n * a safe transfer.\\n *\\n * Emits a {Transfer} event.\\n */\\n function safeTransferFrom(address from, address to, uint256 tokenId) external;\\n\\n /**\\n * @dev Transfers `tokenId` token from `from` to `to`.\\n *\\n * WARNING: Note that the caller is responsible to confirm that the recipient is capable of receiving ERC-721\\n * or else they may be permanently lost. Usage of {safeTransferFrom} prevents loss, though the caller must\\n * understand this adds an external call which potentially creates a reentrancy vulnerability.\\n *\\n * Requirements:\\n *\\n * - `from` cannot be the zero address.\\n * - `to` cannot be the zero address.\\n * - `tokenId` token must be owned by `from`.\\n * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(address from, address to, uint256 tokenId) external;\\n\\n /**\\n * @dev Gives permission to `to` to transfer `tokenId` token to another account.\\n * The approval is cleared when the token is transferred.\\n *\\n * Only a single account can be approved at a time, so approving the zero address clears previous approvals.\\n *\\n * Requirements:\\n *\\n * - The caller must own the token or be an approved operator.\\n * - `tokenId` must exist.\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address to, uint256 tokenId) external;\\n\\n /**\\n * @dev Approve or remove `operator` as an operator for the caller.\\n * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.\\n *\\n * Requirements:\\n *\\n * - The `operator` cannot be the address zero.\\n *\\n * Emits an {ApprovalForAll} event.\\n */\\n function setApprovalForAll(address operator, bool approved) external;\\n\\n /**\\n * @dev Returns the account approved for `tokenId` token.\\n *\\n * Requirements:\\n *\\n * - `tokenId` must exist.\\n */\\n function getApproved(uint256 tokenId) external view returns (address operator);\\n\\n /**\\n * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.\\n *\\n * See {setApprovalForAll}\\n */\\n function isApprovedForAll(address owner, address operator) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x5dc63d1c6a12fe1b17793e1745877b2fcbe1964c3edfd0a482fac21ca8f18261\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC721/IERC721Receiver.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @title ERC-721 token receiver interface\\n * @dev Interface for any contract that wants to support safeTransfers\\n * from ERC-721 asset contracts.\\n */\\ninterface IERC721Receiver {\\n /**\\n * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom}\\n * by `operator` from `from`, this function is called.\\n *\\n * It must return its Solidity selector to confirm the token transfer.\\n * If any other value is returned or the interface is not implemented by the recipient, the transfer will be\\n * reverted.\\n *\\n * The selector can be obtained in Solidity with `IERC721Receiver.onERC721Received.selector`.\\n */\\n function onERC721Received(\\n address operator,\\n address from,\\n uint256 tokenId,\\n bytes calldata data\\n ) external returns (bytes4);\\n}\\n\",\"keccak256\":\"0xb5afb8e8eebc4d1c6404df2f5e1e6d2c3d24fd01e5dfc855314951ecfaae462d\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC721/extensions/ERC721Burnable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC721/extensions/ERC721Burnable.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {ERC721} from \\\"../ERC721.sol\\\";\\nimport {Context} from \\\"../../../utils/Context.sol\\\";\\n\\n/**\\n * @title ERC-721 Burnable Token\\n * @dev ERC-721 Token that can be burned (destroyed).\\n */\\nabstract contract ERC721Burnable is Context, ERC721 {\\n /**\\n * @dev Burns `tokenId`. See {ERC721-_burn}.\\n *\\n * Requirements:\\n *\\n * - The caller must own `tokenId` or be an approved operator.\\n */\\n function burn(uint256 tokenId) public virtual {\\n // Setting an \\\"auth\\\" arguments enables the `_isAuthorized` check which verifies that the token exists\\n // (from != 0). Therefore, it is not needed to verify that the return value is not 0 here.\\n _update(address(0), tokenId, _msgSender());\\n }\\n}\\n\",\"keccak256\":\"0xdee1ff07172e443c6600581fc4f11e7830a6d33e4e551752935b835d52a09404\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC721/extensions/ERC721Enumerable.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {ERC721} from \\\"../ERC721.sol\\\";\\nimport {IERC721Enumerable} from \\\"./IERC721Enumerable.sol\\\";\\nimport {IERC165} from \\\"../../../utils/introspection/ERC165.sol\\\";\\n\\n/**\\n * @dev This implements an optional extension of {ERC721} defined in the ERC that adds enumerability\\n * of all the token ids in the contract as well as all token ids owned by each account.\\n *\\n * CAUTION: {ERC721} extensions that implement custom `balanceOf` logic, such as {ERC721Consecutive},\\n * interfere with enumerability and should not be used together with {ERC721Enumerable}.\\n */\\nabstract contract ERC721Enumerable is ERC721, IERC721Enumerable {\\n mapping(address owner => mapping(uint256 index => uint256)) private _ownedTokens;\\n mapping(uint256 tokenId => uint256) private _ownedTokensIndex;\\n\\n uint256[] private _allTokens;\\n mapping(uint256 tokenId => uint256) private _allTokensIndex;\\n\\n /**\\n * @dev An `owner`'s token query was out of bounds for `index`.\\n *\\n * NOTE: The owner being `address(0)` indicates a global out of bounds index.\\n */\\n error ERC721OutOfBoundsIndex(address owner, uint256 index);\\n\\n /**\\n * @dev Batch mint is not allowed.\\n */\\n error ERC721EnumerableForbiddenBatchMint();\\n\\n /**\\n * @dev See {IERC165-supportsInterface}.\\n */\\n function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165, ERC721) returns (bool) {\\n return interfaceId == type(IERC721Enumerable).interfaceId || super.supportsInterface(interfaceId);\\n }\\n\\n /**\\n * @dev See {IERC721Enumerable-tokenOfOwnerByIndex}.\\n */\\n function tokenOfOwnerByIndex(address owner, uint256 index) public view virtual returns (uint256) {\\n if (index >= balanceOf(owner)) {\\n revert ERC721OutOfBoundsIndex(owner, index);\\n }\\n return _ownedTokens[owner][index];\\n }\\n\\n /**\\n * @dev See {IERC721Enumerable-totalSupply}.\\n */\\n function totalSupply() public view virtual returns (uint256) {\\n return _allTokens.length;\\n }\\n\\n /**\\n * @dev See {IERC721Enumerable-tokenByIndex}.\\n */\\n function tokenByIndex(uint256 index) public view virtual returns (uint256) {\\n if (index >= totalSupply()) {\\n revert ERC721OutOfBoundsIndex(address(0), index);\\n }\\n return _allTokens[index];\\n }\\n\\n /**\\n * @dev See {ERC721-_update}.\\n */\\n function _update(address to, uint256 tokenId, address auth) internal virtual override returns (address) {\\n address previousOwner = super._update(to, tokenId, auth);\\n\\n if (previousOwner == address(0)) {\\n _addTokenToAllTokensEnumeration(tokenId);\\n } else if (previousOwner != to) {\\n _removeTokenFromOwnerEnumeration(previousOwner, tokenId);\\n }\\n if (to == address(0)) {\\n _removeTokenFromAllTokensEnumeration(tokenId);\\n } else if (previousOwner != to) {\\n _addTokenToOwnerEnumeration(to, tokenId);\\n }\\n\\n return previousOwner;\\n }\\n\\n /**\\n * @dev Private function to add a token to this extension's ownership-tracking data structures.\\n * @param to address representing the new owner of the given token ID\\n * @param tokenId uint256 ID of the token to be added to the tokens list of the given address\\n */\\n function _addTokenToOwnerEnumeration(address to, uint256 tokenId) private {\\n uint256 length = balanceOf(to) - 1;\\n _ownedTokens[to][length] = tokenId;\\n _ownedTokensIndex[tokenId] = length;\\n }\\n\\n /**\\n * @dev Private function to add a token to this extension's token tracking data structures.\\n * @param tokenId uint256 ID of the token to be added to the tokens list\\n */\\n function _addTokenToAllTokensEnumeration(uint256 tokenId) private {\\n _allTokensIndex[tokenId] = _allTokens.length;\\n _allTokens.push(tokenId);\\n }\\n\\n /**\\n * @dev Private function to remove a token from this extension's ownership-tracking data structures. Note that\\n * while the token is not assigned a new owner, the `_ownedTokensIndex` mapping is _not_ updated: this allows for\\n * gas optimizations e.g. when performing a transfer operation (avoiding double writes).\\n * This has O(1) time complexity, but alters the order of the _ownedTokens array.\\n * @param from address representing the previous owner of the given token ID\\n * @param tokenId uint256 ID of the token to be removed from the tokens list of the given address\\n */\\n function _removeTokenFromOwnerEnumeration(address from, uint256 tokenId) private {\\n // To prevent a gap in from's tokens array, we store the last token in the index of the token to delete, and\\n // then delete the last slot (swap and pop).\\n\\n uint256 lastTokenIndex = balanceOf(from);\\n uint256 tokenIndex = _ownedTokensIndex[tokenId];\\n\\n mapping(uint256 index => uint256) storage _ownedTokensByOwner = _ownedTokens[from];\\n\\n // When the token to delete is the last token, the swap operation is unnecessary\\n if (tokenIndex != lastTokenIndex) {\\n uint256 lastTokenId = _ownedTokensByOwner[lastTokenIndex];\\n\\n _ownedTokensByOwner[tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token\\n _ownedTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index\\n }\\n\\n // This also deletes the contents at the last position of the array\\n delete _ownedTokensIndex[tokenId];\\n delete _ownedTokensByOwner[lastTokenIndex];\\n }\\n\\n /**\\n * @dev Private function to remove a token from this extension's token tracking data structures.\\n * This has O(1) time complexity, but alters the order of the _allTokens array.\\n * @param tokenId uint256 ID of the token to be removed from the tokens list\\n */\\n function _removeTokenFromAllTokensEnumeration(uint256 tokenId) private {\\n // To prevent a gap in the tokens array, we store the last token in the index of the token to delete, and\\n // then delete the last slot (swap and pop).\\n\\n uint256 lastTokenIndex = _allTokens.length - 1;\\n uint256 tokenIndex = _allTokensIndex[tokenId];\\n\\n // When the token to delete is the last token, the swap operation is unnecessary. However, since this occurs so\\n // rarely (when the last minted token is burnt) that we still do the swap here to avoid the gas cost of adding\\n // an 'if' statement (like in _removeTokenFromOwnerEnumeration)\\n uint256 lastTokenId = _allTokens[lastTokenIndex];\\n\\n _allTokens[tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token\\n _allTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index\\n\\n // This also deletes the contents at the last position of the array\\n delete _allTokensIndex[tokenId];\\n _allTokens.pop();\\n }\\n\\n /**\\n * See {ERC721-_increaseBalance}. We need that to account tokens that were minted in batch\\n */\\n function _increaseBalance(address account, uint128 amount) internal virtual override {\\n if (amount > 0) {\\n revert ERC721EnumerableForbiddenBatchMint();\\n }\\n super._increaseBalance(account, amount);\\n }\\n}\\n\",\"keccak256\":\"0x5191f783af281c75b7de0f1e3e36cdc6ac5cb2358d929584c4953fd02fa2b5eb\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC721/extensions/ERC721URIStorage.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {ERC721} from \\\"../ERC721.sol\\\";\\nimport {Strings} from \\\"../../../utils/Strings.sol\\\";\\nimport {IERC4906} from \\\"../../../interfaces/IERC4906.sol\\\";\\nimport {IERC165} from \\\"../../../interfaces/IERC165.sol\\\";\\n\\n/**\\n * @dev ERC-721 token with storage based token URI management.\\n */\\nabstract contract ERC721URIStorage is IERC4906, ERC721 {\\n using Strings for uint256;\\n\\n // Interface ID as defined in ERC-4906. This does not correspond to a traditional interface ID as ERC-4906 only\\n // defines events and does not include any external function.\\n bytes4 private constant ERC4906_INTERFACE_ID = bytes4(0x49064906);\\n\\n // Optional mapping for token URIs\\n mapping(uint256 tokenId => string) private _tokenURIs;\\n\\n /**\\n * @dev See {IERC165-supportsInterface}\\n */\\n function supportsInterface(bytes4 interfaceId) public view virtual override(ERC721, IERC165) returns (bool) {\\n return interfaceId == ERC4906_INTERFACE_ID || super.supportsInterface(interfaceId);\\n }\\n\\n /**\\n * @dev See {IERC721Metadata-tokenURI}.\\n */\\n function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {\\n _requireOwned(tokenId);\\n\\n string memory _tokenURI = _tokenURIs[tokenId];\\n string memory base = _baseURI();\\n\\n // If there is no base URI, return the token URI.\\n if (bytes(base).length == 0) {\\n return _tokenURI;\\n }\\n // If both are set, concatenate the baseURI and tokenURI (via string.concat).\\n if (bytes(_tokenURI).length > 0) {\\n return string.concat(base, _tokenURI);\\n }\\n\\n return super.tokenURI(tokenId);\\n }\\n\\n /**\\n * @dev Sets `_tokenURI` as the tokenURI of `tokenId`.\\n *\\n * Emits {MetadataUpdate}.\\n */\\n function _setTokenURI(uint256 tokenId, string memory _tokenURI) internal virtual {\\n _tokenURIs[tokenId] = _tokenURI;\\n emit MetadataUpdate(tokenId);\\n }\\n}\\n\",\"keccak256\":\"0xe52813067c6d5838eeb34e1da8beb2514371a7d778266013b04ca3be1dda7100\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC721/extensions/ERC721Votes.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC721/extensions/ERC721Votes.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {ERC721} from \\\"../ERC721.sol\\\";\\nimport {Votes} from \\\"../../../governance/utils/Votes.sol\\\";\\n\\n/**\\n * @dev Extension of ERC-721 to support voting and delegation as implemented by {Votes}, where each individual NFT counts\\n * as 1 vote unit.\\n *\\n * Tokens do not count as votes until they are delegated, because votes must be tracked which incurs an additional cost\\n * on every transfer. Token holders can either delegate to a trusted representative who will decide how to make use of\\n * the votes in governance decisions, or they can delegate to themselves to be their own representative.\\n */\\nabstract contract ERC721Votes is ERC721, Votes {\\n /**\\n * @dev See {ERC721-_update}. Adjusts votes when tokens are transferred.\\n *\\n * Emits a {IVotes-DelegateVotesChanged} event.\\n */\\n function _update(address to, uint256 tokenId, address auth) internal virtual override returns (address) {\\n address previousOwner = super._update(to, tokenId, auth);\\n\\n _transferVotingUnits(previousOwner, to, 1);\\n\\n return previousOwner;\\n }\\n\\n /**\\n * @dev Returns the balance of `account`.\\n *\\n * WARNING: Overriding this function will likely result in incorrect vote tracking.\\n */\\n function _getVotingUnits(address account) internal view virtual override returns (uint256) {\\n return balanceOf(account);\\n }\\n\\n /**\\n * @dev See {ERC721-_increaseBalance}. We need that to account tokens that were minted in batch.\\n */\\n function _increaseBalance(address account, uint128 amount) internal virtual override {\\n super._increaseBalance(account, amount);\\n _transferVotingUnits(address(0), account, amount);\\n }\\n}\\n\",\"keccak256\":\"0x8b245d62f3ce9596d3a52c7b6c738cd95a40fe8dba898e90fcce18bb7a2d8239\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC721/extensions/IERC721Enumerable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC721/extensions/IERC721Enumerable.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {IERC721} from \\\"../IERC721.sol\\\";\\n\\n/**\\n * @title ERC-721 Non-Fungible Token Standard, optional enumeration extension\\n * @dev See https://eips.ethereum.org/EIPS/eip-721\\n */\\ninterface IERC721Enumerable is IERC721 {\\n /**\\n * @dev Returns the total amount of tokens stored by the contract.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns a token ID owned by `owner` at a given `index` of its token list.\\n * Use along with {balanceOf} to enumerate all of ``owner``'s tokens.\\n */\\n function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256);\\n\\n /**\\n * @dev Returns a token ID at a given `index` of all the tokens stored by the contract.\\n * Use along with {totalSupply} to enumerate all tokens.\\n */\\n function tokenByIndex(uint256 index) external view returns (uint256);\\n}\\n\",\"keccak256\":\"0x3d6954a93ac198a2ffa384fa58ccf18e7e235263e051a394328002eff4e073de\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC721/extensions/IERC721Metadata.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {IERC721} from \\\"../IERC721.sol\\\";\\n\\n/**\\n * @title ERC-721 Non-Fungible Token Standard, optional metadata extension\\n * @dev See https://eips.ethereum.org/EIPS/eip-721\\n */\\ninterface IERC721Metadata is IERC721 {\\n /**\\n * @dev Returns the token collection name.\\n */\\n function name() external view returns (string memory);\\n\\n /**\\n * @dev Returns the token collection symbol.\\n */\\n function symbol() external view returns (string memory);\\n\\n /**\\n * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token.\\n */\\n function tokenURI(uint256 tokenId) external view returns (string memory);\\n}\\n\",\"keccak256\":\"0x37d1aaaa5a2908a09e9dcf56a26ddf762ecf295afb5964695937344fc6802ce1\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC721/utils/ERC721Utils.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC721/utils/ERC721Utils.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {IERC721Receiver} from \\\"../IERC721Receiver.sol\\\";\\nimport {IERC721Errors} from \\\"../../../interfaces/draft-IERC6093.sol\\\";\\n\\n/**\\n * @dev Library that provide common ERC-721 utility functions.\\n *\\n * See https://eips.ethereum.org/EIPS/eip-721[ERC-721].\\n *\\n * _Available since v5.1._\\n */\\nlibrary ERC721Utils {\\n /**\\n * @dev Performs an acceptance check for the provided `operator` by calling {IERC721-onERC721Received}\\n * on the `to` address. The `operator` is generally the address that initiated the token transfer (i.e. `msg.sender`).\\n *\\n * The acceptance call is not executed and treated as a no-op if the target address doesn't contain code (i.e. an EOA).\\n * Otherwise, the recipient must implement {IERC721Receiver-onERC721Received} and return the acceptance magic value to accept\\n * the transfer.\\n */\\n function checkOnERC721Received(\\n address operator,\\n address from,\\n address to,\\n uint256 tokenId,\\n bytes memory data\\n ) internal {\\n if (to.code.length > 0) {\\n try IERC721Receiver(to).onERC721Received(operator, from, tokenId, data) returns (bytes4 retval) {\\n if (retval != IERC721Receiver.onERC721Received.selector) {\\n // Token rejected\\n revert IERC721Errors.ERC721InvalidReceiver(to);\\n }\\n } catch (bytes memory reason) {\\n if (reason.length == 0) {\\n // non-IERC721Receiver implementer\\n revert IERC721Errors.ERC721InvalidReceiver(to);\\n } else {\\n assembly (\\\"memory-safe\\\") {\\n revert(add(32, reason), mload(reason))\\n }\\n }\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x40399695922383778f9f540a620bec475a2f8e0f08d41f0005682842e28a9855\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)\\n\\npragma solidity ^0.8.20;\\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\":\"0x493033a8d1b176a037b2cc6a04dad01a5c157722049bbecf632ca876224dd4b2\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Nonces.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/Nonces.sol)\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Provides tracking nonces for addresses. Nonces will only increment.\\n */\\nabstract contract Nonces {\\n /**\\n * @dev The nonce used for an `account` is not the expected current nonce.\\n */\\n error InvalidAccountNonce(address account, uint256 currentNonce);\\n\\n mapping(address account => uint256) private _nonces;\\n\\n /**\\n * @dev Returns the next unused nonce for an address.\\n */\\n function nonces(address owner) public view virtual returns (uint256) {\\n return _nonces[owner];\\n }\\n\\n /**\\n * @dev Consumes a nonce.\\n *\\n * Returns the current value and increments nonce.\\n */\\n function _useNonce(address owner) internal virtual returns (uint256) {\\n // For each account, the nonce has an initial value of 0, can only be incremented by one, and cannot be\\n // decremented or reset. This guarantees that the nonce never overflows.\\n unchecked {\\n // It is important to do x++ and not ++x here.\\n return _nonces[owner]++;\\n }\\n }\\n\\n /**\\n * @dev Same as {_useNonce} but checking that `nonce` is the next valid for `owner`.\\n */\\n function _useCheckedNonce(address owner, uint256 nonce) internal virtual {\\n uint256 current = _useNonce(owner);\\n if (nonce != current) {\\n revert InvalidAccountNonce(owner, current);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x0082767004fca261c332e9ad100868327a863a88ef724e844857128845ab350f\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Panic.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/Panic.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Helper library for emitting standardized panic codes.\\n *\\n * ```solidity\\n * contract Example {\\n * using Panic for uint256;\\n *\\n * // Use any of the declared internal constants\\n * function foo() { Panic.GENERIC.panic(); }\\n *\\n * // Alternatively\\n * function foo() { Panic.panic(Panic.GENERIC); }\\n * }\\n * ```\\n *\\n * Follows the list from https://github.com/ethereum/solidity/blob/v0.8.24/libsolutil/ErrorCodes.h[libsolutil].\\n *\\n * _Available since v5.1._\\n */\\n// slither-disable-next-line unused-state\\nlibrary Panic {\\n /// @dev generic / unspecified error\\n uint256 internal constant GENERIC = 0x00;\\n /// @dev used by the assert() builtin\\n uint256 internal constant ASSERT = 0x01;\\n /// @dev arithmetic underflow or overflow\\n uint256 internal constant UNDER_OVERFLOW = 0x11;\\n /// @dev division or modulo by zero\\n uint256 internal constant DIVISION_BY_ZERO = 0x12;\\n /// @dev enum conversion error\\n uint256 internal constant ENUM_CONVERSION_ERROR = 0x21;\\n /// @dev invalid encoding in storage\\n uint256 internal constant STORAGE_ENCODING_ERROR = 0x22;\\n /// @dev empty array pop\\n uint256 internal constant EMPTY_ARRAY_POP = 0x31;\\n /// @dev array out of bounds access\\n uint256 internal constant ARRAY_OUT_OF_BOUNDS = 0x32;\\n /// @dev resource error (too large allocation or too large array)\\n uint256 internal constant RESOURCE_ERROR = 0x41;\\n /// @dev calling invalid internal function\\n uint256 internal constant INVALID_INTERNAL_FUNCTION = 0x51;\\n\\n /// @dev Reverts with a panic code. Recommended to use with\\n /// the internal constants with predefined codes.\\n function panic(uint256 code) internal pure {\\n assembly (\\\"memory-safe\\\") {\\n mstore(0x00, 0x4e487b71)\\n mstore(0x20, code)\\n revert(0x1c, 0x24)\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf7fe324703a64fc51702311dc51562d5cb1497734f074e4f483bfb6717572d7a\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/ShortStrings.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/ShortStrings.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {StorageSlot} from \\\"./StorageSlot.sol\\\";\\n\\n// | string | 0xAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA |\\n// | length | 0x BB |\\ntype ShortString is bytes32;\\n\\n/**\\n * @dev This library provides functions to convert short memory strings\\n * into a `ShortString` type that can be used as an immutable variable.\\n *\\n * Strings of arbitrary length can be optimized using this library if\\n * they are short enough (up to 31 bytes) by packing them with their\\n * length (1 byte) in a single EVM word (32 bytes). Additionally, a\\n * fallback mechanism can be used for every other case.\\n *\\n * Usage example:\\n *\\n * ```solidity\\n * contract Named {\\n * using ShortStrings for *;\\n *\\n * ShortString private immutable _name;\\n * string private _nameFallback;\\n *\\n * constructor(string memory contractName) {\\n * _name = contractName.toShortStringWithFallback(_nameFallback);\\n * }\\n *\\n * function name() external view returns (string memory) {\\n * return _name.toStringWithFallback(_nameFallback);\\n * }\\n * }\\n * ```\\n */\\nlibrary ShortStrings {\\n // Used as an identifier for strings longer than 31 bytes.\\n bytes32 private constant FALLBACK_SENTINEL = 0x00000000000000000000000000000000000000000000000000000000000000FF;\\n\\n error StringTooLong(string str);\\n error InvalidShortString();\\n\\n /**\\n * @dev Encode a string of at most 31 chars into a `ShortString`.\\n *\\n * This will trigger a `StringTooLong` error is the input string is too long.\\n */\\n function toShortString(string memory str) internal pure returns (ShortString) {\\n bytes memory bstr = bytes(str);\\n if (bstr.length > 31) {\\n revert StringTooLong(str);\\n }\\n return ShortString.wrap(bytes32(uint256(bytes32(bstr)) | bstr.length));\\n }\\n\\n /**\\n * @dev Decode a `ShortString` back to a \\\"normal\\\" string.\\n */\\n function toString(ShortString sstr) internal pure returns (string memory) {\\n uint256 len = byteLength(sstr);\\n // using `new string(len)` would work locally but is not memory safe.\\n string memory str = new string(32);\\n assembly (\\\"memory-safe\\\") {\\n mstore(str, len)\\n mstore(add(str, 0x20), sstr)\\n }\\n return str;\\n }\\n\\n /**\\n * @dev Return the length of a `ShortString`.\\n */\\n function byteLength(ShortString sstr) internal pure returns (uint256) {\\n uint256 result = uint256(ShortString.unwrap(sstr)) & 0xFF;\\n if (result > 31) {\\n revert InvalidShortString();\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Encode a string into a `ShortString`, or write it to storage if it is too long.\\n */\\n function toShortStringWithFallback(string memory value, string storage store) internal returns (ShortString) {\\n if (bytes(value).length < 32) {\\n return toShortString(value);\\n } else {\\n StorageSlot.getStringSlot(store).value = value;\\n return ShortString.wrap(FALLBACK_SENTINEL);\\n }\\n }\\n\\n /**\\n * @dev Decode a string that was encoded to `ShortString` or written to storage using {setWithFallback}.\\n */\\n function toStringWithFallback(ShortString value, string storage store) internal pure returns (string memory) {\\n if (ShortString.unwrap(value) != FALLBACK_SENTINEL) {\\n return toString(value);\\n } else {\\n return store;\\n }\\n }\\n\\n /**\\n * @dev Return the length of a string that was encoded to `ShortString` or written to storage using\\n * {setWithFallback}.\\n *\\n * WARNING: This will return the \\\"byte length\\\" of the string. This may not reflect the actual length in terms of\\n * actual characters as the UTF-8 encoding of a single character can span over multiple bytes.\\n */\\n function byteLengthWithFallback(ShortString value, string storage store) internal view returns (uint256) {\\n if (ShortString.unwrap(value) != FALLBACK_SENTINEL) {\\n return byteLength(value);\\n } else {\\n return bytes(store).length;\\n }\\n }\\n}\\n\",\"keccak256\":\"0x7d94fa0af099a2172eb01f9c8a8a443cbe7e0e43654841563e4e09968efdb549\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/StorageSlot.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/StorageSlot.sol)\\n// This file was procedurally generated from scripts/generate/templates/StorageSlot.js.\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Library for reading and writing primitive types to specific storage slots.\\n *\\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\\n * This library helps with reading and writing to such slots without the need for inline assembly.\\n *\\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\\n *\\n * Example usage to set ERC-1967 implementation slot:\\n * ```solidity\\n * contract ERC1967 {\\n * // Define the slot. Alternatively, use the SlotDerivation library to derive the slot.\\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n *\\n * function _getImplementation() internal view returns (address) {\\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n * }\\n *\\n * function _setImplementation(address newImplementation) internal {\\n * require(newImplementation.code.length > 0);\\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n * }\\n * }\\n * ```\\n *\\n * TIP: Consider using this library along with {SlotDerivation}.\\n */\\nlibrary StorageSlot {\\n struct AddressSlot {\\n address value;\\n }\\n\\n struct BooleanSlot {\\n bool value;\\n }\\n\\n struct Bytes32Slot {\\n bytes32 value;\\n }\\n\\n struct Uint256Slot {\\n uint256 value;\\n }\\n\\n struct Int256Slot {\\n int256 value;\\n }\\n\\n struct StringSlot {\\n string value;\\n }\\n\\n struct BytesSlot {\\n bytes value;\\n }\\n\\n /**\\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\\n */\\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\\n assembly (\\\"memory-safe\\\") {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns a `BooleanSlot` with member `value` located at `slot`.\\n */\\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\\n assembly (\\\"memory-safe\\\") {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns a `Bytes32Slot` with member `value` located at `slot`.\\n */\\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\\n assembly (\\\"memory-safe\\\") {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns a `Uint256Slot` with member `value` located at `slot`.\\n */\\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\\n assembly (\\\"memory-safe\\\") {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns a `Int256Slot` with member `value` located at `slot`.\\n */\\n function getInt256Slot(bytes32 slot) internal pure returns (Int256Slot storage r) {\\n assembly (\\\"memory-safe\\\") {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns a `StringSlot` with member `value` located at `slot`.\\n */\\n function getStringSlot(bytes32 slot) internal pure returns (StringSlot storage r) {\\n assembly (\\\"memory-safe\\\") {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `StringSlot` representation of the string storage pointer `store`.\\n */\\n function getStringSlot(string storage store) internal pure returns (StringSlot storage r) {\\n assembly (\\\"memory-safe\\\") {\\n r.slot := store.slot\\n }\\n }\\n\\n /**\\n * @dev Returns a `BytesSlot` with member `value` located at `slot`.\\n */\\n function getBytesSlot(bytes32 slot) internal pure returns (BytesSlot storage r) {\\n assembly (\\\"memory-safe\\\") {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `BytesSlot` representation of the bytes storage pointer `store`.\\n */\\n function getBytesSlot(bytes storage store) internal pure returns (BytesSlot storage r) {\\n assembly (\\\"memory-safe\\\") {\\n r.slot := store.slot\\n }\\n }\\n}\\n\",\"keccak256\":\"0xcf74f855663ce2ae00ed8352666b7935f6cddea2932fdf2c3ecd30a9b1cd0e97\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Strings.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/Strings.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {Math} from \\\"./math/Math.sol\\\";\\nimport {SignedMath} from \\\"./math/SignedMath.sol\\\";\\n\\n/**\\n * @dev String operations.\\n */\\nlibrary Strings {\\n bytes16 private constant HEX_DIGITS = \\\"0123456789abcdef\\\";\\n uint8 private constant ADDRESS_LENGTH = 20;\\n\\n /**\\n * @dev The `value` string doesn't fit in the specified `length`.\\n */\\n error StringsInsufficientHexLength(uint256 value, uint256 length);\\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 assembly (\\\"memory-safe\\\") {\\n ptr := add(buffer, add(32, length))\\n }\\n while (true) {\\n ptr--;\\n assembly (\\\"memory-safe\\\") {\\n mstore8(ptr, byte(mod(value, 10), HEX_DIGITS))\\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 toStringSigned(int256 value) internal pure returns (string memory) {\\n return string.concat(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 uint256 localValue = value;\\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] = HEX_DIGITS[localValue & 0xf];\\n localValue >>= 4;\\n }\\n if (localValue != 0) {\\n revert StringsInsufficientHexLength(value, length);\\n }\\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\\n * 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 Converts an `address` with fixed length of 20 bytes to its checksummed ASCII `string` hexadecimal\\n * representation, according to EIP-55.\\n */\\n function toChecksumHexString(address addr) internal pure returns (string memory) {\\n bytes memory buffer = bytes(toHexString(addr));\\n\\n // hash the hex part of buffer (skip length + 2 bytes, length 40)\\n uint256 hashValue;\\n assembly (\\\"memory-safe\\\") {\\n hashValue := shr(96, keccak256(add(buffer, 0x22), 40))\\n }\\n\\n for (uint256 i = 41; i > 1; --i) {\\n // possible values for buffer[i] are 48 (0) to 57 (9) and 97 (a) to 102 (f)\\n if (hashValue & 0xf > 7 && uint8(buffer[i]) > 96) {\\n // case shift by xoring with 0x20\\n buffer[i] ^= 0x20;\\n }\\n hashValue >>= 4;\\n }\\n return string(buffer);\\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 bytes(a).length == bytes(b).length && keccak256(bytes(a)) == keccak256(bytes(b));\\n }\\n}\\n\",\"keccak256\":\"0x725209b582291bb83058e3078624b53d15a133f7401c30295e7f3704181d2aed\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/cryptography/ECDSA.sol)\\n\\npragma solidity ^0.8.20;\\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 }\\n\\n /**\\n * @dev The signature derives the `address(0)`.\\n */\\n error ECDSAInvalidSignature();\\n\\n /**\\n * @dev The signature has an invalid length.\\n */\\n error ECDSAInvalidSignatureLength(uint256 length);\\n\\n /**\\n * @dev The signature has an S value that is in the upper half order.\\n */\\n error ECDSAInvalidSignatureS(bytes32 s);\\n\\n /**\\n * @dev Returns the address that signed a hashed message (`hash`) with `signature` or an error. This will not\\n * return address(0) without also returning an error description. Errors are documented using an enum (error type)\\n * and a bytes32 providing additional information about the error.\\n *\\n * If no error is returned, then the address can be used for verification purposes.\\n *\\n * The `ecrecover` EVM precompile 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 {MessageHashUtils-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 function tryRecover(\\n bytes32 hash,\\n bytes memory signature\\n ) internal pure returns (address recovered, RecoverError err, bytes32 errArg) {\\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 assembly (\\\"memory-safe\\\") {\\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, bytes32(signature.length));\\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 precompile 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 {MessageHashUtils-toEthSignedMessageHash} on it.\\n */\\n function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {\\n (address recovered, RecoverError error, bytes32 errorArg) = tryRecover(hash, signature);\\n _throwError(error, errorArg);\\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[ERC-2098 short signatures]\\n */\\n function tryRecover(\\n bytes32 hash,\\n bytes32 r,\\n bytes32 vs\\n ) internal pure returns (address recovered, RecoverError err, bytes32 errArg) {\\n unchecked {\\n bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff);\\n // We do not check for an overflow here since the shift operation results in 0 or 1.\\n uint8 v = uint8((uint256(vs) >> 255) + 27);\\n return tryRecover(hash, v, r, s);\\n }\\n }\\n\\n /**\\n * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately.\\n */\\n function recover(bytes32 hash, bytes32 r, bytes32 vs) internal pure returns (address) {\\n (address recovered, RecoverError error, bytes32 errorArg) = tryRecover(hash, r, vs);\\n _throwError(error, errorArg);\\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 function tryRecover(\\n bytes32 hash,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) internal pure returns (address recovered, RecoverError err, bytes32 errArg) {\\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, s);\\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, bytes32(0));\\n }\\n\\n return (signer, RecoverError.NoError, bytes32(0));\\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, bytes32 errorArg) = tryRecover(hash, v, r, s);\\n _throwError(error, errorArg);\\n return recovered;\\n }\\n\\n /**\\n * @dev Optionally reverts with the corresponding custom error according to the `error` argument provided.\\n */\\n function _throwError(RecoverError error, bytes32 errorArg) private pure {\\n if (error == RecoverError.NoError) {\\n return; // no error: do nothing\\n } else if (error == RecoverError.InvalidSignature) {\\n revert ECDSAInvalidSignature();\\n } else if (error == RecoverError.InvalidSignatureLength) {\\n revert ECDSAInvalidSignatureLength(uint256(errorArg));\\n } else if (error == RecoverError.InvalidSignatureS) {\\n revert ECDSAInvalidSignatureS(errorArg);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x69f54c02b7d81d505910ec198c11ed4c6a728418a868b906b4a0cf29946fda84\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/cryptography/EIP712.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/cryptography/EIP712.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {MessageHashUtils} from \\\"./MessageHashUtils.sol\\\";\\nimport {ShortStrings, ShortString} from \\\"../ShortStrings.sol\\\";\\nimport {IERC5267} from \\\"../../interfaces/IERC5267.sol\\\";\\n\\n/**\\n * @dev https://eips.ethereum.org/EIPS/eip-712[EIP-712] is a standard for hashing and signing of typed structured data.\\n *\\n * The encoding scheme specified in the EIP requires a domain separator and a hash of the typed structured data, whose\\n * encoding is very generic and therefore its implementation in Solidity is not feasible, thus this contract\\n * does not implement the encoding itself. Protocols need to implement the type-specific encoding they need in order to\\n * produce the hash of their typed data using a combination of `abi.encode` and `keccak256`.\\n *\\n * This contract implements the EIP-712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding\\n * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA\\n * ({_hashTypedDataV4}).\\n *\\n * The implementation of the domain separator was designed to be as efficient as possible while still properly updating\\n * the chain id to protect against replay attacks on an eventual fork of the chain.\\n *\\n * NOTE: This contract implements the version of the encoding known as \\\"v4\\\", as implemented by the JSON RPC method\\n * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask].\\n *\\n * NOTE: In the upgradeable version of this contract, the cached values will correspond to the address, and the domain\\n * separator of the implementation contract. This will cause the {_domainSeparatorV4} function to always rebuild the\\n * separator from the immutable values, which is cheaper than accessing a cached version in cold storage.\\n *\\n * @custom:oz-upgrades-unsafe-allow state-variable-immutable\\n */\\nabstract contract EIP712 is IERC5267 {\\n using ShortStrings for *;\\n\\n bytes32 private constant TYPE_HASH =\\n keccak256(\\\"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)\\\");\\n\\n // Cache the domain separator as an immutable value, but also store the chain id that it corresponds to, in order to\\n // invalidate the cached domain separator if the chain id changes.\\n bytes32 private immutable _cachedDomainSeparator;\\n uint256 private immutable _cachedChainId;\\n address private immutable _cachedThis;\\n\\n bytes32 private immutable _hashedName;\\n bytes32 private immutable _hashedVersion;\\n\\n ShortString private immutable _name;\\n ShortString private immutable _version;\\n string private _nameFallback;\\n string private _versionFallback;\\n\\n /**\\n * @dev Initializes the domain separator and parameter caches.\\n *\\n * The meaning of `name` and `version` is specified in\\n * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP-712]:\\n *\\n * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol.\\n * - `version`: the current major version of the signing domain.\\n *\\n * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart\\n * contract upgrade].\\n */\\n constructor(string memory name, string memory version) {\\n _name = name.toShortStringWithFallback(_nameFallback);\\n _version = version.toShortStringWithFallback(_versionFallback);\\n _hashedName = keccak256(bytes(name));\\n _hashedVersion = keccak256(bytes(version));\\n\\n _cachedChainId = block.chainid;\\n _cachedDomainSeparator = _buildDomainSeparator();\\n _cachedThis = address(this);\\n }\\n\\n /**\\n * @dev Returns the domain separator for the current chain.\\n */\\n function _domainSeparatorV4() internal view returns (bytes32) {\\n if (address(this) == _cachedThis && block.chainid == _cachedChainId) {\\n return _cachedDomainSeparator;\\n } else {\\n return _buildDomainSeparator();\\n }\\n }\\n\\n function _buildDomainSeparator() private view returns (bytes32) {\\n return keccak256(abi.encode(TYPE_HASH, _hashedName, _hashedVersion, block.chainid, address(this)));\\n }\\n\\n /**\\n * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this\\n * function returns the hash of the fully encoded EIP712 message for this domain.\\n *\\n * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example:\\n *\\n * ```solidity\\n * bytes32 digest = _hashTypedDataV4(keccak256(abi.encode(\\n * keccak256(\\\"Mail(address to,string contents)\\\"),\\n * mailTo,\\n * keccak256(bytes(mailContents))\\n * )));\\n * address signer = ECDSA.recover(digest, signature);\\n * ```\\n */\\n function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) {\\n return MessageHashUtils.toTypedDataHash(_domainSeparatorV4(), structHash);\\n }\\n\\n /**\\n * @dev See {IERC-5267}.\\n */\\n function eip712Domain()\\n public\\n view\\n virtual\\n returns (\\n bytes1 fields,\\n string memory name,\\n string memory version,\\n uint256 chainId,\\n address verifyingContract,\\n bytes32 salt,\\n uint256[] memory extensions\\n )\\n {\\n return (\\n hex\\\"0f\\\", // 01111\\n _EIP712Name(),\\n _EIP712Version(),\\n block.chainid,\\n address(this),\\n bytes32(0),\\n new uint256[](0)\\n );\\n }\\n\\n /**\\n * @dev The name parameter for the EIP712 domain.\\n *\\n * NOTE: By default this function reads _name which is an immutable value.\\n * It only reads from storage if necessary (in case the value is too large to fit in a ShortString).\\n */\\n // solhint-disable-next-line func-name-mixedcase\\n function _EIP712Name() internal view returns (string memory) {\\n return _name.toStringWithFallback(_nameFallback);\\n }\\n\\n /**\\n * @dev The version parameter for the EIP712 domain.\\n *\\n * NOTE: By default this function reads _version which is an immutable value.\\n * It only reads from storage if necessary (in case the value is too large to fit in a ShortString).\\n */\\n // solhint-disable-next-line func-name-mixedcase\\n function _EIP712Version() internal view returns (string memory) {\\n return _version.toStringWithFallback(_versionFallback);\\n }\\n}\\n\",\"keccak256\":\"0x10eb97d047f8d84fe263a02bb4a656ac6674f6679d74532cc37546289e073a9d\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/cryptography/MessageHashUtils.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/cryptography/MessageHashUtils.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {Strings} from \\\"../Strings.sol\\\";\\n\\n/**\\n * @dev Signature message hash utilities for producing digests to be consumed by {ECDSA} recovery or signing.\\n *\\n * The library provides methods for generating a hash of a message that conforms to the\\n * https://eips.ethereum.org/EIPS/eip-191[ERC-191] and https://eips.ethereum.org/EIPS/eip-712[EIP 712]\\n * specifications.\\n */\\nlibrary MessageHashUtils {\\n /**\\n * @dev Returns the keccak256 digest of an ERC-191 signed data with version\\n * `0x45` (`personal_sign` messages).\\n *\\n * The digest is calculated by prefixing a bytes32 `messageHash` with\\n * `\\\"\\\\x19Ethereum Signed Message:\\\\n32\\\"` and hashing the result. It corresponds with the\\n * hash signed when using the https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] JSON-RPC method.\\n *\\n * NOTE: The `messageHash` parameter is intended to be the result of hashing a raw message with\\n * keccak256, although any bytes32 value can be safely used because the final digest will\\n * be re-hashed.\\n *\\n * See {ECDSA-recover}.\\n */\\n function toEthSignedMessageHash(bytes32 messageHash) internal pure returns (bytes32 digest) {\\n assembly (\\\"memory-safe\\\") {\\n mstore(0x00, \\\"\\\\x19Ethereum Signed Message:\\\\n32\\\") // 32 is the bytes-length of messageHash\\n mstore(0x1c, messageHash) // 0x1c (28) is the length of the prefix\\n digest := keccak256(0x00, 0x3c) // 0x3c is the length of the prefix (0x1c) + messageHash (0x20)\\n }\\n }\\n\\n /**\\n * @dev Returns the keccak256 digest of an ERC-191 signed data with version\\n * `0x45` (`personal_sign` messages).\\n *\\n * The digest is calculated by prefixing an arbitrary `message` with\\n * `\\\"\\\\x19Ethereum Signed Message:\\\\n\\\" + len(message)` and hashing the result. It corresponds with the\\n * hash signed when using the https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] JSON-RPC method.\\n *\\n * See {ECDSA-recover}.\\n */\\n function toEthSignedMessageHash(bytes memory message) internal pure returns (bytes32) {\\n return\\n keccak256(bytes.concat(\\\"\\\\x19Ethereum Signed Message:\\\\n\\\", bytes(Strings.toString(message.length)), message));\\n }\\n\\n /**\\n * @dev Returns the keccak256 digest of an ERC-191 signed data with version\\n * `0x00` (data with intended validator).\\n *\\n * The digest is calculated by prefixing an arbitrary `data` with `\\\"\\\\x19\\\\x00\\\"` and the intended\\n * `validator` address. Then hashing the result.\\n *\\n * See {ECDSA-recover}.\\n */\\n function toDataWithIntendedValidatorHash(address validator, bytes memory data) internal pure returns (bytes32) {\\n return keccak256(abi.encodePacked(hex\\\"19_00\\\", validator, data));\\n }\\n\\n /**\\n * @dev Returns the keccak256 digest of an EIP-712 typed data (ERC-191 version `0x01`).\\n *\\n * The digest is calculated from a `domainSeparator` and a `structHash`, by prefixing them with\\n * `\\\\x19\\\\x01` and hashing the result. It corresponds to the hash signed by the\\n * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`] JSON-RPC method as part of EIP-712.\\n *\\n * See {ECDSA-recover}.\\n */\\n function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32 digest) {\\n assembly (\\\"memory-safe\\\") {\\n let ptr := mload(0x40)\\n mstore(ptr, hex\\\"19_01\\\")\\n mstore(add(ptr, 0x02), domainSeparator)\\n mstore(add(ptr, 0x22), structHash)\\n digest := keccak256(ptr, 0x42)\\n }\\n }\\n}\\n\",\"keccak256\":\"0x4515543bc4c78561f6bea83ecfdfc3dead55bd59858287d682045b11de1ae575\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/introspection/ERC165.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/introspection/ERC165.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {IERC165} from \\\"./IERC165.sol\\\";\\n\\n/**\\n * @dev Implementation of the {IERC165} interface.\\n *\\n * Contracts that want to implement ERC-165 should inherit from this contract and override {supportsInterface} to check\\n * for the additional interface id that will be supported. For example:\\n *\\n * ```solidity\\n * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\\n * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);\\n * }\\n * ```\\n */\\nabstract contract ERC165 is IERC165 {\\n /**\\n * @dev See {IERC165-supportsInterface}.\\n */\\n function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) {\\n return interfaceId == type(IERC165).interfaceId;\\n }\\n}\\n\",\"keccak256\":\"0xddce8e17e3d3f9ed818b4f4c4478a8262aab8b11ed322f1bf5ed705bb4bd97fa\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/introspection/IERC165.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/introspection/IERC165.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Interface of the ERC-165 standard, as defined in the\\n * https://eips.ethereum.org/EIPS/eip-165[ERC].\\n *\\n * Implementers can declare support of contract interfaces, which can then be\\n * queried by others ({ERC165Checker}).\\n *\\n * For an implementation, see {ERC165}.\\n */\\ninterface IERC165 {\\n /**\\n * @dev Returns true if this contract implements the interface defined by\\n * `interfaceId`. See the corresponding\\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[ERC section]\\n * to learn more about how these ids are created.\\n *\\n * This function call must use less than 30 000 gas.\\n */\\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x79796192ec90263f21b464d5bc90b777a525971d3de8232be80d9c4f9fb353b8\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/math/Math.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/math/Math.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {Panic} from \\\"../Panic.sol\\\";\\nimport {SafeCast} from \\\"./SafeCast.sol\\\";\\n\\n/**\\n * @dev Standard math utilities missing in the Solidity language.\\n */\\nlibrary Math {\\n enum Rounding {\\n Floor, // Toward negative infinity\\n Ceil, // Toward positive infinity\\n Trunc, // Toward zero\\n Expand // Away from zero\\n }\\n\\n /**\\n * @dev Returns the addition of two unsigned integers, with an success flag (no overflow).\\n */\\n function tryAdd(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\\n unchecked {\\n uint256 c = a + b;\\n if (c < a) return (false, 0);\\n return (true, c);\\n }\\n }\\n\\n /**\\n * @dev Returns the subtraction of two unsigned integers, with an success flag (no overflow).\\n */\\n function trySub(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\\n unchecked {\\n if (b > a) return (false, 0);\\n return (true, a - b);\\n }\\n }\\n\\n /**\\n * @dev Returns the multiplication of two unsigned integers, with an success flag (no overflow).\\n */\\n function tryMul(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\\n unchecked {\\n // Gas optimization: this is cheaper than requiring 'a' not being zero, but the\\n // benefit is lost if 'b' is also tested.\\n // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522\\n if (a == 0) return (true, 0);\\n uint256 c = a * b;\\n if (c / a != b) return (false, 0);\\n return (true, c);\\n }\\n }\\n\\n /**\\n * @dev Returns the division of two unsigned integers, with a success flag (no division by zero).\\n */\\n function tryDiv(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\\n unchecked {\\n if (b == 0) return (false, 0);\\n return (true, a / b);\\n }\\n }\\n\\n /**\\n * @dev Returns the remainder of dividing two unsigned integers, with a success flag (no division by zero).\\n */\\n function tryMod(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\\n unchecked {\\n if (b == 0) return (false, 0);\\n return (true, a % b);\\n }\\n }\\n\\n /**\\n * @dev Branchless ternary evaluation for `a ? b : c`. Gas costs are constant.\\n *\\n * IMPORTANT: This function may reduce bytecode size and consume less gas when used standalone.\\n * However, the compiler may optimize Solidity ternary operations (i.e. `a ? b : c`) to only compute\\n * one branch when needed, making this function more expensive.\\n */\\n function ternary(bool condition, uint256 a, uint256 b) internal pure returns (uint256) {\\n unchecked {\\n // branchless ternary works because:\\n // b ^ (a ^ b) == a\\n // b ^ 0 == b\\n return b ^ ((a ^ b) * SafeCast.toUint(condition));\\n }\\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 ternary(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 ternary(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 towards infinity instead\\n * of rounding towards zero.\\n */\\n function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {\\n if (b == 0) {\\n // Guarantee the same behavior as in a regular Solidity division.\\n Panic.panic(Panic.DIVISION_BY_ZERO);\\n }\\n\\n // The following calculation ensures accurate ceiling division without overflow.\\n // Since a is non-zero, (a - 1) / b will not overflow.\\n // The largest possible result occurs when (a - 1) / b is type(uint256).max,\\n // but the largest value we can obtain is type(uint256).max - 1, which happens\\n // when a = type(uint256).max and b = 1.\\n unchecked {\\n return SafeCast.toUint(a > 0) * ((a - 1) / b + 1);\\n }\\n }\\n\\n /**\\n * @dev Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or\\n * denominator == 0.\\n *\\n * Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv) with further edits by\\n * 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\\u00b2\\u2075\\u2076 and mod 2\\u00b2\\u2075\\u2076 - 1, then use\\n // the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256\\n // variables such that product = prod1 * 2\\u00b2\\u2075\\u2076 + prod0.\\n uint256 prod0 = x * y; // 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 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\\u00b2\\u2075\\u2076. Also prevents denominator == 0.\\n if (denominator <= prod1) {\\n Panic.panic(ternary(denominator == 0, Panic.DIVISION_BY_ZERO, Panic.UNDER_OVERFLOW));\\n }\\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.\\n // Always >= 1. See https://cs.stackexchange.com/q/138556/92363.\\n\\n uint256 twos = denominator & (0 - denominator);\\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\\u00b2\\u2075\\u2076 / 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\\u00b2\\u2075\\u2076. Now that denominator is an odd number, it has an inverse modulo 2\\u00b2\\u2075\\u2076 such\\n // that denominator * inv \\u2261 1 mod 2\\u00b2\\u2075\\u2076. Compute the inverse by starting with a seed that is correct for\\n // four bits. That is, denominator * inv \\u2261 1 mod 2\\u2074.\\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\\n // works in modular arithmetic, doubling the correct bits in each step.\\n inverse *= 2 - denominator * inverse; // inverse mod 2\\u2078\\n inverse *= 2 - denominator * inverse; // inverse mod 2\\u00b9\\u2076\\n inverse *= 2 - denominator * inverse; // inverse mod 2\\u00b3\\u00b2\\n inverse *= 2 - denominator * inverse; // inverse mod 2\\u2076\\u2074\\n inverse *= 2 - denominator * inverse; // inverse mod 2\\u00b9\\u00b2\\u2078\\n inverse *= 2 - denominator * inverse; // inverse mod 2\\u00b2\\u2075\\u2076\\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\\u00b2\\u2075\\u2076. Since the preconditions guarantee that the outcome is\\n // less than 2\\u00b2\\u2075\\u2076, 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 * @dev 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 return mulDiv(x, y, denominator) + SafeCast.toUint(unsignedRoundsUp(rounding) && mulmod(x, y, denominator) > 0);\\n }\\n\\n /**\\n * @dev Calculate the modular multiplicative inverse of a number in Z/nZ.\\n *\\n * If n is a prime, then Z/nZ is a field. In that case all elements are inversible, except 0.\\n * If n is not a prime, then Z/nZ is not a field, and some elements might not be inversible.\\n *\\n * If the input value is not inversible, 0 is returned.\\n *\\n * NOTE: If you know for sure that n is (big) a prime, it may be cheaper to use Fermat's little theorem and get the\\n * inverse using `Math.modExp(a, n - 2, n)`. See {invModPrime}.\\n */\\n function invMod(uint256 a, uint256 n) internal pure returns (uint256) {\\n unchecked {\\n if (n == 0) return 0;\\n\\n // The inverse modulo is calculated using the Extended Euclidean Algorithm (iterative version)\\n // Used to compute integers x and y such that: ax + ny = gcd(a, n).\\n // When the gcd is 1, then the inverse of a modulo n exists and it's x.\\n // ax + ny = 1\\n // ax = 1 + (-y)n\\n // ax \\u2261 1 (mod n) # x is the inverse of a modulo n\\n\\n // If the remainder is 0 the gcd is n right away.\\n uint256 remainder = a % n;\\n uint256 gcd = n;\\n\\n // Therefore the initial coefficients are:\\n // ax + ny = gcd(a, n) = n\\n // 0a + 1n = n\\n int256 x = 0;\\n int256 y = 1;\\n\\n while (remainder != 0) {\\n uint256 quotient = gcd / remainder;\\n\\n (gcd, remainder) = (\\n // The old remainder is the next gcd to try.\\n remainder,\\n // Compute the next remainder.\\n // Can't overflow given that (a % gcd) * (gcd // (a % gcd)) <= gcd\\n // where gcd is at most n (capped to type(uint256).max)\\n gcd - remainder * quotient\\n );\\n\\n (x, y) = (\\n // Increment the coefficient of a.\\n y,\\n // Decrement the coefficient of n.\\n // Can overflow, but the result is casted to uint256 so that the\\n // next value of y is \\\"wrapped around\\\" to a value between 0 and n - 1.\\n x - y * int256(quotient)\\n );\\n }\\n\\n if (gcd != 1) return 0; // No inverse exists.\\n return ternary(x < 0, n - uint256(-x), uint256(x)); // Wrap the result if it's negative.\\n }\\n }\\n\\n /**\\n * @dev Variant of {invMod}. More efficient, but only works if `p` is known to be a prime greater than `2`.\\n *\\n * From https://en.wikipedia.org/wiki/Fermat%27s_little_theorem[Fermat's little theorem], we know that if p is\\n * prime, then `a**(p-1) \\u2261 1 mod p`. As a consequence, we have `a * a**(p-2) \\u2261 1 mod p`, which means that\\n * `a**(p-2)` is the modular multiplicative inverse of a in Fp.\\n *\\n * NOTE: this function does NOT check that `p` is a prime greater than `2`.\\n */\\n function invModPrime(uint256 a, uint256 p) internal view returns (uint256) {\\n unchecked {\\n return Math.modExp(a, p - 2, p);\\n }\\n }\\n\\n /**\\n * @dev Returns the modular exponentiation of the specified base, exponent and modulus (b ** e % m)\\n *\\n * Requirements:\\n * - modulus can't be zero\\n * - underlying staticcall to precompile must succeed\\n *\\n * IMPORTANT: The result is only valid if the underlying call succeeds. When using this function, make\\n * sure the chain you're using it on supports the precompiled contract for modular exponentiation\\n * at address 0x05 as specified in https://eips.ethereum.org/EIPS/eip-198[EIP-198]. Otherwise,\\n * the underlying function will succeed given the lack of a revert, but the result may be incorrectly\\n * interpreted as 0.\\n */\\n function modExp(uint256 b, uint256 e, uint256 m) internal view returns (uint256) {\\n (bool success, uint256 result) = tryModExp(b, e, m);\\n if (!success) {\\n Panic.panic(Panic.DIVISION_BY_ZERO);\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Returns the modular exponentiation of the specified base, exponent and modulus (b ** e % m).\\n * It includes a success flag indicating if the operation succeeded. Operation will be marked as failed if trying\\n * to operate modulo 0 or if the underlying precompile reverted.\\n *\\n * IMPORTANT: The result is only valid if the success flag is true. When using this function, make sure the chain\\n * you're using it on supports the precompiled contract for modular exponentiation at address 0x05 as specified in\\n * https://eips.ethereum.org/EIPS/eip-198[EIP-198]. Otherwise, the underlying function will succeed given the lack\\n * of a revert, but the result may be incorrectly interpreted as 0.\\n */\\n function tryModExp(uint256 b, uint256 e, uint256 m) internal view returns (bool success, uint256 result) {\\n if (m == 0) return (false, 0);\\n assembly (\\\"memory-safe\\\") {\\n let ptr := mload(0x40)\\n // | Offset | Content | Content (Hex) |\\n // |-----------|------------|--------------------------------------------------------------------|\\n // | 0x00:0x1f | size of b | 0x0000000000000000000000000000000000000000000000000000000000000020 |\\n // | 0x20:0x3f | size of e | 0x0000000000000000000000000000000000000000000000000000000000000020 |\\n // | 0x40:0x5f | size of m | 0x0000000000000000000000000000000000000000000000000000000000000020 |\\n // | 0x60:0x7f | value of b | 0x<.............................................................b> |\\n // | 0x80:0x9f | value of e | 0x<.............................................................e> |\\n // | 0xa0:0xbf | value of m | 0x<.............................................................m> |\\n mstore(ptr, 0x20)\\n mstore(add(ptr, 0x20), 0x20)\\n mstore(add(ptr, 0x40), 0x20)\\n mstore(add(ptr, 0x60), b)\\n mstore(add(ptr, 0x80), e)\\n mstore(add(ptr, 0xa0), m)\\n\\n // Given the result < m, it's guaranteed to fit in 32 bytes,\\n // so we can use the memory scratch space located at offset 0.\\n success := staticcall(gas(), 0x05, ptr, 0xc0, 0x00, 0x20)\\n result := mload(0x00)\\n }\\n }\\n\\n /**\\n * @dev Variant of {modExp} that supports inputs of arbitrary length.\\n */\\n function modExp(bytes memory b, bytes memory e, bytes memory m) internal view returns (bytes memory) {\\n (bool success, bytes memory result) = tryModExp(b, e, m);\\n if (!success) {\\n Panic.panic(Panic.DIVISION_BY_ZERO);\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Variant of {tryModExp} that supports inputs of arbitrary length.\\n */\\n function tryModExp(\\n bytes memory b,\\n bytes memory e,\\n bytes memory m\\n ) internal view returns (bool success, bytes memory result) {\\n if (_zeroBytes(m)) return (false, new bytes(0));\\n\\n uint256 mLen = m.length;\\n\\n // Encode call args in result and move the free memory pointer\\n result = abi.encodePacked(b.length, e.length, mLen, b, e, m);\\n\\n assembly (\\\"memory-safe\\\") {\\n let dataPtr := add(result, 0x20)\\n // Write result on top of args to avoid allocating extra memory.\\n success := staticcall(gas(), 0x05, dataPtr, mload(result), dataPtr, mLen)\\n // Overwrite the length.\\n // result.length > returndatasize() is guaranteed because returndatasize() == m.length\\n mstore(result, mLen)\\n // Set the memory pointer after the returned data.\\n mstore(0x40, add(dataPtr, mLen))\\n }\\n }\\n\\n /**\\n * @dev Returns whether the provided byte array is zero.\\n */\\n function _zeroBytes(bytes memory byteArray) private pure returns (bool) {\\n for (uint256 i = 0; i < byteArray.length; ++i) {\\n if (byteArray[i] != 0) {\\n return false;\\n }\\n }\\n return true;\\n }\\n\\n /**\\n * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded\\n * towards zero.\\n *\\n * This method is based on Newton's method for computing square roots; the algorithm is restricted to only\\n * using integer operations.\\n */\\n function sqrt(uint256 a) internal pure returns (uint256) {\\n unchecked {\\n // Take care of easy edge cases when a == 0 or a == 1\\n if (a <= 1) {\\n return a;\\n }\\n\\n // In this function, we use Newton's method to get a root of `f(x) := x\\u00b2 - a`. It involves building a\\n // sequence x_n that converges toward sqrt(a). For each iteration x_n, we also define the error between\\n // the current value as `\\u03b5_n = | x_n - sqrt(a) |`.\\n //\\n // For our first estimation, we consider `e` the smallest power of 2 which is bigger than the square root\\n // of the target. (i.e. `2**(e-1) \\u2264 sqrt(a) < 2**e`). We know that `e \\u2264 128` because `(2\\u00b9\\u00b2\\u2078)\\u00b2 = 2\\u00b2\\u2075\\u2076` is\\n // bigger than any uint256.\\n //\\n // By noticing that\\n // `2**(e-1) \\u2264 sqrt(a) < 2**e \\u2192 (2**(e-1))\\u00b2 \\u2264 a < (2**e)\\u00b2 \\u2192 2**(2*e-2) \\u2264 a < 2**(2*e)`\\n // we can deduce that `e - 1` is `log2(a) / 2`. We can thus compute `x_n = 2**(e-1)` using a method similar\\n // to the msb function.\\n uint256 aa = a;\\n uint256 xn = 1;\\n\\n if (aa >= (1 << 128)) {\\n aa >>= 128;\\n xn <<= 64;\\n }\\n if (aa >= (1 << 64)) {\\n aa >>= 64;\\n xn <<= 32;\\n }\\n if (aa >= (1 << 32)) {\\n aa >>= 32;\\n xn <<= 16;\\n }\\n if (aa >= (1 << 16)) {\\n aa >>= 16;\\n xn <<= 8;\\n }\\n if (aa >= (1 << 8)) {\\n aa >>= 8;\\n xn <<= 4;\\n }\\n if (aa >= (1 << 4)) {\\n aa >>= 4;\\n xn <<= 2;\\n }\\n if (aa >= (1 << 2)) {\\n xn <<= 1;\\n }\\n\\n // We now have x_n such that `x_n = 2**(e-1) \\u2264 sqrt(a) < 2**e = 2 * x_n`. This implies \\u03b5_n \\u2264 2**(e-1).\\n //\\n // We can refine our estimation by noticing that the middle of that interval minimizes the error.\\n // If we move x_n to equal 2**(e-1) + 2**(e-2), then we reduce the error to \\u03b5_n \\u2264 2**(e-2).\\n // This is going to be our x_0 (and \\u03b5_0)\\n xn = (3 * xn) >> 1; // \\u03b5_0 := | x_0 - sqrt(a) | \\u2264 2**(e-2)\\n\\n // From here, Newton's method give us:\\n // x_{n+1} = (x_n + a / x_n) / 2\\n //\\n // One should note that:\\n // x_{n+1}\\u00b2 - a = ((x_n + a / x_n) / 2)\\u00b2 - a\\n // = ((x_n\\u00b2 + a) / (2 * x_n))\\u00b2 - a\\n // = (x_n\\u2074 + 2 * a * x_n\\u00b2 + a\\u00b2) / (4 * x_n\\u00b2) - a\\n // = (x_n\\u2074 + 2 * a * x_n\\u00b2 + a\\u00b2 - 4 * a * x_n\\u00b2) / (4 * x_n\\u00b2)\\n // = (x_n\\u2074 - 2 * a * x_n\\u00b2 + a\\u00b2) / (4 * x_n\\u00b2)\\n // = (x_n\\u00b2 - a)\\u00b2 / (2 * x_n)\\u00b2\\n // = ((x_n\\u00b2 - a) / (2 * x_n))\\u00b2\\n // \\u2265 0\\n // Which proves that for all n \\u2265 1, sqrt(a) \\u2264 x_n\\n //\\n // This gives us the proof of quadratic convergence of the sequence:\\n // \\u03b5_{n+1} = | x_{n+1} - sqrt(a) |\\n // = | (x_n + a / x_n) / 2 - sqrt(a) |\\n // = | (x_n\\u00b2 + a - 2*x_n*sqrt(a)) / (2 * x_n) |\\n // = | (x_n - sqrt(a))\\u00b2 / (2 * x_n) |\\n // = | \\u03b5_n\\u00b2 / (2 * x_n) |\\n // = \\u03b5_n\\u00b2 / | (2 * x_n) |\\n //\\n // For the first iteration, we have a special case where x_0 is known:\\n // \\u03b5_1 = \\u03b5_0\\u00b2 / | (2 * x_0) |\\n // \\u2264 (2**(e-2))\\u00b2 / (2 * (2**(e-1) + 2**(e-2)))\\n // \\u2264 2**(2*e-4) / (3 * 2**(e-1))\\n // \\u2264 2**(e-3) / 3\\n // \\u2264 2**(e-3-log2(3))\\n // \\u2264 2**(e-4.5)\\n //\\n // For the following iterations, we use the fact that, 2**(e-1) \\u2264 sqrt(a) \\u2264 x_n:\\n // \\u03b5_{n+1} = \\u03b5_n\\u00b2 / | (2 * x_n) |\\n // \\u2264 (2**(e-k))\\u00b2 / (2 * 2**(e-1))\\n // \\u2264 2**(2*e-2*k) / 2**e\\n // \\u2264 2**(e-2*k)\\n xn = (xn + a / xn) >> 1; // \\u03b5_1 := | x_1 - sqrt(a) | \\u2264 2**(e-4.5) -- special case, see above\\n xn = (xn + a / xn) >> 1; // \\u03b5_2 := | x_2 - sqrt(a) | \\u2264 2**(e-9) -- general case with k = 4.5\\n xn = (xn + a / xn) >> 1; // \\u03b5_3 := | x_3 - sqrt(a) | \\u2264 2**(e-18) -- general case with k = 9\\n xn = (xn + a / xn) >> 1; // \\u03b5_4 := | x_4 - sqrt(a) | \\u2264 2**(e-36) -- general case with k = 18\\n xn = (xn + a / xn) >> 1; // \\u03b5_5 := | x_5 - sqrt(a) | \\u2264 2**(e-72) -- general case with k = 36\\n xn = (xn + a / xn) >> 1; // \\u03b5_6 := | x_6 - sqrt(a) | \\u2264 2**(e-144) -- general case with k = 72\\n\\n // Because e \\u2264 128 (as discussed during the first estimation phase), we know have reached a precision\\n // \\u03b5_6 \\u2264 2**(e-144) < 1. Given we're operating on integers, then we can ensure that xn is now either\\n // sqrt(a) or sqrt(a) + 1.\\n return xn - SafeCast.toUint(xn > a / xn);\\n }\\n }\\n\\n /**\\n * @dev 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 + SafeCast.toUint(unsignedRoundsUp(rounding) && result * result < a);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 2 of a positive value rounded towards zero.\\n * Returns 0 if given 0.\\n */\\n function log2(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n uint256 exp;\\n unchecked {\\n exp = 128 * SafeCast.toUint(value > (1 << 128) - 1);\\n value >>= exp;\\n result += exp;\\n\\n exp = 64 * SafeCast.toUint(value > (1 << 64) - 1);\\n value >>= exp;\\n result += exp;\\n\\n exp = 32 * SafeCast.toUint(value > (1 << 32) - 1);\\n value >>= exp;\\n result += exp;\\n\\n exp = 16 * SafeCast.toUint(value > (1 << 16) - 1);\\n value >>= exp;\\n result += exp;\\n\\n exp = 8 * SafeCast.toUint(value > (1 << 8) - 1);\\n value >>= exp;\\n result += exp;\\n\\n exp = 4 * SafeCast.toUint(value > (1 << 4) - 1);\\n value >>= exp;\\n result += exp;\\n\\n exp = 2 * SafeCast.toUint(value > (1 << 2) - 1);\\n value >>= exp;\\n result += exp;\\n\\n result += SafeCast.toUint(value > 1);\\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 + SafeCast.toUint(unsignedRoundsUp(rounding) && 1 << result < value);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 10 of a positive value rounded towards zero.\\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 + SafeCast.toUint(unsignedRoundsUp(rounding) && 10 ** result < value);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 256 of a positive value rounded towards zero.\\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 uint256 isGt;\\n unchecked {\\n isGt = SafeCast.toUint(value > (1 << 128) - 1);\\n value >>= isGt * 128;\\n result += isGt * 16;\\n\\n isGt = SafeCast.toUint(value > (1 << 64) - 1);\\n value >>= isGt * 64;\\n result += isGt * 8;\\n\\n isGt = SafeCast.toUint(value > (1 << 32) - 1);\\n value >>= isGt * 32;\\n result += isGt * 4;\\n\\n isGt = SafeCast.toUint(value > (1 << 16) - 1);\\n value >>= isGt * 16;\\n result += isGt * 2;\\n\\n result += SafeCast.toUint(value > (1 << 8) - 1);\\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 + SafeCast.toUint(unsignedRoundsUp(rounding) && 1 << (result << 3) < value);\\n }\\n }\\n\\n /**\\n * @dev Returns whether a provided rounding mode is considered rounding up for unsigned integers.\\n */\\n function unsignedRoundsUp(Rounding rounding) internal pure returns (bool) {\\n return uint8(rounding) % 2 == 1;\\n }\\n}\\n\",\"keccak256\":\"0xa00be322d7db5786750ce0ac7e2f5b633ac30a5ed5fa1ced1e74acfc19acecea\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/math/SafeCast.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/math/SafeCast.sol)\\n// This file was procedurally generated from scripts/generate/templates/SafeCast.js.\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Wrappers over Solidity's uintXX/intXX/bool casting operators with added overflow\\n * checks.\\n *\\n * Downcasting from uint256/int256 in Solidity does not revert on overflow. This can\\n * easily result in undesired exploitation or bugs, since developers usually\\n * assume that overflows raise errors. `SafeCast` restores this intuition by\\n * reverting the transaction when such an operation overflows.\\n *\\n * Using this library instead of the unchecked operations eliminates an entire\\n * class of bugs, so it's recommended to use it always.\\n */\\nlibrary SafeCast {\\n /**\\n * @dev Value doesn't fit in an uint of `bits` size.\\n */\\n error SafeCastOverflowedUintDowncast(uint8 bits, uint256 value);\\n\\n /**\\n * @dev An int value doesn't fit in an uint of `bits` size.\\n */\\n error SafeCastOverflowedIntToUint(int256 value);\\n\\n /**\\n * @dev Value doesn't fit in an int of `bits` size.\\n */\\n error SafeCastOverflowedIntDowncast(uint8 bits, int256 value);\\n\\n /**\\n * @dev An uint value doesn't fit in an int of `bits` size.\\n */\\n error SafeCastOverflowedUintToInt(uint256 value);\\n\\n /**\\n * @dev Returns the downcasted uint248 from uint256, reverting on\\n * overflow (when the input is greater than largest uint248).\\n *\\n * Counterpart to Solidity's `uint248` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 248 bits\\n */\\n function toUint248(uint256 value) internal pure returns (uint248) {\\n if (value > type(uint248).max) {\\n revert SafeCastOverflowedUintDowncast(248, value);\\n }\\n return uint248(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint240 from uint256, reverting on\\n * overflow (when the input is greater than largest uint240).\\n *\\n * Counterpart to Solidity's `uint240` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 240 bits\\n */\\n function toUint240(uint256 value) internal pure returns (uint240) {\\n if (value > type(uint240).max) {\\n revert SafeCastOverflowedUintDowncast(240, value);\\n }\\n return uint240(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint232 from uint256, reverting on\\n * overflow (when the input is greater than largest uint232).\\n *\\n * Counterpart to Solidity's `uint232` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 232 bits\\n */\\n function toUint232(uint256 value) internal pure returns (uint232) {\\n if (value > type(uint232).max) {\\n revert SafeCastOverflowedUintDowncast(232, value);\\n }\\n return uint232(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint224 from uint256, reverting on\\n * overflow (when the input is greater than largest uint224).\\n *\\n * Counterpart to Solidity's `uint224` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 224 bits\\n */\\n function toUint224(uint256 value) internal pure returns (uint224) {\\n if (value > type(uint224).max) {\\n revert SafeCastOverflowedUintDowncast(224, value);\\n }\\n return uint224(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint216 from uint256, reverting on\\n * overflow (when the input is greater than largest uint216).\\n *\\n * Counterpart to Solidity's `uint216` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 216 bits\\n */\\n function toUint216(uint256 value) internal pure returns (uint216) {\\n if (value > type(uint216).max) {\\n revert SafeCastOverflowedUintDowncast(216, value);\\n }\\n return uint216(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint208 from uint256, reverting on\\n * overflow (when the input is greater than largest uint208).\\n *\\n * Counterpart to Solidity's `uint208` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 208 bits\\n */\\n function toUint208(uint256 value) internal pure returns (uint208) {\\n if (value > type(uint208).max) {\\n revert SafeCastOverflowedUintDowncast(208, value);\\n }\\n return uint208(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint200 from uint256, reverting on\\n * overflow (when the input is greater than largest uint200).\\n *\\n * Counterpart to Solidity's `uint200` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 200 bits\\n */\\n function toUint200(uint256 value) internal pure returns (uint200) {\\n if (value > type(uint200).max) {\\n revert SafeCastOverflowedUintDowncast(200, value);\\n }\\n return uint200(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint192 from uint256, reverting on\\n * overflow (when the input is greater than largest uint192).\\n *\\n * Counterpart to Solidity's `uint192` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 192 bits\\n */\\n function toUint192(uint256 value) internal pure returns (uint192) {\\n if (value > type(uint192).max) {\\n revert SafeCastOverflowedUintDowncast(192, value);\\n }\\n return uint192(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint184 from uint256, reverting on\\n * overflow (when the input is greater than largest uint184).\\n *\\n * Counterpart to Solidity's `uint184` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 184 bits\\n */\\n function toUint184(uint256 value) internal pure returns (uint184) {\\n if (value > type(uint184).max) {\\n revert SafeCastOverflowedUintDowncast(184, value);\\n }\\n return uint184(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint176 from uint256, reverting on\\n * overflow (when the input is greater than largest uint176).\\n *\\n * Counterpart to Solidity's `uint176` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 176 bits\\n */\\n function toUint176(uint256 value) internal pure returns (uint176) {\\n if (value > type(uint176).max) {\\n revert SafeCastOverflowedUintDowncast(176, value);\\n }\\n return uint176(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint168 from uint256, reverting on\\n * overflow (when the input is greater than largest uint168).\\n *\\n * Counterpart to Solidity's `uint168` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 168 bits\\n */\\n function toUint168(uint256 value) internal pure returns (uint168) {\\n if (value > type(uint168).max) {\\n revert SafeCastOverflowedUintDowncast(168, value);\\n }\\n return uint168(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint160 from uint256, reverting on\\n * overflow (when the input is greater than largest uint160).\\n *\\n * Counterpart to Solidity's `uint160` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 160 bits\\n */\\n function toUint160(uint256 value) internal pure returns (uint160) {\\n if (value > type(uint160).max) {\\n revert SafeCastOverflowedUintDowncast(160, value);\\n }\\n return uint160(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint152 from uint256, reverting on\\n * overflow (when the input is greater than largest uint152).\\n *\\n * Counterpart to Solidity's `uint152` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 152 bits\\n */\\n function toUint152(uint256 value) internal pure returns (uint152) {\\n if (value > type(uint152).max) {\\n revert SafeCastOverflowedUintDowncast(152, value);\\n }\\n return uint152(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint144 from uint256, reverting on\\n * overflow (when the input is greater than largest uint144).\\n *\\n * Counterpart to Solidity's `uint144` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 144 bits\\n */\\n function toUint144(uint256 value) internal pure returns (uint144) {\\n if (value > type(uint144).max) {\\n revert SafeCastOverflowedUintDowncast(144, value);\\n }\\n return uint144(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint136 from uint256, reverting on\\n * overflow (when the input is greater than largest uint136).\\n *\\n * Counterpart to Solidity's `uint136` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 136 bits\\n */\\n function toUint136(uint256 value) internal pure returns (uint136) {\\n if (value > type(uint136).max) {\\n revert SafeCastOverflowedUintDowncast(136, value);\\n }\\n return uint136(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint128 from uint256, reverting on\\n * overflow (when the input is greater than largest uint128).\\n *\\n * Counterpart to Solidity's `uint128` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 128 bits\\n */\\n function toUint128(uint256 value) internal pure returns (uint128) {\\n if (value > type(uint128).max) {\\n revert SafeCastOverflowedUintDowncast(128, value);\\n }\\n return uint128(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint120 from uint256, reverting on\\n * overflow (when the input is greater than largest uint120).\\n *\\n * Counterpart to Solidity's `uint120` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 120 bits\\n */\\n function toUint120(uint256 value) internal pure returns (uint120) {\\n if (value > type(uint120).max) {\\n revert SafeCastOverflowedUintDowncast(120, value);\\n }\\n return uint120(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint112 from uint256, reverting on\\n * overflow (when the input is greater than largest uint112).\\n *\\n * Counterpart to Solidity's `uint112` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 112 bits\\n */\\n function toUint112(uint256 value) internal pure returns (uint112) {\\n if (value > type(uint112).max) {\\n revert SafeCastOverflowedUintDowncast(112, value);\\n }\\n return uint112(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint104 from uint256, reverting on\\n * overflow (when the input is greater than largest uint104).\\n *\\n * Counterpart to Solidity's `uint104` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 104 bits\\n */\\n function toUint104(uint256 value) internal pure returns (uint104) {\\n if (value > type(uint104).max) {\\n revert SafeCastOverflowedUintDowncast(104, value);\\n }\\n return uint104(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint96 from uint256, reverting on\\n * overflow (when the input is greater than largest uint96).\\n *\\n * Counterpart to Solidity's `uint96` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 96 bits\\n */\\n function toUint96(uint256 value) internal pure returns (uint96) {\\n if (value > type(uint96).max) {\\n revert SafeCastOverflowedUintDowncast(96, value);\\n }\\n return uint96(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint88 from uint256, reverting on\\n * overflow (when the input is greater than largest uint88).\\n *\\n * Counterpart to Solidity's `uint88` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 88 bits\\n */\\n function toUint88(uint256 value) internal pure returns (uint88) {\\n if (value > type(uint88).max) {\\n revert SafeCastOverflowedUintDowncast(88, value);\\n }\\n return uint88(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint80 from uint256, reverting on\\n * overflow (when the input is greater than largest uint80).\\n *\\n * Counterpart to Solidity's `uint80` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 80 bits\\n */\\n function toUint80(uint256 value) internal pure returns (uint80) {\\n if (value > type(uint80).max) {\\n revert SafeCastOverflowedUintDowncast(80, value);\\n }\\n return uint80(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint72 from uint256, reverting on\\n * overflow (when the input is greater than largest uint72).\\n *\\n * Counterpart to Solidity's `uint72` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 72 bits\\n */\\n function toUint72(uint256 value) internal pure returns (uint72) {\\n if (value > type(uint72).max) {\\n revert SafeCastOverflowedUintDowncast(72, value);\\n }\\n return uint72(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint64 from uint256, reverting on\\n * overflow (when the input is greater than largest uint64).\\n *\\n * Counterpart to Solidity's `uint64` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 64 bits\\n */\\n function toUint64(uint256 value) internal pure returns (uint64) {\\n if (value > type(uint64).max) {\\n revert SafeCastOverflowedUintDowncast(64, value);\\n }\\n return uint64(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint56 from uint256, reverting on\\n * overflow (when the input is greater than largest uint56).\\n *\\n * Counterpart to Solidity's `uint56` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 56 bits\\n */\\n function toUint56(uint256 value) internal pure returns (uint56) {\\n if (value > type(uint56).max) {\\n revert SafeCastOverflowedUintDowncast(56, value);\\n }\\n return uint56(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint48 from uint256, reverting on\\n * overflow (when the input is greater than largest uint48).\\n *\\n * Counterpart to Solidity's `uint48` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 48 bits\\n */\\n function toUint48(uint256 value) internal pure returns (uint48) {\\n if (value > type(uint48).max) {\\n revert SafeCastOverflowedUintDowncast(48, value);\\n }\\n return uint48(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint40 from uint256, reverting on\\n * overflow (when the input is greater than largest uint40).\\n *\\n * Counterpart to Solidity's `uint40` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 40 bits\\n */\\n function toUint40(uint256 value) internal pure returns (uint40) {\\n if (value > type(uint40).max) {\\n revert SafeCastOverflowedUintDowncast(40, value);\\n }\\n return uint40(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint32 from uint256, reverting on\\n * overflow (when the input is greater than largest uint32).\\n *\\n * Counterpart to Solidity's `uint32` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 32 bits\\n */\\n function toUint32(uint256 value) internal pure returns (uint32) {\\n if (value > type(uint32).max) {\\n revert SafeCastOverflowedUintDowncast(32, value);\\n }\\n return uint32(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint24 from uint256, reverting on\\n * overflow (when the input is greater than largest uint24).\\n *\\n * Counterpart to Solidity's `uint24` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 24 bits\\n */\\n function toUint24(uint256 value) internal pure returns (uint24) {\\n if (value > type(uint24).max) {\\n revert SafeCastOverflowedUintDowncast(24, value);\\n }\\n return uint24(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint16 from uint256, reverting on\\n * overflow (when the input is greater than largest uint16).\\n *\\n * Counterpart to Solidity's `uint16` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 16 bits\\n */\\n function toUint16(uint256 value) internal pure returns (uint16) {\\n if (value > type(uint16).max) {\\n revert SafeCastOverflowedUintDowncast(16, value);\\n }\\n return uint16(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint8 from uint256, reverting on\\n * overflow (when the input is greater than largest uint8).\\n *\\n * Counterpart to Solidity's `uint8` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 8 bits\\n */\\n function toUint8(uint256 value) internal pure returns (uint8) {\\n if (value > type(uint8).max) {\\n revert SafeCastOverflowedUintDowncast(8, value);\\n }\\n return uint8(value);\\n }\\n\\n /**\\n * @dev Converts a signed int256 into an unsigned uint256.\\n *\\n * Requirements:\\n *\\n * - input must be greater than or equal to 0.\\n */\\n function toUint256(int256 value) internal pure returns (uint256) {\\n if (value < 0) {\\n revert SafeCastOverflowedIntToUint(value);\\n }\\n return uint256(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted int248 from int256, reverting on\\n * overflow (when the input is less than smallest int248 or\\n * greater than largest int248).\\n *\\n * Counterpart to Solidity's `int248` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 248 bits\\n */\\n function toInt248(int256 value) internal pure returns (int248 downcasted) {\\n downcasted = int248(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(248, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int240 from int256, reverting on\\n * overflow (when the input is less than smallest int240 or\\n * greater than largest int240).\\n *\\n * Counterpart to Solidity's `int240` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 240 bits\\n */\\n function toInt240(int256 value) internal pure returns (int240 downcasted) {\\n downcasted = int240(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(240, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int232 from int256, reverting on\\n * overflow (when the input is less than smallest int232 or\\n * greater than largest int232).\\n *\\n * Counterpart to Solidity's `int232` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 232 bits\\n */\\n function toInt232(int256 value) internal pure returns (int232 downcasted) {\\n downcasted = int232(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(232, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int224 from int256, reverting on\\n * overflow (when the input is less than smallest int224 or\\n * greater than largest int224).\\n *\\n * Counterpart to Solidity's `int224` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 224 bits\\n */\\n function toInt224(int256 value) internal pure returns (int224 downcasted) {\\n downcasted = int224(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(224, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int216 from int256, reverting on\\n * overflow (when the input is less than smallest int216 or\\n * greater than largest int216).\\n *\\n * Counterpart to Solidity's `int216` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 216 bits\\n */\\n function toInt216(int256 value) internal pure returns (int216 downcasted) {\\n downcasted = int216(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(216, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int208 from int256, reverting on\\n * overflow (when the input is less than smallest int208 or\\n * greater than largest int208).\\n *\\n * Counterpart to Solidity's `int208` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 208 bits\\n */\\n function toInt208(int256 value) internal pure returns (int208 downcasted) {\\n downcasted = int208(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(208, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int200 from int256, reverting on\\n * overflow (when the input is less than smallest int200 or\\n * greater than largest int200).\\n *\\n * Counterpart to Solidity's `int200` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 200 bits\\n */\\n function toInt200(int256 value) internal pure returns (int200 downcasted) {\\n downcasted = int200(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(200, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int192 from int256, reverting on\\n * overflow (when the input is less than smallest int192 or\\n * greater than largest int192).\\n *\\n * Counterpart to Solidity's `int192` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 192 bits\\n */\\n function toInt192(int256 value) internal pure returns (int192 downcasted) {\\n downcasted = int192(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(192, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int184 from int256, reverting on\\n * overflow (when the input is less than smallest int184 or\\n * greater than largest int184).\\n *\\n * Counterpart to Solidity's `int184` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 184 bits\\n */\\n function toInt184(int256 value) internal pure returns (int184 downcasted) {\\n downcasted = int184(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(184, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int176 from int256, reverting on\\n * overflow (when the input is less than smallest int176 or\\n * greater than largest int176).\\n *\\n * Counterpart to Solidity's `int176` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 176 bits\\n */\\n function toInt176(int256 value) internal pure returns (int176 downcasted) {\\n downcasted = int176(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(176, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int168 from int256, reverting on\\n * overflow (when the input is less than smallest int168 or\\n * greater than largest int168).\\n *\\n * Counterpart to Solidity's `int168` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 168 bits\\n */\\n function toInt168(int256 value) internal pure returns (int168 downcasted) {\\n downcasted = int168(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(168, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int160 from int256, reverting on\\n * overflow (when the input is less than smallest int160 or\\n * greater than largest int160).\\n *\\n * Counterpart to Solidity's `int160` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 160 bits\\n */\\n function toInt160(int256 value) internal pure returns (int160 downcasted) {\\n downcasted = int160(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(160, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int152 from int256, reverting on\\n * overflow (when the input is less than smallest int152 or\\n * greater than largest int152).\\n *\\n * Counterpart to Solidity's `int152` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 152 bits\\n */\\n function toInt152(int256 value) internal pure returns (int152 downcasted) {\\n downcasted = int152(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(152, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int144 from int256, reverting on\\n * overflow (when the input is less than smallest int144 or\\n * greater than largest int144).\\n *\\n * Counterpart to Solidity's `int144` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 144 bits\\n */\\n function toInt144(int256 value) internal pure returns (int144 downcasted) {\\n downcasted = int144(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(144, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int136 from int256, reverting on\\n * overflow (when the input is less than smallest int136 or\\n * greater than largest int136).\\n *\\n * Counterpart to Solidity's `int136` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 136 bits\\n */\\n function toInt136(int256 value) internal pure returns (int136 downcasted) {\\n downcasted = int136(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(136, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int128 from int256, reverting on\\n * overflow (when the input is less than smallest int128 or\\n * greater than largest int128).\\n *\\n * Counterpart to Solidity's `int128` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 128 bits\\n */\\n function toInt128(int256 value) internal pure returns (int128 downcasted) {\\n downcasted = int128(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(128, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int120 from int256, reverting on\\n * overflow (when the input is less than smallest int120 or\\n * greater than largest int120).\\n *\\n * Counterpart to Solidity's `int120` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 120 bits\\n */\\n function toInt120(int256 value) internal pure returns (int120 downcasted) {\\n downcasted = int120(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(120, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int112 from int256, reverting on\\n * overflow (when the input is less than smallest int112 or\\n * greater than largest int112).\\n *\\n * Counterpart to Solidity's `int112` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 112 bits\\n */\\n function toInt112(int256 value) internal pure returns (int112 downcasted) {\\n downcasted = int112(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(112, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int104 from int256, reverting on\\n * overflow (when the input is less than smallest int104 or\\n * greater than largest int104).\\n *\\n * Counterpart to Solidity's `int104` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 104 bits\\n */\\n function toInt104(int256 value) internal pure returns (int104 downcasted) {\\n downcasted = int104(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(104, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int96 from int256, reverting on\\n * overflow (when the input is less than smallest int96 or\\n * greater than largest int96).\\n *\\n * Counterpart to Solidity's `int96` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 96 bits\\n */\\n function toInt96(int256 value) internal pure returns (int96 downcasted) {\\n downcasted = int96(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(96, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int88 from int256, reverting on\\n * overflow (when the input is less than smallest int88 or\\n * greater than largest int88).\\n *\\n * Counterpart to Solidity's `int88` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 88 bits\\n */\\n function toInt88(int256 value) internal pure returns (int88 downcasted) {\\n downcasted = int88(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(88, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int80 from int256, reverting on\\n * overflow (when the input is less than smallest int80 or\\n * greater than largest int80).\\n *\\n * Counterpart to Solidity's `int80` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 80 bits\\n */\\n function toInt80(int256 value) internal pure returns (int80 downcasted) {\\n downcasted = int80(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(80, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int72 from int256, reverting on\\n * overflow (when the input is less than smallest int72 or\\n * greater than largest int72).\\n *\\n * Counterpart to Solidity's `int72` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 72 bits\\n */\\n function toInt72(int256 value) internal pure returns (int72 downcasted) {\\n downcasted = int72(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(72, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int64 from int256, reverting on\\n * overflow (when the input is less than smallest int64 or\\n * greater than largest int64).\\n *\\n * Counterpart to Solidity's `int64` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 64 bits\\n */\\n function toInt64(int256 value) internal pure returns (int64 downcasted) {\\n downcasted = int64(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(64, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int56 from int256, reverting on\\n * overflow (when the input is less than smallest int56 or\\n * greater than largest int56).\\n *\\n * Counterpart to Solidity's `int56` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 56 bits\\n */\\n function toInt56(int256 value) internal pure returns (int56 downcasted) {\\n downcasted = int56(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(56, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int48 from int256, reverting on\\n * overflow (when the input is less than smallest int48 or\\n * greater than largest int48).\\n *\\n * Counterpart to Solidity's `int48` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 48 bits\\n */\\n function toInt48(int256 value) internal pure returns (int48 downcasted) {\\n downcasted = int48(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(48, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int40 from int256, reverting on\\n * overflow (when the input is less than smallest int40 or\\n * greater than largest int40).\\n *\\n * Counterpart to Solidity's `int40` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 40 bits\\n */\\n function toInt40(int256 value) internal pure returns (int40 downcasted) {\\n downcasted = int40(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(40, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int32 from int256, reverting on\\n * overflow (when the input is less than smallest int32 or\\n * greater than largest int32).\\n *\\n * Counterpart to Solidity's `int32` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 32 bits\\n */\\n function toInt32(int256 value) internal pure returns (int32 downcasted) {\\n downcasted = int32(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(32, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int24 from int256, reverting on\\n * overflow (when the input is less than smallest int24 or\\n * greater than largest int24).\\n *\\n * Counterpart to Solidity's `int24` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 24 bits\\n */\\n function toInt24(int256 value) internal pure returns (int24 downcasted) {\\n downcasted = int24(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(24, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int16 from int256, reverting on\\n * overflow (when the input is less than smallest int16 or\\n * greater than largest int16).\\n *\\n * Counterpart to Solidity's `int16` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 16 bits\\n */\\n function toInt16(int256 value) internal pure returns (int16 downcasted) {\\n downcasted = int16(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(16, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int8 from int256, reverting on\\n * overflow (when the input is less than smallest int8 or\\n * greater than largest int8).\\n *\\n * Counterpart to Solidity's `int8` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 8 bits\\n */\\n function toInt8(int256 value) internal pure returns (int8 downcasted) {\\n downcasted = int8(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(8, value);\\n }\\n }\\n\\n /**\\n * @dev Converts an unsigned uint256 into a signed int256.\\n *\\n * Requirements:\\n *\\n * - input must be less than or equal to maxInt256.\\n */\\n function toInt256(uint256 value) internal pure returns (int256) {\\n // Note: Unsafe cast below is okay because `type(int256).max` is guaranteed to be positive\\n if (value > uint256(type(int256).max)) {\\n revert SafeCastOverflowedUintToInt(value);\\n }\\n return int256(value);\\n }\\n\\n /**\\n * @dev Cast a boolean (false or true) to a uint256 (0 or 1) with no jump.\\n */\\n function toUint(bool b) internal pure returns (uint256 u) {\\n assembly (\\\"memory-safe\\\") {\\n u := iszero(iszero(b))\\n }\\n }\\n}\\n\",\"keccak256\":\"0x195533c86d0ef72bcc06456a4f66a9b941f38eb403739b00f21fd7c1abd1ae54\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/math/SignedMath.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/math/SignedMath.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {SafeCast} from \\\"./SafeCast.sol\\\";\\n\\n/**\\n * @dev Standard signed math utilities missing in the Solidity language.\\n */\\nlibrary SignedMath {\\n /**\\n * @dev Branchless ternary evaluation for `a ? b : c`. Gas costs are constant.\\n *\\n * IMPORTANT: This function may reduce bytecode size and consume less gas when used standalone.\\n * However, the compiler may optimize Solidity ternary operations (i.e. `a ? b : c`) to only compute\\n * one branch when needed, making this function more expensive.\\n */\\n function ternary(bool condition, int256 a, int256 b) internal pure returns (int256) {\\n unchecked {\\n // branchless ternary works because:\\n // b ^ (a ^ b) == a\\n // b ^ 0 == b\\n return b ^ ((a ^ b) * int256(SafeCast.toUint(condition)));\\n }\\n }\\n\\n /**\\n * @dev Returns the largest of two signed numbers.\\n */\\n function max(int256 a, int256 b) internal pure returns (int256) {\\n return ternary(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 ternary(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 // Formula from the \\\"Bit Twiddling Hacks\\\" by Sean Eron Anderson.\\n // Since `n` is a signed integer, the generated bytecode will use the SAR opcode to perform the right shift,\\n // taking advantage of the most significant (or \\\"sign\\\" bit) in two's complement representation.\\n // This opcode adds new most significant bits set to the value of the previous most significant bit. As a result,\\n // the mask will either be `bytes32(0)` (if n is positive) or `~bytes32(0)` (if n is negative).\\n int256 mask = n >> 255;\\n\\n // A `bytes32(0)` mask leaves the input unchanged, while a `~bytes32(0)` mask complements it.\\n return uint256((n + mask) ^ mask);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xb1970fac7b64e6c09611e6691791e848d5e3fe410fa5899e7df2e0afd77a99e3\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/structs/Checkpoints.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/structs/Checkpoints.sol)\\n// This file was procedurally generated from scripts/generate/templates/Checkpoints.js.\\n\\npragma solidity ^0.8.20;\\n\\nimport {Math} from \\\"../math/Math.sol\\\";\\n\\n/**\\n * @dev This library defines the `Trace*` struct, for checkpointing values as they change at different points in\\n * time, and later looking up past values by block number. See {Votes} as an example.\\n *\\n * To create a history of checkpoints define a variable type `Checkpoints.Trace*` in your contract, and store a new\\n * checkpoint for the current transaction block using the {push} function.\\n */\\nlibrary Checkpoints {\\n /**\\n * @dev A value was attempted to be inserted on a past checkpoint.\\n */\\n error CheckpointUnorderedInsertion();\\n\\n struct Trace224 {\\n Checkpoint224[] _checkpoints;\\n }\\n\\n struct Checkpoint224 {\\n uint32 _key;\\n uint224 _value;\\n }\\n\\n /**\\n * @dev Pushes a (`key`, `value`) pair into a Trace224 so that it is stored as the checkpoint.\\n *\\n * Returns previous value and new value.\\n *\\n * IMPORTANT: Never accept `key` as a user input, since an arbitrary `type(uint32).max` key set will disable the\\n * library.\\n */\\n function push(\\n Trace224 storage self,\\n uint32 key,\\n uint224 value\\n ) internal returns (uint224 oldValue, uint224 newValue) {\\n return _insert(self._checkpoints, key, value);\\n }\\n\\n /**\\n * @dev Returns the value in the first (oldest) checkpoint with key greater or equal than the search key, or zero if\\n * there is none.\\n */\\n function lowerLookup(Trace224 storage self, uint32 key) internal view returns (uint224) {\\n uint256 len = self._checkpoints.length;\\n uint256 pos = _lowerBinaryLookup(self._checkpoints, key, 0, len);\\n return pos == len ? 0 : _unsafeAccess(self._checkpoints, pos)._value;\\n }\\n\\n /**\\n * @dev Returns the value in the last (most recent) checkpoint with key lower or equal than the search key, or zero\\n * if there is none.\\n */\\n function upperLookup(Trace224 storage self, uint32 key) internal view returns (uint224) {\\n uint256 len = self._checkpoints.length;\\n uint256 pos = _upperBinaryLookup(self._checkpoints, key, 0, len);\\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\\n }\\n\\n /**\\n * @dev Returns the value in the last (most recent) checkpoint with key lower or equal than the search key, or zero\\n * if there is none.\\n *\\n * NOTE: This is a variant of {upperLookup} that is optimised to find \\\"recent\\\" checkpoint (checkpoints with high\\n * keys).\\n */\\n function upperLookupRecent(Trace224 storage self, uint32 key) internal view returns (uint224) {\\n uint256 len = self._checkpoints.length;\\n\\n uint256 low = 0;\\n uint256 high = len;\\n\\n if (len > 5) {\\n uint256 mid = len - Math.sqrt(len);\\n if (key < _unsafeAccess(self._checkpoints, mid)._key) {\\n high = mid;\\n } else {\\n low = mid + 1;\\n }\\n }\\n\\n uint256 pos = _upperBinaryLookup(self._checkpoints, key, low, high);\\n\\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\\n }\\n\\n /**\\n * @dev Returns the value in the most recent checkpoint, or zero if there are no checkpoints.\\n */\\n function latest(Trace224 storage self) internal view returns (uint224) {\\n uint256 pos = self._checkpoints.length;\\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\\n }\\n\\n /**\\n * @dev Returns whether there is a checkpoint in the structure (i.e. it is not empty), and if so the key and value\\n * in the most recent checkpoint.\\n */\\n function latestCheckpoint(Trace224 storage self) internal view returns (bool exists, uint32 _key, uint224 _value) {\\n uint256 pos = self._checkpoints.length;\\n if (pos == 0) {\\n return (false, 0, 0);\\n } else {\\n Checkpoint224 storage ckpt = _unsafeAccess(self._checkpoints, pos - 1);\\n return (true, ckpt._key, ckpt._value);\\n }\\n }\\n\\n /**\\n * @dev Returns the number of checkpoint.\\n */\\n function length(Trace224 storage self) internal view returns (uint256) {\\n return self._checkpoints.length;\\n }\\n\\n /**\\n * @dev Returns checkpoint at given position.\\n */\\n function at(Trace224 storage self, uint32 pos) internal view returns (Checkpoint224 memory) {\\n return self._checkpoints[pos];\\n }\\n\\n /**\\n * @dev Pushes a (`key`, `value`) pair into an ordered list of checkpoints, either by inserting a new checkpoint,\\n * or by updating the last one.\\n */\\n function _insert(\\n Checkpoint224[] storage self,\\n uint32 key,\\n uint224 value\\n ) private returns (uint224 oldValue, uint224 newValue) {\\n uint256 pos = self.length;\\n\\n if (pos > 0) {\\n Checkpoint224 storage last = _unsafeAccess(self, pos - 1);\\n uint32 lastKey = last._key;\\n uint224 lastValue = last._value;\\n\\n // Checkpoint keys must be non-decreasing.\\n if (lastKey > key) {\\n revert CheckpointUnorderedInsertion();\\n }\\n\\n // Update or push new checkpoint\\n if (lastKey == key) {\\n last._value = value;\\n } else {\\n self.push(Checkpoint224({_key: key, _value: value}));\\n }\\n return (lastValue, value);\\n } else {\\n self.push(Checkpoint224({_key: key, _value: value}));\\n return (0, value);\\n }\\n }\\n\\n /**\\n * @dev Return the index of the first (oldest) checkpoint with key strictly bigger than the search key, or `high`\\n * if there is none. `low` and `high` define a section where to do the search, with inclusive `low` and exclusive\\n * `high`.\\n *\\n * WARNING: `high` should not be greater than the array's length.\\n */\\n function _upperBinaryLookup(\\n Checkpoint224[] storage self,\\n uint32 key,\\n uint256 low,\\n uint256 high\\n ) private view returns (uint256) {\\n while (low < high) {\\n uint256 mid = Math.average(low, high);\\n if (_unsafeAccess(self, mid)._key > key) {\\n high = mid;\\n } else {\\n low = mid + 1;\\n }\\n }\\n return high;\\n }\\n\\n /**\\n * @dev Return the index of the first (oldest) checkpoint with key greater or equal than the search key, or `high`\\n * if there is none. `low` and `high` define a section where to do the search, with inclusive `low` and exclusive\\n * `high`.\\n *\\n * WARNING: `high` should not be greater than the array's length.\\n */\\n function _lowerBinaryLookup(\\n Checkpoint224[] storage self,\\n uint32 key,\\n uint256 low,\\n uint256 high\\n ) private view returns (uint256) {\\n while (low < high) {\\n uint256 mid = Math.average(low, high);\\n if (_unsafeAccess(self, mid)._key < key) {\\n low = mid + 1;\\n } else {\\n high = mid;\\n }\\n }\\n return high;\\n }\\n\\n /**\\n * @dev Access an element of the array without performing bounds check. The position is assumed to be within bounds.\\n */\\n function _unsafeAccess(\\n Checkpoint224[] storage self,\\n uint256 pos\\n ) private pure returns (Checkpoint224 storage result) {\\n assembly {\\n mstore(0, self.slot)\\n result.slot := add(keccak256(0, 0x20), pos)\\n }\\n }\\n\\n struct Trace208 {\\n Checkpoint208[] _checkpoints;\\n }\\n\\n struct Checkpoint208 {\\n uint48 _key;\\n uint208 _value;\\n }\\n\\n /**\\n * @dev Pushes a (`key`, `value`) pair into a Trace208 so that it is stored as the checkpoint.\\n *\\n * Returns previous value and new value.\\n *\\n * IMPORTANT: Never accept `key` as a user input, since an arbitrary `type(uint48).max` key set will disable the\\n * library.\\n */\\n function push(\\n Trace208 storage self,\\n uint48 key,\\n uint208 value\\n ) internal returns (uint208 oldValue, uint208 newValue) {\\n return _insert(self._checkpoints, key, value);\\n }\\n\\n /**\\n * @dev Returns the value in the first (oldest) checkpoint with key greater or equal than the search key, or zero if\\n * there is none.\\n */\\n function lowerLookup(Trace208 storage self, uint48 key) internal view returns (uint208) {\\n uint256 len = self._checkpoints.length;\\n uint256 pos = _lowerBinaryLookup(self._checkpoints, key, 0, len);\\n return pos == len ? 0 : _unsafeAccess(self._checkpoints, pos)._value;\\n }\\n\\n /**\\n * @dev Returns the value in the last (most recent) checkpoint with key lower or equal than the search key, or zero\\n * if there is none.\\n */\\n function upperLookup(Trace208 storage self, uint48 key) internal view returns (uint208) {\\n uint256 len = self._checkpoints.length;\\n uint256 pos = _upperBinaryLookup(self._checkpoints, key, 0, len);\\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\\n }\\n\\n /**\\n * @dev Returns the value in the last (most recent) checkpoint with key lower or equal than the search key, or zero\\n * if there is none.\\n *\\n * NOTE: This is a variant of {upperLookup} that is optimised to find \\\"recent\\\" checkpoint (checkpoints with high\\n * keys).\\n */\\n function upperLookupRecent(Trace208 storage self, uint48 key) internal view returns (uint208) {\\n uint256 len = self._checkpoints.length;\\n\\n uint256 low = 0;\\n uint256 high = len;\\n\\n if (len > 5) {\\n uint256 mid = len - Math.sqrt(len);\\n if (key < _unsafeAccess(self._checkpoints, mid)._key) {\\n high = mid;\\n } else {\\n low = mid + 1;\\n }\\n }\\n\\n uint256 pos = _upperBinaryLookup(self._checkpoints, key, low, high);\\n\\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\\n }\\n\\n /**\\n * @dev Returns the value in the most recent checkpoint, or zero if there are no checkpoints.\\n */\\n function latest(Trace208 storage self) internal view returns (uint208) {\\n uint256 pos = self._checkpoints.length;\\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\\n }\\n\\n /**\\n * @dev Returns whether there is a checkpoint in the structure (i.e. it is not empty), and if so the key and value\\n * in the most recent checkpoint.\\n */\\n function latestCheckpoint(Trace208 storage self) internal view returns (bool exists, uint48 _key, uint208 _value) {\\n uint256 pos = self._checkpoints.length;\\n if (pos == 0) {\\n return (false, 0, 0);\\n } else {\\n Checkpoint208 storage ckpt = _unsafeAccess(self._checkpoints, pos - 1);\\n return (true, ckpt._key, ckpt._value);\\n }\\n }\\n\\n /**\\n * @dev Returns the number of checkpoint.\\n */\\n function length(Trace208 storage self) internal view returns (uint256) {\\n return self._checkpoints.length;\\n }\\n\\n /**\\n * @dev Returns checkpoint at given position.\\n */\\n function at(Trace208 storage self, uint32 pos) internal view returns (Checkpoint208 memory) {\\n return self._checkpoints[pos];\\n }\\n\\n /**\\n * @dev Pushes a (`key`, `value`) pair into an ordered list of checkpoints, either by inserting a new checkpoint,\\n * or by updating the last one.\\n */\\n function _insert(\\n Checkpoint208[] storage self,\\n uint48 key,\\n uint208 value\\n ) private returns (uint208 oldValue, uint208 newValue) {\\n uint256 pos = self.length;\\n\\n if (pos > 0) {\\n Checkpoint208 storage last = _unsafeAccess(self, pos - 1);\\n uint48 lastKey = last._key;\\n uint208 lastValue = last._value;\\n\\n // Checkpoint keys must be non-decreasing.\\n if (lastKey > key) {\\n revert CheckpointUnorderedInsertion();\\n }\\n\\n // Update or push new checkpoint\\n if (lastKey == key) {\\n last._value = value;\\n } else {\\n self.push(Checkpoint208({_key: key, _value: value}));\\n }\\n return (lastValue, value);\\n } else {\\n self.push(Checkpoint208({_key: key, _value: value}));\\n return (0, value);\\n }\\n }\\n\\n /**\\n * @dev Return the index of the first (oldest) checkpoint with key strictly bigger than the search key, or `high`\\n * if there is none. `low` and `high` define a section where to do the search, with inclusive `low` and exclusive\\n * `high`.\\n *\\n * WARNING: `high` should not be greater than the array's length.\\n */\\n function _upperBinaryLookup(\\n Checkpoint208[] storage self,\\n uint48 key,\\n uint256 low,\\n uint256 high\\n ) private view returns (uint256) {\\n while (low < high) {\\n uint256 mid = Math.average(low, high);\\n if (_unsafeAccess(self, mid)._key > key) {\\n high = mid;\\n } else {\\n low = mid + 1;\\n }\\n }\\n return high;\\n }\\n\\n /**\\n * @dev Return the index of the first (oldest) checkpoint with key greater or equal than the search key, or `high`\\n * if there is none. `low` and `high` define a section where to do the search, with inclusive `low` and exclusive\\n * `high`.\\n *\\n * WARNING: `high` should not be greater than the array's length.\\n */\\n function _lowerBinaryLookup(\\n Checkpoint208[] storage self,\\n uint48 key,\\n uint256 low,\\n uint256 high\\n ) private view returns (uint256) {\\n while (low < high) {\\n uint256 mid = Math.average(low, high);\\n if (_unsafeAccess(self, mid)._key < key) {\\n low = mid + 1;\\n } else {\\n high = mid;\\n }\\n }\\n return high;\\n }\\n\\n /**\\n * @dev Access an element of the array without performing bounds check. The position is assumed to be within bounds.\\n */\\n function _unsafeAccess(\\n Checkpoint208[] storage self,\\n uint256 pos\\n ) private pure returns (Checkpoint208 storage result) {\\n assembly {\\n mstore(0, self.slot)\\n result.slot := add(keccak256(0, 0x20), pos)\\n }\\n }\\n\\n struct Trace160 {\\n Checkpoint160[] _checkpoints;\\n }\\n\\n struct Checkpoint160 {\\n uint96 _key;\\n uint160 _value;\\n }\\n\\n /**\\n * @dev Pushes a (`key`, `value`) pair into a Trace160 so that it is stored as the checkpoint.\\n *\\n * Returns previous value and new value.\\n *\\n * IMPORTANT: Never accept `key` as a user input, since an arbitrary `type(uint96).max` key set will disable the\\n * library.\\n */\\n function push(\\n Trace160 storage self,\\n uint96 key,\\n uint160 value\\n ) internal returns (uint160 oldValue, uint160 newValue) {\\n return _insert(self._checkpoints, key, value);\\n }\\n\\n /**\\n * @dev Returns the value in the first (oldest) checkpoint with key greater or equal than the search key, or zero if\\n * there is none.\\n */\\n function lowerLookup(Trace160 storage self, uint96 key) internal view returns (uint160) {\\n uint256 len = self._checkpoints.length;\\n uint256 pos = _lowerBinaryLookup(self._checkpoints, key, 0, len);\\n return pos == len ? 0 : _unsafeAccess(self._checkpoints, pos)._value;\\n }\\n\\n /**\\n * @dev Returns the value in the last (most recent) checkpoint with key lower or equal than the search key, or zero\\n * if there is none.\\n */\\n function upperLookup(Trace160 storage self, uint96 key) internal view returns (uint160) {\\n uint256 len = self._checkpoints.length;\\n uint256 pos = _upperBinaryLookup(self._checkpoints, key, 0, len);\\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\\n }\\n\\n /**\\n * @dev Returns the value in the last (most recent) checkpoint with key lower or equal than the search key, or zero\\n * if there is none.\\n *\\n * NOTE: This is a variant of {upperLookup} that is optimised to find \\\"recent\\\" checkpoint (checkpoints with high\\n * keys).\\n */\\n function upperLookupRecent(Trace160 storage self, uint96 key) internal view returns (uint160) {\\n uint256 len = self._checkpoints.length;\\n\\n uint256 low = 0;\\n uint256 high = len;\\n\\n if (len > 5) {\\n uint256 mid = len - Math.sqrt(len);\\n if (key < _unsafeAccess(self._checkpoints, mid)._key) {\\n high = mid;\\n } else {\\n low = mid + 1;\\n }\\n }\\n\\n uint256 pos = _upperBinaryLookup(self._checkpoints, key, low, high);\\n\\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\\n }\\n\\n /**\\n * @dev Returns the value in the most recent checkpoint, or zero if there are no checkpoints.\\n */\\n function latest(Trace160 storage self) internal view returns (uint160) {\\n uint256 pos = self._checkpoints.length;\\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\\n }\\n\\n /**\\n * @dev Returns whether there is a checkpoint in the structure (i.e. it is not empty), and if so the key and value\\n * in the most recent checkpoint.\\n */\\n function latestCheckpoint(Trace160 storage self) internal view returns (bool exists, uint96 _key, uint160 _value) {\\n uint256 pos = self._checkpoints.length;\\n if (pos == 0) {\\n return (false, 0, 0);\\n } else {\\n Checkpoint160 storage ckpt = _unsafeAccess(self._checkpoints, pos - 1);\\n return (true, ckpt._key, ckpt._value);\\n }\\n }\\n\\n /**\\n * @dev Returns the number of checkpoint.\\n */\\n function length(Trace160 storage self) internal view returns (uint256) {\\n return self._checkpoints.length;\\n }\\n\\n /**\\n * @dev Returns checkpoint at given position.\\n */\\n function at(Trace160 storage self, uint32 pos) internal view returns (Checkpoint160 memory) {\\n return self._checkpoints[pos];\\n }\\n\\n /**\\n * @dev Pushes a (`key`, `value`) pair into an ordered list of checkpoints, either by inserting a new checkpoint,\\n * or by updating the last one.\\n */\\n function _insert(\\n Checkpoint160[] storage self,\\n uint96 key,\\n uint160 value\\n ) private returns (uint160 oldValue, uint160 newValue) {\\n uint256 pos = self.length;\\n\\n if (pos > 0) {\\n Checkpoint160 storage last = _unsafeAccess(self, pos - 1);\\n uint96 lastKey = last._key;\\n uint160 lastValue = last._value;\\n\\n // Checkpoint keys must be non-decreasing.\\n if (lastKey > key) {\\n revert CheckpointUnorderedInsertion();\\n }\\n\\n // Update or push new checkpoint\\n if (lastKey == key) {\\n last._value = value;\\n } else {\\n self.push(Checkpoint160({_key: key, _value: value}));\\n }\\n return (lastValue, value);\\n } else {\\n self.push(Checkpoint160({_key: key, _value: value}));\\n return (0, value);\\n }\\n }\\n\\n /**\\n * @dev Return the index of the first (oldest) checkpoint with key strictly bigger than the search key, or `high`\\n * if there is none. `low` and `high` define a section where to do the search, with inclusive `low` and exclusive\\n * `high`.\\n *\\n * WARNING: `high` should not be greater than the array's length.\\n */\\n function _upperBinaryLookup(\\n Checkpoint160[] storage self,\\n uint96 key,\\n uint256 low,\\n uint256 high\\n ) private view returns (uint256) {\\n while (low < high) {\\n uint256 mid = Math.average(low, high);\\n if (_unsafeAccess(self, mid)._key > key) {\\n high = mid;\\n } else {\\n low = mid + 1;\\n }\\n }\\n return high;\\n }\\n\\n /**\\n * @dev Return the index of the first (oldest) checkpoint with key greater or equal than the search key, or `high`\\n * if there is none. `low` and `high` define a section where to do the search, with inclusive `low` and exclusive\\n * `high`.\\n *\\n * WARNING: `high` should not be greater than the array's length.\\n */\\n function _lowerBinaryLookup(\\n Checkpoint160[] storage self,\\n uint96 key,\\n uint256 low,\\n uint256 high\\n ) private view returns (uint256) {\\n while (low < high) {\\n uint256 mid = Math.average(low, high);\\n if (_unsafeAccess(self, mid)._key < key) {\\n low = mid + 1;\\n } else {\\n high = mid;\\n }\\n }\\n return high;\\n }\\n\\n /**\\n * @dev Access an element of the array without performing bounds check. The position is assumed to be within bounds.\\n */\\n function _unsafeAccess(\\n Checkpoint160[] storage self,\\n uint256 pos\\n ) private pure returns (Checkpoint160 storage result) {\\n assembly {\\n mstore(0, self.slot)\\n result.slot := add(keccak256(0, 0x20), pos)\\n }\\n }\\n}\\n\",\"keccak256\":\"0x66364cd3247ea71cdb58f080f5d5ed6732433a8001413139661841535494692f\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/types/Time.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/types/Time.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {Math} from \\\"../math/Math.sol\\\";\\nimport {SafeCast} from \\\"../math/SafeCast.sol\\\";\\n\\n/**\\n * @dev This library provides helpers for manipulating time-related objects.\\n *\\n * It uses the following types:\\n * - `uint48` for timepoints\\n * - `uint32` for durations\\n *\\n * While the library doesn't provide specific types for timepoints and duration, it does provide:\\n * - a `Delay` type to represent duration that can be programmed to change value automatically at a given point\\n * - additional helper functions\\n */\\nlibrary Time {\\n using Time for *;\\n\\n /**\\n * @dev Get the block timestamp as a Timepoint.\\n */\\n function timestamp() internal view returns (uint48) {\\n return SafeCast.toUint48(block.timestamp);\\n }\\n\\n /**\\n * @dev Get the block number as a Timepoint.\\n */\\n function blockNumber() internal view returns (uint48) {\\n return SafeCast.toUint48(block.number);\\n }\\n\\n // ==================================================== Delay =====================================================\\n /**\\n * @dev A `Delay` is a uint32 duration that can be programmed to change value automatically at a given point in the\\n * future. The \\\"effect\\\" timepoint describes when the transitions happens from the \\\"old\\\" value to the \\\"new\\\" value.\\n * This allows updating the delay applied to some operation while keeping some guarantees.\\n *\\n * In particular, the {update} function guarantees that if the delay is reduced, the old delay still applies for\\n * some time. For example if the delay is currently 7 days to do an upgrade, the admin should not be able to set\\n * the delay to 0 and upgrade immediately. If the admin wants to reduce the delay, the old delay (7 days) should\\n * still apply for some time.\\n *\\n *\\n * The `Delay` type is 112 bits long, and packs the following:\\n *\\n * ```\\n * | [uint48]: effect date (timepoint)\\n * | | [uint32]: value before (duration)\\n * \\u2193 \\u2193 \\u2193 [uint32]: value after (duration)\\n * 0xAAAAAAAAAAAABBBBBBBBCCCCCCCC\\n * ```\\n *\\n * NOTE: The {get} and {withUpdate} functions operate using timestamps. Block number based delays are not currently\\n * supported.\\n */\\n type Delay is uint112;\\n\\n /**\\n * @dev Wrap a duration into a Delay to add the one-step \\\"update in the future\\\" feature\\n */\\n function toDelay(uint32 duration) internal pure returns (Delay) {\\n return Delay.wrap(duration);\\n }\\n\\n /**\\n * @dev Get the value at a given timepoint plus the pending value and effect timepoint if there is a scheduled\\n * change after this timepoint. If the effect timepoint is 0, then the pending value should not be considered.\\n */\\n function _getFullAt(\\n Delay self,\\n uint48 timepoint\\n ) private pure returns (uint32 valueBefore, uint32 valueAfter, uint48 effect) {\\n (valueBefore, valueAfter, effect) = self.unpack();\\n return effect <= timepoint ? (valueAfter, 0, 0) : (valueBefore, valueAfter, effect);\\n }\\n\\n /**\\n * @dev Get the current value plus the pending value and effect timepoint if there is a scheduled change. If the\\n * effect timepoint is 0, then the pending value should not be considered.\\n */\\n function getFull(Delay self) internal view returns (uint32 valueBefore, uint32 valueAfter, uint48 effect) {\\n return _getFullAt(self, timestamp());\\n }\\n\\n /**\\n * @dev Get the current value.\\n */\\n function get(Delay self) internal view returns (uint32) {\\n (uint32 delay, , ) = self.getFull();\\n return delay;\\n }\\n\\n /**\\n * @dev Update a Delay object so that it takes a new duration after a timepoint that is automatically computed to\\n * enforce the old delay at the moment of the update. Returns the updated Delay object and the timestamp when the\\n * new delay becomes effective.\\n */\\n function withUpdate(\\n Delay self,\\n uint32 newValue,\\n uint32 minSetback\\n ) internal view returns (Delay updatedDelay, uint48 effect) {\\n uint32 value = self.get();\\n uint32 setback = uint32(Math.max(minSetback, value > newValue ? value - newValue : 0));\\n effect = timestamp() + setback;\\n return (pack(value, newValue, effect), effect);\\n }\\n\\n /**\\n * @dev Split a delay into its components: valueBefore, valueAfter and effect (transition timepoint).\\n */\\n function unpack(Delay self) internal pure returns (uint32 valueBefore, uint32 valueAfter, uint48 effect) {\\n uint112 raw = Delay.unwrap(self);\\n\\n valueAfter = uint32(raw);\\n valueBefore = uint32(raw >> 32);\\n effect = uint48(raw >> 64);\\n\\n return (valueBefore, valueAfter, effect);\\n }\\n\\n /**\\n * @dev pack the components into a Delay object.\\n */\\n function pack(uint32 valueBefore, uint32 valueAfter, uint48 effect) internal pure returns (Delay) {\\n return Delay.wrap((uint112(effect) << 64) | (uint112(valueBefore) << 32) | uint112(valueAfter));\\n }\\n}\\n\",\"keccak256\":\"0x36776530f012618bc7526ceb28e77b85e582cb12d9b9466a71d4bd6bf952e4cc\",\"license\":\"MIT\"},\"contracts/variants/crosschain/NFT.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity ^0.8.20;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC721/ERC721.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC721/extensions/ERC721Burnable.sol\\\";\\nimport \\\"@openzeppelin/contracts/access/Ownable.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/cryptography/EIP712.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC721/extensions/ERC721Votes.sol\\\";\\nimport \\\"./ProofHandler.sol\\\";\\n\\n/**\\n * @title Cross-chain Membership NFT Contract\\n * @author Web3 Hackers Collective\\n * @notice Non-transferable NFT implementation for DAO membership with cross-chain capabilities\\n * @dev Extends OpenZeppelin's NFT standards with cross-chain operation support and delegation\\n * @custom:security-contact julien@strat.cc\\n */\\ncontract NFT is\\n ERC721,\\n ERC721Enumerable,\\n ERC721URIStorage,\\n ERC721Burnable,\\n Ownable,\\n EIP712,\\n ERC721Votes\\n{\\n using ProofHandler for ProofHandler.ProofStorage;\\n\\n /// @notice Chain ID where contract was originally deployed\\n uint256 public immutable home;\\n\\n /// @notice Next token ID to be minted\\n uint256 private _nextTokenId;\\n\\n /// @notice Storage for proof handling\\n ProofHandler.ProofStorage private _proofStorage;\\n\\n /// @notice Types of operations that can be synchronized across chains\\n enum OperationType {\\n MINT,\\n BURN,\\n SET_METADATA,\\n DELEGATE\\n }\\n\\n /// @notice Emitted when a membership is claimed\\n /// @param tokenId The ID of the claimed token\\n /// @param member The address receiving the membership\\n /// @param nonce Operation sequence number\\n event MembershipClaimed(uint256 indexed tokenId, address indexed member, uint256 nonce);\\n\\n /// @notice Emitted when a membership is revoked\\n /// @param tokenId The ID of the revoked token\\n /// @param member The address losing membership\\n /// @param nonce Operation sequence number\\n event MembershipRevoked(uint256 indexed tokenId, address indexed member, uint256 nonce);\\n\\n /// @notice Emitted when metadata is updated\\n /// @param tokenId The ID of the updated token\\n /// @param newUri The new metadata URI\\n /// @param nonce Operation sequence number\\n event MetadataUpdated(uint256 indexed tokenId, string newUri, uint256 nonce);\\n\\n /// @notice Emitted when delegation is synchronized across chains\\n /// @param delegator The address delegating their voting power\\n /// @param delegatee The address receiving the delegation\\n /// @param nonce Operation sequence number\\n event DelegationSynced(address indexed delegator, address indexed delegatee, uint256 nonce);\\n\\n /// @notice Restricts functions to home chain\\n modifier onlyHomeChain() {\\n require(block.chainid == home, \\\"Operation only allowed on home chain\\\");\\n _;\\n }\\n\\n /**\\n * @notice Initializes the NFT contract\\n * @param _home Chain ID where contract is considered home\\n * @param initialOwner Initial contract owner\\n * @param _firstMembers Array of initial member addresses\\n * @param _uri Initial token URI\\n * @param _name Token collection name\\n * @param _symbol Token collection symbol\\n */\\n constructor(\\n uint256 _home,\\n address initialOwner,\\n address[] memory _firstMembers,\\n string memory _uri,\\n string memory _name,\\n string memory _symbol\\n ) ERC721(_name, _symbol) Ownable(initialOwner) EIP712(_name, \\\"1\\\") {\\n home = _home;\\n for (uint i; i < _firstMembers.length; i++) {\\n _govMint(_firstMembers[i], _uri);\\n _delegate(_firstMembers[i], _firstMembers[i]);\\n }\\n }\\n\\n /**\\n * @notice Adds a new member on home chain\\n * @dev Only callable by owner (governance) on home chain\\n * @param to Address to mint token to\\n * @param uri Token metadata URI\\n */\\n function safeMint(address to, string memory uri) public onlyOwner onlyHomeChain {\\n uint256 nonce = _proofStorage.incrementNonce(uint8(OperationType.MINT));\\n _govMint(to, uri);\\n emit MembershipClaimed(_nextTokenId - 1, to, nonce);\\n }\\n\\n /**\\n * @notice Burns token on home chain\\n * @dev Only callable by owner (governance) on home chain\\n * @param tokenId ID of token to burn\\n */\\n function govBurn(uint256 tokenId) public onlyOwner onlyHomeChain {\\n uint256 nonce = _proofStorage.incrementNonce(uint8(OperationType.BURN));\\n address owner = ownerOf(tokenId);\\n _burn(tokenId);\\n emit MembershipRevoked(tokenId, owner, nonce);\\n }\\n\\n /**\\n * @notice Updates token metadata on home chain\\n * @dev Only callable by owner (governance) on home chain\\n * @param tokenId ID of token to update\\n * @param uri New metadata URI\\n */\\n function setMetadata(uint256 tokenId, string memory uri) public onlyOwner onlyHomeChain {\\n uint256 nonce = _proofStorage.incrementNonce(uint8(OperationType.SET_METADATA));\\n _setTokenURI(tokenId, uri);\\n emit MetadataUpdated(tokenId, uri, nonce);\\n }\\n\\n /**\\n * @notice Delegates voting power to another address on home chain\\n * @dev Overrides ERC721Votes delegate function to add cross-chain functionality\\n * @param delegatee Address to delegate voting power to\\n */\\n function delegate(address delegatee) public virtual override onlyHomeChain {\\n uint256 nonce = _proofStorage.incrementNonce(uint8(OperationType.DELEGATE));\\n _delegate(_msgSender(), delegatee);\\n emit DelegationSynced(_msgSender(), delegatee, nonce);\\n }\\n\\n /**\\n * @notice Generates proof for NFT operations\\n * @dev Only callable on home chain\\n * @param operationType Type of operation\\n * @param params Operation parameters\\n * @return Encoded proof data\\n */\\n function generateOperationProof(\\n uint8 operationType,\\n bytes memory params\\n ) external view returns (bytes memory) {\\n require(block.chainid == home, \\\"Proofs only generated on home chain\\\");\\n uint256 nextNonce = _proofStorage.getNextNonce(operationType);\\n return ProofHandler.generateProof(address(this), operationType, params, nextNonce);\\n }\\n\\n /**\\n * @notice Generates proof for delegation\\n * @dev Only callable on home chain\\n * @param delegator Address delegating voting power\\n * @param delegatee Address receiving delegation\\n * @return Encoded proof data\\n */\\n function generateDelegationProof(\\n address delegator,\\n address delegatee\\n ) external view returns (bytes memory) {\\n require(block.chainid == home, \\\"Proofs only generated on home chain\\\");\\n uint256 nextNonce = _proofStorage.getNextNonce(uint8(OperationType.DELEGATE));\\n bytes memory params = abi.encode(delegator, delegatee);\\n return\\n ProofHandler.generateProof(\\n address(this),\\n uint8(OperationType.DELEGATE),\\n params,\\n nextNonce\\n );\\n }\\n\\n // Claim operations\\n\\n /**\\n * @notice Claims an NFT operation on a foreign chain\\n * @param proof Proof generated by home chain\\n */\\n function claimOperation(bytes memory proof) external {\\n (uint8 operationType, bytes memory params, uint256 nonce) = ProofHandler\\n .verifyAndClaimProof(proof, address(this), _proofStorage);\\n\\n if (operationType == uint8(OperationType.MINT)) {\\n (address to, string memory uri) = abi.decode(params, (address, string));\\n _govMint(to, uri);\\n emit MembershipClaimed(_nextTokenId - 1, to, nonce);\\n } else if (operationType == uint8(OperationType.BURN)) {\\n uint256 tokenId = abi.decode(params, (uint256));\\n address owner = ownerOf(tokenId);\\n _burn(tokenId);\\n emit MembershipRevoked(tokenId, owner, nonce);\\n } else if (operationType == uint8(OperationType.SET_METADATA)) {\\n (uint256 tokenId, string memory uri) = abi.decode(params, (uint256, string));\\n _setTokenURI(tokenId, uri);\\n emit MetadataUpdated(tokenId, uri, nonce);\\n } else if (operationType == uint8(OperationType.DELEGATE)) {\\n (address delegator, address delegatee) = abi.decode(params, (address, address));\\n _delegate(delegator, delegatee);\\n emit DelegationSynced(delegator, delegatee, nonce);\\n }\\n }\\n\\n /**\\n * @notice Claims a delegation operation on a foreign chain\\n * @param proof Proof generated by home chain\\n */\\n function claimDelegation(bytes memory proof) external {\\n (uint8 operationType, bytes memory params, uint256 nonce) = ProofHandler\\n .verifyAndClaimProof(proof, address(this), _proofStorage);\\n\\n require(operationType == uint8(OperationType.DELEGATE), \\\"Invalid operation type\\\");\\n (address delegator, address delegatee) = abi.decode(params, (address, address));\\n\\n _delegate(delegator, delegatee);\\n emit DelegationSynced(delegator, delegatee, nonce);\\n }\\n\\n /**\\n * @notice Internal function for minting without proof verification\\n * @param to Address to receive token\\n * @param uri Token metadata URI\\n */\\n function _govMint(address to, string memory uri) internal {\\n uint256 tokenId = _nextTokenId++;\\n _safeMint(to, tokenId);\\n _setTokenURI(tokenId, uri);\\n _delegate(to, to);\\n }\\n\\n // Required overrides\\n\\n /**\\n * @notice Updates token data\\n * @dev Overrides ERC721 _update to make NFTs non-transferable\\n * @param to Recipient address\\n * @param tokenId Token ID\\n * @param auth Address authorized for transfer\\n * @return Previous owner address\\n */\\n function _update(\\n address to,\\n uint256 tokenId,\\n address auth\\n ) internal override(ERC721, ERC721Enumerable, ERC721Votes) returns (address) {\\n require(auth == address(0) || to == address(0), \\\"NFT is not transferable\\\");\\n return super._update(to, tokenId, auth);\\n }\\n\\n /**\\n * @notice Increments account balance\\n * @dev Internal override to maintain compatibility\\n * @param account Account to update\\n * @param value Amount to increase by\\n */\\n function _increaseBalance(\\n address account,\\n uint128 value\\n ) internal override(ERC721, ERC721Enumerable, ERC721Votes) {\\n super._increaseBalance(account, value);\\n }\\n\\n /**\\n * @notice Gets token URI\\n * @param tokenId Token ID to query\\n * @return URI string\\n */\\n function tokenURI(\\n uint256 tokenId\\n ) public view override(ERC721, ERC721URIStorage) returns (string memory) {\\n return super.tokenURI(tokenId);\\n }\\n\\n /**\\n * @notice Checks interface support\\n * @param interfaceId Interface identifier to check\\n * @return bool True if interface is supported\\n */\\n function supportsInterface(\\n bytes4 interfaceId\\n ) public view override(ERC721, ERC721Enumerable, ERC721URIStorage) returns (bool) {\\n return super.supportsInterface(interfaceId);\\n }\\n\\n /**\\n * @notice Gets current timestamp\\n * @dev Used for voting snapshots\\n * @return Current block timestamp\\n */\\n function clock() public view override returns (uint48) {\\n return uint48(block.timestamp);\\n }\\n\\n /**\\n * @notice Gets clock mode description\\n * @return String indicating timestamp-based voting\\n */\\n function CLOCK_MODE() public pure override returns (string memory) {\\n return \\\"mode=timestamp\\\";\\n }\\n}\\n\",\"keccak256\":\"0x3d703da3e4617f28dc5b0b763ff0485c49bcb162e4eb33d90f7384c7a1f5aed5\",\"license\":\"GPL-3.0\"},\"contracts/variants/crosschain/ProofHandler.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity ^0.8.20;\\n\\n/**\\n * @title Proof Handler Library\\n * @author Web3 Hackers Collective\\n * @notice Library for standardized cross-chain proof generation and verification\\n * @dev Handles proof generation, verification, and tracking for cross-chain operations\\n * @custom:security-contact julien@strat.cc\\n */\\nlibrary ProofHandler {\\n /// @notice Tracks which proofs have been applied on each chain\\n struct ProofStorage {\\n mapping(bytes32 => bool) updateAppliedOnChain;\\n mapping(uint8 => uint256) currentNonce;\\n }\\n\\n /// @dev Emitted when a proof is claimed\\n event ProofClaimed(uint8 indexed operationType, bytes params, uint256 nonce);\\n\\n /**\\n * @notice Generates a proof for cross-chain operations\\n * @param contractAddress Address of contract generating the proof\\n * @param operationType Type of operation being performed\\n * @param params Operation parameters\\n * @param nonce Current nonce for this operation type\\n * @return proof Encoded proof data\\n */\\n function generateProof(\\n address contractAddress,\\n uint8 operationType,\\n bytes memory params,\\n uint256 nonce\\n ) public pure returns (bytes memory proof) {\\n bytes32 message = keccak256(\\n abi.encodePacked(contractAddress, operationType, params, nonce)\\n );\\n bytes32 digest = keccak256(abi.encodePacked(\\\"\\\\x19Ethereum Signed Message:\\\\n32\\\", message));\\n\\n return abi.encode(operationType, params, nonce, digest);\\n }\\n\\n /**\\n * @notice Verifies and claims a proof\\n * @param proof Proof to verify and claim\\n * @param contractAddress Address of contract claiming the proof\\n * @param storage_ Proof storage struct\\n * @return operationType The type of operation being performed\\n * @return params The operation parameters\\n * @return nonce The operation sequence number\\n */\\n function verifyAndClaimProof(\\n bytes memory proof,\\n address contractAddress,\\n ProofStorage storage storage_\\n ) public returns (uint8 operationType, bytes memory params, uint256 nonce) {\\n bytes32 digest;\\n (operationType, params, nonce, digest) = abi.decode(\\n proof,\\n (uint8, bytes, uint256, bytes32)\\n );\\n\\n bytes32 proofHash = keccak256(proof);\\n require(!storage_.updateAppliedOnChain[proofHash], \\\"Proof already claimed\\\");\\n require(nonce == storage_.currentNonce[operationType] + 1, \\\"Invalid nonce\\\");\\n\\n bytes32 message = keccak256(\\n abi.encodePacked(contractAddress, operationType, params, nonce)\\n );\\n bytes32 expectedDigest = keccak256(\\n abi.encodePacked(\\\"\\\\x19Ethereum Signed Message:\\\\n32\\\", message)\\n );\\n require(digest == expectedDigest, \\\"Invalid proof\\\");\\n\\n storage_.updateAppliedOnChain[proofHash] = true;\\n storage_.currentNonce[operationType] = nonce;\\n\\n emit ProofClaimed(operationType, params, nonce);\\n\\n return (operationType, params, nonce);\\n }\\n\\n /**\\n * @notice Gets the next nonce for an operation type\\n * @param storage_ Proof storage struct\\n * @param operationType Type of operation\\n * @return nonce Next nonce value\\n */\\n function getNextNonce(\\n ProofStorage storage storage_,\\n uint8 operationType\\n ) public view returns (uint256 nonce) {\\n return storage_.currentNonce[operationType] + 1;\\n }\\n\\n /**\\n * @notice Increments the nonce for an operation type\\n * @param storage_ Proof storage struct\\n * @param operationType Type of operation\\n * @return nonce New nonce value\\n */\\n function incrementNonce(\\n ProofStorage storage storage_,\\n uint8 operationType\\n ) public returns (uint256 nonce) {\\n storage_.currentNonce[operationType]++;\\n return storage_.currentNonce[operationType];\\n }\\n}\\n\",\"keccak256\":\"0x3719e47c508f29977d48842c5c1d27cce7cb289cbb592526f170f98135ff41a7\",\"license\":\"GPL-3.0\"}},\"version\":1}", + "bytecode": "0x6101806040523480156200001257600080fd5b50604051620050023803806200500283398101604081905262000035916200126d565b6040805180820190915260018152603160f81b602082015282908682846000620000608382620013c8565b5060016200006f8282620013c8565b5050506001600160a01b038116620000a257604051631e4fbdf760e01b8152600060048201526024015b60405180910390fd5b620000ad8162000210565b50620000bb82600c62000262565b61012052620000cc81600d62000262565b61014052815160208084019190912060e052815190820120610100524660a0526200015a60e05161010051604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f60208201529081019290925260608201524660808201523060a082015260009060c00160405160208183030381529060405280519060200120905090565b60805250503060c05261016086905260005b84518110156200020357620001a48582815181106200018f576200018f62001494565b6020026020010151856200029b60201b60201c565b620001ee858281518110620001bd57620001bd62001494565b6020026020010151868381518110620001da57620001da62001494565b6020026020010151620002dd60201b60201c565b80620001fa81620014c0565b9150506200016c565b5050505050505062001628565b600b80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600060208351101562000282576200027a8362000353565b905062000295565b816200028f8482620013c8565b5060ff90505b92915050565b6012805460009182620002ae83620014c0565b909155509050620002c0838262000396565b620002cc8183620003bc565b620002d88380620002dd565b505050565b6001600160a01b038281166000818152600f602052604080822080548686166001600160a01b0319821681179092559151919094169392849290917f3134e8a2e6d97e929a7e54011ea5485d7d196dd5f0ba4d4ef95803e8e3fc257f9190a4620002d881836200034d866200040e565b6200041b565b600080829050601f8151111562000381578260405163305a27a960e01b81526004016200009991906200150a565b80516200038e826200151f565b179392505050565b620003b88282604051806020016040528060008152506200058860201b60201c565b5050565b6000828152600a60205260409020620003d68282620013c8565b506040518281527ff8e1a15aba9398e019f0b49df1a4fde98ee17ae345cb5f6b5e2c27f5033e8ce79060200160405180910390a15050565b60006200029582620005a4565b816001600160a01b0316836001600160a01b0316141580156200043e5750600081115b15620002d8576001600160a01b03831615620004e7576001600160a01b038316600090815260106020908152604082208291620004929190620005ee901b62001593176200048c8662000603565b6200063d565b6001600160d01b031691506001600160d01b03169150846001600160a01b031660008051602062004fe28339815191528383604051620004dc929190918252602082015260400190565b60405180910390a250505b6001600160a01b03821615620002d8576001600160a01b0382166000908152601060209081526040822082916200052f919062000671901b620015a6176200048c8662000603565b6001600160d01b031691506001600160d01b03169150836001600160a01b031660008051602062004fe2833981519152838360405162000579929190918252602082015260400190565b60405180910390a25050505050565b6200059483836200067f565b620002d8336000858585620006e9565b60006001600160a01b038216620005d2576040516322718ad960e21b81526000600482015260240162000099565b506001600160a01b031660009081526003602052604090205490565b6000620005fc828462001544565b9392505050565b60006001600160d01b0382111562000639576040516306dfcc6560e41b815260d060048201526024810183905260440162000099565b5090565b60008062000664426200065b620006548862000821565b868860201c565b87919062000870565b915091505b935093915050565b6000620005fc82846200156e565b6001600160a01b038216620006ab57604051633250574960e11b81526000600482015260240162000099565b6000620006ba83838362000880565b90506001600160a01b03811615620002d8576040516339e3563760e11b81526000600482015260240162000099565b6001600160a01b0383163b156200081a57604051630a85bd0160e11b81526001600160a01b0384169063150b7a02906200072e90889088908790879060040162001591565b6020604051808303816000875af19250505080156200076c575060408051601f3d908101601f191682019092526200076991810190620015d0565b60015b620007da573d8080156200079d576040519150601f19603f3d011682016040523d82523d6000602084013e620007a2565b606091505b508051600003620007d257604051633250574960e11b81526001600160a01b038516600482015260240162000099565b805181602001fd5b6001600160e01b03198116630a85bd0160e11b146200081857604051633250574960e11b81526001600160a01b038516600482015260240162000099565b505b5050505050565b8054600090801562000867576200084d836200083f600184620015fc565b600091825260209091200190565b54660100000000000090046001600160d01b0316620005fc565b60009392505050565b6000806200066485858562000903565b60006001600160a01b0382161580620008a057506001600160a01b038416155b620008ee5760405162461bcd60e51b815260206004820152601760248201527f4e4654206973206e6f74207472616e7366657261626c65000000000000000000604482015260640162000099565b620008fb84848462000a6c565b949350505050565b82546000908190801562000a0d57600062000925876200083f600185620015fc565b805490915065ffffffffffff80821691660100000000000090046001600160d01b03169088168211156200096c57604051632520601d60e01b815260040160405180910390fd5b8765ffffffffffff168265ffffffffffff1603620009aa57825465ffffffffffff1666010000000000006001600160d01b03891602178355620009fe565b6040805180820190915265ffffffffffff808a1682526001600160d01b03808a1660208085019182528d54600181018f5560008f815291909120945191519092166601000000000000029216919091179101555b94508593506200066992505050565b50506040805180820190915265ffffffffffff80851682526001600160d01b0380851660208085019182528854600181018a5560008a815291822095519251909316660100000000000002919093161792019190915590508162000669565b60008062000a7c85858562000a8c565b9050620008fb8186600162000b68565b60008062000a9c85858562000bfa565b90506001600160a01b03811662000afc5762000af684600880546000838152600960205260408120829055600182018355919091527ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee30155565b62000b22565b846001600160a01b0316816001600160a01b03161462000b225762000b22818562000cf9565b6001600160a01b03851662000b425762000b3c8462000d7d565b620008fb565b846001600160a01b0316816001600160a01b031614620008fb57620008fb858562000e37565b6001600160a01b03831662000b975762000b946011620015a66200067160201b176200048c8462000603565b50505b6001600160a01b03821662000bc65762000bc3601162001593620005ee60201b176200048c8462000603565b50505b6001600160a01b038381166000908152600f6020526040808220548584168352912054620002d8929182169116836200041b565b6000828152600260205260408120546001600160a01b039081169083161562000c2a5762000c2a81848662000e8b565b6001600160a01b0381161562000c6a5762000c49600085818062000ef5565b6001600160a01b038116600090815260036020526040902080546000190190555b6001600160a01b0385161562000c9a576001600160a01b0385166000908152600360205260409020805460010190555b60008481526002602052604080822080546001600160a01b0319166001600160a01b0389811691821790925591518793918516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4949350505050565b600062000d0683620005a4565b6000838152600760209081526040808320546001600160a01b038816845260069092529091209192509081831462000d5e57600083815260208281526040808320548584528184208190558352600790915290208290555b6000938452600760209081526040808620869055938552525081205550565b60085460009062000d9190600190620015fc565b6000838152600960205260408120546008805493945090928490811062000dbc5762000dbc62001494565b90600052602060002001549050806008838154811062000de05762000de062001494565b600091825260208083209091019290925582815260099091526040808220849055858252812055600880548062000e1b5762000e1b62001612565b6001900381819060005260206000200160009055905550505050565b6000600162000e4684620005a4565b62000e529190620015fc565b6001600160a01b039093166000908152600660209081526040808320868452825280832085905593825260079052919091209190915550565b62000e9883838362001023565b620002d8576001600160a01b03831662000ec957604051637e27328960e01b81526004810182905260240162000099565b60405163177e802f60e01b81526001600160a01b03831660048201526024810182905260440162000099565b808062000f0a57506001600160a01b03821615155b1562000ff357600062000f1d84620010a9565b90506001600160a01b0383161580159062000f4a5750826001600160a01b0316816001600160a01b031614155b801562000f7d57506001600160a01b0380821660009081526005602090815260408083209387168352929052205460ff16155b1562000fa85760405163a9fbf51f60e01b81526001600160a01b038416600482015260240162000099565b811562000ff15783856001600160a01b0316826001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45b505b5050600090815260046020526040902080546001600160a01b0319166001600160a01b0392909216919091179055565b60006001600160a01b03831615801590620008fb5750826001600160a01b0316846001600160a01b031614806200107f57506001600160a01b0380851660009081526005602090815260408083209387168352929052205460ff165b80620008fb5750506000908152600460205260409020546001600160a01b03908116911614919050565b6000818152600260205260408120546001600160a01b0316806200029557604051637e27328960e01b81526004810184905260240162000099565b80516001600160a01b0381168114620010fc57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b038111828210171562001142576200114262001101565b604052919050565b600082601f8301126200115c57600080fd5b815160206001600160401b038211156200117a576200117a62001101565b8160051b6200118b82820162001117565b9283528481018201928281019087851115620011a657600080fd5b83870192505b84831015620011d057620011c083620010e4565b82529183019190830190620011ac565b979650505050505050565b60005b83811015620011f8578181015183820152602001620011de565b50506000910152565b600082601f8301126200121357600080fd5b81516001600160401b038111156200122f576200122f62001101565b62001244601f8201601f191660200162001117565b8181528460208386010111156200125a57600080fd5b620008fb826020830160208701620011db565b60008060008060008060c087890312156200128757600080fd5b865195506200129960208801620010e4565b60408801519095506001600160401b0380821115620012b757600080fd5b620012c58a838b016200114a565b95506060890151915080821115620012dc57600080fd5b620012ea8a838b0162001201565b945060808901519150808211156200130157600080fd5b6200130f8a838b0162001201565b935060a08901519150808211156200132657600080fd5b506200133589828a0162001201565b9150509295509295509295565b600181811c908216806200135757607f821691505b6020821081036200137857634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115620002d857600081815260208120601f850160051c81016020861015620013a75750805b601f850160051c820191505b818110156200081857828155600101620013b3565b81516001600160401b03811115620013e457620013e462001101565b620013fc81620013f5845462001342565b846200137e565b602080601f8311600181146200143457600084156200141b5750858301515b600019600386901b1c1916600185901b17855562000818565b600085815260208120601f198616915b82811015620014655788860151825594840194600190910190840162001444565b5085821015620014845787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060018201620014d557620014d5620014aa565b5060010190565b60008151808452620014f6816020860160208601620011db565b601f01601f19169290920160200192915050565b602081526000620005fc6020830184620014dc565b80516020808301519190811015620013785760001960209190910360031b1b16919050565b6001600160d01b03828116828216039080821115620015675762001567620014aa565b5092915050565b6001600160d01b03818116838216019080821115620015675762001567620014aa565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090620015c690830184620014dc565b9695505050505050565b600060208284031215620015e357600080fd5b81516001600160e01b031981168114620005fc57600080fd5b81810381811115620002955762000295620014aa565b634e487b7160e01b600052603160045260246000fd5b60805160a05160c05160e0516101005161012051610140516101605161392a620016b8600039600081816104df015281816106fb0152818161092301528181610ad001528181610bd801528181610ea101526114170152600061196a015260006119380152600061235a015260006123320152600061228d015260006122b7015260006122e1015261392a6000f3fe608060405234801561001057600080fd5b50600436106102325760003560e01c8063711864781161013057806395d89b41116100b8578063c3cda5201161007c578063c3cda52014610527578063c87b56dd1461053a578063d204c45e1461054d578063e985e9c514610560578063f2fde38b1461057357600080fd5b806395d89b41146104bf5780639ab24eb0146104c75780639fa92f9d146104da578063a22cb46514610501578063b88d4fde1461051457600080fd5b806381b62086116100ff57806381b620861461045757806384b0196e1461046a5780638da5cb5b146104855780638e539e8c1461049657806391ddadf4146104a957600080fd5b80637118647814610400578063715018a6146104135780637610248e1461041b5780637ecebe001461042e57600080fd5b806342842e0e116101be578063587cde1e11610182578063587cde1e14610388578063593aa283146103b45780635c19a95c146103c75780636352211e146103da57806370a08231146103ed57600080fd5b806342842e0e1461031257806342966c6814610325578063482ffa5e146103385780634bf5d7e91461034b5780634f6ccce71461037557600080fd5b806318160ddd1161020557806318160ddd146102b457806323b872dd146102c657806326926d46146102d95780632f745c59146102ec5780633a46b1a8146102ff57600080fd5b806301ffc9a71461023757806306fdde031461025f578063081812fc14610274578063095ea7b31461029f575b600080fd5b61024a610245366004612ec2565b610586565b60405190151581526020015b60405180910390f35b610267610597565b6040516102569190612f2f565b610287610282366004612f42565b610629565b6040516001600160a01b039091168152602001610256565b6102b26102ad366004612f70565b610652565b005b6008545b604051908152602001610256565b6102b26102d4366004612f9c565b610661565b6102b26102e7366004612f42565b6106f1565b6102b86102fa366004612f70565b610817565b6102b861030d366004612f70565b61087c565b6102b2610320366004612f9c565b6108f3565b6102b2610333366004612f42565b610913565b6102676103463660046130b1565b61091f565b60408051808201909152600e81526d06d6f64653d74696d657374616d760941b6020820152610267565b6102b8610383366004612f42565b610a6d565b610287610396366004613101565b6001600160a01b039081166000908152600f60205260409020541690565b6102b26103c236600461311e565b610ac6565b6102b26103d5366004613101565b610bd6565b6102876103e8366004612f42565b610ce3565b6102b86103fb366004613101565b610cee565b6102b261040e36600461314f565b610d36565b6102b2610e89565b610267610429366004613184565b610e9d565b6102b861043c366004613101565b6001600160a01b03166000908152600e602052604090205490565b6102b261046536600461314f565b611024565b61047261123d565b60405161025697969594939291906131bd565b600b546001600160a01b0316610287565b6102b86104a4366004612f42565b611283565b60405165ffffffffffff42168152602001610256565b6102676112e3565b6102b86104d5366004613101565b6112f2565b6102b87f000000000000000000000000000000000000000000000000000000000000000081565b6102b261050f366004613253565b611322565b6102b2610522366004613286565b61132d565b6102b26105353660046132f2565b611345565b610267610548366004612f42565b611402565b6102b261055b36600461334e565b61140d565b61024a61056e366004613184565b611527565b6102b2610581366004613101565b611555565b6000610591826115b2565b92915050565b6060600080546105a69061336c565b80601f01602080910402602001604051908101604052809291908181526020018280546105d29061336c565b801561061f5780601f106105f45761010080835404028352916020019161061f565b820191906000526020600020905b81548152906001019060200180831161060257829003601f168201915b5050505050905090565b6000610634826115d7565b506000828152600460205260409020546001600160a01b0316610591565b61065d828233611610565b5050565b6001600160a01b03821661069057604051633250574960e11b8152600060048201526024015b60405180910390fd5b600061069d83833361161d565b9050836001600160a01b0316816001600160a01b0316146106eb576040516364283d7b60e01b81526001600160a01b0380861660048301526024820184905282166044820152606401610687565b50505050565b6106f9611693565b7f000000000000000000000000000000000000000000000000000000000000000046146107385760405162461bcd60e51b8152600401610687906133a6565b604051633b0d4dd760e01b8152601360048201526001602482015260009073__$b1c1335e68417b4234016f4aa58fdfac77$__90633b0d4dd790604401602060405180830381865af4158015610792573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107b69190613400565b905060006107c383610ce3565b90506107ce836116c0565b806001600160a01b0316837f81c00ee14a307a39bcddd8f17801cf3101f1c49c8dea9ee90ec0c04a61b5a0078460405161080a91815260200190565b60405180910390a3505050565b600061082283610cee565b82106108535760405163295f44f760e21b81526001600160a01b038416600482015260248101839052604401610687565b506001600160a01b03919091166000908152600660209081526040808320938352929052205490565b60004265ffffffffffff811683106108b857604051637669fc0f60e11b81526004810184905265ffffffffffff82166024820152604401610687565b6108e26108c4846116fb565b6001600160a01b038616600090815260106020526040902090611732565b6001600160d01b0316949350505050565b61090e8383836040518060200160405280600081525061132d565b505050565b61065d6000823361161d565b60607f000000000000000000000000000000000000000000000000000000000000000046146109605760405162461bcd60e51b815260040161068790613419565b604051630564edeb60e31b81526013600482015260ff8416602482015260009073__$b1c1335e68417b4234016f4aa58fdfac77$__90632b276f5890604401602060405180830381865af41580156109bc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109e09190613400565b604051637352178160e01b815290915073__$b1c1335e68417b4234016f4aa58fdfac77$__90637352178190610a2090309088908890879060040161345c565b600060405180830381865af4158015610a3d573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610a6591908101906134df565b949350505050565b6000610a7860085490565b8210610aa15760405163295f44f760e21b81526000600482015260248101839052604401610687565b60088281548110610ab457610ab4613514565b90600052602060002001549050919050565b610ace611693565b7f00000000000000000000000000000000000000000000000000000000000000004614610b0d5760405162461bcd60e51b8152600401610687906133a6565b604051633b0d4dd760e01b8152601360048201526002602482015260009073__$b1c1335e68417b4234016f4aa58fdfac77$__90633b0d4dd790604401602060405180830381865af4158015610b67573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b8b9190613400565b9050610b9783836117e8565b827faef83f88d7b64742932e336e35ec4ebdbf35e2824c4cc154007911e95b72367e8383604051610bc992919061352a565b60405180910390a2505050565b7f00000000000000000000000000000000000000000000000000000000000000004614610c155760405162461bcd60e51b8152600401610687906133a6565b604051633b0d4dd760e01b8152601360048201526003602482015260009073__$b1c1335e68417b4234016f4aa58fdfac77$__90633b0d4dd790604401602060405180830381865af4158015610c6f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c939190613400565b9050610c9f3383611838565b6040518181526001600160a01b0383169033907fa2527a1c304fba1df9beb0da8db977345b95154faa8004c7b3485f52e34dcd0a9060200160405180910390a35050565b6000610591826115d7565b60006001600160a01b038216610d1a576040516322718ad960e21b815260006004820152602401610687565b506001600160a01b031660009081526003602052604090205490565b600080600073__$b1c1335e68417b4234016f4aa58fdfac77$__63c0af6591853060136040518463ffffffff1660e01b8152600401610d779392919061354c565b600060405180830381865af4158015610d94573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610dbc919081019061357a565b9194509250905060ff8316600314610e0f5760405162461bcd60e51b8152602060048201526016602482015275496e76616c6964206f7065726174696f6e207479706560501b6044820152606401610687565b60008083806020019051810190610e2691906135d4565b91509150610e348282611838565b806001600160a01b0316826001600160a01b03167fa2527a1c304fba1df9beb0da8db977345b95154faa8004c7b3485f52e34dcd0a85604051610e7991815260200190565b60405180910390a3505050505050565b610e91611693565b610e9b60006118aa565b565b60607f00000000000000000000000000000000000000000000000000000000000000004614610ede5760405162461bcd60e51b815260040161068790613419565b604051630564edeb60e31b8152601360048201526003602482015260009073__$b1c1335e68417b4234016f4aa58fdfac77$__90632b276f5890604401602060405180830381865af4158015610f38573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f5c9190613400565b905060008484604051602001610f889291906001600160a01b0392831681529116602082015260400190565b60408051808303601f1901815290829052637352178160e01b8252915073__$b1c1335e68417b4234016f4aa58fdfac77$__90637352178190610fd69030906003908690889060040161345c565b600060405180830381865af4158015610ff3573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261101b91908101906134df565b95945050505050565b600080600073__$b1c1335e68417b4234016f4aa58fdfac77$__63c0af6591853060136040518463ffffffff1660e01b81526004016110659392919061354c565b600060405180830381865af4158015611082573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526110aa919081019061357a565b9194509250905060ff831661113257600080838060200190518101906110d09190613603565b915091506110de82826118fc565b816001600160a01b031660016012546110f79190613660565b6040518581527f22ef8ac73166382773e470f8f887ac4c54dcf377f397431fe0ac6f60261fabaf906020015b60405180910390a350506106eb565b60001960ff8416016111a8576000828060200190518101906111549190613400565b9050600061116182610ce3565b905061116c826116c0565b806001600160a01b0316827f81c00ee14a307a39bcddd8f17801cf3101f1c49c8dea9ee90ec0c04a61b5a0078560405161112391815260200190565b60011960ff84160161121a57600080838060200190518101906111cb9190613673565b915091506111d982826117e8565b817faef83f88d7b64742932e336e35ec4ebdbf35e2824c4cc154007911e95b72367e828560405161120b92919061352a565b60405180910390a250506106eb565b60021960ff8416016106eb5760008083806020019051810190610e2691906135d4565b600060608060008060006060611251611931565b611259611963565b60408051600080825260208201909252600f60f81b9b939a50919850469750309650945092509050565b60004265ffffffffffff811683106112bf57604051637669fc0f60e11b81526004810184905265ffffffffffff82166024820152604401610687565b6112d36112cb846116fb565b601190611732565b6001600160d01b03169392505050565b6060600180546105a69061336c565b6001600160a01b038116600090815260106020526040812061131390611990565b6001600160d01b031692915050565b61065d3383836119c9565b611338848484610661565b6106eb3385858585611a60565b8342111561136957604051632341d78760e11b815260048101859052602401610687565b604080517fe48329057bfd03d55e49b547132e39cffd9c1820ad7b9d4c5307691425d15adf60208201526001600160a01b0388169181019190915260608101869052608081018590526000906113e3906113db9060a00160405160208183030381529060405280519060200120611b8b565b858585611bb8565b90506113ef8187611be6565b6113f98188611838565b50505050505050565b606061059182611c39565b611415611693565b7f000000000000000000000000000000000000000000000000000000000000000046146114545760405162461bcd60e51b8152600401610687906133a6565b604051633b0d4dd760e01b8152601360048201526000602482018190529073__$b1c1335e68417b4234016f4aa58fdfac77$__90633b0d4dd790604401602060405180830381865af41580156114ae573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114d29190613400565b90506114de83836118fc565b826001600160a01b031660016012546114f79190613660565b6040518381527f22ef8ac73166382773e470f8f887ac4c54dcf377f397431fe0ac6f60261fabaf9060200161080a565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205460ff1690565b61155d611693565b6001600160a01b03811661158757604051631e4fbdf760e01b815260006004820152602401610687565b611590816118aa565b50565b600061159f82846136a4565b9392505050565b600061159f82846136cb565b60006001600160e01b03198216632483248360e11b1480610591575061059182611d42565b6000818152600260205260408120546001600160a01b03168061059157604051637e27328960e01b815260048101849052602401610687565b61090e8383836001611d67565b60006001600160a01b038216158061163c57506001600160a01b038416155b6116885760405162461bcd60e51b815260206004820152601760248201527f4e4654206973206e6f74207472616e7366657261626c650000000000000000006044820152606401610687565b610a65848484611e6d565b600b546001600160a01b03163314610e9b5760405163118cdaa760e01b8152336004820152602401610687565b60006116cf600083600061161d565b90506001600160a01b03811661065d57604051637e27328960e01b815260048101839052602401610687565b600065ffffffffffff82111561172e576040516306dfcc6560e41b81526030600482015260248101839052604401610687565b5090565b81546000908181600581111561179157600061174d84611e89565b6117579085613660565b60008881526020902090915081015465ffffffffffff90811690871610156117815780915061178f565b61178c8160016136eb565b92505b505b600061179f87878585611fe2565b905080156117da576117c4876117b6600184613660565b600091825260209091200190565b54600160301b90046001600160d01b03166117dd565b60005b979650505050505050565b6000828152600a602052604090206118008282613744565b506040518281527ff8e1a15aba9398e019f0b49df1a4fde98ee17ae345cb5f6b5e2c27f5033e8ce79060200160405180910390a15050565b6001600160a01b038281166000818152600f602052604080822080548686166001600160a01b0319821681179092559151919094169392849290917f3134e8a2e6d97e929a7e54011ea5485d7d196dd5f0ba4d4ef95803e8e3fc257f9190a461090e81836118a586612044565b61204f565b600b80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b601280546000918261190d83613804565b91905055905061191d83826121bb565b61192781836117e8565b61090e8384611838565b606061195e7f0000000000000000000000000000000000000000000000000000000000000000600c6121d5565b905090565b606061195e7f0000000000000000000000000000000000000000000000000000000000000000600d6121d5565b805460009080156119c0576119aa836117b6600184613660565b54600160301b90046001600160d01b031661159f565b60009392505050565b6001600160a01b0382166119fb57604051630b61174360e31b81526001600160a01b0383166004820152602401610687565b6001600160a01b03838116600081815260056020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910161080a565b6001600160a01b0383163b15611b8457604051630a85bd0160e11b81526001600160a01b0384169063150b7a0290611aa290889088908790879060040161381d565b6020604051808303816000875af1925050508015611add575060408051601f3d908101601f19168201909252611ada9181019061385a565b60015b611b46573d808015611b0b576040519150601f19603f3d011682016040523d82523d6000602084013e611b10565b606091505b508051600003611b3e57604051633250574960e11b81526001600160a01b0385166004820152602401610687565b805181602001fd5b6001600160e01b03198116630a85bd0160e11b14611b8257604051633250574960e11b81526001600160a01b0385166004820152602401610687565b505b5050505050565b6000610591611b98612280565b8360405161190160f01b8152600281019290925260228201526042902090565b600080600080611bca888888886123ab565b925092509250611bda828261247a565b50909695505050505050565b6001600160a01b0382166000908152600e6020526040902080546001810190915581811461090e576040516301d4b62360e61b81526001600160a01b038416600482015260248101829052604401610687565b6060611c44826115d7565b506000828152600a602052604081208054611c5e9061336c565b80601f0160208091040260200160405190810160405280929190818152602001828054611c8a9061336c565b8015611cd75780601f10611cac57610100808354040283529160200191611cd7565b820191906000526020600020905b815481529060010190602001808311611cba57829003601f168201915b505050505090506000611cf560408051602081019091526000815290565b90508051600003611d07575092915050565b815115611d39578082604051602001611d21929190613877565b60405160208183030381529060405292505050919050565b610a6584612533565b60006001600160e01b0319821663780e9d6360e01b14806105915750610591826125a7565b8080611d7b57506001600160a01b03821615155b15611e3d576000611d8b846115d7565b90506001600160a01b03831615801590611db75750826001600160a01b0316816001600160a01b031614155b8015611dca5750611dc88184611527565b155b15611df35760405163a9fbf51f60e01b81526001600160a01b0384166004820152602401610687565b8115611e3b5783856001600160a01b0316826001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45b505b5050600090815260046020526040902080546001600160a01b0319166001600160a01b0392909216919091179055565b600080611e7b8585856125f7565b9050610a65818660016126c4565b600060018211611e97575090565b816001600160801b8210611eb05760809190911c9060401b5b680100000000000000008210611ecb5760409190911c9060201b5b6401000000008210611ee25760209190911c9060101b5b620100008210611ef75760109190911c9060081b5b6101008210611f0b5760089190911c9060041b5b60108210611f1e5760049190911c9060021b5b60048210611f2a5760011b5b600302600190811c90818581611f4257611f426138a6565b048201901c90506001818581611f5a57611f5a6138a6565b048201901c90506001818581611f7257611f726138a6565b048201901c90506001818581611f8a57611f8a6138a6565b048201901c90506001818581611fa257611fa26138a6565b048201901c90506001818581611fba57611fba6138a6565b048201901c9050611fd9818581611fd357611fd36138a6565b04821190565b90039392505050565b60005b8183101561203c576000611ff9848461273a565b60008781526020902090915065ffffffffffff86169082015465ffffffffffff16111561202857809250612036565b6120338160016136eb565b93505b50611fe5565b509392505050565b600061059182610cee565b816001600160a01b0316836001600160a01b0316141580156120715750600081115b1561090e576001600160a01b03831615612119576001600160a01b038316600090815260106020526040812081906120b4906115936120af86612755565b612789565b6001600160d01b031691506001600160d01b03169150846001600160a01b03167fdec2bacdd2f05b59de34da9b523dff8be42e5e38e818c82fdb0bae774387a724838360405161210e929190918252602082015260400190565b60405180910390a250505b6001600160a01b0382161561090e576001600160a01b03821660009081526010602052604081208190612152906115a66120af86612755565b6001600160d01b031691506001600160d01b03169150836001600160a01b03167fdec2bacdd2f05b59de34da9b523dff8be42e5e38e818c82fdb0bae774387a72483836040516121ac929190918252602082015260400190565b60405180910390a25050505050565b61065d8282604051806020016040528060008152506127bb565b606060ff83146121ef576121e8836127d3565b9050610591565b8180546121fb9061336c565b80601f01602080910402602001604051908101604052809291908181526020018280546122279061336c565b80156122745780601f1061224957610100808354040283529160200191612274565b820191906000526020600020905b81548152906001019060200180831161225757829003601f168201915b50505050509050610591565b6000306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480156122d957507f000000000000000000000000000000000000000000000000000000000000000046145b1561230357507f000000000000000000000000000000000000000000000000000000000000000090565b61195e604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f60208201527f0000000000000000000000000000000000000000000000000000000000000000918101919091527f000000000000000000000000000000000000000000000000000000000000000060608201524660808201523060a082015260009060c00160405160208183030381529060405280519060200120905090565b600080807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08411156123e65750600091506003905082612470565b604080516000808252602082018084528a905260ff891692820192909252606081018790526080810186905260019060a0016020604051602081039080840390855afa15801561243a573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b03811661246657506000925060019150829050612470565b9250600091508190505b9450945094915050565b600082600381111561248e5761248e6133ea565b03612497575050565b60018260038111156124ab576124ab6133ea565b036124c95760405163f645eedf60e01b815260040160405180910390fd5b60028260038111156124dd576124dd6133ea565b036124fe5760405163fce698f760e01b815260048101829052602401610687565b6003826003811115612512576125126133ea565b0361065d576040516335e2f38360e21b815260048101829052602401610687565b606061253e826115d7565b50600061255660408051602081019091526000815290565b90506000815111612576576040518060200160405280600081525061159f565b8061258084612812565b604051602001612591929190613877565b6040516020818303038152906040529392505050565b60006001600160e01b031982166380ac58cd60e01b14806125d857506001600160e01b03198216635b5e139f60e01b145b8061059157506301ffc9a760e01b6001600160e01b0319831614610591565b6000806126058585856128a5565b90506001600160a01b0381166126625761265d84600880546000838152600960205260408120829055600182018355919091527ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee30155565b612685565b846001600160a01b0316816001600160a01b03161461268557612685818561299e565b6001600160a01b0385166126a15761269c84612a1f565b610a65565b846001600160a01b0316816001600160a01b031614610a6557610a658585612ace565b6001600160a01b0383166126e6576126e360116115a66120af84612755565b50505b6001600160a01b0382166127085761270560116115936120af84612755565b50505b6001600160a01b038381166000908152600f602052604080822054858416835291205461090e9291821691168361204f565b600061274960028484186138bc565b61159f908484166136eb565b60006001600160d01b0382111561172e576040516306dfcc6560e41b815260d0600482015260248101839052604401610687565b6000806127ae426127a661279c88611990565b868863ffffffff16565b879190612b1e565b915091505b935093915050565b6127c58383612b2c565b61090e336000858585611a60565b606060006127e083612b91565b604080516020808252818301909252919250600091906020820181803683375050509182525060208101929092525090565b6060600061281f83612bb9565b600101905060008167ffffffffffffffff81111561283f5761283f612fec565b6040519080825280601f01601f191660200182016040528015612869576020820181803683370190505b5090508181016020015b600019016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a850494508461287357509392505050565b6000828152600260205260408120546001600160a01b03908116908316156128d2576128d2818486612c91565b6001600160a01b03811615612910576128ef600085600080611d67565b6001600160a01b038116600090815260036020526040902080546000190190555b6001600160a01b0385161561293f576001600160a01b0385166000908152600360205260409020805460010190555b60008481526002602052604080822080546001600160a01b0319166001600160a01b0389811691821790925591518793918516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4949350505050565b60006129a983610cee565b6000838152600760209081526040808320546001600160a01b0388168452600690925290912091925090818314612a0057600083815260208281526040808320548584528184208190558352600790915290208290555b6000938452600760209081526040808620869055938552525081205550565b600854600090612a3190600190613660565b60008381526009602052604081205460088054939450909284908110612a5957612a59613514565b906000526020600020015490508060088381548110612a7a57612a7a613514565b6000918252602080832090910192909255828152600990915260408082208490558582528120556008805480612ab257612ab26138de565b6001900381819060005260206000200160009055905550505050565b60006001612adb84610cee565b612ae59190613660565b6001600160a01b039093166000908152600660209081526040808320868452825280832085905593825260079052919091209190915550565b6000806127ae858585612cf5565b6001600160a01b038216612b5657604051633250574960e11b815260006004820152602401610687565b6000612b648383600061161d565b90506001600160a01b0381161561090e576040516339e3563760e11b815260006004820152602401610687565b600060ff8216601f81111561059157604051632cd44ac360e21b815260040160405180910390fd5b60008072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b8310612bf85772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6d04ee2d6d415b85acef81000000008310612c24576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc100008310612c4257662386f26fc10000830492506010015b6305f5e1008310612c5a576305f5e100830492506008015b6127108310612c6e57612710830492506004015b60648310612c80576064830492506002015b600a83106105915760010192915050565b612c9c838383612e49565b61090e576001600160a01b038316612cca57604051637e27328960e01b815260048101829052602401610687565b60405163177e802f60e01b81526001600160a01b038316600482015260248101829052604401610687565b825460009081908015612dee576000612d13876117b6600185613660565b805490915065ffffffffffff80821691600160301b90046001600160d01b0316908816821115612d5657604051632520601d60e01b815260040160405180910390fd5b8765ffffffffffff168265ffffffffffff1603612d8f57825465ffffffffffff16600160301b6001600160d01b03891602178355612de0565b6040805180820190915265ffffffffffff808a1682526001600160d01b03808a1660208085019182528d54600181018f5560008f81529190912094519151909216600160301b029216919091179101555b94508593506127b392505050565b50506040805180820190915265ffffffffffff80851682526001600160d01b0380851660208085019182528854600181018a5560008a815291822095519251909316600160301b0291909316179201919091559050816127b3565b60006001600160a01b03831615801590610a655750826001600160a01b0316846001600160a01b03161480612e835750612e838484611527565b80610a655750506000908152600460205260409020546001600160a01b03908116911614919050565b6001600160e01b03198116811461159057600080fd5b600060208284031215612ed457600080fd5b813561159f81612eac565b60005b83811015612efa578181015183820152602001612ee2565b50506000910152565b60008151808452612f1b816020860160208601612edf565b601f01601f19169290920160200192915050565b60208152600061159f6020830184612f03565b600060208284031215612f5457600080fd5b5035919050565b6001600160a01b038116811461159057600080fd5b60008060408385031215612f8357600080fd5b8235612f8e81612f5b565b946020939093013593505050565b600080600060608486031215612fb157600080fd5b8335612fbc81612f5b565b92506020840135612fcc81612f5b565b929592945050506040919091013590565b60ff8116811461159057600080fd5b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff8111828210171561302b5761302b612fec565b604052919050565b600067ffffffffffffffff82111561304d5761304d612fec565b50601f01601f191660200190565b600082601f83011261306c57600080fd5b813561307f61307a82613033565b613002565b81815284602083860101111561309457600080fd5b816020850160208301376000918101602001919091529392505050565b600080604083850312156130c457600080fd5b82356130cf81612fdd565b9150602083013567ffffffffffffffff8111156130eb57600080fd5b6130f78582860161305b565b9150509250929050565b60006020828403121561311357600080fd5b813561159f81612f5b565b6000806040838503121561313157600080fd5b82359150602083013567ffffffffffffffff8111156130eb57600080fd5b60006020828403121561316157600080fd5b813567ffffffffffffffff81111561317857600080fd5b610a658482850161305b565b6000806040838503121561319757600080fd5b82356131a281612f5b565b915060208301356131b281612f5b565b809150509250929050565b60ff60f81b881681526000602060e0818401526131dd60e084018a612f03565b83810360408501526131ef818a612f03565b606085018990526001600160a01b038816608086015260a0850187905284810360c0860152855180825283870192509083019060005b8181101561324157835183529284019291840191600101613225565b50909c9b505050505050505050505050565b6000806040838503121561326657600080fd5b823561327181612f5b565b9150602083013580151581146131b257600080fd5b6000806000806080858703121561329c57600080fd5b84356132a781612f5b565b935060208501356132b781612f5b565b925060408501359150606085013567ffffffffffffffff8111156132da57600080fd5b6132e68782880161305b565b91505092959194509250565b60008060008060008060c0878903121561330b57600080fd5b863561331681612f5b565b95506020870135945060408701359350606087013561333481612fdd565b9598949750929560808101359460a0909101359350915050565b6000806040838503121561336157600080fd5b82356130cf81612f5b565b600181811c9082168061338057607f821691505b6020821081036133a057634e487b7160e01b600052602260045260246000fd5b50919050565b60208082526024908201527f4f7065726174696f6e206f6e6c7920616c6c6f776564206f6e20686f6d6520636040820152633430b4b760e11b606082015260800190565b634e487b7160e01b600052602160045260246000fd5b60006020828403121561341257600080fd5b5051919050565b60208082526023908201527f50726f6f6673206f6e6c792067656e657261746564206f6e20686f6d6520636860408201526230b4b760e91b606082015260800190565b6001600160a01b038516815260ff8416602082015260806040820181905260009061348990830185612f03565b905082606083015295945050505050565b600082601f8301126134ab57600080fd5b81516134b961307a82613033565b8181528460208386010111156134ce57600080fd5b610a65826020830160208701612edf565b6000602082840312156134f157600080fd5b815167ffffffffffffffff81111561350857600080fd5b610a658482850161349a565b634e487b7160e01b600052603260045260246000fd5b60408152600061353d6040830185612f03565b90508260208301529392505050565b60608152600061355f6060830186612f03565b6001600160a01b039490941660208301525060400152919050565b60008060006060848603121561358f57600080fd5b835161359a81612fdd565b602085015190935067ffffffffffffffff8111156135b757600080fd5b6135c38682870161349a565b925050604084015190509250925092565b600080604083850312156135e757600080fd5b82516135f281612f5b565b60208401519092506131b281612f5b565b6000806040838503121561361657600080fd5b825161362181612f5b565b602084015190925067ffffffffffffffff81111561363e57600080fd5b6130f78582860161349a565b634e487b7160e01b600052601160045260246000fd5b818103818111156105915761059161364a565b6000806040838503121561368657600080fd5b82519150602083015167ffffffffffffffff81111561363e57600080fd5b6001600160d01b038281168282160390808211156136c4576136c461364a565b5092915050565b6001600160d01b038181168382160190808211156136c4576136c461364a565b808201808211156105915761059161364a565b601f82111561090e57600081815260208120601f850160051c810160208610156137255750805b601f850160051c820191505b81811015611b8257828155600101613731565b815167ffffffffffffffff81111561375e5761375e612fec565b6137728161376c845461336c565b846136fe565b602080601f8311600181146137a7576000841561378f5750858301515b600019600386901b1c1916600185901b178555611b82565b600085815260208120601f198616915b828110156137d6578886015182559484019460019091019084016137b7565b50858210156137f45787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6000600182016138165761381661364a565b5060010190565b6001600160a01b038581168252841660208201526040810183905260806060820181905260009061385090830184612f03565b9695505050505050565b60006020828403121561386c57600080fd5b815161159f81612eac565b60008351613889818460208801612edf565b83519083019061389d818360208801612edf565b01949350505050565b634e487b7160e01b600052601260045260246000fd5b6000826138d957634e487b7160e01b600052601260045260246000fd5b500490565b634e487b7160e01b600052603160045260246000fdfea26469706673582212200861948c00ac12a29e05900592c5ed3f68c88227f729b466bf3d29f5a5208d1064736f6c63430008140033dec2bacdd2f05b59de34da9b523dff8be42e5e38e818c82fdb0bae774387a724", + "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106102325760003560e01c8063711864781161013057806395d89b41116100b8578063c3cda5201161007c578063c3cda52014610527578063c87b56dd1461053a578063d204c45e1461054d578063e985e9c514610560578063f2fde38b1461057357600080fd5b806395d89b41146104bf5780639ab24eb0146104c75780639fa92f9d146104da578063a22cb46514610501578063b88d4fde1461051457600080fd5b806381b62086116100ff57806381b620861461045757806384b0196e1461046a5780638da5cb5b146104855780638e539e8c1461049657806391ddadf4146104a957600080fd5b80637118647814610400578063715018a6146104135780637610248e1461041b5780637ecebe001461042e57600080fd5b806342842e0e116101be578063587cde1e11610182578063587cde1e14610388578063593aa283146103b45780635c19a95c146103c75780636352211e146103da57806370a08231146103ed57600080fd5b806342842e0e1461031257806342966c6814610325578063482ffa5e146103385780634bf5d7e91461034b5780634f6ccce71461037557600080fd5b806318160ddd1161020557806318160ddd146102b457806323b872dd146102c657806326926d46146102d95780632f745c59146102ec5780633a46b1a8146102ff57600080fd5b806301ffc9a71461023757806306fdde031461025f578063081812fc14610274578063095ea7b31461029f575b600080fd5b61024a610245366004612ec2565b610586565b60405190151581526020015b60405180910390f35b610267610597565b6040516102569190612f2f565b610287610282366004612f42565b610629565b6040516001600160a01b039091168152602001610256565b6102b26102ad366004612f70565b610652565b005b6008545b604051908152602001610256565b6102b26102d4366004612f9c565b610661565b6102b26102e7366004612f42565b6106f1565b6102b86102fa366004612f70565b610817565b6102b861030d366004612f70565b61087c565b6102b2610320366004612f9c565b6108f3565b6102b2610333366004612f42565b610913565b6102676103463660046130b1565b61091f565b60408051808201909152600e81526d06d6f64653d74696d657374616d760941b6020820152610267565b6102b8610383366004612f42565b610a6d565b610287610396366004613101565b6001600160a01b039081166000908152600f60205260409020541690565b6102b26103c236600461311e565b610ac6565b6102b26103d5366004613101565b610bd6565b6102876103e8366004612f42565b610ce3565b6102b86103fb366004613101565b610cee565b6102b261040e36600461314f565b610d36565b6102b2610e89565b610267610429366004613184565b610e9d565b6102b861043c366004613101565b6001600160a01b03166000908152600e602052604090205490565b6102b261046536600461314f565b611024565b61047261123d565b60405161025697969594939291906131bd565b600b546001600160a01b0316610287565b6102b86104a4366004612f42565b611283565b60405165ffffffffffff42168152602001610256565b6102676112e3565b6102b86104d5366004613101565b6112f2565b6102b87f000000000000000000000000000000000000000000000000000000000000000081565b6102b261050f366004613253565b611322565b6102b2610522366004613286565b61132d565b6102b26105353660046132f2565b611345565b610267610548366004612f42565b611402565b6102b261055b36600461334e565b61140d565b61024a61056e366004613184565b611527565b6102b2610581366004613101565b611555565b6000610591826115b2565b92915050565b6060600080546105a69061336c565b80601f01602080910402602001604051908101604052809291908181526020018280546105d29061336c565b801561061f5780601f106105f45761010080835404028352916020019161061f565b820191906000526020600020905b81548152906001019060200180831161060257829003601f168201915b5050505050905090565b6000610634826115d7565b506000828152600460205260409020546001600160a01b0316610591565b61065d828233611610565b5050565b6001600160a01b03821661069057604051633250574960e11b8152600060048201526024015b60405180910390fd5b600061069d83833361161d565b9050836001600160a01b0316816001600160a01b0316146106eb576040516364283d7b60e01b81526001600160a01b0380861660048301526024820184905282166044820152606401610687565b50505050565b6106f9611693565b7f000000000000000000000000000000000000000000000000000000000000000046146107385760405162461bcd60e51b8152600401610687906133a6565b604051633b0d4dd760e01b8152601360048201526001602482015260009073__$b1c1335e68417b4234016f4aa58fdfac77$__90633b0d4dd790604401602060405180830381865af4158015610792573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107b69190613400565b905060006107c383610ce3565b90506107ce836116c0565b806001600160a01b0316837f81c00ee14a307a39bcddd8f17801cf3101f1c49c8dea9ee90ec0c04a61b5a0078460405161080a91815260200190565b60405180910390a3505050565b600061082283610cee565b82106108535760405163295f44f760e21b81526001600160a01b038416600482015260248101839052604401610687565b506001600160a01b03919091166000908152600660209081526040808320938352929052205490565b60004265ffffffffffff811683106108b857604051637669fc0f60e11b81526004810184905265ffffffffffff82166024820152604401610687565b6108e26108c4846116fb565b6001600160a01b038616600090815260106020526040902090611732565b6001600160d01b0316949350505050565b61090e8383836040518060200160405280600081525061132d565b505050565b61065d6000823361161d565b60607f000000000000000000000000000000000000000000000000000000000000000046146109605760405162461bcd60e51b815260040161068790613419565b604051630564edeb60e31b81526013600482015260ff8416602482015260009073__$b1c1335e68417b4234016f4aa58fdfac77$__90632b276f5890604401602060405180830381865af41580156109bc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109e09190613400565b604051637352178160e01b815290915073__$b1c1335e68417b4234016f4aa58fdfac77$__90637352178190610a2090309088908890879060040161345c565b600060405180830381865af4158015610a3d573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610a6591908101906134df565b949350505050565b6000610a7860085490565b8210610aa15760405163295f44f760e21b81526000600482015260248101839052604401610687565b60088281548110610ab457610ab4613514565b90600052602060002001549050919050565b610ace611693565b7f00000000000000000000000000000000000000000000000000000000000000004614610b0d5760405162461bcd60e51b8152600401610687906133a6565b604051633b0d4dd760e01b8152601360048201526002602482015260009073__$b1c1335e68417b4234016f4aa58fdfac77$__90633b0d4dd790604401602060405180830381865af4158015610b67573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b8b9190613400565b9050610b9783836117e8565b827faef83f88d7b64742932e336e35ec4ebdbf35e2824c4cc154007911e95b72367e8383604051610bc992919061352a565b60405180910390a2505050565b7f00000000000000000000000000000000000000000000000000000000000000004614610c155760405162461bcd60e51b8152600401610687906133a6565b604051633b0d4dd760e01b8152601360048201526003602482015260009073__$b1c1335e68417b4234016f4aa58fdfac77$__90633b0d4dd790604401602060405180830381865af4158015610c6f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c939190613400565b9050610c9f3383611838565b6040518181526001600160a01b0383169033907fa2527a1c304fba1df9beb0da8db977345b95154faa8004c7b3485f52e34dcd0a9060200160405180910390a35050565b6000610591826115d7565b60006001600160a01b038216610d1a576040516322718ad960e21b815260006004820152602401610687565b506001600160a01b031660009081526003602052604090205490565b600080600073__$b1c1335e68417b4234016f4aa58fdfac77$__63c0af6591853060136040518463ffffffff1660e01b8152600401610d779392919061354c565b600060405180830381865af4158015610d94573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610dbc919081019061357a565b9194509250905060ff8316600314610e0f5760405162461bcd60e51b8152602060048201526016602482015275496e76616c6964206f7065726174696f6e207479706560501b6044820152606401610687565b60008083806020019051810190610e2691906135d4565b91509150610e348282611838565b806001600160a01b0316826001600160a01b03167fa2527a1c304fba1df9beb0da8db977345b95154faa8004c7b3485f52e34dcd0a85604051610e7991815260200190565b60405180910390a3505050505050565b610e91611693565b610e9b60006118aa565b565b60607f00000000000000000000000000000000000000000000000000000000000000004614610ede5760405162461bcd60e51b815260040161068790613419565b604051630564edeb60e31b8152601360048201526003602482015260009073__$b1c1335e68417b4234016f4aa58fdfac77$__90632b276f5890604401602060405180830381865af4158015610f38573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f5c9190613400565b905060008484604051602001610f889291906001600160a01b0392831681529116602082015260400190565b60408051808303601f1901815290829052637352178160e01b8252915073__$b1c1335e68417b4234016f4aa58fdfac77$__90637352178190610fd69030906003908690889060040161345c565b600060405180830381865af4158015610ff3573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261101b91908101906134df565b95945050505050565b600080600073__$b1c1335e68417b4234016f4aa58fdfac77$__63c0af6591853060136040518463ffffffff1660e01b81526004016110659392919061354c565b600060405180830381865af4158015611082573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526110aa919081019061357a565b9194509250905060ff831661113257600080838060200190518101906110d09190613603565b915091506110de82826118fc565b816001600160a01b031660016012546110f79190613660565b6040518581527f22ef8ac73166382773e470f8f887ac4c54dcf377f397431fe0ac6f60261fabaf906020015b60405180910390a350506106eb565b60001960ff8416016111a8576000828060200190518101906111549190613400565b9050600061116182610ce3565b905061116c826116c0565b806001600160a01b0316827f81c00ee14a307a39bcddd8f17801cf3101f1c49c8dea9ee90ec0c04a61b5a0078560405161112391815260200190565b60011960ff84160161121a57600080838060200190518101906111cb9190613673565b915091506111d982826117e8565b817faef83f88d7b64742932e336e35ec4ebdbf35e2824c4cc154007911e95b72367e828560405161120b92919061352a565b60405180910390a250506106eb565b60021960ff8416016106eb5760008083806020019051810190610e2691906135d4565b600060608060008060006060611251611931565b611259611963565b60408051600080825260208201909252600f60f81b9b939a50919850469750309650945092509050565b60004265ffffffffffff811683106112bf57604051637669fc0f60e11b81526004810184905265ffffffffffff82166024820152604401610687565b6112d36112cb846116fb565b601190611732565b6001600160d01b03169392505050565b6060600180546105a69061336c565b6001600160a01b038116600090815260106020526040812061131390611990565b6001600160d01b031692915050565b61065d3383836119c9565b611338848484610661565b6106eb3385858585611a60565b8342111561136957604051632341d78760e11b815260048101859052602401610687565b604080517fe48329057bfd03d55e49b547132e39cffd9c1820ad7b9d4c5307691425d15adf60208201526001600160a01b0388169181019190915260608101869052608081018590526000906113e3906113db9060a00160405160208183030381529060405280519060200120611b8b565b858585611bb8565b90506113ef8187611be6565b6113f98188611838565b50505050505050565b606061059182611c39565b611415611693565b7f000000000000000000000000000000000000000000000000000000000000000046146114545760405162461bcd60e51b8152600401610687906133a6565b604051633b0d4dd760e01b8152601360048201526000602482018190529073__$b1c1335e68417b4234016f4aa58fdfac77$__90633b0d4dd790604401602060405180830381865af41580156114ae573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114d29190613400565b90506114de83836118fc565b826001600160a01b031660016012546114f79190613660565b6040518381527f22ef8ac73166382773e470f8f887ac4c54dcf377f397431fe0ac6f60261fabaf9060200161080a565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205460ff1690565b61155d611693565b6001600160a01b03811661158757604051631e4fbdf760e01b815260006004820152602401610687565b611590816118aa565b50565b600061159f82846136a4565b9392505050565b600061159f82846136cb565b60006001600160e01b03198216632483248360e11b1480610591575061059182611d42565b6000818152600260205260408120546001600160a01b03168061059157604051637e27328960e01b815260048101849052602401610687565b61090e8383836001611d67565b60006001600160a01b038216158061163c57506001600160a01b038416155b6116885760405162461bcd60e51b815260206004820152601760248201527f4e4654206973206e6f74207472616e7366657261626c650000000000000000006044820152606401610687565b610a65848484611e6d565b600b546001600160a01b03163314610e9b5760405163118cdaa760e01b8152336004820152602401610687565b60006116cf600083600061161d565b90506001600160a01b03811661065d57604051637e27328960e01b815260048101839052602401610687565b600065ffffffffffff82111561172e576040516306dfcc6560e41b81526030600482015260248101839052604401610687565b5090565b81546000908181600581111561179157600061174d84611e89565b6117579085613660565b60008881526020902090915081015465ffffffffffff90811690871610156117815780915061178f565b61178c8160016136eb565b92505b505b600061179f87878585611fe2565b905080156117da576117c4876117b6600184613660565b600091825260209091200190565b54600160301b90046001600160d01b03166117dd565b60005b979650505050505050565b6000828152600a602052604090206118008282613744565b506040518281527ff8e1a15aba9398e019f0b49df1a4fde98ee17ae345cb5f6b5e2c27f5033e8ce79060200160405180910390a15050565b6001600160a01b038281166000818152600f602052604080822080548686166001600160a01b0319821681179092559151919094169392849290917f3134e8a2e6d97e929a7e54011ea5485d7d196dd5f0ba4d4ef95803e8e3fc257f9190a461090e81836118a586612044565b61204f565b600b80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b601280546000918261190d83613804565b91905055905061191d83826121bb565b61192781836117e8565b61090e8384611838565b606061195e7f0000000000000000000000000000000000000000000000000000000000000000600c6121d5565b905090565b606061195e7f0000000000000000000000000000000000000000000000000000000000000000600d6121d5565b805460009080156119c0576119aa836117b6600184613660565b54600160301b90046001600160d01b031661159f565b60009392505050565b6001600160a01b0382166119fb57604051630b61174360e31b81526001600160a01b0383166004820152602401610687565b6001600160a01b03838116600081815260056020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910161080a565b6001600160a01b0383163b15611b8457604051630a85bd0160e11b81526001600160a01b0384169063150b7a0290611aa290889088908790879060040161381d565b6020604051808303816000875af1925050508015611add575060408051601f3d908101601f19168201909252611ada9181019061385a565b60015b611b46573d808015611b0b576040519150601f19603f3d011682016040523d82523d6000602084013e611b10565b606091505b508051600003611b3e57604051633250574960e11b81526001600160a01b0385166004820152602401610687565b805181602001fd5b6001600160e01b03198116630a85bd0160e11b14611b8257604051633250574960e11b81526001600160a01b0385166004820152602401610687565b505b5050505050565b6000610591611b98612280565b8360405161190160f01b8152600281019290925260228201526042902090565b600080600080611bca888888886123ab565b925092509250611bda828261247a565b50909695505050505050565b6001600160a01b0382166000908152600e6020526040902080546001810190915581811461090e576040516301d4b62360e61b81526001600160a01b038416600482015260248101829052604401610687565b6060611c44826115d7565b506000828152600a602052604081208054611c5e9061336c565b80601f0160208091040260200160405190810160405280929190818152602001828054611c8a9061336c565b8015611cd75780601f10611cac57610100808354040283529160200191611cd7565b820191906000526020600020905b815481529060010190602001808311611cba57829003601f168201915b505050505090506000611cf560408051602081019091526000815290565b90508051600003611d07575092915050565b815115611d39578082604051602001611d21929190613877565b60405160208183030381529060405292505050919050565b610a6584612533565b60006001600160e01b0319821663780e9d6360e01b14806105915750610591826125a7565b8080611d7b57506001600160a01b03821615155b15611e3d576000611d8b846115d7565b90506001600160a01b03831615801590611db75750826001600160a01b0316816001600160a01b031614155b8015611dca5750611dc88184611527565b155b15611df35760405163a9fbf51f60e01b81526001600160a01b0384166004820152602401610687565b8115611e3b5783856001600160a01b0316826001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45b505b5050600090815260046020526040902080546001600160a01b0319166001600160a01b0392909216919091179055565b600080611e7b8585856125f7565b9050610a65818660016126c4565b600060018211611e97575090565b816001600160801b8210611eb05760809190911c9060401b5b680100000000000000008210611ecb5760409190911c9060201b5b6401000000008210611ee25760209190911c9060101b5b620100008210611ef75760109190911c9060081b5b6101008210611f0b5760089190911c9060041b5b60108210611f1e5760049190911c9060021b5b60048210611f2a5760011b5b600302600190811c90818581611f4257611f426138a6565b048201901c90506001818581611f5a57611f5a6138a6565b048201901c90506001818581611f7257611f726138a6565b048201901c90506001818581611f8a57611f8a6138a6565b048201901c90506001818581611fa257611fa26138a6565b048201901c90506001818581611fba57611fba6138a6565b048201901c9050611fd9818581611fd357611fd36138a6565b04821190565b90039392505050565b60005b8183101561203c576000611ff9848461273a565b60008781526020902090915065ffffffffffff86169082015465ffffffffffff16111561202857809250612036565b6120338160016136eb565b93505b50611fe5565b509392505050565b600061059182610cee565b816001600160a01b0316836001600160a01b0316141580156120715750600081115b1561090e576001600160a01b03831615612119576001600160a01b038316600090815260106020526040812081906120b4906115936120af86612755565b612789565b6001600160d01b031691506001600160d01b03169150846001600160a01b03167fdec2bacdd2f05b59de34da9b523dff8be42e5e38e818c82fdb0bae774387a724838360405161210e929190918252602082015260400190565b60405180910390a250505b6001600160a01b0382161561090e576001600160a01b03821660009081526010602052604081208190612152906115a66120af86612755565b6001600160d01b031691506001600160d01b03169150836001600160a01b03167fdec2bacdd2f05b59de34da9b523dff8be42e5e38e818c82fdb0bae774387a72483836040516121ac929190918252602082015260400190565b60405180910390a25050505050565b61065d8282604051806020016040528060008152506127bb565b606060ff83146121ef576121e8836127d3565b9050610591565b8180546121fb9061336c565b80601f01602080910402602001604051908101604052809291908181526020018280546122279061336c565b80156122745780601f1061224957610100808354040283529160200191612274565b820191906000526020600020905b81548152906001019060200180831161225757829003601f168201915b50505050509050610591565b6000306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480156122d957507f000000000000000000000000000000000000000000000000000000000000000046145b1561230357507f000000000000000000000000000000000000000000000000000000000000000090565b61195e604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f60208201527f0000000000000000000000000000000000000000000000000000000000000000918101919091527f000000000000000000000000000000000000000000000000000000000000000060608201524660808201523060a082015260009060c00160405160208183030381529060405280519060200120905090565b600080807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08411156123e65750600091506003905082612470565b604080516000808252602082018084528a905260ff891692820192909252606081018790526080810186905260019060a0016020604051602081039080840390855afa15801561243a573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b03811661246657506000925060019150829050612470565b9250600091508190505b9450945094915050565b600082600381111561248e5761248e6133ea565b03612497575050565b60018260038111156124ab576124ab6133ea565b036124c95760405163f645eedf60e01b815260040160405180910390fd5b60028260038111156124dd576124dd6133ea565b036124fe5760405163fce698f760e01b815260048101829052602401610687565b6003826003811115612512576125126133ea565b0361065d576040516335e2f38360e21b815260048101829052602401610687565b606061253e826115d7565b50600061255660408051602081019091526000815290565b90506000815111612576576040518060200160405280600081525061159f565b8061258084612812565b604051602001612591929190613877565b6040516020818303038152906040529392505050565b60006001600160e01b031982166380ac58cd60e01b14806125d857506001600160e01b03198216635b5e139f60e01b145b8061059157506301ffc9a760e01b6001600160e01b0319831614610591565b6000806126058585856128a5565b90506001600160a01b0381166126625761265d84600880546000838152600960205260408120829055600182018355919091527ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee30155565b612685565b846001600160a01b0316816001600160a01b03161461268557612685818561299e565b6001600160a01b0385166126a15761269c84612a1f565b610a65565b846001600160a01b0316816001600160a01b031614610a6557610a658585612ace565b6001600160a01b0383166126e6576126e360116115a66120af84612755565b50505b6001600160a01b0382166127085761270560116115936120af84612755565b50505b6001600160a01b038381166000908152600f602052604080822054858416835291205461090e9291821691168361204f565b600061274960028484186138bc565b61159f908484166136eb565b60006001600160d01b0382111561172e576040516306dfcc6560e41b815260d0600482015260248101839052604401610687565b6000806127ae426127a661279c88611990565b868863ffffffff16565b879190612b1e565b915091505b935093915050565b6127c58383612b2c565b61090e336000858585611a60565b606060006127e083612b91565b604080516020808252818301909252919250600091906020820181803683375050509182525060208101929092525090565b6060600061281f83612bb9565b600101905060008167ffffffffffffffff81111561283f5761283f612fec565b6040519080825280601f01601f191660200182016040528015612869576020820181803683370190505b5090508181016020015b600019016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a850494508461287357509392505050565b6000828152600260205260408120546001600160a01b03908116908316156128d2576128d2818486612c91565b6001600160a01b03811615612910576128ef600085600080611d67565b6001600160a01b038116600090815260036020526040902080546000190190555b6001600160a01b0385161561293f576001600160a01b0385166000908152600360205260409020805460010190555b60008481526002602052604080822080546001600160a01b0319166001600160a01b0389811691821790925591518793918516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4949350505050565b60006129a983610cee565b6000838152600760209081526040808320546001600160a01b0388168452600690925290912091925090818314612a0057600083815260208281526040808320548584528184208190558352600790915290208290555b6000938452600760209081526040808620869055938552525081205550565b600854600090612a3190600190613660565b60008381526009602052604081205460088054939450909284908110612a5957612a59613514565b906000526020600020015490508060088381548110612a7a57612a7a613514565b6000918252602080832090910192909255828152600990915260408082208490558582528120556008805480612ab257612ab26138de565b6001900381819060005260206000200160009055905550505050565b60006001612adb84610cee565b612ae59190613660565b6001600160a01b039093166000908152600660209081526040808320868452825280832085905593825260079052919091209190915550565b6000806127ae858585612cf5565b6001600160a01b038216612b5657604051633250574960e11b815260006004820152602401610687565b6000612b648383600061161d565b90506001600160a01b0381161561090e576040516339e3563760e11b815260006004820152602401610687565b600060ff8216601f81111561059157604051632cd44ac360e21b815260040160405180910390fd5b60008072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b8310612bf85772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6d04ee2d6d415b85acef81000000008310612c24576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc100008310612c4257662386f26fc10000830492506010015b6305f5e1008310612c5a576305f5e100830492506008015b6127108310612c6e57612710830492506004015b60648310612c80576064830492506002015b600a83106105915760010192915050565b612c9c838383612e49565b61090e576001600160a01b038316612cca57604051637e27328960e01b815260048101829052602401610687565b60405163177e802f60e01b81526001600160a01b038316600482015260248101829052604401610687565b825460009081908015612dee576000612d13876117b6600185613660565b805490915065ffffffffffff80821691600160301b90046001600160d01b0316908816821115612d5657604051632520601d60e01b815260040160405180910390fd5b8765ffffffffffff168265ffffffffffff1603612d8f57825465ffffffffffff16600160301b6001600160d01b03891602178355612de0565b6040805180820190915265ffffffffffff808a1682526001600160d01b03808a1660208085019182528d54600181018f5560008f81529190912094519151909216600160301b029216919091179101555b94508593506127b392505050565b50506040805180820190915265ffffffffffff80851682526001600160d01b0380851660208085019182528854600181018a5560008a815291822095519251909316600160301b0291909316179201919091559050816127b3565b60006001600160a01b03831615801590610a655750826001600160a01b0316846001600160a01b03161480612e835750612e838484611527565b80610a655750506000908152600460205260409020546001600160a01b03908116911614919050565b6001600160e01b03198116811461159057600080fd5b600060208284031215612ed457600080fd5b813561159f81612eac565b60005b83811015612efa578181015183820152602001612ee2565b50506000910152565b60008151808452612f1b816020860160208601612edf565b601f01601f19169290920160200192915050565b60208152600061159f6020830184612f03565b600060208284031215612f5457600080fd5b5035919050565b6001600160a01b038116811461159057600080fd5b60008060408385031215612f8357600080fd5b8235612f8e81612f5b565b946020939093013593505050565b600080600060608486031215612fb157600080fd5b8335612fbc81612f5b565b92506020840135612fcc81612f5b565b929592945050506040919091013590565b60ff8116811461159057600080fd5b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff8111828210171561302b5761302b612fec565b604052919050565b600067ffffffffffffffff82111561304d5761304d612fec565b50601f01601f191660200190565b600082601f83011261306c57600080fd5b813561307f61307a82613033565b613002565b81815284602083860101111561309457600080fd5b816020850160208301376000918101602001919091529392505050565b600080604083850312156130c457600080fd5b82356130cf81612fdd565b9150602083013567ffffffffffffffff8111156130eb57600080fd5b6130f78582860161305b565b9150509250929050565b60006020828403121561311357600080fd5b813561159f81612f5b565b6000806040838503121561313157600080fd5b82359150602083013567ffffffffffffffff8111156130eb57600080fd5b60006020828403121561316157600080fd5b813567ffffffffffffffff81111561317857600080fd5b610a658482850161305b565b6000806040838503121561319757600080fd5b82356131a281612f5b565b915060208301356131b281612f5b565b809150509250929050565b60ff60f81b881681526000602060e0818401526131dd60e084018a612f03565b83810360408501526131ef818a612f03565b606085018990526001600160a01b038816608086015260a0850187905284810360c0860152855180825283870192509083019060005b8181101561324157835183529284019291840191600101613225565b50909c9b505050505050505050505050565b6000806040838503121561326657600080fd5b823561327181612f5b565b9150602083013580151581146131b257600080fd5b6000806000806080858703121561329c57600080fd5b84356132a781612f5b565b935060208501356132b781612f5b565b925060408501359150606085013567ffffffffffffffff8111156132da57600080fd5b6132e68782880161305b565b91505092959194509250565b60008060008060008060c0878903121561330b57600080fd5b863561331681612f5b565b95506020870135945060408701359350606087013561333481612fdd565b9598949750929560808101359460a0909101359350915050565b6000806040838503121561336157600080fd5b82356130cf81612f5b565b600181811c9082168061338057607f821691505b6020821081036133a057634e487b7160e01b600052602260045260246000fd5b50919050565b60208082526024908201527f4f7065726174696f6e206f6e6c7920616c6c6f776564206f6e20686f6d6520636040820152633430b4b760e11b606082015260800190565b634e487b7160e01b600052602160045260246000fd5b60006020828403121561341257600080fd5b5051919050565b60208082526023908201527f50726f6f6673206f6e6c792067656e657261746564206f6e20686f6d6520636860408201526230b4b760e91b606082015260800190565b6001600160a01b038516815260ff8416602082015260806040820181905260009061348990830185612f03565b905082606083015295945050505050565b600082601f8301126134ab57600080fd5b81516134b961307a82613033565b8181528460208386010111156134ce57600080fd5b610a65826020830160208701612edf565b6000602082840312156134f157600080fd5b815167ffffffffffffffff81111561350857600080fd5b610a658482850161349a565b634e487b7160e01b600052603260045260246000fd5b60408152600061353d6040830185612f03565b90508260208301529392505050565b60608152600061355f6060830186612f03565b6001600160a01b039490941660208301525060400152919050565b60008060006060848603121561358f57600080fd5b835161359a81612fdd565b602085015190935067ffffffffffffffff8111156135b757600080fd5b6135c38682870161349a565b925050604084015190509250925092565b600080604083850312156135e757600080fd5b82516135f281612f5b565b60208401519092506131b281612f5b565b6000806040838503121561361657600080fd5b825161362181612f5b565b602084015190925067ffffffffffffffff81111561363e57600080fd5b6130f78582860161349a565b634e487b7160e01b600052601160045260246000fd5b818103818111156105915761059161364a565b6000806040838503121561368657600080fd5b82519150602083015167ffffffffffffffff81111561363e57600080fd5b6001600160d01b038281168282160390808211156136c4576136c461364a565b5092915050565b6001600160d01b038181168382160190808211156136c4576136c461364a565b808201808211156105915761059161364a565b601f82111561090e57600081815260208120601f850160051c810160208610156137255750805b601f850160051c820191505b81811015611b8257828155600101613731565b815167ffffffffffffffff81111561375e5761375e612fec565b6137728161376c845461336c565b846136fe565b602080601f8311600181146137a7576000841561378f5750858301515b600019600386901b1c1916600185901b178555611b82565b600085815260208120601f198616915b828110156137d6578886015182559484019460019091019084016137b7565b50858210156137f45787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6000600182016138165761381661364a565b5060010190565b6001600160a01b038581168252841660208201526040810183905260806060820181905260009061385090830184612f03565b9695505050505050565b60006020828403121561386c57600080fd5b815161159f81612eac565b60008351613889818460208801612edf565b83519083019061389d818360208801612edf565b01949350505050565b634e487b7160e01b600052601260045260246000fd5b6000826138d957634e487b7160e01b600052601260045260246000fd5b500490565b634e487b7160e01b600052603160045260246000fdfea26469706673582212200861948c00ac12a29e05900592c5ed3f68c88227f729b466bf3d29f5a5208d1064736f6c63430008140033", + "libraries": { + "ProofHandler": "0x0152ee45780385dACCCCB128D816031CfFe5F36B" + }, + "devdoc": { + "author": "Web3 Hackers Collective", + "custom:security-contact": "julien@strat.cc", + "details": "Extends OpenZeppelin's NFT standards with cross-chain operation support and delegation", + "errors": { + "CheckpointUnorderedInsertion()": [ + { + "details": "A value was attempted to be inserted on a past checkpoint." + } + ], + "ECDSAInvalidSignature()": [ + { + "details": "The signature derives the `address(0)`." + } + ], + "ECDSAInvalidSignatureLength(uint256)": [ + { + "details": "The signature has an invalid length." + } + ], + "ECDSAInvalidSignatureS(bytes32)": [ + { + "details": "The signature has an S value that is in the upper half order." + } + ], + "ERC5805FutureLookup(uint256,uint48)": [ + { + "details": "Lookup to future votes is not available." + } + ], + "ERC6372InconsistentClock()": [ + { + "details": "The clock was incorrectly modified." + } + ], + "ERC721EnumerableForbiddenBatchMint()": [ + { + "details": "Batch mint is not allowed." + } + ], + "ERC721IncorrectOwner(address,uint256,address)": [ + { + "details": "Indicates an error related to the ownership over a particular token. Used in transfers.", + "params": { + "owner": "Address of the current owner of a token.", + "sender": "Address whose tokens are being transferred.", + "tokenId": "Identifier number of a token." + } + } + ], + "ERC721InsufficientApproval(address,uint256)": [ + { + "details": "Indicates a failure with the `operator`’s approval. Used in transfers.", + "params": { + "operator": "Address that may be allowed to operate on tokens without being their owner.", + "tokenId": "Identifier number of a token." + } + } + ], + "ERC721InvalidApprover(address)": [ + { + "details": "Indicates a failure with the `approver` of a token to be approved. Used in approvals.", + "params": { + "approver": "Address initiating an approval operation." + } + } + ], + "ERC721InvalidOperator(address)": [ + { + "details": "Indicates a failure with the `operator` to be approved. Used in approvals.", + "params": { + "operator": "Address that may be allowed to operate on tokens without being their owner." + } + } + ], + "ERC721InvalidOwner(address)": [ + { + "details": "Indicates that an address can't be an owner. For example, `address(0)` is a forbidden owner in ERC-20. Used in balance queries.", + "params": { + "owner": "Address of the current owner of a token." + } + } + ], + "ERC721InvalidReceiver(address)": [ + { + "details": "Indicates a failure with the token `receiver`. Used in transfers.", + "params": { + "receiver": "Address to which tokens are being transferred." + } + } + ], + "ERC721InvalidSender(address)": [ + { + "details": "Indicates a failure with the token `sender`. Used in transfers.", + "params": { + "sender": "Address whose tokens are being transferred." + } + } + ], + "ERC721NonexistentToken(uint256)": [ + { + "details": "Indicates a `tokenId` whose `owner` is the zero address.", + "params": { + "tokenId": "Identifier number of a token." + } + } + ], + "ERC721OutOfBoundsIndex(address,uint256)": [ + { + "details": "An `owner`'s token query was out of bounds for `index`. NOTE: The owner being `address(0)` indicates a global out of bounds index." + } + ], + "InvalidAccountNonce(address,uint256)": [ + { + "details": "The nonce used for an `account` is not the expected current nonce." + } + ], + "OwnableInvalidOwner(address)": [ + { + "details": "The owner is not a valid owner account. (eg. `address(0)`)" + } + ], + "OwnableUnauthorizedAccount(address)": [ + { + "details": "The caller account is not authorized to perform an operation." + } + ], + "SafeCastOverflowedUintDowncast(uint8,uint256)": [ + { + "details": "Value doesn't fit in an uint of `bits` size." + } + ], + "VotesExpiredSignature(uint256)": [ + { + "details": "The signature used has expired." + } + ] + }, + "events": { + "Approval(address,address,uint256)": { + "details": "Emitted when `owner` enables `approved` to manage the `tokenId` token." + }, + "ApprovalForAll(address,address,bool)": { + "details": "Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets." + }, + "BatchMetadataUpdate(uint256,uint256)": { + "details": "This event emits when the metadata of a range of tokens is changed. So that the third-party platforms such as NFT market could timely update the images and related attributes of the NFTs." + }, + "DelegateChanged(address,address,address)": { + "details": "Emitted when an account changes their delegate." + }, + "DelegateVotesChanged(address,uint256,uint256)": { + "details": "Emitted when a token transfer or delegate change results in changes to a delegate's number of voting units." + }, + "DelegationSynced(address,address,uint256)": { + "params": { + "delegatee": "The address receiving the delegation", + "delegator": "The address delegating their voting power", + "nonce": "Operation sequence number" + } + }, + "EIP712DomainChanged()": { + "details": "MAY be emitted to signal that the domain could have changed." + }, + "MembershipClaimed(uint256,address,uint256)": { + "params": { + "member": "The address receiving the membership", + "nonce": "Operation sequence number", + "tokenId": "The ID of the claimed token" + } + }, + "MembershipRevoked(uint256,address,uint256)": { + "params": { + "member": "The address losing membership", + "nonce": "Operation sequence number", + "tokenId": "The ID of the revoked token" + } + }, + "MetadataUpdate(uint256)": { + "details": "This event emits when the metadata of a token is changed. So that the third-party platforms such as NFT market could timely update the images and related attributes of the NFT." + }, + "MetadataUpdated(uint256,string,uint256)": { + "params": { + "newUri": "The new metadata URI", + "nonce": "Operation sequence number", + "tokenId": "The ID of the updated token" + } + }, + "Transfer(address,address,uint256)": { + "details": "Emitted when `tokenId` token is transferred from `from` to `to`." + } + }, + "kind": "dev", + "methods": { + "CLOCK_MODE()": { + "returns": { + "_0": "String indicating timestamp-based voting" + } + }, + "approve(address,uint256)": { + "details": "See {IERC721-approve}." + }, + "balanceOf(address)": { + "details": "See {IERC721-balanceOf}." + }, + "burn(uint256)": { + "details": "Burns `tokenId`. See {ERC721-_burn}. Requirements: - The caller must own `tokenId` or be an approved operator." + }, + "claimDelegation(bytes)": { + "params": { + "proof": "Proof generated by home chain" + } + }, + "claimOperation(bytes)": { + "params": { + "proof": "Proof generated by home chain" + } + }, + "clock()": { + "details": "Used for voting snapshots", + "returns": { + "_0": "Current block timestamp" + } + }, + "constructor": { + "params": { + "_firstMembers": "Array of initial member addresses", + "_home": "Chain ID where contract is considered home", + "_name": "Token collection name", + "_symbol": "Token collection symbol", + "_uri": "Initial token URI", + "initialOwner": "Initial contract owner" + } + }, + "delegate(address)": { + "details": "Overrides ERC721Votes delegate function to add cross-chain functionality", + "params": { + "delegatee": "Address to delegate voting power to" + } + }, + "delegateBySig(address,uint256,uint256,uint8,bytes32,bytes32)": { + "details": "Delegates votes from signer to `delegatee`." + }, + "delegates(address)": { + "details": "Returns the delegate that `account` has chosen." + }, + "eip712Domain()": { + "details": "See {IERC-5267}." + }, + "generateDelegationProof(address,address)": { + "details": "Only callable on home chain", + "params": { + "delegatee": "Address receiving delegation", + "delegator": "Address delegating voting power" + }, + "returns": { + "_0": "Encoded proof data" + } + }, + "generateOperationProof(uint8,bytes)": { + "details": "Only callable on home chain", + "params": { + "operationType": "Type of operation", + "params": "Operation parameters" + }, + "returns": { + "_0": "Encoded proof data" + } + }, + "getApproved(uint256)": { + "details": "See {IERC721-getApproved}." + }, + "getPastTotalSupply(uint256)": { + "details": "Returns the total supply of votes available at a specific moment in the past. If the `clock()` is configured to use block numbers, this will return the value at the end of the corresponding block. NOTE: This value is the sum of all available votes, which is not necessarily the sum of all delegated votes. Votes that have not been delegated are still part of total supply, even though they would not participate in a vote. Requirements: - `timepoint` must be in the past. If operating using block numbers, the block must be already mined." + }, + "getPastVotes(address,uint256)": { + "details": "Returns the amount of votes that `account` had at a specific moment in the past. If the `clock()` is configured to use block numbers, this will return the value at the end of the corresponding block. Requirements: - `timepoint` must be in the past. If operating using block numbers, the block must be already mined." + }, + "getVotes(address)": { + "details": "Returns the current amount of votes that `account` has." + }, + "govBurn(uint256)": { + "details": "Only callable by owner (governance) on home chain", + "params": { + "tokenId": "ID of token to burn" + } + }, + "isApprovedForAll(address,address)": { + "details": "See {IERC721-isApprovedForAll}." + }, + "name()": { + "details": "See {IERC721Metadata-name}." + }, + "nonces(address)": { + "details": "Returns the next unused nonce for an address." + }, + "owner()": { + "details": "Returns the address of the current owner." + }, + "ownerOf(uint256)": { + "details": "See {IERC721-ownerOf}." + }, + "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." + }, + "safeMint(address,string)": { + "details": "Only callable by owner (governance) on home chain", + "params": { + "to": "Address to mint token to", + "uri": "Token metadata URI" + } + }, + "safeTransferFrom(address,address,uint256)": { + "details": "See {IERC721-safeTransferFrom}." + }, + "safeTransferFrom(address,address,uint256,bytes)": { + "details": "See {IERC721-safeTransferFrom}." + }, + "setApprovalForAll(address,bool)": { + "details": "See {IERC721-setApprovalForAll}." + }, + "setMetadata(uint256,string)": { + "details": "Only callable by owner (governance) on home chain", + "params": { + "tokenId": "ID of token to update", + "uri": "New metadata URI" + } + }, + "supportsInterface(bytes4)": { + "params": { + "interfaceId": "Interface identifier to check" + }, + "returns": { + "_0": "bool True if interface is supported" + } + }, + "symbol()": { + "details": "See {IERC721Metadata-symbol}." + }, + "tokenByIndex(uint256)": { + "details": "See {IERC721Enumerable-tokenByIndex}." + }, + "tokenOfOwnerByIndex(address,uint256)": { + "details": "See {IERC721Enumerable-tokenOfOwnerByIndex}." + }, + "tokenURI(uint256)": { + "params": { + "tokenId": "Token ID to query" + }, + "returns": { + "_0": "URI string" + } + }, + "totalSupply()": { + "details": "See {IERC721Enumerable-totalSupply}." + }, + "transferFrom(address,address,uint256)": { + "details": "See {IERC721-transferFrom}." + }, + "transferOwnership(address)": { + "details": "Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner." + } + }, + "title": "Cross-chain Membership NFT Contract", + "version": 1 + }, + "userdoc": { + "events": { + "DelegationSynced(address,address,uint256)": { + "notice": "Emitted when delegation is synchronized across chains" + }, + "MembershipClaimed(uint256,address,uint256)": { + "notice": "Emitted when a membership is claimed" + }, + "MembershipRevoked(uint256,address,uint256)": { + "notice": "Emitted when a membership is revoked" + }, + "MetadataUpdated(uint256,string,uint256)": { + "notice": "Emitted when metadata is updated" + } + }, + "kind": "user", + "methods": { + "CLOCK_MODE()": { + "notice": "Gets clock mode description" + }, + "claimDelegation(bytes)": { + "notice": "Claims a delegation operation on a foreign chain" + }, + "claimOperation(bytes)": { + "notice": "Claims an NFT operation on a foreign chain" + }, + "clock()": { + "notice": "Gets current timestamp" + }, + "constructor": { + "notice": "Initializes the NFT contract" + }, + "delegate(address)": { + "notice": "Delegates voting power to another address on home chain" + }, + "generateDelegationProof(address,address)": { + "notice": "Generates proof for delegation" + }, + "generateOperationProof(uint8,bytes)": { + "notice": "Generates proof for NFT operations" + }, + "govBurn(uint256)": { + "notice": "Burns token on home chain" + }, + "home()": { + "notice": "Chain ID where contract was originally deployed" + }, + "safeMint(address,string)": { + "notice": "Adds a new member on home chain" + }, + "setMetadata(uint256,string)": { + "notice": "Updates token metadata on home chain" + }, + "supportsInterface(bytes4)": { + "notice": "Checks interface support" + }, + "tokenURI(uint256)": { + "notice": "Gets token URI" + } + }, + "notice": "Non-transferable NFT implementation for DAO membership with cross-chain capabilities", + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 1030, + "contract": "contracts/variants/crosschain/NFT.sol:NFT", + "label": "_name", + "offset": 0, + "slot": "0", + "type": "t_string_storage" + }, + { + "astId": 1032, + "contract": "contracts/variants/crosschain/NFT.sol:NFT", + "label": "_symbol", + "offset": 0, + "slot": "1", + "type": "t_string_storage" + }, + { + "astId": 1036, + "contract": "contracts/variants/crosschain/NFT.sol:NFT", + "label": "_owners", + "offset": 0, + "slot": "2", + "type": "t_mapping(t_uint256,t_address)" + }, + { + "astId": 1040, + "contract": "contracts/variants/crosschain/NFT.sol:NFT", + "label": "_balances", + "offset": 0, + "slot": "3", + "type": "t_mapping(t_address,t_uint256)" + }, + { + "astId": 1044, + "contract": "contracts/variants/crosschain/NFT.sol:NFT", + "label": "_tokenApprovals", + "offset": 0, + "slot": "4", + "type": "t_mapping(t_uint256,t_address)" + }, + { + "astId": 1050, + "contract": "contracts/variants/crosschain/NFT.sol:NFT", + "label": "_operatorApprovals", + "offset": 0, + "slot": "5", + "type": "t_mapping(t_address,t_mapping(t_address,t_bool))" + }, + { + "astId": 2137, + "contract": "contracts/variants/crosschain/NFT.sol:NFT", + "label": "_ownedTokens", + "offset": 0, + "slot": "6", + "type": "t_mapping(t_address,t_mapping(t_uint256,t_uint256))" + }, + { + "astId": 2141, + "contract": "contracts/variants/crosschain/NFT.sol:NFT", + "label": "_ownedTokensIndex", + "offset": 0, + "slot": "7", + "type": "t_mapping(t_uint256,t_uint256)" + }, + { + "astId": 2144, + "contract": "contracts/variants/crosschain/NFT.sol:NFT", + "label": "_allTokens", + "offset": 0, + "slot": "8", + "type": "t_array(t_uint256)dyn_storage" + }, + { + "astId": 2148, + "contract": "contracts/variants/crosschain/NFT.sol:NFT", + "label": "_allTokensIndex", + "offset": 0, + "slot": "9", + "type": "t_mapping(t_uint256,t_uint256)" + }, + { + "astId": 2532, + "contract": "contracts/variants/crosschain/NFT.sol:NFT", + "label": "_tokenURIs", + "offset": 0, + "slot": "10", + "type": "t_mapping(t_uint256,t_string_storage)" + }, + { + "astId": 8, + "contract": "contracts/variants/crosschain/NFT.sol:NFT", + "label": "_owner", + "offset": 0, + "slot": "11", + "type": "t_address" + }, + { + "astId": 4046, + "contract": "contracts/variants/crosschain/NFT.sol:NFT", + "label": "_nameFallback", + "offset": 0, + "slot": "12", + "type": "t_string_storage" + }, + { + "astId": 4048, + "contract": "contracts/variants/crosschain/NFT.sol:NFT", + "label": "_versionFallback", + "offset": 0, + "slot": "13", + "type": "t_string_storage" + }, + { + "astId": 2894, + "contract": "contracts/variants/crosschain/NFT.sol:NFT", + "label": "_nonces", + "offset": 0, + "slot": "14", + "type": "t_mapping(t_address,t_uint256)" + }, + { + "astId": 270, + "contract": "contracts/variants/crosschain/NFT.sol:NFT", + "label": "_delegatee", + "offset": 0, + "slot": "15", + "type": "t_mapping(t_address,t_address)" + }, + { + "astId": 275, + "contract": "contracts/variants/crosschain/NFT.sol:NFT", + "label": "_delegateCheckpoints", + "offset": 0, + "slot": "16", + "type": "t_mapping(t_address,t_struct(Trace208)8398_storage)" + }, + { + "astId": 278, + "contract": "contracts/variants/crosschain/NFT.sol:NFT", + "label": "_totalCheckpoints", + "offset": 0, + "slot": "17", + "type": "t_struct(Trace208)8398_storage" + }, + { + "astId": 9751, + "contract": "contracts/variants/crosschain/NFT.sol:NFT", + "label": "_nextTokenId", + "offset": 0, + "slot": "18", + "type": "t_uint256" + }, + { + "astId": 9755, + "contract": "contracts/variants/crosschain/NFT.sol:NFT", + "label": "_proofStorage", + "offset": 0, + "slot": "19", + "type": "t_struct(ProofStorage)10489_storage" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + }, + "t_array(t_struct(Checkpoint208)8403_storage)dyn_storage": { + "base": "t_struct(Checkpoint208)8403_storage", + "encoding": "dynamic_array", + "label": "struct Checkpoints.Checkpoint208[]", + "numberOfBytes": "32" + }, + "t_array(t_uint256)dyn_storage": { + "base": "t_uint256", + "encoding": "dynamic_array", + "label": "uint256[]", + "numberOfBytes": "32" + }, + "t_bool": { + "encoding": "inplace", + "label": "bool", + "numberOfBytes": "1" + }, + "t_bytes32": { + "encoding": "inplace", + "label": "bytes32", + "numberOfBytes": "32" + }, + "t_mapping(t_address,t_address)": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => address)", + "numberOfBytes": "32", + "value": "t_address" + }, + "t_mapping(t_address,t_bool)": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => bool)", + "numberOfBytes": "32", + "value": "t_bool" + }, + "t_mapping(t_address,t_mapping(t_address,t_bool))": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => mapping(address => bool))", + "numberOfBytes": "32", + "value": "t_mapping(t_address,t_bool)" + }, + "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_address,t_struct(Trace208)8398_storage)": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => struct Checkpoints.Trace208)", + "numberOfBytes": "32", + "value": "t_struct(Trace208)8398_storage" + }, + "t_mapping(t_address,t_uint256)": { + "encoding": "mapping", + "key": "t_address", + "label": "mapping(address => uint256)", + "numberOfBytes": "32", + "value": "t_uint256" + }, + "t_mapping(t_bytes32,t_bool)": { + "encoding": "mapping", + "key": "t_bytes32", + "label": "mapping(bytes32 => bool)", + "numberOfBytes": "32", + "value": "t_bool" + }, + "t_mapping(t_uint256,t_address)": { + "encoding": "mapping", + "key": "t_uint256", + "label": "mapping(uint256 => address)", + "numberOfBytes": "32", + "value": "t_address" + }, + "t_mapping(t_uint256,t_string_storage)": { + "encoding": "mapping", + "key": "t_uint256", + "label": "mapping(uint256 => string)", + "numberOfBytes": "32", + "value": "t_string_storage" + }, + "t_mapping(t_uint256,t_uint256)": { + "encoding": "mapping", + "key": "t_uint256", + "label": "mapping(uint256 => uint256)", + "numberOfBytes": "32", + "value": "t_uint256" + }, + "t_mapping(t_uint8,t_uint256)": { + "encoding": "mapping", + "key": "t_uint8", + "label": "mapping(uint8 => uint256)", + "numberOfBytes": "32", + "value": "t_uint256" + }, + "t_string_storage": { + "encoding": "bytes", + "label": "string", + "numberOfBytes": "32" + }, + "t_struct(Checkpoint208)8403_storage": { + "encoding": "inplace", + "label": "struct Checkpoints.Checkpoint208", + "members": [ + { + "astId": 8400, + "contract": "contracts/variants/crosschain/NFT.sol:NFT", + "label": "_key", + "offset": 0, + "slot": "0", + "type": "t_uint48" + }, + { + "astId": 8402, + "contract": "contracts/variants/crosschain/NFT.sol:NFT", + "label": "_value", + "offset": 6, + "slot": "0", + "type": "t_uint208" + } + ], + "numberOfBytes": "32" + }, + "t_struct(ProofStorage)10489_storage": { + "encoding": "inplace", + "label": "struct ProofHandler.ProofStorage", + "members": [ + { + "astId": 10484, + "contract": "contracts/variants/crosschain/NFT.sol:NFT", + "label": "updateAppliedOnChain", + "offset": 0, + "slot": "0", + "type": "t_mapping(t_bytes32,t_bool)" + }, + { + "astId": 10488, + "contract": "contracts/variants/crosschain/NFT.sol:NFT", + "label": "currentNonce", + "offset": 0, + "slot": "1", + "type": "t_mapping(t_uint8,t_uint256)" + } + ], + "numberOfBytes": "64" + }, + "t_struct(Trace208)8398_storage": { + "encoding": "inplace", + "label": "struct Checkpoints.Trace208", + "members": [ + { + "astId": 8397, + "contract": "contracts/variants/crosschain/NFT.sol:NFT", + "label": "_checkpoints", + "offset": 0, + "slot": "0", + "type": "t_array(t_struct(Checkpoint208)8403_storage)dyn_storage" + } + ], + "numberOfBytes": "32" + }, + "t_uint208": { + "encoding": "inplace", + "label": "uint208", + "numberOfBytes": "26" + }, + "t_uint256": { + "encoding": "inplace", + "label": "uint256", + "numberOfBytes": "32" + }, + "t_uint48": { + "encoding": "inplace", + "label": "uint48", + "numberOfBytes": "6" + }, + "t_uint8": { + "encoding": "inplace", + "label": "uint8", + "numberOfBytes": "1" + } + } + } +} \ No newline at end of file diff --git a/deployments/opSepolia/ProofHandler.json b/deployments/opSepolia/ProofHandler.json new file mode 100644 index 0000000..3ec826e --- /dev/null +++ b/deployments/opSepolia/ProofHandler.json @@ -0,0 +1,149 @@ +{ + "address": "0x0152ee45780385dACCCCB128D816031CfFe5F36B", + "abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint8", + "name": "operationType", + "type": "uint8" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "params", + "type": "bytes" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + } + ], + "name": "ProofClaimed", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "contractAddress", + "type": "address" + }, + { + "internalType": "uint8", + "name": "operationType", + "type": "uint8" + }, + { + "internalType": "bytes", + "name": "params", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + } + ], + "name": "generateProof", + "outputs": [ + { + "internalType": "bytes", + "name": "proof", + "type": "bytes" + } + ], + "stateMutability": "pure", + "type": "function" + } + ], + "args": [], + "numDeployments": 1, + "solcInputHash": "96a9008abeaccbd30a9b75989ce7f0fd", + "metadata": "{\"compiler\":{\"version\":\"0.8.20+commit.a1b79de6\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint8\",\"name\":\"operationType\",\"type\":\"uint8\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"params\",\"type\":\"bytes\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"}],\"name\":\"ProofClaimed\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"contractAddress\",\"type\":\"address\"},{\"internalType\":\"uint8\",\"name\":\"operationType\",\"type\":\"uint8\"},{\"internalType\":\"bytes\",\"name\":\"params\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"}],\"name\":\"generateProof\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"proof\",\"type\":\"bytes\"}],\"stateMutability\":\"pure\",\"type\":\"function\"}],\"devdoc\":{\"author\":\"Web3 Hackers Collective\",\"custom:security-contact\":\"julien@strat.cc\",\"details\":\"Handles proof generation, verification, and tracking for cross-chain operations\",\"events\":{\"ProofClaimed(uint8,bytes,uint256)\":{\"details\":\"Emitted when a proof is claimed\"}},\"kind\":\"dev\",\"methods\":{\"generateProof(address,uint8,bytes,uint256)\":{\"params\":{\"contractAddress\":\"Address of contract generating the proof\",\"nonce\":\"Current nonce for this operation type\",\"operationType\":\"Type of operation being performed\",\"params\":\"Operation parameters\"},\"returns\":{\"proof\":\"Encoded proof data\"}},\"getNextNonce(ProofHandler.ProofStorage storage,uint8)\":{\"params\":{\"operationType\":\"Type of operation\",\"storage_\":\"Proof storage struct\"},\"returns\":{\"nonce\":\"Next nonce value\"}},\"incrementNonce(ProofHandler.ProofStorage storage,uint8)\":{\"params\":{\"operationType\":\"Type of operation\",\"storage_\":\"Proof storage struct\"},\"returns\":{\"nonce\":\"New nonce value\"}},\"verifyAndClaimProof(bytes,address,ProofHandler.ProofStorage storage)\":{\"params\":{\"contractAddress\":\"Address of contract claiming the proof\",\"proof\":\"Proof to verify and claim\",\"storage_\":\"Proof storage struct\"},\"returns\":{\"nonce\":\"The operation sequence number\",\"operationType\":\"The type of operation being performed\",\"params\":\"The operation parameters\"}}},\"title\":\"Proof Handler Library\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"generateProof(address,uint8,bytes,uint256)\":{\"notice\":\"Generates a proof for cross-chain operations\"},\"getNextNonce(ProofHandler.ProofStorage storage,uint8)\":{\"notice\":\"Gets the next nonce for an operation type\"},\"incrementNonce(ProofHandler.ProofStorage storage,uint8)\":{\"notice\":\"Increments the nonce for an operation type\"},\"verifyAndClaimProof(bytes,address,ProofHandler.ProofStorage storage)\":{\"notice\":\"Verifies and claims a proof\"}},\"notice\":\"Library for standardized cross-chain proof generation and verification\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/variants/crosschain/ProofHandler.sol\":\"ProofHandler\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"contracts/variants/crosschain/ProofHandler.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity ^0.8.20;\\n\\n/**\\n * @title Proof Handler Library\\n * @author Web3 Hackers Collective\\n * @notice Library for standardized cross-chain proof generation and verification\\n * @dev Handles proof generation, verification, and tracking for cross-chain operations\\n * @custom:security-contact julien@strat.cc\\n */\\nlibrary ProofHandler {\\n /// @notice Tracks which proofs have been applied on each chain\\n struct ProofStorage {\\n mapping(bytes32 => bool) updateAppliedOnChain;\\n mapping(uint8 => uint256) currentNonce;\\n }\\n\\n /// @dev Emitted when a proof is claimed\\n event ProofClaimed(uint8 indexed operationType, bytes params, uint256 nonce);\\n\\n /**\\n * @notice Generates a proof for cross-chain operations\\n * @param contractAddress Address of contract generating the proof\\n * @param operationType Type of operation being performed\\n * @param params Operation parameters\\n * @param nonce Current nonce for this operation type\\n * @return proof Encoded proof data\\n */\\n function generateProof(\\n address contractAddress,\\n uint8 operationType,\\n bytes memory params,\\n uint256 nonce\\n ) public pure returns (bytes memory proof) {\\n bytes32 message = keccak256(\\n abi.encodePacked(contractAddress, operationType, params, nonce)\\n );\\n bytes32 digest = keccak256(abi.encodePacked(\\\"\\\\x19Ethereum Signed Message:\\\\n32\\\", message));\\n\\n return abi.encode(operationType, params, nonce, digest);\\n }\\n\\n /**\\n * @notice Verifies and claims a proof\\n * @param proof Proof to verify and claim\\n * @param contractAddress Address of contract claiming the proof\\n * @param storage_ Proof storage struct\\n * @return operationType The type of operation being performed\\n * @return params The operation parameters\\n * @return nonce The operation sequence number\\n */\\n function verifyAndClaimProof(\\n bytes memory proof,\\n address contractAddress,\\n ProofStorage storage storage_\\n ) public returns (uint8 operationType, bytes memory params, uint256 nonce) {\\n bytes32 digest;\\n (operationType, params, nonce, digest) = abi.decode(\\n proof,\\n (uint8, bytes, uint256, bytes32)\\n );\\n\\n bytes32 proofHash = keccak256(proof);\\n require(!storage_.updateAppliedOnChain[proofHash], \\\"Proof already claimed\\\");\\n require(nonce == storage_.currentNonce[operationType] + 1, \\\"Invalid nonce\\\");\\n\\n bytes32 message = keccak256(\\n abi.encodePacked(contractAddress, operationType, params, nonce)\\n );\\n bytes32 expectedDigest = keccak256(\\n abi.encodePacked(\\\"\\\\x19Ethereum Signed Message:\\\\n32\\\", message)\\n );\\n require(digest == expectedDigest, \\\"Invalid proof\\\");\\n\\n storage_.updateAppliedOnChain[proofHash] = true;\\n storage_.currentNonce[operationType] = nonce;\\n\\n emit ProofClaimed(operationType, params, nonce);\\n\\n return (operationType, params, nonce);\\n }\\n\\n /**\\n * @notice Gets the next nonce for an operation type\\n * @param storage_ Proof storage struct\\n * @param operationType Type of operation\\n * @return nonce Next nonce value\\n */\\n function getNextNonce(\\n ProofStorage storage storage_,\\n uint8 operationType\\n ) public view returns (uint256 nonce) {\\n return storage_.currentNonce[operationType] + 1;\\n }\\n\\n /**\\n * @notice Increments the nonce for an operation type\\n * @param storage_ Proof storage struct\\n * @param operationType Type of operation\\n * @return nonce New nonce value\\n */\\n function incrementNonce(\\n ProofStorage storage storage_,\\n uint8 operationType\\n ) public returns (uint256 nonce) {\\n storage_.currentNonce[operationType]++;\\n return storage_.currentNonce[operationType];\\n }\\n}\\n\",\"keccak256\":\"0x3719e47c508f29977d48842c5c1d27cce7cb289cbb592526f170f98135ff41a7\",\"license\":\"GPL-3.0\"}},\"version\":1}", + "bytecode": "0x61086261003a600b82828239805160001a60731461002d57634e487b7160e01b600052600060045260246000fd5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600436106100565760003560e01c80632b276f581461005b5780633b0d4dd71461008157806373521781146100a1578063c0af6591146100c1575b600080fd5b61006e610069366004610450565b6100f0565b6040519081526020015b60405180910390f35b81801561008d57600080fd5b5061006e61009c366004610450565b610118565b6100b46100af366004610561565b610158565b6040516100789190610619565b8180156100cd57600080fd5b506100e16100dc36600461062c565b610214565b60405161007893929190610683565b60ff811660009081526001808401602052604082205461010f916106c5565b90505b92915050565b60ff81166000908152600183016020526040812080549082610139836106d8565b90915550505060ff166000908152600191909101602052604090205490565b606060008585858560405160200161017394939291906106f1565b6040516020818303038152906040528051906020012090506000816040516020016101ca91907f19457468657265756d205369676e6564204d6573736167653a0a3332000000008152601c810191909152603c0190565b604051602081830303815290604052805190602001209050858585836040516020016101f99493929190610740565b60405160208183030381529060405292505050949350505050565b600060606000808680602001905181019061022f919061076f565b8a516020808d01919091206000818152918b905260409091205494985092965090945092509060ff16156102a25760405162461bcd60e51b8152602060048201526015602482015274141c9bdbd988185b1c9958591e4818db185a5b5959605a1b60448201526064015b60405180910390fd5b60ff8516600090815260018088016020526040909120546102c2916106c5565b83146103005760405162461bcd60e51b815260206004820152600d60248201526c496e76616c6964206e6f6e636560981b6044820152606401610299565b60008786868660405160200161031994939291906106f1565b60405160208183030381529060405280519060200120905060008160405160200161037091907f19457468657265756d205369676e6564204d6573736167653a0a3332000000008152601c810191909152603c0190565b6040516020818303038152906040528051906020012090508084146103c75760405162461bcd60e51b815260206004820152600d60248201526c24b73b30b634b210383937b7b360991b6044820152606401610299565b600083815260208981526040808320805460ff1916600190811790915560ff8b16808552908c019092529182902087905590517f9d572fd94428aa262dfbc3962dbfc27e1c732588d2f37703185192eb7d39a7cc90610429908990899061080a565b60405180910390a25050505093509350939050565b60ff8116811461044d57600080fd5b50565b6000806040838503121561046357600080fd5b8235915060208301356104758161043e565b809150509250929050565b80356001600160a01b038116811461049757600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff811182821017156104db576104db61049c565b604052919050565b600067ffffffffffffffff8211156104fd576104fd61049c565b50601f01601f191660200190565b600082601f83011261051c57600080fd5b813561052f61052a826104e3565b6104b2565b81815284602083860101111561054457600080fd5b816020850160208301376000918101602001919091529392505050565b6000806000806080858703121561057757600080fd5b61058085610480565b935060208501356105908161043e565b9250604085013567ffffffffffffffff8111156105ac57600080fd5b6105b88782880161050b565b949793965093946060013593505050565b60005b838110156105e45781810151838201526020016105cc565b50506000910152565b600081518084526106058160208601602086016105c9565b601f01601f19169290920160200192915050565b60208152600061010f60208301846105ed565b60008060006060848603121561064157600080fd5b833567ffffffffffffffff81111561065857600080fd5b6106648682870161050b565b93505061067360208501610480565b9150604084013590509250925092565b60ff8416815260606020820152600061069f60608301856105ed565b9050826040830152949350505050565b634e487b7160e01b600052601160045260246000fd5b80820180821115610112576101126106af565b6000600182016106ea576106ea6106af565b5060010190565b6bffffffffffffffffffffffff198560601b16815260ff60f81b8460f81b1660148201526000835161072a8160158501602088016105c9565b6015920191820192909252603501949350505050565b60ff8516815260806020820152600061075c60808301866105ed565b6040830194909452506060015292915050565b6000806000806080858703121561078557600080fd5b84516107908161043e565b602086015190945067ffffffffffffffff8111156107ad57600080fd5b8501601f810187136107be57600080fd5b80516107cc61052a826104e3565b8181528860208385010111156107e157600080fd5b6107f28260208301602086016105c9565b60408801516060909801519699909850945050505050565b60408152600061081d60408301856105ed565b9050826020830152939250505056fea26469706673582212203dae3b101192a9db985457cad109d67a3cd7e229e3e6792a1b933b258581f0e664736f6c63430008140033", + "deployedBytecode": "0x73000000000000000000000000000000000000000030146080604052600436106100565760003560e01c80632b276f581461005b5780633b0d4dd71461008157806373521781146100a1578063c0af6591146100c1575b600080fd5b61006e610069366004610450565b6100f0565b6040519081526020015b60405180910390f35b81801561008d57600080fd5b5061006e61009c366004610450565b610118565b6100b46100af366004610561565b610158565b6040516100789190610619565b8180156100cd57600080fd5b506100e16100dc36600461062c565b610214565b60405161007893929190610683565b60ff811660009081526001808401602052604082205461010f916106c5565b90505b92915050565b60ff81166000908152600183016020526040812080549082610139836106d8565b90915550505060ff166000908152600191909101602052604090205490565b606060008585858560405160200161017394939291906106f1565b6040516020818303038152906040528051906020012090506000816040516020016101ca91907f19457468657265756d205369676e6564204d6573736167653a0a3332000000008152601c810191909152603c0190565b604051602081830303815290604052805190602001209050858585836040516020016101f99493929190610740565b60405160208183030381529060405292505050949350505050565b600060606000808680602001905181019061022f919061076f565b8a516020808d01919091206000818152918b905260409091205494985092965090945092509060ff16156102a25760405162461bcd60e51b8152602060048201526015602482015274141c9bdbd988185b1c9958591e4818db185a5b5959605a1b60448201526064015b60405180910390fd5b60ff8516600090815260018088016020526040909120546102c2916106c5565b83146103005760405162461bcd60e51b815260206004820152600d60248201526c496e76616c6964206e6f6e636560981b6044820152606401610299565b60008786868660405160200161031994939291906106f1565b60405160208183030381529060405280519060200120905060008160405160200161037091907f19457468657265756d205369676e6564204d6573736167653a0a3332000000008152601c810191909152603c0190565b6040516020818303038152906040528051906020012090508084146103c75760405162461bcd60e51b815260206004820152600d60248201526c24b73b30b634b210383937b7b360991b6044820152606401610299565b600083815260208981526040808320805460ff1916600190811790915560ff8b16808552908c019092529182902087905590517f9d572fd94428aa262dfbc3962dbfc27e1c732588d2f37703185192eb7d39a7cc90610429908990899061080a565b60405180910390a25050505093509350939050565b60ff8116811461044d57600080fd5b50565b6000806040838503121561046357600080fd5b8235915060208301356104758161043e565b809150509250929050565b80356001600160a01b038116811461049757600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff811182821017156104db576104db61049c565b604052919050565b600067ffffffffffffffff8211156104fd576104fd61049c565b50601f01601f191660200190565b600082601f83011261051c57600080fd5b813561052f61052a826104e3565b6104b2565b81815284602083860101111561054457600080fd5b816020850160208301376000918101602001919091529392505050565b6000806000806080858703121561057757600080fd5b61058085610480565b935060208501356105908161043e565b9250604085013567ffffffffffffffff8111156105ac57600080fd5b6105b88782880161050b565b949793965093946060013593505050565b60005b838110156105e45781810151838201526020016105cc565b50506000910152565b600081518084526106058160208601602086016105c9565b601f01601f19169290920160200192915050565b60208152600061010f60208301846105ed565b60008060006060848603121561064157600080fd5b833567ffffffffffffffff81111561065857600080fd5b6106648682870161050b565b93505061067360208501610480565b9150604084013590509250925092565b60ff8416815260606020820152600061069f60608301856105ed565b9050826040830152949350505050565b634e487b7160e01b600052601160045260246000fd5b80820180821115610112576101126106af565b6000600182016106ea576106ea6106af565b5060010190565b6bffffffffffffffffffffffff198560601b16815260ff60f81b8460f81b1660148201526000835161072a8160158501602088016105c9565b6015920191820192909252603501949350505050565b60ff8516815260806020820152600061075c60808301866105ed565b6040830194909452506060015292915050565b6000806000806080858703121561078557600080fd5b84516107908161043e565b602086015190945067ffffffffffffffff8111156107ad57600080fd5b8501601f810187136107be57600080fd5b80516107cc61052a826104e3565b8181528860208385010111156107e157600080fd5b6107f28260208301602086016105c9565b60408801516060909801519699909850945050505050565b60408152600061081d60408301856105ed565b9050826020830152939250505056fea26469706673582212203dae3b101192a9db985457cad109d67a3cd7e229e3e6792a1b933b258581f0e664736f6c63430008140033", + "devdoc": { + "author": "Web3 Hackers Collective", + "custom:security-contact": "julien@strat.cc", + "details": "Handles proof generation, verification, and tracking for cross-chain operations", + "events": { + "ProofClaimed(uint8,bytes,uint256)": { + "details": "Emitted when a proof is claimed" + } + }, + "kind": "dev", + "methods": { + "generateProof(address,uint8,bytes,uint256)": { + "params": { + "contractAddress": "Address of contract generating the proof", + "nonce": "Current nonce for this operation type", + "operationType": "Type of operation being performed", + "params": "Operation parameters" + }, + "returns": { + "proof": "Encoded proof data" + } + }, + "getNextNonce(ProofHandler.ProofStorage storage,uint8)": { + "params": { + "operationType": "Type of operation", + "storage_": "Proof storage struct" + }, + "returns": { + "nonce": "Next nonce value" + } + }, + "incrementNonce(ProofHandler.ProofStorage storage,uint8)": { + "params": { + "operationType": "Type of operation", + "storage_": "Proof storage struct" + }, + "returns": { + "nonce": "New nonce value" + } + }, + "verifyAndClaimProof(bytes,address,ProofHandler.ProofStorage storage)": { + "params": { + "contractAddress": "Address of contract claiming the proof", + "proof": "Proof to verify and claim", + "storage_": "Proof storage struct" + }, + "returns": { + "nonce": "The operation sequence number", + "operationType": "The type of operation being performed", + "params": "The operation parameters" + } + } + }, + "title": "Proof Handler Library", + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": { + "generateProof(address,uint8,bytes,uint256)": { + "notice": "Generates a proof for cross-chain operations" + }, + "getNextNonce(ProofHandler.ProofStorage storage,uint8)": { + "notice": "Gets the next nonce for an operation type" + }, + "incrementNonce(ProofHandler.ProofStorage storage,uint8)": { + "notice": "Increments the nonce for an operation type" + }, + "verifyAndClaimProof(bytes,address,ProofHandler.ProofStorage storage)": { + "notice": "Verifies and claims a proof" + } + }, + "notice": "Library for standardized cross-chain proof generation and verification", + "version": 1 + }, + "storageLayout": { + "storage": [], + "types": null + } +} \ No newline at end of file diff --git a/deployments/opSepolia/solcInputs/77ec5f062950e8c4875fd27ffb65d267.json b/deployments/opSepolia/solcInputs/77ec5f062950e8c4875fd27ffb65d267.json new file mode 100644 index 0000000..8590478 --- /dev/null +++ b/deployments/opSepolia/solcInputs/77ec5f062950e8c4875fd27ffb65d267.json @@ -0,0 +1,186 @@ +{ + "language": "Solidity", + "sources": { + "@openzeppelin/contracts/access/Ownable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol)\n\npragma solidity ^0.8.20;\n\nimport {Context} from \"../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 * The initial owner is set to the address provided by the deployer. This can\n * 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 /**\n * @dev The caller account is not authorized to perform an operation.\n */\n error OwnableUnauthorizedAccount(address account);\n\n /**\n * @dev The owner is not a valid owner account. (eg. `address(0)`)\n */\n error OwnableInvalidOwner(address owner);\n\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n /**\n * @dev Initializes the contract setting the address provided by the deployer as the initial owner.\n */\n constructor(address initialOwner) {\n if (initialOwner == address(0)) {\n revert OwnableInvalidOwner(address(0));\n }\n _transferOwnership(initialOwner);\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 if (owner() != _msgSender()) {\n revert OwnableUnauthorizedAccount(_msgSender());\n }\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 if (newOwner == address(0)) {\n revert OwnableInvalidOwner(address(0));\n }\n _transferOwnership(newOwner);\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Internal function without access restriction.\n */\n function _transferOwnership(address newOwner) internal virtual {\n address oldOwner = _owner;\n _owner = newOwner;\n emit OwnershipTransferred(oldOwner, newOwner);\n }\n}\n" + }, + "@openzeppelin/contracts/governance/extensions/GovernorCountingSimple.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (governance/extensions/GovernorCountingSimple.sol)\n\npragma solidity ^0.8.20;\n\nimport {Governor} from \"../Governor.sol\";\n\n/**\n * @dev Extension of {Governor} for simple, 3 options, vote counting.\n */\nabstract contract GovernorCountingSimple is Governor {\n /**\n * @dev Supported vote types. Matches Governor Bravo ordering.\n */\n enum VoteType {\n Against,\n For,\n Abstain\n }\n\n struct ProposalVote {\n uint256 againstVotes;\n uint256 forVotes;\n uint256 abstainVotes;\n mapping(address voter => bool) hasVoted;\n }\n\n mapping(uint256 proposalId => ProposalVote) private _proposalVotes;\n\n /**\n * @dev See {IGovernor-COUNTING_MODE}.\n */\n // solhint-disable-next-line func-name-mixedcase\n function COUNTING_MODE() public pure virtual override returns (string memory) {\n return \"support=bravo&quorum=for,abstain\";\n }\n\n /**\n * @dev See {IGovernor-hasVoted}.\n */\n function hasVoted(uint256 proposalId, address account) public view virtual override returns (bool) {\n return _proposalVotes[proposalId].hasVoted[account];\n }\n\n /**\n * @dev Accessor to the internal vote counts.\n */\n function proposalVotes(\n uint256 proposalId\n ) public view virtual returns (uint256 againstVotes, uint256 forVotes, uint256 abstainVotes) {\n ProposalVote storage proposalVote = _proposalVotes[proposalId];\n return (proposalVote.againstVotes, proposalVote.forVotes, proposalVote.abstainVotes);\n }\n\n /**\n * @dev See {Governor-_quorumReached}.\n */\n function _quorumReached(uint256 proposalId) internal view virtual override returns (bool) {\n ProposalVote storage proposalVote = _proposalVotes[proposalId];\n\n return quorum(proposalSnapshot(proposalId)) <= proposalVote.forVotes + proposalVote.abstainVotes;\n }\n\n /**\n * @dev See {Governor-_voteSucceeded}. In this module, the forVotes must be strictly over the againstVotes.\n */\n function _voteSucceeded(uint256 proposalId) internal view virtual override returns (bool) {\n ProposalVote storage proposalVote = _proposalVotes[proposalId];\n\n return proposalVote.forVotes > proposalVote.againstVotes;\n }\n\n /**\n * @dev See {Governor-_countVote}. In this module, the support follows the `VoteType` enum (from Governor Bravo).\n */\n function _countVote(\n uint256 proposalId,\n address account,\n uint8 support,\n uint256 totalWeight,\n bytes memory // params\n ) internal virtual override returns (uint256) {\n ProposalVote storage proposalVote = _proposalVotes[proposalId];\n\n if (proposalVote.hasVoted[account]) {\n revert GovernorAlreadyCastVote(account);\n }\n proposalVote.hasVoted[account] = true;\n\n if (support == uint8(VoteType.Against)) {\n proposalVote.againstVotes += totalWeight;\n } else if (support == uint8(VoteType.For)) {\n proposalVote.forVotes += totalWeight;\n } else if (support == uint8(VoteType.Abstain)) {\n proposalVote.abstainVotes += totalWeight;\n } else {\n revert GovernorInvalidVoteType();\n }\n\n return totalWeight;\n }\n}\n" + }, + "@openzeppelin/contracts/governance/extensions/GovernorSettings.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (governance/extensions/GovernorSettings.sol)\n\npragma solidity ^0.8.20;\n\nimport {Governor} from \"../Governor.sol\";\n\n/**\n * @dev Extension of {Governor} for settings updatable through governance.\n */\nabstract contract GovernorSettings is Governor {\n // amount of token\n uint256 private _proposalThreshold;\n // timepoint: limited to uint48 in core (same as clock() type)\n uint48 private _votingDelay;\n // duration: limited to uint32 in core\n uint32 private _votingPeriod;\n\n event VotingDelaySet(uint256 oldVotingDelay, uint256 newVotingDelay);\n event VotingPeriodSet(uint256 oldVotingPeriod, uint256 newVotingPeriod);\n event ProposalThresholdSet(uint256 oldProposalThreshold, uint256 newProposalThreshold);\n\n /**\n * @dev Initialize the governance parameters.\n */\n constructor(uint48 initialVotingDelay, uint32 initialVotingPeriod, uint256 initialProposalThreshold) {\n _setVotingDelay(initialVotingDelay);\n _setVotingPeriod(initialVotingPeriod);\n _setProposalThreshold(initialProposalThreshold);\n }\n\n /**\n * @dev See {IGovernor-votingDelay}.\n */\n function votingDelay() public view virtual override returns (uint256) {\n return _votingDelay;\n }\n\n /**\n * @dev See {IGovernor-votingPeriod}.\n */\n function votingPeriod() public view virtual override returns (uint256) {\n return _votingPeriod;\n }\n\n /**\n * @dev See {Governor-proposalThreshold}.\n */\n function proposalThreshold() public view virtual override returns (uint256) {\n return _proposalThreshold;\n }\n\n /**\n * @dev Update the voting delay. This operation can only be performed through a governance proposal.\n *\n * Emits a {VotingDelaySet} event.\n */\n function setVotingDelay(uint48 newVotingDelay) public virtual onlyGovernance {\n _setVotingDelay(newVotingDelay);\n }\n\n /**\n * @dev Update the voting period. This operation can only be performed through a governance proposal.\n *\n * Emits a {VotingPeriodSet} event.\n */\n function setVotingPeriod(uint32 newVotingPeriod) public virtual onlyGovernance {\n _setVotingPeriod(newVotingPeriod);\n }\n\n /**\n * @dev Update the proposal threshold. This operation can only be performed through a governance proposal.\n *\n * Emits a {ProposalThresholdSet} event.\n */\n function setProposalThreshold(uint256 newProposalThreshold) public virtual onlyGovernance {\n _setProposalThreshold(newProposalThreshold);\n }\n\n /**\n * @dev Internal setter for the voting delay.\n *\n * Emits a {VotingDelaySet} event.\n */\n function _setVotingDelay(uint48 newVotingDelay) internal virtual {\n emit VotingDelaySet(_votingDelay, newVotingDelay);\n _votingDelay = newVotingDelay;\n }\n\n /**\n * @dev Internal setter for the voting period.\n *\n * Emits a {VotingPeriodSet} event.\n */\n function _setVotingPeriod(uint32 newVotingPeriod) internal virtual {\n if (newVotingPeriod == 0) {\n revert GovernorInvalidVotingPeriod(0);\n }\n emit VotingPeriodSet(_votingPeriod, newVotingPeriod);\n _votingPeriod = newVotingPeriod;\n }\n\n /**\n * @dev Internal setter for the proposal threshold.\n *\n * Emits a {ProposalThresholdSet} event.\n */\n function _setProposalThreshold(uint256 newProposalThreshold) internal virtual {\n emit ProposalThresholdSet(_proposalThreshold, newProposalThreshold);\n _proposalThreshold = newProposalThreshold;\n }\n}\n" + }, + "@openzeppelin/contracts/governance/extensions/GovernorVotes.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (governance/extensions/GovernorVotes.sol)\n\npragma solidity ^0.8.20;\n\nimport {Governor} from \"../Governor.sol\";\nimport {IVotes} from \"../utils/IVotes.sol\";\nimport {IERC5805} from \"../../interfaces/IERC5805.sol\";\nimport {SafeCast} from \"../../utils/math/SafeCast.sol\";\nimport {Time} from \"../../utils/types/Time.sol\";\n\n/**\n * @dev Extension of {Governor} for voting weight extraction from an {ERC20Votes} token, or since v4.5 an {ERC721Votes}\n * token.\n */\nabstract contract GovernorVotes is Governor {\n IERC5805 private immutable _token;\n\n constructor(IVotes tokenAddress) {\n _token = IERC5805(address(tokenAddress));\n }\n\n /**\n * @dev The token that voting power is sourced from.\n */\n function token() public view virtual returns (IERC5805) {\n return _token;\n }\n\n /**\n * @dev Clock (as specified in ERC-6372) is set to match the token's clock. Fallback to block numbers if the token\n * does not implement ERC-6372.\n */\n function clock() public view virtual override returns (uint48) {\n try token().clock() returns (uint48 timepoint) {\n return timepoint;\n } catch {\n return Time.blockNumber();\n }\n }\n\n /**\n * @dev Machine-readable description of the clock as specified in ERC-6372.\n */\n // solhint-disable-next-line func-name-mixedcase\n function CLOCK_MODE() public view virtual override returns (string memory) {\n try token().CLOCK_MODE() returns (string memory clockmode) {\n return clockmode;\n } catch {\n return \"mode=blocknumber&from=default\";\n }\n }\n\n /**\n * Read the voting weight from the token's built in snapshot mechanism (see {Governor-_getVotes}).\n */\n function _getVotes(\n address account,\n uint256 timepoint,\n bytes memory /*params*/\n ) internal view virtual override returns (uint256) {\n return token().getPastVotes(account, timepoint);\n }\n}\n" + }, + "@openzeppelin/contracts/governance/extensions/GovernorVotesQuorumFraction.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (governance/extensions/GovernorVotesQuorumFraction.sol)\n\npragma solidity ^0.8.20;\n\nimport {GovernorVotes} from \"./GovernorVotes.sol\";\nimport {SafeCast} from \"../../utils/math/SafeCast.sol\";\nimport {Checkpoints} from \"../../utils/structs/Checkpoints.sol\";\n\n/**\n * @dev Extension of {Governor} for voting weight extraction from an {ERC20Votes} token and a quorum expressed as a\n * fraction of the total supply.\n */\nabstract contract GovernorVotesQuorumFraction is GovernorVotes {\n using Checkpoints for Checkpoints.Trace208;\n\n Checkpoints.Trace208 private _quorumNumeratorHistory;\n\n event QuorumNumeratorUpdated(uint256 oldQuorumNumerator, uint256 newQuorumNumerator);\n\n /**\n * @dev The quorum set is not a valid fraction.\n */\n error GovernorInvalidQuorumFraction(uint256 quorumNumerator, uint256 quorumDenominator);\n\n /**\n * @dev Initialize quorum as a fraction of the token's total supply.\n *\n * The fraction is specified as `numerator / denominator`. By default the denominator is 100, so quorum is\n * specified as a percent: a numerator of 10 corresponds to quorum being 10% of total supply. The denominator can be\n * customized by overriding {quorumDenominator}.\n */\n constructor(uint256 quorumNumeratorValue) {\n _updateQuorumNumerator(quorumNumeratorValue);\n }\n\n /**\n * @dev Returns the current quorum numerator. See {quorumDenominator}.\n */\n function quorumNumerator() public view virtual returns (uint256) {\n return _quorumNumeratorHistory.latest();\n }\n\n /**\n * @dev Returns the quorum numerator at a specific timepoint. See {quorumDenominator}.\n */\n function quorumNumerator(uint256 timepoint) public view virtual returns (uint256) {\n uint256 length = _quorumNumeratorHistory._checkpoints.length;\n\n // Optimistic search, check the latest checkpoint\n Checkpoints.Checkpoint208 storage latest = _quorumNumeratorHistory._checkpoints[length - 1];\n uint48 latestKey = latest._key;\n uint208 latestValue = latest._value;\n if (latestKey <= timepoint) {\n return latestValue;\n }\n\n // Otherwise, do the binary search\n return _quorumNumeratorHistory.upperLookupRecent(SafeCast.toUint48(timepoint));\n }\n\n /**\n * @dev Returns the quorum denominator. Defaults to 100, but may be overridden.\n */\n function quorumDenominator() public view virtual returns (uint256) {\n return 100;\n }\n\n /**\n * @dev Returns the quorum for a timepoint, in terms of number of votes: `supply * numerator / denominator`.\n */\n function quorum(uint256 timepoint) public view virtual override returns (uint256) {\n return (token().getPastTotalSupply(timepoint) * quorumNumerator(timepoint)) / quorumDenominator();\n }\n\n /**\n * @dev Changes the quorum numerator.\n *\n * Emits a {QuorumNumeratorUpdated} event.\n *\n * Requirements:\n *\n * - Must be called through a governance proposal.\n * - New numerator must be smaller or equal to the denominator.\n */\n function updateQuorumNumerator(uint256 newQuorumNumerator) external virtual onlyGovernance {\n _updateQuorumNumerator(newQuorumNumerator);\n }\n\n /**\n * @dev Changes the quorum numerator.\n *\n * Emits a {QuorumNumeratorUpdated} event.\n *\n * Requirements:\n *\n * - New numerator must be smaller or equal to the denominator.\n */\n function _updateQuorumNumerator(uint256 newQuorumNumerator) internal virtual {\n uint256 denominator = quorumDenominator();\n if (newQuorumNumerator > denominator) {\n revert GovernorInvalidQuorumFraction(newQuorumNumerator, denominator);\n }\n\n uint256 oldQuorumNumerator = quorumNumerator();\n _quorumNumeratorHistory.push(clock(), SafeCast.toUint208(newQuorumNumerator));\n\n emit QuorumNumeratorUpdated(oldQuorumNumerator, newQuorumNumerator);\n }\n}\n" + }, + "@openzeppelin/contracts/governance/Governor.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (governance/Governor.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC721Receiver} from \"../token/ERC721/IERC721Receiver.sol\";\nimport {IERC1155Receiver} from \"../token/ERC1155/IERC1155Receiver.sol\";\nimport {EIP712} from \"../utils/cryptography/EIP712.sol\";\nimport {SignatureChecker} from \"../utils/cryptography/SignatureChecker.sol\";\nimport {IERC165, ERC165} from \"../utils/introspection/ERC165.sol\";\nimport {SafeCast} from \"../utils/math/SafeCast.sol\";\nimport {DoubleEndedQueue} from \"../utils/structs/DoubleEndedQueue.sol\";\nimport {Address} from \"../utils/Address.sol\";\nimport {Context} from \"../utils/Context.sol\";\nimport {Nonces} from \"../utils/Nonces.sol\";\nimport {IGovernor, IERC6372} from \"./IGovernor.sol\";\n\n/**\n * @dev Core of the governance system, designed to be extended through various modules.\n *\n * This contract is abstract and requires several functions to be implemented in various modules:\n *\n * - A counting module must implement {quorum}, {_quorumReached}, {_voteSucceeded} and {_countVote}\n * - A voting module must implement {_getVotes}\n * - Additionally, {votingPeriod} must also be implemented\n */\nabstract contract Governor is Context, ERC165, EIP712, Nonces, IGovernor, IERC721Receiver, IERC1155Receiver {\n using DoubleEndedQueue for DoubleEndedQueue.Bytes32Deque;\n\n bytes32 public constant BALLOT_TYPEHASH =\n keccak256(\"Ballot(uint256 proposalId,uint8 support,address voter,uint256 nonce)\");\n bytes32 public constant EXTENDED_BALLOT_TYPEHASH =\n keccak256(\n \"ExtendedBallot(uint256 proposalId,uint8 support,address voter,uint256 nonce,string reason,bytes params)\"\n );\n\n struct ProposalCore {\n address proposer;\n uint48 voteStart;\n uint32 voteDuration;\n bool executed;\n bool canceled;\n uint48 etaSeconds;\n }\n\n bytes32 private constant ALL_PROPOSAL_STATES_BITMAP = bytes32((2 ** (uint8(type(ProposalState).max) + 1)) - 1);\n string private _name;\n\n mapping(uint256 proposalId => ProposalCore) private _proposals;\n\n // This queue keeps track of the governor operating on itself. Calls to functions protected by the {onlyGovernance}\n // modifier needs to be whitelisted in this queue. Whitelisting is set in {execute}, consumed by the\n // {onlyGovernance} modifier and eventually reset after {_executeOperations} completes. This ensures that the\n // execution of {onlyGovernance} protected calls can only be achieved through successful proposals.\n DoubleEndedQueue.Bytes32Deque private _governanceCall;\n\n /**\n * @dev Restricts a function so it can only be executed through governance proposals. For example, governance\n * parameter setters in {GovernorSettings} are protected using this modifier.\n *\n * The governance executing address may be different from the Governor's own address, for example it could be a\n * timelock. This can be customized by modules by overriding {_executor}. The executor is only able to invoke these\n * functions during the execution of the governor's {execute} function, and not under any other circumstances. Thus,\n * for example, additional timelock proposers are not able to change governance parameters without going through the\n * governance protocol (since v4.6).\n */\n modifier onlyGovernance() {\n _checkGovernance();\n _;\n }\n\n /**\n * @dev Sets the value for {name} and {version}\n */\n constructor(string memory name_) EIP712(name_, version()) {\n _name = name_;\n }\n\n /**\n * @dev Function to receive ETH that will be handled by the governor (disabled if executor is a third party contract)\n */\n receive() external payable virtual {\n if (_executor() != address(this)) {\n revert GovernorDisabledDeposit();\n }\n }\n\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165, ERC165) returns (bool) {\n return\n interfaceId == type(IGovernor).interfaceId ||\n interfaceId == type(IERC1155Receiver).interfaceId ||\n super.supportsInterface(interfaceId);\n }\n\n /**\n * @dev See {IGovernor-name}.\n */\n function name() public view virtual returns (string memory) {\n return _name;\n }\n\n /**\n * @dev See {IGovernor-version}.\n */\n function version() public view virtual returns (string memory) {\n return \"1\";\n }\n\n /**\n * @dev See {IGovernor-hashProposal}.\n *\n * The proposal id is produced by hashing the ABI encoded `targets` array, the `values` array, the `calldatas` array\n * and the descriptionHash (bytes32 which itself is the keccak256 hash of the description string). This proposal id\n * can be produced from the proposal data which is part of the {ProposalCreated} event. It can even be computed in\n * advance, before the proposal is submitted.\n *\n * Note that the chainId and the governor address are not part of the proposal id computation. Consequently, the\n * same proposal (with same operation and same description) will have the same id if submitted on multiple governors\n * across multiple networks. This also means that in order to execute the same operation twice (on the same\n * governor) the proposer will have to change the description in order to avoid proposal id conflicts.\n */\n function hashProposal(\n address[] memory targets,\n uint256[] memory values,\n bytes[] memory calldatas,\n bytes32 descriptionHash\n ) public pure virtual returns (uint256) {\n return uint256(keccak256(abi.encode(targets, values, calldatas, descriptionHash)));\n }\n\n /**\n * @dev See {IGovernor-state}.\n */\n function state(uint256 proposalId) public view virtual returns (ProposalState) {\n // We read the struct fields into the stack at once so Solidity emits a single SLOAD\n ProposalCore storage proposal = _proposals[proposalId];\n bool proposalExecuted = proposal.executed;\n bool proposalCanceled = proposal.canceled;\n\n if (proposalExecuted) {\n return ProposalState.Executed;\n }\n\n if (proposalCanceled) {\n return ProposalState.Canceled;\n }\n\n uint256 snapshot = proposalSnapshot(proposalId);\n\n if (snapshot == 0) {\n revert GovernorNonexistentProposal(proposalId);\n }\n\n uint256 currentTimepoint = clock();\n\n if (snapshot >= currentTimepoint) {\n return ProposalState.Pending;\n }\n\n uint256 deadline = proposalDeadline(proposalId);\n\n if (deadline >= currentTimepoint) {\n return ProposalState.Active;\n } else if (!_quorumReached(proposalId) || !_voteSucceeded(proposalId)) {\n return ProposalState.Defeated;\n } else if (proposalEta(proposalId) == 0) {\n return ProposalState.Succeeded;\n } else {\n return ProposalState.Queued;\n }\n }\n\n /**\n * @dev See {IGovernor-proposalThreshold}.\n */\n function proposalThreshold() public view virtual returns (uint256) {\n return 0;\n }\n\n /**\n * @dev See {IGovernor-proposalSnapshot}.\n */\n function proposalSnapshot(uint256 proposalId) public view virtual returns (uint256) {\n return _proposals[proposalId].voteStart;\n }\n\n /**\n * @dev See {IGovernor-proposalDeadline}.\n */\n function proposalDeadline(uint256 proposalId) public view virtual returns (uint256) {\n return _proposals[proposalId].voteStart + _proposals[proposalId].voteDuration;\n }\n\n /**\n * @dev See {IGovernor-proposalProposer}.\n */\n function proposalProposer(uint256 proposalId) public view virtual returns (address) {\n return _proposals[proposalId].proposer;\n }\n\n /**\n * @dev See {IGovernor-proposalEta}.\n */\n function proposalEta(uint256 proposalId) public view virtual returns (uint256) {\n return _proposals[proposalId].etaSeconds;\n }\n\n /**\n * @dev See {IGovernor-proposalNeedsQueuing}.\n */\n function proposalNeedsQueuing(uint256) public view virtual returns (bool) {\n return false;\n }\n\n /**\n * @dev Reverts if the `msg.sender` is not the executor. In case the executor is not this contract\n * itself, the function reverts if `msg.data` is not whitelisted as a result of an {execute}\n * operation. See {onlyGovernance}.\n */\n function _checkGovernance() internal virtual {\n if (_executor() != _msgSender()) {\n revert GovernorOnlyExecutor(_msgSender());\n }\n if (_executor() != address(this)) {\n bytes32 msgDataHash = keccak256(_msgData());\n // loop until popping the expected operation - throw if deque is empty (operation not authorized)\n while (_governanceCall.popFront() != msgDataHash) {}\n }\n }\n\n /**\n * @dev Amount of votes already cast passes the threshold limit.\n */\n function _quorumReached(uint256 proposalId) internal view virtual returns (bool);\n\n /**\n * @dev Is the proposal successful or not.\n */\n function _voteSucceeded(uint256 proposalId) internal view virtual returns (bool);\n\n /**\n * @dev Get the voting weight of `account` at a specific `timepoint`, for a vote as described by `params`.\n */\n function _getVotes(address account, uint256 timepoint, bytes memory params) internal view virtual returns (uint256);\n\n /**\n * @dev Register a vote for `proposalId` by `account` with a given `support`, voting `weight` and voting `params`.\n *\n * Note: Support is generic and can represent various things depending on the voting system used.\n */\n function _countVote(\n uint256 proposalId,\n address account,\n uint8 support,\n uint256 totalWeight,\n bytes memory params\n ) internal virtual returns (uint256);\n\n /**\n * @dev Default additional encoded parameters used by castVote methods that don't include them\n *\n * Note: Should be overridden by specific implementations to use an appropriate value, the\n * meaning of the additional params, in the context of that implementation\n */\n function _defaultParams() internal view virtual returns (bytes memory) {\n return \"\";\n }\n\n /**\n * @dev See {IGovernor-propose}. This function has opt-in frontrunning protection, described in {_isValidDescriptionForProposer}.\n */\n function propose(\n address[] memory targets,\n uint256[] memory values,\n bytes[] memory calldatas,\n string memory description\n ) public virtual returns (uint256) {\n address proposer = _msgSender();\n\n // check description restriction\n if (!_isValidDescriptionForProposer(proposer, description)) {\n revert GovernorRestrictedProposer(proposer);\n }\n\n // check proposal threshold\n uint256 votesThreshold = proposalThreshold();\n if (votesThreshold > 0) {\n uint256 proposerVotes = getVotes(proposer, clock() - 1);\n if (proposerVotes < votesThreshold) {\n revert GovernorInsufficientProposerVotes(proposer, proposerVotes, votesThreshold);\n }\n }\n\n return _propose(targets, values, calldatas, description, proposer);\n }\n\n /**\n * @dev Internal propose mechanism. Can be overridden to add more logic on proposal creation.\n *\n * Emits a {IGovernor-ProposalCreated} event.\n */\n function _propose(\n address[] memory targets,\n uint256[] memory values,\n bytes[] memory calldatas,\n string memory description,\n address proposer\n ) internal virtual returns (uint256 proposalId) {\n proposalId = hashProposal(targets, values, calldatas, keccak256(bytes(description)));\n\n if (targets.length != values.length || targets.length != calldatas.length || targets.length == 0) {\n revert GovernorInvalidProposalLength(targets.length, calldatas.length, values.length);\n }\n if (_proposals[proposalId].voteStart != 0) {\n revert GovernorUnexpectedProposalState(proposalId, state(proposalId), bytes32(0));\n }\n\n uint256 snapshot = clock() + votingDelay();\n uint256 duration = votingPeriod();\n\n ProposalCore storage proposal = _proposals[proposalId];\n proposal.proposer = proposer;\n proposal.voteStart = SafeCast.toUint48(snapshot);\n proposal.voteDuration = SafeCast.toUint32(duration);\n\n emit ProposalCreated(\n proposalId,\n proposer,\n targets,\n values,\n new string[](targets.length),\n calldatas,\n snapshot,\n snapshot + duration,\n description\n );\n\n // Using a named return variable to avoid stack too deep errors\n }\n\n /**\n * @dev See {IGovernor-queue}.\n */\n function queue(\n address[] memory targets,\n uint256[] memory values,\n bytes[] memory calldatas,\n bytes32 descriptionHash\n ) public virtual returns (uint256) {\n uint256 proposalId = hashProposal(targets, values, calldatas, descriptionHash);\n\n _validateStateBitmap(proposalId, _encodeStateBitmap(ProposalState.Succeeded));\n\n uint48 etaSeconds = _queueOperations(proposalId, targets, values, calldatas, descriptionHash);\n\n if (etaSeconds != 0) {\n _proposals[proposalId].etaSeconds = etaSeconds;\n emit ProposalQueued(proposalId, etaSeconds);\n } else {\n revert GovernorQueueNotImplemented();\n }\n\n return proposalId;\n }\n\n /**\n * @dev Internal queuing mechanism. Can be overridden (without a super call) to modify the way queuing is\n * performed (for example adding a vault/timelock).\n *\n * This is empty by default, and must be overridden to implement queuing.\n *\n * This function returns a timestamp that describes the expected ETA for execution. If the returned value is 0\n * (which is the default value), the core will consider queueing did not succeed, and the public {queue} function\n * will revert.\n *\n * NOTE: Calling this function directly will NOT check the current state of the proposal, or emit the\n * `ProposalQueued` event. Queuing a proposal should be done using {queue}.\n */\n function _queueOperations(\n uint256 /*proposalId*/,\n address[] memory /*targets*/,\n uint256[] memory /*values*/,\n bytes[] memory /*calldatas*/,\n bytes32 /*descriptionHash*/\n ) internal virtual returns (uint48) {\n return 0;\n }\n\n /**\n * @dev See {IGovernor-execute}.\n */\n function execute(\n address[] memory targets,\n uint256[] memory values,\n bytes[] memory calldatas,\n bytes32 descriptionHash\n ) public payable virtual returns (uint256) {\n uint256 proposalId = hashProposal(targets, values, calldatas, descriptionHash);\n\n _validateStateBitmap(\n proposalId,\n _encodeStateBitmap(ProposalState.Succeeded) | _encodeStateBitmap(ProposalState.Queued)\n );\n\n // mark as executed before calls to avoid reentrancy\n _proposals[proposalId].executed = true;\n\n // before execute: register governance call in queue.\n if (_executor() != address(this)) {\n for (uint256 i = 0; i < targets.length; ++i) {\n if (targets[i] == address(this)) {\n _governanceCall.pushBack(keccak256(calldatas[i]));\n }\n }\n }\n\n _executeOperations(proposalId, targets, values, calldatas, descriptionHash);\n\n // after execute: cleanup governance call queue.\n if (_executor() != address(this) && !_governanceCall.empty()) {\n _governanceCall.clear();\n }\n\n emit ProposalExecuted(proposalId);\n\n return proposalId;\n }\n\n /**\n * @dev Internal execution mechanism. Can be overridden (without a super call) to modify the way execution is\n * performed (for example adding a vault/timelock).\n *\n * NOTE: Calling this function directly will NOT check the current state of the proposal, set the executed flag to\n * true or emit the `ProposalExecuted` event. Executing a proposal should be done using {execute} or {_execute}.\n */\n function _executeOperations(\n uint256 /* proposalId */,\n address[] memory targets,\n uint256[] memory values,\n bytes[] memory calldatas,\n bytes32 /*descriptionHash*/\n ) internal virtual {\n for (uint256 i = 0; i < targets.length; ++i) {\n (bool success, bytes memory returndata) = targets[i].call{value: values[i]}(calldatas[i]);\n Address.verifyCallResult(success, returndata);\n }\n }\n\n /**\n * @dev See {IGovernor-cancel}.\n */\n function cancel(\n address[] memory targets,\n uint256[] memory values,\n bytes[] memory calldatas,\n bytes32 descriptionHash\n ) public virtual returns (uint256) {\n // The proposalId will be recomputed in the `_cancel` call further down. However we need the value before we\n // do the internal call, because we need to check the proposal state BEFORE the internal `_cancel` call\n // changes it. The `hashProposal` duplication has a cost that is limited, and that we accept.\n uint256 proposalId = hashProposal(targets, values, calldatas, descriptionHash);\n\n // public cancel restrictions (on top of existing _cancel restrictions).\n _validateStateBitmap(proposalId, _encodeStateBitmap(ProposalState.Pending));\n if (_msgSender() != proposalProposer(proposalId)) {\n revert GovernorOnlyProposer(_msgSender());\n }\n\n return _cancel(targets, values, calldatas, descriptionHash);\n }\n\n /**\n * @dev Internal cancel mechanism with minimal restrictions. A proposal can be cancelled in any state other than\n * Canceled, Expired, or Executed. Once cancelled a proposal can't be re-submitted.\n *\n * Emits a {IGovernor-ProposalCanceled} event.\n */\n function _cancel(\n address[] memory targets,\n uint256[] memory values,\n bytes[] memory calldatas,\n bytes32 descriptionHash\n ) internal virtual returns (uint256) {\n uint256 proposalId = hashProposal(targets, values, calldatas, descriptionHash);\n\n _validateStateBitmap(\n proposalId,\n ALL_PROPOSAL_STATES_BITMAP ^\n _encodeStateBitmap(ProposalState.Canceled) ^\n _encodeStateBitmap(ProposalState.Expired) ^\n _encodeStateBitmap(ProposalState.Executed)\n );\n\n _proposals[proposalId].canceled = true;\n emit ProposalCanceled(proposalId);\n\n return proposalId;\n }\n\n /**\n * @dev See {IGovernor-getVotes}.\n */\n function getVotes(address account, uint256 timepoint) public view virtual returns (uint256) {\n return _getVotes(account, timepoint, _defaultParams());\n }\n\n /**\n * @dev See {IGovernor-getVotesWithParams}.\n */\n function getVotesWithParams(\n address account,\n uint256 timepoint,\n bytes memory params\n ) public view virtual returns (uint256) {\n return _getVotes(account, timepoint, params);\n }\n\n /**\n * @dev See {IGovernor-castVote}.\n */\n function castVote(uint256 proposalId, uint8 support) public virtual returns (uint256) {\n address voter = _msgSender();\n return _castVote(proposalId, voter, support, \"\");\n }\n\n /**\n * @dev See {IGovernor-castVoteWithReason}.\n */\n function castVoteWithReason(\n uint256 proposalId,\n uint8 support,\n string calldata reason\n ) public virtual returns (uint256) {\n address voter = _msgSender();\n return _castVote(proposalId, voter, support, reason);\n }\n\n /**\n * @dev See {IGovernor-castVoteWithReasonAndParams}.\n */\n function castVoteWithReasonAndParams(\n uint256 proposalId,\n uint8 support,\n string calldata reason,\n bytes memory params\n ) public virtual returns (uint256) {\n address voter = _msgSender();\n return _castVote(proposalId, voter, support, reason, params);\n }\n\n /**\n * @dev See {IGovernor-castVoteBySig}.\n */\n function castVoteBySig(\n uint256 proposalId,\n uint8 support,\n address voter,\n bytes memory signature\n ) public virtual returns (uint256) {\n bool valid = SignatureChecker.isValidSignatureNow(\n voter,\n _hashTypedDataV4(keccak256(abi.encode(BALLOT_TYPEHASH, proposalId, support, voter, _useNonce(voter)))),\n signature\n );\n\n if (!valid) {\n revert GovernorInvalidSignature(voter);\n }\n\n return _castVote(proposalId, voter, support, \"\");\n }\n\n /**\n * @dev See {IGovernor-castVoteWithReasonAndParamsBySig}.\n */\n function castVoteWithReasonAndParamsBySig(\n uint256 proposalId,\n uint8 support,\n address voter,\n string calldata reason,\n bytes memory params,\n bytes memory signature\n ) public virtual returns (uint256) {\n bool valid = SignatureChecker.isValidSignatureNow(\n voter,\n _hashTypedDataV4(\n keccak256(\n abi.encode(\n EXTENDED_BALLOT_TYPEHASH,\n proposalId,\n support,\n voter,\n _useNonce(voter),\n keccak256(bytes(reason)),\n keccak256(params)\n )\n )\n ),\n signature\n );\n\n if (!valid) {\n revert GovernorInvalidSignature(voter);\n }\n\n return _castVote(proposalId, voter, support, reason, params);\n }\n\n /**\n * @dev Internal vote casting mechanism: Check that the vote is pending, that it has not been cast yet, retrieve\n * voting weight using {IGovernor-getVotes} and call the {_countVote} internal function. Uses the _defaultParams().\n *\n * Emits a {IGovernor-VoteCast} event.\n */\n function _castVote(\n uint256 proposalId,\n address account,\n uint8 support,\n string memory reason\n ) internal virtual returns (uint256) {\n return _castVote(proposalId, account, support, reason, _defaultParams());\n }\n\n /**\n * @dev Internal vote casting mechanism: Check that the vote is pending, that it has not been cast yet, retrieve\n * voting weight using {IGovernor-getVotes} and call the {_countVote} internal function.\n *\n * Emits a {IGovernor-VoteCast} event.\n */\n function _castVote(\n uint256 proposalId,\n address account,\n uint8 support,\n string memory reason,\n bytes memory params\n ) internal virtual returns (uint256) {\n _validateStateBitmap(proposalId, _encodeStateBitmap(ProposalState.Active));\n\n uint256 totalWeight = _getVotes(account, proposalSnapshot(proposalId), params);\n uint256 votedWeight = _countVote(proposalId, account, support, totalWeight, params);\n\n if (params.length == 0) {\n emit VoteCast(account, proposalId, support, votedWeight, reason);\n } else {\n emit VoteCastWithParams(account, proposalId, support, votedWeight, reason, params);\n }\n\n return votedWeight;\n }\n\n /**\n * @dev Relays a transaction or function call to an arbitrary target. In cases where the governance executor\n * is some contract other than the governor itself, like when using a timelock, this function can be invoked\n * in a governance proposal to recover tokens or Ether that was sent to the governor contract by mistake.\n * Note that if the executor is simply the governor itself, use of `relay` is redundant.\n */\n function relay(address target, uint256 value, bytes calldata data) external payable virtual onlyGovernance {\n (bool success, bytes memory returndata) = target.call{value: value}(data);\n Address.verifyCallResult(success, returndata);\n }\n\n /**\n * @dev Address through which the governor executes action. Will be overloaded by module that execute actions\n * through another contract such as a timelock.\n */\n function _executor() internal view virtual returns (address) {\n return address(this);\n }\n\n /**\n * @dev See {IERC721Receiver-onERC721Received}.\n * Receiving tokens is disabled if the governance executor is other than the governor itself (eg. when using with a timelock).\n */\n function onERC721Received(address, address, uint256, bytes memory) public virtual returns (bytes4) {\n if (_executor() != address(this)) {\n revert GovernorDisabledDeposit();\n }\n return this.onERC721Received.selector;\n }\n\n /**\n * @dev See {IERC1155Receiver-onERC1155Received}.\n * Receiving tokens is disabled if the governance executor is other than the governor itself (eg. when using with a timelock).\n */\n function onERC1155Received(address, address, uint256, uint256, bytes memory) public virtual returns (bytes4) {\n if (_executor() != address(this)) {\n revert GovernorDisabledDeposit();\n }\n return this.onERC1155Received.selector;\n }\n\n /**\n * @dev See {IERC1155Receiver-onERC1155BatchReceived}.\n * Receiving tokens is disabled if the governance executor is other than the governor itself (eg. when using with a timelock).\n */\n function onERC1155BatchReceived(\n address,\n address,\n uint256[] memory,\n uint256[] memory,\n bytes memory\n ) public virtual returns (bytes4) {\n if (_executor() != address(this)) {\n revert GovernorDisabledDeposit();\n }\n return this.onERC1155BatchReceived.selector;\n }\n\n /**\n * @dev Encodes a `ProposalState` into a `bytes32` representation where each bit enabled corresponds to\n * the underlying position in the `ProposalState` enum. For example:\n *\n * 0x000...10000\n * ^^^^^^------ ...\n * ^----- Succeeded\n * ^---- Defeated\n * ^--- Canceled\n * ^-- Active\n * ^- Pending\n */\n function _encodeStateBitmap(ProposalState proposalState) internal pure returns (bytes32) {\n return bytes32(1 << uint8(proposalState));\n }\n\n /**\n * @dev Check that the current state of a proposal matches the requirements described by the `allowedStates` bitmap.\n * This bitmap should be built using `_encodeStateBitmap`.\n *\n * If requirements are not met, reverts with a {GovernorUnexpectedProposalState} error.\n */\n function _validateStateBitmap(uint256 proposalId, bytes32 allowedStates) private view returns (ProposalState) {\n ProposalState currentState = state(proposalId);\n if (_encodeStateBitmap(currentState) & allowedStates == bytes32(0)) {\n revert GovernorUnexpectedProposalState(proposalId, currentState, allowedStates);\n }\n return currentState;\n }\n\n /*\n * @dev Check if the proposer is authorized to submit a proposal with the given description.\n *\n * If the proposal description ends with `#proposer=0x???`, where `0x???` is an address written as a hex string\n * (case insensitive), then the submission of this proposal will only be authorized to said address.\n *\n * This is used for frontrunning protection. By adding this pattern at the end of their proposal, one can ensure\n * that no other address can submit the same proposal. An attacker would have to either remove or change that part,\n * which would result in a different proposal id.\n *\n * If the description does not match this pattern, it is unrestricted and anyone can submit it. This includes:\n * - If the `0x???` part is not a valid hex string.\n * - If the `0x???` part is a valid hex string, but does not contain exactly 40 hex digits.\n * - If it ends with the expected suffix followed by newlines or other whitespace.\n * - If it ends with some other similar suffix, e.g. `#other=abc`.\n * - If it does not end with any such suffix.\n */\n function _isValidDescriptionForProposer(\n address proposer,\n string memory description\n ) internal view virtual returns (bool) {\n uint256 len = bytes(description).length;\n\n // Length is too short to contain a valid proposer suffix\n if (len < 52) {\n return true;\n }\n\n // Extract what would be the `#proposer=0x` marker beginning the suffix\n bytes12 marker;\n assembly (\"memory-safe\") {\n // - Start of the string contents in memory = description + 32\n // - First character of the marker = len - 52\n // - Length of \"#proposer=0x0000000000000000000000000000000000000000\" = 52\n // - We read the memory word starting at the first character of the marker:\n // - (description + 32) + (len - 52) = description + (len - 20)\n // - Note: Solidity will ignore anything past the first 12 bytes\n marker := mload(add(description, sub(len, 20)))\n }\n\n // If the marker is not found, there is no proposer suffix to check\n if (marker != bytes12(\"#proposer=0x\")) {\n return true;\n }\n\n // Parse the 40 characters following the marker as uint160\n uint160 recovered = 0;\n for (uint256 i = len - 40; i < len; ++i) {\n (bool isHex, uint8 value) = _tryHexToUint(bytes(description)[i]);\n // If any of the characters is not a hex digit, ignore the suffix entirely\n if (!isHex) {\n return true;\n }\n recovered = (recovered << 4) | value;\n }\n\n return recovered == uint160(proposer);\n }\n\n /**\n * @dev Try to parse a character from a string as a hex value. Returns `(true, value)` if the char is in\n * `[0-9a-fA-F]` and `(false, 0)` otherwise. Value is guaranteed to be in the range `0 <= value < 16`\n */\n function _tryHexToUint(bytes1 char) private pure returns (bool isHex, uint8 value) {\n uint8 c = uint8(char);\n unchecked {\n // Case 0-9\n if (47 < c && c < 58) {\n return (true, c - 48);\n }\n // Case A-F\n else if (64 < c && c < 71) {\n return (true, c - 55);\n }\n // Case a-f\n else if (96 < c && c < 103) {\n return (true, c - 87);\n }\n // Else: not a hex char\n else {\n return (false, 0);\n }\n }\n }\n\n /**\n * @inheritdoc IERC6372\n */\n function clock() public view virtual returns (uint48);\n\n /**\n * @inheritdoc IERC6372\n */\n // solhint-disable-next-line func-name-mixedcase\n function CLOCK_MODE() public view virtual returns (string memory);\n\n /**\n * @inheritdoc IGovernor\n */\n function votingDelay() public view virtual returns (uint256);\n\n /**\n * @inheritdoc IGovernor\n */\n function votingPeriod() public view virtual returns (uint256);\n\n /**\n * @inheritdoc IGovernor\n */\n function quorum(uint256 timepoint) public view virtual returns (uint256);\n}\n" + }, + "@openzeppelin/contracts/governance/IGovernor.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (governance/IGovernor.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC165} from \"../interfaces/IERC165.sol\";\nimport {IERC6372} from \"../interfaces/IERC6372.sol\";\n\n/**\n * @dev Interface of the {Governor} core.\n *\n * NOTE: Event parameters lack the `indexed` keyword for compatibility with GovernorBravo events.\n * Making event parameters `indexed` affects how events are decoded, potentially breaking existing indexers.\n */\ninterface IGovernor is IERC165, IERC6372 {\n enum ProposalState {\n Pending,\n Active,\n Canceled,\n Defeated,\n Succeeded,\n Queued,\n Expired,\n Executed\n }\n\n /**\n * @dev Empty proposal or a mismatch between the parameters length for a proposal call.\n */\n error GovernorInvalidProposalLength(uint256 targets, uint256 calldatas, uint256 values);\n\n /**\n * @dev The vote was already cast.\n */\n error GovernorAlreadyCastVote(address voter);\n\n /**\n * @dev Token deposits are disabled in this contract.\n */\n error GovernorDisabledDeposit();\n\n /**\n * @dev The `account` is not a proposer.\n */\n error GovernorOnlyProposer(address account);\n\n /**\n * @dev The `account` is not the governance executor.\n */\n error GovernorOnlyExecutor(address account);\n\n /**\n * @dev The `proposalId` doesn't exist.\n */\n error GovernorNonexistentProposal(uint256 proposalId);\n\n /**\n * @dev The current state of a proposal is not the required for performing an operation.\n * The `expectedStates` is a bitmap with the bits enabled for each ProposalState enum position\n * counting from right to left.\n *\n * NOTE: If `expectedState` is `bytes32(0)`, the proposal is expected to not be in any state (i.e. not exist).\n * This is the case when a proposal that is expected to be unset is already initiated (the proposal is duplicated).\n *\n * See {Governor-_encodeStateBitmap}.\n */\n error GovernorUnexpectedProposalState(uint256 proposalId, ProposalState current, bytes32 expectedStates);\n\n /**\n * @dev The voting period set is not a valid period.\n */\n error GovernorInvalidVotingPeriod(uint256 votingPeriod);\n\n /**\n * @dev The `proposer` does not have the required votes to create a proposal.\n */\n error GovernorInsufficientProposerVotes(address proposer, uint256 votes, uint256 threshold);\n\n /**\n * @dev The `proposer` is not allowed to create a proposal.\n */\n error GovernorRestrictedProposer(address proposer);\n\n /**\n * @dev The vote type used is not valid for the corresponding counting module.\n */\n error GovernorInvalidVoteType();\n\n /**\n * @dev The provided params buffer is not supported by the counting module.\n */\n error GovernorInvalidVoteParams();\n\n /**\n * @dev Queue operation is not implemented for this governor. Execute should be called directly.\n */\n error GovernorQueueNotImplemented();\n\n /**\n * @dev The proposal hasn't been queued yet.\n */\n error GovernorNotQueuedProposal(uint256 proposalId);\n\n /**\n * @dev The proposal has already been queued.\n */\n error GovernorAlreadyQueuedProposal(uint256 proposalId);\n\n /**\n * @dev The provided signature is not valid for the expected `voter`.\n * If the `voter` is a contract, the signature is not valid using {IERC1271-isValidSignature}.\n */\n error GovernorInvalidSignature(address voter);\n\n /**\n * @dev Emitted when a proposal is created.\n */\n event ProposalCreated(\n uint256 proposalId,\n address proposer,\n address[] targets,\n uint256[] values,\n string[] signatures,\n bytes[] calldatas,\n uint256 voteStart,\n uint256 voteEnd,\n string description\n );\n\n /**\n * @dev Emitted when a proposal is queued.\n */\n event ProposalQueued(uint256 proposalId, uint256 etaSeconds);\n\n /**\n * @dev Emitted when a proposal is executed.\n */\n event ProposalExecuted(uint256 proposalId);\n\n /**\n * @dev Emitted when a proposal is canceled.\n */\n event ProposalCanceled(uint256 proposalId);\n\n /**\n * @dev Emitted when a vote is cast without params.\n *\n * Note: `support` values should be seen as buckets. Their interpretation depends on the voting module used.\n */\n event VoteCast(address indexed voter, uint256 proposalId, uint8 support, uint256 weight, string reason);\n\n /**\n * @dev Emitted when a vote is cast with params.\n *\n * Note: `support` values should be seen as buckets. Their interpretation depends on the voting module used.\n * `params` are additional encoded parameters. Their interpretation also depends on the voting module used.\n */\n event VoteCastWithParams(\n address indexed voter,\n uint256 proposalId,\n uint8 support,\n uint256 weight,\n string reason,\n bytes params\n );\n\n /**\n * @notice module:core\n * @dev Name of the governor instance (used in building the EIP-712 domain separator).\n */\n function name() external view returns (string memory);\n\n /**\n * @notice module:core\n * @dev Version of the governor instance (used in building the EIP-712 domain separator). Default: \"1\"\n */\n function version() external view returns (string memory);\n\n /**\n * @notice module:voting\n * @dev A description of the possible `support` values for {castVote} and the way these votes are counted, meant to\n * be consumed by UIs to show correct vote options and interpret the results. The string is a URL-encoded sequence of\n * key-value pairs that each describe one aspect, for example `support=bravo&quorum=for,abstain`.\n *\n * There are 2 standard keys: `support` and `quorum`.\n *\n * - `support=bravo` refers to the vote options 0 = Against, 1 = For, 2 = Abstain, as in `GovernorBravo`.\n * - `quorum=bravo` means that only For votes are counted towards quorum.\n * - `quorum=for,abstain` means that both For and Abstain votes are counted towards quorum.\n *\n * If a counting module makes use of encoded `params`, it should include this under a `params` key with a unique\n * name that describes the behavior. For example:\n *\n * - `params=fractional` might refer to a scheme where votes are divided fractionally between for/against/abstain.\n * - `params=erc721` might refer to a scheme where specific NFTs are delegated to vote.\n *\n * NOTE: The string can be decoded by the standard\n * https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams[`URLSearchParams`]\n * JavaScript class.\n */\n // solhint-disable-next-line func-name-mixedcase\n function COUNTING_MODE() external view returns (string memory);\n\n /**\n * @notice module:core\n * @dev Hashing function used to (re)build the proposal id from the proposal details..\n */\n function hashProposal(\n address[] memory targets,\n uint256[] memory values,\n bytes[] memory calldatas,\n bytes32 descriptionHash\n ) external pure returns (uint256);\n\n /**\n * @notice module:core\n * @dev Current state of a proposal, following Compound's convention\n */\n function state(uint256 proposalId) external view returns (ProposalState);\n\n /**\n * @notice module:core\n * @dev The number of votes required in order for a voter to become a proposer.\n */\n function proposalThreshold() external view returns (uint256);\n\n /**\n * @notice module:core\n * @dev Timepoint used to retrieve user's votes and quorum. If using block number (as per Compound's Comp), the\n * snapshot is performed at the end of this block. Hence, voting for this proposal starts at the beginning of the\n * following block.\n */\n function proposalSnapshot(uint256 proposalId) external view returns (uint256);\n\n /**\n * @notice module:core\n * @dev Timepoint at which votes close. If using block number, votes close at the end of this block, so it is\n * possible to cast a vote during this block.\n */\n function proposalDeadline(uint256 proposalId) external view returns (uint256);\n\n /**\n * @notice module:core\n * @dev The account that created a proposal.\n */\n function proposalProposer(uint256 proposalId) external view returns (address);\n\n /**\n * @notice module:core\n * @dev The time when a queued proposal becomes executable (\"ETA\"). Unlike {proposalSnapshot} and\n * {proposalDeadline}, this doesn't use the governor clock, and instead relies on the executor's clock which may be\n * different. In most cases this will be a timestamp.\n */\n function proposalEta(uint256 proposalId) external view returns (uint256);\n\n /**\n * @notice module:core\n * @dev Whether a proposal needs to be queued before execution.\n */\n function proposalNeedsQueuing(uint256 proposalId) external view returns (bool);\n\n /**\n * @notice module:user-config\n * @dev Delay, between the proposal is created and the vote starts. The unit this duration is expressed in depends\n * on the clock (see ERC-6372) this contract uses.\n *\n * This can be increased to leave time for users to buy voting power, or delegate it, before the voting of a\n * proposal starts.\n *\n * NOTE: While this interface returns a uint256, timepoints are stored as uint48 following the ERC-6372 clock type.\n * Consequently this value must fit in a uint48 (when added to the current clock). See {IERC6372-clock}.\n */\n function votingDelay() external view returns (uint256);\n\n /**\n * @notice module:user-config\n * @dev Delay between the vote start and vote end. The unit this duration is expressed in depends on the clock\n * (see ERC-6372) this contract uses.\n *\n * NOTE: The {votingDelay} can delay the start of the vote. This must be considered when setting the voting\n * duration compared to the voting delay.\n *\n * NOTE: This value is stored when the proposal is submitted so that possible changes to the value do not affect\n * proposals that have already been submitted. The type used to save it is a uint32. Consequently, while this\n * interface returns a uint256, the value it returns should fit in a uint32.\n */\n function votingPeriod() external view returns (uint256);\n\n /**\n * @notice module:user-config\n * @dev Minimum number of cast voted required for a proposal to be successful.\n *\n * NOTE: The `timepoint` parameter corresponds to the snapshot used for counting vote. This allows to scale the\n * quorum depending on values such as the totalSupply of a token at this timepoint (see {ERC20Votes}).\n */\n function quorum(uint256 timepoint) external view returns (uint256);\n\n /**\n * @notice module:reputation\n * @dev Voting power of an `account` at a specific `timepoint`.\n *\n * Note: this can be implemented in a number of ways, for example by reading the delegated balance from one (or\n * multiple), {ERC20Votes} tokens.\n */\n function getVotes(address account, uint256 timepoint) external view returns (uint256);\n\n /**\n * @notice module:reputation\n * @dev Voting power of an `account` at a specific `timepoint` given additional encoded parameters.\n */\n function getVotesWithParams(\n address account,\n uint256 timepoint,\n bytes memory params\n ) external view returns (uint256);\n\n /**\n * @notice module:voting\n * @dev Returns whether `account` has cast a vote on `proposalId`.\n */\n function hasVoted(uint256 proposalId, address account) external view returns (bool);\n\n /**\n * @dev Create a new proposal. Vote start after a delay specified by {IGovernor-votingDelay} and lasts for a\n * duration specified by {IGovernor-votingPeriod}.\n *\n * Emits a {ProposalCreated} event.\n *\n * NOTE: The state of the Governor and `targets` may change between the proposal creation and its execution.\n * This may be the result of third party actions on the targeted contracts, or other governor proposals.\n * For example, the balance of this contract could be updated or its access control permissions may be modified,\n * possibly compromising the proposal's ability to execute successfully (e.g. the governor doesn't have enough\n * value to cover a proposal with multiple transfers).\n */\n function propose(\n address[] memory targets,\n uint256[] memory values,\n bytes[] memory calldatas,\n string memory description\n ) external returns (uint256 proposalId);\n\n /**\n * @dev Queue a proposal. Some governors require this step to be performed before execution can happen. If queuing\n * is not necessary, this function may revert.\n * Queuing a proposal requires the quorum to be reached, the vote to be successful, and the deadline to be reached.\n *\n * Emits a {ProposalQueued} event.\n */\n function queue(\n address[] memory targets,\n uint256[] memory values,\n bytes[] memory calldatas,\n bytes32 descriptionHash\n ) external returns (uint256 proposalId);\n\n /**\n * @dev Execute a successful proposal. This requires the quorum to be reached, the vote to be successful, and the\n * deadline to be reached. Depending on the governor it might also be required that the proposal was queued and\n * that some delay passed.\n *\n * Emits a {ProposalExecuted} event.\n *\n * NOTE: Some modules can modify the requirements for execution, for example by adding an additional timelock.\n */\n function execute(\n address[] memory targets,\n uint256[] memory values,\n bytes[] memory calldatas,\n bytes32 descriptionHash\n ) external payable returns (uint256 proposalId);\n\n /**\n * @dev Cancel a proposal. A proposal is cancellable by the proposer, but only while it is Pending state, i.e.\n * before the vote starts.\n *\n * Emits a {ProposalCanceled} event.\n */\n function cancel(\n address[] memory targets,\n uint256[] memory values,\n bytes[] memory calldatas,\n bytes32 descriptionHash\n ) external returns (uint256 proposalId);\n\n /**\n * @dev Cast a vote\n *\n * Emits a {VoteCast} event.\n */\n function castVote(uint256 proposalId, uint8 support) external returns (uint256 balance);\n\n /**\n * @dev Cast a vote with a reason\n *\n * Emits a {VoteCast} event.\n */\n function castVoteWithReason(\n uint256 proposalId,\n uint8 support,\n string calldata reason\n ) external returns (uint256 balance);\n\n /**\n * @dev Cast a vote with a reason and additional encoded parameters\n *\n * Emits a {VoteCast} or {VoteCastWithParams} event depending on the length of params.\n */\n function castVoteWithReasonAndParams(\n uint256 proposalId,\n uint8 support,\n string calldata reason,\n bytes memory params\n ) external returns (uint256 balance);\n\n /**\n * @dev Cast a vote using the voter's signature, including ERC-1271 signature support.\n *\n * Emits a {VoteCast} event.\n */\n function castVoteBySig(\n uint256 proposalId,\n uint8 support,\n address voter,\n bytes memory signature\n ) external returns (uint256 balance);\n\n /**\n * @dev Cast a vote with a reason and additional encoded parameters using the voter's signature,\n * including ERC-1271 signature support.\n *\n * Emits a {VoteCast} or {VoteCastWithParams} event depending on the length of params.\n */\n function castVoteWithReasonAndParamsBySig(\n uint256 proposalId,\n uint8 support,\n address voter,\n string calldata reason,\n bytes memory params,\n bytes memory signature\n ) external returns (uint256 balance);\n}\n" + }, + "@openzeppelin/contracts/governance/utils/IVotes.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (governance/utils/IVotes.sol)\npragma solidity ^0.8.20;\n\n/**\n * @dev Common interface for {ERC20Votes}, {ERC721Votes}, and other {Votes}-enabled contracts.\n */\ninterface IVotes {\n /**\n * @dev The signature used has expired.\n */\n error VotesExpiredSignature(uint256 expiry);\n\n /**\n * @dev Emitted when an account changes their delegate.\n */\n event DelegateChanged(address indexed delegator, address indexed fromDelegate, address indexed toDelegate);\n\n /**\n * @dev Emitted when a token transfer or delegate change results in changes to a delegate's number of voting units.\n */\n event DelegateVotesChanged(address indexed delegate, uint256 previousVotes, uint256 newVotes);\n\n /**\n * @dev Returns the current amount of votes that `account` has.\n */\n function getVotes(address account) external view returns (uint256);\n\n /**\n * @dev Returns the amount of votes that `account` had at a specific moment in the past. If the `clock()` is\n * configured to use block numbers, this will return the value at the end of the corresponding block.\n */\n function getPastVotes(address account, uint256 timepoint) external view returns (uint256);\n\n /**\n * @dev Returns the total supply of votes available at a specific moment in the past. If the `clock()` is\n * configured to use block numbers, this will return the value at the end of the corresponding block.\n *\n * NOTE: This value is the sum of all available votes, which is not necessarily the sum of all delegated votes.\n * Votes that have not been delegated are still part of total supply, even though they would not participate in a\n * vote.\n */\n function getPastTotalSupply(uint256 timepoint) external view returns (uint256);\n\n /**\n * @dev Returns the delegate that `account` has chosen.\n */\n function delegates(address account) external view returns (address);\n\n /**\n * @dev Delegates votes from the sender to `delegatee`.\n */\n function delegate(address delegatee) external;\n\n /**\n * @dev Delegates votes from signer to `delegatee`.\n */\n function delegateBySig(address delegatee, uint256 nonce, uint256 expiry, uint8 v, bytes32 r, bytes32 s) external;\n}\n" + }, + "@openzeppelin/contracts/governance/utils/Votes.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (governance/utils/Votes.sol)\npragma solidity ^0.8.20;\n\nimport {IERC5805} from \"../../interfaces/IERC5805.sol\";\nimport {Context} from \"../../utils/Context.sol\";\nimport {Nonces} from \"../../utils/Nonces.sol\";\nimport {EIP712} from \"../../utils/cryptography/EIP712.sol\";\nimport {Checkpoints} from \"../../utils/structs/Checkpoints.sol\";\nimport {SafeCast} from \"../../utils/math/SafeCast.sol\";\nimport {ECDSA} from \"../../utils/cryptography/ECDSA.sol\";\nimport {Time} from \"../../utils/types/Time.sol\";\n\n/**\n * @dev This is a base abstract contract that tracks voting units, which are a measure of voting power that can be\n * transferred, and provides a system of vote delegation, where an account can delegate its voting units to a sort of\n * \"representative\" that will pool delegated voting units from different accounts and can then use it to vote in\n * decisions. In fact, voting units _must_ be delegated in order to count as actual votes, and an account has to\n * delegate those votes to itself if it wishes to participate in decisions and does not have a trusted representative.\n *\n * This contract is often combined with a token contract such that voting units correspond to token units. For an\n * example, see {ERC721Votes}.\n *\n * The full history of delegate votes is tracked on-chain so that governance protocols can consider votes as distributed\n * at a particular block number to protect against flash loans and double voting. The opt-in delegate system makes the\n * cost of this history tracking optional.\n *\n * When using this module the derived contract must implement {_getVotingUnits} (for example, make it return\n * {ERC721-balanceOf}), and can use {_transferVotingUnits} to track a change in the distribution of those units (in the\n * previous example, it would be included in {ERC721-_update}).\n */\nabstract contract Votes is Context, EIP712, Nonces, IERC5805 {\n using Checkpoints for Checkpoints.Trace208;\n\n bytes32 private constant DELEGATION_TYPEHASH =\n keccak256(\"Delegation(address delegatee,uint256 nonce,uint256 expiry)\");\n\n mapping(address account => address) private _delegatee;\n\n mapping(address delegatee => Checkpoints.Trace208) private _delegateCheckpoints;\n\n Checkpoints.Trace208 private _totalCheckpoints;\n\n /**\n * @dev The clock was incorrectly modified.\n */\n error ERC6372InconsistentClock();\n\n /**\n * @dev Lookup to future votes is not available.\n */\n error ERC5805FutureLookup(uint256 timepoint, uint48 clock);\n\n /**\n * @dev Clock used for flagging checkpoints. Can be overridden to implement timestamp based\n * checkpoints (and voting), in which case {CLOCK_MODE} should be overridden as well to match.\n */\n function clock() public view virtual returns (uint48) {\n return Time.blockNumber();\n }\n\n /**\n * @dev Machine-readable description of the clock as specified in ERC-6372.\n */\n // solhint-disable-next-line func-name-mixedcase\n function CLOCK_MODE() public view virtual returns (string memory) {\n // Check that the clock was not modified\n if (clock() != Time.blockNumber()) {\n revert ERC6372InconsistentClock();\n }\n return \"mode=blocknumber&from=default\";\n }\n\n /**\n * @dev Returns the current amount of votes that `account` has.\n */\n function getVotes(address account) public view virtual returns (uint256) {\n return _delegateCheckpoints[account].latest();\n }\n\n /**\n * @dev Returns the amount of votes that `account` had at a specific moment in the past. If the `clock()` is\n * configured to use block numbers, this will return the value at the end of the corresponding block.\n *\n * Requirements:\n *\n * - `timepoint` must be in the past. If operating using block numbers, the block must be already mined.\n */\n function getPastVotes(address account, uint256 timepoint) public view virtual returns (uint256) {\n uint48 currentTimepoint = clock();\n if (timepoint >= currentTimepoint) {\n revert ERC5805FutureLookup(timepoint, currentTimepoint);\n }\n return _delegateCheckpoints[account].upperLookupRecent(SafeCast.toUint48(timepoint));\n }\n\n /**\n * @dev Returns the total supply of votes available at a specific moment in the past. If the `clock()` is\n * configured to use block numbers, this will return the value at the end of the corresponding block.\n *\n * NOTE: This value is the sum of all available votes, which is not necessarily the sum of all delegated votes.\n * Votes that have not been delegated are still part of total supply, even though they would not participate in a\n * vote.\n *\n * Requirements:\n *\n * - `timepoint` must be in the past. If operating using block numbers, the block must be already mined.\n */\n function getPastTotalSupply(uint256 timepoint) public view virtual returns (uint256) {\n uint48 currentTimepoint = clock();\n if (timepoint >= currentTimepoint) {\n revert ERC5805FutureLookup(timepoint, currentTimepoint);\n }\n return _totalCheckpoints.upperLookupRecent(SafeCast.toUint48(timepoint));\n }\n\n /**\n * @dev Returns the current total supply of votes.\n */\n function _getTotalSupply() internal view virtual returns (uint256) {\n return _totalCheckpoints.latest();\n }\n\n /**\n * @dev Returns the delegate that `account` has chosen.\n */\n function delegates(address account) public view virtual returns (address) {\n return _delegatee[account];\n }\n\n /**\n * @dev Delegates votes from the sender to `delegatee`.\n */\n function delegate(address delegatee) public virtual {\n address account = _msgSender();\n _delegate(account, delegatee);\n }\n\n /**\n * @dev Delegates votes from signer to `delegatee`.\n */\n function delegateBySig(\n address delegatee,\n uint256 nonce,\n uint256 expiry,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) public virtual {\n if (block.timestamp > expiry) {\n revert VotesExpiredSignature(expiry);\n }\n address signer = ECDSA.recover(\n _hashTypedDataV4(keccak256(abi.encode(DELEGATION_TYPEHASH, delegatee, nonce, expiry))),\n v,\n r,\n s\n );\n _useCheckedNonce(signer, nonce);\n _delegate(signer, delegatee);\n }\n\n /**\n * @dev Delegate all of `account`'s voting units to `delegatee`.\n *\n * Emits events {IVotes-DelegateChanged} and {IVotes-DelegateVotesChanged}.\n */\n function _delegate(address account, address delegatee) internal virtual {\n address oldDelegate = delegates(account);\n _delegatee[account] = delegatee;\n\n emit DelegateChanged(account, oldDelegate, delegatee);\n _moveDelegateVotes(oldDelegate, delegatee, _getVotingUnits(account));\n }\n\n /**\n * @dev Transfers, mints, or burns voting units. To register a mint, `from` should be zero. To register a burn, `to`\n * should be zero. Total supply of voting units will be adjusted with mints and burns.\n */\n function _transferVotingUnits(address from, address to, uint256 amount) internal virtual {\n if (from == address(0)) {\n _push(_totalCheckpoints, _add, SafeCast.toUint208(amount));\n }\n if (to == address(0)) {\n _push(_totalCheckpoints, _subtract, SafeCast.toUint208(amount));\n }\n _moveDelegateVotes(delegates(from), delegates(to), amount);\n }\n\n /**\n * @dev Moves delegated votes from one delegate to another.\n */\n function _moveDelegateVotes(address from, address to, uint256 amount) internal virtual {\n if (from != to && amount > 0) {\n if (from != address(0)) {\n (uint256 oldValue, uint256 newValue) = _push(\n _delegateCheckpoints[from],\n _subtract,\n SafeCast.toUint208(amount)\n );\n emit DelegateVotesChanged(from, oldValue, newValue);\n }\n if (to != address(0)) {\n (uint256 oldValue, uint256 newValue) = _push(\n _delegateCheckpoints[to],\n _add,\n SafeCast.toUint208(amount)\n );\n emit DelegateVotesChanged(to, oldValue, newValue);\n }\n }\n }\n\n /**\n * @dev Get number of checkpoints for `account`.\n */\n function _numCheckpoints(address account) internal view virtual returns (uint32) {\n return SafeCast.toUint32(_delegateCheckpoints[account].length());\n }\n\n /**\n * @dev Get the `pos`-th checkpoint for `account`.\n */\n function _checkpoints(\n address account,\n uint32 pos\n ) internal view virtual returns (Checkpoints.Checkpoint208 memory) {\n return _delegateCheckpoints[account].at(pos);\n }\n\n function _push(\n Checkpoints.Trace208 storage store,\n function(uint208, uint208) view returns (uint208) op,\n uint208 delta\n ) private returns (uint208 oldValue, uint208 newValue) {\n return store.push(clock(), op(store.latest(), delta));\n }\n\n function _add(uint208 a, uint208 b) private pure returns (uint208) {\n return a + b;\n }\n\n function _subtract(uint208 a, uint208 b) private pure returns (uint208) {\n return a - b;\n }\n\n /**\n * @dev Must return the voting units held by an account.\n */\n function _getVotingUnits(address) internal view virtual returns (uint256);\n}\n" + }, + "@openzeppelin/contracts/interfaces/draft-IERC6093.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (interfaces/draft-IERC6093.sol)\npragma solidity ^0.8.20;\n\n/**\n * @dev Standard ERC-20 Errors\n * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC-20 tokens.\n */\ninterface IERC20Errors {\n /**\n * @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers.\n * @param sender Address whose tokens are being transferred.\n * @param balance Current balance for the interacting account.\n * @param needed Minimum amount required to perform a transfer.\n */\n error ERC20InsufficientBalance(address sender, uint256 balance, uint256 needed);\n\n /**\n * @dev Indicates a failure with the token `sender`. Used in transfers.\n * @param sender Address whose tokens are being transferred.\n */\n error ERC20InvalidSender(address sender);\n\n /**\n * @dev Indicates a failure with the token `receiver`. Used in transfers.\n * @param receiver Address to which tokens are being transferred.\n */\n error ERC20InvalidReceiver(address receiver);\n\n /**\n * @dev Indicates a failure with the `spender`’s `allowance`. Used in transfers.\n * @param spender Address that may be allowed to operate on tokens without being their owner.\n * @param allowance Amount of tokens a `spender` is allowed to operate with.\n * @param needed Minimum amount required to perform a transfer.\n */\n error ERC20InsufficientAllowance(address spender, uint256 allowance, uint256 needed);\n\n /**\n * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.\n * @param approver Address initiating an approval operation.\n */\n error ERC20InvalidApprover(address approver);\n\n /**\n * @dev Indicates a failure with the `spender` to be approved. Used in approvals.\n * @param spender Address that may be allowed to operate on tokens without being their owner.\n */\n error ERC20InvalidSpender(address spender);\n}\n\n/**\n * @dev Standard ERC-721 Errors\n * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC-721 tokens.\n */\ninterface IERC721Errors {\n /**\n * @dev Indicates that an address can't be an owner. For example, `address(0)` is a forbidden owner in ERC-20.\n * Used in balance queries.\n * @param owner Address of the current owner of a token.\n */\n error ERC721InvalidOwner(address owner);\n\n /**\n * @dev Indicates a `tokenId` whose `owner` is the zero address.\n * @param tokenId Identifier number of a token.\n */\n error ERC721NonexistentToken(uint256 tokenId);\n\n /**\n * @dev Indicates an error related to the ownership over a particular token. Used in transfers.\n * @param sender Address whose tokens are being transferred.\n * @param tokenId Identifier number of a token.\n * @param owner Address of the current owner of a token.\n */\n error ERC721IncorrectOwner(address sender, uint256 tokenId, address owner);\n\n /**\n * @dev Indicates a failure with the token `sender`. Used in transfers.\n * @param sender Address whose tokens are being transferred.\n */\n error ERC721InvalidSender(address sender);\n\n /**\n * @dev Indicates a failure with the token `receiver`. Used in transfers.\n * @param receiver Address to which tokens are being transferred.\n */\n error ERC721InvalidReceiver(address receiver);\n\n /**\n * @dev Indicates a failure with the `operator`’s approval. Used in transfers.\n * @param operator Address that may be allowed to operate on tokens without being their owner.\n * @param tokenId Identifier number of a token.\n */\n error ERC721InsufficientApproval(address operator, uint256 tokenId);\n\n /**\n * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.\n * @param approver Address initiating an approval operation.\n */\n error ERC721InvalidApprover(address approver);\n\n /**\n * @dev Indicates a failure with the `operator` to be approved. Used in approvals.\n * @param operator Address that may be allowed to operate on tokens without being their owner.\n */\n error ERC721InvalidOperator(address operator);\n}\n\n/**\n * @dev Standard ERC-1155 Errors\n * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC-1155 tokens.\n */\ninterface IERC1155Errors {\n /**\n * @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers.\n * @param sender Address whose tokens are being transferred.\n * @param balance Current balance for the interacting account.\n * @param needed Minimum amount required to perform a transfer.\n * @param tokenId Identifier number of a token.\n */\n error ERC1155InsufficientBalance(address sender, uint256 balance, uint256 needed, uint256 tokenId);\n\n /**\n * @dev Indicates a failure with the token `sender`. Used in transfers.\n * @param sender Address whose tokens are being transferred.\n */\n error ERC1155InvalidSender(address sender);\n\n /**\n * @dev Indicates a failure with the token `receiver`. Used in transfers.\n * @param receiver Address to which tokens are being transferred.\n */\n error ERC1155InvalidReceiver(address receiver);\n\n /**\n * @dev Indicates a failure with the `operator`’s approval. Used in transfers.\n * @param operator Address that may be allowed to operate on tokens without being their owner.\n * @param owner Address of the current owner of a token.\n */\n error ERC1155MissingApprovalForAll(address operator, address owner);\n\n /**\n * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.\n * @param approver Address initiating an approval operation.\n */\n error ERC1155InvalidApprover(address approver);\n\n /**\n * @dev Indicates a failure with the `operator` to be approved. Used in approvals.\n * @param operator Address that may be allowed to operate on tokens without being their owner.\n */\n error ERC1155InvalidOperator(address operator);\n\n /**\n * @dev Indicates an array length mismatch between ids and values in a safeBatchTransferFrom operation.\n * Used in batch transfers.\n * @param idsLength Length of the array of token identifiers\n * @param valuesLength Length of the array of token amounts\n */\n error ERC1155InvalidArrayLength(uint256 idsLength, uint256 valuesLength);\n}\n" + }, + "@openzeppelin/contracts/interfaces/IERC1271.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (interfaces/IERC1271.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Interface of the ERC-1271 standard signature validation method for\n * contracts as defined in https://eips.ethereum.org/EIPS/eip-1271[ERC-1271].\n */\ninterface IERC1271 {\n /**\n * @dev Should return whether the signature provided is valid for the provided data\n * @param hash Hash of the data to be signed\n * @param signature Signature byte array associated with _data\n */\n function isValidSignature(bytes32 hash, bytes memory signature) external view returns (bytes4 magicValue);\n}\n" + }, + "@openzeppelin/contracts/interfaces/IERC165.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC165.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC165} from \"../utils/introspection/IERC165.sol\";\n" + }, + "@openzeppelin/contracts/interfaces/IERC4906.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (interfaces/IERC4906.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC165} from \"./IERC165.sol\";\nimport {IERC721} from \"./IERC721.sol\";\n\n/// @title ERC-721 Metadata Update Extension\ninterface IERC4906 is IERC165, IERC721 {\n /// @dev This event emits when the metadata of a token is changed.\n /// So that the third-party platforms such as NFT market could\n /// timely update the images and related attributes of the NFT.\n event MetadataUpdate(uint256 _tokenId);\n\n /// @dev This event emits when the metadata of a range of tokens is changed.\n /// So that the third-party platforms such as NFT market could\n /// timely update the images and related attributes of the NFTs.\n event BatchMetadataUpdate(uint256 _fromTokenId, uint256 _toTokenId);\n}\n" + }, + "@openzeppelin/contracts/interfaces/IERC5267.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC5267.sol)\n\npragma solidity ^0.8.20;\n\ninterface IERC5267 {\n /**\n * @dev MAY be emitted to signal that the domain could have changed.\n */\n event EIP712DomainChanged();\n\n /**\n * @dev returns the fields and values that describe the domain separator used by this contract for EIP-712\n * signature.\n */\n function eip712Domain()\n external\n view\n returns (\n bytes1 fields,\n string memory name,\n string memory version,\n uint256 chainId,\n address verifyingContract,\n bytes32 salt,\n uint256[] memory extensions\n );\n}\n" + }, + "@openzeppelin/contracts/interfaces/IERC5805.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC5805.sol)\n\npragma solidity ^0.8.20;\n\nimport {IVotes} from \"../governance/utils/IVotes.sol\";\nimport {IERC6372} from \"./IERC6372.sol\";\n\ninterface IERC5805 is IERC6372, IVotes {}\n" + }, + "@openzeppelin/contracts/interfaces/IERC6372.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC6372.sol)\n\npragma solidity ^0.8.20;\n\ninterface IERC6372 {\n /**\n * @dev Clock used for flagging checkpoints. Can be overridden to implement timestamp based checkpoints (and voting).\n */\n function clock() external view returns (uint48);\n\n /**\n * @dev Description of the clock\n */\n // solhint-disable-next-line func-name-mixedcase\n function CLOCK_MODE() external view returns (string memory);\n}\n" + }, + "@openzeppelin/contracts/interfaces/IERC721.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC721.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC721} from \"../token/ERC721/IERC721.sol\";\n" + }, + "@openzeppelin/contracts/token/ERC1155/IERC1155Receiver.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC1155/IERC1155Receiver.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC165} from \"../../utils/introspection/IERC165.sol\";\n\n/**\n * @dev Interface that must be implemented by smart contracts in order to receive\n * ERC-1155 token transfers.\n */\ninterface IERC1155Receiver is IERC165 {\n /**\n * @dev Handles the receipt of a single ERC-1155 token type. This function is\n * called at the end of a `safeTransferFrom` after the balance has been updated.\n *\n * NOTE: To accept the transfer, this must return\n * `bytes4(keccak256(\"onERC1155Received(address,address,uint256,uint256,bytes)\"))`\n * (i.e. 0xf23a6e61, or its own function selector).\n *\n * @param operator The address which initiated the transfer (i.e. msg.sender)\n * @param from The address which previously owned the token\n * @param id The ID of the token being transferred\n * @param value The amount of tokens being transferred\n * @param data Additional data with no specified format\n * @return `bytes4(keccak256(\"onERC1155Received(address,address,uint256,uint256,bytes)\"))` if transfer is allowed\n */\n function onERC1155Received(\n address operator,\n address from,\n uint256 id,\n uint256 value,\n bytes calldata data\n ) external returns (bytes4);\n\n /**\n * @dev Handles the receipt of a multiple ERC-1155 token types. This function\n * is called at the end of a `safeBatchTransferFrom` after the balances have\n * been updated.\n *\n * NOTE: To accept the transfer(s), this must return\n * `bytes4(keccak256(\"onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)\"))`\n * (i.e. 0xbc197c81, or its own function selector).\n *\n * @param operator The address which initiated the batch transfer (i.e. msg.sender)\n * @param from The address which previously owned the token\n * @param ids An array containing ids of each token being transferred (order and length must match values array)\n * @param values An array containing amounts of each token being transferred (order and length must match ids array)\n * @param data Additional data with no specified format\n * @return `bytes4(keccak256(\"onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)\"))` if transfer is allowed\n */\n function onERC1155BatchReceived(\n address operator,\n address from,\n uint256[] calldata ids,\n uint256[] calldata values,\n bytes calldata data\n ) external returns (bytes4);\n}\n" + }, + "@openzeppelin/contracts/token/ERC721/ERC721.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC721/ERC721.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC721} from \"./IERC721.sol\";\nimport {IERC721Metadata} from \"./extensions/IERC721Metadata.sol\";\nimport {ERC721Utils} from \"./utils/ERC721Utils.sol\";\nimport {Context} from \"../../utils/Context.sol\";\nimport {Strings} from \"../../utils/Strings.sol\";\nimport {IERC165, ERC165} from \"../../utils/introspection/ERC165.sol\";\nimport {IERC721Errors} from \"../../interfaces/draft-IERC6093.sol\";\n\n/**\n * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC-721] Non-Fungible Token Standard, including\n * the Metadata extension, but not including the Enumerable extension, which is available separately as\n * {ERC721Enumerable}.\n */\nabstract contract ERC721 is Context, ERC165, IERC721, IERC721Metadata, IERC721Errors {\n using Strings for uint256;\n\n // Token name\n string private _name;\n\n // Token symbol\n string private _symbol;\n\n mapping(uint256 tokenId => address) private _owners;\n\n mapping(address owner => uint256) private _balances;\n\n mapping(uint256 tokenId => address) private _tokenApprovals;\n\n mapping(address owner => mapping(address operator => bool)) private _operatorApprovals;\n\n /**\n * @dev Initializes the contract by setting a `name` and a `symbol` to the token collection.\n */\n constructor(string memory name_, string memory symbol_) {\n _name = name_;\n _symbol = symbol_;\n }\n\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {\n return\n interfaceId == type(IERC721).interfaceId ||\n interfaceId == type(IERC721Metadata).interfaceId ||\n super.supportsInterface(interfaceId);\n }\n\n /**\n * @dev See {IERC721-balanceOf}.\n */\n function balanceOf(address owner) public view virtual returns (uint256) {\n if (owner == address(0)) {\n revert ERC721InvalidOwner(address(0));\n }\n return _balances[owner];\n }\n\n /**\n * @dev See {IERC721-ownerOf}.\n */\n function ownerOf(uint256 tokenId) public view virtual returns (address) {\n return _requireOwned(tokenId);\n }\n\n /**\n * @dev See {IERC721Metadata-name}.\n */\n function name() public view virtual returns (string memory) {\n return _name;\n }\n\n /**\n * @dev See {IERC721Metadata-symbol}.\n */\n function symbol() public view virtual returns (string memory) {\n return _symbol;\n }\n\n /**\n * @dev See {IERC721Metadata-tokenURI}.\n */\n function tokenURI(uint256 tokenId) public view virtual returns (string memory) {\n _requireOwned(tokenId);\n\n string memory baseURI = _baseURI();\n return bytes(baseURI).length > 0 ? string.concat(baseURI, tokenId.toString()) : \"\";\n }\n\n /**\n * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each\n * token will be the concatenation of the `baseURI` and the `tokenId`. Empty\n * by default, can be overridden in child contracts.\n */\n function _baseURI() internal view virtual returns (string memory) {\n return \"\";\n }\n\n /**\n * @dev See {IERC721-approve}.\n */\n function approve(address to, uint256 tokenId) public virtual {\n _approve(to, tokenId, _msgSender());\n }\n\n /**\n * @dev See {IERC721-getApproved}.\n */\n function getApproved(uint256 tokenId) public view virtual returns (address) {\n _requireOwned(tokenId);\n\n return _getApproved(tokenId);\n }\n\n /**\n * @dev See {IERC721-setApprovalForAll}.\n */\n function setApprovalForAll(address operator, bool approved) public virtual {\n _setApprovalForAll(_msgSender(), operator, approved);\n }\n\n /**\n * @dev See {IERC721-isApprovedForAll}.\n */\n function isApprovedForAll(address owner, address operator) public view virtual returns (bool) {\n return _operatorApprovals[owner][operator];\n }\n\n /**\n * @dev See {IERC721-transferFrom}.\n */\n function transferFrom(address from, address to, uint256 tokenId) public virtual {\n if (to == address(0)) {\n revert ERC721InvalidReceiver(address(0));\n }\n // Setting an \"auth\" arguments enables the `_isAuthorized` check which verifies that the token exists\n // (from != 0). Therefore, it is not needed to verify that the return value is not 0 here.\n address previousOwner = _update(to, tokenId, _msgSender());\n if (previousOwner != from) {\n revert ERC721IncorrectOwner(from, tokenId, previousOwner);\n }\n }\n\n /**\n * @dev See {IERC721-safeTransferFrom}.\n */\n function safeTransferFrom(address from, address to, uint256 tokenId) public {\n safeTransferFrom(from, to, tokenId, \"\");\n }\n\n /**\n * @dev See {IERC721-safeTransferFrom}.\n */\n function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory data) public virtual {\n transferFrom(from, to, tokenId);\n ERC721Utils.checkOnERC721Received(_msgSender(), from, to, tokenId, data);\n }\n\n /**\n * @dev Returns the owner of the `tokenId`. Does NOT revert if token doesn't exist\n *\n * IMPORTANT: Any overrides to this function that add ownership of tokens not tracked by the\n * core ERC-721 logic MUST be matched with the use of {_increaseBalance} to keep balances\n * consistent with ownership. The invariant to preserve is that for any address `a` the value returned by\n * `balanceOf(a)` must be equal to the number of tokens such that `_ownerOf(tokenId)` is `a`.\n */\n function _ownerOf(uint256 tokenId) internal view virtual returns (address) {\n return _owners[tokenId];\n }\n\n /**\n * @dev Returns the approved address for `tokenId`. Returns 0 if `tokenId` is not minted.\n */\n function _getApproved(uint256 tokenId) internal view virtual returns (address) {\n return _tokenApprovals[tokenId];\n }\n\n /**\n * @dev Returns whether `spender` is allowed to manage `owner`'s tokens, or `tokenId` in\n * particular (ignoring whether it is owned by `owner`).\n *\n * WARNING: This function assumes that `owner` is the actual owner of `tokenId` and does not verify this\n * assumption.\n */\n function _isAuthorized(address owner, address spender, uint256 tokenId) internal view virtual returns (bool) {\n return\n spender != address(0) &&\n (owner == spender || isApprovedForAll(owner, spender) || _getApproved(tokenId) == spender);\n }\n\n /**\n * @dev Checks if `spender` can operate on `tokenId`, assuming the provided `owner` is the actual owner.\n * Reverts if:\n * - `spender` does not have approval from `owner` for `tokenId`.\n * - `spender` does not have approval to manage all of `owner`'s assets.\n *\n * WARNING: This function assumes that `owner` is the actual owner of `tokenId` and does not verify this\n * assumption.\n */\n function _checkAuthorized(address owner, address spender, uint256 tokenId) internal view virtual {\n if (!_isAuthorized(owner, spender, tokenId)) {\n if (owner == address(0)) {\n revert ERC721NonexistentToken(tokenId);\n } else {\n revert ERC721InsufficientApproval(spender, tokenId);\n }\n }\n }\n\n /**\n * @dev Unsafe write access to the balances, used by extensions that \"mint\" tokens using an {ownerOf} override.\n *\n * NOTE: the value is limited to type(uint128).max. This protect against _balance overflow. It is unrealistic that\n * a uint256 would ever overflow from increments when these increments are bounded to uint128 values.\n *\n * WARNING: Increasing an account's balance using this function tends to be paired with an override of the\n * {_ownerOf} function to resolve the ownership of the corresponding tokens so that balances and ownership\n * remain consistent with one another.\n */\n function _increaseBalance(address account, uint128 value) internal virtual {\n unchecked {\n _balances[account] += value;\n }\n }\n\n /**\n * @dev Transfers `tokenId` from its current owner to `to`, or alternatively mints (or burns) if the current owner\n * (or `to`) is the zero address. Returns the owner of the `tokenId` before the update.\n *\n * The `auth` argument is optional. If the value passed is non 0, then this function will check that\n * `auth` is either the owner of the token, or approved to operate on the token (by the owner).\n *\n * Emits a {Transfer} event.\n *\n * NOTE: If overriding this function in a way that tracks balances, see also {_increaseBalance}.\n */\n function _update(address to, uint256 tokenId, address auth) internal virtual returns (address) {\n address from = _ownerOf(tokenId);\n\n // Perform (optional) operator check\n if (auth != address(0)) {\n _checkAuthorized(from, auth, tokenId);\n }\n\n // Execute the update\n if (from != address(0)) {\n // Clear approval. No need to re-authorize or emit the Approval event\n _approve(address(0), tokenId, address(0), false);\n\n unchecked {\n _balances[from] -= 1;\n }\n }\n\n if (to != address(0)) {\n unchecked {\n _balances[to] += 1;\n }\n }\n\n _owners[tokenId] = to;\n\n emit Transfer(from, to, tokenId);\n\n return from;\n }\n\n /**\n * @dev Mints `tokenId` and transfers it to `to`.\n *\n * WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible\n *\n * Requirements:\n *\n * - `tokenId` must not exist.\n * - `to` cannot be the zero address.\n *\n * Emits a {Transfer} event.\n */\n function _mint(address to, uint256 tokenId) internal {\n if (to == address(0)) {\n revert ERC721InvalidReceiver(address(0));\n }\n address previousOwner = _update(to, tokenId, address(0));\n if (previousOwner != address(0)) {\n revert ERC721InvalidSender(address(0));\n }\n }\n\n /**\n * @dev Mints `tokenId`, transfers it to `to` and checks for `to` acceptance.\n *\n * Requirements:\n *\n * - `tokenId` must not exist.\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\n *\n * Emits a {Transfer} event.\n */\n function _safeMint(address to, uint256 tokenId) internal {\n _safeMint(to, tokenId, \"\");\n }\n\n /**\n * @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is\n * forwarded in {IERC721Receiver-onERC721Received} to contract recipients.\n */\n function _safeMint(address to, uint256 tokenId, bytes memory data) internal virtual {\n _mint(to, tokenId);\n ERC721Utils.checkOnERC721Received(_msgSender(), address(0), to, tokenId, data);\n }\n\n /**\n * @dev Destroys `tokenId`.\n * The approval is cleared when the token is burned.\n * This is an internal function that does not check if the sender is authorized to operate on the token.\n *\n * Requirements:\n *\n * - `tokenId` must exist.\n *\n * Emits a {Transfer} event.\n */\n function _burn(uint256 tokenId) internal {\n address previousOwner = _update(address(0), tokenId, address(0));\n if (previousOwner == address(0)) {\n revert ERC721NonexistentToken(tokenId);\n }\n }\n\n /**\n * @dev Transfers `tokenId` from `from` to `to`.\n * As opposed to {transferFrom}, this imposes no restrictions on msg.sender.\n *\n * Requirements:\n *\n * - `to` cannot be the zero address.\n * - `tokenId` token must be owned by `from`.\n *\n * Emits a {Transfer} event.\n */\n function _transfer(address from, address to, uint256 tokenId) internal {\n if (to == address(0)) {\n revert ERC721InvalidReceiver(address(0));\n }\n address previousOwner = _update(to, tokenId, address(0));\n if (previousOwner == address(0)) {\n revert ERC721NonexistentToken(tokenId);\n } else if (previousOwner != from) {\n revert ERC721IncorrectOwner(from, tokenId, previousOwner);\n }\n }\n\n /**\n * @dev Safely transfers `tokenId` token from `from` to `to`, checking that contract recipients\n * are aware of the ERC-721 standard to prevent tokens from being forever locked.\n *\n * `data` is additional data, it has no specified format and it is sent in call to `to`.\n *\n * This internal function is like {safeTransferFrom} in the sense that it invokes\n * {IERC721Receiver-onERC721Received} on the receiver, and can be used to e.g.\n * implement alternative mechanisms to perform token transfer, such as signature-based.\n *\n * Requirements:\n *\n * - `tokenId` token must exist and be owned by `from`.\n * - `to` cannot be the zero address.\n * - `from` cannot be the zero address.\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\n *\n * Emits a {Transfer} event.\n */\n function _safeTransfer(address from, address to, uint256 tokenId) internal {\n _safeTransfer(from, to, tokenId, \"\");\n }\n\n /**\n * @dev Same as {xref-ERC721-_safeTransfer-address-address-uint256-}[`_safeTransfer`], with an additional `data` parameter which is\n * forwarded in {IERC721Receiver-onERC721Received} to contract recipients.\n */\n function _safeTransfer(address from, address to, uint256 tokenId, bytes memory data) internal virtual {\n _transfer(from, to, tokenId);\n ERC721Utils.checkOnERC721Received(_msgSender(), from, to, tokenId, data);\n }\n\n /**\n * @dev Approve `to` to operate on `tokenId`\n *\n * The `auth` argument is optional. If the value passed is non 0, then this function will check that `auth` is\n * either the owner of the token, or approved to operate on all tokens held by this owner.\n *\n * Emits an {Approval} event.\n *\n * Overrides to this logic should be done to the variant with an additional `bool emitEvent` argument.\n */\n function _approve(address to, uint256 tokenId, address auth) internal {\n _approve(to, tokenId, auth, true);\n }\n\n /**\n * @dev Variant of `_approve` with an optional flag to enable or disable the {Approval} event. The event is not\n * emitted in the context of transfers.\n */\n function _approve(address to, uint256 tokenId, address auth, bool emitEvent) internal virtual {\n // Avoid reading the owner unless necessary\n if (emitEvent || auth != address(0)) {\n address owner = _requireOwned(tokenId);\n\n // We do not use _isAuthorized because single-token approvals should not be able to call approve\n if (auth != address(0) && owner != auth && !isApprovedForAll(owner, auth)) {\n revert ERC721InvalidApprover(auth);\n }\n\n if (emitEvent) {\n emit Approval(owner, to, tokenId);\n }\n }\n\n _tokenApprovals[tokenId] = to;\n }\n\n /**\n * @dev Approve `operator` to operate on all of `owner` tokens\n *\n * Requirements:\n * - operator can't be the address zero.\n *\n * Emits an {ApprovalForAll} event.\n */\n function _setApprovalForAll(address owner, address operator, bool approved) internal virtual {\n if (operator == address(0)) {\n revert ERC721InvalidOperator(operator);\n }\n _operatorApprovals[owner][operator] = approved;\n emit ApprovalForAll(owner, operator, approved);\n }\n\n /**\n * @dev Reverts if the `tokenId` doesn't have a current owner (it hasn't been minted, or it has been burned).\n * Returns the owner.\n *\n * Overrides to ownership logic should be done to {_ownerOf}.\n */\n function _requireOwned(uint256 tokenId) internal view returns (address) {\n address owner = _ownerOf(tokenId);\n if (owner == address(0)) {\n revert ERC721NonexistentToken(tokenId);\n }\n return owner;\n }\n}\n" + }, + "@openzeppelin/contracts/token/ERC721/extensions/ERC721Burnable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC721/extensions/ERC721Burnable.sol)\n\npragma solidity ^0.8.20;\n\nimport {ERC721} from \"../ERC721.sol\";\nimport {Context} from \"../../../utils/Context.sol\";\n\n/**\n * @title ERC-721 Burnable Token\n * @dev ERC-721 Token that can be burned (destroyed).\n */\nabstract contract ERC721Burnable is Context, ERC721 {\n /**\n * @dev Burns `tokenId`. See {ERC721-_burn}.\n *\n * Requirements:\n *\n * - The caller must own `tokenId` or be an approved operator.\n */\n function burn(uint256 tokenId) public virtual {\n // Setting an \"auth\" arguments enables the `_isAuthorized` check which verifies that the token exists\n // (from != 0). Therefore, it is not needed to verify that the return value is not 0 here.\n _update(address(0), tokenId, _msgSender());\n }\n}\n" + }, + "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC721/extensions/ERC721Enumerable.sol)\n\npragma solidity ^0.8.20;\n\nimport {ERC721} from \"../ERC721.sol\";\nimport {IERC721Enumerable} from \"./IERC721Enumerable.sol\";\nimport {IERC165} from \"../../../utils/introspection/ERC165.sol\";\n\n/**\n * @dev This implements an optional extension of {ERC721} defined in the ERC that adds enumerability\n * of all the token ids in the contract as well as all token ids owned by each account.\n *\n * CAUTION: {ERC721} extensions that implement custom `balanceOf` logic, such as {ERC721Consecutive},\n * interfere with enumerability and should not be used together with {ERC721Enumerable}.\n */\nabstract contract ERC721Enumerable is ERC721, IERC721Enumerable {\n mapping(address owner => mapping(uint256 index => uint256)) private _ownedTokens;\n mapping(uint256 tokenId => uint256) private _ownedTokensIndex;\n\n uint256[] private _allTokens;\n mapping(uint256 tokenId => uint256) private _allTokensIndex;\n\n /**\n * @dev An `owner`'s token query was out of bounds for `index`.\n *\n * NOTE: The owner being `address(0)` indicates a global out of bounds index.\n */\n error ERC721OutOfBoundsIndex(address owner, uint256 index);\n\n /**\n * @dev Batch mint is not allowed.\n */\n error ERC721EnumerableForbiddenBatchMint();\n\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165, ERC721) returns (bool) {\n return interfaceId == type(IERC721Enumerable).interfaceId || super.supportsInterface(interfaceId);\n }\n\n /**\n * @dev See {IERC721Enumerable-tokenOfOwnerByIndex}.\n */\n function tokenOfOwnerByIndex(address owner, uint256 index) public view virtual returns (uint256) {\n if (index >= balanceOf(owner)) {\n revert ERC721OutOfBoundsIndex(owner, index);\n }\n return _ownedTokens[owner][index];\n }\n\n /**\n * @dev See {IERC721Enumerable-totalSupply}.\n */\n function totalSupply() public view virtual returns (uint256) {\n return _allTokens.length;\n }\n\n /**\n * @dev See {IERC721Enumerable-tokenByIndex}.\n */\n function tokenByIndex(uint256 index) public view virtual returns (uint256) {\n if (index >= totalSupply()) {\n revert ERC721OutOfBoundsIndex(address(0), index);\n }\n return _allTokens[index];\n }\n\n /**\n * @dev See {ERC721-_update}.\n */\n function _update(address to, uint256 tokenId, address auth) internal virtual override returns (address) {\n address previousOwner = super._update(to, tokenId, auth);\n\n if (previousOwner == address(0)) {\n _addTokenToAllTokensEnumeration(tokenId);\n } else if (previousOwner != to) {\n _removeTokenFromOwnerEnumeration(previousOwner, tokenId);\n }\n if (to == address(0)) {\n _removeTokenFromAllTokensEnumeration(tokenId);\n } else if (previousOwner != to) {\n _addTokenToOwnerEnumeration(to, tokenId);\n }\n\n return previousOwner;\n }\n\n /**\n * @dev Private function to add a token to this extension's ownership-tracking data structures.\n * @param to address representing the new owner of the given token ID\n * @param tokenId uint256 ID of the token to be added to the tokens list of the given address\n */\n function _addTokenToOwnerEnumeration(address to, uint256 tokenId) private {\n uint256 length = balanceOf(to) - 1;\n _ownedTokens[to][length] = tokenId;\n _ownedTokensIndex[tokenId] = length;\n }\n\n /**\n * @dev Private function to add a token to this extension's token tracking data structures.\n * @param tokenId uint256 ID of the token to be added to the tokens list\n */\n function _addTokenToAllTokensEnumeration(uint256 tokenId) private {\n _allTokensIndex[tokenId] = _allTokens.length;\n _allTokens.push(tokenId);\n }\n\n /**\n * @dev Private function to remove a token from this extension's ownership-tracking data structures. Note that\n * while the token is not assigned a new owner, the `_ownedTokensIndex` mapping is _not_ updated: this allows for\n * gas optimizations e.g. when performing a transfer operation (avoiding double writes).\n * This has O(1) time complexity, but alters the order of the _ownedTokens array.\n * @param from address representing the previous owner of the given token ID\n * @param tokenId uint256 ID of the token to be removed from the tokens list of the given address\n */\n function _removeTokenFromOwnerEnumeration(address from, uint256 tokenId) private {\n // To prevent a gap in from's tokens array, we store the last token in the index of the token to delete, and\n // then delete the last slot (swap and pop).\n\n uint256 lastTokenIndex = balanceOf(from);\n uint256 tokenIndex = _ownedTokensIndex[tokenId];\n\n mapping(uint256 index => uint256) storage _ownedTokensByOwner = _ownedTokens[from];\n\n // When the token to delete is the last token, the swap operation is unnecessary\n if (tokenIndex != lastTokenIndex) {\n uint256 lastTokenId = _ownedTokensByOwner[lastTokenIndex];\n\n _ownedTokensByOwner[tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token\n _ownedTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index\n }\n\n // This also deletes the contents at the last position of the array\n delete _ownedTokensIndex[tokenId];\n delete _ownedTokensByOwner[lastTokenIndex];\n }\n\n /**\n * @dev Private function to remove a token from this extension's token tracking data structures.\n * This has O(1) time complexity, but alters the order of the _allTokens array.\n * @param tokenId uint256 ID of the token to be removed from the tokens list\n */\n function _removeTokenFromAllTokensEnumeration(uint256 tokenId) private {\n // To prevent a gap in the tokens array, we store the last token in the index of the token to delete, and\n // then delete the last slot (swap and pop).\n\n uint256 lastTokenIndex = _allTokens.length - 1;\n uint256 tokenIndex = _allTokensIndex[tokenId];\n\n // When the token to delete is the last token, the swap operation is unnecessary. However, since this occurs so\n // rarely (when the last minted token is burnt) that we still do the swap here to avoid the gas cost of adding\n // an 'if' statement (like in _removeTokenFromOwnerEnumeration)\n uint256 lastTokenId = _allTokens[lastTokenIndex];\n\n _allTokens[tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token\n _allTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index\n\n // This also deletes the contents at the last position of the array\n delete _allTokensIndex[tokenId];\n _allTokens.pop();\n }\n\n /**\n * See {ERC721-_increaseBalance}. We need that to account tokens that were minted in batch\n */\n function _increaseBalance(address account, uint128 amount) internal virtual override {\n if (amount > 0) {\n revert ERC721EnumerableForbiddenBatchMint();\n }\n super._increaseBalance(account, amount);\n }\n}\n" + }, + "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC721/extensions/ERC721URIStorage.sol)\n\npragma solidity ^0.8.20;\n\nimport {ERC721} from \"../ERC721.sol\";\nimport {Strings} from \"../../../utils/Strings.sol\";\nimport {IERC4906} from \"../../../interfaces/IERC4906.sol\";\nimport {IERC165} from \"../../../interfaces/IERC165.sol\";\n\n/**\n * @dev ERC-721 token with storage based token URI management.\n */\nabstract contract ERC721URIStorage is IERC4906, ERC721 {\n using Strings for uint256;\n\n // Interface ID as defined in ERC-4906. This does not correspond to a traditional interface ID as ERC-4906 only\n // defines events and does not include any external function.\n bytes4 private constant ERC4906_INTERFACE_ID = bytes4(0x49064906);\n\n // Optional mapping for token URIs\n mapping(uint256 tokenId => string) private _tokenURIs;\n\n /**\n * @dev See {IERC165-supportsInterface}\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override(ERC721, IERC165) returns (bool) {\n return interfaceId == ERC4906_INTERFACE_ID || super.supportsInterface(interfaceId);\n }\n\n /**\n * @dev See {IERC721Metadata-tokenURI}.\n */\n function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {\n _requireOwned(tokenId);\n\n string memory _tokenURI = _tokenURIs[tokenId];\n string memory base = _baseURI();\n\n // If there is no base URI, return the token URI.\n if (bytes(base).length == 0) {\n return _tokenURI;\n }\n // If both are set, concatenate the baseURI and tokenURI (via string.concat).\n if (bytes(_tokenURI).length > 0) {\n return string.concat(base, _tokenURI);\n }\n\n return super.tokenURI(tokenId);\n }\n\n /**\n * @dev Sets `_tokenURI` as the tokenURI of `tokenId`.\n *\n * Emits {MetadataUpdate}.\n */\n function _setTokenURI(uint256 tokenId, string memory _tokenURI) internal virtual {\n _tokenURIs[tokenId] = _tokenURI;\n emit MetadataUpdate(tokenId);\n }\n}\n" + }, + "@openzeppelin/contracts/token/ERC721/extensions/ERC721Votes.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC721/extensions/ERC721Votes.sol)\n\npragma solidity ^0.8.20;\n\nimport {ERC721} from \"../ERC721.sol\";\nimport {Votes} from \"../../../governance/utils/Votes.sol\";\n\n/**\n * @dev Extension of ERC-721 to support voting and delegation as implemented by {Votes}, where each individual NFT counts\n * as 1 vote unit.\n *\n * Tokens do not count as votes until they are delegated, because votes must be tracked which incurs an additional cost\n * on every transfer. Token holders can either delegate to a trusted representative who will decide how to make use of\n * the votes in governance decisions, or they can delegate to themselves to be their own representative.\n */\nabstract contract ERC721Votes is ERC721, Votes {\n /**\n * @dev See {ERC721-_update}. Adjusts votes when tokens are transferred.\n *\n * Emits a {IVotes-DelegateVotesChanged} event.\n */\n function _update(address to, uint256 tokenId, address auth) internal virtual override returns (address) {\n address previousOwner = super._update(to, tokenId, auth);\n\n _transferVotingUnits(previousOwner, to, 1);\n\n return previousOwner;\n }\n\n /**\n * @dev Returns the balance of `account`.\n *\n * WARNING: Overriding this function will likely result in incorrect vote tracking.\n */\n function _getVotingUnits(address account) internal view virtual override returns (uint256) {\n return balanceOf(account);\n }\n\n /**\n * @dev See {ERC721-_increaseBalance}. We need that to account tokens that were minted in batch.\n */\n function _increaseBalance(address account, uint128 amount) internal virtual override {\n super._increaseBalance(account, amount);\n _transferVotingUnits(address(0), account, amount);\n }\n}\n" + }, + "@openzeppelin/contracts/token/ERC721/extensions/IERC721Enumerable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC721/extensions/IERC721Enumerable.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC721} from \"../IERC721.sol\";\n\n/**\n * @title ERC-721 Non-Fungible Token Standard, optional enumeration extension\n * @dev See https://eips.ethereum.org/EIPS/eip-721\n */\ninterface IERC721Enumerable is IERC721 {\n /**\n * @dev Returns the total amount of tokens stored by the contract.\n */\n function totalSupply() external view returns (uint256);\n\n /**\n * @dev Returns a token ID owned by `owner` at a given `index` of its token list.\n * Use along with {balanceOf} to enumerate all of ``owner``'s tokens.\n */\n function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256);\n\n /**\n * @dev Returns a token ID at a given `index` of all the tokens stored by the contract.\n * Use along with {totalSupply} to enumerate all tokens.\n */\n function tokenByIndex(uint256 index) external view returns (uint256);\n}\n" + }, + "@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC721/extensions/IERC721Metadata.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC721} from \"../IERC721.sol\";\n\n/**\n * @title ERC-721 Non-Fungible Token Standard, optional metadata extension\n * @dev See https://eips.ethereum.org/EIPS/eip-721\n */\ninterface IERC721Metadata is IERC721 {\n /**\n * @dev Returns the token collection name.\n */\n function name() external view returns (string memory);\n\n /**\n * @dev Returns the token collection symbol.\n */\n function symbol() external view returns (string memory);\n\n /**\n * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token.\n */\n function tokenURI(uint256 tokenId) external view returns (string memory);\n}\n" + }, + "@openzeppelin/contracts/token/ERC721/IERC721.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC721/IERC721.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC165} from \"../../utils/introspection/IERC165.sol\";\n\n/**\n * @dev Required interface of an ERC-721 compliant contract.\n */\ninterface IERC721 is IERC165 {\n /**\n * @dev Emitted when `tokenId` token is transferred from `from` to `to`.\n */\n event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);\n\n /**\n * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.\n */\n event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);\n\n /**\n * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.\n */\n event ApprovalForAll(address indexed owner, address indexed operator, bool approved);\n\n /**\n * @dev Returns the number of tokens in ``owner``'s account.\n */\n function balanceOf(address owner) external view returns (uint256 balance);\n\n /**\n * @dev Returns the owner of the `tokenId` token.\n *\n * Requirements:\n *\n * - `tokenId` must exist.\n */\n function ownerOf(uint256 tokenId) external view returns (address owner);\n\n /**\n * @dev Safely transfers `tokenId` token from `from` to `to`.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `tokenId` token must exist and be owned by `from`.\n * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon\n * a safe transfer.\n *\n * Emits a {Transfer} event.\n */\n function safeTransferFrom(address from, address to, uint256 tokenId, bytes calldata data) external;\n\n /**\n * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients\n * are aware of the ERC-721 protocol to prevent tokens from being forever locked.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `tokenId` token must exist and be owned by `from`.\n * - If the caller is not `from`, it must have been allowed to move this token by either {approve} or\n * {setApprovalForAll}.\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon\n * a safe transfer.\n *\n * Emits a {Transfer} event.\n */\n function safeTransferFrom(address from, address to, uint256 tokenId) external;\n\n /**\n * @dev Transfers `tokenId` token from `from` to `to`.\n *\n * WARNING: Note that the caller is responsible to confirm that the recipient is capable of receiving ERC-721\n * or else they may be permanently lost. Usage of {safeTransferFrom} prevents loss, though the caller must\n * understand this adds an external call which potentially creates a reentrancy vulnerability.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `tokenId` token must be owned by `from`.\n * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(address from, address to, uint256 tokenId) external;\n\n /**\n * @dev Gives permission to `to` to transfer `tokenId` token to another account.\n * The approval is cleared when the token is transferred.\n *\n * Only a single account can be approved at a time, so approving the zero address clears previous approvals.\n *\n * Requirements:\n *\n * - The caller must own the token or be an approved operator.\n * - `tokenId` must exist.\n *\n * Emits an {Approval} event.\n */\n function approve(address to, uint256 tokenId) external;\n\n /**\n * @dev Approve or remove `operator` as an operator for the caller.\n * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.\n *\n * Requirements:\n *\n * - The `operator` cannot be the address zero.\n *\n * Emits an {ApprovalForAll} event.\n */\n function setApprovalForAll(address operator, bool approved) external;\n\n /**\n * @dev Returns the account approved for `tokenId` token.\n *\n * Requirements:\n *\n * - `tokenId` must exist.\n */\n function getApproved(uint256 tokenId) external view returns (address operator);\n\n /**\n * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.\n *\n * See {setApprovalForAll}\n */\n function isApprovedForAll(address owner, address operator) external view returns (bool);\n}\n" + }, + "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC721/IERC721Receiver.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @title ERC-721 token receiver interface\n * @dev Interface for any contract that wants to support safeTransfers\n * from ERC-721 asset contracts.\n */\ninterface IERC721Receiver {\n /**\n * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom}\n * by `operator` from `from`, this function is called.\n *\n * It must return its Solidity selector to confirm the token transfer.\n * If any other value is returned or the interface is not implemented by the recipient, the transfer will be\n * reverted.\n *\n * The selector can be obtained in Solidity with `IERC721Receiver.onERC721Received.selector`.\n */\n function onERC721Received(\n address operator,\n address from,\n uint256 tokenId,\n bytes calldata data\n ) external returns (bytes4);\n}\n" + }, + "@openzeppelin/contracts/token/ERC721/utils/ERC721Utils.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC721/utils/ERC721Utils.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC721Receiver} from \"../IERC721Receiver.sol\";\nimport {IERC721Errors} from \"../../../interfaces/draft-IERC6093.sol\";\n\n/**\n * @dev Library that provide common ERC-721 utility functions.\n *\n * See https://eips.ethereum.org/EIPS/eip-721[ERC-721].\n *\n * _Available since v5.1._\n */\nlibrary ERC721Utils {\n /**\n * @dev Performs an acceptance check for the provided `operator` by calling {IERC721-onERC721Received}\n * on the `to` address. The `operator` is generally the address that initiated the token transfer (i.e. `msg.sender`).\n *\n * The acceptance call is not executed and treated as a no-op if the target address doesn't contain code (i.e. an EOA).\n * Otherwise, the recipient must implement {IERC721Receiver-onERC721Received} and return the acceptance magic value to accept\n * the transfer.\n */\n function checkOnERC721Received(\n address operator,\n address from,\n address to,\n uint256 tokenId,\n bytes memory data\n ) internal {\n if (to.code.length > 0) {\n try IERC721Receiver(to).onERC721Received(operator, from, tokenId, data) returns (bytes4 retval) {\n if (retval != IERC721Receiver.onERC721Received.selector) {\n // Token rejected\n revert IERC721Errors.ERC721InvalidReceiver(to);\n }\n } catch (bytes memory reason) {\n if (reason.length == 0) {\n // non-IERC721Receiver implementer\n revert IERC721Errors.ERC721InvalidReceiver(to);\n } else {\n assembly (\"memory-safe\") {\n revert(add(32, reason), mload(reason))\n }\n }\n }\n }\n }\n}\n" + }, + "@openzeppelin/contracts/utils/Address.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/Address.sol)\n\npragma solidity ^0.8.20;\n\nimport {Errors} from \"./Errors.sol\";\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary Address {\n /**\n * @dev There's no code at `target` (it is not a contract).\n */\n error AddressEmptyCode(address target);\n\n /**\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\n * `recipient`, forwarding all available gas and reverting on errors.\n *\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\n * imposed by `transfer`, making them unable to receive funds via\n * `transfer`. {sendValue} removes this limitation.\n *\n * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n *\n * IMPORTANT: because control is transferred to `recipient`, care must be\n * taken to not create reentrancy vulnerabilities. Consider using\n * {ReentrancyGuard} or the\n * https://solidity.readthedocs.io/en/v0.8.20/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n */\n function sendValue(address payable recipient, uint256 amount) internal {\n if (address(this).balance < amount) {\n revert Errors.InsufficientBalance(address(this).balance, amount);\n }\n\n (bool success, ) = recipient.call{value: amount}(\"\");\n if (!success) {\n revert Errors.FailedCall();\n }\n }\n\n /**\n * @dev Performs a Solidity function call using a low level `call`. A\n * plain `call` is an unsafe replacement for a function call: use this\n * function instead.\n *\n * If `target` reverts with a revert reason or custom error, it is bubbled\n * up by this function (like regular Solidity function calls). However, if\n * the call reverted with no returned reason, this function reverts with a\n * {Errors.FailedCall} error.\n *\n * Returns the raw returned data. To convert to the expected return value,\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\n *\n * Requirements:\n *\n * - `target` must be a contract.\n * - calling `target` with `data` must not revert.\n */\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but also transferring `value` wei to `target`.\n *\n * Requirements:\n *\n * - the calling contract must have an ETH balance of at least `value`.\n * - the called Solidity function must be `payable`.\n */\n function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {\n if (address(this).balance < value) {\n revert Errors.InsufficientBalance(address(this).balance, value);\n }\n (bool success, bytes memory returndata) = target.call{value: value}(data);\n return verifyCallResultFromTarget(target, success, returndata);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a static call.\n */\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\n (bool success, bytes memory returndata) = target.staticcall(data);\n return verifyCallResultFromTarget(target, success, returndata);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a delegate call.\n */\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\n (bool success, bytes memory returndata) = target.delegatecall(data);\n return verifyCallResultFromTarget(target, success, returndata);\n }\n\n /**\n * @dev Tool to verify that a low level call to smart-contract was successful, and reverts if the target\n * was not a contract or bubbling up the revert reason (falling back to {Errors.FailedCall}) in case\n * of an unsuccessful call.\n */\n function verifyCallResultFromTarget(\n address target,\n bool success,\n bytes memory returndata\n ) internal view returns (bytes memory) {\n if (!success) {\n _revert(returndata);\n } else {\n // only check if target is a contract if the call was successful and the return data is empty\n // otherwise we already know that it was a contract\n if (returndata.length == 0 && target.code.length == 0) {\n revert AddressEmptyCode(target);\n }\n return returndata;\n }\n }\n\n /**\n * @dev Tool to verify that a low level call was successful, and reverts if it wasn't, either by bubbling the\n * revert reason or with a default {Errors.FailedCall} error.\n */\n function verifyCallResult(bool success, bytes memory returndata) internal pure returns (bytes memory) {\n if (!success) {\n _revert(returndata);\n } else {\n return returndata;\n }\n }\n\n /**\n * @dev Reverts with returndata if present. Otherwise reverts with {Errors.FailedCall}.\n */\n function _revert(bytes memory returndata) private pure {\n // Look for revert reason and bubble it up if present\n if (returndata.length > 0) {\n // The easiest way to bubble the revert reason is using memory via assembly\n assembly (\"memory-safe\") {\n let returndata_size := mload(returndata)\n revert(add(32, returndata), returndata_size)\n }\n } else {\n revert Errors.FailedCall();\n }\n }\n}\n" + }, + "@openzeppelin/contracts/utils/Context.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract Context {\n function _msgSender() internal view virtual returns (address) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual returns (bytes calldata) {\n return msg.data;\n }\n\n function _contextSuffixLength() internal view virtual returns (uint256) {\n return 0;\n }\n}\n" + }, + "@openzeppelin/contracts/utils/cryptography/ECDSA.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/cryptography/ECDSA.sol)\n\npragma solidity ^0.8.20;\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 }\n\n /**\n * @dev The signature derives the `address(0)`.\n */\n error ECDSAInvalidSignature();\n\n /**\n * @dev The signature has an invalid length.\n */\n error ECDSAInvalidSignatureLength(uint256 length);\n\n /**\n * @dev The signature has an S value that is in the upper half order.\n */\n error ECDSAInvalidSignatureS(bytes32 s);\n\n /**\n * @dev Returns the address that signed a hashed message (`hash`) with `signature` or an error. This will not\n * return address(0) without also returning an error description. Errors are documented using an enum (error type)\n * and a bytes32 providing additional information about the error.\n *\n * If no error is returned, then the address can be used for verification purposes.\n *\n * The `ecrecover` EVM precompile 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 {MessageHashUtils-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 function tryRecover(\n bytes32 hash,\n bytes memory signature\n ) internal pure returns (address recovered, RecoverError err, bytes32 errArg) {\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 assembly (\"memory-safe\") {\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, bytes32(signature.length));\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 precompile 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 {MessageHashUtils-toEthSignedMessageHash} on it.\n */\n function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {\n (address recovered, RecoverError error, bytes32 errorArg) = tryRecover(hash, signature);\n _throwError(error, errorArg);\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[ERC-2098 short signatures]\n */\n function tryRecover(\n bytes32 hash,\n bytes32 r,\n bytes32 vs\n ) internal pure returns (address recovered, RecoverError err, bytes32 errArg) {\n unchecked {\n bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff);\n // We do not check for an overflow here since the shift operation results in 0 or 1.\n uint8 v = uint8((uint256(vs) >> 255) + 27);\n return tryRecover(hash, v, r, s);\n }\n }\n\n /**\n * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately.\n */\n function recover(bytes32 hash, bytes32 r, bytes32 vs) internal pure returns (address) {\n (address recovered, RecoverError error, bytes32 errorArg) = tryRecover(hash, r, vs);\n _throwError(error, errorArg);\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 function tryRecover(\n bytes32 hash,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) internal pure returns (address recovered, RecoverError err, bytes32 errArg) {\n // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature\n // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines\n // the valid range for s in (301): 0 < s < secp256k1n ÷ 2 + 1, and for v in (302): v ∈ {27, 28}. Most\n // signatures from current libraries generate a unique signature with an s-value in the lower half order.\n //\n // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value\n // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or\n // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept\n // these malleable signatures as well.\n if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) {\n return (address(0), RecoverError.InvalidSignatureS, s);\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, bytes32(0));\n }\n\n return (signer, RecoverError.NoError, bytes32(0));\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, bytes32 errorArg) = tryRecover(hash, v, r, s);\n _throwError(error, errorArg);\n return recovered;\n }\n\n /**\n * @dev Optionally reverts with the corresponding custom error according to the `error` argument provided.\n */\n function _throwError(RecoverError error, bytes32 errorArg) private pure {\n if (error == RecoverError.NoError) {\n return; // no error: do nothing\n } else if (error == RecoverError.InvalidSignature) {\n revert ECDSAInvalidSignature();\n } else if (error == RecoverError.InvalidSignatureLength) {\n revert ECDSAInvalidSignatureLength(uint256(errorArg));\n } else if (error == RecoverError.InvalidSignatureS) {\n revert ECDSAInvalidSignatureS(errorArg);\n }\n }\n}\n" + }, + "@openzeppelin/contracts/utils/cryptography/EIP712.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/cryptography/EIP712.sol)\n\npragma solidity ^0.8.20;\n\nimport {MessageHashUtils} from \"./MessageHashUtils.sol\";\nimport {ShortStrings, ShortString} from \"../ShortStrings.sol\";\nimport {IERC5267} from \"../../interfaces/IERC5267.sol\";\n\n/**\n * @dev https://eips.ethereum.org/EIPS/eip-712[EIP-712] is a standard for hashing and signing of typed structured data.\n *\n * The encoding scheme specified in the EIP requires a domain separator and a hash of the typed structured data, whose\n * encoding is very generic and therefore its implementation in Solidity is not feasible, thus this contract\n * does not implement the encoding itself. Protocols need to implement the type-specific encoding they need in order to\n * produce the hash of their typed data using a combination of `abi.encode` and `keccak256`.\n *\n * This contract implements the EIP-712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding\n * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA\n * ({_hashTypedDataV4}).\n *\n * The implementation of the domain separator was designed to be as efficient as possible while still properly updating\n * the chain id to protect against replay attacks on an eventual fork of the chain.\n *\n * NOTE: This contract implements the version of the encoding known as \"v4\", as implemented by the JSON RPC method\n * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask].\n *\n * NOTE: In the upgradeable version of this contract, the cached values will correspond to the address, and the domain\n * separator of the implementation contract. This will cause the {_domainSeparatorV4} function to always rebuild the\n * separator from the immutable values, which is cheaper than accessing a cached version in cold storage.\n *\n * @custom:oz-upgrades-unsafe-allow state-variable-immutable\n */\nabstract contract EIP712 is IERC5267 {\n using ShortStrings for *;\n\n bytes32 private constant TYPE_HASH =\n keccak256(\"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)\");\n\n // Cache the domain separator as an immutable value, but also store the chain id that it corresponds to, in order to\n // invalidate the cached domain separator if the chain id changes.\n bytes32 private immutable _cachedDomainSeparator;\n uint256 private immutable _cachedChainId;\n address private immutable _cachedThis;\n\n bytes32 private immutable _hashedName;\n bytes32 private immutable _hashedVersion;\n\n ShortString private immutable _name;\n ShortString private immutable _version;\n string private _nameFallback;\n string private _versionFallback;\n\n /**\n * @dev Initializes the domain separator and parameter caches.\n *\n * The meaning of `name` and `version` is specified in\n * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP-712]:\n *\n * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol.\n * - `version`: the current major version of the signing domain.\n *\n * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart\n * contract upgrade].\n */\n constructor(string memory name, string memory version) {\n _name = name.toShortStringWithFallback(_nameFallback);\n _version = version.toShortStringWithFallback(_versionFallback);\n _hashedName = keccak256(bytes(name));\n _hashedVersion = keccak256(bytes(version));\n\n _cachedChainId = block.chainid;\n _cachedDomainSeparator = _buildDomainSeparator();\n _cachedThis = address(this);\n }\n\n /**\n * @dev Returns the domain separator for the current chain.\n */\n function _domainSeparatorV4() internal view returns (bytes32) {\n if (address(this) == _cachedThis && block.chainid == _cachedChainId) {\n return _cachedDomainSeparator;\n } else {\n return _buildDomainSeparator();\n }\n }\n\n function _buildDomainSeparator() private view returns (bytes32) {\n return keccak256(abi.encode(TYPE_HASH, _hashedName, _hashedVersion, block.chainid, address(this)));\n }\n\n /**\n * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this\n * function returns the hash of the fully encoded EIP712 message for this domain.\n *\n * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example:\n *\n * ```solidity\n * bytes32 digest = _hashTypedDataV4(keccak256(abi.encode(\n * keccak256(\"Mail(address to,string contents)\"),\n * mailTo,\n * keccak256(bytes(mailContents))\n * )));\n * address signer = ECDSA.recover(digest, signature);\n * ```\n */\n function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) {\n return MessageHashUtils.toTypedDataHash(_domainSeparatorV4(), structHash);\n }\n\n /**\n * @dev See {IERC-5267}.\n */\n function eip712Domain()\n public\n view\n virtual\n returns (\n bytes1 fields,\n string memory name,\n string memory version,\n uint256 chainId,\n address verifyingContract,\n bytes32 salt,\n uint256[] memory extensions\n )\n {\n return (\n hex\"0f\", // 01111\n _EIP712Name(),\n _EIP712Version(),\n block.chainid,\n address(this),\n bytes32(0),\n new uint256[](0)\n );\n }\n\n /**\n * @dev The name parameter for the EIP712 domain.\n *\n * NOTE: By default this function reads _name which is an immutable value.\n * It only reads from storage if necessary (in case the value is too large to fit in a ShortString).\n */\n // solhint-disable-next-line func-name-mixedcase\n function _EIP712Name() internal view returns (string memory) {\n return _name.toStringWithFallback(_nameFallback);\n }\n\n /**\n * @dev The version parameter for the EIP712 domain.\n *\n * NOTE: By default this function reads _version which is an immutable value.\n * It only reads from storage if necessary (in case the value is too large to fit in a ShortString).\n */\n // solhint-disable-next-line func-name-mixedcase\n function _EIP712Version() internal view returns (string memory) {\n return _version.toStringWithFallback(_versionFallback);\n }\n}\n" + }, + "@openzeppelin/contracts/utils/cryptography/MessageHashUtils.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/cryptography/MessageHashUtils.sol)\n\npragma solidity ^0.8.20;\n\nimport {Strings} from \"../Strings.sol\";\n\n/**\n * @dev Signature message hash utilities for producing digests to be consumed by {ECDSA} recovery or signing.\n *\n * The library provides methods for generating a hash of a message that conforms to the\n * https://eips.ethereum.org/EIPS/eip-191[ERC-191] and https://eips.ethereum.org/EIPS/eip-712[EIP 712]\n * specifications.\n */\nlibrary MessageHashUtils {\n /**\n * @dev Returns the keccak256 digest of an ERC-191 signed data with version\n * `0x45` (`personal_sign` messages).\n *\n * The digest is calculated by prefixing a bytes32 `messageHash` with\n * `\"\\x19Ethereum Signed Message:\\n32\"` and hashing the result. It corresponds with the\n * hash signed when using the https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] JSON-RPC method.\n *\n * NOTE: The `messageHash` parameter is intended to be the result of hashing a raw message with\n * keccak256, although any bytes32 value can be safely used because the final digest will\n * be re-hashed.\n *\n * See {ECDSA-recover}.\n */\n function toEthSignedMessageHash(bytes32 messageHash) internal pure returns (bytes32 digest) {\n assembly (\"memory-safe\") {\n mstore(0x00, \"\\x19Ethereum Signed Message:\\n32\") // 32 is the bytes-length of messageHash\n mstore(0x1c, messageHash) // 0x1c (28) is the length of the prefix\n digest := keccak256(0x00, 0x3c) // 0x3c is the length of the prefix (0x1c) + messageHash (0x20)\n }\n }\n\n /**\n * @dev Returns the keccak256 digest of an ERC-191 signed data with version\n * `0x45` (`personal_sign` messages).\n *\n * The digest is calculated by prefixing an arbitrary `message` with\n * `\"\\x19Ethereum Signed Message:\\n\" + len(message)` and hashing the result. It corresponds with the\n * hash signed when using the https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] JSON-RPC method.\n *\n * See {ECDSA-recover}.\n */\n function toEthSignedMessageHash(bytes memory message) internal pure returns (bytes32) {\n return\n keccak256(bytes.concat(\"\\x19Ethereum Signed Message:\\n\", bytes(Strings.toString(message.length)), message));\n }\n\n /**\n * @dev Returns the keccak256 digest of an ERC-191 signed data with version\n * `0x00` (data with intended validator).\n *\n * The digest is calculated by prefixing an arbitrary `data` with `\"\\x19\\x00\"` and the intended\n * `validator` address. Then hashing the result.\n *\n * See {ECDSA-recover}.\n */\n function toDataWithIntendedValidatorHash(address validator, bytes memory data) internal pure returns (bytes32) {\n return keccak256(abi.encodePacked(hex\"19_00\", validator, data));\n }\n\n /**\n * @dev Returns the keccak256 digest of an EIP-712 typed data (ERC-191 version `0x01`).\n *\n * The digest is calculated from a `domainSeparator` and a `structHash`, by prefixing them with\n * `\\x19\\x01` and hashing the result. It corresponds to the hash signed by the\n * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`] JSON-RPC method as part of EIP-712.\n *\n * See {ECDSA-recover}.\n */\n function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32 digest) {\n assembly (\"memory-safe\") {\n let ptr := mload(0x40)\n mstore(ptr, hex\"19_01\")\n mstore(add(ptr, 0x02), domainSeparator)\n mstore(add(ptr, 0x22), structHash)\n digest := keccak256(ptr, 0x42)\n }\n }\n}\n" + }, + "@openzeppelin/contracts/utils/cryptography/SignatureChecker.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/cryptography/SignatureChecker.sol)\n\npragma solidity ^0.8.20;\n\nimport {ECDSA} from \"./ECDSA.sol\";\nimport {IERC1271} from \"../../interfaces/IERC1271.sol\";\n\n/**\n * @dev Signature verification helper that can be used instead of `ECDSA.recover` to seamlessly support both ECDSA\n * signatures from externally owned accounts (EOAs) as well as ERC-1271 signatures from smart contract wallets like\n * Argent and Safe Wallet (previously Gnosis Safe).\n */\nlibrary SignatureChecker {\n /**\n * @dev Checks if a signature is valid for a given signer and data hash. If the signer is a smart contract, the\n * signature is validated against that smart contract using ERC-1271, otherwise it's validated using `ECDSA.recover`.\n *\n * NOTE: Unlike ECDSA signatures, contract signatures are revocable, and the outcome of this function can thus\n * change through time. It could return true at block N and false at block N+1 (or the opposite).\n */\n function isValidSignatureNow(address signer, bytes32 hash, bytes memory signature) internal view returns (bool) {\n if (signer.code.length == 0) {\n (address recovered, ECDSA.RecoverError err, ) = ECDSA.tryRecover(hash, signature);\n return err == ECDSA.RecoverError.NoError && recovered == signer;\n } else {\n return isValidERC1271SignatureNow(signer, hash, signature);\n }\n }\n\n /**\n * @dev Checks if a signature is valid for a given signer and data hash. The signature is validated\n * against the signer smart contract using ERC-1271.\n *\n * NOTE: Unlike ECDSA signatures, contract signatures are revocable, and the outcome of this function can thus\n * change through time. It could return true at block N and false at block N+1 (or the opposite).\n */\n function isValidERC1271SignatureNow(\n address signer,\n bytes32 hash,\n bytes memory signature\n ) internal view returns (bool) {\n (bool success, bytes memory result) = signer.staticcall(\n abi.encodeCall(IERC1271.isValidSignature, (hash, signature))\n );\n return (success &&\n result.length >= 32 &&\n abi.decode(result, (bytes32)) == bytes32(IERC1271.isValidSignature.selector));\n }\n}\n" + }, + "@openzeppelin/contracts/utils/Errors.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/Errors.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Collection of common custom errors used in multiple contracts\n *\n * IMPORTANT: Backwards compatibility is not guaranteed in future versions of the library.\n * It is recommended to avoid relying on the error API for critical functionality.\n *\n * _Available since v5.1._\n */\nlibrary Errors {\n /**\n * @dev The ETH balance of the account is not enough to perform the operation.\n */\n error InsufficientBalance(uint256 balance, uint256 needed);\n\n /**\n * @dev A call to an address target failed. The target may have reverted.\n */\n error FailedCall();\n\n /**\n * @dev The deployment failed.\n */\n error FailedDeployment();\n\n /**\n * @dev A necessary precompile is missing.\n */\n error MissingPrecompile(address);\n}\n" + }, + "@openzeppelin/contracts/utils/introspection/ERC165.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/introspection/ERC165.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC165} from \"./IERC165.sol\";\n\n/**\n * @dev Implementation of the {IERC165} interface.\n *\n * Contracts that want to implement ERC-165 should inherit from this contract and override {supportsInterface} to check\n * for the additional interface id that will be supported. For example:\n *\n * ```solidity\n * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);\n * }\n * ```\n */\nabstract contract ERC165 is IERC165 {\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) {\n return interfaceId == type(IERC165).interfaceId;\n }\n}\n" + }, + "@openzeppelin/contracts/utils/introspection/IERC165.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/introspection/IERC165.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Interface of the ERC-165 standard, as defined in the\n * https://eips.ethereum.org/EIPS/eip-165[ERC].\n *\n * Implementers can declare support of contract interfaces, which can then be\n * queried by others ({ERC165Checker}).\n *\n * For an implementation, see {ERC165}.\n */\ninterface IERC165 {\n /**\n * @dev Returns true if this contract implements the interface defined by\n * `interfaceId`. See the corresponding\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[ERC section]\n * to learn more about how these ids are created.\n *\n * This function call must use less than 30 000 gas.\n */\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\n}\n" + }, + "@openzeppelin/contracts/utils/math/Math.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/math/Math.sol)\n\npragma solidity ^0.8.20;\n\nimport {Panic} from \"../Panic.sol\";\nimport {SafeCast} from \"./SafeCast.sol\";\n\n/**\n * @dev Standard math utilities missing in the Solidity language.\n */\nlibrary Math {\n enum Rounding {\n Floor, // Toward negative infinity\n Ceil, // Toward positive infinity\n Trunc, // Toward zero\n Expand // Away from zero\n }\n\n /**\n * @dev Returns the addition of two unsigned integers, with an success flag (no overflow).\n */\n function tryAdd(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\n unchecked {\n uint256 c = a + b;\n if (c < a) return (false, 0);\n return (true, c);\n }\n }\n\n /**\n * @dev Returns the subtraction of two unsigned integers, with an success flag (no overflow).\n */\n function trySub(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\n unchecked {\n if (b > a) return (false, 0);\n return (true, a - b);\n }\n }\n\n /**\n * @dev Returns the multiplication of two unsigned integers, with an success flag (no overflow).\n */\n function tryMul(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\n unchecked {\n // Gas optimization: this is cheaper than requiring 'a' not being zero, but the\n // benefit is lost if 'b' is also tested.\n // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522\n if (a == 0) return (true, 0);\n uint256 c = a * b;\n if (c / a != b) return (false, 0);\n return (true, c);\n }\n }\n\n /**\n * @dev Returns the division of two unsigned integers, with a success flag (no division by zero).\n */\n function tryDiv(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\n unchecked {\n if (b == 0) return (false, 0);\n return (true, a / b);\n }\n }\n\n /**\n * @dev Returns the remainder of dividing two unsigned integers, with a success flag (no division by zero).\n */\n function tryMod(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\n unchecked {\n if (b == 0) return (false, 0);\n return (true, a % b);\n }\n }\n\n /**\n * @dev Branchless ternary evaluation for `a ? b : c`. Gas costs are constant.\n *\n * IMPORTANT: This function may reduce bytecode size and consume less gas when used standalone.\n * However, the compiler may optimize Solidity ternary operations (i.e. `a ? b : c`) to only compute\n * one branch when needed, making this function more expensive.\n */\n function ternary(bool condition, uint256 a, uint256 b) internal pure returns (uint256) {\n unchecked {\n // branchless ternary works because:\n // b ^ (a ^ b) == a\n // b ^ 0 == b\n return b ^ ((a ^ b) * SafeCast.toUint(condition));\n }\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 ternary(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 ternary(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 towards infinity instead\n * of rounding towards zero.\n */\n function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {\n if (b == 0) {\n // Guarantee the same behavior as in a regular Solidity division.\n Panic.panic(Panic.DIVISION_BY_ZERO);\n }\n\n // The following calculation ensures accurate ceiling division without overflow.\n // Since a is non-zero, (a - 1) / b will not overflow.\n // The largest possible result occurs when (a - 1) / b is type(uint256).max,\n // but the largest value we can obtain is type(uint256).max - 1, which happens\n // when a = type(uint256).max and b = 1.\n unchecked {\n return SafeCast.toUint(a > 0) * ((a - 1) / b + 1);\n }\n }\n\n /**\n * @dev Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or\n * denominator == 0.\n *\n * Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv) with further edits by\n * 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²⁵⁶ and mod 2²⁵⁶ - 1, then use\n // the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256\n // variables such that product = prod1 * 2²⁵⁶ + prod0.\n uint256 prod0 = x * y; // 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 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²⁵⁶. Also prevents denominator == 0.\n if (denominator <= prod1) {\n Panic.panic(ternary(denominator == 0, Panic.DIVISION_BY_ZERO, Panic.UNDER_OVERFLOW));\n }\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.\n // Always >= 1. See https://cs.stackexchange.com/q/138556/92363.\n\n uint256 twos = denominator & (0 - denominator);\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²⁵⁶ / 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²⁵⁶. Now that denominator is an odd number, it has an inverse modulo 2²⁵⁶ such\n // that denominator * inv ≡ 1 mod 2²⁵⁶. Compute the inverse by starting with a seed that is correct for\n // four bits. That is, denominator * inv ≡ 1 mod 2⁴.\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\n // works in modular arithmetic, doubling the correct bits in each step.\n inverse *= 2 - denominator * inverse; // inverse mod 2⁸\n inverse *= 2 - denominator * inverse; // inverse mod 2¹⁶\n inverse *= 2 - denominator * inverse; // inverse mod 2³²\n inverse *= 2 - denominator * inverse; // inverse mod 2⁶⁴\n inverse *= 2 - denominator * inverse; // inverse mod 2¹²⁸\n inverse *= 2 - denominator * inverse; // inverse mod 2²⁵⁶\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²⁵⁶. Since the preconditions guarantee that the outcome is\n // less than 2²⁵⁶, 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 * @dev 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 return mulDiv(x, y, denominator) + SafeCast.toUint(unsignedRoundsUp(rounding) && mulmod(x, y, denominator) > 0);\n }\n\n /**\n * @dev Calculate the modular multiplicative inverse of a number in Z/nZ.\n *\n * If n is a prime, then Z/nZ is a field. In that case all elements are inversible, except 0.\n * If n is not a prime, then Z/nZ is not a field, and some elements might not be inversible.\n *\n * If the input value is not inversible, 0 is returned.\n *\n * NOTE: If you know for sure that n is (big) a prime, it may be cheaper to use Fermat's little theorem and get the\n * inverse using `Math.modExp(a, n - 2, n)`. See {invModPrime}.\n */\n function invMod(uint256 a, uint256 n) internal pure returns (uint256) {\n unchecked {\n if (n == 0) return 0;\n\n // The inverse modulo is calculated using the Extended Euclidean Algorithm (iterative version)\n // Used to compute integers x and y such that: ax + ny = gcd(a, n).\n // When the gcd is 1, then the inverse of a modulo n exists and it's x.\n // ax + ny = 1\n // ax = 1 + (-y)n\n // ax ≡ 1 (mod n) # x is the inverse of a modulo n\n\n // If the remainder is 0 the gcd is n right away.\n uint256 remainder = a % n;\n uint256 gcd = n;\n\n // Therefore the initial coefficients are:\n // ax + ny = gcd(a, n) = n\n // 0a + 1n = n\n int256 x = 0;\n int256 y = 1;\n\n while (remainder != 0) {\n uint256 quotient = gcd / remainder;\n\n (gcd, remainder) = (\n // The old remainder is the next gcd to try.\n remainder,\n // Compute the next remainder.\n // Can't overflow given that (a % gcd) * (gcd // (a % gcd)) <= gcd\n // where gcd is at most n (capped to type(uint256).max)\n gcd - remainder * quotient\n );\n\n (x, y) = (\n // Increment the coefficient of a.\n y,\n // Decrement the coefficient of n.\n // Can overflow, but the result is casted to uint256 so that the\n // next value of y is \"wrapped around\" to a value between 0 and n - 1.\n x - y * int256(quotient)\n );\n }\n\n if (gcd != 1) return 0; // No inverse exists.\n return ternary(x < 0, n - uint256(-x), uint256(x)); // Wrap the result if it's negative.\n }\n }\n\n /**\n * @dev Variant of {invMod}. More efficient, but only works if `p` is known to be a prime greater than `2`.\n *\n * From https://en.wikipedia.org/wiki/Fermat%27s_little_theorem[Fermat's little theorem], we know that if p is\n * prime, then `a**(p-1) ≡ 1 mod p`. As a consequence, we have `a * a**(p-2) ≡ 1 mod p`, which means that\n * `a**(p-2)` is the modular multiplicative inverse of a in Fp.\n *\n * NOTE: this function does NOT check that `p` is a prime greater than `2`.\n */\n function invModPrime(uint256 a, uint256 p) internal view returns (uint256) {\n unchecked {\n return Math.modExp(a, p - 2, p);\n }\n }\n\n /**\n * @dev Returns the modular exponentiation of the specified base, exponent and modulus (b ** e % m)\n *\n * Requirements:\n * - modulus can't be zero\n * - underlying staticcall to precompile must succeed\n *\n * IMPORTANT: The result is only valid if the underlying call succeeds. When using this function, make\n * sure the chain you're using it on supports the precompiled contract for modular exponentiation\n * at address 0x05 as specified in https://eips.ethereum.org/EIPS/eip-198[EIP-198]. Otherwise,\n * the underlying function will succeed given the lack of a revert, but the result may be incorrectly\n * interpreted as 0.\n */\n function modExp(uint256 b, uint256 e, uint256 m) internal view returns (uint256) {\n (bool success, uint256 result) = tryModExp(b, e, m);\n if (!success) {\n Panic.panic(Panic.DIVISION_BY_ZERO);\n }\n return result;\n }\n\n /**\n * @dev Returns the modular exponentiation of the specified base, exponent and modulus (b ** e % m).\n * It includes a success flag indicating if the operation succeeded. Operation will be marked as failed if trying\n * to operate modulo 0 or if the underlying precompile reverted.\n *\n * IMPORTANT: The result is only valid if the success flag is true. When using this function, make sure the chain\n * you're using it on supports the precompiled contract for modular exponentiation at address 0x05 as specified in\n * https://eips.ethereum.org/EIPS/eip-198[EIP-198]. Otherwise, the underlying function will succeed given the lack\n * of a revert, but the result may be incorrectly interpreted as 0.\n */\n function tryModExp(uint256 b, uint256 e, uint256 m) internal view returns (bool success, uint256 result) {\n if (m == 0) return (false, 0);\n assembly (\"memory-safe\") {\n let ptr := mload(0x40)\n // | Offset | Content | Content (Hex) |\n // |-----------|------------|--------------------------------------------------------------------|\n // | 0x00:0x1f | size of b | 0x0000000000000000000000000000000000000000000000000000000000000020 |\n // | 0x20:0x3f | size of e | 0x0000000000000000000000000000000000000000000000000000000000000020 |\n // | 0x40:0x5f | size of m | 0x0000000000000000000000000000000000000000000000000000000000000020 |\n // | 0x60:0x7f | value of b | 0x<.............................................................b> |\n // | 0x80:0x9f | value of e | 0x<.............................................................e> |\n // | 0xa0:0xbf | value of m | 0x<.............................................................m> |\n mstore(ptr, 0x20)\n mstore(add(ptr, 0x20), 0x20)\n mstore(add(ptr, 0x40), 0x20)\n mstore(add(ptr, 0x60), b)\n mstore(add(ptr, 0x80), e)\n mstore(add(ptr, 0xa0), m)\n\n // Given the result < m, it's guaranteed to fit in 32 bytes,\n // so we can use the memory scratch space located at offset 0.\n success := staticcall(gas(), 0x05, ptr, 0xc0, 0x00, 0x20)\n result := mload(0x00)\n }\n }\n\n /**\n * @dev Variant of {modExp} that supports inputs of arbitrary length.\n */\n function modExp(bytes memory b, bytes memory e, bytes memory m) internal view returns (bytes memory) {\n (bool success, bytes memory result) = tryModExp(b, e, m);\n if (!success) {\n Panic.panic(Panic.DIVISION_BY_ZERO);\n }\n return result;\n }\n\n /**\n * @dev Variant of {tryModExp} that supports inputs of arbitrary length.\n */\n function tryModExp(\n bytes memory b,\n bytes memory e,\n bytes memory m\n ) internal view returns (bool success, bytes memory result) {\n if (_zeroBytes(m)) return (false, new bytes(0));\n\n uint256 mLen = m.length;\n\n // Encode call args in result and move the free memory pointer\n result = abi.encodePacked(b.length, e.length, mLen, b, e, m);\n\n assembly (\"memory-safe\") {\n let dataPtr := add(result, 0x20)\n // Write result on top of args to avoid allocating extra memory.\n success := staticcall(gas(), 0x05, dataPtr, mload(result), dataPtr, mLen)\n // Overwrite the length.\n // result.length > returndatasize() is guaranteed because returndatasize() == m.length\n mstore(result, mLen)\n // Set the memory pointer after the returned data.\n mstore(0x40, add(dataPtr, mLen))\n }\n }\n\n /**\n * @dev Returns whether the provided byte array is zero.\n */\n function _zeroBytes(bytes memory byteArray) private pure returns (bool) {\n for (uint256 i = 0; i < byteArray.length; ++i) {\n if (byteArray[i] != 0) {\n return false;\n }\n }\n return true;\n }\n\n /**\n * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded\n * towards zero.\n *\n * This method is based on Newton's method for computing square roots; the algorithm is restricted to only\n * using integer operations.\n */\n function sqrt(uint256 a) internal pure returns (uint256) {\n unchecked {\n // Take care of easy edge cases when a == 0 or a == 1\n if (a <= 1) {\n return a;\n }\n\n // In this function, we use Newton's method to get a root of `f(x) := x² - a`. It involves building a\n // sequence x_n that converges toward sqrt(a). For each iteration x_n, we also define the error between\n // the current value as `ε_n = | x_n - sqrt(a) |`.\n //\n // For our first estimation, we consider `e` the smallest power of 2 which is bigger than the square root\n // of the target. (i.e. `2**(e-1) ≤ sqrt(a) < 2**e`). We know that `e ≤ 128` because `(2¹²⁸)² = 2²⁵⁶` is\n // bigger than any uint256.\n //\n // By noticing that\n // `2**(e-1) ≤ sqrt(a) < 2**e → (2**(e-1))² ≤ a < (2**e)² → 2**(2*e-2) ≤ a < 2**(2*e)`\n // we can deduce that `e - 1` is `log2(a) / 2`. We can thus compute `x_n = 2**(e-1)` using a method similar\n // to the msb function.\n uint256 aa = a;\n uint256 xn = 1;\n\n if (aa >= (1 << 128)) {\n aa >>= 128;\n xn <<= 64;\n }\n if (aa >= (1 << 64)) {\n aa >>= 64;\n xn <<= 32;\n }\n if (aa >= (1 << 32)) {\n aa >>= 32;\n xn <<= 16;\n }\n if (aa >= (1 << 16)) {\n aa >>= 16;\n xn <<= 8;\n }\n if (aa >= (1 << 8)) {\n aa >>= 8;\n xn <<= 4;\n }\n if (aa >= (1 << 4)) {\n aa >>= 4;\n xn <<= 2;\n }\n if (aa >= (1 << 2)) {\n xn <<= 1;\n }\n\n // We now have x_n such that `x_n = 2**(e-1) ≤ sqrt(a) < 2**e = 2 * x_n`. This implies ε_n ≤ 2**(e-1).\n //\n // We can refine our estimation by noticing that the middle of that interval minimizes the error.\n // If we move x_n to equal 2**(e-1) + 2**(e-2), then we reduce the error to ε_n ≤ 2**(e-2).\n // This is going to be our x_0 (and ε_0)\n xn = (3 * xn) >> 1; // ε_0 := | x_0 - sqrt(a) | ≤ 2**(e-2)\n\n // From here, Newton's method give us:\n // x_{n+1} = (x_n + a / x_n) / 2\n //\n // One should note that:\n // x_{n+1}² - a = ((x_n + a / x_n) / 2)² - a\n // = ((x_n² + a) / (2 * x_n))² - a\n // = (x_n⁴ + 2 * a * x_n² + a²) / (4 * x_n²) - a\n // = (x_n⁴ + 2 * a * x_n² + a² - 4 * a * x_n²) / (4 * x_n²)\n // = (x_n⁴ - 2 * a * x_n² + a²) / (4 * x_n²)\n // = (x_n² - a)² / (2 * x_n)²\n // = ((x_n² - a) / (2 * x_n))²\n // ≥ 0\n // Which proves that for all n ≥ 1, sqrt(a) ≤ x_n\n //\n // This gives us the proof of quadratic convergence of the sequence:\n // ε_{n+1} = | x_{n+1} - sqrt(a) |\n // = | (x_n + a / x_n) / 2 - sqrt(a) |\n // = | (x_n² + a - 2*x_n*sqrt(a)) / (2 * x_n) |\n // = | (x_n - sqrt(a))² / (2 * x_n) |\n // = | ε_n² / (2 * x_n) |\n // = ε_n² / | (2 * x_n) |\n //\n // For the first iteration, we have a special case where x_0 is known:\n // ε_1 = ε_0² / | (2 * x_0) |\n // ≤ (2**(e-2))² / (2 * (2**(e-1) + 2**(e-2)))\n // ≤ 2**(2*e-4) / (3 * 2**(e-1))\n // ≤ 2**(e-3) / 3\n // ≤ 2**(e-3-log2(3))\n // ≤ 2**(e-4.5)\n //\n // For the following iterations, we use the fact that, 2**(e-1) ≤ sqrt(a) ≤ x_n:\n // ε_{n+1} = ε_n² / | (2 * x_n) |\n // ≤ (2**(e-k))² / (2 * 2**(e-1))\n // ≤ 2**(2*e-2*k) / 2**e\n // ≤ 2**(e-2*k)\n xn = (xn + a / xn) >> 1; // ε_1 := | x_1 - sqrt(a) | ≤ 2**(e-4.5) -- special case, see above\n xn = (xn + a / xn) >> 1; // ε_2 := | x_2 - sqrt(a) | ≤ 2**(e-9) -- general case with k = 4.5\n xn = (xn + a / xn) >> 1; // ε_3 := | x_3 - sqrt(a) | ≤ 2**(e-18) -- general case with k = 9\n xn = (xn + a / xn) >> 1; // ε_4 := | x_4 - sqrt(a) | ≤ 2**(e-36) -- general case with k = 18\n xn = (xn + a / xn) >> 1; // ε_5 := | x_5 - sqrt(a) | ≤ 2**(e-72) -- general case with k = 36\n xn = (xn + a / xn) >> 1; // ε_6 := | x_6 - sqrt(a) | ≤ 2**(e-144) -- general case with k = 72\n\n // Because e ≤ 128 (as discussed during the first estimation phase), we know have reached a precision\n // ε_6 ≤ 2**(e-144) < 1. Given we're operating on integers, then we can ensure that xn is now either\n // sqrt(a) or sqrt(a) + 1.\n return xn - SafeCast.toUint(xn > a / xn);\n }\n }\n\n /**\n * @dev 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 + SafeCast.toUint(unsignedRoundsUp(rounding) && result * result < a);\n }\n }\n\n /**\n * @dev Return the log in base 2 of a positive value rounded towards zero.\n * Returns 0 if given 0.\n */\n function log2(uint256 value) internal pure returns (uint256) {\n uint256 result = 0;\n uint256 exp;\n unchecked {\n exp = 128 * SafeCast.toUint(value > (1 << 128) - 1);\n value >>= exp;\n result += exp;\n\n exp = 64 * SafeCast.toUint(value > (1 << 64) - 1);\n value >>= exp;\n result += exp;\n\n exp = 32 * SafeCast.toUint(value > (1 << 32) - 1);\n value >>= exp;\n result += exp;\n\n exp = 16 * SafeCast.toUint(value > (1 << 16) - 1);\n value >>= exp;\n result += exp;\n\n exp = 8 * SafeCast.toUint(value > (1 << 8) - 1);\n value >>= exp;\n result += exp;\n\n exp = 4 * SafeCast.toUint(value > (1 << 4) - 1);\n value >>= exp;\n result += exp;\n\n exp = 2 * SafeCast.toUint(value > (1 << 2) - 1);\n value >>= exp;\n result += exp;\n\n result += SafeCast.toUint(value > 1);\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 + SafeCast.toUint(unsignedRoundsUp(rounding) && 1 << result < value);\n }\n }\n\n /**\n * @dev Return the log in base 10 of a positive value rounded towards zero.\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 + SafeCast.toUint(unsignedRoundsUp(rounding) && 10 ** result < value);\n }\n }\n\n /**\n * @dev Return the log in base 256 of a positive value rounded towards zero.\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 uint256 isGt;\n unchecked {\n isGt = SafeCast.toUint(value > (1 << 128) - 1);\n value >>= isGt * 128;\n result += isGt * 16;\n\n isGt = SafeCast.toUint(value > (1 << 64) - 1);\n value >>= isGt * 64;\n result += isGt * 8;\n\n isGt = SafeCast.toUint(value > (1 << 32) - 1);\n value >>= isGt * 32;\n result += isGt * 4;\n\n isGt = SafeCast.toUint(value > (1 << 16) - 1);\n value >>= isGt * 16;\n result += isGt * 2;\n\n result += SafeCast.toUint(value > (1 << 8) - 1);\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 + SafeCast.toUint(unsignedRoundsUp(rounding) && 1 << (result << 3) < value);\n }\n }\n\n /**\n * @dev Returns whether a provided rounding mode is considered rounding up for unsigned integers.\n */\n function unsignedRoundsUp(Rounding rounding) internal pure returns (bool) {\n return uint8(rounding) % 2 == 1;\n }\n}\n" + }, + "@openzeppelin/contracts/utils/math/SafeCast.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/math/SafeCast.sol)\n// This file was procedurally generated from scripts/generate/templates/SafeCast.js.\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Wrappers over Solidity's uintXX/intXX/bool casting operators with added overflow\n * checks.\n *\n * Downcasting from uint256/int256 in Solidity does not revert on overflow. This can\n * easily result in undesired exploitation or bugs, since developers usually\n * assume that overflows raise errors. `SafeCast` restores this intuition by\n * reverting the transaction when such an operation overflows.\n *\n * Using this library instead of the unchecked operations eliminates an entire\n * class of bugs, so it's recommended to use it always.\n */\nlibrary SafeCast {\n /**\n * @dev Value doesn't fit in an uint of `bits` size.\n */\n error SafeCastOverflowedUintDowncast(uint8 bits, uint256 value);\n\n /**\n * @dev An int value doesn't fit in an uint of `bits` size.\n */\n error SafeCastOverflowedIntToUint(int256 value);\n\n /**\n * @dev Value doesn't fit in an int of `bits` size.\n */\n error SafeCastOverflowedIntDowncast(uint8 bits, int256 value);\n\n /**\n * @dev An uint value doesn't fit in an int of `bits` size.\n */\n error SafeCastOverflowedUintToInt(uint256 value);\n\n /**\n * @dev Returns the downcasted uint248 from uint256, reverting on\n * overflow (when the input is greater than largest uint248).\n *\n * Counterpart to Solidity's `uint248` operator.\n *\n * Requirements:\n *\n * - input must fit into 248 bits\n */\n function toUint248(uint256 value) internal pure returns (uint248) {\n if (value > type(uint248).max) {\n revert SafeCastOverflowedUintDowncast(248, value);\n }\n return uint248(value);\n }\n\n /**\n * @dev Returns the downcasted uint240 from uint256, reverting on\n * overflow (when the input is greater than largest uint240).\n *\n * Counterpart to Solidity's `uint240` operator.\n *\n * Requirements:\n *\n * - input must fit into 240 bits\n */\n function toUint240(uint256 value) internal pure returns (uint240) {\n if (value > type(uint240).max) {\n revert SafeCastOverflowedUintDowncast(240, value);\n }\n return uint240(value);\n }\n\n /**\n * @dev Returns the downcasted uint232 from uint256, reverting on\n * overflow (when the input is greater than largest uint232).\n *\n * Counterpart to Solidity's `uint232` operator.\n *\n * Requirements:\n *\n * - input must fit into 232 bits\n */\n function toUint232(uint256 value) internal pure returns (uint232) {\n if (value > type(uint232).max) {\n revert SafeCastOverflowedUintDowncast(232, value);\n }\n return uint232(value);\n }\n\n /**\n * @dev Returns the downcasted uint224 from uint256, reverting on\n * overflow (when the input is greater than largest uint224).\n *\n * Counterpart to Solidity's `uint224` operator.\n *\n * Requirements:\n *\n * - input must fit into 224 bits\n */\n function toUint224(uint256 value) internal pure returns (uint224) {\n if (value > type(uint224).max) {\n revert SafeCastOverflowedUintDowncast(224, value);\n }\n return uint224(value);\n }\n\n /**\n * @dev Returns the downcasted uint216 from uint256, reverting on\n * overflow (when the input is greater than largest uint216).\n *\n * Counterpart to Solidity's `uint216` operator.\n *\n * Requirements:\n *\n * - input must fit into 216 bits\n */\n function toUint216(uint256 value) internal pure returns (uint216) {\n if (value > type(uint216).max) {\n revert SafeCastOverflowedUintDowncast(216, value);\n }\n return uint216(value);\n }\n\n /**\n * @dev Returns the downcasted uint208 from uint256, reverting on\n * overflow (when the input is greater than largest uint208).\n *\n * Counterpart to Solidity's `uint208` operator.\n *\n * Requirements:\n *\n * - input must fit into 208 bits\n */\n function toUint208(uint256 value) internal pure returns (uint208) {\n if (value > type(uint208).max) {\n revert SafeCastOverflowedUintDowncast(208, value);\n }\n return uint208(value);\n }\n\n /**\n * @dev Returns the downcasted uint200 from uint256, reverting on\n * overflow (when the input is greater than largest uint200).\n *\n * Counterpart to Solidity's `uint200` operator.\n *\n * Requirements:\n *\n * - input must fit into 200 bits\n */\n function toUint200(uint256 value) internal pure returns (uint200) {\n if (value > type(uint200).max) {\n revert SafeCastOverflowedUintDowncast(200, value);\n }\n return uint200(value);\n }\n\n /**\n * @dev Returns the downcasted uint192 from uint256, reverting on\n * overflow (when the input is greater than largest uint192).\n *\n * Counterpart to Solidity's `uint192` operator.\n *\n * Requirements:\n *\n * - input must fit into 192 bits\n */\n function toUint192(uint256 value) internal pure returns (uint192) {\n if (value > type(uint192).max) {\n revert SafeCastOverflowedUintDowncast(192, value);\n }\n return uint192(value);\n }\n\n /**\n * @dev Returns the downcasted uint184 from uint256, reverting on\n * overflow (when the input is greater than largest uint184).\n *\n * Counterpart to Solidity's `uint184` operator.\n *\n * Requirements:\n *\n * - input must fit into 184 bits\n */\n function toUint184(uint256 value) internal pure returns (uint184) {\n if (value > type(uint184).max) {\n revert SafeCastOverflowedUintDowncast(184, value);\n }\n return uint184(value);\n }\n\n /**\n * @dev Returns the downcasted uint176 from uint256, reverting on\n * overflow (when the input is greater than largest uint176).\n *\n * Counterpart to Solidity's `uint176` operator.\n *\n * Requirements:\n *\n * - input must fit into 176 bits\n */\n function toUint176(uint256 value) internal pure returns (uint176) {\n if (value > type(uint176).max) {\n revert SafeCastOverflowedUintDowncast(176, value);\n }\n return uint176(value);\n }\n\n /**\n * @dev Returns the downcasted uint168 from uint256, reverting on\n * overflow (when the input is greater than largest uint168).\n *\n * Counterpart to Solidity's `uint168` operator.\n *\n * Requirements:\n *\n * - input must fit into 168 bits\n */\n function toUint168(uint256 value) internal pure returns (uint168) {\n if (value > type(uint168).max) {\n revert SafeCastOverflowedUintDowncast(168, value);\n }\n return uint168(value);\n }\n\n /**\n * @dev Returns the downcasted uint160 from uint256, reverting on\n * overflow (when the input is greater than largest uint160).\n *\n * Counterpart to Solidity's `uint160` operator.\n *\n * Requirements:\n *\n * - input must fit into 160 bits\n */\n function toUint160(uint256 value) internal pure returns (uint160) {\n if (value > type(uint160).max) {\n revert SafeCastOverflowedUintDowncast(160, value);\n }\n return uint160(value);\n }\n\n /**\n * @dev Returns the downcasted uint152 from uint256, reverting on\n * overflow (when the input is greater than largest uint152).\n *\n * Counterpart to Solidity's `uint152` operator.\n *\n * Requirements:\n *\n * - input must fit into 152 bits\n */\n function toUint152(uint256 value) internal pure returns (uint152) {\n if (value > type(uint152).max) {\n revert SafeCastOverflowedUintDowncast(152, value);\n }\n return uint152(value);\n }\n\n /**\n * @dev Returns the downcasted uint144 from uint256, reverting on\n * overflow (when the input is greater than largest uint144).\n *\n * Counterpart to Solidity's `uint144` operator.\n *\n * Requirements:\n *\n * - input must fit into 144 bits\n */\n function toUint144(uint256 value) internal pure returns (uint144) {\n if (value > type(uint144).max) {\n revert SafeCastOverflowedUintDowncast(144, value);\n }\n return uint144(value);\n }\n\n /**\n * @dev Returns the downcasted uint136 from uint256, reverting on\n * overflow (when the input is greater than largest uint136).\n *\n * Counterpart to Solidity's `uint136` operator.\n *\n * Requirements:\n *\n * - input must fit into 136 bits\n */\n function toUint136(uint256 value) internal pure returns (uint136) {\n if (value > type(uint136).max) {\n revert SafeCastOverflowedUintDowncast(136, value);\n }\n return uint136(value);\n }\n\n /**\n * @dev Returns the downcasted uint128 from uint256, reverting on\n * overflow (when the input is greater than largest uint128).\n *\n * Counterpart to Solidity's `uint128` operator.\n *\n * Requirements:\n *\n * - input must fit into 128 bits\n */\n function toUint128(uint256 value) internal pure returns (uint128) {\n if (value > type(uint128).max) {\n revert SafeCastOverflowedUintDowncast(128, value);\n }\n return uint128(value);\n }\n\n /**\n * @dev Returns the downcasted uint120 from uint256, reverting on\n * overflow (when the input is greater than largest uint120).\n *\n * Counterpart to Solidity's `uint120` operator.\n *\n * Requirements:\n *\n * - input must fit into 120 bits\n */\n function toUint120(uint256 value) internal pure returns (uint120) {\n if (value > type(uint120).max) {\n revert SafeCastOverflowedUintDowncast(120, value);\n }\n return uint120(value);\n }\n\n /**\n * @dev Returns the downcasted uint112 from uint256, reverting on\n * overflow (when the input is greater than largest uint112).\n *\n * Counterpart to Solidity's `uint112` operator.\n *\n * Requirements:\n *\n * - input must fit into 112 bits\n */\n function toUint112(uint256 value) internal pure returns (uint112) {\n if (value > type(uint112).max) {\n revert SafeCastOverflowedUintDowncast(112, value);\n }\n return uint112(value);\n }\n\n /**\n * @dev Returns the downcasted uint104 from uint256, reverting on\n * overflow (when the input is greater than largest uint104).\n *\n * Counterpart to Solidity's `uint104` operator.\n *\n * Requirements:\n *\n * - input must fit into 104 bits\n */\n function toUint104(uint256 value) internal pure returns (uint104) {\n if (value > type(uint104).max) {\n revert SafeCastOverflowedUintDowncast(104, value);\n }\n return uint104(value);\n }\n\n /**\n * @dev Returns the downcasted uint96 from uint256, reverting on\n * overflow (when the input is greater than largest uint96).\n *\n * Counterpart to Solidity's `uint96` operator.\n *\n * Requirements:\n *\n * - input must fit into 96 bits\n */\n function toUint96(uint256 value) internal pure returns (uint96) {\n if (value > type(uint96).max) {\n revert SafeCastOverflowedUintDowncast(96, value);\n }\n return uint96(value);\n }\n\n /**\n * @dev Returns the downcasted uint88 from uint256, reverting on\n * overflow (when the input is greater than largest uint88).\n *\n * Counterpart to Solidity's `uint88` operator.\n *\n * Requirements:\n *\n * - input must fit into 88 bits\n */\n function toUint88(uint256 value) internal pure returns (uint88) {\n if (value > type(uint88).max) {\n revert SafeCastOverflowedUintDowncast(88, value);\n }\n return uint88(value);\n }\n\n /**\n * @dev Returns the downcasted uint80 from uint256, reverting on\n * overflow (when the input is greater than largest uint80).\n *\n * Counterpart to Solidity's `uint80` operator.\n *\n * Requirements:\n *\n * - input must fit into 80 bits\n */\n function toUint80(uint256 value) internal pure returns (uint80) {\n if (value > type(uint80).max) {\n revert SafeCastOverflowedUintDowncast(80, value);\n }\n return uint80(value);\n }\n\n /**\n * @dev Returns the downcasted uint72 from uint256, reverting on\n * overflow (when the input is greater than largest uint72).\n *\n * Counterpart to Solidity's `uint72` operator.\n *\n * Requirements:\n *\n * - input must fit into 72 bits\n */\n function toUint72(uint256 value) internal pure returns (uint72) {\n if (value > type(uint72).max) {\n revert SafeCastOverflowedUintDowncast(72, value);\n }\n return uint72(value);\n }\n\n /**\n * @dev Returns the downcasted uint64 from uint256, reverting on\n * overflow (when the input is greater than largest uint64).\n *\n * Counterpart to Solidity's `uint64` operator.\n *\n * Requirements:\n *\n * - input must fit into 64 bits\n */\n function toUint64(uint256 value) internal pure returns (uint64) {\n if (value > type(uint64).max) {\n revert SafeCastOverflowedUintDowncast(64, value);\n }\n return uint64(value);\n }\n\n /**\n * @dev Returns the downcasted uint56 from uint256, reverting on\n * overflow (when the input is greater than largest uint56).\n *\n * Counterpart to Solidity's `uint56` operator.\n *\n * Requirements:\n *\n * - input must fit into 56 bits\n */\n function toUint56(uint256 value) internal pure returns (uint56) {\n if (value > type(uint56).max) {\n revert SafeCastOverflowedUintDowncast(56, value);\n }\n return uint56(value);\n }\n\n /**\n * @dev Returns the downcasted uint48 from uint256, reverting on\n * overflow (when the input is greater than largest uint48).\n *\n * Counterpart to Solidity's `uint48` operator.\n *\n * Requirements:\n *\n * - input must fit into 48 bits\n */\n function toUint48(uint256 value) internal pure returns (uint48) {\n if (value > type(uint48).max) {\n revert SafeCastOverflowedUintDowncast(48, value);\n }\n return uint48(value);\n }\n\n /**\n * @dev Returns the downcasted uint40 from uint256, reverting on\n * overflow (when the input is greater than largest uint40).\n *\n * Counterpart to Solidity's `uint40` operator.\n *\n * Requirements:\n *\n * - input must fit into 40 bits\n */\n function toUint40(uint256 value) internal pure returns (uint40) {\n if (value > type(uint40).max) {\n revert SafeCastOverflowedUintDowncast(40, value);\n }\n return uint40(value);\n }\n\n /**\n * @dev Returns the downcasted uint32 from uint256, reverting on\n * overflow (when the input is greater than largest uint32).\n *\n * Counterpart to Solidity's `uint32` operator.\n *\n * Requirements:\n *\n * - input must fit into 32 bits\n */\n function toUint32(uint256 value) internal pure returns (uint32) {\n if (value > type(uint32).max) {\n revert SafeCastOverflowedUintDowncast(32, value);\n }\n return uint32(value);\n }\n\n /**\n * @dev Returns the downcasted uint24 from uint256, reverting on\n * overflow (when the input is greater than largest uint24).\n *\n * Counterpart to Solidity's `uint24` operator.\n *\n * Requirements:\n *\n * - input must fit into 24 bits\n */\n function toUint24(uint256 value) internal pure returns (uint24) {\n if (value > type(uint24).max) {\n revert SafeCastOverflowedUintDowncast(24, value);\n }\n return uint24(value);\n }\n\n /**\n * @dev Returns the downcasted uint16 from uint256, reverting on\n * overflow (when the input is greater than largest uint16).\n *\n * Counterpart to Solidity's `uint16` operator.\n *\n * Requirements:\n *\n * - input must fit into 16 bits\n */\n function toUint16(uint256 value) internal pure returns (uint16) {\n if (value > type(uint16).max) {\n revert SafeCastOverflowedUintDowncast(16, value);\n }\n return uint16(value);\n }\n\n /**\n * @dev Returns the downcasted uint8 from uint256, reverting on\n * overflow (when the input is greater than largest uint8).\n *\n * Counterpart to Solidity's `uint8` operator.\n *\n * Requirements:\n *\n * - input must fit into 8 bits\n */\n function toUint8(uint256 value) internal pure returns (uint8) {\n if (value > type(uint8).max) {\n revert SafeCastOverflowedUintDowncast(8, value);\n }\n return uint8(value);\n }\n\n /**\n * @dev Converts a signed int256 into an unsigned uint256.\n *\n * Requirements:\n *\n * - input must be greater than or equal to 0.\n */\n function toUint256(int256 value) internal pure returns (uint256) {\n if (value < 0) {\n revert SafeCastOverflowedIntToUint(value);\n }\n return uint256(value);\n }\n\n /**\n * @dev Returns the downcasted int248 from int256, reverting on\n * overflow (when the input is less than smallest int248 or\n * greater than largest int248).\n *\n * Counterpart to Solidity's `int248` operator.\n *\n * Requirements:\n *\n * - input must fit into 248 bits\n */\n function toInt248(int256 value) internal pure returns (int248 downcasted) {\n downcasted = int248(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(248, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int240 from int256, reverting on\n * overflow (when the input is less than smallest int240 or\n * greater than largest int240).\n *\n * Counterpart to Solidity's `int240` operator.\n *\n * Requirements:\n *\n * - input must fit into 240 bits\n */\n function toInt240(int256 value) internal pure returns (int240 downcasted) {\n downcasted = int240(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(240, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int232 from int256, reverting on\n * overflow (when the input is less than smallest int232 or\n * greater than largest int232).\n *\n * Counterpart to Solidity's `int232` operator.\n *\n * Requirements:\n *\n * - input must fit into 232 bits\n */\n function toInt232(int256 value) internal pure returns (int232 downcasted) {\n downcasted = int232(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(232, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int224 from int256, reverting on\n * overflow (when the input is less than smallest int224 or\n * greater than largest int224).\n *\n * Counterpart to Solidity's `int224` operator.\n *\n * Requirements:\n *\n * - input must fit into 224 bits\n */\n function toInt224(int256 value) internal pure returns (int224 downcasted) {\n downcasted = int224(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(224, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int216 from int256, reverting on\n * overflow (when the input is less than smallest int216 or\n * greater than largest int216).\n *\n * Counterpart to Solidity's `int216` operator.\n *\n * Requirements:\n *\n * - input must fit into 216 bits\n */\n function toInt216(int256 value) internal pure returns (int216 downcasted) {\n downcasted = int216(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(216, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int208 from int256, reverting on\n * overflow (when the input is less than smallest int208 or\n * greater than largest int208).\n *\n * Counterpart to Solidity's `int208` operator.\n *\n * Requirements:\n *\n * - input must fit into 208 bits\n */\n function toInt208(int256 value) internal pure returns (int208 downcasted) {\n downcasted = int208(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(208, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int200 from int256, reverting on\n * overflow (when the input is less than smallest int200 or\n * greater than largest int200).\n *\n * Counterpart to Solidity's `int200` operator.\n *\n * Requirements:\n *\n * - input must fit into 200 bits\n */\n function toInt200(int256 value) internal pure returns (int200 downcasted) {\n downcasted = int200(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(200, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int192 from int256, reverting on\n * overflow (when the input is less than smallest int192 or\n * greater than largest int192).\n *\n * Counterpart to Solidity's `int192` operator.\n *\n * Requirements:\n *\n * - input must fit into 192 bits\n */\n function toInt192(int256 value) internal pure returns (int192 downcasted) {\n downcasted = int192(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(192, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int184 from int256, reverting on\n * overflow (when the input is less than smallest int184 or\n * greater than largest int184).\n *\n * Counterpart to Solidity's `int184` operator.\n *\n * Requirements:\n *\n * - input must fit into 184 bits\n */\n function toInt184(int256 value) internal pure returns (int184 downcasted) {\n downcasted = int184(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(184, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int176 from int256, reverting on\n * overflow (when the input is less than smallest int176 or\n * greater than largest int176).\n *\n * Counterpart to Solidity's `int176` operator.\n *\n * Requirements:\n *\n * - input must fit into 176 bits\n */\n function toInt176(int256 value) internal pure returns (int176 downcasted) {\n downcasted = int176(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(176, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int168 from int256, reverting on\n * overflow (when the input is less than smallest int168 or\n * greater than largest int168).\n *\n * Counterpart to Solidity's `int168` operator.\n *\n * Requirements:\n *\n * - input must fit into 168 bits\n */\n function toInt168(int256 value) internal pure returns (int168 downcasted) {\n downcasted = int168(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(168, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int160 from int256, reverting on\n * overflow (when the input is less than smallest int160 or\n * greater than largest int160).\n *\n * Counterpart to Solidity's `int160` operator.\n *\n * Requirements:\n *\n * - input must fit into 160 bits\n */\n function toInt160(int256 value) internal pure returns (int160 downcasted) {\n downcasted = int160(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(160, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int152 from int256, reverting on\n * overflow (when the input is less than smallest int152 or\n * greater than largest int152).\n *\n * Counterpart to Solidity's `int152` operator.\n *\n * Requirements:\n *\n * - input must fit into 152 bits\n */\n function toInt152(int256 value) internal pure returns (int152 downcasted) {\n downcasted = int152(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(152, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int144 from int256, reverting on\n * overflow (when the input is less than smallest int144 or\n * greater than largest int144).\n *\n * Counterpart to Solidity's `int144` operator.\n *\n * Requirements:\n *\n * - input must fit into 144 bits\n */\n function toInt144(int256 value) internal pure returns (int144 downcasted) {\n downcasted = int144(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(144, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int136 from int256, reverting on\n * overflow (when the input is less than smallest int136 or\n * greater than largest int136).\n *\n * Counterpart to Solidity's `int136` operator.\n *\n * Requirements:\n *\n * - input must fit into 136 bits\n */\n function toInt136(int256 value) internal pure returns (int136 downcasted) {\n downcasted = int136(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(136, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int128 from int256, reverting on\n * overflow (when the input is less than smallest int128 or\n * greater than largest int128).\n *\n * Counterpart to Solidity's `int128` operator.\n *\n * Requirements:\n *\n * - input must fit into 128 bits\n */\n function toInt128(int256 value) internal pure returns (int128 downcasted) {\n downcasted = int128(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(128, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int120 from int256, reverting on\n * overflow (when the input is less than smallest int120 or\n * greater than largest int120).\n *\n * Counterpart to Solidity's `int120` operator.\n *\n * Requirements:\n *\n * - input must fit into 120 bits\n */\n function toInt120(int256 value) internal pure returns (int120 downcasted) {\n downcasted = int120(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(120, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int112 from int256, reverting on\n * overflow (when the input is less than smallest int112 or\n * greater than largest int112).\n *\n * Counterpart to Solidity's `int112` operator.\n *\n * Requirements:\n *\n * - input must fit into 112 bits\n */\n function toInt112(int256 value) internal pure returns (int112 downcasted) {\n downcasted = int112(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(112, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int104 from int256, reverting on\n * overflow (when the input is less than smallest int104 or\n * greater than largest int104).\n *\n * Counterpart to Solidity's `int104` operator.\n *\n * Requirements:\n *\n * - input must fit into 104 bits\n */\n function toInt104(int256 value) internal pure returns (int104 downcasted) {\n downcasted = int104(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(104, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int96 from int256, reverting on\n * overflow (when the input is less than smallest int96 or\n * greater than largest int96).\n *\n * Counterpart to Solidity's `int96` operator.\n *\n * Requirements:\n *\n * - input must fit into 96 bits\n */\n function toInt96(int256 value) internal pure returns (int96 downcasted) {\n downcasted = int96(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(96, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int88 from int256, reverting on\n * overflow (when the input is less than smallest int88 or\n * greater than largest int88).\n *\n * Counterpart to Solidity's `int88` operator.\n *\n * Requirements:\n *\n * - input must fit into 88 bits\n */\n function toInt88(int256 value) internal pure returns (int88 downcasted) {\n downcasted = int88(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(88, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int80 from int256, reverting on\n * overflow (when the input is less than smallest int80 or\n * greater than largest int80).\n *\n * Counterpart to Solidity's `int80` operator.\n *\n * Requirements:\n *\n * - input must fit into 80 bits\n */\n function toInt80(int256 value) internal pure returns (int80 downcasted) {\n downcasted = int80(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(80, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int72 from int256, reverting on\n * overflow (when the input is less than smallest int72 or\n * greater than largest int72).\n *\n * Counterpart to Solidity's `int72` operator.\n *\n * Requirements:\n *\n * - input must fit into 72 bits\n */\n function toInt72(int256 value) internal pure returns (int72 downcasted) {\n downcasted = int72(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(72, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int64 from int256, reverting on\n * overflow (when the input is less than smallest int64 or\n * greater than largest int64).\n *\n * Counterpart to Solidity's `int64` operator.\n *\n * Requirements:\n *\n * - input must fit into 64 bits\n */\n function toInt64(int256 value) internal pure returns (int64 downcasted) {\n downcasted = int64(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(64, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int56 from int256, reverting on\n * overflow (when the input is less than smallest int56 or\n * greater than largest int56).\n *\n * Counterpart to Solidity's `int56` operator.\n *\n * Requirements:\n *\n * - input must fit into 56 bits\n */\n function toInt56(int256 value) internal pure returns (int56 downcasted) {\n downcasted = int56(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(56, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int48 from int256, reverting on\n * overflow (when the input is less than smallest int48 or\n * greater than largest int48).\n *\n * Counterpart to Solidity's `int48` operator.\n *\n * Requirements:\n *\n * - input must fit into 48 bits\n */\n function toInt48(int256 value) internal pure returns (int48 downcasted) {\n downcasted = int48(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(48, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int40 from int256, reverting on\n * overflow (when the input is less than smallest int40 or\n * greater than largest int40).\n *\n * Counterpart to Solidity's `int40` operator.\n *\n * Requirements:\n *\n * - input must fit into 40 bits\n */\n function toInt40(int256 value) internal pure returns (int40 downcasted) {\n downcasted = int40(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(40, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int32 from int256, reverting on\n * overflow (when the input is less than smallest int32 or\n * greater than largest int32).\n *\n * Counterpart to Solidity's `int32` operator.\n *\n * Requirements:\n *\n * - input must fit into 32 bits\n */\n function toInt32(int256 value) internal pure returns (int32 downcasted) {\n downcasted = int32(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(32, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int24 from int256, reverting on\n * overflow (when the input is less than smallest int24 or\n * greater than largest int24).\n *\n * Counterpart to Solidity's `int24` operator.\n *\n * Requirements:\n *\n * - input must fit into 24 bits\n */\n function toInt24(int256 value) internal pure returns (int24 downcasted) {\n downcasted = int24(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(24, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int16 from int256, reverting on\n * overflow (when the input is less than smallest int16 or\n * greater than largest int16).\n *\n * Counterpart to Solidity's `int16` operator.\n *\n * Requirements:\n *\n * - input must fit into 16 bits\n */\n function toInt16(int256 value) internal pure returns (int16 downcasted) {\n downcasted = int16(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(16, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int8 from int256, reverting on\n * overflow (when the input is less than smallest int8 or\n * greater than largest int8).\n *\n * Counterpart to Solidity's `int8` operator.\n *\n * Requirements:\n *\n * - input must fit into 8 bits\n */\n function toInt8(int256 value) internal pure returns (int8 downcasted) {\n downcasted = int8(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(8, value);\n }\n }\n\n /**\n * @dev Converts an unsigned uint256 into a signed int256.\n *\n * Requirements:\n *\n * - input must be less than or equal to maxInt256.\n */\n function toInt256(uint256 value) internal pure returns (int256) {\n // Note: Unsafe cast below is okay because `type(int256).max` is guaranteed to be positive\n if (value > uint256(type(int256).max)) {\n revert SafeCastOverflowedUintToInt(value);\n }\n return int256(value);\n }\n\n /**\n * @dev Cast a boolean (false or true) to a uint256 (0 or 1) with no jump.\n */\n function toUint(bool b) internal pure returns (uint256 u) {\n assembly (\"memory-safe\") {\n u := iszero(iszero(b))\n }\n }\n}\n" + }, + "@openzeppelin/contracts/utils/math/SignedMath.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/math/SignedMath.sol)\n\npragma solidity ^0.8.20;\n\nimport {SafeCast} from \"./SafeCast.sol\";\n\n/**\n * @dev Standard signed math utilities missing in the Solidity language.\n */\nlibrary SignedMath {\n /**\n * @dev Branchless ternary evaluation for `a ? b : c`. Gas costs are constant.\n *\n * IMPORTANT: This function may reduce bytecode size and consume less gas when used standalone.\n * However, the compiler may optimize Solidity ternary operations (i.e. `a ? b : c`) to only compute\n * one branch when needed, making this function more expensive.\n */\n function ternary(bool condition, int256 a, int256 b) internal pure returns (int256) {\n unchecked {\n // branchless ternary works because:\n // b ^ (a ^ b) == a\n // b ^ 0 == b\n return b ^ ((a ^ b) * int256(SafeCast.toUint(condition)));\n }\n }\n\n /**\n * @dev Returns the largest of two signed numbers.\n */\n function max(int256 a, int256 b) internal pure returns (int256) {\n return ternary(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 ternary(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 // Formula from the \"Bit Twiddling Hacks\" by Sean Eron Anderson.\n // Since `n` is a signed integer, the generated bytecode will use the SAR opcode to perform the right shift,\n // taking advantage of the most significant (or \"sign\" bit) in two's complement representation.\n // This opcode adds new most significant bits set to the value of the previous most significant bit. As a result,\n // the mask will either be `bytes32(0)` (if n is positive) or `~bytes32(0)` (if n is negative).\n int256 mask = n >> 255;\n\n // A `bytes32(0)` mask leaves the input unchanged, while a `~bytes32(0)` mask complements it.\n return uint256((n + mask) ^ mask);\n }\n }\n}\n" + }, + "@openzeppelin/contracts/utils/Nonces.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/Nonces.sol)\npragma solidity ^0.8.20;\n\n/**\n * @dev Provides tracking nonces for addresses. Nonces will only increment.\n */\nabstract contract Nonces {\n /**\n * @dev The nonce used for an `account` is not the expected current nonce.\n */\n error InvalidAccountNonce(address account, uint256 currentNonce);\n\n mapping(address account => uint256) private _nonces;\n\n /**\n * @dev Returns the next unused nonce for an address.\n */\n function nonces(address owner) public view virtual returns (uint256) {\n return _nonces[owner];\n }\n\n /**\n * @dev Consumes a nonce.\n *\n * Returns the current value and increments nonce.\n */\n function _useNonce(address owner) internal virtual returns (uint256) {\n // For each account, the nonce has an initial value of 0, can only be incremented by one, and cannot be\n // decremented or reset. This guarantees that the nonce never overflows.\n unchecked {\n // It is important to do x++ and not ++x here.\n return _nonces[owner]++;\n }\n }\n\n /**\n * @dev Same as {_useNonce} but checking that `nonce` is the next valid for `owner`.\n */\n function _useCheckedNonce(address owner, uint256 nonce) internal virtual {\n uint256 current = _useNonce(owner);\n if (nonce != current) {\n revert InvalidAccountNonce(owner, current);\n }\n }\n}\n" + }, + "@openzeppelin/contracts/utils/Panic.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/Panic.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Helper library for emitting standardized panic codes.\n *\n * ```solidity\n * contract Example {\n * using Panic for uint256;\n *\n * // Use any of the declared internal constants\n * function foo() { Panic.GENERIC.panic(); }\n *\n * // Alternatively\n * function foo() { Panic.panic(Panic.GENERIC); }\n * }\n * ```\n *\n * Follows the list from https://github.com/ethereum/solidity/blob/v0.8.24/libsolutil/ErrorCodes.h[libsolutil].\n *\n * _Available since v5.1._\n */\n// slither-disable-next-line unused-state\nlibrary Panic {\n /// @dev generic / unspecified error\n uint256 internal constant GENERIC = 0x00;\n /// @dev used by the assert() builtin\n uint256 internal constant ASSERT = 0x01;\n /// @dev arithmetic underflow or overflow\n uint256 internal constant UNDER_OVERFLOW = 0x11;\n /// @dev division or modulo by zero\n uint256 internal constant DIVISION_BY_ZERO = 0x12;\n /// @dev enum conversion error\n uint256 internal constant ENUM_CONVERSION_ERROR = 0x21;\n /// @dev invalid encoding in storage\n uint256 internal constant STORAGE_ENCODING_ERROR = 0x22;\n /// @dev empty array pop\n uint256 internal constant EMPTY_ARRAY_POP = 0x31;\n /// @dev array out of bounds access\n uint256 internal constant ARRAY_OUT_OF_BOUNDS = 0x32;\n /// @dev resource error (too large allocation or too large array)\n uint256 internal constant RESOURCE_ERROR = 0x41;\n /// @dev calling invalid internal function\n uint256 internal constant INVALID_INTERNAL_FUNCTION = 0x51;\n\n /// @dev Reverts with a panic code. Recommended to use with\n /// the internal constants with predefined codes.\n function panic(uint256 code) internal pure {\n assembly (\"memory-safe\") {\n mstore(0x00, 0x4e487b71)\n mstore(0x20, code)\n revert(0x1c, 0x24)\n }\n }\n}\n" + }, + "@openzeppelin/contracts/utils/ShortStrings.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/ShortStrings.sol)\n\npragma solidity ^0.8.20;\n\nimport {StorageSlot} from \"./StorageSlot.sol\";\n\n// | string | 0xAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA |\n// | length | 0x BB |\ntype ShortString is bytes32;\n\n/**\n * @dev This library provides functions to convert short memory strings\n * into a `ShortString` type that can be used as an immutable variable.\n *\n * Strings of arbitrary length can be optimized using this library if\n * they are short enough (up to 31 bytes) by packing them with their\n * length (1 byte) in a single EVM word (32 bytes). Additionally, a\n * fallback mechanism can be used for every other case.\n *\n * Usage example:\n *\n * ```solidity\n * contract Named {\n * using ShortStrings for *;\n *\n * ShortString private immutable _name;\n * string private _nameFallback;\n *\n * constructor(string memory contractName) {\n * _name = contractName.toShortStringWithFallback(_nameFallback);\n * }\n *\n * function name() external view returns (string memory) {\n * return _name.toStringWithFallback(_nameFallback);\n * }\n * }\n * ```\n */\nlibrary ShortStrings {\n // Used as an identifier for strings longer than 31 bytes.\n bytes32 private constant FALLBACK_SENTINEL = 0x00000000000000000000000000000000000000000000000000000000000000FF;\n\n error StringTooLong(string str);\n error InvalidShortString();\n\n /**\n * @dev Encode a string of at most 31 chars into a `ShortString`.\n *\n * This will trigger a `StringTooLong` error is the input string is too long.\n */\n function toShortString(string memory str) internal pure returns (ShortString) {\n bytes memory bstr = bytes(str);\n if (bstr.length > 31) {\n revert StringTooLong(str);\n }\n return ShortString.wrap(bytes32(uint256(bytes32(bstr)) | bstr.length));\n }\n\n /**\n * @dev Decode a `ShortString` back to a \"normal\" string.\n */\n function toString(ShortString sstr) internal pure returns (string memory) {\n uint256 len = byteLength(sstr);\n // using `new string(len)` would work locally but is not memory safe.\n string memory str = new string(32);\n assembly (\"memory-safe\") {\n mstore(str, len)\n mstore(add(str, 0x20), sstr)\n }\n return str;\n }\n\n /**\n * @dev Return the length of a `ShortString`.\n */\n function byteLength(ShortString sstr) internal pure returns (uint256) {\n uint256 result = uint256(ShortString.unwrap(sstr)) & 0xFF;\n if (result > 31) {\n revert InvalidShortString();\n }\n return result;\n }\n\n /**\n * @dev Encode a string into a `ShortString`, or write it to storage if it is too long.\n */\n function toShortStringWithFallback(string memory value, string storage store) internal returns (ShortString) {\n if (bytes(value).length < 32) {\n return toShortString(value);\n } else {\n StorageSlot.getStringSlot(store).value = value;\n return ShortString.wrap(FALLBACK_SENTINEL);\n }\n }\n\n /**\n * @dev Decode a string that was encoded to `ShortString` or written to storage using {setWithFallback}.\n */\n function toStringWithFallback(ShortString value, string storage store) internal pure returns (string memory) {\n if (ShortString.unwrap(value) != FALLBACK_SENTINEL) {\n return toString(value);\n } else {\n return store;\n }\n }\n\n /**\n * @dev Return the length of a string that was encoded to `ShortString` or written to storage using\n * {setWithFallback}.\n *\n * WARNING: This will return the \"byte length\" of the string. This may not reflect the actual length in terms of\n * actual characters as the UTF-8 encoding of a single character can span over multiple bytes.\n */\n function byteLengthWithFallback(ShortString value, string storage store) internal view returns (uint256) {\n if (ShortString.unwrap(value) != FALLBACK_SENTINEL) {\n return byteLength(value);\n } else {\n return bytes(store).length;\n }\n }\n}\n" + }, + "@openzeppelin/contracts/utils/StorageSlot.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/StorageSlot.sol)\n// This file was procedurally generated from scripts/generate/templates/StorageSlot.js.\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Library for reading and writing primitive types to specific storage slots.\n *\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\n * This library helps with reading and writing to such slots without the need for inline assembly.\n *\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\n *\n * Example usage to set ERC-1967 implementation slot:\n * ```solidity\n * contract ERC1967 {\n * // Define the slot. Alternatively, use the SlotDerivation library to derive the slot.\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\n *\n * function _getImplementation() internal view returns (address) {\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\n * }\n *\n * function _setImplementation(address newImplementation) internal {\n * require(newImplementation.code.length > 0);\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\n * }\n * }\n * ```\n *\n * TIP: Consider using this library along with {SlotDerivation}.\n */\nlibrary StorageSlot {\n struct AddressSlot {\n address value;\n }\n\n struct BooleanSlot {\n bool value;\n }\n\n struct Bytes32Slot {\n bytes32 value;\n }\n\n struct Uint256Slot {\n uint256 value;\n }\n\n struct Int256Slot {\n int256 value;\n }\n\n struct StringSlot {\n string value;\n }\n\n struct BytesSlot {\n bytes value;\n }\n\n /**\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\n */\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\n assembly (\"memory-safe\") {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns a `BooleanSlot` with member `value` located at `slot`.\n */\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\n assembly (\"memory-safe\") {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns a `Bytes32Slot` with member `value` located at `slot`.\n */\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\n assembly (\"memory-safe\") {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns a `Uint256Slot` with member `value` located at `slot`.\n */\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\n assembly (\"memory-safe\") {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns a `Int256Slot` with member `value` located at `slot`.\n */\n function getInt256Slot(bytes32 slot) internal pure returns (Int256Slot storage r) {\n assembly (\"memory-safe\") {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns a `StringSlot` with member `value` located at `slot`.\n */\n function getStringSlot(bytes32 slot) internal pure returns (StringSlot storage r) {\n assembly (\"memory-safe\") {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `StringSlot` representation of the string storage pointer `store`.\n */\n function getStringSlot(string storage store) internal pure returns (StringSlot storage r) {\n assembly (\"memory-safe\") {\n r.slot := store.slot\n }\n }\n\n /**\n * @dev Returns a `BytesSlot` with member `value` located at `slot`.\n */\n function getBytesSlot(bytes32 slot) internal pure returns (BytesSlot storage r) {\n assembly (\"memory-safe\") {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `BytesSlot` representation of the bytes storage pointer `store`.\n */\n function getBytesSlot(bytes storage store) internal pure returns (BytesSlot storage r) {\n assembly (\"memory-safe\") {\n r.slot := store.slot\n }\n }\n}\n" + }, + "@openzeppelin/contracts/utils/Strings.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/Strings.sol)\n\npragma solidity ^0.8.20;\n\nimport {Math} from \"./math/Math.sol\";\nimport {SignedMath} from \"./math/SignedMath.sol\";\n\n/**\n * @dev String operations.\n */\nlibrary Strings {\n bytes16 private constant HEX_DIGITS = \"0123456789abcdef\";\n uint8 private constant ADDRESS_LENGTH = 20;\n\n /**\n * @dev The `value` string doesn't fit in the specified `length`.\n */\n error StringsInsufficientHexLength(uint256 value, uint256 length);\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 assembly (\"memory-safe\") {\n ptr := add(buffer, add(32, length))\n }\n while (true) {\n ptr--;\n assembly (\"memory-safe\") {\n mstore8(ptr, byte(mod(value, 10), HEX_DIGITS))\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 toStringSigned(int256 value) internal pure returns (string memory) {\n return string.concat(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 uint256 localValue = value;\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] = HEX_DIGITS[localValue & 0xf];\n localValue >>= 4;\n }\n if (localValue != 0) {\n revert StringsInsufficientHexLength(value, length);\n }\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\n * 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 Converts an `address` with fixed length of 20 bytes to its checksummed ASCII `string` hexadecimal\n * representation, according to EIP-55.\n */\n function toChecksumHexString(address addr) internal pure returns (string memory) {\n bytes memory buffer = bytes(toHexString(addr));\n\n // hash the hex part of buffer (skip length + 2 bytes, length 40)\n uint256 hashValue;\n assembly (\"memory-safe\") {\n hashValue := shr(96, keccak256(add(buffer, 0x22), 40))\n }\n\n for (uint256 i = 41; i > 1; --i) {\n // possible values for buffer[i] are 48 (0) to 57 (9) and 97 (a) to 102 (f)\n if (hashValue & 0xf > 7 && uint8(buffer[i]) > 96) {\n // case shift by xoring with 0x20\n buffer[i] ^= 0x20;\n }\n hashValue >>= 4;\n }\n return string(buffer);\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 bytes(a).length == bytes(b).length && keccak256(bytes(a)) == keccak256(bytes(b));\n }\n}\n" + }, + "@openzeppelin/contracts/utils/structs/Checkpoints.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/structs/Checkpoints.sol)\n// This file was procedurally generated from scripts/generate/templates/Checkpoints.js.\n\npragma solidity ^0.8.20;\n\nimport {Math} from \"../math/Math.sol\";\n\n/**\n * @dev This library defines the `Trace*` struct, for checkpointing values as they change at different points in\n * time, and later looking up past values by block number. See {Votes} as an example.\n *\n * To create a history of checkpoints define a variable type `Checkpoints.Trace*` in your contract, and store a new\n * checkpoint for the current transaction block using the {push} function.\n */\nlibrary Checkpoints {\n /**\n * @dev A value was attempted to be inserted on a past checkpoint.\n */\n error CheckpointUnorderedInsertion();\n\n struct Trace224 {\n Checkpoint224[] _checkpoints;\n }\n\n struct Checkpoint224 {\n uint32 _key;\n uint224 _value;\n }\n\n /**\n * @dev Pushes a (`key`, `value`) pair into a Trace224 so that it is stored as the checkpoint.\n *\n * Returns previous value and new value.\n *\n * IMPORTANT: Never accept `key` as a user input, since an arbitrary `type(uint32).max` key set will disable the\n * library.\n */\n function push(\n Trace224 storage self,\n uint32 key,\n uint224 value\n ) internal returns (uint224 oldValue, uint224 newValue) {\n return _insert(self._checkpoints, key, value);\n }\n\n /**\n * @dev Returns the value in the first (oldest) checkpoint with key greater or equal than the search key, or zero if\n * there is none.\n */\n function lowerLookup(Trace224 storage self, uint32 key) internal view returns (uint224) {\n uint256 len = self._checkpoints.length;\n uint256 pos = _lowerBinaryLookup(self._checkpoints, key, 0, len);\n return pos == len ? 0 : _unsafeAccess(self._checkpoints, pos)._value;\n }\n\n /**\n * @dev Returns the value in the last (most recent) checkpoint with key lower or equal than the search key, or zero\n * if there is none.\n */\n function upperLookup(Trace224 storage self, uint32 key) internal view returns (uint224) {\n uint256 len = self._checkpoints.length;\n uint256 pos = _upperBinaryLookup(self._checkpoints, key, 0, len);\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\n }\n\n /**\n * @dev Returns the value in the last (most recent) checkpoint with key lower or equal than the search key, or zero\n * if there is none.\n *\n * NOTE: This is a variant of {upperLookup} that is optimised to find \"recent\" checkpoint (checkpoints with high\n * keys).\n */\n function upperLookupRecent(Trace224 storage self, uint32 key) internal view returns (uint224) {\n uint256 len = self._checkpoints.length;\n\n uint256 low = 0;\n uint256 high = len;\n\n if (len > 5) {\n uint256 mid = len - Math.sqrt(len);\n if (key < _unsafeAccess(self._checkpoints, mid)._key) {\n high = mid;\n } else {\n low = mid + 1;\n }\n }\n\n uint256 pos = _upperBinaryLookup(self._checkpoints, key, low, high);\n\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\n }\n\n /**\n * @dev Returns the value in the most recent checkpoint, or zero if there are no checkpoints.\n */\n function latest(Trace224 storage self) internal view returns (uint224) {\n uint256 pos = self._checkpoints.length;\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\n }\n\n /**\n * @dev Returns whether there is a checkpoint in the structure (i.e. it is not empty), and if so the key and value\n * in the most recent checkpoint.\n */\n function latestCheckpoint(Trace224 storage self) internal view returns (bool exists, uint32 _key, uint224 _value) {\n uint256 pos = self._checkpoints.length;\n if (pos == 0) {\n return (false, 0, 0);\n } else {\n Checkpoint224 storage ckpt = _unsafeAccess(self._checkpoints, pos - 1);\n return (true, ckpt._key, ckpt._value);\n }\n }\n\n /**\n * @dev Returns the number of checkpoint.\n */\n function length(Trace224 storage self) internal view returns (uint256) {\n return self._checkpoints.length;\n }\n\n /**\n * @dev Returns checkpoint at given position.\n */\n function at(Trace224 storage self, uint32 pos) internal view returns (Checkpoint224 memory) {\n return self._checkpoints[pos];\n }\n\n /**\n * @dev Pushes a (`key`, `value`) pair into an ordered list of checkpoints, either by inserting a new checkpoint,\n * or by updating the last one.\n */\n function _insert(\n Checkpoint224[] storage self,\n uint32 key,\n uint224 value\n ) private returns (uint224 oldValue, uint224 newValue) {\n uint256 pos = self.length;\n\n if (pos > 0) {\n Checkpoint224 storage last = _unsafeAccess(self, pos - 1);\n uint32 lastKey = last._key;\n uint224 lastValue = last._value;\n\n // Checkpoint keys must be non-decreasing.\n if (lastKey > key) {\n revert CheckpointUnorderedInsertion();\n }\n\n // Update or push new checkpoint\n if (lastKey == key) {\n last._value = value;\n } else {\n self.push(Checkpoint224({_key: key, _value: value}));\n }\n return (lastValue, value);\n } else {\n self.push(Checkpoint224({_key: key, _value: value}));\n return (0, value);\n }\n }\n\n /**\n * @dev Return the index of the first (oldest) checkpoint with key strictly bigger than the search key, or `high`\n * if there is none. `low` and `high` define a section where to do the search, with inclusive `low` and exclusive\n * `high`.\n *\n * WARNING: `high` should not be greater than the array's length.\n */\n function _upperBinaryLookup(\n Checkpoint224[] storage self,\n uint32 key,\n uint256 low,\n uint256 high\n ) private view returns (uint256) {\n while (low < high) {\n uint256 mid = Math.average(low, high);\n if (_unsafeAccess(self, mid)._key > key) {\n high = mid;\n } else {\n low = mid + 1;\n }\n }\n return high;\n }\n\n /**\n * @dev Return the index of the first (oldest) checkpoint with key greater or equal than the search key, or `high`\n * if there is none. `low` and `high` define a section where to do the search, with inclusive `low` and exclusive\n * `high`.\n *\n * WARNING: `high` should not be greater than the array's length.\n */\n function _lowerBinaryLookup(\n Checkpoint224[] storage self,\n uint32 key,\n uint256 low,\n uint256 high\n ) private view returns (uint256) {\n while (low < high) {\n uint256 mid = Math.average(low, high);\n if (_unsafeAccess(self, mid)._key < key) {\n low = mid + 1;\n } else {\n high = mid;\n }\n }\n return high;\n }\n\n /**\n * @dev Access an element of the array without performing bounds check. The position is assumed to be within bounds.\n */\n function _unsafeAccess(\n Checkpoint224[] storage self,\n uint256 pos\n ) private pure returns (Checkpoint224 storage result) {\n assembly {\n mstore(0, self.slot)\n result.slot := add(keccak256(0, 0x20), pos)\n }\n }\n\n struct Trace208 {\n Checkpoint208[] _checkpoints;\n }\n\n struct Checkpoint208 {\n uint48 _key;\n uint208 _value;\n }\n\n /**\n * @dev Pushes a (`key`, `value`) pair into a Trace208 so that it is stored as the checkpoint.\n *\n * Returns previous value and new value.\n *\n * IMPORTANT: Never accept `key` as a user input, since an arbitrary `type(uint48).max` key set will disable the\n * library.\n */\n function push(\n Trace208 storage self,\n uint48 key,\n uint208 value\n ) internal returns (uint208 oldValue, uint208 newValue) {\n return _insert(self._checkpoints, key, value);\n }\n\n /**\n * @dev Returns the value in the first (oldest) checkpoint with key greater or equal than the search key, or zero if\n * there is none.\n */\n function lowerLookup(Trace208 storage self, uint48 key) internal view returns (uint208) {\n uint256 len = self._checkpoints.length;\n uint256 pos = _lowerBinaryLookup(self._checkpoints, key, 0, len);\n return pos == len ? 0 : _unsafeAccess(self._checkpoints, pos)._value;\n }\n\n /**\n * @dev Returns the value in the last (most recent) checkpoint with key lower or equal than the search key, or zero\n * if there is none.\n */\n function upperLookup(Trace208 storage self, uint48 key) internal view returns (uint208) {\n uint256 len = self._checkpoints.length;\n uint256 pos = _upperBinaryLookup(self._checkpoints, key, 0, len);\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\n }\n\n /**\n * @dev Returns the value in the last (most recent) checkpoint with key lower or equal than the search key, or zero\n * if there is none.\n *\n * NOTE: This is a variant of {upperLookup} that is optimised to find \"recent\" checkpoint (checkpoints with high\n * keys).\n */\n function upperLookupRecent(Trace208 storage self, uint48 key) internal view returns (uint208) {\n uint256 len = self._checkpoints.length;\n\n uint256 low = 0;\n uint256 high = len;\n\n if (len > 5) {\n uint256 mid = len - Math.sqrt(len);\n if (key < _unsafeAccess(self._checkpoints, mid)._key) {\n high = mid;\n } else {\n low = mid + 1;\n }\n }\n\n uint256 pos = _upperBinaryLookup(self._checkpoints, key, low, high);\n\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\n }\n\n /**\n * @dev Returns the value in the most recent checkpoint, or zero if there are no checkpoints.\n */\n function latest(Trace208 storage self) internal view returns (uint208) {\n uint256 pos = self._checkpoints.length;\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\n }\n\n /**\n * @dev Returns whether there is a checkpoint in the structure (i.e. it is not empty), and if so the key and value\n * in the most recent checkpoint.\n */\n function latestCheckpoint(Trace208 storage self) internal view returns (bool exists, uint48 _key, uint208 _value) {\n uint256 pos = self._checkpoints.length;\n if (pos == 0) {\n return (false, 0, 0);\n } else {\n Checkpoint208 storage ckpt = _unsafeAccess(self._checkpoints, pos - 1);\n return (true, ckpt._key, ckpt._value);\n }\n }\n\n /**\n * @dev Returns the number of checkpoint.\n */\n function length(Trace208 storage self) internal view returns (uint256) {\n return self._checkpoints.length;\n }\n\n /**\n * @dev Returns checkpoint at given position.\n */\n function at(Trace208 storage self, uint32 pos) internal view returns (Checkpoint208 memory) {\n return self._checkpoints[pos];\n }\n\n /**\n * @dev Pushes a (`key`, `value`) pair into an ordered list of checkpoints, either by inserting a new checkpoint,\n * or by updating the last one.\n */\n function _insert(\n Checkpoint208[] storage self,\n uint48 key,\n uint208 value\n ) private returns (uint208 oldValue, uint208 newValue) {\n uint256 pos = self.length;\n\n if (pos > 0) {\n Checkpoint208 storage last = _unsafeAccess(self, pos - 1);\n uint48 lastKey = last._key;\n uint208 lastValue = last._value;\n\n // Checkpoint keys must be non-decreasing.\n if (lastKey > key) {\n revert CheckpointUnorderedInsertion();\n }\n\n // Update or push new checkpoint\n if (lastKey == key) {\n last._value = value;\n } else {\n self.push(Checkpoint208({_key: key, _value: value}));\n }\n return (lastValue, value);\n } else {\n self.push(Checkpoint208({_key: key, _value: value}));\n return (0, value);\n }\n }\n\n /**\n * @dev Return the index of the first (oldest) checkpoint with key strictly bigger than the search key, or `high`\n * if there is none. `low` and `high` define a section where to do the search, with inclusive `low` and exclusive\n * `high`.\n *\n * WARNING: `high` should not be greater than the array's length.\n */\n function _upperBinaryLookup(\n Checkpoint208[] storage self,\n uint48 key,\n uint256 low,\n uint256 high\n ) private view returns (uint256) {\n while (low < high) {\n uint256 mid = Math.average(low, high);\n if (_unsafeAccess(self, mid)._key > key) {\n high = mid;\n } else {\n low = mid + 1;\n }\n }\n return high;\n }\n\n /**\n * @dev Return the index of the first (oldest) checkpoint with key greater or equal than the search key, or `high`\n * if there is none. `low` and `high` define a section where to do the search, with inclusive `low` and exclusive\n * `high`.\n *\n * WARNING: `high` should not be greater than the array's length.\n */\n function _lowerBinaryLookup(\n Checkpoint208[] storage self,\n uint48 key,\n uint256 low,\n uint256 high\n ) private view returns (uint256) {\n while (low < high) {\n uint256 mid = Math.average(low, high);\n if (_unsafeAccess(self, mid)._key < key) {\n low = mid + 1;\n } else {\n high = mid;\n }\n }\n return high;\n }\n\n /**\n * @dev Access an element of the array without performing bounds check. The position is assumed to be within bounds.\n */\n function _unsafeAccess(\n Checkpoint208[] storage self,\n uint256 pos\n ) private pure returns (Checkpoint208 storage result) {\n assembly {\n mstore(0, self.slot)\n result.slot := add(keccak256(0, 0x20), pos)\n }\n }\n\n struct Trace160 {\n Checkpoint160[] _checkpoints;\n }\n\n struct Checkpoint160 {\n uint96 _key;\n uint160 _value;\n }\n\n /**\n * @dev Pushes a (`key`, `value`) pair into a Trace160 so that it is stored as the checkpoint.\n *\n * Returns previous value and new value.\n *\n * IMPORTANT: Never accept `key` as a user input, since an arbitrary `type(uint96).max` key set will disable the\n * library.\n */\n function push(\n Trace160 storage self,\n uint96 key,\n uint160 value\n ) internal returns (uint160 oldValue, uint160 newValue) {\n return _insert(self._checkpoints, key, value);\n }\n\n /**\n * @dev Returns the value in the first (oldest) checkpoint with key greater or equal than the search key, or zero if\n * there is none.\n */\n function lowerLookup(Trace160 storage self, uint96 key) internal view returns (uint160) {\n uint256 len = self._checkpoints.length;\n uint256 pos = _lowerBinaryLookup(self._checkpoints, key, 0, len);\n return pos == len ? 0 : _unsafeAccess(self._checkpoints, pos)._value;\n }\n\n /**\n * @dev Returns the value in the last (most recent) checkpoint with key lower or equal than the search key, or zero\n * if there is none.\n */\n function upperLookup(Trace160 storage self, uint96 key) internal view returns (uint160) {\n uint256 len = self._checkpoints.length;\n uint256 pos = _upperBinaryLookup(self._checkpoints, key, 0, len);\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\n }\n\n /**\n * @dev Returns the value in the last (most recent) checkpoint with key lower or equal than the search key, or zero\n * if there is none.\n *\n * NOTE: This is a variant of {upperLookup} that is optimised to find \"recent\" checkpoint (checkpoints with high\n * keys).\n */\n function upperLookupRecent(Trace160 storage self, uint96 key) internal view returns (uint160) {\n uint256 len = self._checkpoints.length;\n\n uint256 low = 0;\n uint256 high = len;\n\n if (len > 5) {\n uint256 mid = len - Math.sqrt(len);\n if (key < _unsafeAccess(self._checkpoints, mid)._key) {\n high = mid;\n } else {\n low = mid + 1;\n }\n }\n\n uint256 pos = _upperBinaryLookup(self._checkpoints, key, low, high);\n\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\n }\n\n /**\n * @dev Returns the value in the most recent checkpoint, or zero if there are no checkpoints.\n */\n function latest(Trace160 storage self) internal view returns (uint160) {\n uint256 pos = self._checkpoints.length;\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\n }\n\n /**\n * @dev Returns whether there is a checkpoint in the structure (i.e. it is not empty), and if so the key and value\n * in the most recent checkpoint.\n */\n function latestCheckpoint(Trace160 storage self) internal view returns (bool exists, uint96 _key, uint160 _value) {\n uint256 pos = self._checkpoints.length;\n if (pos == 0) {\n return (false, 0, 0);\n } else {\n Checkpoint160 storage ckpt = _unsafeAccess(self._checkpoints, pos - 1);\n return (true, ckpt._key, ckpt._value);\n }\n }\n\n /**\n * @dev Returns the number of checkpoint.\n */\n function length(Trace160 storage self) internal view returns (uint256) {\n return self._checkpoints.length;\n }\n\n /**\n * @dev Returns checkpoint at given position.\n */\n function at(Trace160 storage self, uint32 pos) internal view returns (Checkpoint160 memory) {\n return self._checkpoints[pos];\n }\n\n /**\n * @dev Pushes a (`key`, `value`) pair into an ordered list of checkpoints, either by inserting a new checkpoint,\n * or by updating the last one.\n */\n function _insert(\n Checkpoint160[] storage self,\n uint96 key,\n uint160 value\n ) private returns (uint160 oldValue, uint160 newValue) {\n uint256 pos = self.length;\n\n if (pos > 0) {\n Checkpoint160 storage last = _unsafeAccess(self, pos - 1);\n uint96 lastKey = last._key;\n uint160 lastValue = last._value;\n\n // Checkpoint keys must be non-decreasing.\n if (lastKey > key) {\n revert CheckpointUnorderedInsertion();\n }\n\n // Update or push new checkpoint\n if (lastKey == key) {\n last._value = value;\n } else {\n self.push(Checkpoint160({_key: key, _value: value}));\n }\n return (lastValue, value);\n } else {\n self.push(Checkpoint160({_key: key, _value: value}));\n return (0, value);\n }\n }\n\n /**\n * @dev Return the index of the first (oldest) checkpoint with key strictly bigger than the search key, or `high`\n * if there is none. `low` and `high` define a section where to do the search, with inclusive `low` and exclusive\n * `high`.\n *\n * WARNING: `high` should not be greater than the array's length.\n */\n function _upperBinaryLookup(\n Checkpoint160[] storage self,\n uint96 key,\n uint256 low,\n uint256 high\n ) private view returns (uint256) {\n while (low < high) {\n uint256 mid = Math.average(low, high);\n if (_unsafeAccess(self, mid)._key > key) {\n high = mid;\n } else {\n low = mid + 1;\n }\n }\n return high;\n }\n\n /**\n * @dev Return the index of the first (oldest) checkpoint with key greater or equal than the search key, or `high`\n * if there is none. `low` and `high` define a section where to do the search, with inclusive `low` and exclusive\n * `high`.\n *\n * WARNING: `high` should not be greater than the array's length.\n */\n function _lowerBinaryLookup(\n Checkpoint160[] storage self,\n uint96 key,\n uint256 low,\n uint256 high\n ) private view returns (uint256) {\n while (low < high) {\n uint256 mid = Math.average(low, high);\n if (_unsafeAccess(self, mid)._key < key) {\n low = mid + 1;\n } else {\n high = mid;\n }\n }\n return high;\n }\n\n /**\n * @dev Access an element of the array without performing bounds check. The position is assumed to be within bounds.\n */\n function _unsafeAccess(\n Checkpoint160[] storage self,\n uint256 pos\n ) private pure returns (Checkpoint160 storage result) {\n assembly {\n mstore(0, self.slot)\n result.slot := add(keccak256(0, 0x20), pos)\n }\n }\n}\n" + }, + "@openzeppelin/contracts/utils/structs/DoubleEndedQueue.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/structs/DoubleEndedQueue.sol)\npragma solidity ^0.8.20;\n\nimport {Panic} from \"../Panic.sol\";\n\n/**\n * @dev A sequence of items with the ability to efficiently push and pop items (i.e. insert and remove) on both ends of\n * the sequence (called front and back). Among other access patterns, it can be used to implement efficient LIFO and\n * FIFO queues. Storage use is optimized, and all operations are O(1) constant time. This includes {clear}, given that\n * the existing queue contents are left in storage.\n *\n * The struct is called `Bytes32Deque`. Other types can be cast to and from `bytes32`. This data structure can only be\n * used in storage, and not in memory.\n * ```solidity\n * DoubleEndedQueue.Bytes32Deque queue;\n * ```\n */\nlibrary DoubleEndedQueue {\n /**\n * @dev Indices are 128 bits so begin and end are packed in a single storage slot for efficient access.\n *\n * Struct members have an underscore prefix indicating that they are \"private\" and should not be read or written to\n * directly. Use the functions provided below instead. Modifying the struct manually may violate assumptions and\n * lead to unexpected behavior.\n *\n * The first item is at data[begin] and the last item is at data[end - 1]. This range can wrap around.\n */\n struct Bytes32Deque {\n uint128 _begin;\n uint128 _end;\n mapping(uint128 index => bytes32) _data;\n }\n\n /**\n * @dev Inserts an item at the end of the queue.\n *\n * Reverts with {Panic-RESOURCE_ERROR} if the queue is full.\n */\n function pushBack(Bytes32Deque storage deque, bytes32 value) internal {\n unchecked {\n uint128 backIndex = deque._end;\n if (backIndex + 1 == deque._begin) Panic.panic(Panic.RESOURCE_ERROR);\n deque._data[backIndex] = value;\n deque._end = backIndex + 1;\n }\n }\n\n /**\n * @dev Removes the item at the end of the queue and returns it.\n *\n * Reverts with {Panic-EMPTY_ARRAY_POP} if the queue is empty.\n */\n function popBack(Bytes32Deque storage deque) internal returns (bytes32 value) {\n unchecked {\n uint128 backIndex = deque._end;\n if (backIndex == deque._begin) Panic.panic(Panic.EMPTY_ARRAY_POP);\n --backIndex;\n value = deque._data[backIndex];\n delete deque._data[backIndex];\n deque._end = backIndex;\n }\n }\n\n /**\n * @dev Inserts an item at the beginning of the queue.\n *\n * Reverts with {Panic-RESOURCE_ERROR} if the queue is full.\n */\n function pushFront(Bytes32Deque storage deque, bytes32 value) internal {\n unchecked {\n uint128 frontIndex = deque._begin - 1;\n if (frontIndex == deque._end) Panic.panic(Panic.RESOURCE_ERROR);\n deque._data[frontIndex] = value;\n deque._begin = frontIndex;\n }\n }\n\n /**\n * @dev Removes the item at the beginning of the queue and returns it.\n *\n * Reverts with {Panic-EMPTY_ARRAY_POP} if the queue is empty.\n */\n function popFront(Bytes32Deque storage deque) internal returns (bytes32 value) {\n unchecked {\n uint128 frontIndex = deque._begin;\n if (frontIndex == deque._end) Panic.panic(Panic.EMPTY_ARRAY_POP);\n value = deque._data[frontIndex];\n delete deque._data[frontIndex];\n deque._begin = frontIndex + 1;\n }\n }\n\n /**\n * @dev Returns the item at the beginning of the queue.\n *\n * Reverts with {Panic-ARRAY_OUT_OF_BOUNDS} if the queue is empty.\n */\n function front(Bytes32Deque storage deque) internal view returns (bytes32 value) {\n if (empty(deque)) Panic.panic(Panic.ARRAY_OUT_OF_BOUNDS);\n return deque._data[deque._begin];\n }\n\n /**\n * @dev Returns the item at the end of the queue.\n *\n * Reverts with {Panic-ARRAY_OUT_OF_BOUNDS} if the queue is empty.\n */\n function back(Bytes32Deque storage deque) internal view returns (bytes32 value) {\n if (empty(deque)) Panic.panic(Panic.ARRAY_OUT_OF_BOUNDS);\n unchecked {\n return deque._data[deque._end - 1];\n }\n }\n\n /**\n * @dev Return the item at a position in the queue given by `index`, with the first item at 0 and last item at\n * `length(deque) - 1`.\n *\n * Reverts with {Panic-ARRAY_OUT_OF_BOUNDS} if the index is out of bounds.\n */\n function at(Bytes32Deque storage deque, uint256 index) internal view returns (bytes32 value) {\n if (index >= length(deque)) Panic.panic(Panic.ARRAY_OUT_OF_BOUNDS);\n // By construction, length is a uint128, so the check above ensures that index can be safely downcast to uint128\n unchecked {\n return deque._data[deque._begin + uint128(index)];\n }\n }\n\n /**\n * @dev Resets the queue back to being empty.\n *\n * NOTE: The current items are left behind in storage. This does not affect the functioning of the queue, but misses\n * out on potential gas refunds.\n */\n function clear(Bytes32Deque storage deque) internal {\n deque._begin = 0;\n deque._end = 0;\n }\n\n /**\n * @dev Returns the number of items in the queue.\n */\n function length(Bytes32Deque storage deque) internal view returns (uint256) {\n unchecked {\n return uint256(deque._end - deque._begin);\n }\n }\n\n /**\n * @dev Returns true if the queue is empty.\n */\n function empty(Bytes32Deque storage deque) internal view returns (bool) {\n return deque._end == deque._begin;\n }\n}\n" + }, + "@openzeppelin/contracts/utils/types/Time.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/types/Time.sol)\n\npragma solidity ^0.8.20;\n\nimport {Math} from \"../math/Math.sol\";\nimport {SafeCast} from \"../math/SafeCast.sol\";\n\n/**\n * @dev This library provides helpers for manipulating time-related objects.\n *\n * It uses the following types:\n * - `uint48` for timepoints\n * - `uint32` for durations\n *\n * While the library doesn't provide specific types for timepoints and duration, it does provide:\n * - a `Delay` type to represent duration that can be programmed to change value automatically at a given point\n * - additional helper functions\n */\nlibrary Time {\n using Time for *;\n\n /**\n * @dev Get the block timestamp as a Timepoint.\n */\n function timestamp() internal view returns (uint48) {\n return SafeCast.toUint48(block.timestamp);\n }\n\n /**\n * @dev Get the block number as a Timepoint.\n */\n function blockNumber() internal view returns (uint48) {\n return SafeCast.toUint48(block.number);\n }\n\n // ==================================================== Delay =====================================================\n /**\n * @dev A `Delay` is a uint32 duration that can be programmed to change value automatically at a given point in the\n * future. The \"effect\" timepoint describes when the transitions happens from the \"old\" value to the \"new\" value.\n * This allows updating the delay applied to some operation while keeping some guarantees.\n *\n * In particular, the {update} function guarantees that if the delay is reduced, the old delay still applies for\n * some time. For example if the delay is currently 7 days to do an upgrade, the admin should not be able to set\n * the delay to 0 and upgrade immediately. If the admin wants to reduce the delay, the old delay (7 days) should\n * still apply for some time.\n *\n *\n * The `Delay` type is 112 bits long, and packs the following:\n *\n * ```\n * | [uint48]: effect date (timepoint)\n * | | [uint32]: value before (duration)\n * ↓ ↓ ↓ [uint32]: value after (duration)\n * 0xAAAAAAAAAAAABBBBBBBBCCCCCCCC\n * ```\n *\n * NOTE: The {get} and {withUpdate} functions operate using timestamps. Block number based delays are not currently\n * supported.\n */\n type Delay is uint112;\n\n /**\n * @dev Wrap a duration into a Delay to add the one-step \"update in the future\" feature\n */\n function toDelay(uint32 duration) internal pure returns (Delay) {\n return Delay.wrap(duration);\n }\n\n /**\n * @dev Get the value at a given timepoint plus the pending value and effect timepoint if there is a scheduled\n * change after this timepoint. If the effect timepoint is 0, then the pending value should not be considered.\n */\n function _getFullAt(\n Delay self,\n uint48 timepoint\n ) private pure returns (uint32 valueBefore, uint32 valueAfter, uint48 effect) {\n (valueBefore, valueAfter, effect) = self.unpack();\n return effect <= timepoint ? (valueAfter, 0, 0) : (valueBefore, valueAfter, effect);\n }\n\n /**\n * @dev Get the current value plus the pending value and effect timepoint if there is a scheduled change. If the\n * effect timepoint is 0, then the pending value should not be considered.\n */\n function getFull(Delay self) internal view returns (uint32 valueBefore, uint32 valueAfter, uint48 effect) {\n return _getFullAt(self, timestamp());\n }\n\n /**\n * @dev Get the current value.\n */\n function get(Delay self) internal view returns (uint32) {\n (uint32 delay, , ) = self.getFull();\n return delay;\n }\n\n /**\n * @dev Update a Delay object so that it takes a new duration after a timepoint that is automatically computed to\n * enforce the old delay at the moment of the update. Returns the updated Delay object and the timestamp when the\n * new delay becomes effective.\n */\n function withUpdate(\n Delay self,\n uint32 newValue,\n uint32 minSetback\n ) internal view returns (Delay updatedDelay, uint48 effect) {\n uint32 value = self.get();\n uint32 setback = uint32(Math.max(minSetback, value > newValue ? value - newValue : 0));\n effect = timestamp() + setback;\n return (pack(value, newValue, effect), effect);\n }\n\n /**\n * @dev Split a delay into its components: valueBefore, valueAfter and effect (transition timepoint).\n */\n function unpack(Delay self) internal pure returns (uint32 valueBefore, uint32 valueAfter, uint48 effect) {\n uint112 raw = Delay.unwrap(self);\n\n valueAfter = uint32(raw);\n valueBefore = uint32(raw >> 32);\n effect = uint48(raw >> 64);\n\n return (valueBefore, valueAfter, effect);\n }\n\n /**\n * @dev pack the components into a Delay object.\n */\n function pack(uint32 valueBefore, uint32 valueAfter, uint48 effect) internal pure returns (Delay) {\n return Delay.wrap((uint112(effect) << 64) | (uint112(valueBefore) << 32) | uint112(valueAfter));\n }\n}\n" + }, + "contracts/variants/crosschain/Gov.sol": { + "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity ^0.8.20;\n\nimport \"@openzeppelin/contracts/governance/Governor.sol\";\nimport \"@openzeppelin/contracts/governance/extensions/GovernorSettings.sol\";\nimport \"@openzeppelin/contracts/governance/extensions/GovernorCountingSimple.sol\";\nimport \"@openzeppelin/contracts/governance/extensions/GovernorVotes.sol\";\nimport \"@openzeppelin/contracts/governance/extensions/GovernorVotesQuorumFraction.sol\";\nimport \"./ProofHandler.sol\";\n\n/**\n * @title Cross-chain Governance Contract\n * @author Web3 Hackers Collective\n * @notice Implementation of a DAO with cross-chain synchronization capabilities\n * @dev Extends OpenZeppelin's Governor contract with cross-chain parameter updates\n * @custom:security-contact julien@strat.cc\n */\ncontract Gov is\n Governor,\n GovernorSettings,\n GovernorCountingSimple,\n GovernorVotes,\n GovernorVotesQuorumFraction\n{\n /// @notice Chain ID where this contract was originally deployed\n uint256 public immutable home;\n\n /// @notice IPFS CID of the DAO's manifesto\n string public manifesto;\n\n /// @notice Storage for proof handling\n ProofHandler.ProofStorage private _proofStorage;\n\n /// @notice Types of operations that can be synchronized across chains\n enum OperationType {\n SET_MANIFESTO,\n UPDATE_VOTING_DELAY,\n UPDATE_VOTING_PERIOD,\n UPDATE_PROPOSAL_THRESHOLD,\n UPDATE_QUORUM\n }\n\n /// @notice Emitted when the manifesto is updated\n /// @param oldManifesto Previous manifesto CID\n /// @param newManifesto New manifesto CID\n /// @param nonce Update sequence number\n event ManifestoUpdated(string oldManifesto, string newManifesto, uint256 nonce);\n\n /// @notice Emitted when a governance parameter is updated\n /// @param operationType Type of parameter updated\n /// @param oldValue Previous value\n /// @param newValue New value\n /// @param nonce Update sequence number\n event GovernanceParameterUpdated(\n OperationType indexed operationType,\n uint256 oldValue,\n uint256 newValue,\n uint256 nonce\n );\n\n /// @notice Restricts functions to be called only on the home chain\n modifier onlyHomeChain() {\n require(block.chainid == home, \"Operation only allowed on home chain\");\n _;\n }\n\n /**\n * @notice Initializes the governance contract\n * @dev Sets up initial governance parameters and manifesto\n * @param _home Chain ID where this contract is considered home\n * @param _token The voting token contract address\n * @param _manifestoCid Initial manifesto CID\n * @param _name Name of the governance contract\n * @param _votingDelay Time before voting begins\n * @param _votingPeriod Duration of voting period\n * @param _proposalThreshold Minimum votes needed to create a proposal\n * @param _quorum Minimum participation percentage required\n */\n constructor(\n uint256 _home,\n IVotes _token,\n string memory _manifestoCid,\n string memory _name,\n uint48 _votingDelay,\n uint32 _votingPeriod,\n uint256 _proposalThreshold,\n uint256 _quorum\n )\n Governor(_name)\n GovernorSettings(_votingDelay, _votingPeriod, _proposalThreshold)\n GovernorVotes(_token)\n GovernorVotesQuorumFraction(_quorum)\n {\n home = _home;\n manifesto = _manifestoCid;\n }\n\n /**\n * @notice Updates the DAO's manifesto on the home chain\n * @param newManifesto New manifesto CID\n */\n function setManifesto(string memory newManifesto) public onlyGovernance onlyHomeChain {\n uint256 nonce = ProofHandler.incrementNonce(\n _proofStorage,\n uint8(OperationType.SET_MANIFESTO)\n );\n string memory oldManifesto = manifesto;\n manifesto = newManifesto;\n emit ManifestoUpdated(oldManifesto, newManifesto, nonce);\n }\n\n /**\n * @notice Updates the voting delay parameter on the home chain\n * @param newVotingDelay New voting delay value\n */\n function setVotingDelay(\n uint48 newVotingDelay\n ) public virtual override onlyGovernance onlyHomeChain {\n uint256 nonce = ProofHandler.incrementNonce(\n _proofStorage,\n uint8(OperationType.UPDATE_VOTING_DELAY)\n );\n uint256 oldValue = votingDelay();\n _setVotingDelay(newVotingDelay);\n emit GovernanceParameterUpdated(\n OperationType.UPDATE_VOTING_DELAY,\n oldValue,\n newVotingDelay,\n nonce\n );\n }\n\n /**\n * @notice Updates the voting period parameter on the home chain\n * @param newVotingPeriod New voting period value\n */\n function setVotingPeriod(\n uint32 newVotingPeriod\n ) public virtual override onlyGovernance onlyHomeChain {\n uint256 nonce = ProofHandler.incrementNonce(\n _proofStorage,\n uint8(OperationType.UPDATE_VOTING_PERIOD)\n );\n uint256 oldValue = votingPeriod();\n _setVotingPeriod(newVotingPeriod);\n emit GovernanceParameterUpdated(\n OperationType.UPDATE_VOTING_PERIOD,\n oldValue,\n newVotingPeriod,\n nonce\n );\n }\n\n /**\n * @notice Updates the proposal threshold parameter on the home chain\n * @param newProposalThreshold New proposal threshold value\n */\n function setProposalThreshold(\n uint256 newProposalThreshold\n ) public virtual override onlyGovernance onlyHomeChain {\n uint256 nonce = ProofHandler.incrementNonce(\n _proofStorage,\n uint8(OperationType.UPDATE_PROPOSAL_THRESHOLD)\n );\n uint256 oldValue = proposalThreshold();\n _setProposalThreshold(newProposalThreshold);\n emit GovernanceParameterUpdated(\n OperationType.UPDATE_PROPOSAL_THRESHOLD,\n oldValue,\n newProposalThreshold,\n nonce\n );\n }\n\n /**\n * @notice Updates the quorum numerator on the home chain\n * @param newQuorumNumerator New quorum numerator value\n */\n function updateQuorumNumerator(\n uint256 newQuorumNumerator\n ) public virtual override onlyGovernance onlyHomeChain {\n uint256 nonce = ProofHandler.incrementNonce(\n _proofStorage,\n uint8(OperationType.UPDATE_QUORUM)\n );\n uint256 oldValue = quorumNumerator();\n _updateQuorumNumerator(newQuorumNumerator);\n emit GovernanceParameterUpdated(\n OperationType.UPDATE_QUORUM,\n oldValue,\n newQuorumNumerator,\n nonce\n );\n }\n\n /**\n * @notice Generates proof for parameter updates\n * @param operationType Type of parameter being updated\n * @param value Encoded parameter value\n * @return proof Encoded proof data\n */\n function generateParameterProof(\n uint8 operationType,\n bytes memory value\n ) external view returns (bytes memory proof) {\n require(block.chainid == home, \"Proofs only generated on home chain\");\n uint256 nextNonce = ProofHandler.getNextNonce(_proofStorage, operationType);\n return ProofHandler.generateProof(address(this), operationType, value, nextNonce);\n }\n\n /**\n * @notice Claims a parameter update on a foreign chain\n * @param proof Proof generated by home chain\n */\n function claimParameterUpdate(bytes memory proof) external {\n (uint8 operationType, bytes memory value, uint256 nonce) = ProofHandler.verifyAndClaimProof(\n proof,\n address(this),\n _proofStorage\n );\n\n if (operationType == uint8(OperationType.SET_MANIFESTO)) {\n string memory newManifesto = abi.decode(value, (string));\n string memory oldManifesto = manifesto;\n manifesto = newManifesto;\n emit ManifestoUpdated(oldManifesto, newManifesto, nonce);\n } else if (operationType == uint8(OperationType.UPDATE_VOTING_DELAY)) {\n uint48 newValue = uint48(bytes6(value));\n uint256 oldValue = votingDelay();\n _setVotingDelay(newValue);\n emit GovernanceParameterUpdated(\n OperationType.UPDATE_VOTING_DELAY,\n oldValue,\n newValue,\n nonce\n );\n } else if (operationType == uint8(OperationType.UPDATE_VOTING_PERIOD)) {\n uint32 newValue = uint32(bytes4(value));\n uint256 oldValue = votingPeriod();\n _setVotingPeriod(newValue);\n emit GovernanceParameterUpdated(\n OperationType.UPDATE_VOTING_PERIOD,\n oldValue,\n newValue,\n nonce\n );\n } else if (operationType == uint8(OperationType.UPDATE_PROPOSAL_THRESHOLD)) {\n uint256 newValue = abi.decode(value, (uint256));\n uint256 oldValue = proposalThreshold();\n _setProposalThreshold(newValue);\n emit GovernanceParameterUpdated(\n OperationType.UPDATE_PROPOSAL_THRESHOLD,\n oldValue,\n newValue,\n nonce\n );\n } else if (operationType == uint8(OperationType.UPDATE_QUORUM)) {\n uint256 newValue = abi.decode(value, (uint256));\n uint256 oldValue = quorumNumerator();\n _updateQuorumNumerator(newValue);\n emit GovernanceParameterUpdated(OperationType.UPDATE_QUORUM, oldValue, newValue, nonce);\n }\n }\n\n // Required overrides\n\n function votingDelay() public view override(Governor, GovernorSettings) returns (uint256) {\n return super.votingDelay();\n }\n\n function votingPeriod() public view override(Governor, GovernorSettings) returns (uint256) {\n return super.votingPeriod();\n }\n\n function quorum(\n uint256 blockNumber\n ) public view override(Governor, GovernorVotesQuorumFraction) returns (uint256) {\n return super.quorum(blockNumber);\n }\n\n function proposalThreshold()\n public\n view\n override(Governor, GovernorSettings)\n returns (uint256)\n {\n return super.proposalThreshold();\n }\n}\n" + }, + "contracts/variants/crosschain/NFT.sol": { + "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity ^0.8.20;\n\nimport \"@openzeppelin/contracts/token/ERC721/ERC721.sol\";\nimport \"@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol\";\nimport \"@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol\";\nimport \"@openzeppelin/contracts/token/ERC721/extensions/ERC721Burnable.sol\";\nimport \"@openzeppelin/contracts/access/Ownable.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/EIP712.sol\";\nimport \"@openzeppelin/contracts/token/ERC721/extensions/ERC721Votes.sol\";\nimport \"./ProofHandler.sol\";\n\n/**\n * @title Cross-chain Membership NFT Contract\n * @author Web3 Hackers Collective\n * @notice Non-transferable NFT implementation for DAO membership with cross-chain capabilities\n * @dev Extends OpenZeppelin's NFT standards with cross-chain operation support\n * @custom:security-contact julien@strat.cc\n */\ncontract NFT is\n ERC721,\n ERC721Enumerable,\n ERC721URIStorage,\n ERC721Burnable,\n Ownable,\n EIP712,\n ERC721Votes\n{\n using ProofHandler for ProofHandler.ProofStorage;\n\n /// @notice Chain ID where contract was originally deployed\n uint256 public immutable home;\n\n /// @notice Next token ID to be minted\n uint256 private _nextTokenId;\n\n /// @notice Storage for proof handling\n ProofHandler.ProofStorage private _proofStorage;\n\n /// @notice Types of operations that can be synchronized across chains\n enum OperationType {\n MINT,\n BURN,\n SET_METADATA\n }\n\n /// @notice Emitted when a membership is claimed\n /// @param tokenId The ID of the claimed token\n /// @param member The address receiving the membership\n /// @param nonce Operation sequence number\n event MembershipClaimed(uint256 indexed tokenId, address indexed member, uint256 nonce);\n\n /// @notice Emitted when a membership is revoked\n /// @param tokenId The ID of the revoked token\n /// @param member The address losing membership\n /// @param nonce Operation sequence number\n event MembershipRevoked(uint256 indexed tokenId, address indexed member, uint256 nonce);\n\n /// @notice Emitted when metadata is updated\n /// @param tokenId The ID of the updated token\n /// @param newUri The new metadata URI\n /// @param nonce Operation sequence number\n event MetadataUpdated(uint256 indexed tokenId, string newUri, uint256 nonce);\n\n /// @notice Restricts functions to home chain\n modifier onlyHomeChain() {\n require(block.chainid == home, \"Operation only allowed on home chain\");\n _;\n }\n\n /**\n * @notice Initializes the NFT contract\n * @param _home Chain ID where contract is considered home\n * @param initialOwner Initial contract owner\n * @param _firstMembers Array of initial member addresses\n * @param _uri Initial token URI\n * @param _name Token collection name\n * @param _symbol Token collection symbol\n */\n constructor(\n uint256 _home,\n address initialOwner,\n address[] memory _firstMembers,\n string memory _uri,\n string memory _name,\n string memory _symbol\n ) ERC721(_name, _symbol) Ownable(initialOwner) EIP712(_name, \"1\") {\n home = _home;\n for (uint i; i < _firstMembers.length; i++) {\n _govMint(_firstMembers[i], _uri);\n }\n }\n\n /**\n * @notice Adds a new member on home chain\n * @dev Only callable by owner (governance) on home chain\n * @param to Address to mint token to\n * @param uri Token metadata URI\n */\n function safeMint(address to, string memory uri) public onlyOwner onlyHomeChain {\n uint256 nonce = _proofStorage.incrementNonce(uint8(OperationType.MINT));\n _govMint(to, uri);\n emit MembershipClaimed(_nextTokenId - 1, to, nonce);\n }\n\n /**\n * @notice Burns token on home chain\n * @dev Only callable by owner (governance) on home chain\n * @param tokenId ID of token to burn\n */\n function govBurn(uint256 tokenId) public onlyOwner onlyHomeChain {\n uint256 nonce = _proofStorage.incrementNonce(uint8(OperationType.BURN));\n address owner = ownerOf(tokenId);\n _burn(tokenId);\n emit MembershipRevoked(tokenId, owner, nonce);\n }\n\n /**\n * @notice Updates token metadata on home chain\n * @dev Only callable by owner (governance) on home chain\n * @param tokenId ID of token to update\n * @param uri New metadata URI\n */\n function setMetadata(uint256 tokenId, string memory uri) public onlyOwner onlyHomeChain {\n uint256 nonce = _proofStorage.incrementNonce(uint8(OperationType.SET_METADATA));\n _setTokenURI(tokenId, uri);\n emit MetadataUpdated(tokenId, uri, nonce);\n }\n\n /**\n * @notice Generates proof for NFT operations\n * @param operationType Type of operation\n * @param params Operation parameters\n * @return Encoded proof data\n */\n function generateOperationProof(\n uint8 operationType,\n bytes memory params\n ) external view returns (bytes memory) {\n require(block.chainid == home, \"Proofs only generated on home chain\");\n uint256 nextNonce = _proofStorage.getNextNonce(operationType);\n return ProofHandler.generateProof(address(this), operationType, params, nextNonce);\n }\n\n /**\n * @notice Claims an NFT operation on a foreign chain\n * @param proof Proof generated by home chain\n */\n function claimOperation(bytes memory proof) external {\n (uint8 operationType, bytes memory params, uint256 nonce) = ProofHandler\n .verifyAndClaimProof(proof, address(this), _proofStorage);\n\n if (operationType == uint8(OperationType.MINT)) {\n (address to, string memory uri) = abi.decode(params, (address, string));\n _govMint(to, uri);\n emit MembershipClaimed(_nextTokenId - 1, to, nonce);\n } else if (operationType == uint8(OperationType.BURN)) {\n uint256 tokenId = abi.decode(params, (uint256));\n address owner = ownerOf(tokenId);\n _burn(tokenId);\n emit MembershipRevoked(tokenId, owner, nonce);\n } else if (operationType == uint8(OperationType.SET_METADATA)) {\n (uint256 tokenId, string memory uri) = abi.decode(params, (uint256, string));\n _setTokenURI(tokenId, uri);\n emit MetadataUpdated(tokenId, uri, nonce);\n }\n }\n\n /**\n * @notice Internal function for minting without proof verification\n * @param to Address to receive token\n * @param uri Token metadata URI\n */\n function _govMint(address to, string memory uri) internal {\n uint256 tokenId = _nextTokenId++;\n _safeMint(to, tokenId);\n _setTokenURI(tokenId, uri);\n }\n\n // Required overrides\n\n function _update(\n address to,\n uint256 tokenId,\n address auth\n ) internal override(ERC721, ERC721Enumerable, ERC721Votes) returns (address) {\n require(auth == address(0) || to == address(0), \"NFT is not transferable\");\n return super._update(to, tokenId, auth);\n }\n\n function _increaseBalance(\n address account,\n uint128 value\n ) internal override(ERC721, ERC721Enumerable, ERC721Votes) {\n super._increaseBalance(account, value);\n }\n\n function tokenURI(\n uint256 tokenId\n ) public view override(ERC721, ERC721URIStorage) returns (string memory) {\n return super.tokenURI(tokenId);\n }\n\n function supportsInterface(\n bytes4 interfaceId\n ) public view override(ERC721, ERC721Enumerable, ERC721URIStorage) returns (bool) {\n return super.supportsInterface(interfaceId);\n }\n\n function clock() public view override returns (uint48) {\n return uint48(block.timestamp);\n }\n\n function CLOCK_MODE() public pure override returns (string memory) {\n return \"mode=timestamp\";\n }\n}\n" + }, + "contracts/variants/crosschain/ProofHandler.sol": { + "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity ^0.8.20;\n\n/**\n * @title Proof Handler Library\n * @author Web3 Hackers Collective\n * @notice Library for standardized cross-chain proof generation and verification\n * @dev Handles proof generation, verification, and tracking for cross-chain operations\n * @custom:security-contact julien@strat.cc\n */\nlibrary ProofHandler {\n /// @notice Tracks which proofs have been applied on each chain\n struct ProofStorage {\n mapping(bytes32 => bool) updateAppliedOnChain;\n mapping(uint8 => uint256) currentNonce;\n }\n\n /// @dev Emitted when a proof is claimed\n event ProofClaimed(uint8 indexed operationType, bytes params, uint256 nonce);\n\n /**\n * @notice Generates a proof for cross-chain operations\n * @param contractAddress Address of contract generating the proof\n * @param operationType Type of operation being performed\n * @param params Operation parameters\n * @param nonce Current nonce for this operation type\n * @return proof Encoded proof data\n */\n function generateProof(\n address contractAddress,\n uint8 operationType,\n bytes memory params,\n uint256 nonce\n ) public pure returns (bytes memory proof) {\n bytes32 message = keccak256(\n abi.encodePacked(contractAddress, operationType, params, nonce)\n );\n bytes32 digest = keccak256(abi.encodePacked(\"\\x19Ethereum Signed Message:\\n32\", message));\n\n return abi.encode(operationType, params, nonce, digest);\n }\n\n /**\n * @notice Verifies and claims a proof\n * @param proof Proof to verify and claim\n * @param contractAddress Address of contract claiming the proof\n * @param storage_ Proof storage struct\n * @return operationType The type of operation being performed\n * @return params The operation parameters\n * @return nonce The operation sequence number\n */\n function verifyAndClaimProof(\n bytes memory proof,\n address contractAddress,\n ProofStorage storage storage_\n ) public returns (uint8 operationType, bytes memory params, uint256 nonce) {\n bytes32 digest;\n (operationType, params, nonce, digest) = abi.decode(\n proof,\n (uint8, bytes, uint256, bytes32)\n );\n\n bytes32 proofHash = keccak256(proof);\n require(!storage_.updateAppliedOnChain[proofHash], \"Proof already claimed\");\n require(nonce == storage_.currentNonce[operationType] + 1, \"Invalid nonce\");\n\n bytes32 message = keccak256(\n abi.encodePacked(contractAddress, operationType, params, nonce)\n );\n bytes32 expectedDigest = keccak256(\n abi.encodePacked(\"\\x19Ethereum Signed Message:\\n32\", message)\n );\n require(digest == expectedDigest, \"Invalid proof\");\n\n storage_.updateAppliedOnChain[proofHash] = true;\n storage_.currentNonce[operationType] = nonce;\n\n emit ProofClaimed(operationType, params, nonce);\n\n return (operationType, params, nonce);\n }\n\n /**\n * @notice Gets the next nonce for an operation type\n * @param storage_ Proof storage struct\n * @param operationType Type of operation\n * @return nonce Next nonce value\n */\n function getNextNonce(\n ProofStorage storage storage_,\n uint8 operationType\n ) public view returns (uint256 nonce) {\n return storage_.currentNonce[operationType] + 1;\n }\n\n /**\n * @notice Increments the nonce for an operation type\n * @param storage_ Proof storage struct\n * @param operationType Type of operation\n * @return nonce New nonce value\n */\n function incrementNonce(\n ProofStorage storage storage_,\n uint8 operationType\n ) public returns (uint256 nonce) {\n storage_.currentNonce[operationType]++;\n return storage_.currentNonce[operationType];\n }\n}\n" + } + }, + "settings": { + "optimizer": { + "enabled": true, + "runs": 200 + }, + "evmVersion": "paris", + "outputSelection": { + "*": { + "*": [ + "abi", + "evm.bytecode", + "evm.deployedBytecode", + "evm.methodIdentifiers", + "metadata", + "devdoc", + "userdoc", + "storageLayout", + "evm.gasEstimates" + ], + "": [ + "ast" + ] + } + }, + "metadata": { + "useLiteralContent": true + } + } +} \ No newline at end of file diff --git a/deployments/opSepolia/solcInputs/96a9008abeaccbd30a9b75989ce7f0fd.json b/deployments/opSepolia/solcInputs/96a9008abeaccbd30a9b75989ce7f0fd.json new file mode 100644 index 0000000..9f2897c --- /dev/null +++ b/deployments/opSepolia/solcInputs/96a9008abeaccbd30a9b75989ce7f0fd.json @@ -0,0 +1,186 @@ +{ + "language": "Solidity", + "sources": { + "@openzeppelin/contracts/access/Ownable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol)\n\npragma solidity ^0.8.20;\n\nimport {Context} from \"../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 * The initial owner is set to the address provided by the deployer. This can\n * 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 /**\n * @dev The caller account is not authorized to perform an operation.\n */\n error OwnableUnauthorizedAccount(address account);\n\n /**\n * @dev The owner is not a valid owner account. (eg. `address(0)`)\n */\n error OwnableInvalidOwner(address owner);\n\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n /**\n * @dev Initializes the contract setting the address provided by the deployer as the initial owner.\n */\n constructor(address initialOwner) {\n if (initialOwner == address(0)) {\n revert OwnableInvalidOwner(address(0));\n }\n _transferOwnership(initialOwner);\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 if (owner() != _msgSender()) {\n revert OwnableUnauthorizedAccount(_msgSender());\n }\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 if (newOwner == address(0)) {\n revert OwnableInvalidOwner(address(0));\n }\n _transferOwnership(newOwner);\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Internal function without access restriction.\n */\n function _transferOwnership(address newOwner) internal virtual {\n address oldOwner = _owner;\n _owner = newOwner;\n emit OwnershipTransferred(oldOwner, newOwner);\n }\n}\n" + }, + "@openzeppelin/contracts/governance/extensions/GovernorCountingSimple.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (governance/extensions/GovernorCountingSimple.sol)\n\npragma solidity ^0.8.20;\n\nimport {Governor} from \"../Governor.sol\";\n\n/**\n * @dev Extension of {Governor} for simple, 3 options, vote counting.\n */\nabstract contract GovernorCountingSimple is Governor {\n /**\n * @dev Supported vote types. Matches Governor Bravo ordering.\n */\n enum VoteType {\n Against,\n For,\n Abstain\n }\n\n struct ProposalVote {\n uint256 againstVotes;\n uint256 forVotes;\n uint256 abstainVotes;\n mapping(address voter => bool) hasVoted;\n }\n\n mapping(uint256 proposalId => ProposalVote) private _proposalVotes;\n\n /**\n * @dev See {IGovernor-COUNTING_MODE}.\n */\n // solhint-disable-next-line func-name-mixedcase\n function COUNTING_MODE() public pure virtual override returns (string memory) {\n return \"support=bravo&quorum=for,abstain\";\n }\n\n /**\n * @dev See {IGovernor-hasVoted}.\n */\n function hasVoted(uint256 proposalId, address account) public view virtual override returns (bool) {\n return _proposalVotes[proposalId].hasVoted[account];\n }\n\n /**\n * @dev Accessor to the internal vote counts.\n */\n function proposalVotes(\n uint256 proposalId\n ) public view virtual returns (uint256 againstVotes, uint256 forVotes, uint256 abstainVotes) {\n ProposalVote storage proposalVote = _proposalVotes[proposalId];\n return (proposalVote.againstVotes, proposalVote.forVotes, proposalVote.abstainVotes);\n }\n\n /**\n * @dev See {Governor-_quorumReached}.\n */\n function _quorumReached(uint256 proposalId) internal view virtual override returns (bool) {\n ProposalVote storage proposalVote = _proposalVotes[proposalId];\n\n return quorum(proposalSnapshot(proposalId)) <= proposalVote.forVotes + proposalVote.abstainVotes;\n }\n\n /**\n * @dev See {Governor-_voteSucceeded}. In this module, the forVotes must be strictly over the againstVotes.\n */\n function _voteSucceeded(uint256 proposalId) internal view virtual override returns (bool) {\n ProposalVote storage proposalVote = _proposalVotes[proposalId];\n\n return proposalVote.forVotes > proposalVote.againstVotes;\n }\n\n /**\n * @dev See {Governor-_countVote}. In this module, the support follows the `VoteType` enum (from Governor Bravo).\n */\n function _countVote(\n uint256 proposalId,\n address account,\n uint8 support,\n uint256 totalWeight,\n bytes memory // params\n ) internal virtual override returns (uint256) {\n ProposalVote storage proposalVote = _proposalVotes[proposalId];\n\n if (proposalVote.hasVoted[account]) {\n revert GovernorAlreadyCastVote(account);\n }\n proposalVote.hasVoted[account] = true;\n\n if (support == uint8(VoteType.Against)) {\n proposalVote.againstVotes += totalWeight;\n } else if (support == uint8(VoteType.For)) {\n proposalVote.forVotes += totalWeight;\n } else if (support == uint8(VoteType.Abstain)) {\n proposalVote.abstainVotes += totalWeight;\n } else {\n revert GovernorInvalidVoteType();\n }\n\n return totalWeight;\n }\n}\n" + }, + "@openzeppelin/contracts/governance/extensions/GovernorSettings.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (governance/extensions/GovernorSettings.sol)\n\npragma solidity ^0.8.20;\n\nimport {Governor} from \"../Governor.sol\";\n\n/**\n * @dev Extension of {Governor} for settings updatable through governance.\n */\nabstract contract GovernorSettings is Governor {\n // amount of token\n uint256 private _proposalThreshold;\n // timepoint: limited to uint48 in core (same as clock() type)\n uint48 private _votingDelay;\n // duration: limited to uint32 in core\n uint32 private _votingPeriod;\n\n event VotingDelaySet(uint256 oldVotingDelay, uint256 newVotingDelay);\n event VotingPeriodSet(uint256 oldVotingPeriod, uint256 newVotingPeriod);\n event ProposalThresholdSet(uint256 oldProposalThreshold, uint256 newProposalThreshold);\n\n /**\n * @dev Initialize the governance parameters.\n */\n constructor(uint48 initialVotingDelay, uint32 initialVotingPeriod, uint256 initialProposalThreshold) {\n _setVotingDelay(initialVotingDelay);\n _setVotingPeriod(initialVotingPeriod);\n _setProposalThreshold(initialProposalThreshold);\n }\n\n /**\n * @dev See {IGovernor-votingDelay}.\n */\n function votingDelay() public view virtual override returns (uint256) {\n return _votingDelay;\n }\n\n /**\n * @dev See {IGovernor-votingPeriod}.\n */\n function votingPeriod() public view virtual override returns (uint256) {\n return _votingPeriod;\n }\n\n /**\n * @dev See {Governor-proposalThreshold}.\n */\n function proposalThreshold() public view virtual override returns (uint256) {\n return _proposalThreshold;\n }\n\n /**\n * @dev Update the voting delay. This operation can only be performed through a governance proposal.\n *\n * Emits a {VotingDelaySet} event.\n */\n function setVotingDelay(uint48 newVotingDelay) public virtual onlyGovernance {\n _setVotingDelay(newVotingDelay);\n }\n\n /**\n * @dev Update the voting period. This operation can only be performed through a governance proposal.\n *\n * Emits a {VotingPeriodSet} event.\n */\n function setVotingPeriod(uint32 newVotingPeriod) public virtual onlyGovernance {\n _setVotingPeriod(newVotingPeriod);\n }\n\n /**\n * @dev Update the proposal threshold. This operation can only be performed through a governance proposal.\n *\n * Emits a {ProposalThresholdSet} event.\n */\n function setProposalThreshold(uint256 newProposalThreshold) public virtual onlyGovernance {\n _setProposalThreshold(newProposalThreshold);\n }\n\n /**\n * @dev Internal setter for the voting delay.\n *\n * Emits a {VotingDelaySet} event.\n */\n function _setVotingDelay(uint48 newVotingDelay) internal virtual {\n emit VotingDelaySet(_votingDelay, newVotingDelay);\n _votingDelay = newVotingDelay;\n }\n\n /**\n * @dev Internal setter for the voting period.\n *\n * Emits a {VotingPeriodSet} event.\n */\n function _setVotingPeriod(uint32 newVotingPeriod) internal virtual {\n if (newVotingPeriod == 0) {\n revert GovernorInvalidVotingPeriod(0);\n }\n emit VotingPeriodSet(_votingPeriod, newVotingPeriod);\n _votingPeriod = newVotingPeriod;\n }\n\n /**\n * @dev Internal setter for the proposal threshold.\n *\n * Emits a {ProposalThresholdSet} event.\n */\n function _setProposalThreshold(uint256 newProposalThreshold) internal virtual {\n emit ProposalThresholdSet(_proposalThreshold, newProposalThreshold);\n _proposalThreshold = newProposalThreshold;\n }\n}\n" + }, + "@openzeppelin/contracts/governance/extensions/GovernorVotes.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (governance/extensions/GovernorVotes.sol)\n\npragma solidity ^0.8.20;\n\nimport {Governor} from \"../Governor.sol\";\nimport {IVotes} from \"../utils/IVotes.sol\";\nimport {IERC5805} from \"../../interfaces/IERC5805.sol\";\nimport {SafeCast} from \"../../utils/math/SafeCast.sol\";\nimport {Time} from \"../../utils/types/Time.sol\";\n\n/**\n * @dev Extension of {Governor} for voting weight extraction from an {ERC20Votes} token, or since v4.5 an {ERC721Votes}\n * token.\n */\nabstract contract GovernorVotes is Governor {\n IERC5805 private immutable _token;\n\n constructor(IVotes tokenAddress) {\n _token = IERC5805(address(tokenAddress));\n }\n\n /**\n * @dev The token that voting power is sourced from.\n */\n function token() public view virtual returns (IERC5805) {\n return _token;\n }\n\n /**\n * @dev Clock (as specified in ERC-6372) is set to match the token's clock. Fallback to block numbers if the token\n * does not implement ERC-6372.\n */\n function clock() public view virtual override returns (uint48) {\n try token().clock() returns (uint48 timepoint) {\n return timepoint;\n } catch {\n return Time.blockNumber();\n }\n }\n\n /**\n * @dev Machine-readable description of the clock as specified in ERC-6372.\n */\n // solhint-disable-next-line func-name-mixedcase\n function CLOCK_MODE() public view virtual override returns (string memory) {\n try token().CLOCK_MODE() returns (string memory clockmode) {\n return clockmode;\n } catch {\n return \"mode=blocknumber&from=default\";\n }\n }\n\n /**\n * Read the voting weight from the token's built in snapshot mechanism (see {Governor-_getVotes}).\n */\n function _getVotes(\n address account,\n uint256 timepoint,\n bytes memory /*params*/\n ) internal view virtual override returns (uint256) {\n return token().getPastVotes(account, timepoint);\n }\n}\n" + }, + "@openzeppelin/contracts/governance/extensions/GovernorVotesQuorumFraction.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (governance/extensions/GovernorVotesQuorumFraction.sol)\n\npragma solidity ^0.8.20;\n\nimport {GovernorVotes} from \"./GovernorVotes.sol\";\nimport {SafeCast} from \"../../utils/math/SafeCast.sol\";\nimport {Checkpoints} from \"../../utils/structs/Checkpoints.sol\";\n\n/**\n * @dev Extension of {Governor} for voting weight extraction from an {ERC20Votes} token and a quorum expressed as a\n * fraction of the total supply.\n */\nabstract contract GovernorVotesQuorumFraction is GovernorVotes {\n using Checkpoints for Checkpoints.Trace208;\n\n Checkpoints.Trace208 private _quorumNumeratorHistory;\n\n event QuorumNumeratorUpdated(uint256 oldQuorumNumerator, uint256 newQuorumNumerator);\n\n /**\n * @dev The quorum set is not a valid fraction.\n */\n error GovernorInvalidQuorumFraction(uint256 quorumNumerator, uint256 quorumDenominator);\n\n /**\n * @dev Initialize quorum as a fraction of the token's total supply.\n *\n * The fraction is specified as `numerator / denominator`. By default the denominator is 100, so quorum is\n * specified as a percent: a numerator of 10 corresponds to quorum being 10% of total supply. The denominator can be\n * customized by overriding {quorumDenominator}.\n */\n constructor(uint256 quorumNumeratorValue) {\n _updateQuorumNumerator(quorumNumeratorValue);\n }\n\n /**\n * @dev Returns the current quorum numerator. See {quorumDenominator}.\n */\n function quorumNumerator() public view virtual returns (uint256) {\n return _quorumNumeratorHistory.latest();\n }\n\n /**\n * @dev Returns the quorum numerator at a specific timepoint. See {quorumDenominator}.\n */\n function quorumNumerator(uint256 timepoint) public view virtual returns (uint256) {\n uint256 length = _quorumNumeratorHistory._checkpoints.length;\n\n // Optimistic search, check the latest checkpoint\n Checkpoints.Checkpoint208 storage latest = _quorumNumeratorHistory._checkpoints[length - 1];\n uint48 latestKey = latest._key;\n uint208 latestValue = latest._value;\n if (latestKey <= timepoint) {\n return latestValue;\n }\n\n // Otherwise, do the binary search\n return _quorumNumeratorHistory.upperLookupRecent(SafeCast.toUint48(timepoint));\n }\n\n /**\n * @dev Returns the quorum denominator. Defaults to 100, but may be overridden.\n */\n function quorumDenominator() public view virtual returns (uint256) {\n return 100;\n }\n\n /**\n * @dev Returns the quorum for a timepoint, in terms of number of votes: `supply * numerator / denominator`.\n */\n function quorum(uint256 timepoint) public view virtual override returns (uint256) {\n return (token().getPastTotalSupply(timepoint) * quorumNumerator(timepoint)) / quorumDenominator();\n }\n\n /**\n * @dev Changes the quorum numerator.\n *\n * Emits a {QuorumNumeratorUpdated} event.\n *\n * Requirements:\n *\n * - Must be called through a governance proposal.\n * - New numerator must be smaller or equal to the denominator.\n */\n function updateQuorumNumerator(uint256 newQuorumNumerator) external virtual onlyGovernance {\n _updateQuorumNumerator(newQuorumNumerator);\n }\n\n /**\n * @dev Changes the quorum numerator.\n *\n * Emits a {QuorumNumeratorUpdated} event.\n *\n * Requirements:\n *\n * - New numerator must be smaller or equal to the denominator.\n */\n function _updateQuorumNumerator(uint256 newQuorumNumerator) internal virtual {\n uint256 denominator = quorumDenominator();\n if (newQuorumNumerator > denominator) {\n revert GovernorInvalidQuorumFraction(newQuorumNumerator, denominator);\n }\n\n uint256 oldQuorumNumerator = quorumNumerator();\n _quorumNumeratorHistory.push(clock(), SafeCast.toUint208(newQuorumNumerator));\n\n emit QuorumNumeratorUpdated(oldQuorumNumerator, newQuorumNumerator);\n }\n}\n" + }, + "@openzeppelin/contracts/governance/Governor.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (governance/Governor.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC721Receiver} from \"../token/ERC721/IERC721Receiver.sol\";\nimport {IERC1155Receiver} from \"../token/ERC1155/IERC1155Receiver.sol\";\nimport {EIP712} from \"../utils/cryptography/EIP712.sol\";\nimport {SignatureChecker} from \"../utils/cryptography/SignatureChecker.sol\";\nimport {IERC165, ERC165} from \"../utils/introspection/ERC165.sol\";\nimport {SafeCast} from \"../utils/math/SafeCast.sol\";\nimport {DoubleEndedQueue} from \"../utils/structs/DoubleEndedQueue.sol\";\nimport {Address} from \"../utils/Address.sol\";\nimport {Context} from \"../utils/Context.sol\";\nimport {Nonces} from \"../utils/Nonces.sol\";\nimport {IGovernor, IERC6372} from \"./IGovernor.sol\";\n\n/**\n * @dev Core of the governance system, designed to be extended through various modules.\n *\n * This contract is abstract and requires several functions to be implemented in various modules:\n *\n * - A counting module must implement {quorum}, {_quorumReached}, {_voteSucceeded} and {_countVote}\n * - A voting module must implement {_getVotes}\n * - Additionally, {votingPeriod} must also be implemented\n */\nabstract contract Governor is Context, ERC165, EIP712, Nonces, IGovernor, IERC721Receiver, IERC1155Receiver {\n using DoubleEndedQueue for DoubleEndedQueue.Bytes32Deque;\n\n bytes32 public constant BALLOT_TYPEHASH =\n keccak256(\"Ballot(uint256 proposalId,uint8 support,address voter,uint256 nonce)\");\n bytes32 public constant EXTENDED_BALLOT_TYPEHASH =\n keccak256(\n \"ExtendedBallot(uint256 proposalId,uint8 support,address voter,uint256 nonce,string reason,bytes params)\"\n );\n\n struct ProposalCore {\n address proposer;\n uint48 voteStart;\n uint32 voteDuration;\n bool executed;\n bool canceled;\n uint48 etaSeconds;\n }\n\n bytes32 private constant ALL_PROPOSAL_STATES_BITMAP = bytes32((2 ** (uint8(type(ProposalState).max) + 1)) - 1);\n string private _name;\n\n mapping(uint256 proposalId => ProposalCore) private _proposals;\n\n // This queue keeps track of the governor operating on itself. Calls to functions protected by the {onlyGovernance}\n // modifier needs to be whitelisted in this queue. Whitelisting is set in {execute}, consumed by the\n // {onlyGovernance} modifier and eventually reset after {_executeOperations} completes. This ensures that the\n // execution of {onlyGovernance} protected calls can only be achieved through successful proposals.\n DoubleEndedQueue.Bytes32Deque private _governanceCall;\n\n /**\n * @dev Restricts a function so it can only be executed through governance proposals. For example, governance\n * parameter setters in {GovernorSettings} are protected using this modifier.\n *\n * The governance executing address may be different from the Governor's own address, for example it could be a\n * timelock. This can be customized by modules by overriding {_executor}. The executor is only able to invoke these\n * functions during the execution of the governor's {execute} function, and not under any other circumstances. Thus,\n * for example, additional timelock proposers are not able to change governance parameters without going through the\n * governance protocol (since v4.6).\n */\n modifier onlyGovernance() {\n _checkGovernance();\n _;\n }\n\n /**\n * @dev Sets the value for {name} and {version}\n */\n constructor(string memory name_) EIP712(name_, version()) {\n _name = name_;\n }\n\n /**\n * @dev Function to receive ETH that will be handled by the governor (disabled if executor is a third party contract)\n */\n receive() external payable virtual {\n if (_executor() != address(this)) {\n revert GovernorDisabledDeposit();\n }\n }\n\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165, ERC165) returns (bool) {\n return\n interfaceId == type(IGovernor).interfaceId ||\n interfaceId == type(IERC1155Receiver).interfaceId ||\n super.supportsInterface(interfaceId);\n }\n\n /**\n * @dev See {IGovernor-name}.\n */\n function name() public view virtual returns (string memory) {\n return _name;\n }\n\n /**\n * @dev See {IGovernor-version}.\n */\n function version() public view virtual returns (string memory) {\n return \"1\";\n }\n\n /**\n * @dev See {IGovernor-hashProposal}.\n *\n * The proposal id is produced by hashing the ABI encoded `targets` array, the `values` array, the `calldatas` array\n * and the descriptionHash (bytes32 which itself is the keccak256 hash of the description string). This proposal id\n * can be produced from the proposal data which is part of the {ProposalCreated} event. It can even be computed in\n * advance, before the proposal is submitted.\n *\n * Note that the chainId and the governor address are not part of the proposal id computation. Consequently, the\n * same proposal (with same operation and same description) will have the same id if submitted on multiple governors\n * across multiple networks. This also means that in order to execute the same operation twice (on the same\n * governor) the proposer will have to change the description in order to avoid proposal id conflicts.\n */\n function hashProposal(\n address[] memory targets,\n uint256[] memory values,\n bytes[] memory calldatas,\n bytes32 descriptionHash\n ) public pure virtual returns (uint256) {\n return uint256(keccak256(abi.encode(targets, values, calldatas, descriptionHash)));\n }\n\n /**\n * @dev See {IGovernor-state}.\n */\n function state(uint256 proposalId) public view virtual returns (ProposalState) {\n // We read the struct fields into the stack at once so Solidity emits a single SLOAD\n ProposalCore storage proposal = _proposals[proposalId];\n bool proposalExecuted = proposal.executed;\n bool proposalCanceled = proposal.canceled;\n\n if (proposalExecuted) {\n return ProposalState.Executed;\n }\n\n if (proposalCanceled) {\n return ProposalState.Canceled;\n }\n\n uint256 snapshot = proposalSnapshot(proposalId);\n\n if (snapshot == 0) {\n revert GovernorNonexistentProposal(proposalId);\n }\n\n uint256 currentTimepoint = clock();\n\n if (snapshot >= currentTimepoint) {\n return ProposalState.Pending;\n }\n\n uint256 deadline = proposalDeadline(proposalId);\n\n if (deadline >= currentTimepoint) {\n return ProposalState.Active;\n } else if (!_quorumReached(proposalId) || !_voteSucceeded(proposalId)) {\n return ProposalState.Defeated;\n } else if (proposalEta(proposalId) == 0) {\n return ProposalState.Succeeded;\n } else {\n return ProposalState.Queued;\n }\n }\n\n /**\n * @dev See {IGovernor-proposalThreshold}.\n */\n function proposalThreshold() public view virtual returns (uint256) {\n return 0;\n }\n\n /**\n * @dev See {IGovernor-proposalSnapshot}.\n */\n function proposalSnapshot(uint256 proposalId) public view virtual returns (uint256) {\n return _proposals[proposalId].voteStart;\n }\n\n /**\n * @dev See {IGovernor-proposalDeadline}.\n */\n function proposalDeadline(uint256 proposalId) public view virtual returns (uint256) {\n return _proposals[proposalId].voteStart + _proposals[proposalId].voteDuration;\n }\n\n /**\n * @dev See {IGovernor-proposalProposer}.\n */\n function proposalProposer(uint256 proposalId) public view virtual returns (address) {\n return _proposals[proposalId].proposer;\n }\n\n /**\n * @dev See {IGovernor-proposalEta}.\n */\n function proposalEta(uint256 proposalId) public view virtual returns (uint256) {\n return _proposals[proposalId].etaSeconds;\n }\n\n /**\n * @dev See {IGovernor-proposalNeedsQueuing}.\n */\n function proposalNeedsQueuing(uint256) public view virtual returns (bool) {\n return false;\n }\n\n /**\n * @dev Reverts if the `msg.sender` is not the executor. In case the executor is not this contract\n * itself, the function reverts if `msg.data` is not whitelisted as a result of an {execute}\n * operation. See {onlyGovernance}.\n */\n function _checkGovernance() internal virtual {\n if (_executor() != _msgSender()) {\n revert GovernorOnlyExecutor(_msgSender());\n }\n if (_executor() != address(this)) {\n bytes32 msgDataHash = keccak256(_msgData());\n // loop until popping the expected operation - throw if deque is empty (operation not authorized)\n while (_governanceCall.popFront() != msgDataHash) {}\n }\n }\n\n /**\n * @dev Amount of votes already cast passes the threshold limit.\n */\n function _quorumReached(uint256 proposalId) internal view virtual returns (bool);\n\n /**\n * @dev Is the proposal successful or not.\n */\n function _voteSucceeded(uint256 proposalId) internal view virtual returns (bool);\n\n /**\n * @dev Get the voting weight of `account` at a specific `timepoint`, for a vote as described by `params`.\n */\n function _getVotes(address account, uint256 timepoint, bytes memory params) internal view virtual returns (uint256);\n\n /**\n * @dev Register a vote for `proposalId` by `account` with a given `support`, voting `weight` and voting `params`.\n *\n * Note: Support is generic and can represent various things depending on the voting system used.\n */\n function _countVote(\n uint256 proposalId,\n address account,\n uint8 support,\n uint256 totalWeight,\n bytes memory params\n ) internal virtual returns (uint256);\n\n /**\n * @dev Default additional encoded parameters used by castVote methods that don't include them\n *\n * Note: Should be overridden by specific implementations to use an appropriate value, the\n * meaning of the additional params, in the context of that implementation\n */\n function _defaultParams() internal view virtual returns (bytes memory) {\n return \"\";\n }\n\n /**\n * @dev See {IGovernor-propose}. This function has opt-in frontrunning protection, described in {_isValidDescriptionForProposer}.\n */\n function propose(\n address[] memory targets,\n uint256[] memory values,\n bytes[] memory calldatas,\n string memory description\n ) public virtual returns (uint256) {\n address proposer = _msgSender();\n\n // check description restriction\n if (!_isValidDescriptionForProposer(proposer, description)) {\n revert GovernorRestrictedProposer(proposer);\n }\n\n // check proposal threshold\n uint256 votesThreshold = proposalThreshold();\n if (votesThreshold > 0) {\n uint256 proposerVotes = getVotes(proposer, clock() - 1);\n if (proposerVotes < votesThreshold) {\n revert GovernorInsufficientProposerVotes(proposer, proposerVotes, votesThreshold);\n }\n }\n\n return _propose(targets, values, calldatas, description, proposer);\n }\n\n /**\n * @dev Internal propose mechanism. Can be overridden to add more logic on proposal creation.\n *\n * Emits a {IGovernor-ProposalCreated} event.\n */\n function _propose(\n address[] memory targets,\n uint256[] memory values,\n bytes[] memory calldatas,\n string memory description,\n address proposer\n ) internal virtual returns (uint256 proposalId) {\n proposalId = hashProposal(targets, values, calldatas, keccak256(bytes(description)));\n\n if (targets.length != values.length || targets.length != calldatas.length || targets.length == 0) {\n revert GovernorInvalidProposalLength(targets.length, calldatas.length, values.length);\n }\n if (_proposals[proposalId].voteStart != 0) {\n revert GovernorUnexpectedProposalState(proposalId, state(proposalId), bytes32(0));\n }\n\n uint256 snapshot = clock() + votingDelay();\n uint256 duration = votingPeriod();\n\n ProposalCore storage proposal = _proposals[proposalId];\n proposal.proposer = proposer;\n proposal.voteStart = SafeCast.toUint48(snapshot);\n proposal.voteDuration = SafeCast.toUint32(duration);\n\n emit ProposalCreated(\n proposalId,\n proposer,\n targets,\n values,\n new string[](targets.length),\n calldatas,\n snapshot,\n snapshot + duration,\n description\n );\n\n // Using a named return variable to avoid stack too deep errors\n }\n\n /**\n * @dev See {IGovernor-queue}.\n */\n function queue(\n address[] memory targets,\n uint256[] memory values,\n bytes[] memory calldatas,\n bytes32 descriptionHash\n ) public virtual returns (uint256) {\n uint256 proposalId = hashProposal(targets, values, calldatas, descriptionHash);\n\n _validateStateBitmap(proposalId, _encodeStateBitmap(ProposalState.Succeeded));\n\n uint48 etaSeconds = _queueOperations(proposalId, targets, values, calldatas, descriptionHash);\n\n if (etaSeconds != 0) {\n _proposals[proposalId].etaSeconds = etaSeconds;\n emit ProposalQueued(proposalId, etaSeconds);\n } else {\n revert GovernorQueueNotImplemented();\n }\n\n return proposalId;\n }\n\n /**\n * @dev Internal queuing mechanism. Can be overridden (without a super call) to modify the way queuing is\n * performed (for example adding a vault/timelock).\n *\n * This is empty by default, and must be overridden to implement queuing.\n *\n * This function returns a timestamp that describes the expected ETA for execution. If the returned value is 0\n * (which is the default value), the core will consider queueing did not succeed, and the public {queue} function\n * will revert.\n *\n * NOTE: Calling this function directly will NOT check the current state of the proposal, or emit the\n * `ProposalQueued` event. Queuing a proposal should be done using {queue}.\n */\n function _queueOperations(\n uint256 /*proposalId*/,\n address[] memory /*targets*/,\n uint256[] memory /*values*/,\n bytes[] memory /*calldatas*/,\n bytes32 /*descriptionHash*/\n ) internal virtual returns (uint48) {\n return 0;\n }\n\n /**\n * @dev See {IGovernor-execute}.\n */\n function execute(\n address[] memory targets,\n uint256[] memory values,\n bytes[] memory calldatas,\n bytes32 descriptionHash\n ) public payable virtual returns (uint256) {\n uint256 proposalId = hashProposal(targets, values, calldatas, descriptionHash);\n\n _validateStateBitmap(\n proposalId,\n _encodeStateBitmap(ProposalState.Succeeded) | _encodeStateBitmap(ProposalState.Queued)\n );\n\n // mark as executed before calls to avoid reentrancy\n _proposals[proposalId].executed = true;\n\n // before execute: register governance call in queue.\n if (_executor() != address(this)) {\n for (uint256 i = 0; i < targets.length; ++i) {\n if (targets[i] == address(this)) {\n _governanceCall.pushBack(keccak256(calldatas[i]));\n }\n }\n }\n\n _executeOperations(proposalId, targets, values, calldatas, descriptionHash);\n\n // after execute: cleanup governance call queue.\n if (_executor() != address(this) && !_governanceCall.empty()) {\n _governanceCall.clear();\n }\n\n emit ProposalExecuted(proposalId);\n\n return proposalId;\n }\n\n /**\n * @dev Internal execution mechanism. Can be overridden (without a super call) to modify the way execution is\n * performed (for example adding a vault/timelock).\n *\n * NOTE: Calling this function directly will NOT check the current state of the proposal, set the executed flag to\n * true or emit the `ProposalExecuted` event. Executing a proposal should be done using {execute} or {_execute}.\n */\n function _executeOperations(\n uint256 /* proposalId */,\n address[] memory targets,\n uint256[] memory values,\n bytes[] memory calldatas,\n bytes32 /*descriptionHash*/\n ) internal virtual {\n for (uint256 i = 0; i < targets.length; ++i) {\n (bool success, bytes memory returndata) = targets[i].call{value: values[i]}(calldatas[i]);\n Address.verifyCallResult(success, returndata);\n }\n }\n\n /**\n * @dev See {IGovernor-cancel}.\n */\n function cancel(\n address[] memory targets,\n uint256[] memory values,\n bytes[] memory calldatas,\n bytes32 descriptionHash\n ) public virtual returns (uint256) {\n // The proposalId will be recomputed in the `_cancel` call further down. However we need the value before we\n // do the internal call, because we need to check the proposal state BEFORE the internal `_cancel` call\n // changes it. The `hashProposal` duplication has a cost that is limited, and that we accept.\n uint256 proposalId = hashProposal(targets, values, calldatas, descriptionHash);\n\n // public cancel restrictions (on top of existing _cancel restrictions).\n _validateStateBitmap(proposalId, _encodeStateBitmap(ProposalState.Pending));\n if (_msgSender() != proposalProposer(proposalId)) {\n revert GovernorOnlyProposer(_msgSender());\n }\n\n return _cancel(targets, values, calldatas, descriptionHash);\n }\n\n /**\n * @dev Internal cancel mechanism with minimal restrictions. A proposal can be cancelled in any state other than\n * Canceled, Expired, or Executed. Once cancelled a proposal can't be re-submitted.\n *\n * Emits a {IGovernor-ProposalCanceled} event.\n */\n function _cancel(\n address[] memory targets,\n uint256[] memory values,\n bytes[] memory calldatas,\n bytes32 descriptionHash\n ) internal virtual returns (uint256) {\n uint256 proposalId = hashProposal(targets, values, calldatas, descriptionHash);\n\n _validateStateBitmap(\n proposalId,\n ALL_PROPOSAL_STATES_BITMAP ^\n _encodeStateBitmap(ProposalState.Canceled) ^\n _encodeStateBitmap(ProposalState.Expired) ^\n _encodeStateBitmap(ProposalState.Executed)\n );\n\n _proposals[proposalId].canceled = true;\n emit ProposalCanceled(proposalId);\n\n return proposalId;\n }\n\n /**\n * @dev See {IGovernor-getVotes}.\n */\n function getVotes(address account, uint256 timepoint) public view virtual returns (uint256) {\n return _getVotes(account, timepoint, _defaultParams());\n }\n\n /**\n * @dev See {IGovernor-getVotesWithParams}.\n */\n function getVotesWithParams(\n address account,\n uint256 timepoint,\n bytes memory params\n ) public view virtual returns (uint256) {\n return _getVotes(account, timepoint, params);\n }\n\n /**\n * @dev See {IGovernor-castVote}.\n */\n function castVote(uint256 proposalId, uint8 support) public virtual returns (uint256) {\n address voter = _msgSender();\n return _castVote(proposalId, voter, support, \"\");\n }\n\n /**\n * @dev See {IGovernor-castVoteWithReason}.\n */\n function castVoteWithReason(\n uint256 proposalId,\n uint8 support,\n string calldata reason\n ) public virtual returns (uint256) {\n address voter = _msgSender();\n return _castVote(proposalId, voter, support, reason);\n }\n\n /**\n * @dev See {IGovernor-castVoteWithReasonAndParams}.\n */\n function castVoteWithReasonAndParams(\n uint256 proposalId,\n uint8 support,\n string calldata reason,\n bytes memory params\n ) public virtual returns (uint256) {\n address voter = _msgSender();\n return _castVote(proposalId, voter, support, reason, params);\n }\n\n /**\n * @dev See {IGovernor-castVoteBySig}.\n */\n function castVoteBySig(\n uint256 proposalId,\n uint8 support,\n address voter,\n bytes memory signature\n ) public virtual returns (uint256) {\n bool valid = SignatureChecker.isValidSignatureNow(\n voter,\n _hashTypedDataV4(keccak256(abi.encode(BALLOT_TYPEHASH, proposalId, support, voter, _useNonce(voter)))),\n signature\n );\n\n if (!valid) {\n revert GovernorInvalidSignature(voter);\n }\n\n return _castVote(proposalId, voter, support, \"\");\n }\n\n /**\n * @dev See {IGovernor-castVoteWithReasonAndParamsBySig}.\n */\n function castVoteWithReasonAndParamsBySig(\n uint256 proposalId,\n uint8 support,\n address voter,\n string calldata reason,\n bytes memory params,\n bytes memory signature\n ) public virtual returns (uint256) {\n bool valid = SignatureChecker.isValidSignatureNow(\n voter,\n _hashTypedDataV4(\n keccak256(\n abi.encode(\n EXTENDED_BALLOT_TYPEHASH,\n proposalId,\n support,\n voter,\n _useNonce(voter),\n keccak256(bytes(reason)),\n keccak256(params)\n )\n )\n ),\n signature\n );\n\n if (!valid) {\n revert GovernorInvalidSignature(voter);\n }\n\n return _castVote(proposalId, voter, support, reason, params);\n }\n\n /**\n * @dev Internal vote casting mechanism: Check that the vote is pending, that it has not been cast yet, retrieve\n * voting weight using {IGovernor-getVotes} and call the {_countVote} internal function. Uses the _defaultParams().\n *\n * Emits a {IGovernor-VoteCast} event.\n */\n function _castVote(\n uint256 proposalId,\n address account,\n uint8 support,\n string memory reason\n ) internal virtual returns (uint256) {\n return _castVote(proposalId, account, support, reason, _defaultParams());\n }\n\n /**\n * @dev Internal vote casting mechanism: Check that the vote is pending, that it has not been cast yet, retrieve\n * voting weight using {IGovernor-getVotes} and call the {_countVote} internal function.\n *\n * Emits a {IGovernor-VoteCast} event.\n */\n function _castVote(\n uint256 proposalId,\n address account,\n uint8 support,\n string memory reason,\n bytes memory params\n ) internal virtual returns (uint256) {\n _validateStateBitmap(proposalId, _encodeStateBitmap(ProposalState.Active));\n\n uint256 totalWeight = _getVotes(account, proposalSnapshot(proposalId), params);\n uint256 votedWeight = _countVote(proposalId, account, support, totalWeight, params);\n\n if (params.length == 0) {\n emit VoteCast(account, proposalId, support, votedWeight, reason);\n } else {\n emit VoteCastWithParams(account, proposalId, support, votedWeight, reason, params);\n }\n\n return votedWeight;\n }\n\n /**\n * @dev Relays a transaction or function call to an arbitrary target. In cases where the governance executor\n * is some contract other than the governor itself, like when using a timelock, this function can be invoked\n * in a governance proposal to recover tokens or Ether that was sent to the governor contract by mistake.\n * Note that if the executor is simply the governor itself, use of `relay` is redundant.\n */\n function relay(address target, uint256 value, bytes calldata data) external payable virtual onlyGovernance {\n (bool success, bytes memory returndata) = target.call{value: value}(data);\n Address.verifyCallResult(success, returndata);\n }\n\n /**\n * @dev Address through which the governor executes action. Will be overloaded by module that execute actions\n * through another contract such as a timelock.\n */\n function _executor() internal view virtual returns (address) {\n return address(this);\n }\n\n /**\n * @dev See {IERC721Receiver-onERC721Received}.\n * Receiving tokens is disabled if the governance executor is other than the governor itself (eg. when using with a timelock).\n */\n function onERC721Received(address, address, uint256, bytes memory) public virtual returns (bytes4) {\n if (_executor() != address(this)) {\n revert GovernorDisabledDeposit();\n }\n return this.onERC721Received.selector;\n }\n\n /**\n * @dev See {IERC1155Receiver-onERC1155Received}.\n * Receiving tokens is disabled if the governance executor is other than the governor itself (eg. when using with a timelock).\n */\n function onERC1155Received(address, address, uint256, uint256, bytes memory) public virtual returns (bytes4) {\n if (_executor() != address(this)) {\n revert GovernorDisabledDeposit();\n }\n return this.onERC1155Received.selector;\n }\n\n /**\n * @dev See {IERC1155Receiver-onERC1155BatchReceived}.\n * Receiving tokens is disabled if the governance executor is other than the governor itself (eg. when using with a timelock).\n */\n function onERC1155BatchReceived(\n address,\n address,\n uint256[] memory,\n uint256[] memory,\n bytes memory\n ) public virtual returns (bytes4) {\n if (_executor() != address(this)) {\n revert GovernorDisabledDeposit();\n }\n return this.onERC1155BatchReceived.selector;\n }\n\n /**\n * @dev Encodes a `ProposalState` into a `bytes32` representation where each bit enabled corresponds to\n * the underlying position in the `ProposalState` enum. For example:\n *\n * 0x000...10000\n * ^^^^^^------ ...\n * ^----- Succeeded\n * ^---- Defeated\n * ^--- Canceled\n * ^-- Active\n * ^- Pending\n */\n function _encodeStateBitmap(ProposalState proposalState) internal pure returns (bytes32) {\n return bytes32(1 << uint8(proposalState));\n }\n\n /**\n * @dev Check that the current state of a proposal matches the requirements described by the `allowedStates` bitmap.\n * This bitmap should be built using `_encodeStateBitmap`.\n *\n * If requirements are not met, reverts with a {GovernorUnexpectedProposalState} error.\n */\n function _validateStateBitmap(uint256 proposalId, bytes32 allowedStates) private view returns (ProposalState) {\n ProposalState currentState = state(proposalId);\n if (_encodeStateBitmap(currentState) & allowedStates == bytes32(0)) {\n revert GovernorUnexpectedProposalState(proposalId, currentState, allowedStates);\n }\n return currentState;\n }\n\n /*\n * @dev Check if the proposer is authorized to submit a proposal with the given description.\n *\n * If the proposal description ends with `#proposer=0x???`, where `0x???` is an address written as a hex string\n * (case insensitive), then the submission of this proposal will only be authorized to said address.\n *\n * This is used for frontrunning protection. By adding this pattern at the end of their proposal, one can ensure\n * that no other address can submit the same proposal. An attacker would have to either remove or change that part,\n * which would result in a different proposal id.\n *\n * If the description does not match this pattern, it is unrestricted and anyone can submit it. This includes:\n * - If the `0x???` part is not a valid hex string.\n * - If the `0x???` part is a valid hex string, but does not contain exactly 40 hex digits.\n * - If it ends with the expected suffix followed by newlines or other whitespace.\n * - If it ends with some other similar suffix, e.g. `#other=abc`.\n * - If it does not end with any such suffix.\n */\n function _isValidDescriptionForProposer(\n address proposer,\n string memory description\n ) internal view virtual returns (bool) {\n uint256 len = bytes(description).length;\n\n // Length is too short to contain a valid proposer suffix\n if (len < 52) {\n return true;\n }\n\n // Extract what would be the `#proposer=0x` marker beginning the suffix\n bytes12 marker;\n assembly (\"memory-safe\") {\n // - Start of the string contents in memory = description + 32\n // - First character of the marker = len - 52\n // - Length of \"#proposer=0x0000000000000000000000000000000000000000\" = 52\n // - We read the memory word starting at the first character of the marker:\n // - (description + 32) + (len - 52) = description + (len - 20)\n // - Note: Solidity will ignore anything past the first 12 bytes\n marker := mload(add(description, sub(len, 20)))\n }\n\n // If the marker is not found, there is no proposer suffix to check\n if (marker != bytes12(\"#proposer=0x\")) {\n return true;\n }\n\n // Parse the 40 characters following the marker as uint160\n uint160 recovered = 0;\n for (uint256 i = len - 40; i < len; ++i) {\n (bool isHex, uint8 value) = _tryHexToUint(bytes(description)[i]);\n // If any of the characters is not a hex digit, ignore the suffix entirely\n if (!isHex) {\n return true;\n }\n recovered = (recovered << 4) | value;\n }\n\n return recovered == uint160(proposer);\n }\n\n /**\n * @dev Try to parse a character from a string as a hex value. Returns `(true, value)` if the char is in\n * `[0-9a-fA-F]` and `(false, 0)` otherwise. Value is guaranteed to be in the range `0 <= value < 16`\n */\n function _tryHexToUint(bytes1 char) private pure returns (bool isHex, uint8 value) {\n uint8 c = uint8(char);\n unchecked {\n // Case 0-9\n if (47 < c && c < 58) {\n return (true, c - 48);\n }\n // Case A-F\n else if (64 < c && c < 71) {\n return (true, c - 55);\n }\n // Case a-f\n else if (96 < c && c < 103) {\n return (true, c - 87);\n }\n // Else: not a hex char\n else {\n return (false, 0);\n }\n }\n }\n\n /**\n * @inheritdoc IERC6372\n */\n function clock() public view virtual returns (uint48);\n\n /**\n * @inheritdoc IERC6372\n */\n // solhint-disable-next-line func-name-mixedcase\n function CLOCK_MODE() public view virtual returns (string memory);\n\n /**\n * @inheritdoc IGovernor\n */\n function votingDelay() public view virtual returns (uint256);\n\n /**\n * @inheritdoc IGovernor\n */\n function votingPeriod() public view virtual returns (uint256);\n\n /**\n * @inheritdoc IGovernor\n */\n function quorum(uint256 timepoint) public view virtual returns (uint256);\n}\n" + }, + "@openzeppelin/contracts/governance/IGovernor.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (governance/IGovernor.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC165} from \"../interfaces/IERC165.sol\";\nimport {IERC6372} from \"../interfaces/IERC6372.sol\";\n\n/**\n * @dev Interface of the {Governor} core.\n *\n * NOTE: Event parameters lack the `indexed` keyword for compatibility with GovernorBravo events.\n * Making event parameters `indexed` affects how events are decoded, potentially breaking existing indexers.\n */\ninterface IGovernor is IERC165, IERC6372 {\n enum ProposalState {\n Pending,\n Active,\n Canceled,\n Defeated,\n Succeeded,\n Queued,\n Expired,\n Executed\n }\n\n /**\n * @dev Empty proposal or a mismatch between the parameters length for a proposal call.\n */\n error GovernorInvalidProposalLength(uint256 targets, uint256 calldatas, uint256 values);\n\n /**\n * @dev The vote was already cast.\n */\n error GovernorAlreadyCastVote(address voter);\n\n /**\n * @dev Token deposits are disabled in this contract.\n */\n error GovernorDisabledDeposit();\n\n /**\n * @dev The `account` is not a proposer.\n */\n error GovernorOnlyProposer(address account);\n\n /**\n * @dev The `account` is not the governance executor.\n */\n error GovernorOnlyExecutor(address account);\n\n /**\n * @dev The `proposalId` doesn't exist.\n */\n error GovernorNonexistentProposal(uint256 proposalId);\n\n /**\n * @dev The current state of a proposal is not the required for performing an operation.\n * The `expectedStates` is a bitmap with the bits enabled for each ProposalState enum position\n * counting from right to left.\n *\n * NOTE: If `expectedState` is `bytes32(0)`, the proposal is expected to not be in any state (i.e. not exist).\n * This is the case when a proposal that is expected to be unset is already initiated (the proposal is duplicated).\n *\n * See {Governor-_encodeStateBitmap}.\n */\n error GovernorUnexpectedProposalState(uint256 proposalId, ProposalState current, bytes32 expectedStates);\n\n /**\n * @dev The voting period set is not a valid period.\n */\n error GovernorInvalidVotingPeriod(uint256 votingPeriod);\n\n /**\n * @dev The `proposer` does not have the required votes to create a proposal.\n */\n error GovernorInsufficientProposerVotes(address proposer, uint256 votes, uint256 threshold);\n\n /**\n * @dev The `proposer` is not allowed to create a proposal.\n */\n error GovernorRestrictedProposer(address proposer);\n\n /**\n * @dev The vote type used is not valid for the corresponding counting module.\n */\n error GovernorInvalidVoteType();\n\n /**\n * @dev The provided params buffer is not supported by the counting module.\n */\n error GovernorInvalidVoteParams();\n\n /**\n * @dev Queue operation is not implemented for this governor. Execute should be called directly.\n */\n error GovernorQueueNotImplemented();\n\n /**\n * @dev The proposal hasn't been queued yet.\n */\n error GovernorNotQueuedProposal(uint256 proposalId);\n\n /**\n * @dev The proposal has already been queued.\n */\n error GovernorAlreadyQueuedProposal(uint256 proposalId);\n\n /**\n * @dev The provided signature is not valid for the expected `voter`.\n * If the `voter` is a contract, the signature is not valid using {IERC1271-isValidSignature}.\n */\n error GovernorInvalidSignature(address voter);\n\n /**\n * @dev Emitted when a proposal is created.\n */\n event ProposalCreated(\n uint256 proposalId,\n address proposer,\n address[] targets,\n uint256[] values,\n string[] signatures,\n bytes[] calldatas,\n uint256 voteStart,\n uint256 voteEnd,\n string description\n );\n\n /**\n * @dev Emitted when a proposal is queued.\n */\n event ProposalQueued(uint256 proposalId, uint256 etaSeconds);\n\n /**\n * @dev Emitted when a proposal is executed.\n */\n event ProposalExecuted(uint256 proposalId);\n\n /**\n * @dev Emitted when a proposal is canceled.\n */\n event ProposalCanceled(uint256 proposalId);\n\n /**\n * @dev Emitted when a vote is cast without params.\n *\n * Note: `support` values should be seen as buckets. Their interpretation depends on the voting module used.\n */\n event VoteCast(address indexed voter, uint256 proposalId, uint8 support, uint256 weight, string reason);\n\n /**\n * @dev Emitted when a vote is cast with params.\n *\n * Note: `support` values should be seen as buckets. Their interpretation depends on the voting module used.\n * `params` are additional encoded parameters. Their interpretation also depends on the voting module used.\n */\n event VoteCastWithParams(\n address indexed voter,\n uint256 proposalId,\n uint8 support,\n uint256 weight,\n string reason,\n bytes params\n );\n\n /**\n * @notice module:core\n * @dev Name of the governor instance (used in building the EIP-712 domain separator).\n */\n function name() external view returns (string memory);\n\n /**\n * @notice module:core\n * @dev Version of the governor instance (used in building the EIP-712 domain separator). Default: \"1\"\n */\n function version() external view returns (string memory);\n\n /**\n * @notice module:voting\n * @dev A description of the possible `support` values for {castVote} and the way these votes are counted, meant to\n * be consumed by UIs to show correct vote options and interpret the results. The string is a URL-encoded sequence of\n * key-value pairs that each describe one aspect, for example `support=bravo&quorum=for,abstain`.\n *\n * There are 2 standard keys: `support` and `quorum`.\n *\n * - `support=bravo` refers to the vote options 0 = Against, 1 = For, 2 = Abstain, as in `GovernorBravo`.\n * - `quorum=bravo` means that only For votes are counted towards quorum.\n * - `quorum=for,abstain` means that both For and Abstain votes are counted towards quorum.\n *\n * If a counting module makes use of encoded `params`, it should include this under a `params` key with a unique\n * name that describes the behavior. For example:\n *\n * - `params=fractional` might refer to a scheme where votes are divided fractionally between for/against/abstain.\n * - `params=erc721` might refer to a scheme where specific NFTs are delegated to vote.\n *\n * NOTE: The string can be decoded by the standard\n * https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams[`URLSearchParams`]\n * JavaScript class.\n */\n // solhint-disable-next-line func-name-mixedcase\n function COUNTING_MODE() external view returns (string memory);\n\n /**\n * @notice module:core\n * @dev Hashing function used to (re)build the proposal id from the proposal details..\n */\n function hashProposal(\n address[] memory targets,\n uint256[] memory values,\n bytes[] memory calldatas,\n bytes32 descriptionHash\n ) external pure returns (uint256);\n\n /**\n * @notice module:core\n * @dev Current state of a proposal, following Compound's convention\n */\n function state(uint256 proposalId) external view returns (ProposalState);\n\n /**\n * @notice module:core\n * @dev The number of votes required in order for a voter to become a proposer.\n */\n function proposalThreshold() external view returns (uint256);\n\n /**\n * @notice module:core\n * @dev Timepoint used to retrieve user's votes and quorum. If using block number (as per Compound's Comp), the\n * snapshot is performed at the end of this block. Hence, voting for this proposal starts at the beginning of the\n * following block.\n */\n function proposalSnapshot(uint256 proposalId) external view returns (uint256);\n\n /**\n * @notice module:core\n * @dev Timepoint at which votes close. If using block number, votes close at the end of this block, so it is\n * possible to cast a vote during this block.\n */\n function proposalDeadline(uint256 proposalId) external view returns (uint256);\n\n /**\n * @notice module:core\n * @dev The account that created a proposal.\n */\n function proposalProposer(uint256 proposalId) external view returns (address);\n\n /**\n * @notice module:core\n * @dev The time when a queued proposal becomes executable (\"ETA\"). Unlike {proposalSnapshot} and\n * {proposalDeadline}, this doesn't use the governor clock, and instead relies on the executor's clock which may be\n * different. In most cases this will be a timestamp.\n */\n function proposalEta(uint256 proposalId) external view returns (uint256);\n\n /**\n * @notice module:core\n * @dev Whether a proposal needs to be queued before execution.\n */\n function proposalNeedsQueuing(uint256 proposalId) external view returns (bool);\n\n /**\n * @notice module:user-config\n * @dev Delay, between the proposal is created and the vote starts. The unit this duration is expressed in depends\n * on the clock (see ERC-6372) this contract uses.\n *\n * This can be increased to leave time for users to buy voting power, or delegate it, before the voting of a\n * proposal starts.\n *\n * NOTE: While this interface returns a uint256, timepoints are stored as uint48 following the ERC-6372 clock type.\n * Consequently this value must fit in a uint48 (when added to the current clock). See {IERC6372-clock}.\n */\n function votingDelay() external view returns (uint256);\n\n /**\n * @notice module:user-config\n * @dev Delay between the vote start and vote end. The unit this duration is expressed in depends on the clock\n * (see ERC-6372) this contract uses.\n *\n * NOTE: The {votingDelay} can delay the start of the vote. This must be considered when setting the voting\n * duration compared to the voting delay.\n *\n * NOTE: This value is stored when the proposal is submitted so that possible changes to the value do not affect\n * proposals that have already been submitted. The type used to save it is a uint32. Consequently, while this\n * interface returns a uint256, the value it returns should fit in a uint32.\n */\n function votingPeriod() external view returns (uint256);\n\n /**\n * @notice module:user-config\n * @dev Minimum number of cast voted required for a proposal to be successful.\n *\n * NOTE: The `timepoint` parameter corresponds to the snapshot used for counting vote. This allows to scale the\n * quorum depending on values such as the totalSupply of a token at this timepoint (see {ERC20Votes}).\n */\n function quorum(uint256 timepoint) external view returns (uint256);\n\n /**\n * @notice module:reputation\n * @dev Voting power of an `account` at a specific `timepoint`.\n *\n * Note: this can be implemented in a number of ways, for example by reading the delegated balance from one (or\n * multiple), {ERC20Votes} tokens.\n */\n function getVotes(address account, uint256 timepoint) external view returns (uint256);\n\n /**\n * @notice module:reputation\n * @dev Voting power of an `account` at a specific `timepoint` given additional encoded parameters.\n */\n function getVotesWithParams(\n address account,\n uint256 timepoint,\n bytes memory params\n ) external view returns (uint256);\n\n /**\n * @notice module:voting\n * @dev Returns whether `account` has cast a vote on `proposalId`.\n */\n function hasVoted(uint256 proposalId, address account) external view returns (bool);\n\n /**\n * @dev Create a new proposal. Vote start after a delay specified by {IGovernor-votingDelay} and lasts for a\n * duration specified by {IGovernor-votingPeriod}.\n *\n * Emits a {ProposalCreated} event.\n *\n * NOTE: The state of the Governor and `targets` may change between the proposal creation and its execution.\n * This may be the result of third party actions on the targeted contracts, or other governor proposals.\n * For example, the balance of this contract could be updated or its access control permissions may be modified,\n * possibly compromising the proposal's ability to execute successfully (e.g. the governor doesn't have enough\n * value to cover a proposal with multiple transfers).\n */\n function propose(\n address[] memory targets,\n uint256[] memory values,\n bytes[] memory calldatas,\n string memory description\n ) external returns (uint256 proposalId);\n\n /**\n * @dev Queue a proposal. Some governors require this step to be performed before execution can happen. If queuing\n * is not necessary, this function may revert.\n * Queuing a proposal requires the quorum to be reached, the vote to be successful, and the deadline to be reached.\n *\n * Emits a {ProposalQueued} event.\n */\n function queue(\n address[] memory targets,\n uint256[] memory values,\n bytes[] memory calldatas,\n bytes32 descriptionHash\n ) external returns (uint256 proposalId);\n\n /**\n * @dev Execute a successful proposal. This requires the quorum to be reached, the vote to be successful, and the\n * deadline to be reached. Depending on the governor it might also be required that the proposal was queued and\n * that some delay passed.\n *\n * Emits a {ProposalExecuted} event.\n *\n * NOTE: Some modules can modify the requirements for execution, for example by adding an additional timelock.\n */\n function execute(\n address[] memory targets,\n uint256[] memory values,\n bytes[] memory calldatas,\n bytes32 descriptionHash\n ) external payable returns (uint256 proposalId);\n\n /**\n * @dev Cancel a proposal. A proposal is cancellable by the proposer, but only while it is Pending state, i.e.\n * before the vote starts.\n *\n * Emits a {ProposalCanceled} event.\n */\n function cancel(\n address[] memory targets,\n uint256[] memory values,\n bytes[] memory calldatas,\n bytes32 descriptionHash\n ) external returns (uint256 proposalId);\n\n /**\n * @dev Cast a vote\n *\n * Emits a {VoteCast} event.\n */\n function castVote(uint256 proposalId, uint8 support) external returns (uint256 balance);\n\n /**\n * @dev Cast a vote with a reason\n *\n * Emits a {VoteCast} event.\n */\n function castVoteWithReason(\n uint256 proposalId,\n uint8 support,\n string calldata reason\n ) external returns (uint256 balance);\n\n /**\n * @dev Cast a vote with a reason and additional encoded parameters\n *\n * Emits a {VoteCast} or {VoteCastWithParams} event depending on the length of params.\n */\n function castVoteWithReasonAndParams(\n uint256 proposalId,\n uint8 support,\n string calldata reason,\n bytes memory params\n ) external returns (uint256 balance);\n\n /**\n * @dev Cast a vote using the voter's signature, including ERC-1271 signature support.\n *\n * Emits a {VoteCast} event.\n */\n function castVoteBySig(\n uint256 proposalId,\n uint8 support,\n address voter,\n bytes memory signature\n ) external returns (uint256 balance);\n\n /**\n * @dev Cast a vote with a reason and additional encoded parameters using the voter's signature,\n * including ERC-1271 signature support.\n *\n * Emits a {VoteCast} or {VoteCastWithParams} event depending on the length of params.\n */\n function castVoteWithReasonAndParamsBySig(\n uint256 proposalId,\n uint8 support,\n address voter,\n string calldata reason,\n bytes memory params,\n bytes memory signature\n ) external returns (uint256 balance);\n}\n" + }, + "@openzeppelin/contracts/governance/utils/IVotes.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (governance/utils/IVotes.sol)\npragma solidity ^0.8.20;\n\n/**\n * @dev Common interface for {ERC20Votes}, {ERC721Votes}, and other {Votes}-enabled contracts.\n */\ninterface IVotes {\n /**\n * @dev The signature used has expired.\n */\n error VotesExpiredSignature(uint256 expiry);\n\n /**\n * @dev Emitted when an account changes their delegate.\n */\n event DelegateChanged(address indexed delegator, address indexed fromDelegate, address indexed toDelegate);\n\n /**\n * @dev Emitted when a token transfer or delegate change results in changes to a delegate's number of voting units.\n */\n event DelegateVotesChanged(address indexed delegate, uint256 previousVotes, uint256 newVotes);\n\n /**\n * @dev Returns the current amount of votes that `account` has.\n */\n function getVotes(address account) external view returns (uint256);\n\n /**\n * @dev Returns the amount of votes that `account` had at a specific moment in the past. If the `clock()` is\n * configured to use block numbers, this will return the value at the end of the corresponding block.\n */\n function getPastVotes(address account, uint256 timepoint) external view returns (uint256);\n\n /**\n * @dev Returns the total supply of votes available at a specific moment in the past. If the `clock()` is\n * configured to use block numbers, this will return the value at the end of the corresponding block.\n *\n * NOTE: This value is the sum of all available votes, which is not necessarily the sum of all delegated votes.\n * Votes that have not been delegated are still part of total supply, even though they would not participate in a\n * vote.\n */\n function getPastTotalSupply(uint256 timepoint) external view returns (uint256);\n\n /**\n * @dev Returns the delegate that `account` has chosen.\n */\n function delegates(address account) external view returns (address);\n\n /**\n * @dev Delegates votes from the sender to `delegatee`.\n */\n function delegate(address delegatee) external;\n\n /**\n * @dev Delegates votes from signer to `delegatee`.\n */\n function delegateBySig(address delegatee, uint256 nonce, uint256 expiry, uint8 v, bytes32 r, bytes32 s) external;\n}\n" + }, + "@openzeppelin/contracts/governance/utils/Votes.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (governance/utils/Votes.sol)\npragma solidity ^0.8.20;\n\nimport {IERC5805} from \"../../interfaces/IERC5805.sol\";\nimport {Context} from \"../../utils/Context.sol\";\nimport {Nonces} from \"../../utils/Nonces.sol\";\nimport {EIP712} from \"../../utils/cryptography/EIP712.sol\";\nimport {Checkpoints} from \"../../utils/structs/Checkpoints.sol\";\nimport {SafeCast} from \"../../utils/math/SafeCast.sol\";\nimport {ECDSA} from \"../../utils/cryptography/ECDSA.sol\";\nimport {Time} from \"../../utils/types/Time.sol\";\n\n/**\n * @dev This is a base abstract contract that tracks voting units, which are a measure of voting power that can be\n * transferred, and provides a system of vote delegation, where an account can delegate its voting units to a sort of\n * \"representative\" that will pool delegated voting units from different accounts and can then use it to vote in\n * decisions. In fact, voting units _must_ be delegated in order to count as actual votes, and an account has to\n * delegate those votes to itself if it wishes to participate in decisions and does not have a trusted representative.\n *\n * This contract is often combined with a token contract such that voting units correspond to token units. For an\n * example, see {ERC721Votes}.\n *\n * The full history of delegate votes is tracked on-chain so that governance protocols can consider votes as distributed\n * at a particular block number to protect against flash loans and double voting. The opt-in delegate system makes the\n * cost of this history tracking optional.\n *\n * When using this module the derived contract must implement {_getVotingUnits} (for example, make it return\n * {ERC721-balanceOf}), and can use {_transferVotingUnits} to track a change in the distribution of those units (in the\n * previous example, it would be included in {ERC721-_update}).\n */\nabstract contract Votes is Context, EIP712, Nonces, IERC5805 {\n using Checkpoints for Checkpoints.Trace208;\n\n bytes32 private constant DELEGATION_TYPEHASH =\n keccak256(\"Delegation(address delegatee,uint256 nonce,uint256 expiry)\");\n\n mapping(address account => address) private _delegatee;\n\n mapping(address delegatee => Checkpoints.Trace208) private _delegateCheckpoints;\n\n Checkpoints.Trace208 private _totalCheckpoints;\n\n /**\n * @dev The clock was incorrectly modified.\n */\n error ERC6372InconsistentClock();\n\n /**\n * @dev Lookup to future votes is not available.\n */\n error ERC5805FutureLookup(uint256 timepoint, uint48 clock);\n\n /**\n * @dev Clock used for flagging checkpoints. Can be overridden to implement timestamp based\n * checkpoints (and voting), in which case {CLOCK_MODE} should be overridden as well to match.\n */\n function clock() public view virtual returns (uint48) {\n return Time.blockNumber();\n }\n\n /**\n * @dev Machine-readable description of the clock as specified in ERC-6372.\n */\n // solhint-disable-next-line func-name-mixedcase\n function CLOCK_MODE() public view virtual returns (string memory) {\n // Check that the clock was not modified\n if (clock() != Time.blockNumber()) {\n revert ERC6372InconsistentClock();\n }\n return \"mode=blocknumber&from=default\";\n }\n\n /**\n * @dev Returns the current amount of votes that `account` has.\n */\n function getVotes(address account) public view virtual returns (uint256) {\n return _delegateCheckpoints[account].latest();\n }\n\n /**\n * @dev Returns the amount of votes that `account` had at a specific moment in the past. If the `clock()` is\n * configured to use block numbers, this will return the value at the end of the corresponding block.\n *\n * Requirements:\n *\n * - `timepoint` must be in the past. If operating using block numbers, the block must be already mined.\n */\n function getPastVotes(address account, uint256 timepoint) public view virtual returns (uint256) {\n uint48 currentTimepoint = clock();\n if (timepoint >= currentTimepoint) {\n revert ERC5805FutureLookup(timepoint, currentTimepoint);\n }\n return _delegateCheckpoints[account].upperLookupRecent(SafeCast.toUint48(timepoint));\n }\n\n /**\n * @dev Returns the total supply of votes available at a specific moment in the past. If the `clock()` is\n * configured to use block numbers, this will return the value at the end of the corresponding block.\n *\n * NOTE: This value is the sum of all available votes, which is not necessarily the sum of all delegated votes.\n * Votes that have not been delegated are still part of total supply, even though they would not participate in a\n * vote.\n *\n * Requirements:\n *\n * - `timepoint` must be in the past. If operating using block numbers, the block must be already mined.\n */\n function getPastTotalSupply(uint256 timepoint) public view virtual returns (uint256) {\n uint48 currentTimepoint = clock();\n if (timepoint >= currentTimepoint) {\n revert ERC5805FutureLookup(timepoint, currentTimepoint);\n }\n return _totalCheckpoints.upperLookupRecent(SafeCast.toUint48(timepoint));\n }\n\n /**\n * @dev Returns the current total supply of votes.\n */\n function _getTotalSupply() internal view virtual returns (uint256) {\n return _totalCheckpoints.latest();\n }\n\n /**\n * @dev Returns the delegate that `account` has chosen.\n */\n function delegates(address account) public view virtual returns (address) {\n return _delegatee[account];\n }\n\n /**\n * @dev Delegates votes from the sender to `delegatee`.\n */\n function delegate(address delegatee) public virtual {\n address account = _msgSender();\n _delegate(account, delegatee);\n }\n\n /**\n * @dev Delegates votes from signer to `delegatee`.\n */\n function delegateBySig(\n address delegatee,\n uint256 nonce,\n uint256 expiry,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) public virtual {\n if (block.timestamp > expiry) {\n revert VotesExpiredSignature(expiry);\n }\n address signer = ECDSA.recover(\n _hashTypedDataV4(keccak256(abi.encode(DELEGATION_TYPEHASH, delegatee, nonce, expiry))),\n v,\n r,\n s\n );\n _useCheckedNonce(signer, nonce);\n _delegate(signer, delegatee);\n }\n\n /**\n * @dev Delegate all of `account`'s voting units to `delegatee`.\n *\n * Emits events {IVotes-DelegateChanged} and {IVotes-DelegateVotesChanged}.\n */\n function _delegate(address account, address delegatee) internal virtual {\n address oldDelegate = delegates(account);\n _delegatee[account] = delegatee;\n\n emit DelegateChanged(account, oldDelegate, delegatee);\n _moveDelegateVotes(oldDelegate, delegatee, _getVotingUnits(account));\n }\n\n /**\n * @dev Transfers, mints, or burns voting units. To register a mint, `from` should be zero. To register a burn, `to`\n * should be zero. Total supply of voting units will be adjusted with mints and burns.\n */\n function _transferVotingUnits(address from, address to, uint256 amount) internal virtual {\n if (from == address(0)) {\n _push(_totalCheckpoints, _add, SafeCast.toUint208(amount));\n }\n if (to == address(0)) {\n _push(_totalCheckpoints, _subtract, SafeCast.toUint208(amount));\n }\n _moveDelegateVotes(delegates(from), delegates(to), amount);\n }\n\n /**\n * @dev Moves delegated votes from one delegate to another.\n */\n function _moveDelegateVotes(address from, address to, uint256 amount) internal virtual {\n if (from != to && amount > 0) {\n if (from != address(0)) {\n (uint256 oldValue, uint256 newValue) = _push(\n _delegateCheckpoints[from],\n _subtract,\n SafeCast.toUint208(amount)\n );\n emit DelegateVotesChanged(from, oldValue, newValue);\n }\n if (to != address(0)) {\n (uint256 oldValue, uint256 newValue) = _push(\n _delegateCheckpoints[to],\n _add,\n SafeCast.toUint208(amount)\n );\n emit DelegateVotesChanged(to, oldValue, newValue);\n }\n }\n }\n\n /**\n * @dev Get number of checkpoints for `account`.\n */\n function _numCheckpoints(address account) internal view virtual returns (uint32) {\n return SafeCast.toUint32(_delegateCheckpoints[account].length());\n }\n\n /**\n * @dev Get the `pos`-th checkpoint for `account`.\n */\n function _checkpoints(\n address account,\n uint32 pos\n ) internal view virtual returns (Checkpoints.Checkpoint208 memory) {\n return _delegateCheckpoints[account].at(pos);\n }\n\n function _push(\n Checkpoints.Trace208 storage store,\n function(uint208, uint208) view returns (uint208) op,\n uint208 delta\n ) private returns (uint208 oldValue, uint208 newValue) {\n return store.push(clock(), op(store.latest(), delta));\n }\n\n function _add(uint208 a, uint208 b) private pure returns (uint208) {\n return a + b;\n }\n\n function _subtract(uint208 a, uint208 b) private pure returns (uint208) {\n return a - b;\n }\n\n /**\n * @dev Must return the voting units held by an account.\n */\n function _getVotingUnits(address) internal view virtual returns (uint256);\n}\n" + }, + "@openzeppelin/contracts/interfaces/draft-IERC6093.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (interfaces/draft-IERC6093.sol)\npragma solidity ^0.8.20;\n\n/**\n * @dev Standard ERC-20 Errors\n * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC-20 tokens.\n */\ninterface IERC20Errors {\n /**\n * @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers.\n * @param sender Address whose tokens are being transferred.\n * @param balance Current balance for the interacting account.\n * @param needed Minimum amount required to perform a transfer.\n */\n error ERC20InsufficientBalance(address sender, uint256 balance, uint256 needed);\n\n /**\n * @dev Indicates a failure with the token `sender`. Used in transfers.\n * @param sender Address whose tokens are being transferred.\n */\n error ERC20InvalidSender(address sender);\n\n /**\n * @dev Indicates a failure with the token `receiver`. Used in transfers.\n * @param receiver Address to which tokens are being transferred.\n */\n error ERC20InvalidReceiver(address receiver);\n\n /**\n * @dev Indicates a failure with the `spender`’s `allowance`. Used in transfers.\n * @param spender Address that may be allowed to operate on tokens without being their owner.\n * @param allowance Amount of tokens a `spender` is allowed to operate with.\n * @param needed Minimum amount required to perform a transfer.\n */\n error ERC20InsufficientAllowance(address spender, uint256 allowance, uint256 needed);\n\n /**\n * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.\n * @param approver Address initiating an approval operation.\n */\n error ERC20InvalidApprover(address approver);\n\n /**\n * @dev Indicates a failure with the `spender` to be approved. Used in approvals.\n * @param spender Address that may be allowed to operate on tokens without being their owner.\n */\n error ERC20InvalidSpender(address spender);\n}\n\n/**\n * @dev Standard ERC-721 Errors\n * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC-721 tokens.\n */\ninterface IERC721Errors {\n /**\n * @dev Indicates that an address can't be an owner. For example, `address(0)` is a forbidden owner in ERC-20.\n * Used in balance queries.\n * @param owner Address of the current owner of a token.\n */\n error ERC721InvalidOwner(address owner);\n\n /**\n * @dev Indicates a `tokenId` whose `owner` is the zero address.\n * @param tokenId Identifier number of a token.\n */\n error ERC721NonexistentToken(uint256 tokenId);\n\n /**\n * @dev Indicates an error related to the ownership over a particular token. Used in transfers.\n * @param sender Address whose tokens are being transferred.\n * @param tokenId Identifier number of a token.\n * @param owner Address of the current owner of a token.\n */\n error ERC721IncorrectOwner(address sender, uint256 tokenId, address owner);\n\n /**\n * @dev Indicates a failure with the token `sender`. Used in transfers.\n * @param sender Address whose tokens are being transferred.\n */\n error ERC721InvalidSender(address sender);\n\n /**\n * @dev Indicates a failure with the token `receiver`. Used in transfers.\n * @param receiver Address to which tokens are being transferred.\n */\n error ERC721InvalidReceiver(address receiver);\n\n /**\n * @dev Indicates a failure with the `operator`’s approval. Used in transfers.\n * @param operator Address that may be allowed to operate on tokens without being their owner.\n * @param tokenId Identifier number of a token.\n */\n error ERC721InsufficientApproval(address operator, uint256 tokenId);\n\n /**\n * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.\n * @param approver Address initiating an approval operation.\n */\n error ERC721InvalidApprover(address approver);\n\n /**\n * @dev Indicates a failure with the `operator` to be approved. Used in approvals.\n * @param operator Address that may be allowed to operate on tokens without being their owner.\n */\n error ERC721InvalidOperator(address operator);\n}\n\n/**\n * @dev Standard ERC-1155 Errors\n * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC-1155 tokens.\n */\ninterface IERC1155Errors {\n /**\n * @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers.\n * @param sender Address whose tokens are being transferred.\n * @param balance Current balance for the interacting account.\n * @param needed Minimum amount required to perform a transfer.\n * @param tokenId Identifier number of a token.\n */\n error ERC1155InsufficientBalance(address sender, uint256 balance, uint256 needed, uint256 tokenId);\n\n /**\n * @dev Indicates a failure with the token `sender`. Used in transfers.\n * @param sender Address whose tokens are being transferred.\n */\n error ERC1155InvalidSender(address sender);\n\n /**\n * @dev Indicates a failure with the token `receiver`. Used in transfers.\n * @param receiver Address to which tokens are being transferred.\n */\n error ERC1155InvalidReceiver(address receiver);\n\n /**\n * @dev Indicates a failure with the `operator`’s approval. Used in transfers.\n * @param operator Address that may be allowed to operate on tokens without being their owner.\n * @param owner Address of the current owner of a token.\n */\n error ERC1155MissingApprovalForAll(address operator, address owner);\n\n /**\n * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.\n * @param approver Address initiating an approval operation.\n */\n error ERC1155InvalidApprover(address approver);\n\n /**\n * @dev Indicates a failure with the `operator` to be approved. Used in approvals.\n * @param operator Address that may be allowed to operate on tokens without being their owner.\n */\n error ERC1155InvalidOperator(address operator);\n\n /**\n * @dev Indicates an array length mismatch between ids and values in a safeBatchTransferFrom operation.\n * Used in batch transfers.\n * @param idsLength Length of the array of token identifiers\n * @param valuesLength Length of the array of token amounts\n */\n error ERC1155InvalidArrayLength(uint256 idsLength, uint256 valuesLength);\n}\n" + }, + "@openzeppelin/contracts/interfaces/IERC1271.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (interfaces/IERC1271.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Interface of the ERC-1271 standard signature validation method for\n * contracts as defined in https://eips.ethereum.org/EIPS/eip-1271[ERC-1271].\n */\ninterface IERC1271 {\n /**\n * @dev Should return whether the signature provided is valid for the provided data\n * @param hash Hash of the data to be signed\n * @param signature Signature byte array associated with _data\n */\n function isValidSignature(bytes32 hash, bytes memory signature) external view returns (bytes4 magicValue);\n}\n" + }, + "@openzeppelin/contracts/interfaces/IERC165.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC165.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC165} from \"../utils/introspection/IERC165.sol\";\n" + }, + "@openzeppelin/contracts/interfaces/IERC4906.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (interfaces/IERC4906.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC165} from \"./IERC165.sol\";\nimport {IERC721} from \"./IERC721.sol\";\n\n/// @title ERC-721 Metadata Update Extension\ninterface IERC4906 is IERC165, IERC721 {\n /// @dev This event emits when the metadata of a token is changed.\n /// So that the third-party platforms such as NFT market could\n /// timely update the images and related attributes of the NFT.\n event MetadataUpdate(uint256 _tokenId);\n\n /// @dev This event emits when the metadata of a range of tokens is changed.\n /// So that the third-party platforms such as NFT market could\n /// timely update the images and related attributes of the NFTs.\n event BatchMetadataUpdate(uint256 _fromTokenId, uint256 _toTokenId);\n}\n" + }, + "@openzeppelin/contracts/interfaces/IERC5267.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC5267.sol)\n\npragma solidity ^0.8.20;\n\ninterface IERC5267 {\n /**\n * @dev MAY be emitted to signal that the domain could have changed.\n */\n event EIP712DomainChanged();\n\n /**\n * @dev returns the fields and values that describe the domain separator used by this contract for EIP-712\n * signature.\n */\n function eip712Domain()\n external\n view\n returns (\n bytes1 fields,\n string memory name,\n string memory version,\n uint256 chainId,\n address verifyingContract,\n bytes32 salt,\n uint256[] memory extensions\n );\n}\n" + }, + "@openzeppelin/contracts/interfaces/IERC5805.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC5805.sol)\n\npragma solidity ^0.8.20;\n\nimport {IVotes} from \"../governance/utils/IVotes.sol\";\nimport {IERC6372} from \"./IERC6372.sol\";\n\ninterface IERC5805 is IERC6372, IVotes {}\n" + }, + "@openzeppelin/contracts/interfaces/IERC6372.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC6372.sol)\n\npragma solidity ^0.8.20;\n\ninterface IERC6372 {\n /**\n * @dev Clock used for flagging checkpoints. Can be overridden to implement timestamp based checkpoints (and voting).\n */\n function clock() external view returns (uint48);\n\n /**\n * @dev Description of the clock\n */\n // solhint-disable-next-line func-name-mixedcase\n function CLOCK_MODE() external view returns (string memory);\n}\n" + }, + "@openzeppelin/contracts/interfaces/IERC721.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC721.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC721} from \"../token/ERC721/IERC721.sol\";\n" + }, + "@openzeppelin/contracts/token/ERC1155/IERC1155Receiver.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC1155/IERC1155Receiver.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC165} from \"../../utils/introspection/IERC165.sol\";\n\n/**\n * @dev Interface that must be implemented by smart contracts in order to receive\n * ERC-1155 token transfers.\n */\ninterface IERC1155Receiver is IERC165 {\n /**\n * @dev Handles the receipt of a single ERC-1155 token type. This function is\n * called at the end of a `safeTransferFrom` after the balance has been updated.\n *\n * NOTE: To accept the transfer, this must return\n * `bytes4(keccak256(\"onERC1155Received(address,address,uint256,uint256,bytes)\"))`\n * (i.e. 0xf23a6e61, or its own function selector).\n *\n * @param operator The address which initiated the transfer (i.e. msg.sender)\n * @param from The address which previously owned the token\n * @param id The ID of the token being transferred\n * @param value The amount of tokens being transferred\n * @param data Additional data with no specified format\n * @return `bytes4(keccak256(\"onERC1155Received(address,address,uint256,uint256,bytes)\"))` if transfer is allowed\n */\n function onERC1155Received(\n address operator,\n address from,\n uint256 id,\n uint256 value,\n bytes calldata data\n ) external returns (bytes4);\n\n /**\n * @dev Handles the receipt of a multiple ERC-1155 token types. This function\n * is called at the end of a `safeBatchTransferFrom` after the balances have\n * been updated.\n *\n * NOTE: To accept the transfer(s), this must return\n * `bytes4(keccak256(\"onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)\"))`\n * (i.e. 0xbc197c81, or its own function selector).\n *\n * @param operator The address which initiated the batch transfer (i.e. msg.sender)\n * @param from The address which previously owned the token\n * @param ids An array containing ids of each token being transferred (order and length must match values array)\n * @param values An array containing amounts of each token being transferred (order and length must match ids array)\n * @param data Additional data with no specified format\n * @return `bytes4(keccak256(\"onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)\"))` if transfer is allowed\n */\n function onERC1155BatchReceived(\n address operator,\n address from,\n uint256[] calldata ids,\n uint256[] calldata values,\n bytes calldata data\n ) external returns (bytes4);\n}\n" + }, + "@openzeppelin/contracts/token/ERC721/ERC721.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC721/ERC721.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC721} from \"./IERC721.sol\";\nimport {IERC721Metadata} from \"./extensions/IERC721Metadata.sol\";\nimport {ERC721Utils} from \"./utils/ERC721Utils.sol\";\nimport {Context} from \"../../utils/Context.sol\";\nimport {Strings} from \"../../utils/Strings.sol\";\nimport {IERC165, ERC165} from \"../../utils/introspection/ERC165.sol\";\nimport {IERC721Errors} from \"../../interfaces/draft-IERC6093.sol\";\n\n/**\n * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC-721] Non-Fungible Token Standard, including\n * the Metadata extension, but not including the Enumerable extension, which is available separately as\n * {ERC721Enumerable}.\n */\nabstract contract ERC721 is Context, ERC165, IERC721, IERC721Metadata, IERC721Errors {\n using Strings for uint256;\n\n // Token name\n string private _name;\n\n // Token symbol\n string private _symbol;\n\n mapping(uint256 tokenId => address) private _owners;\n\n mapping(address owner => uint256) private _balances;\n\n mapping(uint256 tokenId => address) private _tokenApprovals;\n\n mapping(address owner => mapping(address operator => bool)) private _operatorApprovals;\n\n /**\n * @dev Initializes the contract by setting a `name` and a `symbol` to the token collection.\n */\n constructor(string memory name_, string memory symbol_) {\n _name = name_;\n _symbol = symbol_;\n }\n\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {\n return\n interfaceId == type(IERC721).interfaceId ||\n interfaceId == type(IERC721Metadata).interfaceId ||\n super.supportsInterface(interfaceId);\n }\n\n /**\n * @dev See {IERC721-balanceOf}.\n */\n function balanceOf(address owner) public view virtual returns (uint256) {\n if (owner == address(0)) {\n revert ERC721InvalidOwner(address(0));\n }\n return _balances[owner];\n }\n\n /**\n * @dev See {IERC721-ownerOf}.\n */\n function ownerOf(uint256 tokenId) public view virtual returns (address) {\n return _requireOwned(tokenId);\n }\n\n /**\n * @dev See {IERC721Metadata-name}.\n */\n function name() public view virtual returns (string memory) {\n return _name;\n }\n\n /**\n * @dev See {IERC721Metadata-symbol}.\n */\n function symbol() public view virtual returns (string memory) {\n return _symbol;\n }\n\n /**\n * @dev See {IERC721Metadata-tokenURI}.\n */\n function tokenURI(uint256 tokenId) public view virtual returns (string memory) {\n _requireOwned(tokenId);\n\n string memory baseURI = _baseURI();\n return bytes(baseURI).length > 0 ? string.concat(baseURI, tokenId.toString()) : \"\";\n }\n\n /**\n * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each\n * token will be the concatenation of the `baseURI` and the `tokenId`. Empty\n * by default, can be overridden in child contracts.\n */\n function _baseURI() internal view virtual returns (string memory) {\n return \"\";\n }\n\n /**\n * @dev See {IERC721-approve}.\n */\n function approve(address to, uint256 tokenId) public virtual {\n _approve(to, tokenId, _msgSender());\n }\n\n /**\n * @dev See {IERC721-getApproved}.\n */\n function getApproved(uint256 tokenId) public view virtual returns (address) {\n _requireOwned(tokenId);\n\n return _getApproved(tokenId);\n }\n\n /**\n * @dev See {IERC721-setApprovalForAll}.\n */\n function setApprovalForAll(address operator, bool approved) public virtual {\n _setApprovalForAll(_msgSender(), operator, approved);\n }\n\n /**\n * @dev See {IERC721-isApprovedForAll}.\n */\n function isApprovedForAll(address owner, address operator) public view virtual returns (bool) {\n return _operatorApprovals[owner][operator];\n }\n\n /**\n * @dev See {IERC721-transferFrom}.\n */\n function transferFrom(address from, address to, uint256 tokenId) public virtual {\n if (to == address(0)) {\n revert ERC721InvalidReceiver(address(0));\n }\n // Setting an \"auth\" arguments enables the `_isAuthorized` check which verifies that the token exists\n // (from != 0). Therefore, it is not needed to verify that the return value is not 0 here.\n address previousOwner = _update(to, tokenId, _msgSender());\n if (previousOwner != from) {\n revert ERC721IncorrectOwner(from, tokenId, previousOwner);\n }\n }\n\n /**\n * @dev See {IERC721-safeTransferFrom}.\n */\n function safeTransferFrom(address from, address to, uint256 tokenId) public {\n safeTransferFrom(from, to, tokenId, \"\");\n }\n\n /**\n * @dev See {IERC721-safeTransferFrom}.\n */\n function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory data) public virtual {\n transferFrom(from, to, tokenId);\n ERC721Utils.checkOnERC721Received(_msgSender(), from, to, tokenId, data);\n }\n\n /**\n * @dev Returns the owner of the `tokenId`. Does NOT revert if token doesn't exist\n *\n * IMPORTANT: Any overrides to this function that add ownership of tokens not tracked by the\n * core ERC-721 logic MUST be matched with the use of {_increaseBalance} to keep balances\n * consistent with ownership. The invariant to preserve is that for any address `a` the value returned by\n * `balanceOf(a)` must be equal to the number of tokens such that `_ownerOf(tokenId)` is `a`.\n */\n function _ownerOf(uint256 tokenId) internal view virtual returns (address) {\n return _owners[tokenId];\n }\n\n /**\n * @dev Returns the approved address for `tokenId`. Returns 0 if `tokenId` is not minted.\n */\n function _getApproved(uint256 tokenId) internal view virtual returns (address) {\n return _tokenApprovals[tokenId];\n }\n\n /**\n * @dev Returns whether `spender` is allowed to manage `owner`'s tokens, or `tokenId` in\n * particular (ignoring whether it is owned by `owner`).\n *\n * WARNING: This function assumes that `owner` is the actual owner of `tokenId` and does not verify this\n * assumption.\n */\n function _isAuthorized(address owner, address spender, uint256 tokenId) internal view virtual returns (bool) {\n return\n spender != address(0) &&\n (owner == spender || isApprovedForAll(owner, spender) || _getApproved(tokenId) == spender);\n }\n\n /**\n * @dev Checks if `spender` can operate on `tokenId`, assuming the provided `owner` is the actual owner.\n * Reverts if:\n * - `spender` does not have approval from `owner` for `tokenId`.\n * - `spender` does not have approval to manage all of `owner`'s assets.\n *\n * WARNING: This function assumes that `owner` is the actual owner of `tokenId` and does not verify this\n * assumption.\n */\n function _checkAuthorized(address owner, address spender, uint256 tokenId) internal view virtual {\n if (!_isAuthorized(owner, spender, tokenId)) {\n if (owner == address(0)) {\n revert ERC721NonexistentToken(tokenId);\n } else {\n revert ERC721InsufficientApproval(spender, tokenId);\n }\n }\n }\n\n /**\n * @dev Unsafe write access to the balances, used by extensions that \"mint\" tokens using an {ownerOf} override.\n *\n * NOTE: the value is limited to type(uint128).max. This protect against _balance overflow. It is unrealistic that\n * a uint256 would ever overflow from increments when these increments are bounded to uint128 values.\n *\n * WARNING: Increasing an account's balance using this function tends to be paired with an override of the\n * {_ownerOf} function to resolve the ownership of the corresponding tokens so that balances and ownership\n * remain consistent with one another.\n */\n function _increaseBalance(address account, uint128 value) internal virtual {\n unchecked {\n _balances[account] += value;\n }\n }\n\n /**\n * @dev Transfers `tokenId` from its current owner to `to`, or alternatively mints (or burns) if the current owner\n * (or `to`) is the zero address. Returns the owner of the `tokenId` before the update.\n *\n * The `auth` argument is optional. If the value passed is non 0, then this function will check that\n * `auth` is either the owner of the token, or approved to operate on the token (by the owner).\n *\n * Emits a {Transfer} event.\n *\n * NOTE: If overriding this function in a way that tracks balances, see also {_increaseBalance}.\n */\n function _update(address to, uint256 tokenId, address auth) internal virtual returns (address) {\n address from = _ownerOf(tokenId);\n\n // Perform (optional) operator check\n if (auth != address(0)) {\n _checkAuthorized(from, auth, tokenId);\n }\n\n // Execute the update\n if (from != address(0)) {\n // Clear approval. No need to re-authorize or emit the Approval event\n _approve(address(0), tokenId, address(0), false);\n\n unchecked {\n _balances[from] -= 1;\n }\n }\n\n if (to != address(0)) {\n unchecked {\n _balances[to] += 1;\n }\n }\n\n _owners[tokenId] = to;\n\n emit Transfer(from, to, tokenId);\n\n return from;\n }\n\n /**\n * @dev Mints `tokenId` and transfers it to `to`.\n *\n * WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible\n *\n * Requirements:\n *\n * - `tokenId` must not exist.\n * - `to` cannot be the zero address.\n *\n * Emits a {Transfer} event.\n */\n function _mint(address to, uint256 tokenId) internal {\n if (to == address(0)) {\n revert ERC721InvalidReceiver(address(0));\n }\n address previousOwner = _update(to, tokenId, address(0));\n if (previousOwner != address(0)) {\n revert ERC721InvalidSender(address(0));\n }\n }\n\n /**\n * @dev Mints `tokenId`, transfers it to `to` and checks for `to` acceptance.\n *\n * Requirements:\n *\n * - `tokenId` must not exist.\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\n *\n * Emits a {Transfer} event.\n */\n function _safeMint(address to, uint256 tokenId) internal {\n _safeMint(to, tokenId, \"\");\n }\n\n /**\n * @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is\n * forwarded in {IERC721Receiver-onERC721Received} to contract recipients.\n */\n function _safeMint(address to, uint256 tokenId, bytes memory data) internal virtual {\n _mint(to, tokenId);\n ERC721Utils.checkOnERC721Received(_msgSender(), address(0), to, tokenId, data);\n }\n\n /**\n * @dev Destroys `tokenId`.\n * The approval is cleared when the token is burned.\n * This is an internal function that does not check if the sender is authorized to operate on the token.\n *\n * Requirements:\n *\n * - `tokenId` must exist.\n *\n * Emits a {Transfer} event.\n */\n function _burn(uint256 tokenId) internal {\n address previousOwner = _update(address(0), tokenId, address(0));\n if (previousOwner == address(0)) {\n revert ERC721NonexistentToken(tokenId);\n }\n }\n\n /**\n * @dev Transfers `tokenId` from `from` to `to`.\n * As opposed to {transferFrom}, this imposes no restrictions on msg.sender.\n *\n * Requirements:\n *\n * - `to` cannot be the zero address.\n * - `tokenId` token must be owned by `from`.\n *\n * Emits a {Transfer} event.\n */\n function _transfer(address from, address to, uint256 tokenId) internal {\n if (to == address(0)) {\n revert ERC721InvalidReceiver(address(0));\n }\n address previousOwner = _update(to, tokenId, address(0));\n if (previousOwner == address(0)) {\n revert ERC721NonexistentToken(tokenId);\n } else if (previousOwner != from) {\n revert ERC721IncorrectOwner(from, tokenId, previousOwner);\n }\n }\n\n /**\n * @dev Safely transfers `tokenId` token from `from` to `to`, checking that contract recipients\n * are aware of the ERC-721 standard to prevent tokens from being forever locked.\n *\n * `data` is additional data, it has no specified format and it is sent in call to `to`.\n *\n * This internal function is like {safeTransferFrom} in the sense that it invokes\n * {IERC721Receiver-onERC721Received} on the receiver, and can be used to e.g.\n * implement alternative mechanisms to perform token transfer, such as signature-based.\n *\n * Requirements:\n *\n * - `tokenId` token must exist and be owned by `from`.\n * - `to` cannot be the zero address.\n * - `from` cannot be the zero address.\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\n *\n * Emits a {Transfer} event.\n */\n function _safeTransfer(address from, address to, uint256 tokenId) internal {\n _safeTransfer(from, to, tokenId, \"\");\n }\n\n /**\n * @dev Same as {xref-ERC721-_safeTransfer-address-address-uint256-}[`_safeTransfer`], with an additional `data` parameter which is\n * forwarded in {IERC721Receiver-onERC721Received} to contract recipients.\n */\n function _safeTransfer(address from, address to, uint256 tokenId, bytes memory data) internal virtual {\n _transfer(from, to, tokenId);\n ERC721Utils.checkOnERC721Received(_msgSender(), from, to, tokenId, data);\n }\n\n /**\n * @dev Approve `to` to operate on `tokenId`\n *\n * The `auth` argument is optional. If the value passed is non 0, then this function will check that `auth` is\n * either the owner of the token, or approved to operate on all tokens held by this owner.\n *\n * Emits an {Approval} event.\n *\n * Overrides to this logic should be done to the variant with an additional `bool emitEvent` argument.\n */\n function _approve(address to, uint256 tokenId, address auth) internal {\n _approve(to, tokenId, auth, true);\n }\n\n /**\n * @dev Variant of `_approve` with an optional flag to enable or disable the {Approval} event. The event is not\n * emitted in the context of transfers.\n */\n function _approve(address to, uint256 tokenId, address auth, bool emitEvent) internal virtual {\n // Avoid reading the owner unless necessary\n if (emitEvent || auth != address(0)) {\n address owner = _requireOwned(tokenId);\n\n // We do not use _isAuthorized because single-token approvals should not be able to call approve\n if (auth != address(0) && owner != auth && !isApprovedForAll(owner, auth)) {\n revert ERC721InvalidApprover(auth);\n }\n\n if (emitEvent) {\n emit Approval(owner, to, tokenId);\n }\n }\n\n _tokenApprovals[tokenId] = to;\n }\n\n /**\n * @dev Approve `operator` to operate on all of `owner` tokens\n *\n * Requirements:\n * - operator can't be the address zero.\n *\n * Emits an {ApprovalForAll} event.\n */\n function _setApprovalForAll(address owner, address operator, bool approved) internal virtual {\n if (operator == address(0)) {\n revert ERC721InvalidOperator(operator);\n }\n _operatorApprovals[owner][operator] = approved;\n emit ApprovalForAll(owner, operator, approved);\n }\n\n /**\n * @dev Reverts if the `tokenId` doesn't have a current owner (it hasn't been minted, or it has been burned).\n * Returns the owner.\n *\n * Overrides to ownership logic should be done to {_ownerOf}.\n */\n function _requireOwned(uint256 tokenId) internal view returns (address) {\n address owner = _ownerOf(tokenId);\n if (owner == address(0)) {\n revert ERC721NonexistentToken(tokenId);\n }\n return owner;\n }\n}\n" + }, + "@openzeppelin/contracts/token/ERC721/extensions/ERC721Burnable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC721/extensions/ERC721Burnable.sol)\n\npragma solidity ^0.8.20;\n\nimport {ERC721} from \"../ERC721.sol\";\nimport {Context} from \"../../../utils/Context.sol\";\n\n/**\n * @title ERC-721 Burnable Token\n * @dev ERC-721 Token that can be burned (destroyed).\n */\nabstract contract ERC721Burnable is Context, ERC721 {\n /**\n * @dev Burns `tokenId`. See {ERC721-_burn}.\n *\n * Requirements:\n *\n * - The caller must own `tokenId` or be an approved operator.\n */\n function burn(uint256 tokenId) public virtual {\n // Setting an \"auth\" arguments enables the `_isAuthorized` check which verifies that the token exists\n // (from != 0). Therefore, it is not needed to verify that the return value is not 0 here.\n _update(address(0), tokenId, _msgSender());\n }\n}\n" + }, + "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC721/extensions/ERC721Enumerable.sol)\n\npragma solidity ^0.8.20;\n\nimport {ERC721} from \"../ERC721.sol\";\nimport {IERC721Enumerable} from \"./IERC721Enumerable.sol\";\nimport {IERC165} from \"../../../utils/introspection/ERC165.sol\";\n\n/**\n * @dev This implements an optional extension of {ERC721} defined in the ERC that adds enumerability\n * of all the token ids in the contract as well as all token ids owned by each account.\n *\n * CAUTION: {ERC721} extensions that implement custom `balanceOf` logic, such as {ERC721Consecutive},\n * interfere with enumerability and should not be used together with {ERC721Enumerable}.\n */\nabstract contract ERC721Enumerable is ERC721, IERC721Enumerable {\n mapping(address owner => mapping(uint256 index => uint256)) private _ownedTokens;\n mapping(uint256 tokenId => uint256) private _ownedTokensIndex;\n\n uint256[] private _allTokens;\n mapping(uint256 tokenId => uint256) private _allTokensIndex;\n\n /**\n * @dev An `owner`'s token query was out of bounds for `index`.\n *\n * NOTE: The owner being `address(0)` indicates a global out of bounds index.\n */\n error ERC721OutOfBoundsIndex(address owner, uint256 index);\n\n /**\n * @dev Batch mint is not allowed.\n */\n error ERC721EnumerableForbiddenBatchMint();\n\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165, ERC721) returns (bool) {\n return interfaceId == type(IERC721Enumerable).interfaceId || super.supportsInterface(interfaceId);\n }\n\n /**\n * @dev See {IERC721Enumerable-tokenOfOwnerByIndex}.\n */\n function tokenOfOwnerByIndex(address owner, uint256 index) public view virtual returns (uint256) {\n if (index >= balanceOf(owner)) {\n revert ERC721OutOfBoundsIndex(owner, index);\n }\n return _ownedTokens[owner][index];\n }\n\n /**\n * @dev See {IERC721Enumerable-totalSupply}.\n */\n function totalSupply() public view virtual returns (uint256) {\n return _allTokens.length;\n }\n\n /**\n * @dev See {IERC721Enumerable-tokenByIndex}.\n */\n function tokenByIndex(uint256 index) public view virtual returns (uint256) {\n if (index >= totalSupply()) {\n revert ERC721OutOfBoundsIndex(address(0), index);\n }\n return _allTokens[index];\n }\n\n /**\n * @dev See {ERC721-_update}.\n */\n function _update(address to, uint256 tokenId, address auth) internal virtual override returns (address) {\n address previousOwner = super._update(to, tokenId, auth);\n\n if (previousOwner == address(0)) {\n _addTokenToAllTokensEnumeration(tokenId);\n } else if (previousOwner != to) {\n _removeTokenFromOwnerEnumeration(previousOwner, tokenId);\n }\n if (to == address(0)) {\n _removeTokenFromAllTokensEnumeration(tokenId);\n } else if (previousOwner != to) {\n _addTokenToOwnerEnumeration(to, tokenId);\n }\n\n return previousOwner;\n }\n\n /**\n * @dev Private function to add a token to this extension's ownership-tracking data structures.\n * @param to address representing the new owner of the given token ID\n * @param tokenId uint256 ID of the token to be added to the tokens list of the given address\n */\n function _addTokenToOwnerEnumeration(address to, uint256 tokenId) private {\n uint256 length = balanceOf(to) - 1;\n _ownedTokens[to][length] = tokenId;\n _ownedTokensIndex[tokenId] = length;\n }\n\n /**\n * @dev Private function to add a token to this extension's token tracking data structures.\n * @param tokenId uint256 ID of the token to be added to the tokens list\n */\n function _addTokenToAllTokensEnumeration(uint256 tokenId) private {\n _allTokensIndex[tokenId] = _allTokens.length;\n _allTokens.push(tokenId);\n }\n\n /**\n * @dev Private function to remove a token from this extension's ownership-tracking data structures. Note that\n * while the token is not assigned a new owner, the `_ownedTokensIndex` mapping is _not_ updated: this allows for\n * gas optimizations e.g. when performing a transfer operation (avoiding double writes).\n * This has O(1) time complexity, but alters the order of the _ownedTokens array.\n * @param from address representing the previous owner of the given token ID\n * @param tokenId uint256 ID of the token to be removed from the tokens list of the given address\n */\n function _removeTokenFromOwnerEnumeration(address from, uint256 tokenId) private {\n // To prevent a gap in from's tokens array, we store the last token in the index of the token to delete, and\n // then delete the last slot (swap and pop).\n\n uint256 lastTokenIndex = balanceOf(from);\n uint256 tokenIndex = _ownedTokensIndex[tokenId];\n\n mapping(uint256 index => uint256) storage _ownedTokensByOwner = _ownedTokens[from];\n\n // When the token to delete is the last token, the swap operation is unnecessary\n if (tokenIndex != lastTokenIndex) {\n uint256 lastTokenId = _ownedTokensByOwner[lastTokenIndex];\n\n _ownedTokensByOwner[tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token\n _ownedTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index\n }\n\n // This also deletes the contents at the last position of the array\n delete _ownedTokensIndex[tokenId];\n delete _ownedTokensByOwner[lastTokenIndex];\n }\n\n /**\n * @dev Private function to remove a token from this extension's token tracking data structures.\n * This has O(1) time complexity, but alters the order of the _allTokens array.\n * @param tokenId uint256 ID of the token to be removed from the tokens list\n */\n function _removeTokenFromAllTokensEnumeration(uint256 tokenId) private {\n // To prevent a gap in the tokens array, we store the last token in the index of the token to delete, and\n // then delete the last slot (swap and pop).\n\n uint256 lastTokenIndex = _allTokens.length - 1;\n uint256 tokenIndex = _allTokensIndex[tokenId];\n\n // When the token to delete is the last token, the swap operation is unnecessary. However, since this occurs so\n // rarely (when the last minted token is burnt) that we still do the swap here to avoid the gas cost of adding\n // an 'if' statement (like in _removeTokenFromOwnerEnumeration)\n uint256 lastTokenId = _allTokens[lastTokenIndex];\n\n _allTokens[tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token\n _allTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index\n\n // This also deletes the contents at the last position of the array\n delete _allTokensIndex[tokenId];\n _allTokens.pop();\n }\n\n /**\n * See {ERC721-_increaseBalance}. We need that to account tokens that were minted in batch\n */\n function _increaseBalance(address account, uint128 amount) internal virtual override {\n if (amount > 0) {\n revert ERC721EnumerableForbiddenBatchMint();\n }\n super._increaseBalance(account, amount);\n }\n}\n" + }, + "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC721/extensions/ERC721URIStorage.sol)\n\npragma solidity ^0.8.20;\n\nimport {ERC721} from \"../ERC721.sol\";\nimport {Strings} from \"../../../utils/Strings.sol\";\nimport {IERC4906} from \"../../../interfaces/IERC4906.sol\";\nimport {IERC165} from \"../../../interfaces/IERC165.sol\";\n\n/**\n * @dev ERC-721 token with storage based token URI management.\n */\nabstract contract ERC721URIStorage is IERC4906, ERC721 {\n using Strings for uint256;\n\n // Interface ID as defined in ERC-4906. This does not correspond to a traditional interface ID as ERC-4906 only\n // defines events and does not include any external function.\n bytes4 private constant ERC4906_INTERFACE_ID = bytes4(0x49064906);\n\n // Optional mapping for token URIs\n mapping(uint256 tokenId => string) private _tokenURIs;\n\n /**\n * @dev See {IERC165-supportsInterface}\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override(ERC721, IERC165) returns (bool) {\n return interfaceId == ERC4906_INTERFACE_ID || super.supportsInterface(interfaceId);\n }\n\n /**\n * @dev See {IERC721Metadata-tokenURI}.\n */\n function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {\n _requireOwned(tokenId);\n\n string memory _tokenURI = _tokenURIs[tokenId];\n string memory base = _baseURI();\n\n // If there is no base URI, return the token URI.\n if (bytes(base).length == 0) {\n return _tokenURI;\n }\n // If both are set, concatenate the baseURI and tokenURI (via string.concat).\n if (bytes(_tokenURI).length > 0) {\n return string.concat(base, _tokenURI);\n }\n\n return super.tokenURI(tokenId);\n }\n\n /**\n * @dev Sets `_tokenURI` as the tokenURI of `tokenId`.\n *\n * Emits {MetadataUpdate}.\n */\n function _setTokenURI(uint256 tokenId, string memory _tokenURI) internal virtual {\n _tokenURIs[tokenId] = _tokenURI;\n emit MetadataUpdate(tokenId);\n }\n}\n" + }, + "@openzeppelin/contracts/token/ERC721/extensions/ERC721Votes.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC721/extensions/ERC721Votes.sol)\n\npragma solidity ^0.8.20;\n\nimport {ERC721} from \"../ERC721.sol\";\nimport {Votes} from \"../../../governance/utils/Votes.sol\";\n\n/**\n * @dev Extension of ERC-721 to support voting and delegation as implemented by {Votes}, where each individual NFT counts\n * as 1 vote unit.\n *\n * Tokens do not count as votes until they are delegated, because votes must be tracked which incurs an additional cost\n * on every transfer. Token holders can either delegate to a trusted representative who will decide how to make use of\n * the votes in governance decisions, or they can delegate to themselves to be their own representative.\n */\nabstract contract ERC721Votes is ERC721, Votes {\n /**\n * @dev See {ERC721-_update}. Adjusts votes when tokens are transferred.\n *\n * Emits a {IVotes-DelegateVotesChanged} event.\n */\n function _update(address to, uint256 tokenId, address auth) internal virtual override returns (address) {\n address previousOwner = super._update(to, tokenId, auth);\n\n _transferVotingUnits(previousOwner, to, 1);\n\n return previousOwner;\n }\n\n /**\n * @dev Returns the balance of `account`.\n *\n * WARNING: Overriding this function will likely result in incorrect vote tracking.\n */\n function _getVotingUnits(address account) internal view virtual override returns (uint256) {\n return balanceOf(account);\n }\n\n /**\n * @dev See {ERC721-_increaseBalance}. We need that to account tokens that were minted in batch.\n */\n function _increaseBalance(address account, uint128 amount) internal virtual override {\n super._increaseBalance(account, amount);\n _transferVotingUnits(address(0), account, amount);\n }\n}\n" + }, + "@openzeppelin/contracts/token/ERC721/extensions/IERC721Enumerable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC721/extensions/IERC721Enumerable.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC721} from \"../IERC721.sol\";\n\n/**\n * @title ERC-721 Non-Fungible Token Standard, optional enumeration extension\n * @dev See https://eips.ethereum.org/EIPS/eip-721\n */\ninterface IERC721Enumerable is IERC721 {\n /**\n * @dev Returns the total amount of tokens stored by the contract.\n */\n function totalSupply() external view returns (uint256);\n\n /**\n * @dev Returns a token ID owned by `owner` at a given `index` of its token list.\n * Use along with {balanceOf} to enumerate all of ``owner``'s tokens.\n */\n function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256);\n\n /**\n * @dev Returns a token ID at a given `index` of all the tokens stored by the contract.\n * Use along with {totalSupply} to enumerate all tokens.\n */\n function tokenByIndex(uint256 index) external view returns (uint256);\n}\n" + }, + "@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC721/extensions/IERC721Metadata.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC721} from \"../IERC721.sol\";\n\n/**\n * @title ERC-721 Non-Fungible Token Standard, optional metadata extension\n * @dev See https://eips.ethereum.org/EIPS/eip-721\n */\ninterface IERC721Metadata is IERC721 {\n /**\n * @dev Returns the token collection name.\n */\n function name() external view returns (string memory);\n\n /**\n * @dev Returns the token collection symbol.\n */\n function symbol() external view returns (string memory);\n\n /**\n * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token.\n */\n function tokenURI(uint256 tokenId) external view returns (string memory);\n}\n" + }, + "@openzeppelin/contracts/token/ERC721/IERC721.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC721/IERC721.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC165} from \"../../utils/introspection/IERC165.sol\";\n\n/**\n * @dev Required interface of an ERC-721 compliant contract.\n */\ninterface IERC721 is IERC165 {\n /**\n * @dev Emitted when `tokenId` token is transferred from `from` to `to`.\n */\n event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);\n\n /**\n * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.\n */\n event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);\n\n /**\n * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.\n */\n event ApprovalForAll(address indexed owner, address indexed operator, bool approved);\n\n /**\n * @dev Returns the number of tokens in ``owner``'s account.\n */\n function balanceOf(address owner) external view returns (uint256 balance);\n\n /**\n * @dev Returns the owner of the `tokenId` token.\n *\n * Requirements:\n *\n * - `tokenId` must exist.\n */\n function ownerOf(uint256 tokenId) external view returns (address owner);\n\n /**\n * @dev Safely transfers `tokenId` token from `from` to `to`.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `tokenId` token must exist and be owned by `from`.\n * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon\n * a safe transfer.\n *\n * Emits a {Transfer} event.\n */\n function safeTransferFrom(address from, address to, uint256 tokenId, bytes calldata data) external;\n\n /**\n * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients\n * are aware of the ERC-721 protocol to prevent tokens from being forever locked.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `tokenId` token must exist and be owned by `from`.\n * - If the caller is not `from`, it must have been allowed to move this token by either {approve} or\n * {setApprovalForAll}.\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon\n * a safe transfer.\n *\n * Emits a {Transfer} event.\n */\n function safeTransferFrom(address from, address to, uint256 tokenId) external;\n\n /**\n * @dev Transfers `tokenId` token from `from` to `to`.\n *\n * WARNING: Note that the caller is responsible to confirm that the recipient is capable of receiving ERC-721\n * or else they may be permanently lost. Usage of {safeTransferFrom} prevents loss, though the caller must\n * understand this adds an external call which potentially creates a reentrancy vulnerability.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `tokenId` token must be owned by `from`.\n * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(address from, address to, uint256 tokenId) external;\n\n /**\n * @dev Gives permission to `to` to transfer `tokenId` token to another account.\n * The approval is cleared when the token is transferred.\n *\n * Only a single account can be approved at a time, so approving the zero address clears previous approvals.\n *\n * Requirements:\n *\n * - The caller must own the token or be an approved operator.\n * - `tokenId` must exist.\n *\n * Emits an {Approval} event.\n */\n function approve(address to, uint256 tokenId) external;\n\n /**\n * @dev Approve or remove `operator` as an operator for the caller.\n * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.\n *\n * Requirements:\n *\n * - The `operator` cannot be the address zero.\n *\n * Emits an {ApprovalForAll} event.\n */\n function setApprovalForAll(address operator, bool approved) external;\n\n /**\n * @dev Returns the account approved for `tokenId` token.\n *\n * Requirements:\n *\n * - `tokenId` must exist.\n */\n function getApproved(uint256 tokenId) external view returns (address operator);\n\n /**\n * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.\n *\n * See {setApprovalForAll}\n */\n function isApprovedForAll(address owner, address operator) external view returns (bool);\n}\n" + }, + "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC721/IERC721Receiver.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @title ERC-721 token receiver interface\n * @dev Interface for any contract that wants to support safeTransfers\n * from ERC-721 asset contracts.\n */\ninterface IERC721Receiver {\n /**\n * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom}\n * by `operator` from `from`, this function is called.\n *\n * It must return its Solidity selector to confirm the token transfer.\n * If any other value is returned or the interface is not implemented by the recipient, the transfer will be\n * reverted.\n *\n * The selector can be obtained in Solidity with `IERC721Receiver.onERC721Received.selector`.\n */\n function onERC721Received(\n address operator,\n address from,\n uint256 tokenId,\n bytes calldata data\n ) external returns (bytes4);\n}\n" + }, + "@openzeppelin/contracts/token/ERC721/utils/ERC721Utils.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC721/utils/ERC721Utils.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC721Receiver} from \"../IERC721Receiver.sol\";\nimport {IERC721Errors} from \"../../../interfaces/draft-IERC6093.sol\";\n\n/**\n * @dev Library that provide common ERC-721 utility functions.\n *\n * See https://eips.ethereum.org/EIPS/eip-721[ERC-721].\n *\n * _Available since v5.1._\n */\nlibrary ERC721Utils {\n /**\n * @dev Performs an acceptance check for the provided `operator` by calling {IERC721-onERC721Received}\n * on the `to` address. The `operator` is generally the address that initiated the token transfer (i.e. `msg.sender`).\n *\n * The acceptance call is not executed and treated as a no-op if the target address doesn't contain code (i.e. an EOA).\n * Otherwise, the recipient must implement {IERC721Receiver-onERC721Received} and return the acceptance magic value to accept\n * the transfer.\n */\n function checkOnERC721Received(\n address operator,\n address from,\n address to,\n uint256 tokenId,\n bytes memory data\n ) internal {\n if (to.code.length > 0) {\n try IERC721Receiver(to).onERC721Received(operator, from, tokenId, data) returns (bytes4 retval) {\n if (retval != IERC721Receiver.onERC721Received.selector) {\n // Token rejected\n revert IERC721Errors.ERC721InvalidReceiver(to);\n }\n } catch (bytes memory reason) {\n if (reason.length == 0) {\n // non-IERC721Receiver implementer\n revert IERC721Errors.ERC721InvalidReceiver(to);\n } else {\n assembly (\"memory-safe\") {\n revert(add(32, reason), mload(reason))\n }\n }\n }\n }\n }\n}\n" + }, + "@openzeppelin/contracts/utils/Address.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/Address.sol)\n\npragma solidity ^0.8.20;\n\nimport {Errors} from \"./Errors.sol\";\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary Address {\n /**\n * @dev There's no code at `target` (it is not a contract).\n */\n error AddressEmptyCode(address target);\n\n /**\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\n * `recipient`, forwarding all available gas and reverting on errors.\n *\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\n * imposed by `transfer`, making them unable to receive funds via\n * `transfer`. {sendValue} removes this limitation.\n *\n * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n *\n * IMPORTANT: because control is transferred to `recipient`, care must be\n * taken to not create reentrancy vulnerabilities. Consider using\n * {ReentrancyGuard} or the\n * https://solidity.readthedocs.io/en/v0.8.20/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n */\n function sendValue(address payable recipient, uint256 amount) internal {\n if (address(this).balance < amount) {\n revert Errors.InsufficientBalance(address(this).balance, amount);\n }\n\n (bool success, ) = recipient.call{value: amount}(\"\");\n if (!success) {\n revert Errors.FailedCall();\n }\n }\n\n /**\n * @dev Performs a Solidity function call using a low level `call`. A\n * plain `call` is an unsafe replacement for a function call: use this\n * function instead.\n *\n * If `target` reverts with a revert reason or custom error, it is bubbled\n * up by this function (like regular Solidity function calls). However, if\n * the call reverted with no returned reason, this function reverts with a\n * {Errors.FailedCall} error.\n *\n * Returns the raw returned data. To convert to the expected return value,\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\n *\n * Requirements:\n *\n * - `target` must be a contract.\n * - calling `target` with `data` must not revert.\n */\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but also transferring `value` wei to `target`.\n *\n * Requirements:\n *\n * - the calling contract must have an ETH balance of at least `value`.\n * - the called Solidity function must be `payable`.\n */\n function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {\n if (address(this).balance < value) {\n revert Errors.InsufficientBalance(address(this).balance, value);\n }\n (bool success, bytes memory returndata) = target.call{value: value}(data);\n return verifyCallResultFromTarget(target, success, returndata);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a static call.\n */\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\n (bool success, bytes memory returndata) = target.staticcall(data);\n return verifyCallResultFromTarget(target, success, returndata);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a delegate call.\n */\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\n (bool success, bytes memory returndata) = target.delegatecall(data);\n return verifyCallResultFromTarget(target, success, returndata);\n }\n\n /**\n * @dev Tool to verify that a low level call to smart-contract was successful, and reverts if the target\n * was not a contract or bubbling up the revert reason (falling back to {Errors.FailedCall}) in case\n * of an unsuccessful call.\n */\n function verifyCallResultFromTarget(\n address target,\n bool success,\n bytes memory returndata\n ) internal view returns (bytes memory) {\n if (!success) {\n _revert(returndata);\n } else {\n // only check if target is a contract if the call was successful and the return data is empty\n // otherwise we already know that it was a contract\n if (returndata.length == 0 && target.code.length == 0) {\n revert AddressEmptyCode(target);\n }\n return returndata;\n }\n }\n\n /**\n * @dev Tool to verify that a low level call was successful, and reverts if it wasn't, either by bubbling the\n * revert reason or with a default {Errors.FailedCall} error.\n */\n function verifyCallResult(bool success, bytes memory returndata) internal pure returns (bytes memory) {\n if (!success) {\n _revert(returndata);\n } else {\n return returndata;\n }\n }\n\n /**\n * @dev Reverts with returndata if present. Otherwise reverts with {Errors.FailedCall}.\n */\n function _revert(bytes memory returndata) private pure {\n // Look for revert reason and bubble it up if present\n if (returndata.length > 0) {\n // The easiest way to bubble the revert reason is using memory via assembly\n assembly (\"memory-safe\") {\n let returndata_size := mload(returndata)\n revert(add(32, returndata), returndata_size)\n }\n } else {\n revert Errors.FailedCall();\n }\n }\n}\n" + }, + "@openzeppelin/contracts/utils/Context.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract Context {\n function _msgSender() internal view virtual returns (address) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual returns (bytes calldata) {\n return msg.data;\n }\n\n function _contextSuffixLength() internal view virtual returns (uint256) {\n return 0;\n }\n}\n" + }, + "@openzeppelin/contracts/utils/cryptography/ECDSA.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/cryptography/ECDSA.sol)\n\npragma solidity ^0.8.20;\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 }\n\n /**\n * @dev The signature derives the `address(0)`.\n */\n error ECDSAInvalidSignature();\n\n /**\n * @dev The signature has an invalid length.\n */\n error ECDSAInvalidSignatureLength(uint256 length);\n\n /**\n * @dev The signature has an S value that is in the upper half order.\n */\n error ECDSAInvalidSignatureS(bytes32 s);\n\n /**\n * @dev Returns the address that signed a hashed message (`hash`) with `signature` or an error. This will not\n * return address(0) without also returning an error description. Errors are documented using an enum (error type)\n * and a bytes32 providing additional information about the error.\n *\n * If no error is returned, then the address can be used for verification purposes.\n *\n * The `ecrecover` EVM precompile 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 {MessageHashUtils-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 function tryRecover(\n bytes32 hash,\n bytes memory signature\n ) internal pure returns (address recovered, RecoverError err, bytes32 errArg) {\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 assembly (\"memory-safe\") {\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, bytes32(signature.length));\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 precompile 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 {MessageHashUtils-toEthSignedMessageHash} on it.\n */\n function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {\n (address recovered, RecoverError error, bytes32 errorArg) = tryRecover(hash, signature);\n _throwError(error, errorArg);\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[ERC-2098 short signatures]\n */\n function tryRecover(\n bytes32 hash,\n bytes32 r,\n bytes32 vs\n ) internal pure returns (address recovered, RecoverError err, bytes32 errArg) {\n unchecked {\n bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff);\n // We do not check for an overflow here since the shift operation results in 0 or 1.\n uint8 v = uint8((uint256(vs) >> 255) + 27);\n return tryRecover(hash, v, r, s);\n }\n }\n\n /**\n * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately.\n */\n function recover(bytes32 hash, bytes32 r, bytes32 vs) internal pure returns (address) {\n (address recovered, RecoverError error, bytes32 errorArg) = tryRecover(hash, r, vs);\n _throwError(error, errorArg);\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 function tryRecover(\n bytes32 hash,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) internal pure returns (address recovered, RecoverError err, bytes32 errArg) {\n // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature\n // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines\n // the valid range for s in (301): 0 < s < secp256k1n ÷ 2 + 1, and for v in (302): v ∈ {27, 28}. Most\n // signatures from current libraries generate a unique signature with an s-value in the lower half order.\n //\n // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value\n // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or\n // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept\n // these malleable signatures as well.\n if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) {\n return (address(0), RecoverError.InvalidSignatureS, s);\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, bytes32(0));\n }\n\n return (signer, RecoverError.NoError, bytes32(0));\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, bytes32 errorArg) = tryRecover(hash, v, r, s);\n _throwError(error, errorArg);\n return recovered;\n }\n\n /**\n * @dev Optionally reverts with the corresponding custom error according to the `error` argument provided.\n */\n function _throwError(RecoverError error, bytes32 errorArg) private pure {\n if (error == RecoverError.NoError) {\n return; // no error: do nothing\n } else if (error == RecoverError.InvalidSignature) {\n revert ECDSAInvalidSignature();\n } else if (error == RecoverError.InvalidSignatureLength) {\n revert ECDSAInvalidSignatureLength(uint256(errorArg));\n } else if (error == RecoverError.InvalidSignatureS) {\n revert ECDSAInvalidSignatureS(errorArg);\n }\n }\n}\n" + }, + "@openzeppelin/contracts/utils/cryptography/EIP712.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/cryptography/EIP712.sol)\n\npragma solidity ^0.8.20;\n\nimport {MessageHashUtils} from \"./MessageHashUtils.sol\";\nimport {ShortStrings, ShortString} from \"../ShortStrings.sol\";\nimport {IERC5267} from \"../../interfaces/IERC5267.sol\";\n\n/**\n * @dev https://eips.ethereum.org/EIPS/eip-712[EIP-712] is a standard for hashing and signing of typed structured data.\n *\n * The encoding scheme specified in the EIP requires a domain separator and a hash of the typed structured data, whose\n * encoding is very generic and therefore its implementation in Solidity is not feasible, thus this contract\n * does not implement the encoding itself. Protocols need to implement the type-specific encoding they need in order to\n * produce the hash of their typed data using a combination of `abi.encode` and `keccak256`.\n *\n * This contract implements the EIP-712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding\n * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA\n * ({_hashTypedDataV4}).\n *\n * The implementation of the domain separator was designed to be as efficient as possible while still properly updating\n * the chain id to protect against replay attacks on an eventual fork of the chain.\n *\n * NOTE: This contract implements the version of the encoding known as \"v4\", as implemented by the JSON RPC method\n * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask].\n *\n * NOTE: In the upgradeable version of this contract, the cached values will correspond to the address, and the domain\n * separator of the implementation contract. This will cause the {_domainSeparatorV4} function to always rebuild the\n * separator from the immutable values, which is cheaper than accessing a cached version in cold storage.\n *\n * @custom:oz-upgrades-unsafe-allow state-variable-immutable\n */\nabstract contract EIP712 is IERC5267 {\n using ShortStrings for *;\n\n bytes32 private constant TYPE_HASH =\n keccak256(\"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)\");\n\n // Cache the domain separator as an immutable value, but also store the chain id that it corresponds to, in order to\n // invalidate the cached domain separator if the chain id changes.\n bytes32 private immutable _cachedDomainSeparator;\n uint256 private immutable _cachedChainId;\n address private immutable _cachedThis;\n\n bytes32 private immutable _hashedName;\n bytes32 private immutable _hashedVersion;\n\n ShortString private immutable _name;\n ShortString private immutable _version;\n string private _nameFallback;\n string private _versionFallback;\n\n /**\n * @dev Initializes the domain separator and parameter caches.\n *\n * The meaning of `name` and `version` is specified in\n * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP-712]:\n *\n * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol.\n * - `version`: the current major version of the signing domain.\n *\n * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart\n * contract upgrade].\n */\n constructor(string memory name, string memory version) {\n _name = name.toShortStringWithFallback(_nameFallback);\n _version = version.toShortStringWithFallback(_versionFallback);\n _hashedName = keccak256(bytes(name));\n _hashedVersion = keccak256(bytes(version));\n\n _cachedChainId = block.chainid;\n _cachedDomainSeparator = _buildDomainSeparator();\n _cachedThis = address(this);\n }\n\n /**\n * @dev Returns the domain separator for the current chain.\n */\n function _domainSeparatorV4() internal view returns (bytes32) {\n if (address(this) == _cachedThis && block.chainid == _cachedChainId) {\n return _cachedDomainSeparator;\n } else {\n return _buildDomainSeparator();\n }\n }\n\n function _buildDomainSeparator() private view returns (bytes32) {\n return keccak256(abi.encode(TYPE_HASH, _hashedName, _hashedVersion, block.chainid, address(this)));\n }\n\n /**\n * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this\n * function returns the hash of the fully encoded EIP712 message for this domain.\n *\n * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example:\n *\n * ```solidity\n * bytes32 digest = _hashTypedDataV4(keccak256(abi.encode(\n * keccak256(\"Mail(address to,string contents)\"),\n * mailTo,\n * keccak256(bytes(mailContents))\n * )));\n * address signer = ECDSA.recover(digest, signature);\n * ```\n */\n function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) {\n return MessageHashUtils.toTypedDataHash(_domainSeparatorV4(), structHash);\n }\n\n /**\n * @dev See {IERC-5267}.\n */\n function eip712Domain()\n public\n view\n virtual\n returns (\n bytes1 fields,\n string memory name,\n string memory version,\n uint256 chainId,\n address verifyingContract,\n bytes32 salt,\n uint256[] memory extensions\n )\n {\n return (\n hex\"0f\", // 01111\n _EIP712Name(),\n _EIP712Version(),\n block.chainid,\n address(this),\n bytes32(0),\n new uint256[](0)\n );\n }\n\n /**\n * @dev The name parameter for the EIP712 domain.\n *\n * NOTE: By default this function reads _name which is an immutable value.\n * It only reads from storage if necessary (in case the value is too large to fit in a ShortString).\n */\n // solhint-disable-next-line func-name-mixedcase\n function _EIP712Name() internal view returns (string memory) {\n return _name.toStringWithFallback(_nameFallback);\n }\n\n /**\n * @dev The version parameter for the EIP712 domain.\n *\n * NOTE: By default this function reads _version which is an immutable value.\n * It only reads from storage if necessary (in case the value is too large to fit in a ShortString).\n */\n // solhint-disable-next-line func-name-mixedcase\n function _EIP712Version() internal view returns (string memory) {\n return _version.toStringWithFallback(_versionFallback);\n }\n}\n" + }, + "@openzeppelin/contracts/utils/cryptography/MessageHashUtils.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/cryptography/MessageHashUtils.sol)\n\npragma solidity ^0.8.20;\n\nimport {Strings} from \"../Strings.sol\";\n\n/**\n * @dev Signature message hash utilities for producing digests to be consumed by {ECDSA} recovery or signing.\n *\n * The library provides methods for generating a hash of a message that conforms to the\n * https://eips.ethereum.org/EIPS/eip-191[ERC-191] and https://eips.ethereum.org/EIPS/eip-712[EIP 712]\n * specifications.\n */\nlibrary MessageHashUtils {\n /**\n * @dev Returns the keccak256 digest of an ERC-191 signed data with version\n * `0x45` (`personal_sign` messages).\n *\n * The digest is calculated by prefixing a bytes32 `messageHash` with\n * `\"\\x19Ethereum Signed Message:\\n32\"` and hashing the result. It corresponds with the\n * hash signed when using the https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] JSON-RPC method.\n *\n * NOTE: The `messageHash` parameter is intended to be the result of hashing a raw message with\n * keccak256, although any bytes32 value can be safely used because the final digest will\n * be re-hashed.\n *\n * See {ECDSA-recover}.\n */\n function toEthSignedMessageHash(bytes32 messageHash) internal pure returns (bytes32 digest) {\n assembly (\"memory-safe\") {\n mstore(0x00, \"\\x19Ethereum Signed Message:\\n32\") // 32 is the bytes-length of messageHash\n mstore(0x1c, messageHash) // 0x1c (28) is the length of the prefix\n digest := keccak256(0x00, 0x3c) // 0x3c is the length of the prefix (0x1c) + messageHash (0x20)\n }\n }\n\n /**\n * @dev Returns the keccak256 digest of an ERC-191 signed data with version\n * `0x45` (`personal_sign` messages).\n *\n * The digest is calculated by prefixing an arbitrary `message` with\n * `\"\\x19Ethereum Signed Message:\\n\" + len(message)` and hashing the result. It corresponds with the\n * hash signed when using the https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] JSON-RPC method.\n *\n * See {ECDSA-recover}.\n */\n function toEthSignedMessageHash(bytes memory message) internal pure returns (bytes32) {\n return\n keccak256(bytes.concat(\"\\x19Ethereum Signed Message:\\n\", bytes(Strings.toString(message.length)), message));\n }\n\n /**\n * @dev Returns the keccak256 digest of an ERC-191 signed data with version\n * `0x00` (data with intended validator).\n *\n * The digest is calculated by prefixing an arbitrary `data` with `\"\\x19\\x00\"` and the intended\n * `validator` address. Then hashing the result.\n *\n * See {ECDSA-recover}.\n */\n function toDataWithIntendedValidatorHash(address validator, bytes memory data) internal pure returns (bytes32) {\n return keccak256(abi.encodePacked(hex\"19_00\", validator, data));\n }\n\n /**\n * @dev Returns the keccak256 digest of an EIP-712 typed data (ERC-191 version `0x01`).\n *\n * The digest is calculated from a `domainSeparator` and a `structHash`, by prefixing them with\n * `\\x19\\x01` and hashing the result. It corresponds to the hash signed by the\n * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`] JSON-RPC method as part of EIP-712.\n *\n * See {ECDSA-recover}.\n */\n function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32 digest) {\n assembly (\"memory-safe\") {\n let ptr := mload(0x40)\n mstore(ptr, hex\"19_01\")\n mstore(add(ptr, 0x02), domainSeparator)\n mstore(add(ptr, 0x22), structHash)\n digest := keccak256(ptr, 0x42)\n }\n }\n}\n" + }, + "@openzeppelin/contracts/utils/cryptography/SignatureChecker.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/cryptography/SignatureChecker.sol)\n\npragma solidity ^0.8.20;\n\nimport {ECDSA} from \"./ECDSA.sol\";\nimport {IERC1271} from \"../../interfaces/IERC1271.sol\";\n\n/**\n * @dev Signature verification helper that can be used instead of `ECDSA.recover` to seamlessly support both ECDSA\n * signatures from externally owned accounts (EOAs) as well as ERC-1271 signatures from smart contract wallets like\n * Argent and Safe Wallet (previously Gnosis Safe).\n */\nlibrary SignatureChecker {\n /**\n * @dev Checks if a signature is valid for a given signer and data hash. If the signer is a smart contract, the\n * signature is validated against that smart contract using ERC-1271, otherwise it's validated using `ECDSA.recover`.\n *\n * NOTE: Unlike ECDSA signatures, contract signatures are revocable, and the outcome of this function can thus\n * change through time. It could return true at block N and false at block N+1 (or the opposite).\n */\n function isValidSignatureNow(address signer, bytes32 hash, bytes memory signature) internal view returns (bool) {\n if (signer.code.length == 0) {\n (address recovered, ECDSA.RecoverError err, ) = ECDSA.tryRecover(hash, signature);\n return err == ECDSA.RecoverError.NoError && recovered == signer;\n } else {\n return isValidERC1271SignatureNow(signer, hash, signature);\n }\n }\n\n /**\n * @dev Checks if a signature is valid for a given signer and data hash. The signature is validated\n * against the signer smart contract using ERC-1271.\n *\n * NOTE: Unlike ECDSA signatures, contract signatures are revocable, and the outcome of this function can thus\n * change through time. It could return true at block N and false at block N+1 (or the opposite).\n */\n function isValidERC1271SignatureNow(\n address signer,\n bytes32 hash,\n bytes memory signature\n ) internal view returns (bool) {\n (bool success, bytes memory result) = signer.staticcall(\n abi.encodeCall(IERC1271.isValidSignature, (hash, signature))\n );\n return (success &&\n result.length >= 32 &&\n abi.decode(result, (bytes32)) == bytes32(IERC1271.isValidSignature.selector));\n }\n}\n" + }, + "@openzeppelin/contracts/utils/Errors.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/Errors.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Collection of common custom errors used in multiple contracts\n *\n * IMPORTANT: Backwards compatibility is not guaranteed in future versions of the library.\n * It is recommended to avoid relying on the error API for critical functionality.\n *\n * _Available since v5.1._\n */\nlibrary Errors {\n /**\n * @dev The ETH balance of the account is not enough to perform the operation.\n */\n error InsufficientBalance(uint256 balance, uint256 needed);\n\n /**\n * @dev A call to an address target failed. The target may have reverted.\n */\n error FailedCall();\n\n /**\n * @dev The deployment failed.\n */\n error FailedDeployment();\n\n /**\n * @dev A necessary precompile is missing.\n */\n error MissingPrecompile(address);\n}\n" + }, + "@openzeppelin/contracts/utils/introspection/ERC165.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/introspection/ERC165.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC165} from \"./IERC165.sol\";\n\n/**\n * @dev Implementation of the {IERC165} interface.\n *\n * Contracts that want to implement ERC-165 should inherit from this contract and override {supportsInterface} to check\n * for the additional interface id that will be supported. For example:\n *\n * ```solidity\n * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);\n * }\n * ```\n */\nabstract contract ERC165 is IERC165 {\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) {\n return interfaceId == type(IERC165).interfaceId;\n }\n}\n" + }, + "@openzeppelin/contracts/utils/introspection/IERC165.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/introspection/IERC165.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Interface of the ERC-165 standard, as defined in the\n * https://eips.ethereum.org/EIPS/eip-165[ERC].\n *\n * Implementers can declare support of contract interfaces, which can then be\n * queried by others ({ERC165Checker}).\n *\n * For an implementation, see {ERC165}.\n */\ninterface IERC165 {\n /**\n * @dev Returns true if this contract implements the interface defined by\n * `interfaceId`. See the corresponding\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[ERC section]\n * to learn more about how these ids are created.\n *\n * This function call must use less than 30 000 gas.\n */\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\n}\n" + }, + "@openzeppelin/contracts/utils/math/Math.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/math/Math.sol)\n\npragma solidity ^0.8.20;\n\nimport {Panic} from \"../Panic.sol\";\nimport {SafeCast} from \"./SafeCast.sol\";\n\n/**\n * @dev Standard math utilities missing in the Solidity language.\n */\nlibrary Math {\n enum Rounding {\n Floor, // Toward negative infinity\n Ceil, // Toward positive infinity\n Trunc, // Toward zero\n Expand // Away from zero\n }\n\n /**\n * @dev Returns the addition of two unsigned integers, with an success flag (no overflow).\n */\n function tryAdd(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\n unchecked {\n uint256 c = a + b;\n if (c < a) return (false, 0);\n return (true, c);\n }\n }\n\n /**\n * @dev Returns the subtraction of two unsigned integers, with an success flag (no overflow).\n */\n function trySub(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\n unchecked {\n if (b > a) return (false, 0);\n return (true, a - b);\n }\n }\n\n /**\n * @dev Returns the multiplication of two unsigned integers, with an success flag (no overflow).\n */\n function tryMul(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\n unchecked {\n // Gas optimization: this is cheaper than requiring 'a' not being zero, but the\n // benefit is lost if 'b' is also tested.\n // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522\n if (a == 0) return (true, 0);\n uint256 c = a * b;\n if (c / a != b) return (false, 0);\n return (true, c);\n }\n }\n\n /**\n * @dev Returns the division of two unsigned integers, with a success flag (no division by zero).\n */\n function tryDiv(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\n unchecked {\n if (b == 0) return (false, 0);\n return (true, a / b);\n }\n }\n\n /**\n * @dev Returns the remainder of dividing two unsigned integers, with a success flag (no division by zero).\n */\n function tryMod(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\n unchecked {\n if (b == 0) return (false, 0);\n return (true, a % b);\n }\n }\n\n /**\n * @dev Branchless ternary evaluation for `a ? b : c`. Gas costs are constant.\n *\n * IMPORTANT: This function may reduce bytecode size and consume less gas when used standalone.\n * However, the compiler may optimize Solidity ternary operations (i.e. `a ? b : c`) to only compute\n * one branch when needed, making this function more expensive.\n */\n function ternary(bool condition, uint256 a, uint256 b) internal pure returns (uint256) {\n unchecked {\n // branchless ternary works because:\n // b ^ (a ^ b) == a\n // b ^ 0 == b\n return b ^ ((a ^ b) * SafeCast.toUint(condition));\n }\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 ternary(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 ternary(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 towards infinity instead\n * of rounding towards zero.\n */\n function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {\n if (b == 0) {\n // Guarantee the same behavior as in a regular Solidity division.\n Panic.panic(Panic.DIVISION_BY_ZERO);\n }\n\n // The following calculation ensures accurate ceiling division without overflow.\n // Since a is non-zero, (a - 1) / b will not overflow.\n // The largest possible result occurs when (a - 1) / b is type(uint256).max,\n // but the largest value we can obtain is type(uint256).max - 1, which happens\n // when a = type(uint256).max and b = 1.\n unchecked {\n return SafeCast.toUint(a > 0) * ((a - 1) / b + 1);\n }\n }\n\n /**\n * @dev Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or\n * denominator == 0.\n *\n * Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv) with further edits by\n * 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²⁵⁶ and mod 2²⁵⁶ - 1, then use\n // the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256\n // variables such that product = prod1 * 2²⁵⁶ + prod0.\n uint256 prod0 = x * y; // 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 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²⁵⁶. Also prevents denominator == 0.\n if (denominator <= prod1) {\n Panic.panic(ternary(denominator == 0, Panic.DIVISION_BY_ZERO, Panic.UNDER_OVERFLOW));\n }\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.\n // Always >= 1. See https://cs.stackexchange.com/q/138556/92363.\n\n uint256 twos = denominator & (0 - denominator);\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²⁵⁶ / 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²⁵⁶. Now that denominator is an odd number, it has an inverse modulo 2²⁵⁶ such\n // that denominator * inv ≡ 1 mod 2²⁵⁶. Compute the inverse by starting with a seed that is correct for\n // four bits. That is, denominator * inv ≡ 1 mod 2⁴.\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\n // works in modular arithmetic, doubling the correct bits in each step.\n inverse *= 2 - denominator * inverse; // inverse mod 2⁸\n inverse *= 2 - denominator * inverse; // inverse mod 2¹⁶\n inverse *= 2 - denominator * inverse; // inverse mod 2³²\n inverse *= 2 - denominator * inverse; // inverse mod 2⁶⁴\n inverse *= 2 - denominator * inverse; // inverse mod 2¹²⁸\n inverse *= 2 - denominator * inverse; // inverse mod 2²⁵⁶\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²⁵⁶. Since the preconditions guarantee that the outcome is\n // less than 2²⁵⁶, 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 * @dev 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 return mulDiv(x, y, denominator) + SafeCast.toUint(unsignedRoundsUp(rounding) && mulmod(x, y, denominator) > 0);\n }\n\n /**\n * @dev Calculate the modular multiplicative inverse of a number in Z/nZ.\n *\n * If n is a prime, then Z/nZ is a field. In that case all elements are inversible, except 0.\n * If n is not a prime, then Z/nZ is not a field, and some elements might not be inversible.\n *\n * If the input value is not inversible, 0 is returned.\n *\n * NOTE: If you know for sure that n is (big) a prime, it may be cheaper to use Fermat's little theorem and get the\n * inverse using `Math.modExp(a, n - 2, n)`. See {invModPrime}.\n */\n function invMod(uint256 a, uint256 n) internal pure returns (uint256) {\n unchecked {\n if (n == 0) return 0;\n\n // The inverse modulo is calculated using the Extended Euclidean Algorithm (iterative version)\n // Used to compute integers x and y such that: ax + ny = gcd(a, n).\n // When the gcd is 1, then the inverse of a modulo n exists and it's x.\n // ax + ny = 1\n // ax = 1 + (-y)n\n // ax ≡ 1 (mod n) # x is the inverse of a modulo n\n\n // If the remainder is 0 the gcd is n right away.\n uint256 remainder = a % n;\n uint256 gcd = n;\n\n // Therefore the initial coefficients are:\n // ax + ny = gcd(a, n) = n\n // 0a + 1n = n\n int256 x = 0;\n int256 y = 1;\n\n while (remainder != 0) {\n uint256 quotient = gcd / remainder;\n\n (gcd, remainder) = (\n // The old remainder is the next gcd to try.\n remainder,\n // Compute the next remainder.\n // Can't overflow given that (a % gcd) * (gcd // (a % gcd)) <= gcd\n // where gcd is at most n (capped to type(uint256).max)\n gcd - remainder * quotient\n );\n\n (x, y) = (\n // Increment the coefficient of a.\n y,\n // Decrement the coefficient of n.\n // Can overflow, but the result is casted to uint256 so that the\n // next value of y is \"wrapped around\" to a value between 0 and n - 1.\n x - y * int256(quotient)\n );\n }\n\n if (gcd != 1) return 0; // No inverse exists.\n return ternary(x < 0, n - uint256(-x), uint256(x)); // Wrap the result if it's negative.\n }\n }\n\n /**\n * @dev Variant of {invMod}. More efficient, but only works if `p` is known to be a prime greater than `2`.\n *\n * From https://en.wikipedia.org/wiki/Fermat%27s_little_theorem[Fermat's little theorem], we know that if p is\n * prime, then `a**(p-1) ≡ 1 mod p`. As a consequence, we have `a * a**(p-2) ≡ 1 mod p`, which means that\n * `a**(p-2)` is the modular multiplicative inverse of a in Fp.\n *\n * NOTE: this function does NOT check that `p` is a prime greater than `2`.\n */\n function invModPrime(uint256 a, uint256 p) internal view returns (uint256) {\n unchecked {\n return Math.modExp(a, p - 2, p);\n }\n }\n\n /**\n * @dev Returns the modular exponentiation of the specified base, exponent and modulus (b ** e % m)\n *\n * Requirements:\n * - modulus can't be zero\n * - underlying staticcall to precompile must succeed\n *\n * IMPORTANT: The result is only valid if the underlying call succeeds. When using this function, make\n * sure the chain you're using it on supports the precompiled contract for modular exponentiation\n * at address 0x05 as specified in https://eips.ethereum.org/EIPS/eip-198[EIP-198]. Otherwise,\n * the underlying function will succeed given the lack of a revert, but the result may be incorrectly\n * interpreted as 0.\n */\n function modExp(uint256 b, uint256 e, uint256 m) internal view returns (uint256) {\n (bool success, uint256 result) = tryModExp(b, e, m);\n if (!success) {\n Panic.panic(Panic.DIVISION_BY_ZERO);\n }\n return result;\n }\n\n /**\n * @dev Returns the modular exponentiation of the specified base, exponent and modulus (b ** e % m).\n * It includes a success flag indicating if the operation succeeded. Operation will be marked as failed if trying\n * to operate modulo 0 or if the underlying precompile reverted.\n *\n * IMPORTANT: The result is only valid if the success flag is true. When using this function, make sure the chain\n * you're using it on supports the precompiled contract for modular exponentiation at address 0x05 as specified in\n * https://eips.ethereum.org/EIPS/eip-198[EIP-198]. Otherwise, the underlying function will succeed given the lack\n * of a revert, but the result may be incorrectly interpreted as 0.\n */\n function tryModExp(uint256 b, uint256 e, uint256 m) internal view returns (bool success, uint256 result) {\n if (m == 0) return (false, 0);\n assembly (\"memory-safe\") {\n let ptr := mload(0x40)\n // | Offset | Content | Content (Hex) |\n // |-----------|------------|--------------------------------------------------------------------|\n // | 0x00:0x1f | size of b | 0x0000000000000000000000000000000000000000000000000000000000000020 |\n // | 0x20:0x3f | size of e | 0x0000000000000000000000000000000000000000000000000000000000000020 |\n // | 0x40:0x5f | size of m | 0x0000000000000000000000000000000000000000000000000000000000000020 |\n // | 0x60:0x7f | value of b | 0x<.............................................................b> |\n // | 0x80:0x9f | value of e | 0x<.............................................................e> |\n // | 0xa0:0xbf | value of m | 0x<.............................................................m> |\n mstore(ptr, 0x20)\n mstore(add(ptr, 0x20), 0x20)\n mstore(add(ptr, 0x40), 0x20)\n mstore(add(ptr, 0x60), b)\n mstore(add(ptr, 0x80), e)\n mstore(add(ptr, 0xa0), m)\n\n // Given the result < m, it's guaranteed to fit in 32 bytes,\n // so we can use the memory scratch space located at offset 0.\n success := staticcall(gas(), 0x05, ptr, 0xc0, 0x00, 0x20)\n result := mload(0x00)\n }\n }\n\n /**\n * @dev Variant of {modExp} that supports inputs of arbitrary length.\n */\n function modExp(bytes memory b, bytes memory e, bytes memory m) internal view returns (bytes memory) {\n (bool success, bytes memory result) = tryModExp(b, e, m);\n if (!success) {\n Panic.panic(Panic.DIVISION_BY_ZERO);\n }\n return result;\n }\n\n /**\n * @dev Variant of {tryModExp} that supports inputs of arbitrary length.\n */\n function tryModExp(\n bytes memory b,\n bytes memory e,\n bytes memory m\n ) internal view returns (bool success, bytes memory result) {\n if (_zeroBytes(m)) return (false, new bytes(0));\n\n uint256 mLen = m.length;\n\n // Encode call args in result and move the free memory pointer\n result = abi.encodePacked(b.length, e.length, mLen, b, e, m);\n\n assembly (\"memory-safe\") {\n let dataPtr := add(result, 0x20)\n // Write result on top of args to avoid allocating extra memory.\n success := staticcall(gas(), 0x05, dataPtr, mload(result), dataPtr, mLen)\n // Overwrite the length.\n // result.length > returndatasize() is guaranteed because returndatasize() == m.length\n mstore(result, mLen)\n // Set the memory pointer after the returned data.\n mstore(0x40, add(dataPtr, mLen))\n }\n }\n\n /**\n * @dev Returns whether the provided byte array is zero.\n */\n function _zeroBytes(bytes memory byteArray) private pure returns (bool) {\n for (uint256 i = 0; i < byteArray.length; ++i) {\n if (byteArray[i] != 0) {\n return false;\n }\n }\n return true;\n }\n\n /**\n * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded\n * towards zero.\n *\n * This method is based on Newton's method for computing square roots; the algorithm is restricted to only\n * using integer operations.\n */\n function sqrt(uint256 a) internal pure returns (uint256) {\n unchecked {\n // Take care of easy edge cases when a == 0 or a == 1\n if (a <= 1) {\n return a;\n }\n\n // In this function, we use Newton's method to get a root of `f(x) := x² - a`. It involves building a\n // sequence x_n that converges toward sqrt(a). For each iteration x_n, we also define the error between\n // the current value as `ε_n = | x_n - sqrt(a) |`.\n //\n // For our first estimation, we consider `e` the smallest power of 2 which is bigger than the square root\n // of the target. (i.e. `2**(e-1) ≤ sqrt(a) < 2**e`). We know that `e ≤ 128` because `(2¹²⁸)² = 2²⁵⁶` is\n // bigger than any uint256.\n //\n // By noticing that\n // `2**(e-1) ≤ sqrt(a) < 2**e → (2**(e-1))² ≤ a < (2**e)² → 2**(2*e-2) ≤ a < 2**(2*e)`\n // we can deduce that `e - 1` is `log2(a) / 2`. We can thus compute `x_n = 2**(e-1)` using a method similar\n // to the msb function.\n uint256 aa = a;\n uint256 xn = 1;\n\n if (aa >= (1 << 128)) {\n aa >>= 128;\n xn <<= 64;\n }\n if (aa >= (1 << 64)) {\n aa >>= 64;\n xn <<= 32;\n }\n if (aa >= (1 << 32)) {\n aa >>= 32;\n xn <<= 16;\n }\n if (aa >= (1 << 16)) {\n aa >>= 16;\n xn <<= 8;\n }\n if (aa >= (1 << 8)) {\n aa >>= 8;\n xn <<= 4;\n }\n if (aa >= (1 << 4)) {\n aa >>= 4;\n xn <<= 2;\n }\n if (aa >= (1 << 2)) {\n xn <<= 1;\n }\n\n // We now have x_n such that `x_n = 2**(e-1) ≤ sqrt(a) < 2**e = 2 * x_n`. This implies ε_n ≤ 2**(e-1).\n //\n // We can refine our estimation by noticing that the middle of that interval minimizes the error.\n // If we move x_n to equal 2**(e-1) + 2**(e-2), then we reduce the error to ε_n ≤ 2**(e-2).\n // This is going to be our x_0 (and ε_0)\n xn = (3 * xn) >> 1; // ε_0 := | x_0 - sqrt(a) | ≤ 2**(e-2)\n\n // From here, Newton's method give us:\n // x_{n+1} = (x_n + a / x_n) / 2\n //\n // One should note that:\n // x_{n+1}² - a = ((x_n + a / x_n) / 2)² - a\n // = ((x_n² + a) / (2 * x_n))² - a\n // = (x_n⁴ + 2 * a * x_n² + a²) / (4 * x_n²) - a\n // = (x_n⁴ + 2 * a * x_n² + a² - 4 * a * x_n²) / (4 * x_n²)\n // = (x_n⁴ - 2 * a * x_n² + a²) / (4 * x_n²)\n // = (x_n² - a)² / (2 * x_n)²\n // = ((x_n² - a) / (2 * x_n))²\n // ≥ 0\n // Which proves that for all n ≥ 1, sqrt(a) ≤ x_n\n //\n // This gives us the proof of quadratic convergence of the sequence:\n // ε_{n+1} = | x_{n+1} - sqrt(a) |\n // = | (x_n + a / x_n) / 2 - sqrt(a) |\n // = | (x_n² + a - 2*x_n*sqrt(a)) / (2 * x_n) |\n // = | (x_n - sqrt(a))² / (2 * x_n) |\n // = | ε_n² / (2 * x_n) |\n // = ε_n² / | (2 * x_n) |\n //\n // For the first iteration, we have a special case where x_0 is known:\n // ε_1 = ε_0² / | (2 * x_0) |\n // ≤ (2**(e-2))² / (2 * (2**(e-1) + 2**(e-2)))\n // ≤ 2**(2*e-4) / (3 * 2**(e-1))\n // ≤ 2**(e-3) / 3\n // ≤ 2**(e-3-log2(3))\n // ≤ 2**(e-4.5)\n //\n // For the following iterations, we use the fact that, 2**(e-1) ≤ sqrt(a) ≤ x_n:\n // ε_{n+1} = ε_n² / | (2 * x_n) |\n // ≤ (2**(e-k))² / (2 * 2**(e-1))\n // ≤ 2**(2*e-2*k) / 2**e\n // ≤ 2**(e-2*k)\n xn = (xn + a / xn) >> 1; // ε_1 := | x_1 - sqrt(a) | ≤ 2**(e-4.5) -- special case, see above\n xn = (xn + a / xn) >> 1; // ε_2 := | x_2 - sqrt(a) | ≤ 2**(e-9) -- general case with k = 4.5\n xn = (xn + a / xn) >> 1; // ε_3 := | x_3 - sqrt(a) | ≤ 2**(e-18) -- general case with k = 9\n xn = (xn + a / xn) >> 1; // ε_4 := | x_4 - sqrt(a) | ≤ 2**(e-36) -- general case with k = 18\n xn = (xn + a / xn) >> 1; // ε_5 := | x_5 - sqrt(a) | ≤ 2**(e-72) -- general case with k = 36\n xn = (xn + a / xn) >> 1; // ε_6 := | x_6 - sqrt(a) | ≤ 2**(e-144) -- general case with k = 72\n\n // Because e ≤ 128 (as discussed during the first estimation phase), we know have reached a precision\n // ε_6 ≤ 2**(e-144) < 1. Given we're operating on integers, then we can ensure that xn is now either\n // sqrt(a) or sqrt(a) + 1.\n return xn - SafeCast.toUint(xn > a / xn);\n }\n }\n\n /**\n * @dev 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 + SafeCast.toUint(unsignedRoundsUp(rounding) && result * result < a);\n }\n }\n\n /**\n * @dev Return the log in base 2 of a positive value rounded towards zero.\n * Returns 0 if given 0.\n */\n function log2(uint256 value) internal pure returns (uint256) {\n uint256 result = 0;\n uint256 exp;\n unchecked {\n exp = 128 * SafeCast.toUint(value > (1 << 128) - 1);\n value >>= exp;\n result += exp;\n\n exp = 64 * SafeCast.toUint(value > (1 << 64) - 1);\n value >>= exp;\n result += exp;\n\n exp = 32 * SafeCast.toUint(value > (1 << 32) - 1);\n value >>= exp;\n result += exp;\n\n exp = 16 * SafeCast.toUint(value > (1 << 16) - 1);\n value >>= exp;\n result += exp;\n\n exp = 8 * SafeCast.toUint(value > (1 << 8) - 1);\n value >>= exp;\n result += exp;\n\n exp = 4 * SafeCast.toUint(value > (1 << 4) - 1);\n value >>= exp;\n result += exp;\n\n exp = 2 * SafeCast.toUint(value > (1 << 2) - 1);\n value >>= exp;\n result += exp;\n\n result += SafeCast.toUint(value > 1);\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 + SafeCast.toUint(unsignedRoundsUp(rounding) && 1 << result < value);\n }\n }\n\n /**\n * @dev Return the log in base 10 of a positive value rounded towards zero.\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 + SafeCast.toUint(unsignedRoundsUp(rounding) && 10 ** result < value);\n }\n }\n\n /**\n * @dev Return the log in base 256 of a positive value rounded towards zero.\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 uint256 isGt;\n unchecked {\n isGt = SafeCast.toUint(value > (1 << 128) - 1);\n value >>= isGt * 128;\n result += isGt * 16;\n\n isGt = SafeCast.toUint(value > (1 << 64) - 1);\n value >>= isGt * 64;\n result += isGt * 8;\n\n isGt = SafeCast.toUint(value > (1 << 32) - 1);\n value >>= isGt * 32;\n result += isGt * 4;\n\n isGt = SafeCast.toUint(value > (1 << 16) - 1);\n value >>= isGt * 16;\n result += isGt * 2;\n\n result += SafeCast.toUint(value > (1 << 8) - 1);\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 + SafeCast.toUint(unsignedRoundsUp(rounding) && 1 << (result << 3) < value);\n }\n }\n\n /**\n * @dev Returns whether a provided rounding mode is considered rounding up for unsigned integers.\n */\n function unsignedRoundsUp(Rounding rounding) internal pure returns (bool) {\n return uint8(rounding) % 2 == 1;\n }\n}\n" + }, + "@openzeppelin/contracts/utils/math/SafeCast.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/math/SafeCast.sol)\n// This file was procedurally generated from scripts/generate/templates/SafeCast.js.\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Wrappers over Solidity's uintXX/intXX/bool casting operators with added overflow\n * checks.\n *\n * Downcasting from uint256/int256 in Solidity does not revert on overflow. This can\n * easily result in undesired exploitation or bugs, since developers usually\n * assume that overflows raise errors. `SafeCast` restores this intuition by\n * reverting the transaction when such an operation overflows.\n *\n * Using this library instead of the unchecked operations eliminates an entire\n * class of bugs, so it's recommended to use it always.\n */\nlibrary SafeCast {\n /**\n * @dev Value doesn't fit in an uint of `bits` size.\n */\n error SafeCastOverflowedUintDowncast(uint8 bits, uint256 value);\n\n /**\n * @dev An int value doesn't fit in an uint of `bits` size.\n */\n error SafeCastOverflowedIntToUint(int256 value);\n\n /**\n * @dev Value doesn't fit in an int of `bits` size.\n */\n error SafeCastOverflowedIntDowncast(uint8 bits, int256 value);\n\n /**\n * @dev An uint value doesn't fit in an int of `bits` size.\n */\n error SafeCastOverflowedUintToInt(uint256 value);\n\n /**\n * @dev Returns the downcasted uint248 from uint256, reverting on\n * overflow (when the input is greater than largest uint248).\n *\n * Counterpart to Solidity's `uint248` operator.\n *\n * Requirements:\n *\n * - input must fit into 248 bits\n */\n function toUint248(uint256 value) internal pure returns (uint248) {\n if (value > type(uint248).max) {\n revert SafeCastOverflowedUintDowncast(248, value);\n }\n return uint248(value);\n }\n\n /**\n * @dev Returns the downcasted uint240 from uint256, reverting on\n * overflow (when the input is greater than largest uint240).\n *\n * Counterpart to Solidity's `uint240` operator.\n *\n * Requirements:\n *\n * - input must fit into 240 bits\n */\n function toUint240(uint256 value) internal pure returns (uint240) {\n if (value > type(uint240).max) {\n revert SafeCastOverflowedUintDowncast(240, value);\n }\n return uint240(value);\n }\n\n /**\n * @dev Returns the downcasted uint232 from uint256, reverting on\n * overflow (when the input is greater than largest uint232).\n *\n * Counterpart to Solidity's `uint232` operator.\n *\n * Requirements:\n *\n * - input must fit into 232 bits\n */\n function toUint232(uint256 value) internal pure returns (uint232) {\n if (value > type(uint232).max) {\n revert SafeCastOverflowedUintDowncast(232, value);\n }\n return uint232(value);\n }\n\n /**\n * @dev Returns the downcasted uint224 from uint256, reverting on\n * overflow (when the input is greater than largest uint224).\n *\n * Counterpart to Solidity's `uint224` operator.\n *\n * Requirements:\n *\n * - input must fit into 224 bits\n */\n function toUint224(uint256 value) internal pure returns (uint224) {\n if (value > type(uint224).max) {\n revert SafeCastOverflowedUintDowncast(224, value);\n }\n return uint224(value);\n }\n\n /**\n * @dev Returns the downcasted uint216 from uint256, reverting on\n * overflow (when the input is greater than largest uint216).\n *\n * Counterpart to Solidity's `uint216` operator.\n *\n * Requirements:\n *\n * - input must fit into 216 bits\n */\n function toUint216(uint256 value) internal pure returns (uint216) {\n if (value > type(uint216).max) {\n revert SafeCastOverflowedUintDowncast(216, value);\n }\n return uint216(value);\n }\n\n /**\n * @dev Returns the downcasted uint208 from uint256, reverting on\n * overflow (when the input is greater than largest uint208).\n *\n * Counterpart to Solidity's `uint208` operator.\n *\n * Requirements:\n *\n * - input must fit into 208 bits\n */\n function toUint208(uint256 value) internal pure returns (uint208) {\n if (value > type(uint208).max) {\n revert SafeCastOverflowedUintDowncast(208, value);\n }\n return uint208(value);\n }\n\n /**\n * @dev Returns the downcasted uint200 from uint256, reverting on\n * overflow (when the input is greater than largest uint200).\n *\n * Counterpart to Solidity's `uint200` operator.\n *\n * Requirements:\n *\n * - input must fit into 200 bits\n */\n function toUint200(uint256 value) internal pure returns (uint200) {\n if (value > type(uint200).max) {\n revert SafeCastOverflowedUintDowncast(200, value);\n }\n return uint200(value);\n }\n\n /**\n * @dev Returns the downcasted uint192 from uint256, reverting on\n * overflow (when the input is greater than largest uint192).\n *\n * Counterpart to Solidity's `uint192` operator.\n *\n * Requirements:\n *\n * - input must fit into 192 bits\n */\n function toUint192(uint256 value) internal pure returns (uint192) {\n if (value > type(uint192).max) {\n revert SafeCastOverflowedUintDowncast(192, value);\n }\n return uint192(value);\n }\n\n /**\n * @dev Returns the downcasted uint184 from uint256, reverting on\n * overflow (when the input is greater than largest uint184).\n *\n * Counterpart to Solidity's `uint184` operator.\n *\n * Requirements:\n *\n * - input must fit into 184 bits\n */\n function toUint184(uint256 value) internal pure returns (uint184) {\n if (value > type(uint184).max) {\n revert SafeCastOverflowedUintDowncast(184, value);\n }\n return uint184(value);\n }\n\n /**\n * @dev Returns the downcasted uint176 from uint256, reverting on\n * overflow (when the input is greater than largest uint176).\n *\n * Counterpart to Solidity's `uint176` operator.\n *\n * Requirements:\n *\n * - input must fit into 176 bits\n */\n function toUint176(uint256 value) internal pure returns (uint176) {\n if (value > type(uint176).max) {\n revert SafeCastOverflowedUintDowncast(176, value);\n }\n return uint176(value);\n }\n\n /**\n * @dev Returns the downcasted uint168 from uint256, reverting on\n * overflow (when the input is greater than largest uint168).\n *\n * Counterpart to Solidity's `uint168` operator.\n *\n * Requirements:\n *\n * - input must fit into 168 bits\n */\n function toUint168(uint256 value) internal pure returns (uint168) {\n if (value > type(uint168).max) {\n revert SafeCastOverflowedUintDowncast(168, value);\n }\n return uint168(value);\n }\n\n /**\n * @dev Returns the downcasted uint160 from uint256, reverting on\n * overflow (when the input is greater than largest uint160).\n *\n * Counterpart to Solidity's `uint160` operator.\n *\n * Requirements:\n *\n * - input must fit into 160 bits\n */\n function toUint160(uint256 value) internal pure returns (uint160) {\n if (value > type(uint160).max) {\n revert SafeCastOverflowedUintDowncast(160, value);\n }\n return uint160(value);\n }\n\n /**\n * @dev Returns the downcasted uint152 from uint256, reverting on\n * overflow (when the input is greater than largest uint152).\n *\n * Counterpart to Solidity's `uint152` operator.\n *\n * Requirements:\n *\n * - input must fit into 152 bits\n */\n function toUint152(uint256 value) internal pure returns (uint152) {\n if (value > type(uint152).max) {\n revert SafeCastOverflowedUintDowncast(152, value);\n }\n return uint152(value);\n }\n\n /**\n * @dev Returns the downcasted uint144 from uint256, reverting on\n * overflow (when the input is greater than largest uint144).\n *\n * Counterpart to Solidity's `uint144` operator.\n *\n * Requirements:\n *\n * - input must fit into 144 bits\n */\n function toUint144(uint256 value) internal pure returns (uint144) {\n if (value > type(uint144).max) {\n revert SafeCastOverflowedUintDowncast(144, value);\n }\n return uint144(value);\n }\n\n /**\n * @dev Returns the downcasted uint136 from uint256, reverting on\n * overflow (when the input is greater than largest uint136).\n *\n * Counterpart to Solidity's `uint136` operator.\n *\n * Requirements:\n *\n * - input must fit into 136 bits\n */\n function toUint136(uint256 value) internal pure returns (uint136) {\n if (value > type(uint136).max) {\n revert SafeCastOverflowedUintDowncast(136, value);\n }\n return uint136(value);\n }\n\n /**\n * @dev Returns the downcasted uint128 from uint256, reverting on\n * overflow (when the input is greater than largest uint128).\n *\n * Counterpart to Solidity's `uint128` operator.\n *\n * Requirements:\n *\n * - input must fit into 128 bits\n */\n function toUint128(uint256 value) internal pure returns (uint128) {\n if (value > type(uint128).max) {\n revert SafeCastOverflowedUintDowncast(128, value);\n }\n return uint128(value);\n }\n\n /**\n * @dev Returns the downcasted uint120 from uint256, reverting on\n * overflow (when the input is greater than largest uint120).\n *\n * Counterpart to Solidity's `uint120` operator.\n *\n * Requirements:\n *\n * - input must fit into 120 bits\n */\n function toUint120(uint256 value) internal pure returns (uint120) {\n if (value > type(uint120).max) {\n revert SafeCastOverflowedUintDowncast(120, value);\n }\n return uint120(value);\n }\n\n /**\n * @dev Returns the downcasted uint112 from uint256, reverting on\n * overflow (when the input is greater than largest uint112).\n *\n * Counterpart to Solidity's `uint112` operator.\n *\n * Requirements:\n *\n * - input must fit into 112 bits\n */\n function toUint112(uint256 value) internal pure returns (uint112) {\n if (value > type(uint112).max) {\n revert SafeCastOverflowedUintDowncast(112, value);\n }\n return uint112(value);\n }\n\n /**\n * @dev Returns the downcasted uint104 from uint256, reverting on\n * overflow (when the input is greater than largest uint104).\n *\n * Counterpart to Solidity's `uint104` operator.\n *\n * Requirements:\n *\n * - input must fit into 104 bits\n */\n function toUint104(uint256 value) internal pure returns (uint104) {\n if (value > type(uint104).max) {\n revert SafeCastOverflowedUintDowncast(104, value);\n }\n return uint104(value);\n }\n\n /**\n * @dev Returns the downcasted uint96 from uint256, reverting on\n * overflow (when the input is greater than largest uint96).\n *\n * Counterpart to Solidity's `uint96` operator.\n *\n * Requirements:\n *\n * - input must fit into 96 bits\n */\n function toUint96(uint256 value) internal pure returns (uint96) {\n if (value > type(uint96).max) {\n revert SafeCastOverflowedUintDowncast(96, value);\n }\n return uint96(value);\n }\n\n /**\n * @dev Returns the downcasted uint88 from uint256, reverting on\n * overflow (when the input is greater than largest uint88).\n *\n * Counterpart to Solidity's `uint88` operator.\n *\n * Requirements:\n *\n * - input must fit into 88 bits\n */\n function toUint88(uint256 value) internal pure returns (uint88) {\n if (value > type(uint88).max) {\n revert SafeCastOverflowedUintDowncast(88, value);\n }\n return uint88(value);\n }\n\n /**\n * @dev Returns the downcasted uint80 from uint256, reverting on\n * overflow (when the input is greater than largest uint80).\n *\n * Counterpart to Solidity's `uint80` operator.\n *\n * Requirements:\n *\n * - input must fit into 80 bits\n */\n function toUint80(uint256 value) internal pure returns (uint80) {\n if (value > type(uint80).max) {\n revert SafeCastOverflowedUintDowncast(80, value);\n }\n return uint80(value);\n }\n\n /**\n * @dev Returns the downcasted uint72 from uint256, reverting on\n * overflow (when the input is greater than largest uint72).\n *\n * Counterpart to Solidity's `uint72` operator.\n *\n * Requirements:\n *\n * - input must fit into 72 bits\n */\n function toUint72(uint256 value) internal pure returns (uint72) {\n if (value > type(uint72).max) {\n revert SafeCastOverflowedUintDowncast(72, value);\n }\n return uint72(value);\n }\n\n /**\n * @dev Returns the downcasted uint64 from uint256, reverting on\n * overflow (when the input is greater than largest uint64).\n *\n * Counterpart to Solidity's `uint64` operator.\n *\n * Requirements:\n *\n * - input must fit into 64 bits\n */\n function toUint64(uint256 value) internal pure returns (uint64) {\n if (value > type(uint64).max) {\n revert SafeCastOverflowedUintDowncast(64, value);\n }\n return uint64(value);\n }\n\n /**\n * @dev Returns the downcasted uint56 from uint256, reverting on\n * overflow (when the input is greater than largest uint56).\n *\n * Counterpart to Solidity's `uint56` operator.\n *\n * Requirements:\n *\n * - input must fit into 56 bits\n */\n function toUint56(uint256 value) internal pure returns (uint56) {\n if (value > type(uint56).max) {\n revert SafeCastOverflowedUintDowncast(56, value);\n }\n return uint56(value);\n }\n\n /**\n * @dev Returns the downcasted uint48 from uint256, reverting on\n * overflow (when the input is greater than largest uint48).\n *\n * Counterpart to Solidity's `uint48` operator.\n *\n * Requirements:\n *\n * - input must fit into 48 bits\n */\n function toUint48(uint256 value) internal pure returns (uint48) {\n if (value > type(uint48).max) {\n revert SafeCastOverflowedUintDowncast(48, value);\n }\n return uint48(value);\n }\n\n /**\n * @dev Returns the downcasted uint40 from uint256, reverting on\n * overflow (when the input is greater than largest uint40).\n *\n * Counterpart to Solidity's `uint40` operator.\n *\n * Requirements:\n *\n * - input must fit into 40 bits\n */\n function toUint40(uint256 value) internal pure returns (uint40) {\n if (value > type(uint40).max) {\n revert SafeCastOverflowedUintDowncast(40, value);\n }\n return uint40(value);\n }\n\n /**\n * @dev Returns the downcasted uint32 from uint256, reverting on\n * overflow (when the input is greater than largest uint32).\n *\n * Counterpart to Solidity's `uint32` operator.\n *\n * Requirements:\n *\n * - input must fit into 32 bits\n */\n function toUint32(uint256 value) internal pure returns (uint32) {\n if (value > type(uint32).max) {\n revert SafeCastOverflowedUintDowncast(32, value);\n }\n return uint32(value);\n }\n\n /**\n * @dev Returns the downcasted uint24 from uint256, reverting on\n * overflow (when the input is greater than largest uint24).\n *\n * Counterpart to Solidity's `uint24` operator.\n *\n * Requirements:\n *\n * - input must fit into 24 bits\n */\n function toUint24(uint256 value) internal pure returns (uint24) {\n if (value > type(uint24).max) {\n revert SafeCastOverflowedUintDowncast(24, value);\n }\n return uint24(value);\n }\n\n /**\n * @dev Returns the downcasted uint16 from uint256, reverting on\n * overflow (when the input is greater than largest uint16).\n *\n * Counterpart to Solidity's `uint16` operator.\n *\n * Requirements:\n *\n * - input must fit into 16 bits\n */\n function toUint16(uint256 value) internal pure returns (uint16) {\n if (value > type(uint16).max) {\n revert SafeCastOverflowedUintDowncast(16, value);\n }\n return uint16(value);\n }\n\n /**\n * @dev Returns the downcasted uint8 from uint256, reverting on\n * overflow (when the input is greater than largest uint8).\n *\n * Counterpart to Solidity's `uint8` operator.\n *\n * Requirements:\n *\n * - input must fit into 8 bits\n */\n function toUint8(uint256 value) internal pure returns (uint8) {\n if (value > type(uint8).max) {\n revert SafeCastOverflowedUintDowncast(8, value);\n }\n return uint8(value);\n }\n\n /**\n * @dev Converts a signed int256 into an unsigned uint256.\n *\n * Requirements:\n *\n * - input must be greater than or equal to 0.\n */\n function toUint256(int256 value) internal pure returns (uint256) {\n if (value < 0) {\n revert SafeCastOverflowedIntToUint(value);\n }\n return uint256(value);\n }\n\n /**\n * @dev Returns the downcasted int248 from int256, reverting on\n * overflow (when the input is less than smallest int248 or\n * greater than largest int248).\n *\n * Counterpart to Solidity's `int248` operator.\n *\n * Requirements:\n *\n * - input must fit into 248 bits\n */\n function toInt248(int256 value) internal pure returns (int248 downcasted) {\n downcasted = int248(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(248, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int240 from int256, reverting on\n * overflow (when the input is less than smallest int240 or\n * greater than largest int240).\n *\n * Counterpart to Solidity's `int240` operator.\n *\n * Requirements:\n *\n * - input must fit into 240 bits\n */\n function toInt240(int256 value) internal pure returns (int240 downcasted) {\n downcasted = int240(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(240, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int232 from int256, reverting on\n * overflow (when the input is less than smallest int232 or\n * greater than largest int232).\n *\n * Counterpart to Solidity's `int232` operator.\n *\n * Requirements:\n *\n * - input must fit into 232 bits\n */\n function toInt232(int256 value) internal pure returns (int232 downcasted) {\n downcasted = int232(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(232, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int224 from int256, reverting on\n * overflow (when the input is less than smallest int224 or\n * greater than largest int224).\n *\n * Counterpart to Solidity's `int224` operator.\n *\n * Requirements:\n *\n * - input must fit into 224 bits\n */\n function toInt224(int256 value) internal pure returns (int224 downcasted) {\n downcasted = int224(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(224, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int216 from int256, reverting on\n * overflow (when the input is less than smallest int216 or\n * greater than largest int216).\n *\n * Counterpart to Solidity's `int216` operator.\n *\n * Requirements:\n *\n * - input must fit into 216 bits\n */\n function toInt216(int256 value) internal pure returns (int216 downcasted) {\n downcasted = int216(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(216, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int208 from int256, reverting on\n * overflow (when the input is less than smallest int208 or\n * greater than largest int208).\n *\n * Counterpart to Solidity's `int208` operator.\n *\n * Requirements:\n *\n * - input must fit into 208 bits\n */\n function toInt208(int256 value) internal pure returns (int208 downcasted) {\n downcasted = int208(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(208, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int200 from int256, reverting on\n * overflow (when the input is less than smallest int200 or\n * greater than largest int200).\n *\n * Counterpart to Solidity's `int200` operator.\n *\n * Requirements:\n *\n * - input must fit into 200 bits\n */\n function toInt200(int256 value) internal pure returns (int200 downcasted) {\n downcasted = int200(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(200, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int192 from int256, reverting on\n * overflow (when the input is less than smallest int192 or\n * greater than largest int192).\n *\n * Counterpart to Solidity's `int192` operator.\n *\n * Requirements:\n *\n * - input must fit into 192 bits\n */\n function toInt192(int256 value) internal pure returns (int192 downcasted) {\n downcasted = int192(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(192, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int184 from int256, reverting on\n * overflow (when the input is less than smallest int184 or\n * greater than largest int184).\n *\n * Counterpart to Solidity's `int184` operator.\n *\n * Requirements:\n *\n * - input must fit into 184 bits\n */\n function toInt184(int256 value) internal pure returns (int184 downcasted) {\n downcasted = int184(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(184, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int176 from int256, reverting on\n * overflow (when the input is less than smallest int176 or\n * greater than largest int176).\n *\n * Counterpart to Solidity's `int176` operator.\n *\n * Requirements:\n *\n * - input must fit into 176 bits\n */\n function toInt176(int256 value) internal pure returns (int176 downcasted) {\n downcasted = int176(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(176, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int168 from int256, reverting on\n * overflow (when the input is less than smallest int168 or\n * greater than largest int168).\n *\n * Counterpart to Solidity's `int168` operator.\n *\n * Requirements:\n *\n * - input must fit into 168 bits\n */\n function toInt168(int256 value) internal pure returns (int168 downcasted) {\n downcasted = int168(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(168, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int160 from int256, reverting on\n * overflow (when the input is less than smallest int160 or\n * greater than largest int160).\n *\n * Counterpart to Solidity's `int160` operator.\n *\n * Requirements:\n *\n * - input must fit into 160 bits\n */\n function toInt160(int256 value) internal pure returns (int160 downcasted) {\n downcasted = int160(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(160, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int152 from int256, reverting on\n * overflow (when the input is less than smallest int152 or\n * greater than largest int152).\n *\n * Counterpart to Solidity's `int152` operator.\n *\n * Requirements:\n *\n * - input must fit into 152 bits\n */\n function toInt152(int256 value) internal pure returns (int152 downcasted) {\n downcasted = int152(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(152, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int144 from int256, reverting on\n * overflow (when the input is less than smallest int144 or\n * greater than largest int144).\n *\n * Counterpart to Solidity's `int144` operator.\n *\n * Requirements:\n *\n * - input must fit into 144 bits\n */\n function toInt144(int256 value) internal pure returns (int144 downcasted) {\n downcasted = int144(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(144, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int136 from int256, reverting on\n * overflow (when the input is less than smallest int136 or\n * greater than largest int136).\n *\n * Counterpart to Solidity's `int136` operator.\n *\n * Requirements:\n *\n * - input must fit into 136 bits\n */\n function toInt136(int256 value) internal pure returns (int136 downcasted) {\n downcasted = int136(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(136, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int128 from int256, reverting on\n * overflow (when the input is less than smallest int128 or\n * greater than largest int128).\n *\n * Counterpart to Solidity's `int128` operator.\n *\n * Requirements:\n *\n * - input must fit into 128 bits\n */\n function toInt128(int256 value) internal pure returns (int128 downcasted) {\n downcasted = int128(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(128, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int120 from int256, reverting on\n * overflow (when the input is less than smallest int120 or\n * greater than largest int120).\n *\n * Counterpart to Solidity's `int120` operator.\n *\n * Requirements:\n *\n * - input must fit into 120 bits\n */\n function toInt120(int256 value) internal pure returns (int120 downcasted) {\n downcasted = int120(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(120, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int112 from int256, reverting on\n * overflow (when the input is less than smallest int112 or\n * greater than largest int112).\n *\n * Counterpart to Solidity's `int112` operator.\n *\n * Requirements:\n *\n * - input must fit into 112 bits\n */\n function toInt112(int256 value) internal pure returns (int112 downcasted) {\n downcasted = int112(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(112, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int104 from int256, reverting on\n * overflow (when the input is less than smallest int104 or\n * greater than largest int104).\n *\n * Counterpart to Solidity's `int104` operator.\n *\n * Requirements:\n *\n * - input must fit into 104 bits\n */\n function toInt104(int256 value) internal pure returns (int104 downcasted) {\n downcasted = int104(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(104, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int96 from int256, reverting on\n * overflow (when the input is less than smallest int96 or\n * greater than largest int96).\n *\n * Counterpart to Solidity's `int96` operator.\n *\n * Requirements:\n *\n * - input must fit into 96 bits\n */\n function toInt96(int256 value) internal pure returns (int96 downcasted) {\n downcasted = int96(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(96, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int88 from int256, reverting on\n * overflow (when the input is less than smallest int88 or\n * greater than largest int88).\n *\n * Counterpart to Solidity's `int88` operator.\n *\n * Requirements:\n *\n * - input must fit into 88 bits\n */\n function toInt88(int256 value) internal pure returns (int88 downcasted) {\n downcasted = int88(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(88, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int80 from int256, reverting on\n * overflow (when the input is less than smallest int80 or\n * greater than largest int80).\n *\n * Counterpart to Solidity's `int80` operator.\n *\n * Requirements:\n *\n * - input must fit into 80 bits\n */\n function toInt80(int256 value) internal pure returns (int80 downcasted) {\n downcasted = int80(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(80, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int72 from int256, reverting on\n * overflow (when the input is less than smallest int72 or\n * greater than largest int72).\n *\n * Counterpart to Solidity's `int72` operator.\n *\n * Requirements:\n *\n * - input must fit into 72 bits\n */\n function toInt72(int256 value) internal pure returns (int72 downcasted) {\n downcasted = int72(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(72, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int64 from int256, reverting on\n * overflow (when the input is less than smallest int64 or\n * greater than largest int64).\n *\n * Counterpart to Solidity's `int64` operator.\n *\n * Requirements:\n *\n * - input must fit into 64 bits\n */\n function toInt64(int256 value) internal pure returns (int64 downcasted) {\n downcasted = int64(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(64, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int56 from int256, reverting on\n * overflow (when the input is less than smallest int56 or\n * greater than largest int56).\n *\n * Counterpart to Solidity's `int56` operator.\n *\n * Requirements:\n *\n * - input must fit into 56 bits\n */\n function toInt56(int256 value) internal pure returns (int56 downcasted) {\n downcasted = int56(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(56, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int48 from int256, reverting on\n * overflow (when the input is less than smallest int48 or\n * greater than largest int48).\n *\n * Counterpart to Solidity's `int48` operator.\n *\n * Requirements:\n *\n * - input must fit into 48 bits\n */\n function toInt48(int256 value) internal pure returns (int48 downcasted) {\n downcasted = int48(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(48, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int40 from int256, reverting on\n * overflow (when the input is less than smallest int40 or\n * greater than largest int40).\n *\n * Counterpart to Solidity's `int40` operator.\n *\n * Requirements:\n *\n * - input must fit into 40 bits\n */\n function toInt40(int256 value) internal pure returns (int40 downcasted) {\n downcasted = int40(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(40, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int32 from int256, reverting on\n * overflow (when the input is less than smallest int32 or\n * greater than largest int32).\n *\n * Counterpart to Solidity's `int32` operator.\n *\n * Requirements:\n *\n * - input must fit into 32 bits\n */\n function toInt32(int256 value) internal pure returns (int32 downcasted) {\n downcasted = int32(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(32, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int24 from int256, reverting on\n * overflow (when the input is less than smallest int24 or\n * greater than largest int24).\n *\n * Counterpart to Solidity's `int24` operator.\n *\n * Requirements:\n *\n * - input must fit into 24 bits\n */\n function toInt24(int256 value) internal pure returns (int24 downcasted) {\n downcasted = int24(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(24, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int16 from int256, reverting on\n * overflow (when the input is less than smallest int16 or\n * greater than largest int16).\n *\n * Counterpart to Solidity's `int16` operator.\n *\n * Requirements:\n *\n * - input must fit into 16 bits\n */\n function toInt16(int256 value) internal pure returns (int16 downcasted) {\n downcasted = int16(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(16, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int8 from int256, reverting on\n * overflow (when the input is less than smallest int8 or\n * greater than largest int8).\n *\n * Counterpart to Solidity's `int8` operator.\n *\n * Requirements:\n *\n * - input must fit into 8 bits\n */\n function toInt8(int256 value) internal pure returns (int8 downcasted) {\n downcasted = int8(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(8, value);\n }\n }\n\n /**\n * @dev Converts an unsigned uint256 into a signed int256.\n *\n * Requirements:\n *\n * - input must be less than or equal to maxInt256.\n */\n function toInt256(uint256 value) internal pure returns (int256) {\n // Note: Unsafe cast below is okay because `type(int256).max` is guaranteed to be positive\n if (value > uint256(type(int256).max)) {\n revert SafeCastOverflowedUintToInt(value);\n }\n return int256(value);\n }\n\n /**\n * @dev Cast a boolean (false or true) to a uint256 (0 or 1) with no jump.\n */\n function toUint(bool b) internal pure returns (uint256 u) {\n assembly (\"memory-safe\") {\n u := iszero(iszero(b))\n }\n }\n}\n" + }, + "@openzeppelin/contracts/utils/math/SignedMath.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/math/SignedMath.sol)\n\npragma solidity ^0.8.20;\n\nimport {SafeCast} from \"./SafeCast.sol\";\n\n/**\n * @dev Standard signed math utilities missing in the Solidity language.\n */\nlibrary SignedMath {\n /**\n * @dev Branchless ternary evaluation for `a ? b : c`. Gas costs are constant.\n *\n * IMPORTANT: This function may reduce bytecode size and consume less gas when used standalone.\n * However, the compiler may optimize Solidity ternary operations (i.e. `a ? b : c`) to only compute\n * one branch when needed, making this function more expensive.\n */\n function ternary(bool condition, int256 a, int256 b) internal pure returns (int256) {\n unchecked {\n // branchless ternary works because:\n // b ^ (a ^ b) == a\n // b ^ 0 == b\n return b ^ ((a ^ b) * int256(SafeCast.toUint(condition)));\n }\n }\n\n /**\n * @dev Returns the largest of two signed numbers.\n */\n function max(int256 a, int256 b) internal pure returns (int256) {\n return ternary(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 ternary(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 // Formula from the \"Bit Twiddling Hacks\" by Sean Eron Anderson.\n // Since `n` is a signed integer, the generated bytecode will use the SAR opcode to perform the right shift,\n // taking advantage of the most significant (or \"sign\" bit) in two's complement representation.\n // This opcode adds new most significant bits set to the value of the previous most significant bit. As a result,\n // the mask will either be `bytes32(0)` (if n is positive) or `~bytes32(0)` (if n is negative).\n int256 mask = n >> 255;\n\n // A `bytes32(0)` mask leaves the input unchanged, while a `~bytes32(0)` mask complements it.\n return uint256((n + mask) ^ mask);\n }\n }\n}\n" + }, + "@openzeppelin/contracts/utils/Nonces.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/Nonces.sol)\npragma solidity ^0.8.20;\n\n/**\n * @dev Provides tracking nonces for addresses. Nonces will only increment.\n */\nabstract contract Nonces {\n /**\n * @dev The nonce used for an `account` is not the expected current nonce.\n */\n error InvalidAccountNonce(address account, uint256 currentNonce);\n\n mapping(address account => uint256) private _nonces;\n\n /**\n * @dev Returns the next unused nonce for an address.\n */\n function nonces(address owner) public view virtual returns (uint256) {\n return _nonces[owner];\n }\n\n /**\n * @dev Consumes a nonce.\n *\n * Returns the current value and increments nonce.\n */\n function _useNonce(address owner) internal virtual returns (uint256) {\n // For each account, the nonce has an initial value of 0, can only be incremented by one, and cannot be\n // decremented or reset. This guarantees that the nonce never overflows.\n unchecked {\n // It is important to do x++ and not ++x here.\n return _nonces[owner]++;\n }\n }\n\n /**\n * @dev Same as {_useNonce} but checking that `nonce` is the next valid for `owner`.\n */\n function _useCheckedNonce(address owner, uint256 nonce) internal virtual {\n uint256 current = _useNonce(owner);\n if (nonce != current) {\n revert InvalidAccountNonce(owner, current);\n }\n }\n}\n" + }, + "@openzeppelin/contracts/utils/Panic.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/Panic.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Helper library for emitting standardized panic codes.\n *\n * ```solidity\n * contract Example {\n * using Panic for uint256;\n *\n * // Use any of the declared internal constants\n * function foo() { Panic.GENERIC.panic(); }\n *\n * // Alternatively\n * function foo() { Panic.panic(Panic.GENERIC); }\n * }\n * ```\n *\n * Follows the list from https://github.com/ethereum/solidity/blob/v0.8.24/libsolutil/ErrorCodes.h[libsolutil].\n *\n * _Available since v5.1._\n */\n// slither-disable-next-line unused-state\nlibrary Panic {\n /// @dev generic / unspecified error\n uint256 internal constant GENERIC = 0x00;\n /// @dev used by the assert() builtin\n uint256 internal constant ASSERT = 0x01;\n /// @dev arithmetic underflow or overflow\n uint256 internal constant UNDER_OVERFLOW = 0x11;\n /// @dev division or modulo by zero\n uint256 internal constant DIVISION_BY_ZERO = 0x12;\n /// @dev enum conversion error\n uint256 internal constant ENUM_CONVERSION_ERROR = 0x21;\n /// @dev invalid encoding in storage\n uint256 internal constant STORAGE_ENCODING_ERROR = 0x22;\n /// @dev empty array pop\n uint256 internal constant EMPTY_ARRAY_POP = 0x31;\n /// @dev array out of bounds access\n uint256 internal constant ARRAY_OUT_OF_BOUNDS = 0x32;\n /// @dev resource error (too large allocation or too large array)\n uint256 internal constant RESOURCE_ERROR = 0x41;\n /// @dev calling invalid internal function\n uint256 internal constant INVALID_INTERNAL_FUNCTION = 0x51;\n\n /// @dev Reverts with a panic code. Recommended to use with\n /// the internal constants with predefined codes.\n function panic(uint256 code) internal pure {\n assembly (\"memory-safe\") {\n mstore(0x00, 0x4e487b71)\n mstore(0x20, code)\n revert(0x1c, 0x24)\n }\n }\n}\n" + }, + "@openzeppelin/contracts/utils/ShortStrings.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/ShortStrings.sol)\n\npragma solidity ^0.8.20;\n\nimport {StorageSlot} from \"./StorageSlot.sol\";\n\n// | string | 0xAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA |\n// | length | 0x BB |\ntype ShortString is bytes32;\n\n/**\n * @dev This library provides functions to convert short memory strings\n * into a `ShortString` type that can be used as an immutable variable.\n *\n * Strings of arbitrary length can be optimized using this library if\n * they are short enough (up to 31 bytes) by packing them with their\n * length (1 byte) in a single EVM word (32 bytes). Additionally, a\n * fallback mechanism can be used for every other case.\n *\n * Usage example:\n *\n * ```solidity\n * contract Named {\n * using ShortStrings for *;\n *\n * ShortString private immutable _name;\n * string private _nameFallback;\n *\n * constructor(string memory contractName) {\n * _name = contractName.toShortStringWithFallback(_nameFallback);\n * }\n *\n * function name() external view returns (string memory) {\n * return _name.toStringWithFallback(_nameFallback);\n * }\n * }\n * ```\n */\nlibrary ShortStrings {\n // Used as an identifier for strings longer than 31 bytes.\n bytes32 private constant FALLBACK_SENTINEL = 0x00000000000000000000000000000000000000000000000000000000000000FF;\n\n error StringTooLong(string str);\n error InvalidShortString();\n\n /**\n * @dev Encode a string of at most 31 chars into a `ShortString`.\n *\n * This will trigger a `StringTooLong` error is the input string is too long.\n */\n function toShortString(string memory str) internal pure returns (ShortString) {\n bytes memory bstr = bytes(str);\n if (bstr.length > 31) {\n revert StringTooLong(str);\n }\n return ShortString.wrap(bytes32(uint256(bytes32(bstr)) | bstr.length));\n }\n\n /**\n * @dev Decode a `ShortString` back to a \"normal\" string.\n */\n function toString(ShortString sstr) internal pure returns (string memory) {\n uint256 len = byteLength(sstr);\n // using `new string(len)` would work locally but is not memory safe.\n string memory str = new string(32);\n assembly (\"memory-safe\") {\n mstore(str, len)\n mstore(add(str, 0x20), sstr)\n }\n return str;\n }\n\n /**\n * @dev Return the length of a `ShortString`.\n */\n function byteLength(ShortString sstr) internal pure returns (uint256) {\n uint256 result = uint256(ShortString.unwrap(sstr)) & 0xFF;\n if (result > 31) {\n revert InvalidShortString();\n }\n return result;\n }\n\n /**\n * @dev Encode a string into a `ShortString`, or write it to storage if it is too long.\n */\n function toShortStringWithFallback(string memory value, string storage store) internal returns (ShortString) {\n if (bytes(value).length < 32) {\n return toShortString(value);\n } else {\n StorageSlot.getStringSlot(store).value = value;\n return ShortString.wrap(FALLBACK_SENTINEL);\n }\n }\n\n /**\n * @dev Decode a string that was encoded to `ShortString` or written to storage using {setWithFallback}.\n */\n function toStringWithFallback(ShortString value, string storage store) internal pure returns (string memory) {\n if (ShortString.unwrap(value) != FALLBACK_SENTINEL) {\n return toString(value);\n } else {\n return store;\n }\n }\n\n /**\n * @dev Return the length of a string that was encoded to `ShortString` or written to storage using\n * {setWithFallback}.\n *\n * WARNING: This will return the \"byte length\" of the string. This may not reflect the actual length in terms of\n * actual characters as the UTF-8 encoding of a single character can span over multiple bytes.\n */\n function byteLengthWithFallback(ShortString value, string storage store) internal view returns (uint256) {\n if (ShortString.unwrap(value) != FALLBACK_SENTINEL) {\n return byteLength(value);\n } else {\n return bytes(store).length;\n }\n }\n}\n" + }, + "@openzeppelin/contracts/utils/StorageSlot.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/StorageSlot.sol)\n// This file was procedurally generated from scripts/generate/templates/StorageSlot.js.\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Library for reading and writing primitive types to specific storage slots.\n *\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\n * This library helps with reading and writing to such slots without the need for inline assembly.\n *\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\n *\n * Example usage to set ERC-1967 implementation slot:\n * ```solidity\n * contract ERC1967 {\n * // Define the slot. Alternatively, use the SlotDerivation library to derive the slot.\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\n *\n * function _getImplementation() internal view returns (address) {\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\n * }\n *\n * function _setImplementation(address newImplementation) internal {\n * require(newImplementation.code.length > 0);\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\n * }\n * }\n * ```\n *\n * TIP: Consider using this library along with {SlotDerivation}.\n */\nlibrary StorageSlot {\n struct AddressSlot {\n address value;\n }\n\n struct BooleanSlot {\n bool value;\n }\n\n struct Bytes32Slot {\n bytes32 value;\n }\n\n struct Uint256Slot {\n uint256 value;\n }\n\n struct Int256Slot {\n int256 value;\n }\n\n struct StringSlot {\n string value;\n }\n\n struct BytesSlot {\n bytes value;\n }\n\n /**\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\n */\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\n assembly (\"memory-safe\") {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns a `BooleanSlot` with member `value` located at `slot`.\n */\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\n assembly (\"memory-safe\") {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns a `Bytes32Slot` with member `value` located at `slot`.\n */\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\n assembly (\"memory-safe\") {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns a `Uint256Slot` with member `value` located at `slot`.\n */\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\n assembly (\"memory-safe\") {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns a `Int256Slot` with member `value` located at `slot`.\n */\n function getInt256Slot(bytes32 slot) internal pure returns (Int256Slot storage r) {\n assembly (\"memory-safe\") {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns a `StringSlot` with member `value` located at `slot`.\n */\n function getStringSlot(bytes32 slot) internal pure returns (StringSlot storage r) {\n assembly (\"memory-safe\") {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `StringSlot` representation of the string storage pointer `store`.\n */\n function getStringSlot(string storage store) internal pure returns (StringSlot storage r) {\n assembly (\"memory-safe\") {\n r.slot := store.slot\n }\n }\n\n /**\n * @dev Returns a `BytesSlot` with member `value` located at `slot`.\n */\n function getBytesSlot(bytes32 slot) internal pure returns (BytesSlot storage r) {\n assembly (\"memory-safe\") {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `BytesSlot` representation of the bytes storage pointer `store`.\n */\n function getBytesSlot(bytes storage store) internal pure returns (BytesSlot storage r) {\n assembly (\"memory-safe\") {\n r.slot := store.slot\n }\n }\n}\n" + }, + "@openzeppelin/contracts/utils/Strings.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/Strings.sol)\n\npragma solidity ^0.8.20;\n\nimport {Math} from \"./math/Math.sol\";\nimport {SignedMath} from \"./math/SignedMath.sol\";\n\n/**\n * @dev String operations.\n */\nlibrary Strings {\n bytes16 private constant HEX_DIGITS = \"0123456789abcdef\";\n uint8 private constant ADDRESS_LENGTH = 20;\n\n /**\n * @dev The `value` string doesn't fit in the specified `length`.\n */\n error StringsInsufficientHexLength(uint256 value, uint256 length);\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 assembly (\"memory-safe\") {\n ptr := add(buffer, add(32, length))\n }\n while (true) {\n ptr--;\n assembly (\"memory-safe\") {\n mstore8(ptr, byte(mod(value, 10), HEX_DIGITS))\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 toStringSigned(int256 value) internal pure returns (string memory) {\n return string.concat(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 uint256 localValue = value;\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] = HEX_DIGITS[localValue & 0xf];\n localValue >>= 4;\n }\n if (localValue != 0) {\n revert StringsInsufficientHexLength(value, length);\n }\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\n * 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 Converts an `address` with fixed length of 20 bytes to its checksummed ASCII `string` hexadecimal\n * representation, according to EIP-55.\n */\n function toChecksumHexString(address addr) internal pure returns (string memory) {\n bytes memory buffer = bytes(toHexString(addr));\n\n // hash the hex part of buffer (skip length + 2 bytes, length 40)\n uint256 hashValue;\n assembly (\"memory-safe\") {\n hashValue := shr(96, keccak256(add(buffer, 0x22), 40))\n }\n\n for (uint256 i = 41; i > 1; --i) {\n // possible values for buffer[i] are 48 (0) to 57 (9) and 97 (a) to 102 (f)\n if (hashValue & 0xf > 7 && uint8(buffer[i]) > 96) {\n // case shift by xoring with 0x20\n buffer[i] ^= 0x20;\n }\n hashValue >>= 4;\n }\n return string(buffer);\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 bytes(a).length == bytes(b).length && keccak256(bytes(a)) == keccak256(bytes(b));\n }\n}\n" + }, + "@openzeppelin/contracts/utils/structs/Checkpoints.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/structs/Checkpoints.sol)\n// This file was procedurally generated from scripts/generate/templates/Checkpoints.js.\n\npragma solidity ^0.8.20;\n\nimport {Math} from \"../math/Math.sol\";\n\n/**\n * @dev This library defines the `Trace*` struct, for checkpointing values as they change at different points in\n * time, and later looking up past values by block number. See {Votes} as an example.\n *\n * To create a history of checkpoints define a variable type `Checkpoints.Trace*` in your contract, and store a new\n * checkpoint for the current transaction block using the {push} function.\n */\nlibrary Checkpoints {\n /**\n * @dev A value was attempted to be inserted on a past checkpoint.\n */\n error CheckpointUnorderedInsertion();\n\n struct Trace224 {\n Checkpoint224[] _checkpoints;\n }\n\n struct Checkpoint224 {\n uint32 _key;\n uint224 _value;\n }\n\n /**\n * @dev Pushes a (`key`, `value`) pair into a Trace224 so that it is stored as the checkpoint.\n *\n * Returns previous value and new value.\n *\n * IMPORTANT: Never accept `key` as a user input, since an arbitrary `type(uint32).max` key set will disable the\n * library.\n */\n function push(\n Trace224 storage self,\n uint32 key,\n uint224 value\n ) internal returns (uint224 oldValue, uint224 newValue) {\n return _insert(self._checkpoints, key, value);\n }\n\n /**\n * @dev Returns the value in the first (oldest) checkpoint with key greater or equal than the search key, or zero if\n * there is none.\n */\n function lowerLookup(Trace224 storage self, uint32 key) internal view returns (uint224) {\n uint256 len = self._checkpoints.length;\n uint256 pos = _lowerBinaryLookup(self._checkpoints, key, 0, len);\n return pos == len ? 0 : _unsafeAccess(self._checkpoints, pos)._value;\n }\n\n /**\n * @dev Returns the value in the last (most recent) checkpoint with key lower or equal than the search key, or zero\n * if there is none.\n */\n function upperLookup(Trace224 storage self, uint32 key) internal view returns (uint224) {\n uint256 len = self._checkpoints.length;\n uint256 pos = _upperBinaryLookup(self._checkpoints, key, 0, len);\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\n }\n\n /**\n * @dev Returns the value in the last (most recent) checkpoint with key lower or equal than the search key, or zero\n * if there is none.\n *\n * NOTE: This is a variant of {upperLookup} that is optimised to find \"recent\" checkpoint (checkpoints with high\n * keys).\n */\n function upperLookupRecent(Trace224 storage self, uint32 key) internal view returns (uint224) {\n uint256 len = self._checkpoints.length;\n\n uint256 low = 0;\n uint256 high = len;\n\n if (len > 5) {\n uint256 mid = len - Math.sqrt(len);\n if (key < _unsafeAccess(self._checkpoints, mid)._key) {\n high = mid;\n } else {\n low = mid + 1;\n }\n }\n\n uint256 pos = _upperBinaryLookup(self._checkpoints, key, low, high);\n\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\n }\n\n /**\n * @dev Returns the value in the most recent checkpoint, or zero if there are no checkpoints.\n */\n function latest(Trace224 storage self) internal view returns (uint224) {\n uint256 pos = self._checkpoints.length;\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\n }\n\n /**\n * @dev Returns whether there is a checkpoint in the structure (i.e. it is not empty), and if so the key and value\n * in the most recent checkpoint.\n */\n function latestCheckpoint(Trace224 storage self) internal view returns (bool exists, uint32 _key, uint224 _value) {\n uint256 pos = self._checkpoints.length;\n if (pos == 0) {\n return (false, 0, 0);\n } else {\n Checkpoint224 storage ckpt = _unsafeAccess(self._checkpoints, pos - 1);\n return (true, ckpt._key, ckpt._value);\n }\n }\n\n /**\n * @dev Returns the number of checkpoint.\n */\n function length(Trace224 storage self) internal view returns (uint256) {\n return self._checkpoints.length;\n }\n\n /**\n * @dev Returns checkpoint at given position.\n */\n function at(Trace224 storage self, uint32 pos) internal view returns (Checkpoint224 memory) {\n return self._checkpoints[pos];\n }\n\n /**\n * @dev Pushes a (`key`, `value`) pair into an ordered list of checkpoints, either by inserting a new checkpoint,\n * or by updating the last one.\n */\n function _insert(\n Checkpoint224[] storage self,\n uint32 key,\n uint224 value\n ) private returns (uint224 oldValue, uint224 newValue) {\n uint256 pos = self.length;\n\n if (pos > 0) {\n Checkpoint224 storage last = _unsafeAccess(self, pos - 1);\n uint32 lastKey = last._key;\n uint224 lastValue = last._value;\n\n // Checkpoint keys must be non-decreasing.\n if (lastKey > key) {\n revert CheckpointUnorderedInsertion();\n }\n\n // Update or push new checkpoint\n if (lastKey == key) {\n last._value = value;\n } else {\n self.push(Checkpoint224({_key: key, _value: value}));\n }\n return (lastValue, value);\n } else {\n self.push(Checkpoint224({_key: key, _value: value}));\n return (0, value);\n }\n }\n\n /**\n * @dev Return the index of the first (oldest) checkpoint with key strictly bigger than the search key, or `high`\n * if there is none. `low` and `high` define a section where to do the search, with inclusive `low` and exclusive\n * `high`.\n *\n * WARNING: `high` should not be greater than the array's length.\n */\n function _upperBinaryLookup(\n Checkpoint224[] storage self,\n uint32 key,\n uint256 low,\n uint256 high\n ) private view returns (uint256) {\n while (low < high) {\n uint256 mid = Math.average(low, high);\n if (_unsafeAccess(self, mid)._key > key) {\n high = mid;\n } else {\n low = mid + 1;\n }\n }\n return high;\n }\n\n /**\n * @dev Return the index of the first (oldest) checkpoint with key greater or equal than the search key, or `high`\n * if there is none. `low` and `high` define a section where to do the search, with inclusive `low` and exclusive\n * `high`.\n *\n * WARNING: `high` should not be greater than the array's length.\n */\n function _lowerBinaryLookup(\n Checkpoint224[] storage self,\n uint32 key,\n uint256 low,\n uint256 high\n ) private view returns (uint256) {\n while (low < high) {\n uint256 mid = Math.average(low, high);\n if (_unsafeAccess(self, mid)._key < key) {\n low = mid + 1;\n } else {\n high = mid;\n }\n }\n return high;\n }\n\n /**\n * @dev Access an element of the array without performing bounds check. The position is assumed to be within bounds.\n */\n function _unsafeAccess(\n Checkpoint224[] storage self,\n uint256 pos\n ) private pure returns (Checkpoint224 storage result) {\n assembly {\n mstore(0, self.slot)\n result.slot := add(keccak256(0, 0x20), pos)\n }\n }\n\n struct Trace208 {\n Checkpoint208[] _checkpoints;\n }\n\n struct Checkpoint208 {\n uint48 _key;\n uint208 _value;\n }\n\n /**\n * @dev Pushes a (`key`, `value`) pair into a Trace208 so that it is stored as the checkpoint.\n *\n * Returns previous value and new value.\n *\n * IMPORTANT: Never accept `key` as a user input, since an arbitrary `type(uint48).max` key set will disable the\n * library.\n */\n function push(\n Trace208 storage self,\n uint48 key,\n uint208 value\n ) internal returns (uint208 oldValue, uint208 newValue) {\n return _insert(self._checkpoints, key, value);\n }\n\n /**\n * @dev Returns the value in the first (oldest) checkpoint with key greater or equal than the search key, or zero if\n * there is none.\n */\n function lowerLookup(Trace208 storage self, uint48 key) internal view returns (uint208) {\n uint256 len = self._checkpoints.length;\n uint256 pos = _lowerBinaryLookup(self._checkpoints, key, 0, len);\n return pos == len ? 0 : _unsafeAccess(self._checkpoints, pos)._value;\n }\n\n /**\n * @dev Returns the value in the last (most recent) checkpoint with key lower or equal than the search key, or zero\n * if there is none.\n */\n function upperLookup(Trace208 storage self, uint48 key) internal view returns (uint208) {\n uint256 len = self._checkpoints.length;\n uint256 pos = _upperBinaryLookup(self._checkpoints, key, 0, len);\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\n }\n\n /**\n * @dev Returns the value in the last (most recent) checkpoint with key lower or equal than the search key, or zero\n * if there is none.\n *\n * NOTE: This is a variant of {upperLookup} that is optimised to find \"recent\" checkpoint (checkpoints with high\n * keys).\n */\n function upperLookupRecent(Trace208 storage self, uint48 key) internal view returns (uint208) {\n uint256 len = self._checkpoints.length;\n\n uint256 low = 0;\n uint256 high = len;\n\n if (len > 5) {\n uint256 mid = len - Math.sqrt(len);\n if (key < _unsafeAccess(self._checkpoints, mid)._key) {\n high = mid;\n } else {\n low = mid + 1;\n }\n }\n\n uint256 pos = _upperBinaryLookup(self._checkpoints, key, low, high);\n\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\n }\n\n /**\n * @dev Returns the value in the most recent checkpoint, or zero if there are no checkpoints.\n */\n function latest(Trace208 storage self) internal view returns (uint208) {\n uint256 pos = self._checkpoints.length;\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\n }\n\n /**\n * @dev Returns whether there is a checkpoint in the structure (i.e. it is not empty), and if so the key and value\n * in the most recent checkpoint.\n */\n function latestCheckpoint(Trace208 storage self) internal view returns (bool exists, uint48 _key, uint208 _value) {\n uint256 pos = self._checkpoints.length;\n if (pos == 0) {\n return (false, 0, 0);\n } else {\n Checkpoint208 storage ckpt = _unsafeAccess(self._checkpoints, pos - 1);\n return (true, ckpt._key, ckpt._value);\n }\n }\n\n /**\n * @dev Returns the number of checkpoint.\n */\n function length(Trace208 storage self) internal view returns (uint256) {\n return self._checkpoints.length;\n }\n\n /**\n * @dev Returns checkpoint at given position.\n */\n function at(Trace208 storage self, uint32 pos) internal view returns (Checkpoint208 memory) {\n return self._checkpoints[pos];\n }\n\n /**\n * @dev Pushes a (`key`, `value`) pair into an ordered list of checkpoints, either by inserting a new checkpoint,\n * or by updating the last one.\n */\n function _insert(\n Checkpoint208[] storage self,\n uint48 key,\n uint208 value\n ) private returns (uint208 oldValue, uint208 newValue) {\n uint256 pos = self.length;\n\n if (pos > 0) {\n Checkpoint208 storage last = _unsafeAccess(self, pos - 1);\n uint48 lastKey = last._key;\n uint208 lastValue = last._value;\n\n // Checkpoint keys must be non-decreasing.\n if (lastKey > key) {\n revert CheckpointUnorderedInsertion();\n }\n\n // Update or push new checkpoint\n if (lastKey == key) {\n last._value = value;\n } else {\n self.push(Checkpoint208({_key: key, _value: value}));\n }\n return (lastValue, value);\n } else {\n self.push(Checkpoint208({_key: key, _value: value}));\n return (0, value);\n }\n }\n\n /**\n * @dev Return the index of the first (oldest) checkpoint with key strictly bigger than the search key, or `high`\n * if there is none. `low` and `high` define a section where to do the search, with inclusive `low` and exclusive\n * `high`.\n *\n * WARNING: `high` should not be greater than the array's length.\n */\n function _upperBinaryLookup(\n Checkpoint208[] storage self,\n uint48 key,\n uint256 low,\n uint256 high\n ) private view returns (uint256) {\n while (low < high) {\n uint256 mid = Math.average(low, high);\n if (_unsafeAccess(self, mid)._key > key) {\n high = mid;\n } else {\n low = mid + 1;\n }\n }\n return high;\n }\n\n /**\n * @dev Return the index of the first (oldest) checkpoint with key greater or equal than the search key, or `high`\n * if there is none. `low` and `high` define a section where to do the search, with inclusive `low` and exclusive\n * `high`.\n *\n * WARNING: `high` should not be greater than the array's length.\n */\n function _lowerBinaryLookup(\n Checkpoint208[] storage self,\n uint48 key,\n uint256 low,\n uint256 high\n ) private view returns (uint256) {\n while (low < high) {\n uint256 mid = Math.average(low, high);\n if (_unsafeAccess(self, mid)._key < key) {\n low = mid + 1;\n } else {\n high = mid;\n }\n }\n return high;\n }\n\n /**\n * @dev Access an element of the array without performing bounds check. The position is assumed to be within bounds.\n */\n function _unsafeAccess(\n Checkpoint208[] storage self,\n uint256 pos\n ) private pure returns (Checkpoint208 storage result) {\n assembly {\n mstore(0, self.slot)\n result.slot := add(keccak256(0, 0x20), pos)\n }\n }\n\n struct Trace160 {\n Checkpoint160[] _checkpoints;\n }\n\n struct Checkpoint160 {\n uint96 _key;\n uint160 _value;\n }\n\n /**\n * @dev Pushes a (`key`, `value`) pair into a Trace160 so that it is stored as the checkpoint.\n *\n * Returns previous value and new value.\n *\n * IMPORTANT: Never accept `key` as a user input, since an arbitrary `type(uint96).max` key set will disable the\n * library.\n */\n function push(\n Trace160 storage self,\n uint96 key,\n uint160 value\n ) internal returns (uint160 oldValue, uint160 newValue) {\n return _insert(self._checkpoints, key, value);\n }\n\n /**\n * @dev Returns the value in the first (oldest) checkpoint with key greater or equal than the search key, or zero if\n * there is none.\n */\n function lowerLookup(Trace160 storage self, uint96 key) internal view returns (uint160) {\n uint256 len = self._checkpoints.length;\n uint256 pos = _lowerBinaryLookup(self._checkpoints, key, 0, len);\n return pos == len ? 0 : _unsafeAccess(self._checkpoints, pos)._value;\n }\n\n /**\n * @dev Returns the value in the last (most recent) checkpoint with key lower or equal than the search key, or zero\n * if there is none.\n */\n function upperLookup(Trace160 storage self, uint96 key) internal view returns (uint160) {\n uint256 len = self._checkpoints.length;\n uint256 pos = _upperBinaryLookup(self._checkpoints, key, 0, len);\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\n }\n\n /**\n * @dev Returns the value in the last (most recent) checkpoint with key lower or equal than the search key, or zero\n * if there is none.\n *\n * NOTE: This is a variant of {upperLookup} that is optimised to find \"recent\" checkpoint (checkpoints with high\n * keys).\n */\n function upperLookupRecent(Trace160 storage self, uint96 key) internal view returns (uint160) {\n uint256 len = self._checkpoints.length;\n\n uint256 low = 0;\n uint256 high = len;\n\n if (len > 5) {\n uint256 mid = len - Math.sqrt(len);\n if (key < _unsafeAccess(self._checkpoints, mid)._key) {\n high = mid;\n } else {\n low = mid + 1;\n }\n }\n\n uint256 pos = _upperBinaryLookup(self._checkpoints, key, low, high);\n\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\n }\n\n /**\n * @dev Returns the value in the most recent checkpoint, or zero if there are no checkpoints.\n */\n function latest(Trace160 storage self) internal view returns (uint160) {\n uint256 pos = self._checkpoints.length;\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\n }\n\n /**\n * @dev Returns whether there is a checkpoint in the structure (i.e. it is not empty), and if so the key and value\n * in the most recent checkpoint.\n */\n function latestCheckpoint(Trace160 storage self) internal view returns (bool exists, uint96 _key, uint160 _value) {\n uint256 pos = self._checkpoints.length;\n if (pos == 0) {\n return (false, 0, 0);\n } else {\n Checkpoint160 storage ckpt = _unsafeAccess(self._checkpoints, pos - 1);\n return (true, ckpt._key, ckpt._value);\n }\n }\n\n /**\n * @dev Returns the number of checkpoint.\n */\n function length(Trace160 storage self) internal view returns (uint256) {\n return self._checkpoints.length;\n }\n\n /**\n * @dev Returns checkpoint at given position.\n */\n function at(Trace160 storage self, uint32 pos) internal view returns (Checkpoint160 memory) {\n return self._checkpoints[pos];\n }\n\n /**\n * @dev Pushes a (`key`, `value`) pair into an ordered list of checkpoints, either by inserting a new checkpoint,\n * or by updating the last one.\n */\n function _insert(\n Checkpoint160[] storage self,\n uint96 key,\n uint160 value\n ) private returns (uint160 oldValue, uint160 newValue) {\n uint256 pos = self.length;\n\n if (pos > 0) {\n Checkpoint160 storage last = _unsafeAccess(self, pos - 1);\n uint96 lastKey = last._key;\n uint160 lastValue = last._value;\n\n // Checkpoint keys must be non-decreasing.\n if (lastKey > key) {\n revert CheckpointUnorderedInsertion();\n }\n\n // Update or push new checkpoint\n if (lastKey == key) {\n last._value = value;\n } else {\n self.push(Checkpoint160({_key: key, _value: value}));\n }\n return (lastValue, value);\n } else {\n self.push(Checkpoint160({_key: key, _value: value}));\n return (0, value);\n }\n }\n\n /**\n * @dev Return the index of the first (oldest) checkpoint with key strictly bigger than the search key, or `high`\n * if there is none. `low` and `high` define a section where to do the search, with inclusive `low` and exclusive\n * `high`.\n *\n * WARNING: `high` should not be greater than the array's length.\n */\n function _upperBinaryLookup(\n Checkpoint160[] storage self,\n uint96 key,\n uint256 low,\n uint256 high\n ) private view returns (uint256) {\n while (low < high) {\n uint256 mid = Math.average(low, high);\n if (_unsafeAccess(self, mid)._key > key) {\n high = mid;\n } else {\n low = mid + 1;\n }\n }\n return high;\n }\n\n /**\n * @dev Return the index of the first (oldest) checkpoint with key greater or equal than the search key, or `high`\n * if there is none. `low` and `high` define a section where to do the search, with inclusive `low` and exclusive\n * `high`.\n *\n * WARNING: `high` should not be greater than the array's length.\n */\n function _lowerBinaryLookup(\n Checkpoint160[] storage self,\n uint96 key,\n uint256 low,\n uint256 high\n ) private view returns (uint256) {\n while (low < high) {\n uint256 mid = Math.average(low, high);\n if (_unsafeAccess(self, mid)._key < key) {\n low = mid + 1;\n } else {\n high = mid;\n }\n }\n return high;\n }\n\n /**\n * @dev Access an element of the array without performing bounds check. The position is assumed to be within bounds.\n */\n function _unsafeAccess(\n Checkpoint160[] storage self,\n uint256 pos\n ) private pure returns (Checkpoint160 storage result) {\n assembly {\n mstore(0, self.slot)\n result.slot := add(keccak256(0, 0x20), pos)\n }\n }\n}\n" + }, + "@openzeppelin/contracts/utils/structs/DoubleEndedQueue.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/structs/DoubleEndedQueue.sol)\npragma solidity ^0.8.20;\n\nimport {Panic} from \"../Panic.sol\";\n\n/**\n * @dev A sequence of items with the ability to efficiently push and pop items (i.e. insert and remove) on both ends of\n * the sequence (called front and back). Among other access patterns, it can be used to implement efficient LIFO and\n * FIFO queues. Storage use is optimized, and all operations are O(1) constant time. This includes {clear}, given that\n * the existing queue contents are left in storage.\n *\n * The struct is called `Bytes32Deque`. Other types can be cast to and from `bytes32`. This data structure can only be\n * used in storage, and not in memory.\n * ```solidity\n * DoubleEndedQueue.Bytes32Deque queue;\n * ```\n */\nlibrary DoubleEndedQueue {\n /**\n * @dev Indices are 128 bits so begin and end are packed in a single storage slot for efficient access.\n *\n * Struct members have an underscore prefix indicating that they are \"private\" and should not be read or written to\n * directly. Use the functions provided below instead. Modifying the struct manually may violate assumptions and\n * lead to unexpected behavior.\n *\n * The first item is at data[begin] and the last item is at data[end - 1]. This range can wrap around.\n */\n struct Bytes32Deque {\n uint128 _begin;\n uint128 _end;\n mapping(uint128 index => bytes32) _data;\n }\n\n /**\n * @dev Inserts an item at the end of the queue.\n *\n * Reverts with {Panic-RESOURCE_ERROR} if the queue is full.\n */\n function pushBack(Bytes32Deque storage deque, bytes32 value) internal {\n unchecked {\n uint128 backIndex = deque._end;\n if (backIndex + 1 == deque._begin) Panic.panic(Panic.RESOURCE_ERROR);\n deque._data[backIndex] = value;\n deque._end = backIndex + 1;\n }\n }\n\n /**\n * @dev Removes the item at the end of the queue and returns it.\n *\n * Reverts with {Panic-EMPTY_ARRAY_POP} if the queue is empty.\n */\n function popBack(Bytes32Deque storage deque) internal returns (bytes32 value) {\n unchecked {\n uint128 backIndex = deque._end;\n if (backIndex == deque._begin) Panic.panic(Panic.EMPTY_ARRAY_POP);\n --backIndex;\n value = deque._data[backIndex];\n delete deque._data[backIndex];\n deque._end = backIndex;\n }\n }\n\n /**\n * @dev Inserts an item at the beginning of the queue.\n *\n * Reverts with {Panic-RESOURCE_ERROR} if the queue is full.\n */\n function pushFront(Bytes32Deque storage deque, bytes32 value) internal {\n unchecked {\n uint128 frontIndex = deque._begin - 1;\n if (frontIndex == deque._end) Panic.panic(Panic.RESOURCE_ERROR);\n deque._data[frontIndex] = value;\n deque._begin = frontIndex;\n }\n }\n\n /**\n * @dev Removes the item at the beginning of the queue and returns it.\n *\n * Reverts with {Panic-EMPTY_ARRAY_POP} if the queue is empty.\n */\n function popFront(Bytes32Deque storage deque) internal returns (bytes32 value) {\n unchecked {\n uint128 frontIndex = deque._begin;\n if (frontIndex == deque._end) Panic.panic(Panic.EMPTY_ARRAY_POP);\n value = deque._data[frontIndex];\n delete deque._data[frontIndex];\n deque._begin = frontIndex + 1;\n }\n }\n\n /**\n * @dev Returns the item at the beginning of the queue.\n *\n * Reverts with {Panic-ARRAY_OUT_OF_BOUNDS} if the queue is empty.\n */\n function front(Bytes32Deque storage deque) internal view returns (bytes32 value) {\n if (empty(deque)) Panic.panic(Panic.ARRAY_OUT_OF_BOUNDS);\n return deque._data[deque._begin];\n }\n\n /**\n * @dev Returns the item at the end of the queue.\n *\n * Reverts with {Panic-ARRAY_OUT_OF_BOUNDS} if the queue is empty.\n */\n function back(Bytes32Deque storage deque) internal view returns (bytes32 value) {\n if (empty(deque)) Panic.panic(Panic.ARRAY_OUT_OF_BOUNDS);\n unchecked {\n return deque._data[deque._end - 1];\n }\n }\n\n /**\n * @dev Return the item at a position in the queue given by `index`, with the first item at 0 and last item at\n * `length(deque) - 1`.\n *\n * Reverts with {Panic-ARRAY_OUT_OF_BOUNDS} if the index is out of bounds.\n */\n function at(Bytes32Deque storage deque, uint256 index) internal view returns (bytes32 value) {\n if (index >= length(deque)) Panic.panic(Panic.ARRAY_OUT_OF_BOUNDS);\n // By construction, length is a uint128, so the check above ensures that index can be safely downcast to uint128\n unchecked {\n return deque._data[deque._begin + uint128(index)];\n }\n }\n\n /**\n * @dev Resets the queue back to being empty.\n *\n * NOTE: The current items are left behind in storage. This does not affect the functioning of the queue, but misses\n * out on potential gas refunds.\n */\n function clear(Bytes32Deque storage deque) internal {\n deque._begin = 0;\n deque._end = 0;\n }\n\n /**\n * @dev Returns the number of items in the queue.\n */\n function length(Bytes32Deque storage deque) internal view returns (uint256) {\n unchecked {\n return uint256(deque._end - deque._begin);\n }\n }\n\n /**\n * @dev Returns true if the queue is empty.\n */\n function empty(Bytes32Deque storage deque) internal view returns (bool) {\n return deque._end == deque._begin;\n }\n}\n" + }, + "@openzeppelin/contracts/utils/types/Time.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/types/Time.sol)\n\npragma solidity ^0.8.20;\n\nimport {Math} from \"../math/Math.sol\";\nimport {SafeCast} from \"../math/SafeCast.sol\";\n\n/**\n * @dev This library provides helpers for manipulating time-related objects.\n *\n * It uses the following types:\n * - `uint48` for timepoints\n * - `uint32` for durations\n *\n * While the library doesn't provide specific types for timepoints and duration, it does provide:\n * - a `Delay` type to represent duration that can be programmed to change value automatically at a given point\n * - additional helper functions\n */\nlibrary Time {\n using Time for *;\n\n /**\n * @dev Get the block timestamp as a Timepoint.\n */\n function timestamp() internal view returns (uint48) {\n return SafeCast.toUint48(block.timestamp);\n }\n\n /**\n * @dev Get the block number as a Timepoint.\n */\n function blockNumber() internal view returns (uint48) {\n return SafeCast.toUint48(block.number);\n }\n\n // ==================================================== Delay =====================================================\n /**\n * @dev A `Delay` is a uint32 duration that can be programmed to change value automatically at a given point in the\n * future. The \"effect\" timepoint describes when the transitions happens from the \"old\" value to the \"new\" value.\n * This allows updating the delay applied to some operation while keeping some guarantees.\n *\n * In particular, the {update} function guarantees that if the delay is reduced, the old delay still applies for\n * some time. For example if the delay is currently 7 days to do an upgrade, the admin should not be able to set\n * the delay to 0 and upgrade immediately. If the admin wants to reduce the delay, the old delay (7 days) should\n * still apply for some time.\n *\n *\n * The `Delay` type is 112 bits long, and packs the following:\n *\n * ```\n * | [uint48]: effect date (timepoint)\n * | | [uint32]: value before (duration)\n * ↓ ↓ ↓ [uint32]: value after (duration)\n * 0xAAAAAAAAAAAABBBBBBBBCCCCCCCC\n * ```\n *\n * NOTE: The {get} and {withUpdate} functions operate using timestamps. Block number based delays are not currently\n * supported.\n */\n type Delay is uint112;\n\n /**\n * @dev Wrap a duration into a Delay to add the one-step \"update in the future\" feature\n */\n function toDelay(uint32 duration) internal pure returns (Delay) {\n return Delay.wrap(duration);\n }\n\n /**\n * @dev Get the value at a given timepoint plus the pending value and effect timepoint if there is a scheduled\n * change after this timepoint. If the effect timepoint is 0, then the pending value should not be considered.\n */\n function _getFullAt(\n Delay self,\n uint48 timepoint\n ) private pure returns (uint32 valueBefore, uint32 valueAfter, uint48 effect) {\n (valueBefore, valueAfter, effect) = self.unpack();\n return effect <= timepoint ? (valueAfter, 0, 0) : (valueBefore, valueAfter, effect);\n }\n\n /**\n * @dev Get the current value plus the pending value and effect timepoint if there is a scheduled change. If the\n * effect timepoint is 0, then the pending value should not be considered.\n */\n function getFull(Delay self) internal view returns (uint32 valueBefore, uint32 valueAfter, uint48 effect) {\n return _getFullAt(self, timestamp());\n }\n\n /**\n * @dev Get the current value.\n */\n function get(Delay self) internal view returns (uint32) {\n (uint32 delay, , ) = self.getFull();\n return delay;\n }\n\n /**\n * @dev Update a Delay object so that it takes a new duration after a timepoint that is automatically computed to\n * enforce the old delay at the moment of the update. Returns the updated Delay object and the timestamp when the\n * new delay becomes effective.\n */\n function withUpdate(\n Delay self,\n uint32 newValue,\n uint32 minSetback\n ) internal view returns (Delay updatedDelay, uint48 effect) {\n uint32 value = self.get();\n uint32 setback = uint32(Math.max(minSetback, value > newValue ? value - newValue : 0));\n effect = timestamp() + setback;\n return (pack(value, newValue, effect), effect);\n }\n\n /**\n * @dev Split a delay into its components: valueBefore, valueAfter and effect (transition timepoint).\n */\n function unpack(Delay self) internal pure returns (uint32 valueBefore, uint32 valueAfter, uint48 effect) {\n uint112 raw = Delay.unwrap(self);\n\n valueAfter = uint32(raw);\n valueBefore = uint32(raw >> 32);\n effect = uint48(raw >> 64);\n\n return (valueBefore, valueAfter, effect);\n }\n\n /**\n * @dev pack the components into a Delay object.\n */\n function pack(uint32 valueBefore, uint32 valueAfter, uint48 effect) internal pure returns (Delay) {\n return Delay.wrap((uint112(effect) << 64) | (uint112(valueBefore) << 32) | uint112(valueAfter));\n }\n}\n" + }, + "contracts/variants/crosschain/Gov.sol": { + "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity ^0.8.20;\n\nimport \"@openzeppelin/contracts/governance/Governor.sol\";\nimport \"@openzeppelin/contracts/governance/extensions/GovernorSettings.sol\";\nimport \"@openzeppelin/contracts/governance/extensions/GovernorCountingSimple.sol\";\nimport \"@openzeppelin/contracts/governance/extensions/GovernorVotes.sol\";\nimport \"@openzeppelin/contracts/governance/extensions/GovernorVotesQuorumFraction.sol\";\nimport \"./ProofHandler.sol\";\n\n/**\n * @title Cross-chain Governance Contract\n * @author Web3 Hackers Collective\n * @notice Implementation of a DAO with secure cross-chain synchronization capabilities\n * @dev Uses ProofHandler library for managing cross-chain parameter updates\n * @custom:security-contact julien@strat.cc\n */\ncontract Gov is\n Governor,\n GovernorSettings,\n GovernorCountingSimple,\n GovernorVotes,\n GovernorVotesQuorumFraction\n{\n /// @notice Chain ID where this contract was originally deployed\n uint256 public immutable home;\n\n /// @notice IPFS CID of the DAO's manifesto\n string public manifesto;\n\n /// @notice Storage for proof handling\n ProofHandler.ProofStorage private _proofStorage;\n\n /// @notice Types of operations that can be synchronized across chains\n enum OperationType {\n SET_MANIFESTO,\n UPDATE_VOTING_DELAY,\n UPDATE_VOTING_PERIOD,\n UPDATE_PROPOSAL_THRESHOLD,\n UPDATE_QUORUM\n }\n\n /// @notice Emitted when the manifesto is updated\n /// @param oldManifesto Previous manifesto CID\n /// @param newManifesto New manifesto CID\n /// @param nonce Update sequence number\n event ManifestoUpdated(string oldManifesto, string newManifesto, uint256 nonce);\n\n /// @notice Emitted when a governance parameter is updated\n /// @param operationType Type of parameter updated\n /// @param oldValue Previous value\n /// @param newValue New value\n /// @param nonce Update sequence number\n event GovernanceParameterUpdated(\n OperationType indexed operationType,\n uint256 oldValue,\n uint256 newValue,\n uint256 nonce\n );\n\n /// @notice Restricts functions to be called only on the home chain\n modifier onlyHomeChain() {\n require(block.chainid == home, \"Operation only allowed on home chain\");\n _;\n }\n\n /**\n * @notice Initializes the governance contract\n * @param _home Chain ID where this contract is considered home\n * @param _token The voting token contract address\n * @param _manifestoCid Initial manifesto CID\n * @param _name Name of the governance contract\n * @param _votingDelay Time before voting begins\n * @param _votingPeriod Duration of voting period\n * @param _proposalThreshold Minimum votes needed for proposal\n * @param _quorum Minimum participation percentage required\n */\n constructor(\n uint256 _home,\n IVotes _token,\n string memory _manifestoCid,\n string memory _name,\n uint48 _votingDelay,\n uint32 _votingPeriod,\n uint256 _proposalThreshold,\n uint256 _quorum\n )\n Governor(_name)\n GovernorSettings(_votingDelay, _votingPeriod, _proposalThreshold)\n GovernorVotes(_token)\n GovernorVotesQuorumFraction(_quorum)\n {\n home = _home;\n manifesto = _manifestoCid;\n }\n\n /**\n * @notice Updates the DAO's manifesto on the home chain\n * @param newManifesto New manifesto CID\n */\n function setManifesto(string memory newManifesto) public onlyGovernance onlyHomeChain {\n uint256 nonce = ProofHandler.incrementNonce(\n _proofStorage,\n uint8(OperationType.SET_MANIFESTO)\n );\n string memory oldManifesto = manifesto;\n manifesto = newManifesto;\n emit ManifestoUpdated(oldManifesto, newManifesto, nonce);\n }\n\n /**\n * @notice Updates the voting delay parameter on the home chain\n * @param newVotingDelay New voting delay value\n */\n function setVotingDelay(\n uint48 newVotingDelay\n ) public virtual override onlyGovernance onlyHomeChain {\n uint256 nonce = ProofHandler.incrementNonce(\n _proofStorage,\n uint8(OperationType.UPDATE_VOTING_DELAY)\n );\n uint256 oldValue = votingDelay();\n _setVotingDelay(newVotingDelay);\n emit GovernanceParameterUpdated(\n OperationType.UPDATE_VOTING_DELAY,\n oldValue,\n newVotingDelay,\n nonce\n );\n }\n\n /**\n * @notice Updates the voting period parameter on the home chain\n * @param newVotingPeriod New voting period value\n */\n function setVotingPeriod(\n uint32 newVotingPeriod\n ) public virtual override onlyGovernance onlyHomeChain {\n uint256 nonce = ProofHandler.incrementNonce(\n _proofStorage,\n uint8(OperationType.UPDATE_VOTING_PERIOD)\n );\n uint256 oldValue = votingPeriod();\n _setVotingPeriod(newVotingPeriod);\n emit GovernanceParameterUpdated(\n OperationType.UPDATE_VOTING_PERIOD,\n oldValue,\n newVotingPeriod,\n nonce\n );\n }\n\n /**\n * @notice Updates the proposal threshold parameter on the home chain\n * @param newProposalThreshold New proposal threshold value\n */\n function setProposalThreshold(\n uint256 newProposalThreshold\n ) public virtual override onlyGovernance onlyHomeChain {\n uint256 nonce = ProofHandler.incrementNonce(\n _proofStorage,\n uint8(OperationType.UPDATE_PROPOSAL_THRESHOLD)\n );\n uint256 oldValue = proposalThreshold();\n _setProposalThreshold(newProposalThreshold);\n emit GovernanceParameterUpdated(\n OperationType.UPDATE_PROPOSAL_THRESHOLD,\n oldValue,\n newProposalThreshold,\n nonce\n );\n }\n\n /**\n * @notice Updates the quorum numerator on the home chain\n * @param newQuorumNumerator New quorum numerator value\n */\n function updateQuorumNumerator(\n uint256 newQuorumNumerator\n ) public virtual override onlyGovernance onlyHomeChain {\n uint256 nonce = ProofHandler.incrementNonce(\n _proofStorage,\n uint8(OperationType.UPDATE_QUORUM)\n );\n uint256 oldValue = quorumNumerator();\n _updateQuorumNumerator(newQuorumNumerator);\n emit GovernanceParameterUpdated(\n OperationType.UPDATE_QUORUM,\n oldValue,\n newQuorumNumerator,\n nonce\n );\n }\n\n /**\n * @notice Generates proof for parameter updates\n * @param operationType Type of parameter being updated\n * @param value Encoded parameter value\n * @return proof Encoded proof data\n */\n function generateParameterProof(\n uint8 operationType,\n bytes memory value\n ) external view returns (bytes memory proof) {\n require(block.chainid == home, \"Proofs only generated on home chain\");\n uint256 nextNonce = ProofHandler.getNextNonce(_proofStorage, operationType);\n return ProofHandler.generateProof(address(this), operationType, value, nextNonce);\n }\n\n /**\n * @notice Claims a parameter update on a foreign chain\n * @param proof Proof generated by home chain\n */\n function claimParameterUpdate(bytes memory proof) external {\n (uint8 operationType, bytes memory value, uint256 nonce) = ProofHandler.verifyAndClaimProof(\n proof,\n address(this),\n _proofStorage\n );\n\n if (operationType == uint8(OperationType.SET_MANIFESTO)) {\n string memory newManifesto = abi.decode(value, (string));\n string memory oldManifesto = manifesto;\n manifesto = newManifesto;\n emit ManifestoUpdated(oldManifesto, newManifesto, nonce);\n } else if (operationType == uint8(OperationType.UPDATE_VOTING_DELAY)) {\n uint48 newValue = uint48(bytes6(value));\n uint256 oldValue = votingDelay();\n _setVotingDelay(newValue);\n emit GovernanceParameterUpdated(\n OperationType.UPDATE_VOTING_DELAY,\n oldValue,\n newValue,\n nonce\n );\n } else if (operationType == uint8(OperationType.UPDATE_VOTING_PERIOD)) {\n uint32 newValue = uint32(bytes4(value));\n uint256 oldValue = votingPeriod();\n _setVotingPeriod(newValue);\n emit GovernanceParameterUpdated(\n OperationType.UPDATE_VOTING_PERIOD,\n oldValue,\n newValue,\n nonce\n );\n } else if (operationType == uint8(OperationType.UPDATE_PROPOSAL_THRESHOLD)) {\n uint256 newValue = abi.decode(value, (uint256));\n uint256 oldValue = proposalThreshold();\n _setProposalThreshold(newValue);\n emit GovernanceParameterUpdated(\n OperationType.UPDATE_PROPOSAL_THRESHOLD,\n oldValue,\n newValue,\n nonce\n );\n } else if (operationType == uint8(OperationType.UPDATE_QUORUM)) {\n uint256 newValue = abi.decode(value, (uint256));\n uint256 oldValue = quorumNumerator();\n _updateQuorumNumerator(newValue);\n emit GovernanceParameterUpdated(OperationType.UPDATE_QUORUM, oldValue, newValue, nonce);\n }\n }\n\n // Required overrides\n\n function votingDelay() public view override(Governor, GovernorSettings) returns (uint256) {\n return super.votingDelay();\n }\n\n function votingPeriod() public view override(Governor, GovernorSettings) returns (uint256) {\n return super.votingPeriod();\n }\n\n function quorum(\n uint256 blockNumber\n ) public view override(Governor, GovernorVotesQuorumFraction) returns (uint256) {\n return super.quorum(blockNumber);\n }\n\n function proposalThreshold()\n public\n view\n override(Governor, GovernorSettings)\n returns (uint256)\n {\n return super.proposalThreshold();\n }\n}\n" + }, + "contracts/variants/crosschain/NFT.sol": { + "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity ^0.8.20;\n\nimport \"@openzeppelin/contracts/token/ERC721/ERC721.sol\";\nimport \"@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol\";\nimport \"@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol\";\nimport \"@openzeppelin/contracts/token/ERC721/extensions/ERC721Burnable.sol\";\nimport \"@openzeppelin/contracts/access/Ownable.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/EIP712.sol\";\nimport \"@openzeppelin/contracts/token/ERC721/extensions/ERC721Votes.sol\";\nimport \"./ProofHandler.sol\";\n\n/**\n * @title Cross-chain Membership NFT Contract\n * @author Web3 Hackers Collective\n * @notice Non-transferable NFT implementation for DAO membership with cross-chain capabilities\n * @dev Uses ProofHandler library for cross-chain proof management\n * @custom:security-contact julien@strat.cc\n */\ncontract NFT is\n ERC721,\n ERC721Enumerable,\n ERC721URIStorage,\n ERC721Burnable,\n Ownable,\n EIP712,\n ERC721Votes\n{\n using ProofHandler for ProofHandler.ProofStorage;\n\n /// @notice Chain ID where contract was originally deployed\n uint256 public immutable home;\n\n /// @notice Next token ID to be minted\n uint256 private _nextTokenId;\n\n /// @notice Storage for proof handling\n ProofHandler.ProofStorage private _proofStorage;\n\n /// @notice Types of operations that can be synchronized across chains\n enum OperationType {\n MINT,\n BURN,\n SET_METADATA\n }\n\n /// @notice Emitted when a membership is claimed\n /// @param tokenId The ID of the claimed token\n /// @param member The address receiving the membership\n /// @param nonce Operation sequence number\n event MembershipClaimed(uint256 indexed tokenId, address indexed member, uint256 nonce);\n\n /// @notice Emitted when a membership is revoked\n /// @param tokenId The ID of the revoked token\n /// @param member The address losing membership\n /// @param nonce Operation sequence number\n event MembershipRevoked(uint256 indexed tokenId, address indexed member, uint256 nonce);\n\n /// @notice Emitted when metadata is updated\n /// @param tokenId The ID of the updated token\n /// @param newUri The new metadata URI\n /// @param nonce Operation sequence number\n event MetadataUpdated(uint256 indexed tokenId, string newUri, uint256 nonce);\n\n /// @notice Restricts functions to home chain\n modifier onlyHomeChain() {\n require(block.chainid == home, \"Operation only allowed on home chain\");\n _;\n }\n\n /**\n * @notice Initializes the NFT contract\n * @param _home Chain ID where contract is considered home\n * @param initialOwner Initial contract owner\n * @param _firstMembers Array of initial member addresses\n * @param _uri Initial token URI\n * @param _name Token collection name\n * @param _symbol Token collection symbol\n */\n constructor(\n uint256 _home,\n address initialOwner,\n address[] memory _firstMembers,\n string memory _uri,\n string memory _name,\n string memory _symbol\n ) ERC721(_name, _symbol) Ownable(initialOwner) EIP712(_name, \"1\") {\n home = _home;\n for (uint i; i < _firstMembers.length; i++) {\n _govMint(_firstMembers[i], _uri);\n }\n }\n\n /**\n * @notice Adds a new member on home chain\n * @dev Only callable by owner (governance) on home chain\n * @param to Address to mint token to\n * @param uri Token metadata URI\n */\n function safeMint(address to, string memory uri) public onlyOwner onlyHomeChain {\n uint256 nonce = _proofStorage.incrementNonce(uint8(OperationType.MINT));\n _govMint(to, uri);\n emit MembershipClaimed(_nextTokenId - 1, to, nonce);\n }\n\n /**\n * @notice Burns token on home chain\n * @dev Only callable by owner (governance) on home chain\n * @param tokenId ID of token to burn\n */\n function govBurn(uint256 tokenId) public onlyOwner onlyHomeChain {\n uint256 nonce = _proofStorage.incrementNonce(uint8(OperationType.BURN));\n address owner = ownerOf(tokenId);\n _burn(tokenId);\n emit MembershipRevoked(tokenId, owner, nonce);\n }\n\n /**\n * @notice Updates token metadata on home chain\n * @dev Only callable by owner (governance) on home chain\n * @param tokenId ID of token to update\n * @param uri New metadata URI\n */\n function setMetadata(uint256 tokenId, string memory uri) public onlyOwner onlyHomeChain {\n uint256 nonce = _proofStorage.incrementNonce(uint8(OperationType.SET_METADATA));\n _setTokenURI(tokenId, uri);\n emit MetadataUpdated(tokenId, uri, nonce);\n }\n\n /**\n * @notice Generates proof for NFT operations\n * @param operationType Type of operation\n * @param params Operation parameters\n * @return Encoded proof data\n */\n function generateOperationProof(\n uint8 operationType,\n bytes memory params\n ) external view returns (bytes memory) {\n require(block.chainid == home, \"Proofs only generated on home chain\");\n uint256 nextNonce = _proofStorage.getNextNonce(operationType);\n return ProofHandler.generateProof(address(this), operationType, params, nextNonce);\n }\n\n /**\n * @notice Claims an NFT operation on a foreign chain\n * @param proof Proof generated by home chain\n */\n function claimOperation(bytes memory proof) external {\n (uint8 operationType, bytes memory params, uint256 nonce) = ProofHandler\n .verifyAndClaimProof(proof, address(this), _proofStorage);\n\n if (operationType == uint8(OperationType.MINT)) {\n (address to, string memory uri) = abi.decode(params, (address, string));\n _govMint(to, uri);\n emit MembershipClaimed(_nextTokenId - 1, to, nonce);\n } else if (operationType == uint8(OperationType.BURN)) {\n uint256 tokenId = abi.decode(params, (uint256));\n address owner = ownerOf(tokenId);\n _burn(tokenId);\n emit MembershipRevoked(tokenId, owner, nonce);\n } else if (operationType == uint8(OperationType.SET_METADATA)) {\n (uint256 tokenId, string memory uri) = abi.decode(params, (uint256, string));\n _setTokenURI(tokenId, uri);\n emit MetadataUpdated(tokenId, uri, nonce);\n }\n }\n\n /**\n * @notice Internal function for minting without proof verification\n * @param to Address to receive token\n * @param uri Token metadata URI\n */\n function _govMint(address to, string memory uri) internal {\n uint256 tokenId = _nextTokenId++;\n _safeMint(to, tokenId);\n _setTokenURI(tokenId, uri);\n }\n\n // Required overrides\n\n function _update(\n address to,\n uint256 tokenId,\n address auth\n ) internal override(ERC721, ERC721Enumerable, ERC721Votes) returns (address) {\n require(auth == address(0) || to == address(0), \"NFT is not transferable\");\n return super._update(to, tokenId, auth);\n }\n\n function _increaseBalance(\n address account,\n uint128 value\n ) internal override(ERC721, ERC721Enumerable, ERC721Votes) {\n super._increaseBalance(account, value);\n }\n\n function tokenURI(\n uint256 tokenId\n ) public view override(ERC721, ERC721URIStorage) returns (string memory) {\n return super.tokenURI(tokenId);\n }\n\n function supportsInterface(\n bytes4 interfaceId\n ) public view override(ERC721, ERC721Enumerable, ERC721URIStorage) returns (bool) {\n return super.supportsInterface(interfaceId);\n }\n\n function clock() public view override returns (uint48) {\n return uint48(block.timestamp);\n }\n\n function CLOCK_MODE() public pure override returns (string memory) {\n return \"mode=timestamp\";\n }\n}\n" + }, + "contracts/variants/crosschain/ProofHandler.sol": { + "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity ^0.8.20;\n\n/**\n * @title Proof Handler Library\n * @author Web3 Hackers Collective\n * @notice Library for standardized cross-chain proof generation and verification\n * @dev Handles proof generation, verification, and tracking for cross-chain operations\n * @custom:security-contact julien@strat.cc\n */\nlibrary ProofHandler {\n /// @notice Tracks which proofs have been applied on each chain\n struct ProofStorage {\n mapping(bytes32 => bool) updateAppliedOnChain;\n mapping(uint8 => uint256) currentNonce;\n }\n\n /// @dev Emitted when a proof is claimed\n event ProofClaimed(uint8 indexed operationType, bytes params, uint256 nonce);\n\n /**\n * @notice Generates a proof for cross-chain operations\n * @param contractAddress Address of contract generating the proof\n * @param operationType Type of operation being performed\n * @param params Operation parameters\n * @param nonce Current nonce for this operation type\n * @return proof Encoded proof data\n */\n function generateProof(\n address contractAddress,\n uint8 operationType,\n bytes memory params,\n uint256 nonce\n ) public pure returns (bytes memory proof) {\n bytes32 message = keccak256(\n abi.encodePacked(contractAddress, operationType, params, nonce)\n );\n bytes32 digest = keccak256(abi.encodePacked(\"\\x19Ethereum Signed Message:\\n32\", message));\n\n return abi.encode(operationType, params, nonce, digest);\n }\n\n /**\n * @notice Verifies and claims a proof\n * @param proof Proof to verify and claim\n * @param contractAddress Address of contract claiming the proof\n * @param storage_ Proof storage struct\n * @return operationType The type of operation being performed\n * @return params The operation parameters\n * @return nonce The operation sequence number\n */\n function verifyAndClaimProof(\n bytes memory proof,\n address contractAddress,\n ProofStorage storage storage_\n ) public returns (uint8 operationType, bytes memory params, uint256 nonce) {\n bytes32 digest;\n (operationType, params, nonce, digest) = abi.decode(\n proof,\n (uint8, bytes, uint256, bytes32)\n );\n\n bytes32 proofHash = keccak256(proof);\n require(!storage_.updateAppliedOnChain[proofHash], \"Proof already claimed\");\n require(nonce == storage_.currentNonce[operationType] + 1, \"Invalid nonce\");\n\n bytes32 message = keccak256(\n abi.encodePacked(contractAddress, operationType, params, nonce)\n );\n bytes32 expectedDigest = keccak256(\n abi.encodePacked(\"\\x19Ethereum Signed Message:\\n32\", message)\n );\n require(digest == expectedDigest, \"Invalid proof\");\n\n storage_.updateAppliedOnChain[proofHash] = true;\n storage_.currentNonce[operationType] = nonce;\n\n emit ProofClaimed(operationType, params, nonce);\n\n return (operationType, params, nonce);\n }\n\n /**\n * @notice Gets the next nonce for an operation type\n * @param storage_ Proof storage struct\n * @param operationType Type of operation\n * @return nonce Next nonce value\n */\n function getNextNonce(\n ProofStorage storage storage_,\n uint8 operationType\n ) public view returns (uint256 nonce) {\n return storage_.currentNonce[operationType] + 1;\n }\n\n /**\n * @notice Increments the nonce for an operation type\n * @param storage_ Proof storage struct\n * @param operationType Type of operation\n * @return nonce New nonce value\n */\n function incrementNonce(\n ProofStorage storage storage_,\n uint8 operationType\n ) public returns (uint256 nonce) {\n storage_.currentNonce[operationType]++;\n return storage_.currentNonce[operationType];\n }\n}\n" + } + }, + "settings": { + "optimizer": { + "enabled": true, + "runs": 200 + }, + "evmVersion": "paris", + "outputSelection": { + "*": { + "*": [ + "abi", + "evm.bytecode", + "evm.deployedBytecode", + "evm.methodIdentifiers", + "metadata", + "devdoc", + "userdoc", + "storageLayout", + "evm.gasEstimates" + ], + "": [ + "ast" + ] + } + }, + "metadata": { + "useLiteralContent": true + } + } +} \ No newline at end of file diff --git a/deployments/opSepolia/solcInputs/c27a34cff02617821c386fb97b476bc1.json b/deployments/opSepolia/solcInputs/c27a34cff02617821c386fb97b476bc1.json new file mode 100644 index 0000000..f692b04 --- /dev/null +++ b/deployments/opSepolia/solcInputs/c27a34cff02617821c386fb97b476bc1.json @@ -0,0 +1,147 @@ +{ + "language": "Solidity", + "sources": { + "@openzeppelin/contracts/access/Ownable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol)\n\npragma solidity ^0.8.20;\n\nimport {Context} from \"../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 * The initial owner is set to the address provided by the deployer. This can\n * 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 /**\n * @dev The caller account is not authorized to perform an operation.\n */\n error OwnableUnauthorizedAccount(address account);\n\n /**\n * @dev The owner is not a valid owner account. (eg. `address(0)`)\n */\n error OwnableInvalidOwner(address owner);\n\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n /**\n * @dev Initializes the contract setting the address provided by the deployer as the initial owner.\n */\n constructor(address initialOwner) {\n if (initialOwner == address(0)) {\n revert OwnableInvalidOwner(address(0));\n }\n _transferOwnership(initialOwner);\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 if (owner() != _msgSender()) {\n revert OwnableUnauthorizedAccount(_msgSender());\n }\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 if (newOwner == address(0)) {\n revert OwnableInvalidOwner(address(0));\n }\n _transferOwnership(newOwner);\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Internal function without access restriction.\n */\n function _transferOwnership(address newOwner) internal virtual {\n address oldOwner = _owner;\n _owner = newOwner;\n emit OwnershipTransferred(oldOwner, newOwner);\n }\n}\n" + }, + "@openzeppelin/contracts/governance/utils/IVotes.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (governance/utils/IVotes.sol)\npragma solidity ^0.8.20;\n\n/**\n * @dev Common interface for {ERC20Votes}, {ERC721Votes}, and other {Votes}-enabled contracts.\n */\ninterface IVotes {\n /**\n * @dev The signature used has expired.\n */\n error VotesExpiredSignature(uint256 expiry);\n\n /**\n * @dev Emitted when an account changes their delegate.\n */\n event DelegateChanged(address indexed delegator, address indexed fromDelegate, address indexed toDelegate);\n\n /**\n * @dev Emitted when a token transfer or delegate change results in changes to a delegate's number of voting units.\n */\n event DelegateVotesChanged(address indexed delegate, uint256 previousVotes, uint256 newVotes);\n\n /**\n * @dev Returns the current amount of votes that `account` has.\n */\n function getVotes(address account) external view returns (uint256);\n\n /**\n * @dev Returns the amount of votes that `account` had at a specific moment in the past. If the `clock()` is\n * configured to use block numbers, this will return the value at the end of the corresponding block.\n */\n function getPastVotes(address account, uint256 timepoint) external view returns (uint256);\n\n /**\n * @dev Returns the total supply of votes available at a specific moment in the past. If the `clock()` is\n * configured to use block numbers, this will return the value at the end of the corresponding block.\n *\n * NOTE: This value is the sum of all available votes, which is not necessarily the sum of all delegated votes.\n * Votes that have not been delegated are still part of total supply, even though they would not participate in a\n * vote.\n */\n function getPastTotalSupply(uint256 timepoint) external view returns (uint256);\n\n /**\n * @dev Returns the delegate that `account` has chosen.\n */\n function delegates(address account) external view returns (address);\n\n /**\n * @dev Delegates votes from the sender to `delegatee`.\n */\n function delegate(address delegatee) external;\n\n /**\n * @dev Delegates votes from signer to `delegatee`.\n */\n function delegateBySig(address delegatee, uint256 nonce, uint256 expiry, uint8 v, bytes32 r, bytes32 s) external;\n}\n" + }, + "@openzeppelin/contracts/governance/utils/Votes.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (governance/utils/Votes.sol)\npragma solidity ^0.8.20;\n\nimport {IERC5805} from \"../../interfaces/IERC5805.sol\";\nimport {Context} from \"../../utils/Context.sol\";\nimport {Nonces} from \"../../utils/Nonces.sol\";\nimport {EIP712} from \"../../utils/cryptography/EIP712.sol\";\nimport {Checkpoints} from \"../../utils/structs/Checkpoints.sol\";\nimport {SafeCast} from \"../../utils/math/SafeCast.sol\";\nimport {ECDSA} from \"../../utils/cryptography/ECDSA.sol\";\nimport {Time} from \"../../utils/types/Time.sol\";\n\n/**\n * @dev This is a base abstract contract that tracks voting units, which are a measure of voting power that can be\n * transferred, and provides a system of vote delegation, where an account can delegate its voting units to a sort of\n * \"representative\" that will pool delegated voting units from different accounts and can then use it to vote in\n * decisions. In fact, voting units _must_ be delegated in order to count as actual votes, and an account has to\n * delegate those votes to itself if it wishes to participate in decisions and does not have a trusted representative.\n *\n * This contract is often combined with a token contract such that voting units correspond to token units. For an\n * example, see {ERC721Votes}.\n *\n * The full history of delegate votes is tracked on-chain so that governance protocols can consider votes as distributed\n * at a particular block number to protect against flash loans and double voting. The opt-in delegate system makes the\n * cost of this history tracking optional.\n *\n * When using this module the derived contract must implement {_getVotingUnits} (for example, make it return\n * {ERC721-balanceOf}), and can use {_transferVotingUnits} to track a change in the distribution of those units (in the\n * previous example, it would be included in {ERC721-_update}).\n */\nabstract contract Votes is Context, EIP712, Nonces, IERC5805 {\n using Checkpoints for Checkpoints.Trace208;\n\n bytes32 private constant DELEGATION_TYPEHASH =\n keccak256(\"Delegation(address delegatee,uint256 nonce,uint256 expiry)\");\n\n mapping(address account => address) private _delegatee;\n\n mapping(address delegatee => Checkpoints.Trace208) private _delegateCheckpoints;\n\n Checkpoints.Trace208 private _totalCheckpoints;\n\n /**\n * @dev The clock was incorrectly modified.\n */\n error ERC6372InconsistentClock();\n\n /**\n * @dev Lookup to future votes is not available.\n */\n error ERC5805FutureLookup(uint256 timepoint, uint48 clock);\n\n /**\n * @dev Clock used for flagging checkpoints. Can be overridden to implement timestamp based\n * checkpoints (and voting), in which case {CLOCK_MODE} should be overridden as well to match.\n */\n function clock() public view virtual returns (uint48) {\n return Time.blockNumber();\n }\n\n /**\n * @dev Machine-readable description of the clock as specified in ERC-6372.\n */\n // solhint-disable-next-line func-name-mixedcase\n function CLOCK_MODE() public view virtual returns (string memory) {\n // Check that the clock was not modified\n if (clock() != Time.blockNumber()) {\n revert ERC6372InconsistentClock();\n }\n return \"mode=blocknumber&from=default\";\n }\n\n /**\n * @dev Returns the current amount of votes that `account` has.\n */\n function getVotes(address account) public view virtual returns (uint256) {\n return _delegateCheckpoints[account].latest();\n }\n\n /**\n * @dev Returns the amount of votes that `account` had at a specific moment in the past. If the `clock()` is\n * configured to use block numbers, this will return the value at the end of the corresponding block.\n *\n * Requirements:\n *\n * - `timepoint` must be in the past. If operating using block numbers, the block must be already mined.\n */\n function getPastVotes(address account, uint256 timepoint) public view virtual returns (uint256) {\n uint48 currentTimepoint = clock();\n if (timepoint >= currentTimepoint) {\n revert ERC5805FutureLookup(timepoint, currentTimepoint);\n }\n return _delegateCheckpoints[account].upperLookupRecent(SafeCast.toUint48(timepoint));\n }\n\n /**\n * @dev Returns the total supply of votes available at a specific moment in the past. If the `clock()` is\n * configured to use block numbers, this will return the value at the end of the corresponding block.\n *\n * NOTE: This value is the sum of all available votes, which is not necessarily the sum of all delegated votes.\n * Votes that have not been delegated are still part of total supply, even though they would not participate in a\n * vote.\n *\n * Requirements:\n *\n * - `timepoint` must be in the past. If operating using block numbers, the block must be already mined.\n */\n function getPastTotalSupply(uint256 timepoint) public view virtual returns (uint256) {\n uint48 currentTimepoint = clock();\n if (timepoint >= currentTimepoint) {\n revert ERC5805FutureLookup(timepoint, currentTimepoint);\n }\n return _totalCheckpoints.upperLookupRecent(SafeCast.toUint48(timepoint));\n }\n\n /**\n * @dev Returns the current total supply of votes.\n */\n function _getTotalSupply() internal view virtual returns (uint256) {\n return _totalCheckpoints.latest();\n }\n\n /**\n * @dev Returns the delegate that `account` has chosen.\n */\n function delegates(address account) public view virtual returns (address) {\n return _delegatee[account];\n }\n\n /**\n * @dev Delegates votes from the sender to `delegatee`.\n */\n function delegate(address delegatee) public virtual {\n address account = _msgSender();\n _delegate(account, delegatee);\n }\n\n /**\n * @dev Delegates votes from signer to `delegatee`.\n */\n function delegateBySig(\n address delegatee,\n uint256 nonce,\n uint256 expiry,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) public virtual {\n if (block.timestamp > expiry) {\n revert VotesExpiredSignature(expiry);\n }\n address signer = ECDSA.recover(\n _hashTypedDataV4(keccak256(abi.encode(DELEGATION_TYPEHASH, delegatee, nonce, expiry))),\n v,\n r,\n s\n );\n _useCheckedNonce(signer, nonce);\n _delegate(signer, delegatee);\n }\n\n /**\n * @dev Delegate all of `account`'s voting units to `delegatee`.\n *\n * Emits events {IVotes-DelegateChanged} and {IVotes-DelegateVotesChanged}.\n */\n function _delegate(address account, address delegatee) internal virtual {\n address oldDelegate = delegates(account);\n _delegatee[account] = delegatee;\n\n emit DelegateChanged(account, oldDelegate, delegatee);\n _moveDelegateVotes(oldDelegate, delegatee, _getVotingUnits(account));\n }\n\n /**\n * @dev Transfers, mints, or burns voting units. To register a mint, `from` should be zero. To register a burn, `to`\n * should be zero. Total supply of voting units will be adjusted with mints and burns.\n */\n function _transferVotingUnits(address from, address to, uint256 amount) internal virtual {\n if (from == address(0)) {\n _push(_totalCheckpoints, _add, SafeCast.toUint208(amount));\n }\n if (to == address(0)) {\n _push(_totalCheckpoints, _subtract, SafeCast.toUint208(amount));\n }\n _moveDelegateVotes(delegates(from), delegates(to), amount);\n }\n\n /**\n * @dev Moves delegated votes from one delegate to another.\n */\n function _moveDelegateVotes(address from, address to, uint256 amount) internal virtual {\n if (from != to && amount > 0) {\n if (from != address(0)) {\n (uint256 oldValue, uint256 newValue) = _push(\n _delegateCheckpoints[from],\n _subtract,\n SafeCast.toUint208(amount)\n );\n emit DelegateVotesChanged(from, oldValue, newValue);\n }\n if (to != address(0)) {\n (uint256 oldValue, uint256 newValue) = _push(\n _delegateCheckpoints[to],\n _add,\n SafeCast.toUint208(amount)\n );\n emit DelegateVotesChanged(to, oldValue, newValue);\n }\n }\n }\n\n /**\n * @dev Get number of checkpoints for `account`.\n */\n function _numCheckpoints(address account) internal view virtual returns (uint32) {\n return SafeCast.toUint32(_delegateCheckpoints[account].length());\n }\n\n /**\n * @dev Get the `pos`-th checkpoint for `account`.\n */\n function _checkpoints(\n address account,\n uint32 pos\n ) internal view virtual returns (Checkpoints.Checkpoint208 memory) {\n return _delegateCheckpoints[account].at(pos);\n }\n\n function _push(\n Checkpoints.Trace208 storage store,\n function(uint208, uint208) view returns (uint208) op,\n uint208 delta\n ) private returns (uint208 oldValue, uint208 newValue) {\n return store.push(clock(), op(store.latest(), delta));\n }\n\n function _add(uint208 a, uint208 b) private pure returns (uint208) {\n return a + b;\n }\n\n function _subtract(uint208 a, uint208 b) private pure returns (uint208) {\n return a - b;\n }\n\n /**\n * @dev Must return the voting units held by an account.\n */\n function _getVotingUnits(address) internal view virtual returns (uint256);\n}\n" + }, + "@openzeppelin/contracts/interfaces/draft-IERC6093.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (interfaces/draft-IERC6093.sol)\npragma solidity ^0.8.20;\n\n/**\n * @dev Standard ERC-20 Errors\n * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC-20 tokens.\n */\ninterface IERC20Errors {\n /**\n * @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers.\n * @param sender Address whose tokens are being transferred.\n * @param balance Current balance for the interacting account.\n * @param needed Minimum amount required to perform a transfer.\n */\n error ERC20InsufficientBalance(address sender, uint256 balance, uint256 needed);\n\n /**\n * @dev Indicates a failure with the token `sender`. Used in transfers.\n * @param sender Address whose tokens are being transferred.\n */\n error ERC20InvalidSender(address sender);\n\n /**\n * @dev Indicates a failure with the token `receiver`. Used in transfers.\n * @param receiver Address to which tokens are being transferred.\n */\n error ERC20InvalidReceiver(address receiver);\n\n /**\n * @dev Indicates a failure with the `spender`’s `allowance`. Used in transfers.\n * @param spender Address that may be allowed to operate on tokens without being their owner.\n * @param allowance Amount of tokens a `spender` is allowed to operate with.\n * @param needed Minimum amount required to perform a transfer.\n */\n error ERC20InsufficientAllowance(address spender, uint256 allowance, uint256 needed);\n\n /**\n * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.\n * @param approver Address initiating an approval operation.\n */\n error ERC20InvalidApprover(address approver);\n\n /**\n * @dev Indicates a failure with the `spender` to be approved. Used in approvals.\n * @param spender Address that may be allowed to operate on tokens without being their owner.\n */\n error ERC20InvalidSpender(address spender);\n}\n\n/**\n * @dev Standard ERC-721 Errors\n * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC-721 tokens.\n */\ninterface IERC721Errors {\n /**\n * @dev Indicates that an address can't be an owner. For example, `address(0)` is a forbidden owner in ERC-20.\n * Used in balance queries.\n * @param owner Address of the current owner of a token.\n */\n error ERC721InvalidOwner(address owner);\n\n /**\n * @dev Indicates a `tokenId` whose `owner` is the zero address.\n * @param tokenId Identifier number of a token.\n */\n error ERC721NonexistentToken(uint256 tokenId);\n\n /**\n * @dev Indicates an error related to the ownership over a particular token. Used in transfers.\n * @param sender Address whose tokens are being transferred.\n * @param tokenId Identifier number of a token.\n * @param owner Address of the current owner of a token.\n */\n error ERC721IncorrectOwner(address sender, uint256 tokenId, address owner);\n\n /**\n * @dev Indicates a failure with the token `sender`. Used in transfers.\n * @param sender Address whose tokens are being transferred.\n */\n error ERC721InvalidSender(address sender);\n\n /**\n * @dev Indicates a failure with the token `receiver`. Used in transfers.\n * @param receiver Address to which tokens are being transferred.\n */\n error ERC721InvalidReceiver(address receiver);\n\n /**\n * @dev Indicates a failure with the `operator`’s approval. Used in transfers.\n * @param operator Address that may be allowed to operate on tokens without being their owner.\n * @param tokenId Identifier number of a token.\n */\n error ERC721InsufficientApproval(address operator, uint256 tokenId);\n\n /**\n * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.\n * @param approver Address initiating an approval operation.\n */\n error ERC721InvalidApprover(address approver);\n\n /**\n * @dev Indicates a failure with the `operator` to be approved. Used in approvals.\n * @param operator Address that may be allowed to operate on tokens without being their owner.\n */\n error ERC721InvalidOperator(address operator);\n}\n\n/**\n * @dev Standard ERC-1155 Errors\n * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC-1155 tokens.\n */\ninterface IERC1155Errors {\n /**\n * @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers.\n * @param sender Address whose tokens are being transferred.\n * @param balance Current balance for the interacting account.\n * @param needed Minimum amount required to perform a transfer.\n * @param tokenId Identifier number of a token.\n */\n error ERC1155InsufficientBalance(address sender, uint256 balance, uint256 needed, uint256 tokenId);\n\n /**\n * @dev Indicates a failure with the token `sender`. Used in transfers.\n * @param sender Address whose tokens are being transferred.\n */\n error ERC1155InvalidSender(address sender);\n\n /**\n * @dev Indicates a failure with the token `receiver`. Used in transfers.\n * @param receiver Address to which tokens are being transferred.\n */\n error ERC1155InvalidReceiver(address receiver);\n\n /**\n * @dev Indicates a failure with the `operator`’s approval. Used in transfers.\n * @param operator Address that may be allowed to operate on tokens without being their owner.\n * @param owner Address of the current owner of a token.\n */\n error ERC1155MissingApprovalForAll(address operator, address owner);\n\n /**\n * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.\n * @param approver Address initiating an approval operation.\n */\n error ERC1155InvalidApprover(address approver);\n\n /**\n * @dev Indicates a failure with the `operator` to be approved. Used in approvals.\n * @param operator Address that may be allowed to operate on tokens without being their owner.\n */\n error ERC1155InvalidOperator(address operator);\n\n /**\n * @dev Indicates an array length mismatch between ids and values in a safeBatchTransferFrom operation.\n * Used in batch transfers.\n * @param idsLength Length of the array of token identifiers\n * @param valuesLength Length of the array of token amounts\n */\n error ERC1155InvalidArrayLength(uint256 idsLength, uint256 valuesLength);\n}\n" + }, + "@openzeppelin/contracts/interfaces/IERC165.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC165.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC165} from \"../utils/introspection/IERC165.sol\";\n" + }, + "@openzeppelin/contracts/interfaces/IERC4906.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (interfaces/IERC4906.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC165} from \"./IERC165.sol\";\nimport {IERC721} from \"./IERC721.sol\";\n\n/// @title ERC-721 Metadata Update Extension\ninterface IERC4906 is IERC165, IERC721 {\n /// @dev This event emits when the metadata of a token is changed.\n /// So that the third-party platforms such as NFT market could\n /// timely update the images and related attributes of the NFT.\n event MetadataUpdate(uint256 _tokenId);\n\n /// @dev This event emits when the metadata of a range of tokens is changed.\n /// So that the third-party platforms such as NFT market could\n /// timely update the images and related attributes of the NFTs.\n event BatchMetadataUpdate(uint256 _fromTokenId, uint256 _toTokenId);\n}\n" + }, + "@openzeppelin/contracts/interfaces/IERC5267.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC5267.sol)\n\npragma solidity ^0.8.20;\n\ninterface IERC5267 {\n /**\n * @dev MAY be emitted to signal that the domain could have changed.\n */\n event EIP712DomainChanged();\n\n /**\n * @dev returns the fields and values that describe the domain separator used by this contract for EIP-712\n * signature.\n */\n function eip712Domain()\n external\n view\n returns (\n bytes1 fields,\n string memory name,\n string memory version,\n uint256 chainId,\n address verifyingContract,\n bytes32 salt,\n uint256[] memory extensions\n );\n}\n" + }, + "@openzeppelin/contracts/interfaces/IERC5805.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC5805.sol)\n\npragma solidity ^0.8.20;\n\nimport {IVotes} from \"../governance/utils/IVotes.sol\";\nimport {IERC6372} from \"./IERC6372.sol\";\n\ninterface IERC5805 is IERC6372, IVotes {}\n" + }, + "@openzeppelin/contracts/interfaces/IERC6372.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC6372.sol)\n\npragma solidity ^0.8.20;\n\ninterface IERC6372 {\n /**\n * @dev Clock used for flagging checkpoints. Can be overridden to implement timestamp based checkpoints (and voting).\n */\n function clock() external view returns (uint48);\n\n /**\n * @dev Description of the clock\n */\n // solhint-disable-next-line func-name-mixedcase\n function CLOCK_MODE() external view returns (string memory);\n}\n" + }, + "@openzeppelin/contracts/interfaces/IERC721.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC721.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC721} from \"../token/ERC721/IERC721.sol\";\n" + }, + "@openzeppelin/contracts/token/ERC721/ERC721.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC721/ERC721.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC721} from \"./IERC721.sol\";\nimport {IERC721Metadata} from \"./extensions/IERC721Metadata.sol\";\nimport {ERC721Utils} from \"./utils/ERC721Utils.sol\";\nimport {Context} from \"../../utils/Context.sol\";\nimport {Strings} from \"../../utils/Strings.sol\";\nimport {IERC165, ERC165} from \"../../utils/introspection/ERC165.sol\";\nimport {IERC721Errors} from \"../../interfaces/draft-IERC6093.sol\";\n\n/**\n * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC-721] Non-Fungible Token Standard, including\n * the Metadata extension, but not including the Enumerable extension, which is available separately as\n * {ERC721Enumerable}.\n */\nabstract contract ERC721 is Context, ERC165, IERC721, IERC721Metadata, IERC721Errors {\n using Strings for uint256;\n\n // Token name\n string private _name;\n\n // Token symbol\n string private _symbol;\n\n mapping(uint256 tokenId => address) private _owners;\n\n mapping(address owner => uint256) private _balances;\n\n mapping(uint256 tokenId => address) private _tokenApprovals;\n\n mapping(address owner => mapping(address operator => bool)) private _operatorApprovals;\n\n /**\n * @dev Initializes the contract by setting a `name` and a `symbol` to the token collection.\n */\n constructor(string memory name_, string memory symbol_) {\n _name = name_;\n _symbol = symbol_;\n }\n\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {\n return\n interfaceId == type(IERC721).interfaceId ||\n interfaceId == type(IERC721Metadata).interfaceId ||\n super.supportsInterface(interfaceId);\n }\n\n /**\n * @dev See {IERC721-balanceOf}.\n */\n function balanceOf(address owner) public view virtual returns (uint256) {\n if (owner == address(0)) {\n revert ERC721InvalidOwner(address(0));\n }\n return _balances[owner];\n }\n\n /**\n * @dev See {IERC721-ownerOf}.\n */\n function ownerOf(uint256 tokenId) public view virtual returns (address) {\n return _requireOwned(tokenId);\n }\n\n /**\n * @dev See {IERC721Metadata-name}.\n */\n function name() public view virtual returns (string memory) {\n return _name;\n }\n\n /**\n * @dev See {IERC721Metadata-symbol}.\n */\n function symbol() public view virtual returns (string memory) {\n return _symbol;\n }\n\n /**\n * @dev See {IERC721Metadata-tokenURI}.\n */\n function tokenURI(uint256 tokenId) public view virtual returns (string memory) {\n _requireOwned(tokenId);\n\n string memory baseURI = _baseURI();\n return bytes(baseURI).length > 0 ? string.concat(baseURI, tokenId.toString()) : \"\";\n }\n\n /**\n * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each\n * token will be the concatenation of the `baseURI` and the `tokenId`. Empty\n * by default, can be overridden in child contracts.\n */\n function _baseURI() internal view virtual returns (string memory) {\n return \"\";\n }\n\n /**\n * @dev See {IERC721-approve}.\n */\n function approve(address to, uint256 tokenId) public virtual {\n _approve(to, tokenId, _msgSender());\n }\n\n /**\n * @dev See {IERC721-getApproved}.\n */\n function getApproved(uint256 tokenId) public view virtual returns (address) {\n _requireOwned(tokenId);\n\n return _getApproved(tokenId);\n }\n\n /**\n * @dev See {IERC721-setApprovalForAll}.\n */\n function setApprovalForAll(address operator, bool approved) public virtual {\n _setApprovalForAll(_msgSender(), operator, approved);\n }\n\n /**\n * @dev See {IERC721-isApprovedForAll}.\n */\n function isApprovedForAll(address owner, address operator) public view virtual returns (bool) {\n return _operatorApprovals[owner][operator];\n }\n\n /**\n * @dev See {IERC721-transferFrom}.\n */\n function transferFrom(address from, address to, uint256 tokenId) public virtual {\n if (to == address(0)) {\n revert ERC721InvalidReceiver(address(0));\n }\n // Setting an \"auth\" arguments enables the `_isAuthorized` check which verifies that the token exists\n // (from != 0). Therefore, it is not needed to verify that the return value is not 0 here.\n address previousOwner = _update(to, tokenId, _msgSender());\n if (previousOwner != from) {\n revert ERC721IncorrectOwner(from, tokenId, previousOwner);\n }\n }\n\n /**\n * @dev See {IERC721-safeTransferFrom}.\n */\n function safeTransferFrom(address from, address to, uint256 tokenId) public {\n safeTransferFrom(from, to, tokenId, \"\");\n }\n\n /**\n * @dev See {IERC721-safeTransferFrom}.\n */\n function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory data) public virtual {\n transferFrom(from, to, tokenId);\n ERC721Utils.checkOnERC721Received(_msgSender(), from, to, tokenId, data);\n }\n\n /**\n * @dev Returns the owner of the `tokenId`. Does NOT revert if token doesn't exist\n *\n * IMPORTANT: Any overrides to this function that add ownership of tokens not tracked by the\n * core ERC-721 logic MUST be matched with the use of {_increaseBalance} to keep balances\n * consistent with ownership. The invariant to preserve is that for any address `a` the value returned by\n * `balanceOf(a)` must be equal to the number of tokens such that `_ownerOf(tokenId)` is `a`.\n */\n function _ownerOf(uint256 tokenId) internal view virtual returns (address) {\n return _owners[tokenId];\n }\n\n /**\n * @dev Returns the approved address for `tokenId`. Returns 0 if `tokenId` is not minted.\n */\n function _getApproved(uint256 tokenId) internal view virtual returns (address) {\n return _tokenApprovals[tokenId];\n }\n\n /**\n * @dev Returns whether `spender` is allowed to manage `owner`'s tokens, or `tokenId` in\n * particular (ignoring whether it is owned by `owner`).\n *\n * WARNING: This function assumes that `owner` is the actual owner of `tokenId` and does not verify this\n * assumption.\n */\n function _isAuthorized(address owner, address spender, uint256 tokenId) internal view virtual returns (bool) {\n return\n spender != address(0) &&\n (owner == spender || isApprovedForAll(owner, spender) || _getApproved(tokenId) == spender);\n }\n\n /**\n * @dev Checks if `spender` can operate on `tokenId`, assuming the provided `owner` is the actual owner.\n * Reverts if:\n * - `spender` does not have approval from `owner` for `tokenId`.\n * - `spender` does not have approval to manage all of `owner`'s assets.\n *\n * WARNING: This function assumes that `owner` is the actual owner of `tokenId` and does not verify this\n * assumption.\n */\n function _checkAuthorized(address owner, address spender, uint256 tokenId) internal view virtual {\n if (!_isAuthorized(owner, spender, tokenId)) {\n if (owner == address(0)) {\n revert ERC721NonexistentToken(tokenId);\n } else {\n revert ERC721InsufficientApproval(spender, tokenId);\n }\n }\n }\n\n /**\n * @dev Unsafe write access to the balances, used by extensions that \"mint\" tokens using an {ownerOf} override.\n *\n * NOTE: the value is limited to type(uint128).max. This protect against _balance overflow. It is unrealistic that\n * a uint256 would ever overflow from increments when these increments are bounded to uint128 values.\n *\n * WARNING: Increasing an account's balance using this function tends to be paired with an override of the\n * {_ownerOf} function to resolve the ownership of the corresponding tokens so that balances and ownership\n * remain consistent with one another.\n */\n function _increaseBalance(address account, uint128 value) internal virtual {\n unchecked {\n _balances[account] += value;\n }\n }\n\n /**\n * @dev Transfers `tokenId` from its current owner to `to`, or alternatively mints (or burns) if the current owner\n * (or `to`) is the zero address. Returns the owner of the `tokenId` before the update.\n *\n * The `auth` argument is optional. If the value passed is non 0, then this function will check that\n * `auth` is either the owner of the token, or approved to operate on the token (by the owner).\n *\n * Emits a {Transfer} event.\n *\n * NOTE: If overriding this function in a way that tracks balances, see also {_increaseBalance}.\n */\n function _update(address to, uint256 tokenId, address auth) internal virtual returns (address) {\n address from = _ownerOf(tokenId);\n\n // Perform (optional) operator check\n if (auth != address(0)) {\n _checkAuthorized(from, auth, tokenId);\n }\n\n // Execute the update\n if (from != address(0)) {\n // Clear approval. No need to re-authorize or emit the Approval event\n _approve(address(0), tokenId, address(0), false);\n\n unchecked {\n _balances[from] -= 1;\n }\n }\n\n if (to != address(0)) {\n unchecked {\n _balances[to] += 1;\n }\n }\n\n _owners[tokenId] = to;\n\n emit Transfer(from, to, tokenId);\n\n return from;\n }\n\n /**\n * @dev Mints `tokenId` and transfers it to `to`.\n *\n * WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible\n *\n * Requirements:\n *\n * - `tokenId` must not exist.\n * - `to` cannot be the zero address.\n *\n * Emits a {Transfer} event.\n */\n function _mint(address to, uint256 tokenId) internal {\n if (to == address(0)) {\n revert ERC721InvalidReceiver(address(0));\n }\n address previousOwner = _update(to, tokenId, address(0));\n if (previousOwner != address(0)) {\n revert ERC721InvalidSender(address(0));\n }\n }\n\n /**\n * @dev Mints `tokenId`, transfers it to `to` and checks for `to` acceptance.\n *\n * Requirements:\n *\n * - `tokenId` must not exist.\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\n *\n * Emits a {Transfer} event.\n */\n function _safeMint(address to, uint256 tokenId) internal {\n _safeMint(to, tokenId, \"\");\n }\n\n /**\n * @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is\n * forwarded in {IERC721Receiver-onERC721Received} to contract recipients.\n */\n function _safeMint(address to, uint256 tokenId, bytes memory data) internal virtual {\n _mint(to, tokenId);\n ERC721Utils.checkOnERC721Received(_msgSender(), address(0), to, tokenId, data);\n }\n\n /**\n * @dev Destroys `tokenId`.\n * The approval is cleared when the token is burned.\n * This is an internal function that does not check if the sender is authorized to operate on the token.\n *\n * Requirements:\n *\n * - `tokenId` must exist.\n *\n * Emits a {Transfer} event.\n */\n function _burn(uint256 tokenId) internal {\n address previousOwner = _update(address(0), tokenId, address(0));\n if (previousOwner == address(0)) {\n revert ERC721NonexistentToken(tokenId);\n }\n }\n\n /**\n * @dev Transfers `tokenId` from `from` to `to`.\n * As opposed to {transferFrom}, this imposes no restrictions on msg.sender.\n *\n * Requirements:\n *\n * - `to` cannot be the zero address.\n * - `tokenId` token must be owned by `from`.\n *\n * Emits a {Transfer} event.\n */\n function _transfer(address from, address to, uint256 tokenId) internal {\n if (to == address(0)) {\n revert ERC721InvalidReceiver(address(0));\n }\n address previousOwner = _update(to, tokenId, address(0));\n if (previousOwner == address(0)) {\n revert ERC721NonexistentToken(tokenId);\n } else if (previousOwner != from) {\n revert ERC721IncorrectOwner(from, tokenId, previousOwner);\n }\n }\n\n /**\n * @dev Safely transfers `tokenId` token from `from` to `to`, checking that contract recipients\n * are aware of the ERC-721 standard to prevent tokens from being forever locked.\n *\n * `data` is additional data, it has no specified format and it is sent in call to `to`.\n *\n * This internal function is like {safeTransferFrom} in the sense that it invokes\n * {IERC721Receiver-onERC721Received} on the receiver, and can be used to e.g.\n * implement alternative mechanisms to perform token transfer, such as signature-based.\n *\n * Requirements:\n *\n * - `tokenId` token must exist and be owned by `from`.\n * - `to` cannot be the zero address.\n * - `from` cannot be the zero address.\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\n *\n * Emits a {Transfer} event.\n */\n function _safeTransfer(address from, address to, uint256 tokenId) internal {\n _safeTransfer(from, to, tokenId, \"\");\n }\n\n /**\n * @dev Same as {xref-ERC721-_safeTransfer-address-address-uint256-}[`_safeTransfer`], with an additional `data` parameter which is\n * forwarded in {IERC721Receiver-onERC721Received} to contract recipients.\n */\n function _safeTransfer(address from, address to, uint256 tokenId, bytes memory data) internal virtual {\n _transfer(from, to, tokenId);\n ERC721Utils.checkOnERC721Received(_msgSender(), from, to, tokenId, data);\n }\n\n /**\n * @dev Approve `to` to operate on `tokenId`\n *\n * The `auth` argument is optional. If the value passed is non 0, then this function will check that `auth` is\n * either the owner of the token, or approved to operate on all tokens held by this owner.\n *\n * Emits an {Approval} event.\n *\n * Overrides to this logic should be done to the variant with an additional `bool emitEvent` argument.\n */\n function _approve(address to, uint256 tokenId, address auth) internal {\n _approve(to, tokenId, auth, true);\n }\n\n /**\n * @dev Variant of `_approve` with an optional flag to enable or disable the {Approval} event. The event is not\n * emitted in the context of transfers.\n */\n function _approve(address to, uint256 tokenId, address auth, bool emitEvent) internal virtual {\n // Avoid reading the owner unless necessary\n if (emitEvent || auth != address(0)) {\n address owner = _requireOwned(tokenId);\n\n // We do not use _isAuthorized because single-token approvals should not be able to call approve\n if (auth != address(0) && owner != auth && !isApprovedForAll(owner, auth)) {\n revert ERC721InvalidApprover(auth);\n }\n\n if (emitEvent) {\n emit Approval(owner, to, tokenId);\n }\n }\n\n _tokenApprovals[tokenId] = to;\n }\n\n /**\n * @dev Approve `operator` to operate on all of `owner` tokens\n *\n * Requirements:\n * - operator can't be the address zero.\n *\n * Emits an {ApprovalForAll} event.\n */\n function _setApprovalForAll(address owner, address operator, bool approved) internal virtual {\n if (operator == address(0)) {\n revert ERC721InvalidOperator(operator);\n }\n _operatorApprovals[owner][operator] = approved;\n emit ApprovalForAll(owner, operator, approved);\n }\n\n /**\n * @dev Reverts if the `tokenId` doesn't have a current owner (it hasn't been minted, or it has been burned).\n * Returns the owner.\n *\n * Overrides to ownership logic should be done to {_ownerOf}.\n */\n function _requireOwned(uint256 tokenId) internal view returns (address) {\n address owner = _ownerOf(tokenId);\n if (owner == address(0)) {\n revert ERC721NonexistentToken(tokenId);\n }\n return owner;\n }\n}\n" + }, + "@openzeppelin/contracts/token/ERC721/extensions/ERC721Burnable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC721/extensions/ERC721Burnable.sol)\n\npragma solidity ^0.8.20;\n\nimport {ERC721} from \"../ERC721.sol\";\nimport {Context} from \"../../../utils/Context.sol\";\n\n/**\n * @title ERC-721 Burnable Token\n * @dev ERC-721 Token that can be burned (destroyed).\n */\nabstract contract ERC721Burnable is Context, ERC721 {\n /**\n * @dev Burns `tokenId`. See {ERC721-_burn}.\n *\n * Requirements:\n *\n * - The caller must own `tokenId` or be an approved operator.\n */\n function burn(uint256 tokenId) public virtual {\n // Setting an \"auth\" arguments enables the `_isAuthorized` check which verifies that the token exists\n // (from != 0). Therefore, it is not needed to verify that the return value is not 0 here.\n _update(address(0), tokenId, _msgSender());\n }\n}\n" + }, + "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC721/extensions/ERC721Enumerable.sol)\n\npragma solidity ^0.8.20;\n\nimport {ERC721} from \"../ERC721.sol\";\nimport {IERC721Enumerable} from \"./IERC721Enumerable.sol\";\nimport {IERC165} from \"../../../utils/introspection/ERC165.sol\";\n\n/**\n * @dev This implements an optional extension of {ERC721} defined in the ERC that adds enumerability\n * of all the token ids in the contract as well as all token ids owned by each account.\n *\n * CAUTION: {ERC721} extensions that implement custom `balanceOf` logic, such as {ERC721Consecutive},\n * interfere with enumerability and should not be used together with {ERC721Enumerable}.\n */\nabstract contract ERC721Enumerable is ERC721, IERC721Enumerable {\n mapping(address owner => mapping(uint256 index => uint256)) private _ownedTokens;\n mapping(uint256 tokenId => uint256) private _ownedTokensIndex;\n\n uint256[] private _allTokens;\n mapping(uint256 tokenId => uint256) private _allTokensIndex;\n\n /**\n * @dev An `owner`'s token query was out of bounds for `index`.\n *\n * NOTE: The owner being `address(0)` indicates a global out of bounds index.\n */\n error ERC721OutOfBoundsIndex(address owner, uint256 index);\n\n /**\n * @dev Batch mint is not allowed.\n */\n error ERC721EnumerableForbiddenBatchMint();\n\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165, ERC721) returns (bool) {\n return interfaceId == type(IERC721Enumerable).interfaceId || super.supportsInterface(interfaceId);\n }\n\n /**\n * @dev See {IERC721Enumerable-tokenOfOwnerByIndex}.\n */\n function tokenOfOwnerByIndex(address owner, uint256 index) public view virtual returns (uint256) {\n if (index >= balanceOf(owner)) {\n revert ERC721OutOfBoundsIndex(owner, index);\n }\n return _ownedTokens[owner][index];\n }\n\n /**\n * @dev See {IERC721Enumerable-totalSupply}.\n */\n function totalSupply() public view virtual returns (uint256) {\n return _allTokens.length;\n }\n\n /**\n * @dev See {IERC721Enumerable-tokenByIndex}.\n */\n function tokenByIndex(uint256 index) public view virtual returns (uint256) {\n if (index >= totalSupply()) {\n revert ERC721OutOfBoundsIndex(address(0), index);\n }\n return _allTokens[index];\n }\n\n /**\n * @dev See {ERC721-_update}.\n */\n function _update(address to, uint256 tokenId, address auth) internal virtual override returns (address) {\n address previousOwner = super._update(to, tokenId, auth);\n\n if (previousOwner == address(0)) {\n _addTokenToAllTokensEnumeration(tokenId);\n } else if (previousOwner != to) {\n _removeTokenFromOwnerEnumeration(previousOwner, tokenId);\n }\n if (to == address(0)) {\n _removeTokenFromAllTokensEnumeration(tokenId);\n } else if (previousOwner != to) {\n _addTokenToOwnerEnumeration(to, tokenId);\n }\n\n return previousOwner;\n }\n\n /**\n * @dev Private function to add a token to this extension's ownership-tracking data structures.\n * @param to address representing the new owner of the given token ID\n * @param tokenId uint256 ID of the token to be added to the tokens list of the given address\n */\n function _addTokenToOwnerEnumeration(address to, uint256 tokenId) private {\n uint256 length = balanceOf(to) - 1;\n _ownedTokens[to][length] = tokenId;\n _ownedTokensIndex[tokenId] = length;\n }\n\n /**\n * @dev Private function to add a token to this extension's token tracking data structures.\n * @param tokenId uint256 ID of the token to be added to the tokens list\n */\n function _addTokenToAllTokensEnumeration(uint256 tokenId) private {\n _allTokensIndex[tokenId] = _allTokens.length;\n _allTokens.push(tokenId);\n }\n\n /**\n * @dev Private function to remove a token from this extension's ownership-tracking data structures. Note that\n * while the token is not assigned a new owner, the `_ownedTokensIndex` mapping is _not_ updated: this allows for\n * gas optimizations e.g. when performing a transfer operation (avoiding double writes).\n * This has O(1) time complexity, but alters the order of the _ownedTokens array.\n * @param from address representing the previous owner of the given token ID\n * @param tokenId uint256 ID of the token to be removed from the tokens list of the given address\n */\n function _removeTokenFromOwnerEnumeration(address from, uint256 tokenId) private {\n // To prevent a gap in from's tokens array, we store the last token in the index of the token to delete, and\n // then delete the last slot (swap and pop).\n\n uint256 lastTokenIndex = balanceOf(from);\n uint256 tokenIndex = _ownedTokensIndex[tokenId];\n\n mapping(uint256 index => uint256) storage _ownedTokensByOwner = _ownedTokens[from];\n\n // When the token to delete is the last token, the swap operation is unnecessary\n if (tokenIndex != lastTokenIndex) {\n uint256 lastTokenId = _ownedTokensByOwner[lastTokenIndex];\n\n _ownedTokensByOwner[tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token\n _ownedTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index\n }\n\n // This also deletes the contents at the last position of the array\n delete _ownedTokensIndex[tokenId];\n delete _ownedTokensByOwner[lastTokenIndex];\n }\n\n /**\n * @dev Private function to remove a token from this extension's token tracking data structures.\n * This has O(1) time complexity, but alters the order of the _allTokens array.\n * @param tokenId uint256 ID of the token to be removed from the tokens list\n */\n function _removeTokenFromAllTokensEnumeration(uint256 tokenId) private {\n // To prevent a gap in the tokens array, we store the last token in the index of the token to delete, and\n // then delete the last slot (swap and pop).\n\n uint256 lastTokenIndex = _allTokens.length - 1;\n uint256 tokenIndex = _allTokensIndex[tokenId];\n\n // When the token to delete is the last token, the swap operation is unnecessary. However, since this occurs so\n // rarely (when the last minted token is burnt) that we still do the swap here to avoid the gas cost of adding\n // an 'if' statement (like in _removeTokenFromOwnerEnumeration)\n uint256 lastTokenId = _allTokens[lastTokenIndex];\n\n _allTokens[tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token\n _allTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index\n\n // This also deletes the contents at the last position of the array\n delete _allTokensIndex[tokenId];\n _allTokens.pop();\n }\n\n /**\n * See {ERC721-_increaseBalance}. We need that to account tokens that were minted in batch\n */\n function _increaseBalance(address account, uint128 amount) internal virtual override {\n if (amount > 0) {\n revert ERC721EnumerableForbiddenBatchMint();\n }\n super._increaseBalance(account, amount);\n }\n}\n" + }, + "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC721/extensions/ERC721URIStorage.sol)\n\npragma solidity ^0.8.20;\n\nimport {ERC721} from \"../ERC721.sol\";\nimport {Strings} from \"../../../utils/Strings.sol\";\nimport {IERC4906} from \"../../../interfaces/IERC4906.sol\";\nimport {IERC165} from \"../../../interfaces/IERC165.sol\";\n\n/**\n * @dev ERC-721 token with storage based token URI management.\n */\nabstract contract ERC721URIStorage is IERC4906, ERC721 {\n using Strings for uint256;\n\n // Interface ID as defined in ERC-4906. This does not correspond to a traditional interface ID as ERC-4906 only\n // defines events and does not include any external function.\n bytes4 private constant ERC4906_INTERFACE_ID = bytes4(0x49064906);\n\n // Optional mapping for token URIs\n mapping(uint256 tokenId => string) private _tokenURIs;\n\n /**\n * @dev See {IERC165-supportsInterface}\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override(ERC721, IERC165) returns (bool) {\n return interfaceId == ERC4906_INTERFACE_ID || super.supportsInterface(interfaceId);\n }\n\n /**\n * @dev See {IERC721Metadata-tokenURI}.\n */\n function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {\n _requireOwned(tokenId);\n\n string memory _tokenURI = _tokenURIs[tokenId];\n string memory base = _baseURI();\n\n // If there is no base URI, return the token URI.\n if (bytes(base).length == 0) {\n return _tokenURI;\n }\n // If both are set, concatenate the baseURI and tokenURI (via string.concat).\n if (bytes(_tokenURI).length > 0) {\n return string.concat(base, _tokenURI);\n }\n\n return super.tokenURI(tokenId);\n }\n\n /**\n * @dev Sets `_tokenURI` as the tokenURI of `tokenId`.\n *\n * Emits {MetadataUpdate}.\n */\n function _setTokenURI(uint256 tokenId, string memory _tokenURI) internal virtual {\n _tokenURIs[tokenId] = _tokenURI;\n emit MetadataUpdate(tokenId);\n }\n}\n" + }, + "@openzeppelin/contracts/token/ERC721/extensions/ERC721Votes.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC721/extensions/ERC721Votes.sol)\n\npragma solidity ^0.8.20;\n\nimport {ERC721} from \"../ERC721.sol\";\nimport {Votes} from \"../../../governance/utils/Votes.sol\";\n\n/**\n * @dev Extension of ERC-721 to support voting and delegation as implemented by {Votes}, where each individual NFT counts\n * as 1 vote unit.\n *\n * Tokens do not count as votes until they are delegated, because votes must be tracked which incurs an additional cost\n * on every transfer. Token holders can either delegate to a trusted representative who will decide how to make use of\n * the votes in governance decisions, or they can delegate to themselves to be their own representative.\n */\nabstract contract ERC721Votes is ERC721, Votes {\n /**\n * @dev See {ERC721-_update}. Adjusts votes when tokens are transferred.\n *\n * Emits a {IVotes-DelegateVotesChanged} event.\n */\n function _update(address to, uint256 tokenId, address auth) internal virtual override returns (address) {\n address previousOwner = super._update(to, tokenId, auth);\n\n _transferVotingUnits(previousOwner, to, 1);\n\n return previousOwner;\n }\n\n /**\n * @dev Returns the balance of `account`.\n *\n * WARNING: Overriding this function will likely result in incorrect vote tracking.\n */\n function _getVotingUnits(address account) internal view virtual override returns (uint256) {\n return balanceOf(account);\n }\n\n /**\n * @dev See {ERC721-_increaseBalance}. We need that to account tokens that were minted in batch.\n */\n function _increaseBalance(address account, uint128 amount) internal virtual override {\n super._increaseBalance(account, amount);\n _transferVotingUnits(address(0), account, amount);\n }\n}\n" + }, + "@openzeppelin/contracts/token/ERC721/extensions/IERC721Enumerable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC721/extensions/IERC721Enumerable.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC721} from \"../IERC721.sol\";\n\n/**\n * @title ERC-721 Non-Fungible Token Standard, optional enumeration extension\n * @dev See https://eips.ethereum.org/EIPS/eip-721\n */\ninterface IERC721Enumerable is IERC721 {\n /**\n * @dev Returns the total amount of tokens stored by the contract.\n */\n function totalSupply() external view returns (uint256);\n\n /**\n * @dev Returns a token ID owned by `owner` at a given `index` of its token list.\n * Use along with {balanceOf} to enumerate all of ``owner``'s tokens.\n */\n function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256);\n\n /**\n * @dev Returns a token ID at a given `index` of all the tokens stored by the contract.\n * Use along with {totalSupply} to enumerate all tokens.\n */\n function tokenByIndex(uint256 index) external view returns (uint256);\n}\n" + }, + "@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC721/extensions/IERC721Metadata.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC721} from \"../IERC721.sol\";\n\n/**\n * @title ERC-721 Non-Fungible Token Standard, optional metadata extension\n * @dev See https://eips.ethereum.org/EIPS/eip-721\n */\ninterface IERC721Metadata is IERC721 {\n /**\n * @dev Returns the token collection name.\n */\n function name() external view returns (string memory);\n\n /**\n * @dev Returns the token collection symbol.\n */\n function symbol() external view returns (string memory);\n\n /**\n * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token.\n */\n function tokenURI(uint256 tokenId) external view returns (string memory);\n}\n" + }, + "@openzeppelin/contracts/token/ERC721/IERC721.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC721/IERC721.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC165} from \"../../utils/introspection/IERC165.sol\";\n\n/**\n * @dev Required interface of an ERC-721 compliant contract.\n */\ninterface IERC721 is IERC165 {\n /**\n * @dev Emitted when `tokenId` token is transferred from `from` to `to`.\n */\n event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);\n\n /**\n * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.\n */\n event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);\n\n /**\n * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.\n */\n event ApprovalForAll(address indexed owner, address indexed operator, bool approved);\n\n /**\n * @dev Returns the number of tokens in ``owner``'s account.\n */\n function balanceOf(address owner) external view returns (uint256 balance);\n\n /**\n * @dev Returns the owner of the `tokenId` token.\n *\n * Requirements:\n *\n * - `tokenId` must exist.\n */\n function ownerOf(uint256 tokenId) external view returns (address owner);\n\n /**\n * @dev Safely transfers `tokenId` token from `from` to `to`.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `tokenId` token must exist and be owned by `from`.\n * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon\n * a safe transfer.\n *\n * Emits a {Transfer} event.\n */\n function safeTransferFrom(address from, address to, uint256 tokenId, bytes calldata data) external;\n\n /**\n * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients\n * are aware of the ERC-721 protocol to prevent tokens from being forever locked.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `tokenId` token must exist and be owned by `from`.\n * - If the caller is not `from`, it must have been allowed to move this token by either {approve} or\n * {setApprovalForAll}.\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon\n * a safe transfer.\n *\n * Emits a {Transfer} event.\n */\n function safeTransferFrom(address from, address to, uint256 tokenId) external;\n\n /**\n * @dev Transfers `tokenId` token from `from` to `to`.\n *\n * WARNING: Note that the caller is responsible to confirm that the recipient is capable of receiving ERC-721\n * or else they may be permanently lost. Usage of {safeTransferFrom} prevents loss, though the caller must\n * understand this adds an external call which potentially creates a reentrancy vulnerability.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `tokenId` token must be owned by `from`.\n * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(address from, address to, uint256 tokenId) external;\n\n /**\n * @dev Gives permission to `to` to transfer `tokenId` token to another account.\n * The approval is cleared when the token is transferred.\n *\n * Only a single account can be approved at a time, so approving the zero address clears previous approvals.\n *\n * Requirements:\n *\n * - The caller must own the token or be an approved operator.\n * - `tokenId` must exist.\n *\n * Emits an {Approval} event.\n */\n function approve(address to, uint256 tokenId) external;\n\n /**\n * @dev Approve or remove `operator` as an operator for the caller.\n * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.\n *\n * Requirements:\n *\n * - The `operator` cannot be the address zero.\n *\n * Emits an {ApprovalForAll} event.\n */\n function setApprovalForAll(address operator, bool approved) external;\n\n /**\n * @dev Returns the account approved for `tokenId` token.\n *\n * Requirements:\n *\n * - `tokenId` must exist.\n */\n function getApproved(uint256 tokenId) external view returns (address operator);\n\n /**\n * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.\n *\n * See {setApprovalForAll}\n */\n function isApprovedForAll(address owner, address operator) external view returns (bool);\n}\n" + }, + "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC721/IERC721Receiver.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @title ERC-721 token receiver interface\n * @dev Interface for any contract that wants to support safeTransfers\n * from ERC-721 asset contracts.\n */\ninterface IERC721Receiver {\n /**\n * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom}\n * by `operator` from `from`, this function is called.\n *\n * It must return its Solidity selector to confirm the token transfer.\n * If any other value is returned or the interface is not implemented by the recipient, the transfer will be\n * reverted.\n *\n * The selector can be obtained in Solidity with `IERC721Receiver.onERC721Received.selector`.\n */\n function onERC721Received(\n address operator,\n address from,\n uint256 tokenId,\n bytes calldata data\n ) external returns (bytes4);\n}\n" + }, + "@openzeppelin/contracts/token/ERC721/utils/ERC721Utils.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC721/utils/ERC721Utils.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC721Receiver} from \"../IERC721Receiver.sol\";\nimport {IERC721Errors} from \"../../../interfaces/draft-IERC6093.sol\";\n\n/**\n * @dev Library that provide common ERC-721 utility functions.\n *\n * See https://eips.ethereum.org/EIPS/eip-721[ERC-721].\n *\n * _Available since v5.1._\n */\nlibrary ERC721Utils {\n /**\n * @dev Performs an acceptance check for the provided `operator` by calling {IERC721-onERC721Received}\n * on the `to` address. The `operator` is generally the address that initiated the token transfer (i.e. `msg.sender`).\n *\n * The acceptance call is not executed and treated as a no-op if the target address doesn't contain code (i.e. an EOA).\n * Otherwise, the recipient must implement {IERC721Receiver-onERC721Received} and return the acceptance magic value to accept\n * the transfer.\n */\n function checkOnERC721Received(\n address operator,\n address from,\n address to,\n uint256 tokenId,\n bytes memory data\n ) internal {\n if (to.code.length > 0) {\n try IERC721Receiver(to).onERC721Received(operator, from, tokenId, data) returns (bytes4 retval) {\n if (retval != IERC721Receiver.onERC721Received.selector) {\n // Token rejected\n revert IERC721Errors.ERC721InvalidReceiver(to);\n }\n } catch (bytes memory reason) {\n if (reason.length == 0) {\n // non-IERC721Receiver implementer\n revert IERC721Errors.ERC721InvalidReceiver(to);\n } else {\n assembly (\"memory-safe\") {\n revert(add(32, reason), mload(reason))\n }\n }\n }\n }\n }\n}\n" + }, + "@openzeppelin/contracts/utils/Context.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract Context {\n function _msgSender() internal view virtual returns (address) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual returns (bytes calldata) {\n return msg.data;\n }\n\n function _contextSuffixLength() internal view virtual returns (uint256) {\n return 0;\n }\n}\n" + }, + "@openzeppelin/contracts/utils/cryptography/ECDSA.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/cryptography/ECDSA.sol)\n\npragma solidity ^0.8.20;\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 }\n\n /**\n * @dev The signature derives the `address(0)`.\n */\n error ECDSAInvalidSignature();\n\n /**\n * @dev The signature has an invalid length.\n */\n error ECDSAInvalidSignatureLength(uint256 length);\n\n /**\n * @dev The signature has an S value that is in the upper half order.\n */\n error ECDSAInvalidSignatureS(bytes32 s);\n\n /**\n * @dev Returns the address that signed a hashed message (`hash`) with `signature` or an error. This will not\n * return address(0) without also returning an error description. Errors are documented using an enum (error type)\n * and a bytes32 providing additional information about the error.\n *\n * If no error is returned, then the address can be used for verification purposes.\n *\n * The `ecrecover` EVM precompile 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 {MessageHashUtils-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 function tryRecover(\n bytes32 hash,\n bytes memory signature\n ) internal pure returns (address recovered, RecoverError err, bytes32 errArg) {\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 assembly (\"memory-safe\") {\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, bytes32(signature.length));\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 precompile 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 {MessageHashUtils-toEthSignedMessageHash} on it.\n */\n function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {\n (address recovered, RecoverError error, bytes32 errorArg) = tryRecover(hash, signature);\n _throwError(error, errorArg);\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[ERC-2098 short signatures]\n */\n function tryRecover(\n bytes32 hash,\n bytes32 r,\n bytes32 vs\n ) internal pure returns (address recovered, RecoverError err, bytes32 errArg) {\n unchecked {\n bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff);\n // We do not check for an overflow here since the shift operation results in 0 or 1.\n uint8 v = uint8((uint256(vs) >> 255) + 27);\n return tryRecover(hash, v, r, s);\n }\n }\n\n /**\n * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately.\n */\n function recover(bytes32 hash, bytes32 r, bytes32 vs) internal pure returns (address) {\n (address recovered, RecoverError error, bytes32 errorArg) = tryRecover(hash, r, vs);\n _throwError(error, errorArg);\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 function tryRecover(\n bytes32 hash,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) internal pure returns (address recovered, RecoverError err, bytes32 errArg) {\n // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature\n // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines\n // the valid range for s in (301): 0 < s < secp256k1n ÷ 2 + 1, and for v in (302): v ∈ {27, 28}. Most\n // signatures from current libraries generate a unique signature with an s-value in the lower half order.\n //\n // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value\n // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or\n // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept\n // these malleable signatures as well.\n if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) {\n return (address(0), RecoverError.InvalidSignatureS, s);\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, bytes32(0));\n }\n\n return (signer, RecoverError.NoError, bytes32(0));\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, bytes32 errorArg) = tryRecover(hash, v, r, s);\n _throwError(error, errorArg);\n return recovered;\n }\n\n /**\n * @dev Optionally reverts with the corresponding custom error according to the `error` argument provided.\n */\n function _throwError(RecoverError error, bytes32 errorArg) private pure {\n if (error == RecoverError.NoError) {\n return; // no error: do nothing\n } else if (error == RecoverError.InvalidSignature) {\n revert ECDSAInvalidSignature();\n } else if (error == RecoverError.InvalidSignatureLength) {\n revert ECDSAInvalidSignatureLength(uint256(errorArg));\n } else if (error == RecoverError.InvalidSignatureS) {\n revert ECDSAInvalidSignatureS(errorArg);\n }\n }\n}\n" + }, + "@openzeppelin/contracts/utils/cryptography/EIP712.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/cryptography/EIP712.sol)\n\npragma solidity ^0.8.20;\n\nimport {MessageHashUtils} from \"./MessageHashUtils.sol\";\nimport {ShortStrings, ShortString} from \"../ShortStrings.sol\";\nimport {IERC5267} from \"../../interfaces/IERC5267.sol\";\n\n/**\n * @dev https://eips.ethereum.org/EIPS/eip-712[EIP-712] is a standard for hashing and signing of typed structured data.\n *\n * The encoding scheme specified in the EIP requires a domain separator and a hash of the typed structured data, whose\n * encoding is very generic and therefore its implementation in Solidity is not feasible, thus this contract\n * does not implement the encoding itself. Protocols need to implement the type-specific encoding they need in order to\n * produce the hash of their typed data using a combination of `abi.encode` and `keccak256`.\n *\n * This contract implements the EIP-712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding\n * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA\n * ({_hashTypedDataV4}).\n *\n * The implementation of the domain separator was designed to be as efficient as possible while still properly updating\n * the chain id to protect against replay attacks on an eventual fork of the chain.\n *\n * NOTE: This contract implements the version of the encoding known as \"v4\", as implemented by the JSON RPC method\n * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask].\n *\n * NOTE: In the upgradeable version of this contract, the cached values will correspond to the address, and the domain\n * separator of the implementation contract. This will cause the {_domainSeparatorV4} function to always rebuild the\n * separator from the immutable values, which is cheaper than accessing a cached version in cold storage.\n *\n * @custom:oz-upgrades-unsafe-allow state-variable-immutable\n */\nabstract contract EIP712 is IERC5267 {\n using ShortStrings for *;\n\n bytes32 private constant TYPE_HASH =\n keccak256(\"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)\");\n\n // Cache the domain separator as an immutable value, but also store the chain id that it corresponds to, in order to\n // invalidate the cached domain separator if the chain id changes.\n bytes32 private immutable _cachedDomainSeparator;\n uint256 private immutable _cachedChainId;\n address private immutable _cachedThis;\n\n bytes32 private immutable _hashedName;\n bytes32 private immutable _hashedVersion;\n\n ShortString private immutable _name;\n ShortString private immutable _version;\n string private _nameFallback;\n string private _versionFallback;\n\n /**\n * @dev Initializes the domain separator and parameter caches.\n *\n * The meaning of `name` and `version` is specified in\n * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP-712]:\n *\n * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol.\n * - `version`: the current major version of the signing domain.\n *\n * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart\n * contract upgrade].\n */\n constructor(string memory name, string memory version) {\n _name = name.toShortStringWithFallback(_nameFallback);\n _version = version.toShortStringWithFallback(_versionFallback);\n _hashedName = keccak256(bytes(name));\n _hashedVersion = keccak256(bytes(version));\n\n _cachedChainId = block.chainid;\n _cachedDomainSeparator = _buildDomainSeparator();\n _cachedThis = address(this);\n }\n\n /**\n * @dev Returns the domain separator for the current chain.\n */\n function _domainSeparatorV4() internal view returns (bytes32) {\n if (address(this) == _cachedThis && block.chainid == _cachedChainId) {\n return _cachedDomainSeparator;\n } else {\n return _buildDomainSeparator();\n }\n }\n\n function _buildDomainSeparator() private view returns (bytes32) {\n return keccak256(abi.encode(TYPE_HASH, _hashedName, _hashedVersion, block.chainid, address(this)));\n }\n\n /**\n * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this\n * function returns the hash of the fully encoded EIP712 message for this domain.\n *\n * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example:\n *\n * ```solidity\n * bytes32 digest = _hashTypedDataV4(keccak256(abi.encode(\n * keccak256(\"Mail(address to,string contents)\"),\n * mailTo,\n * keccak256(bytes(mailContents))\n * )));\n * address signer = ECDSA.recover(digest, signature);\n * ```\n */\n function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) {\n return MessageHashUtils.toTypedDataHash(_domainSeparatorV4(), structHash);\n }\n\n /**\n * @dev See {IERC-5267}.\n */\n function eip712Domain()\n public\n view\n virtual\n returns (\n bytes1 fields,\n string memory name,\n string memory version,\n uint256 chainId,\n address verifyingContract,\n bytes32 salt,\n uint256[] memory extensions\n )\n {\n return (\n hex\"0f\", // 01111\n _EIP712Name(),\n _EIP712Version(),\n block.chainid,\n address(this),\n bytes32(0),\n new uint256[](0)\n );\n }\n\n /**\n * @dev The name parameter for the EIP712 domain.\n *\n * NOTE: By default this function reads _name which is an immutable value.\n * It only reads from storage if necessary (in case the value is too large to fit in a ShortString).\n */\n // solhint-disable-next-line func-name-mixedcase\n function _EIP712Name() internal view returns (string memory) {\n return _name.toStringWithFallback(_nameFallback);\n }\n\n /**\n * @dev The version parameter for the EIP712 domain.\n *\n * NOTE: By default this function reads _version which is an immutable value.\n * It only reads from storage if necessary (in case the value is too large to fit in a ShortString).\n */\n // solhint-disable-next-line func-name-mixedcase\n function _EIP712Version() internal view returns (string memory) {\n return _version.toStringWithFallback(_versionFallback);\n }\n}\n" + }, + "@openzeppelin/contracts/utils/cryptography/MessageHashUtils.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/cryptography/MessageHashUtils.sol)\n\npragma solidity ^0.8.20;\n\nimport {Strings} from \"../Strings.sol\";\n\n/**\n * @dev Signature message hash utilities for producing digests to be consumed by {ECDSA} recovery or signing.\n *\n * The library provides methods for generating a hash of a message that conforms to the\n * https://eips.ethereum.org/EIPS/eip-191[ERC-191] and https://eips.ethereum.org/EIPS/eip-712[EIP 712]\n * specifications.\n */\nlibrary MessageHashUtils {\n /**\n * @dev Returns the keccak256 digest of an ERC-191 signed data with version\n * `0x45` (`personal_sign` messages).\n *\n * The digest is calculated by prefixing a bytes32 `messageHash` with\n * `\"\\x19Ethereum Signed Message:\\n32\"` and hashing the result. It corresponds with the\n * hash signed when using the https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] JSON-RPC method.\n *\n * NOTE: The `messageHash` parameter is intended to be the result of hashing a raw message with\n * keccak256, although any bytes32 value can be safely used because the final digest will\n * be re-hashed.\n *\n * See {ECDSA-recover}.\n */\n function toEthSignedMessageHash(bytes32 messageHash) internal pure returns (bytes32 digest) {\n assembly (\"memory-safe\") {\n mstore(0x00, \"\\x19Ethereum Signed Message:\\n32\") // 32 is the bytes-length of messageHash\n mstore(0x1c, messageHash) // 0x1c (28) is the length of the prefix\n digest := keccak256(0x00, 0x3c) // 0x3c is the length of the prefix (0x1c) + messageHash (0x20)\n }\n }\n\n /**\n * @dev Returns the keccak256 digest of an ERC-191 signed data with version\n * `0x45` (`personal_sign` messages).\n *\n * The digest is calculated by prefixing an arbitrary `message` with\n * `\"\\x19Ethereum Signed Message:\\n\" + len(message)` and hashing the result. It corresponds with the\n * hash signed when using the https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] JSON-RPC method.\n *\n * See {ECDSA-recover}.\n */\n function toEthSignedMessageHash(bytes memory message) internal pure returns (bytes32) {\n return\n keccak256(bytes.concat(\"\\x19Ethereum Signed Message:\\n\", bytes(Strings.toString(message.length)), message));\n }\n\n /**\n * @dev Returns the keccak256 digest of an ERC-191 signed data with version\n * `0x00` (data with intended validator).\n *\n * The digest is calculated by prefixing an arbitrary `data` with `\"\\x19\\x00\"` and the intended\n * `validator` address. Then hashing the result.\n *\n * See {ECDSA-recover}.\n */\n function toDataWithIntendedValidatorHash(address validator, bytes memory data) internal pure returns (bytes32) {\n return keccak256(abi.encodePacked(hex\"19_00\", validator, data));\n }\n\n /**\n * @dev Returns the keccak256 digest of an EIP-712 typed data (ERC-191 version `0x01`).\n *\n * The digest is calculated from a `domainSeparator` and a `structHash`, by prefixing them with\n * `\\x19\\x01` and hashing the result. It corresponds to the hash signed by the\n * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`] JSON-RPC method as part of EIP-712.\n *\n * See {ECDSA-recover}.\n */\n function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32 digest) {\n assembly (\"memory-safe\") {\n let ptr := mload(0x40)\n mstore(ptr, hex\"19_01\")\n mstore(add(ptr, 0x02), domainSeparator)\n mstore(add(ptr, 0x22), structHash)\n digest := keccak256(ptr, 0x42)\n }\n }\n}\n" + }, + "@openzeppelin/contracts/utils/introspection/ERC165.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/introspection/ERC165.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC165} from \"./IERC165.sol\";\n\n/**\n * @dev Implementation of the {IERC165} interface.\n *\n * Contracts that want to implement ERC-165 should inherit from this contract and override {supportsInterface} to check\n * for the additional interface id that will be supported. For example:\n *\n * ```solidity\n * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);\n * }\n * ```\n */\nabstract contract ERC165 is IERC165 {\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) {\n return interfaceId == type(IERC165).interfaceId;\n }\n}\n" + }, + "@openzeppelin/contracts/utils/introspection/IERC165.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/introspection/IERC165.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Interface of the ERC-165 standard, as defined in the\n * https://eips.ethereum.org/EIPS/eip-165[ERC].\n *\n * Implementers can declare support of contract interfaces, which can then be\n * queried by others ({ERC165Checker}).\n *\n * For an implementation, see {ERC165}.\n */\ninterface IERC165 {\n /**\n * @dev Returns true if this contract implements the interface defined by\n * `interfaceId`. See the corresponding\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[ERC section]\n * to learn more about how these ids are created.\n *\n * This function call must use less than 30 000 gas.\n */\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\n}\n" + }, + "@openzeppelin/contracts/utils/math/Math.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/math/Math.sol)\n\npragma solidity ^0.8.20;\n\nimport {Panic} from \"../Panic.sol\";\nimport {SafeCast} from \"./SafeCast.sol\";\n\n/**\n * @dev Standard math utilities missing in the Solidity language.\n */\nlibrary Math {\n enum Rounding {\n Floor, // Toward negative infinity\n Ceil, // Toward positive infinity\n Trunc, // Toward zero\n Expand // Away from zero\n }\n\n /**\n * @dev Returns the addition of two unsigned integers, with an success flag (no overflow).\n */\n function tryAdd(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\n unchecked {\n uint256 c = a + b;\n if (c < a) return (false, 0);\n return (true, c);\n }\n }\n\n /**\n * @dev Returns the subtraction of two unsigned integers, with an success flag (no overflow).\n */\n function trySub(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\n unchecked {\n if (b > a) return (false, 0);\n return (true, a - b);\n }\n }\n\n /**\n * @dev Returns the multiplication of two unsigned integers, with an success flag (no overflow).\n */\n function tryMul(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\n unchecked {\n // Gas optimization: this is cheaper than requiring 'a' not being zero, but the\n // benefit is lost if 'b' is also tested.\n // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522\n if (a == 0) return (true, 0);\n uint256 c = a * b;\n if (c / a != b) return (false, 0);\n return (true, c);\n }\n }\n\n /**\n * @dev Returns the division of two unsigned integers, with a success flag (no division by zero).\n */\n function tryDiv(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\n unchecked {\n if (b == 0) return (false, 0);\n return (true, a / b);\n }\n }\n\n /**\n * @dev Returns the remainder of dividing two unsigned integers, with a success flag (no division by zero).\n */\n function tryMod(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\n unchecked {\n if (b == 0) return (false, 0);\n return (true, a % b);\n }\n }\n\n /**\n * @dev Branchless ternary evaluation for `a ? b : c`. Gas costs are constant.\n *\n * IMPORTANT: This function may reduce bytecode size and consume less gas when used standalone.\n * However, the compiler may optimize Solidity ternary operations (i.e. `a ? b : c`) to only compute\n * one branch when needed, making this function more expensive.\n */\n function ternary(bool condition, uint256 a, uint256 b) internal pure returns (uint256) {\n unchecked {\n // branchless ternary works because:\n // b ^ (a ^ b) == a\n // b ^ 0 == b\n return b ^ ((a ^ b) * SafeCast.toUint(condition));\n }\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 ternary(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 ternary(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 towards infinity instead\n * of rounding towards zero.\n */\n function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {\n if (b == 0) {\n // Guarantee the same behavior as in a regular Solidity division.\n Panic.panic(Panic.DIVISION_BY_ZERO);\n }\n\n // The following calculation ensures accurate ceiling division without overflow.\n // Since a is non-zero, (a - 1) / b will not overflow.\n // The largest possible result occurs when (a - 1) / b is type(uint256).max,\n // but the largest value we can obtain is type(uint256).max - 1, which happens\n // when a = type(uint256).max and b = 1.\n unchecked {\n return SafeCast.toUint(a > 0) * ((a - 1) / b + 1);\n }\n }\n\n /**\n * @dev Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or\n * denominator == 0.\n *\n * Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv) with further edits by\n * 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²⁵⁶ and mod 2²⁵⁶ - 1, then use\n // the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256\n // variables such that product = prod1 * 2²⁵⁶ + prod0.\n uint256 prod0 = x * y; // 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 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²⁵⁶. Also prevents denominator == 0.\n if (denominator <= prod1) {\n Panic.panic(ternary(denominator == 0, Panic.DIVISION_BY_ZERO, Panic.UNDER_OVERFLOW));\n }\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.\n // Always >= 1. See https://cs.stackexchange.com/q/138556/92363.\n\n uint256 twos = denominator & (0 - denominator);\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²⁵⁶ / 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²⁵⁶. Now that denominator is an odd number, it has an inverse modulo 2²⁵⁶ such\n // that denominator * inv ≡ 1 mod 2²⁵⁶. Compute the inverse by starting with a seed that is correct for\n // four bits. That is, denominator * inv ≡ 1 mod 2⁴.\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\n // works in modular arithmetic, doubling the correct bits in each step.\n inverse *= 2 - denominator * inverse; // inverse mod 2⁸\n inverse *= 2 - denominator * inverse; // inverse mod 2¹⁶\n inverse *= 2 - denominator * inverse; // inverse mod 2³²\n inverse *= 2 - denominator * inverse; // inverse mod 2⁶⁴\n inverse *= 2 - denominator * inverse; // inverse mod 2¹²⁸\n inverse *= 2 - denominator * inverse; // inverse mod 2²⁵⁶\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²⁵⁶. Since the preconditions guarantee that the outcome is\n // less than 2²⁵⁶, 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 * @dev 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 return mulDiv(x, y, denominator) + SafeCast.toUint(unsignedRoundsUp(rounding) && mulmod(x, y, denominator) > 0);\n }\n\n /**\n * @dev Calculate the modular multiplicative inverse of a number in Z/nZ.\n *\n * If n is a prime, then Z/nZ is a field. In that case all elements are inversible, except 0.\n * If n is not a prime, then Z/nZ is not a field, and some elements might not be inversible.\n *\n * If the input value is not inversible, 0 is returned.\n *\n * NOTE: If you know for sure that n is (big) a prime, it may be cheaper to use Fermat's little theorem and get the\n * inverse using `Math.modExp(a, n - 2, n)`. See {invModPrime}.\n */\n function invMod(uint256 a, uint256 n) internal pure returns (uint256) {\n unchecked {\n if (n == 0) return 0;\n\n // The inverse modulo is calculated using the Extended Euclidean Algorithm (iterative version)\n // Used to compute integers x and y such that: ax + ny = gcd(a, n).\n // When the gcd is 1, then the inverse of a modulo n exists and it's x.\n // ax + ny = 1\n // ax = 1 + (-y)n\n // ax ≡ 1 (mod n) # x is the inverse of a modulo n\n\n // If the remainder is 0 the gcd is n right away.\n uint256 remainder = a % n;\n uint256 gcd = n;\n\n // Therefore the initial coefficients are:\n // ax + ny = gcd(a, n) = n\n // 0a + 1n = n\n int256 x = 0;\n int256 y = 1;\n\n while (remainder != 0) {\n uint256 quotient = gcd / remainder;\n\n (gcd, remainder) = (\n // The old remainder is the next gcd to try.\n remainder,\n // Compute the next remainder.\n // Can't overflow given that (a % gcd) * (gcd // (a % gcd)) <= gcd\n // where gcd is at most n (capped to type(uint256).max)\n gcd - remainder * quotient\n );\n\n (x, y) = (\n // Increment the coefficient of a.\n y,\n // Decrement the coefficient of n.\n // Can overflow, but the result is casted to uint256 so that the\n // next value of y is \"wrapped around\" to a value between 0 and n - 1.\n x - y * int256(quotient)\n );\n }\n\n if (gcd != 1) return 0; // No inverse exists.\n return ternary(x < 0, n - uint256(-x), uint256(x)); // Wrap the result if it's negative.\n }\n }\n\n /**\n * @dev Variant of {invMod}. More efficient, but only works if `p` is known to be a prime greater than `2`.\n *\n * From https://en.wikipedia.org/wiki/Fermat%27s_little_theorem[Fermat's little theorem], we know that if p is\n * prime, then `a**(p-1) ≡ 1 mod p`. As a consequence, we have `a * a**(p-2) ≡ 1 mod p`, which means that\n * `a**(p-2)` is the modular multiplicative inverse of a in Fp.\n *\n * NOTE: this function does NOT check that `p` is a prime greater than `2`.\n */\n function invModPrime(uint256 a, uint256 p) internal view returns (uint256) {\n unchecked {\n return Math.modExp(a, p - 2, p);\n }\n }\n\n /**\n * @dev Returns the modular exponentiation of the specified base, exponent and modulus (b ** e % m)\n *\n * Requirements:\n * - modulus can't be zero\n * - underlying staticcall to precompile must succeed\n *\n * IMPORTANT: The result is only valid if the underlying call succeeds. When using this function, make\n * sure the chain you're using it on supports the precompiled contract for modular exponentiation\n * at address 0x05 as specified in https://eips.ethereum.org/EIPS/eip-198[EIP-198]. Otherwise,\n * the underlying function will succeed given the lack of a revert, but the result may be incorrectly\n * interpreted as 0.\n */\n function modExp(uint256 b, uint256 e, uint256 m) internal view returns (uint256) {\n (bool success, uint256 result) = tryModExp(b, e, m);\n if (!success) {\n Panic.panic(Panic.DIVISION_BY_ZERO);\n }\n return result;\n }\n\n /**\n * @dev Returns the modular exponentiation of the specified base, exponent and modulus (b ** e % m).\n * It includes a success flag indicating if the operation succeeded. Operation will be marked as failed if trying\n * to operate modulo 0 or if the underlying precompile reverted.\n *\n * IMPORTANT: The result is only valid if the success flag is true. When using this function, make sure the chain\n * you're using it on supports the precompiled contract for modular exponentiation at address 0x05 as specified in\n * https://eips.ethereum.org/EIPS/eip-198[EIP-198]. Otherwise, the underlying function will succeed given the lack\n * of a revert, but the result may be incorrectly interpreted as 0.\n */\n function tryModExp(uint256 b, uint256 e, uint256 m) internal view returns (bool success, uint256 result) {\n if (m == 0) return (false, 0);\n assembly (\"memory-safe\") {\n let ptr := mload(0x40)\n // | Offset | Content | Content (Hex) |\n // |-----------|------------|--------------------------------------------------------------------|\n // | 0x00:0x1f | size of b | 0x0000000000000000000000000000000000000000000000000000000000000020 |\n // | 0x20:0x3f | size of e | 0x0000000000000000000000000000000000000000000000000000000000000020 |\n // | 0x40:0x5f | size of m | 0x0000000000000000000000000000000000000000000000000000000000000020 |\n // | 0x60:0x7f | value of b | 0x<.............................................................b> |\n // | 0x80:0x9f | value of e | 0x<.............................................................e> |\n // | 0xa0:0xbf | value of m | 0x<.............................................................m> |\n mstore(ptr, 0x20)\n mstore(add(ptr, 0x20), 0x20)\n mstore(add(ptr, 0x40), 0x20)\n mstore(add(ptr, 0x60), b)\n mstore(add(ptr, 0x80), e)\n mstore(add(ptr, 0xa0), m)\n\n // Given the result < m, it's guaranteed to fit in 32 bytes,\n // so we can use the memory scratch space located at offset 0.\n success := staticcall(gas(), 0x05, ptr, 0xc0, 0x00, 0x20)\n result := mload(0x00)\n }\n }\n\n /**\n * @dev Variant of {modExp} that supports inputs of arbitrary length.\n */\n function modExp(bytes memory b, bytes memory e, bytes memory m) internal view returns (bytes memory) {\n (bool success, bytes memory result) = tryModExp(b, e, m);\n if (!success) {\n Panic.panic(Panic.DIVISION_BY_ZERO);\n }\n return result;\n }\n\n /**\n * @dev Variant of {tryModExp} that supports inputs of arbitrary length.\n */\n function tryModExp(\n bytes memory b,\n bytes memory e,\n bytes memory m\n ) internal view returns (bool success, bytes memory result) {\n if (_zeroBytes(m)) return (false, new bytes(0));\n\n uint256 mLen = m.length;\n\n // Encode call args in result and move the free memory pointer\n result = abi.encodePacked(b.length, e.length, mLen, b, e, m);\n\n assembly (\"memory-safe\") {\n let dataPtr := add(result, 0x20)\n // Write result on top of args to avoid allocating extra memory.\n success := staticcall(gas(), 0x05, dataPtr, mload(result), dataPtr, mLen)\n // Overwrite the length.\n // result.length > returndatasize() is guaranteed because returndatasize() == m.length\n mstore(result, mLen)\n // Set the memory pointer after the returned data.\n mstore(0x40, add(dataPtr, mLen))\n }\n }\n\n /**\n * @dev Returns whether the provided byte array is zero.\n */\n function _zeroBytes(bytes memory byteArray) private pure returns (bool) {\n for (uint256 i = 0; i < byteArray.length; ++i) {\n if (byteArray[i] != 0) {\n return false;\n }\n }\n return true;\n }\n\n /**\n * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded\n * towards zero.\n *\n * This method is based on Newton's method for computing square roots; the algorithm is restricted to only\n * using integer operations.\n */\n function sqrt(uint256 a) internal pure returns (uint256) {\n unchecked {\n // Take care of easy edge cases when a == 0 or a == 1\n if (a <= 1) {\n return a;\n }\n\n // In this function, we use Newton's method to get a root of `f(x) := x² - a`. It involves building a\n // sequence x_n that converges toward sqrt(a). For each iteration x_n, we also define the error between\n // the current value as `ε_n = | x_n - sqrt(a) |`.\n //\n // For our first estimation, we consider `e` the smallest power of 2 which is bigger than the square root\n // of the target. (i.e. `2**(e-1) ≤ sqrt(a) < 2**e`). We know that `e ≤ 128` because `(2¹²⁸)² = 2²⁵⁶` is\n // bigger than any uint256.\n //\n // By noticing that\n // `2**(e-1) ≤ sqrt(a) < 2**e → (2**(e-1))² ≤ a < (2**e)² → 2**(2*e-2) ≤ a < 2**(2*e)`\n // we can deduce that `e - 1` is `log2(a) / 2`. We can thus compute `x_n = 2**(e-1)` using a method similar\n // to the msb function.\n uint256 aa = a;\n uint256 xn = 1;\n\n if (aa >= (1 << 128)) {\n aa >>= 128;\n xn <<= 64;\n }\n if (aa >= (1 << 64)) {\n aa >>= 64;\n xn <<= 32;\n }\n if (aa >= (1 << 32)) {\n aa >>= 32;\n xn <<= 16;\n }\n if (aa >= (1 << 16)) {\n aa >>= 16;\n xn <<= 8;\n }\n if (aa >= (1 << 8)) {\n aa >>= 8;\n xn <<= 4;\n }\n if (aa >= (1 << 4)) {\n aa >>= 4;\n xn <<= 2;\n }\n if (aa >= (1 << 2)) {\n xn <<= 1;\n }\n\n // We now have x_n such that `x_n = 2**(e-1) ≤ sqrt(a) < 2**e = 2 * x_n`. This implies ε_n ≤ 2**(e-1).\n //\n // We can refine our estimation by noticing that the middle of that interval minimizes the error.\n // If we move x_n to equal 2**(e-1) + 2**(e-2), then we reduce the error to ε_n ≤ 2**(e-2).\n // This is going to be our x_0 (and ε_0)\n xn = (3 * xn) >> 1; // ε_0 := | x_0 - sqrt(a) | ≤ 2**(e-2)\n\n // From here, Newton's method give us:\n // x_{n+1} = (x_n + a / x_n) / 2\n //\n // One should note that:\n // x_{n+1}² - a = ((x_n + a / x_n) / 2)² - a\n // = ((x_n² + a) / (2 * x_n))² - a\n // = (x_n⁴ + 2 * a * x_n² + a²) / (4 * x_n²) - a\n // = (x_n⁴ + 2 * a * x_n² + a² - 4 * a * x_n²) / (4 * x_n²)\n // = (x_n⁴ - 2 * a * x_n² + a²) / (4 * x_n²)\n // = (x_n² - a)² / (2 * x_n)²\n // = ((x_n² - a) / (2 * x_n))²\n // ≥ 0\n // Which proves that for all n ≥ 1, sqrt(a) ≤ x_n\n //\n // This gives us the proof of quadratic convergence of the sequence:\n // ε_{n+1} = | x_{n+1} - sqrt(a) |\n // = | (x_n + a / x_n) / 2 - sqrt(a) |\n // = | (x_n² + a - 2*x_n*sqrt(a)) / (2 * x_n) |\n // = | (x_n - sqrt(a))² / (2 * x_n) |\n // = | ε_n² / (2 * x_n) |\n // = ε_n² / | (2 * x_n) |\n //\n // For the first iteration, we have a special case where x_0 is known:\n // ε_1 = ε_0² / | (2 * x_0) |\n // ≤ (2**(e-2))² / (2 * (2**(e-1) + 2**(e-2)))\n // ≤ 2**(2*e-4) / (3 * 2**(e-1))\n // ≤ 2**(e-3) / 3\n // ≤ 2**(e-3-log2(3))\n // ≤ 2**(e-4.5)\n //\n // For the following iterations, we use the fact that, 2**(e-1) ≤ sqrt(a) ≤ x_n:\n // ε_{n+1} = ε_n² / | (2 * x_n) |\n // ≤ (2**(e-k))² / (2 * 2**(e-1))\n // ≤ 2**(2*e-2*k) / 2**e\n // ≤ 2**(e-2*k)\n xn = (xn + a / xn) >> 1; // ε_1 := | x_1 - sqrt(a) | ≤ 2**(e-4.5) -- special case, see above\n xn = (xn + a / xn) >> 1; // ε_2 := | x_2 - sqrt(a) | ≤ 2**(e-9) -- general case with k = 4.5\n xn = (xn + a / xn) >> 1; // ε_3 := | x_3 - sqrt(a) | ≤ 2**(e-18) -- general case with k = 9\n xn = (xn + a / xn) >> 1; // ε_4 := | x_4 - sqrt(a) | ≤ 2**(e-36) -- general case with k = 18\n xn = (xn + a / xn) >> 1; // ε_5 := | x_5 - sqrt(a) | ≤ 2**(e-72) -- general case with k = 36\n xn = (xn + a / xn) >> 1; // ε_6 := | x_6 - sqrt(a) | ≤ 2**(e-144) -- general case with k = 72\n\n // Because e ≤ 128 (as discussed during the first estimation phase), we know have reached a precision\n // ε_6 ≤ 2**(e-144) < 1. Given we're operating on integers, then we can ensure that xn is now either\n // sqrt(a) or sqrt(a) + 1.\n return xn - SafeCast.toUint(xn > a / xn);\n }\n }\n\n /**\n * @dev 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 + SafeCast.toUint(unsignedRoundsUp(rounding) && result * result < a);\n }\n }\n\n /**\n * @dev Return the log in base 2 of a positive value rounded towards zero.\n * Returns 0 if given 0.\n */\n function log2(uint256 value) internal pure returns (uint256) {\n uint256 result = 0;\n uint256 exp;\n unchecked {\n exp = 128 * SafeCast.toUint(value > (1 << 128) - 1);\n value >>= exp;\n result += exp;\n\n exp = 64 * SafeCast.toUint(value > (1 << 64) - 1);\n value >>= exp;\n result += exp;\n\n exp = 32 * SafeCast.toUint(value > (1 << 32) - 1);\n value >>= exp;\n result += exp;\n\n exp = 16 * SafeCast.toUint(value > (1 << 16) - 1);\n value >>= exp;\n result += exp;\n\n exp = 8 * SafeCast.toUint(value > (1 << 8) - 1);\n value >>= exp;\n result += exp;\n\n exp = 4 * SafeCast.toUint(value > (1 << 4) - 1);\n value >>= exp;\n result += exp;\n\n exp = 2 * SafeCast.toUint(value > (1 << 2) - 1);\n value >>= exp;\n result += exp;\n\n result += SafeCast.toUint(value > 1);\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 + SafeCast.toUint(unsignedRoundsUp(rounding) && 1 << result < value);\n }\n }\n\n /**\n * @dev Return the log in base 10 of a positive value rounded towards zero.\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 + SafeCast.toUint(unsignedRoundsUp(rounding) && 10 ** result < value);\n }\n }\n\n /**\n * @dev Return the log in base 256 of a positive value rounded towards zero.\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 uint256 isGt;\n unchecked {\n isGt = SafeCast.toUint(value > (1 << 128) - 1);\n value >>= isGt * 128;\n result += isGt * 16;\n\n isGt = SafeCast.toUint(value > (1 << 64) - 1);\n value >>= isGt * 64;\n result += isGt * 8;\n\n isGt = SafeCast.toUint(value > (1 << 32) - 1);\n value >>= isGt * 32;\n result += isGt * 4;\n\n isGt = SafeCast.toUint(value > (1 << 16) - 1);\n value >>= isGt * 16;\n result += isGt * 2;\n\n result += SafeCast.toUint(value > (1 << 8) - 1);\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 + SafeCast.toUint(unsignedRoundsUp(rounding) && 1 << (result << 3) < value);\n }\n }\n\n /**\n * @dev Returns whether a provided rounding mode is considered rounding up for unsigned integers.\n */\n function unsignedRoundsUp(Rounding rounding) internal pure returns (bool) {\n return uint8(rounding) % 2 == 1;\n }\n}\n" + }, + "@openzeppelin/contracts/utils/math/SafeCast.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/math/SafeCast.sol)\n// This file was procedurally generated from scripts/generate/templates/SafeCast.js.\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Wrappers over Solidity's uintXX/intXX/bool casting operators with added overflow\n * checks.\n *\n * Downcasting from uint256/int256 in Solidity does not revert on overflow. This can\n * easily result in undesired exploitation or bugs, since developers usually\n * assume that overflows raise errors. `SafeCast` restores this intuition by\n * reverting the transaction when such an operation overflows.\n *\n * Using this library instead of the unchecked operations eliminates an entire\n * class of bugs, so it's recommended to use it always.\n */\nlibrary SafeCast {\n /**\n * @dev Value doesn't fit in an uint of `bits` size.\n */\n error SafeCastOverflowedUintDowncast(uint8 bits, uint256 value);\n\n /**\n * @dev An int value doesn't fit in an uint of `bits` size.\n */\n error SafeCastOverflowedIntToUint(int256 value);\n\n /**\n * @dev Value doesn't fit in an int of `bits` size.\n */\n error SafeCastOverflowedIntDowncast(uint8 bits, int256 value);\n\n /**\n * @dev An uint value doesn't fit in an int of `bits` size.\n */\n error SafeCastOverflowedUintToInt(uint256 value);\n\n /**\n * @dev Returns the downcasted uint248 from uint256, reverting on\n * overflow (when the input is greater than largest uint248).\n *\n * Counterpart to Solidity's `uint248` operator.\n *\n * Requirements:\n *\n * - input must fit into 248 bits\n */\n function toUint248(uint256 value) internal pure returns (uint248) {\n if (value > type(uint248).max) {\n revert SafeCastOverflowedUintDowncast(248, value);\n }\n return uint248(value);\n }\n\n /**\n * @dev Returns the downcasted uint240 from uint256, reverting on\n * overflow (when the input is greater than largest uint240).\n *\n * Counterpart to Solidity's `uint240` operator.\n *\n * Requirements:\n *\n * - input must fit into 240 bits\n */\n function toUint240(uint256 value) internal pure returns (uint240) {\n if (value > type(uint240).max) {\n revert SafeCastOverflowedUintDowncast(240, value);\n }\n return uint240(value);\n }\n\n /**\n * @dev Returns the downcasted uint232 from uint256, reverting on\n * overflow (when the input is greater than largest uint232).\n *\n * Counterpart to Solidity's `uint232` operator.\n *\n * Requirements:\n *\n * - input must fit into 232 bits\n */\n function toUint232(uint256 value) internal pure returns (uint232) {\n if (value > type(uint232).max) {\n revert SafeCastOverflowedUintDowncast(232, value);\n }\n return uint232(value);\n }\n\n /**\n * @dev Returns the downcasted uint224 from uint256, reverting on\n * overflow (when the input is greater than largest uint224).\n *\n * Counterpart to Solidity's `uint224` operator.\n *\n * Requirements:\n *\n * - input must fit into 224 bits\n */\n function toUint224(uint256 value) internal pure returns (uint224) {\n if (value > type(uint224).max) {\n revert SafeCastOverflowedUintDowncast(224, value);\n }\n return uint224(value);\n }\n\n /**\n * @dev Returns the downcasted uint216 from uint256, reverting on\n * overflow (when the input is greater than largest uint216).\n *\n * Counterpart to Solidity's `uint216` operator.\n *\n * Requirements:\n *\n * - input must fit into 216 bits\n */\n function toUint216(uint256 value) internal pure returns (uint216) {\n if (value > type(uint216).max) {\n revert SafeCastOverflowedUintDowncast(216, value);\n }\n return uint216(value);\n }\n\n /**\n * @dev Returns the downcasted uint208 from uint256, reverting on\n * overflow (when the input is greater than largest uint208).\n *\n * Counterpart to Solidity's `uint208` operator.\n *\n * Requirements:\n *\n * - input must fit into 208 bits\n */\n function toUint208(uint256 value) internal pure returns (uint208) {\n if (value > type(uint208).max) {\n revert SafeCastOverflowedUintDowncast(208, value);\n }\n return uint208(value);\n }\n\n /**\n * @dev Returns the downcasted uint200 from uint256, reverting on\n * overflow (when the input is greater than largest uint200).\n *\n * Counterpart to Solidity's `uint200` operator.\n *\n * Requirements:\n *\n * - input must fit into 200 bits\n */\n function toUint200(uint256 value) internal pure returns (uint200) {\n if (value > type(uint200).max) {\n revert SafeCastOverflowedUintDowncast(200, value);\n }\n return uint200(value);\n }\n\n /**\n * @dev Returns the downcasted uint192 from uint256, reverting on\n * overflow (when the input is greater than largest uint192).\n *\n * Counterpart to Solidity's `uint192` operator.\n *\n * Requirements:\n *\n * - input must fit into 192 bits\n */\n function toUint192(uint256 value) internal pure returns (uint192) {\n if (value > type(uint192).max) {\n revert SafeCastOverflowedUintDowncast(192, value);\n }\n return uint192(value);\n }\n\n /**\n * @dev Returns the downcasted uint184 from uint256, reverting on\n * overflow (when the input is greater than largest uint184).\n *\n * Counterpart to Solidity's `uint184` operator.\n *\n * Requirements:\n *\n * - input must fit into 184 bits\n */\n function toUint184(uint256 value) internal pure returns (uint184) {\n if (value > type(uint184).max) {\n revert SafeCastOverflowedUintDowncast(184, value);\n }\n return uint184(value);\n }\n\n /**\n * @dev Returns the downcasted uint176 from uint256, reverting on\n * overflow (when the input is greater than largest uint176).\n *\n * Counterpart to Solidity's `uint176` operator.\n *\n * Requirements:\n *\n * - input must fit into 176 bits\n */\n function toUint176(uint256 value) internal pure returns (uint176) {\n if (value > type(uint176).max) {\n revert SafeCastOverflowedUintDowncast(176, value);\n }\n return uint176(value);\n }\n\n /**\n * @dev Returns the downcasted uint168 from uint256, reverting on\n * overflow (when the input is greater than largest uint168).\n *\n * Counterpart to Solidity's `uint168` operator.\n *\n * Requirements:\n *\n * - input must fit into 168 bits\n */\n function toUint168(uint256 value) internal pure returns (uint168) {\n if (value > type(uint168).max) {\n revert SafeCastOverflowedUintDowncast(168, value);\n }\n return uint168(value);\n }\n\n /**\n * @dev Returns the downcasted uint160 from uint256, reverting on\n * overflow (when the input is greater than largest uint160).\n *\n * Counterpart to Solidity's `uint160` operator.\n *\n * Requirements:\n *\n * - input must fit into 160 bits\n */\n function toUint160(uint256 value) internal pure returns (uint160) {\n if (value > type(uint160).max) {\n revert SafeCastOverflowedUintDowncast(160, value);\n }\n return uint160(value);\n }\n\n /**\n * @dev Returns the downcasted uint152 from uint256, reverting on\n * overflow (when the input is greater than largest uint152).\n *\n * Counterpart to Solidity's `uint152` operator.\n *\n * Requirements:\n *\n * - input must fit into 152 bits\n */\n function toUint152(uint256 value) internal pure returns (uint152) {\n if (value > type(uint152).max) {\n revert SafeCastOverflowedUintDowncast(152, value);\n }\n return uint152(value);\n }\n\n /**\n * @dev Returns the downcasted uint144 from uint256, reverting on\n * overflow (when the input is greater than largest uint144).\n *\n * Counterpart to Solidity's `uint144` operator.\n *\n * Requirements:\n *\n * - input must fit into 144 bits\n */\n function toUint144(uint256 value) internal pure returns (uint144) {\n if (value > type(uint144).max) {\n revert SafeCastOverflowedUintDowncast(144, value);\n }\n return uint144(value);\n }\n\n /**\n * @dev Returns the downcasted uint136 from uint256, reverting on\n * overflow (when the input is greater than largest uint136).\n *\n * Counterpart to Solidity's `uint136` operator.\n *\n * Requirements:\n *\n * - input must fit into 136 bits\n */\n function toUint136(uint256 value) internal pure returns (uint136) {\n if (value > type(uint136).max) {\n revert SafeCastOverflowedUintDowncast(136, value);\n }\n return uint136(value);\n }\n\n /**\n * @dev Returns the downcasted uint128 from uint256, reverting on\n * overflow (when the input is greater than largest uint128).\n *\n * Counterpart to Solidity's `uint128` operator.\n *\n * Requirements:\n *\n * - input must fit into 128 bits\n */\n function toUint128(uint256 value) internal pure returns (uint128) {\n if (value > type(uint128).max) {\n revert SafeCastOverflowedUintDowncast(128, value);\n }\n return uint128(value);\n }\n\n /**\n * @dev Returns the downcasted uint120 from uint256, reverting on\n * overflow (when the input is greater than largest uint120).\n *\n * Counterpart to Solidity's `uint120` operator.\n *\n * Requirements:\n *\n * - input must fit into 120 bits\n */\n function toUint120(uint256 value) internal pure returns (uint120) {\n if (value > type(uint120).max) {\n revert SafeCastOverflowedUintDowncast(120, value);\n }\n return uint120(value);\n }\n\n /**\n * @dev Returns the downcasted uint112 from uint256, reverting on\n * overflow (when the input is greater than largest uint112).\n *\n * Counterpart to Solidity's `uint112` operator.\n *\n * Requirements:\n *\n * - input must fit into 112 bits\n */\n function toUint112(uint256 value) internal pure returns (uint112) {\n if (value > type(uint112).max) {\n revert SafeCastOverflowedUintDowncast(112, value);\n }\n return uint112(value);\n }\n\n /**\n * @dev Returns the downcasted uint104 from uint256, reverting on\n * overflow (when the input is greater than largest uint104).\n *\n * Counterpart to Solidity's `uint104` operator.\n *\n * Requirements:\n *\n * - input must fit into 104 bits\n */\n function toUint104(uint256 value) internal pure returns (uint104) {\n if (value > type(uint104).max) {\n revert SafeCastOverflowedUintDowncast(104, value);\n }\n return uint104(value);\n }\n\n /**\n * @dev Returns the downcasted uint96 from uint256, reverting on\n * overflow (when the input is greater than largest uint96).\n *\n * Counterpart to Solidity's `uint96` operator.\n *\n * Requirements:\n *\n * - input must fit into 96 bits\n */\n function toUint96(uint256 value) internal pure returns (uint96) {\n if (value > type(uint96).max) {\n revert SafeCastOverflowedUintDowncast(96, value);\n }\n return uint96(value);\n }\n\n /**\n * @dev Returns the downcasted uint88 from uint256, reverting on\n * overflow (when the input is greater than largest uint88).\n *\n * Counterpart to Solidity's `uint88` operator.\n *\n * Requirements:\n *\n * - input must fit into 88 bits\n */\n function toUint88(uint256 value) internal pure returns (uint88) {\n if (value > type(uint88).max) {\n revert SafeCastOverflowedUintDowncast(88, value);\n }\n return uint88(value);\n }\n\n /**\n * @dev Returns the downcasted uint80 from uint256, reverting on\n * overflow (when the input is greater than largest uint80).\n *\n * Counterpart to Solidity's `uint80` operator.\n *\n * Requirements:\n *\n * - input must fit into 80 bits\n */\n function toUint80(uint256 value) internal pure returns (uint80) {\n if (value > type(uint80).max) {\n revert SafeCastOverflowedUintDowncast(80, value);\n }\n return uint80(value);\n }\n\n /**\n * @dev Returns the downcasted uint72 from uint256, reverting on\n * overflow (when the input is greater than largest uint72).\n *\n * Counterpart to Solidity's `uint72` operator.\n *\n * Requirements:\n *\n * - input must fit into 72 bits\n */\n function toUint72(uint256 value) internal pure returns (uint72) {\n if (value > type(uint72).max) {\n revert SafeCastOverflowedUintDowncast(72, value);\n }\n return uint72(value);\n }\n\n /**\n * @dev Returns the downcasted uint64 from uint256, reverting on\n * overflow (when the input is greater than largest uint64).\n *\n * Counterpart to Solidity's `uint64` operator.\n *\n * Requirements:\n *\n * - input must fit into 64 bits\n */\n function toUint64(uint256 value) internal pure returns (uint64) {\n if (value > type(uint64).max) {\n revert SafeCastOverflowedUintDowncast(64, value);\n }\n return uint64(value);\n }\n\n /**\n * @dev Returns the downcasted uint56 from uint256, reverting on\n * overflow (when the input is greater than largest uint56).\n *\n * Counterpart to Solidity's `uint56` operator.\n *\n * Requirements:\n *\n * - input must fit into 56 bits\n */\n function toUint56(uint256 value) internal pure returns (uint56) {\n if (value > type(uint56).max) {\n revert SafeCastOverflowedUintDowncast(56, value);\n }\n return uint56(value);\n }\n\n /**\n * @dev Returns the downcasted uint48 from uint256, reverting on\n * overflow (when the input is greater than largest uint48).\n *\n * Counterpart to Solidity's `uint48` operator.\n *\n * Requirements:\n *\n * - input must fit into 48 bits\n */\n function toUint48(uint256 value) internal pure returns (uint48) {\n if (value > type(uint48).max) {\n revert SafeCastOverflowedUintDowncast(48, value);\n }\n return uint48(value);\n }\n\n /**\n * @dev Returns the downcasted uint40 from uint256, reverting on\n * overflow (when the input is greater than largest uint40).\n *\n * Counterpart to Solidity's `uint40` operator.\n *\n * Requirements:\n *\n * - input must fit into 40 bits\n */\n function toUint40(uint256 value) internal pure returns (uint40) {\n if (value > type(uint40).max) {\n revert SafeCastOverflowedUintDowncast(40, value);\n }\n return uint40(value);\n }\n\n /**\n * @dev Returns the downcasted uint32 from uint256, reverting on\n * overflow (when the input is greater than largest uint32).\n *\n * Counterpart to Solidity's `uint32` operator.\n *\n * Requirements:\n *\n * - input must fit into 32 bits\n */\n function toUint32(uint256 value) internal pure returns (uint32) {\n if (value > type(uint32).max) {\n revert SafeCastOverflowedUintDowncast(32, value);\n }\n return uint32(value);\n }\n\n /**\n * @dev Returns the downcasted uint24 from uint256, reverting on\n * overflow (when the input is greater than largest uint24).\n *\n * Counterpart to Solidity's `uint24` operator.\n *\n * Requirements:\n *\n * - input must fit into 24 bits\n */\n function toUint24(uint256 value) internal pure returns (uint24) {\n if (value > type(uint24).max) {\n revert SafeCastOverflowedUintDowncast(24, value);\n }\n return uint24(value);\n }\n\n /**\n * @dev Returns the downcasted uint16 from uint256, reverting on\n * overflow (when the input is greater than largest uint16).\n *\n * Counterpart to Solidity's `uint16` operator.\n *\n * Requirements:\n *\n * - input must fit into 16 bits\n */\n function toUint16(uint256 value) internal pure returns (uint16) {\n if (value > type(uint16).max) {\n revert SafeCastOverflowedUintDowncast(16, value);\n }\n return uint16(value);\n }\n\n /**\n * @dev Returns the downcasted uint8 from uint256, reverting on\n * overflow (when the input is greater than largest uint8).\n *\n * Counterpart to Solidity's `uint8` operator.\n *\n * Requirements:\n *\n * - input must fit into 8 bits\n */\n function toUint8(uint256 value) internal pure returns (uint8) {\n if (value > type(uint8).max) {\n revert SafeCastOverflowedUintDowncast(8, value);\n }\n return uint8(value);\n }\n\n /**\n * @dev Converts a signed int256 into an unsigned uint256.\n *\n * Requirements:\n *\n * - input must be greater than or equal to 0.\n */\n function toUint256(int256 value) internal pure returns (uint256) {\n if (value < 0) {\n revert SafeCastOverflowedIntToUint(value);\n }\n return uint256(value);\n }\n\n /**\n * @dev Returns the downcasted int248 from int256, reverting on\n * overflow (when the input is less than smallest int248 or\n * greater than largest int248).\n *\n * Counterpart to Solidity's `int248` operator.\n *\n * Requirements:\n *\n * - input must fit into 248 bits\n */\n function toInt248(int256 value) internal pure returns (int248 downcasted) {\n downcasted = int248(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(248, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int240 from int256, reverting on\n * overflow (when the input is less than smallest int240 or\n * greater than largest int240).\n *\n * Counterpart to Solidity's `int240` operator.\n *\n * Requirements:\n *\n * - input must fit into 240 bits\n */\n function toInt240(int256 value) internal pure returns (int240 downcasted) {\n downcasted = int240(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(240, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int232 from int256, reverting on\n * overflow (when the input is less than smallest int232 or\n * greater than largest int232).\n *\n * Counterpart to Solidity's `int232` operator.\n *\n * Requirements:\n *\n * - input must fit into 232 bits\n */\n function toInt232(int256 value) internal pure returns (int232 downcasted) {\n downcasted = int232(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(232, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int224 from int256, reverting on\n * overflow (when the input is less than smallest int224 or\n * greater than largest int224).\n *\n * Counterpart to Solidity's `int224` operator.\n *\n * Requirements:\n *\n * - input must fit into 224 bits\n */\n function toInt224(int256 value) internal pure returns (int224 downcasted) {\n downcasted = int224(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(224, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int216 from int256, reverting on\n * overflow (when the input is less than smallest int216 or\n * greater than largest int216).\n *\n * Counterpart to Solidity's `int216` operator.\n *\n * Requirements:\n *\n * - input must fit into 216 bits\n */\n function toInt216(int256 value) internal pure returns (int216 downcasted) {\n downcasted = int216(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(216, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int208 from int256, reverting on\n * overflow (when the input is less than smallest int208 or\n * greater than largest int208).\n *\n * Counterpart to Solidity's `int208` operator.\n *\n * Requirements:\n *\n * - input must fit into 208 bits\n */\n function toInt208(int256 value) internal pure returns (int208 downcasted) {\n downcasted = int208(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(208, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int200 from int256, reverting on\n * overflow (when the input is less than smallest int200 or\n * greater than largest int200).\n *\n * Counterpart to Solidity's `int200` operator.\n *\n * Requirements:\n *\n * - input must fit into 200 bits\n */\n function toInt200(int256 value) internal pure returns (int200 downcasted) {\n downcasted = int200(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(200, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int192 from int256, reverting on\n * overflow (when the input is less than smallest int192 or\n * greater than largest int192).\n *\n * Counterpart to Solidity's `int192` operator.\n *\n * Requirements:\n *\n * - input must fit into 192 bits\n */\n function toInt192(int256 value) internal pure returns (int192 downcasted) {\n downcasted = int192(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(192, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int184 from int256, reverting on\n * overflow (when the input is less than smallest int184 or\n * greater than largest int184).\n *\n * Counterpart to Solidity's `int184` operator.\n *\n * Requirements:\n *\n * - input must fit into 184 bits\n */\n function toInt184(int256 value) internal pure returns (int184 downcasted) {\n downcasted = int184(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(184, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int176 from int256, reverting on\n * overflow (when the input is less than smallest int176 or\n * greater than largest int176).\n *\n * Counterpart to Solidity's `int176` operator.\n *\n * Requirements:\n *\n * - input must fit into 176 bits\n */\n function toInt176(int256 value) internal pure returns (int176 downcasted) {\n downcasted = int176(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(176, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int168 from int256, reverting on\n * overflow (when the input is less than smallest int168 or\n * greater than largest int168).\n *\n * Counterpart to Solidity's `int168` operator.\n *\n * Requirements:\n *\n * - input must fit into 168 bits\n */\n function toInt168(int256 value) internal pure returns (int168 downcasted) {\n downcasted = int168(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(168, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int160 from int256, reverting on\n * overflow (when the input is less than smallest int160 or\n * greater than largest int160).\n *\n * Counterpart to Solidity's `int160` operator.\n *\n * Requirements:\n *\n * - input must fit into 160 bits\n */\n function toInt160(int256 value) internal pure returns (int160 downcasted) {\n downcasted = int160(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(160, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int152 from int256, reverting on\n * overflow (when the input is less than smallest int152 or\n * greater than largest int152).\n *\n * Counterpart to Solidity's `int152` operator.\n *\n * Requirements:\n *\n * - input must fit into 152 bits\n */\n function toInt152(int256 value) internal pure returns (int152 downcasted) {\n downcasted = int152(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(152, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int144 from int256, reverting on\n * overflow (when the input is less than smallest int144 or\n * greater than largest int144).\n *\n * Counterpart to Solidity's `int144` operator.\n *\n * Requirements:\n *\n * - input must fit into 144 bits\n */\n function toInt144(int256 value) internal pure returns (int144 downcasted) {\n downcasted = int144(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(144, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int136 from int256, reverting on\n * overflow (when the input is less than smallest int136 or\n * greater than largest int136).\n *\n * Counterpart to Solidity's `int136` operator.\n *\n * Requirements:\n *\n * - input must fit into 136 bits\n */\n function toInt136(int256 value) internal pure returns (int136 downcasted) {\n downcasted = int136(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(136, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int128 from int256, reverting on\n * overflow (when the input is less than smallest int128 or\n * greater than largest int128).\n *\n * Counterpart to Solidity's `int128` operator.\n *\n * Requirements:\n *\n * - input must fit into 128 bits\n */\n function toInt128(int256 value) internal pure returns (int128 downcasted) {\n downcasted = int128(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(128, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int120 from int256, reverting on\n * overflow (when the input is less than smallest int120 or\n * greater than largest int120).\n *\n * Counterpart to Solidity's `int120` operator.\n *\n * Requirements:\n *\n * - input must fit into 120 bits\n */\n function toInt120(int256 value) internal pure returns (int120 downcasted) {\n downcasted = int120(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(120, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int112 from int256, reverting on\n * overflow (when the input is less than smallest int112 or\n * greater than largest int112).\n *\n * Counterpart to Solidity's `int112` operator.\n *\n * Requirements:\n *\n * - input must fit into 112 bits\n */\n function toInt112(int256 value) internal pure returns (int112 downcasted) {\n downcasted = int112(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(112, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int104 from int256, reverting on\n * overflow (when the input is less than smallest int104 or\n * greater than largest int104).\n *\n * Counterpart to Solidity's `int104` operator.\n *\n * Requirements:\n *\n * - input must fit into 104 bits\n */\n function toInt104(int256 value) internal pure returns (int104 downcasted) {\n downcasted = int104(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(104, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int96 from int256, reverting on\n * overflow (when the input is less than smallest int96 or\n * greater than largest int96).\n *\n * Counterpart to Solidity's `int96` operator.\n *\n * Requirements:\n *\n * - input must fit into 96 bits\n */\n function toInt96(int256 value) internal pure returns (int96 downcasted) {\n downcasted = int96(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(96, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int88 from int256, reverting on\n * overflow (when the input is less than smallest int88 or\n * greater than largest int88).\n *\n * Counterpart to Solidity's `int88` operator.\n *\n * Requirements:\n *\n * - input must fit into 88 bits\n */\n function toInt88(int256 value) internal pure returns (int88 downcasted) {\n downcasted = int88(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(88, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int80 from int256, reverting on\n * overflow (when the input is less than smallest int80 or\n * greater than largest int80).\n *\n * Counterpart to Solidity's `int80` operator.\n *\n * Requirements:\n *\n * - input must fit into 80 bits\n */\n function toInt80(int256 value) internal pure returns (int80 downcasted) {\n downcasted = int80(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(80, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int72 from int256, reverting on\n * overflow (when the input is less than smallest int72 or\n * greater than largest int72).\n *\n * Counterpart to Solidity's `int72` operator.\n *\n * Requirements:\n *\n * - input must fit into 72 bits\n */\n function toInt72(int256 value) internal pure returns (int72 downcasted) {\n downcasted = int72(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(72, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int64 from int256, reverting on\n * overflow (when the input is less than smallest int64 or\n * greater than largest int64).\n *\n * Counterpart to Solidity's `int64` operator.\n *\n * Requirements:\n *\n * - input must fit into 64 bits\n */\n function toInt64(int256 value) internal pure returns (int64 downcasted) {\n downcasted = int64(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(64, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int56 from int256, reverting on\n * overflow (when the input is less than smallest int56 or\n * greater than largest int56).\n *\n * Counterpart to Solidity's `int56` operator.\n *\n * Requirements:\n *\n * - input must fit into 56 bits\n */\n function toInt56(int256 value) internal pure returns (int56 downcasted) {\n downcasted = int56(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(56, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int48 from int256, reverting on\n * overflow (when the input is less than smallest int48 or\n * greater than largest int48).\n *\n * Counterpart to Solidity's `int48` operator.\n *\n * Requirements:\n *\n * - input must fit into 48 bits\n */\n function toInt48(int256 value) internal pure returns (int48 downcasted) {\n downcasted = int48(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(48, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int40 from int256, reverting on\n * overflow (when the input is less than smallest int40 or\n * greater than largest int40).\n *\n * Counterpart to Solidity's `int40` operator.\n *\n * Requirements:\n *\n * - input must fit into 40 bits\n */\n function toInt40(int256 value) internal pure returns (int40 downcasted) {\n downcasted = int40(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(40, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int32 from int256, reverting on\n * overflow (when the input is less than smallest int32 or\n * greater than largest int32).\n *\n * Counterpart to Solidity's `int32` operator.\n *\n * Requirements:\n *\n * - input must fit into 32 bits\n */\n function toInt32(int256 value) internal pure returns (int32 downcasted) {\n downcasted = int32(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(32, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int24 from int256, reverting on\n * overflow (when the input is less than smallest int24 or\n * greater than largest int24).\n *\n * Counterpart to Solidity's `int24` operator.\n *\n * Requirements:\n *\n * - input must fit into 24 bits\n */\n function toInt24(int256 value) internal pure returns (int24 downcasted) {\n downcasted = int24(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(24, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int16 from int256, reverting on\n * overflow (when the input is less than smallest int16 or\n * greater than largest int16).\n *\n * Counterpart to Solidity's `int16` operator.\n *\n * Requirements:\n *\n * - input must fit into 16 bits\n */\n function toInt16(int256 value) internal pure returns (int16 downcasted) {\n downcasted = int16(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(16, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int8 from int256, reverting on\n * overflow (when the input is less than smallest int8 or\n * greater than largest int8).\n *\n * Counterpart to Solidity's `int8` operator.\n *\n * Requirements:\n *\n * - input must fit into 8 bits\n */\n function toInt8(int256 value) internal pure returns (int8 downcasted) {\n downcasted = int8(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(8, value);\n }\n }\n\n /**\n * @dev Converts an unsigned uint256 into a signed int256.\n *\n * Requirements:\n *\n * - input must be less than or equal to maxInt256.\n */\n function toInt256(uint256 value) internal pure returns (int256) {\n // Note: Unsafe cast below is okay because `type(int256).max` is guaranteed to be positive\n if (value > uint256(type(int256).max)) {\n revert SafeCastOverflowedUintToInt(value);\n }\n return int256(value);\n }\n\n /**\n * @dev Cast a boolean (false or true) to a uint256 (0 or 1) with no jump.\n */\n function toUint(bool b) internal pure returns (uint256 u) {\n assembly (\"memory-safe\") {\n u := iszero(iszero(b))\n }\n }\n}\n" + }, + "@openzeppelin/contracts/utils/math/SignedMath.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/math/SignedMath.sol)\n\npragma solidity ^0.8.20;\n\nimport {SafeCast} from \"./SafeCast.sol\";\n\n/**\n * @dev Standard signed math utilities missing in the Solidity language.\n */\nlibrary SignedMath {\n /**\n * @dev Branchless ternary evaluation for `a ? b : c`. Gas costs are constant.\n *\n * IMPORTANT: This function may reduce bytecode size and consume less gas when used standalone.\n * However, the compiler may optimize Solidity ternary operations (i.e. `a ? b : c`) to only compute\n * one branch when needed, making this function more expensive.\n */\n function ternary(bool condition, int256 a, int256 b) internal pure returns (int256) {\n unchecked {\n // branchless ternary works because:\n // b ^ (a ^ b) == a\n // b ^ 0 == b\n return b ^ ((a ^ b) * int256(SafeCast.toUint(condition)));\n }\n }\n\n /**\n * @dev Returns the largest of two signed numbers.\n */\n function max(int256 a, int256 b) internal pure returns (int256) {\n return ternary(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 ternary(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 // Formula from the \"Bit Twiddling Hacks\" by Sean Eron Anderson.\n // Since `n` is a signed integer, the generated bytecode will use the SAR opcode to perform the right shift,\n // taking advantage of the most significant (or \"sign\" bit) in two's complement representation.\n // This opcode adds new most significant bits set to the value of the previous most significant bit. As a result,\n // the mask will either be `bytes32(0)` (if n is positive) or `~bytes32(0)` (if n is negative).\n int256 mask = n >> 255;\n\n // A `bytes32(0)` mask leaves the input unchanged, while a `~bytes32(0)` mask complements it.\n return uint256((n + mask) ^ mask);\n }\n }\n}\n" + }, + "@openzeppelin/contracts/utils/Nonces.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/Nonces.sol)\npragma solidity ^0.8.20;\n\n/**\n * @dev Provides tracking nonces for addresses. Nonces will only increment.\n */\nabstract contract Nonces {\n /**\n * @dev The nonce used for an `account` is not the expected current nonce.\n */\n error InvalidAccountNonce(address account, uint256 currentNonce);\n\n mapping(address account => uint256) private _nonces;\n\n /**\n * @dev Returns the next unused nonce for an address.\n */\n function nonces(address owner) public view virtual returns (uint256) {\n return _nonces[owner];\n }\n\n /**\n * @dev Consumes a nonce.\n *\n * Returns the current value and increments nonce.\n */\n function _useNonce(address owner) internal virtual returns (uint256) {\n // For each account, the nonce has an initial value of 0, can only be incremented by one, and cannot be\n // decremented or reset. This guarantees that the nonce never overflows.\n unchecked {\n // It is important to do x++ and not ++x here.\n return _nonces[owner]++;\n }\n }\n\n /**\n * @dev Same as {_useNonce} but checking that `nonce` is the next valid for `owner`.\n */\n function _useCheckedNonce(address owner, uint256 nonce) internal virtual {\n uint256 current = _useNonce(owner);\n if (nonce != current) {\n revert InvalidAccountNonce(owner, current);\n }\n }\n}\n" + }, + "@openzeppelin/contracts/utils/Panic.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/Panic.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Helper library for emitting standardized panic codes.\n *\n * ```solidity\n * contract Example {\n * using Panic for uint256;\n *\n * // Use any of the declared internal constants\n * function foo() { Panic.GENERIC.panic(); }\n *\n * // Alternatively\n * function foo() { Panic.panic(Panic.GENERIC); }\n * }\n * ```\n *\n * Follows the list from https://github.com/ethereum/solidity/blob/v0.8.24/libsolutil/ErrorCodes.h[libsolutil].\n *\n * _Available since v5.1._\n */\n// slither-disable-next-line unused-state\nlibrary Panic {\n /// @dev generic / unspecified error\n uint256 internal constant GENERIC = 0x00;\n /// @dev used by the assert() builtin\n uint256 internal constant ASSERT = 0x01;\n /// @dev arithmetic underflow or overflow\n uint256 internal constant UNDER_OVERFLOW = 0x11;\n /// @dev division or modulo by zero\n uint256 internal constant DIVISION_BY_ZERO = 0x12;\n /// @dev enum conversion error\n uint256 internal constant ENUM_CONVERSION_ERROR = 0x21;\n /// @dev invalid encoding in storage\n uint256 internal constant STORAGE_ENCODING_ERROR = 0x22;\n /// @dev empty array pop\n uint256 internal constant EMPTY_ARRAY_POP = 0x31;\n /// @dev array out of bounds access\n uint256 internal constant ARRAY_OUT_OF_BOUNDS = 0x32;\n /// @dev resource error (too large allocation or too large array)\n uint256 internal constant RESOURCE_ERROR = 0x41;\n /// @dev calling invalid internal function\n uint256 internal constant INVALID_INTERNAL_FUNCTION = 0x51;\n\n /// @dev Reverts with a panic code. Recommended to use with\n /// the internal constants with predefined codes.\n function panic(uint256 code) internal pure {\n assembly (\"memory-safe\") {\n mstore(0x00, 0x4e487b71)\n mstore(0x20, code)\n revert(0x1c, 0x24)\n }\n }\n}\n" + }, + "@openzeppelin/contracts/utils/ShortStrings.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/ShortStrings.sol)\n\npragma solidity ^0.8.20;\n\nimport {StorageSlot} from \"./StorageSlot.sol\";\n\n// | string | 0xAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA |\n// | length | 0x BB |\ntype ShortString is bytes32;\n\n/**\n * @dev This library provides functions to convert short memory strings\n * into a `ShortString` type that can be used as an immutable variable.\n *\n * Strings of arbitrary length can be optimized using this library if\n * they are short enough (up to 31 bytes) by packing them with their\n * length (1 byte) in a single EVM word (32 bytes). Additionally, a\n * fallback mechanism can be used for every other case.\n *\n * Usage example:\n *\n * ```solidity\n * contract Named {\n * using ShortStrings for *;\n *\n * ShortString private immutable _name;\n * string private _nameFallback;\n *\n * constructor(string memory contractName) {\n * _name = contractName.toShortStringWithFallback(_nameFallback);\n * }\n *\n * function name() external view returns (string memory) {\n * return _name.toStringWithFallback(_nameFallback);\n * }\n * }\n * ```\n */\nlibrary ShortStrings {\n // Used as an identifier for strings longer than 31 bytes.\n bytes32 private constant FALLBACK_SENTINEL = 0x00000000000000000000000000000000000000000000000000000000000000FF;\n\n error StringTooLong(string str);\n error InvalidShortString();\n\n /**\n * @dev Encode a string of at most 31 chars into a `ShortString`.\n *\n * This will trigger a `StringTooLong` error is the input string is too long.\n */\n function toShortString(string memory str) internal pure returns (ShortString) {\n bytes memory bstr = bytes(str);\n if (bstr.length > 31) {\n revert StringTooLong(str);\n }\n return ShortString.wrap(bytes32(uint256(bytes32(bstr)) | bstr.length));\n }\n\n /**\n * @dev Decode a `ShortString` back to a \"normal\" string.\n */\n function toString(ShortString sstr) internal pure returns (string memory) {\n uint256 len = byteLength(sstr);\n // using `new string(len)` would work locally but is not memory safe.\n string memory str = new string(32);\n assembly (\"memory-safe\") {\n mstore(str, len)\n mstore(add(str, 0x20), sstr)\n }\n return str;\n }\n\n /**\n * @dev Return the length of a `ShortString`.\n */\n function byteLength(ShortString sstr) internal pure returns (uint256) {\n uint256 result = uint256(ShortString.unwrap(sstr)) & 0xFF;\n if (result > 31) {\n revert InvalidShortString();\n }\n return result;\n }\n\n /**\n * @dev Encode a string into a `ShortString`, or write it to storage if it is too long.\n */\n function toShortStringWithFallback(string memory value, string storage store) internal returns (ShortString) {\n if (bytes(value).length < 32) {\n return toShortString(value);\n } else {\n StorageSlot.getStringSlot(store).value = value;\n return ShortString.wrap(FALLBACK_SENTINEL);\n }\n }\n\n /**\n * @dev Decode a string that was encoded to `ShortString` or written to storage using {setWithFallback}.\n */\n function toStringWithFallback(ShortString value, string storage store) internal pure returns (string memory) {\n if (ShortString.unwrap(value) != FALLBACK_SENTINEL) {\n return toString(value);\n } else {\n return store;\n }\n }\n\n /**\n * @dev Return the length of a string that was encoded to `ShortString` or written to storage using\n * {setWithFallback}.\n *\n * WARNING: This will return the \"byte length\" of the string. This may not reflect the actual length in terms of\n * actual characters as the UTF-8 encoding of a single character can span over multiple bytes.\n */\n function byteLengthWithFallback(ShortString value, string storage store) internal view returns (uint256) {\n if (ShortString.unwrap(value) != FALLBACK_SENTINEL) {\n return byteLength(value);\n } else {\n return bytes(store).length;\n }\n }\n}\n" + }, + "@openzeppelin/contracts/utils/StorageSlot.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/StorageSlot.sol)\n// This file was procedurally generated from scripts/generate/templates/StorageSlot.js.\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Library for reading and writing primitive types to specific storage slots.\n *\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\n * This library helps with reading and writing to such slots without the need for inline assembly.\n *\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\n *\n * Example usage to set ERC-1967 implementation slot:\n * ```solidity\n * contract ERC1967 {\n * // Define the slot. Alternatively, use the SlotDerivation library to derive the slot.\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\n *\n * function _getImplementation() internal view returns (address) {\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\n * }\n *\n * function _setImplementation(address newImplementation) internal {\n * require(newImplementation.code.length > 0);\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\n * }\n * }\n * ```\n *\n * TIP: Consider using this library along with {SlotDerivation}.\n */\nlibrary StorageSlot {\n struct AddressSlot {\n address value;\n }\n\n struct BooleanSlot {\n bool value;\n }\n\n struct Bytes32Slot {\n bytes32 value;\n }\n\n struct Uint256Slot {\n uint256 value;\n }\n\n struct Int256Slot {\n int256 value;\n }\n\n struct StringSlot {\n string value;\n }\n\n struct BytesSlot {\n bytes value;\n }\n\n /**\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\n */\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\n assembly (\"memory-safe\") {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns a `BooleanSlot` with member `value` located at `slot`.\n */\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\n assembly (\"memory-safe\") {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns a `Bytes32Slot` with member `value` located at `slot`.\n */\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\n assembly (\"memory-safe\") {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns a `Uint256Slot` with member `value` located at `slot`.\n */\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\n assembly (\"memory-safe\") {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns a `Int256Slot` with member `value` located at `slot`.\n */\n function getInt256Slot(bytes32 slot) internal pure returns (Int256Slot storage r) {\n assembly (\"memory-safe\") {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns a `StringSlot` with member `value` located at `slot`.\n */\n function getStringSlot(bytes32 slot) internal pure returns (StringSlot storage r) {\n assembly (\"memory-safe\") {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `StringSlot` representation of the string storage pointer `store`.\n */\n function getStringSlot(string storage store) internal pure returns (StringSlot storage r) {\n assembly (\"memory-safe\") {\n r.slot := store.slot\n }\n }\n\n /**\n * @dev Returns a `BytesSlot` with member `value` located at `slot`.\n */\n function getBytesSlot(bytes32 slot) internal pure returns (BytesSlot storage r) {\n assembly (\"memory-safe\") {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `BytesSlot` representation of the bytes storage pointer `store`.\n */\n function getBytesSlot(bytes storage store) internal pure returns (BytesSlot storage r) {\n assembly (\"memory-safe\") {\n r.slot := store.slot\n }\n }\n}\n" + }, + "@openzeppelin/contracts/utils/Strings.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/Strings.sol)\n\npragma solidity ^0.8.20;\n\nimport {Math} from \"./math/Math.sol\";\nimport {SignedMath} from \"./math/SignedMath.sol\";\n\n/**\n * @dev String operations.\n */\nlibrary Strings {\n bytes16 private constant HEX_DIGITS = \"0123456789abcdef\";\n uint8 private constant ADDRESS_LENGTH = 20;\n\n /**\n * @dev The `value` string doesn't fit in the specified `length`.\n */\n error StringsInsufficientHexLength(uint256 value, uint256 length);\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 assembly (\"memory-safe\") {\n ptr := add(buffer, add(32, length))\n }\n while (true) {\n ptr--;\n assembly (\"memory-safe\") {\n mstore8(ptr, byte(mod(value, 10), HEX_DIGITS))\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 toStringSigned(int256 value) internal pure returns (string memory) {\n return string.concat(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 uint256 localValue = value;\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] = HEX_DIGITS[localValue & 0xf];\n localValue >>= 4;\n }\n if (localValue != 0) {\n revert StringsInsufficientHexLength(value, length);\n }\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\n * 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 Converts an `address` with fixed length of 20 bytes to its checksummed ASCII `string` hexadecimal\n * representation, according to EIP-55.\n */\n function toChecksumHexString(address addr) internal pure returns (string memory) {\n bytes memory buffer = bytes(toHexString(addr));\n\n // hash the hex part of buffer (skip length + 2 bytes, length 40)\n uint256 hashValue;\n assembly (\"memory-safe\") {\n hashValue := shr(96, keccak256(add(buffer, 0x22), 40))\n }\n\n for (uint256 i = 41; i > 1; --i) {\n // possible values for buffer[i] are 48 (0) to 57 (9) and 97 (a) to 102 (f)\n if (hashValue & 0xf > 7 && uint8(buffer[i]) > 96) {\n // case shift by xoring with 0x20\n buffer[i] ^= 0x20;\n }\n hashValue >>= 4;\n }\n return string(buffer);\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 bytes(a).length == bytes(b).length && keccak256(bytes(a)) == keccak256(bytes(b));\n }\n}\n" + }, + "@openzeppelin/contracts/utils/structs/Checkpoints.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/structs/Checkpoints.sol)\n// This file was procedurally generated from scripts/generate/templates/Checkpoints.js.\n\npragma solidity ^0.8.20;\n\nimport {Math} from \"../math/Math.sol\";\n\n/**\n * @dev This library defines the `Trace*` struct, for checkpointing values as they change at different points in\n * time, and later looking up past values by block number. See {Votes} as an example.\n *\n * To create a history of checkpoints define a variable type `Checkpoints.Trace*` in your contract, and store a new\n * checkpoint for the current transaction block using the {push} function.\n */\nlibrary Checkpoints {\n /**\n * @dev A value was attempted to be inserted on a past checkpoint.\n */\n error CheckpointUnorderedInsertion();\n\n struct Trace224 {\n Checkpoint224[] _checkpoints;\n }\n\n struct Checkpoint224 {\n uint32 _key;\n uint224 _value;\n }\n\n /**\n * @dev Pushes a (`key`, `value`) pair into a Trace224 so that it is stored as the checkpoint.\n *\n * Returns previous value and new value.\n *\n * IMPORTANT: Never accept `key` as a user input, since an arbitrary `type(uint32).max` key set will disable the\n * library.\n */\n function push(\n Trace224 storage self,\n uint32 key,\n uint224 value\n ) internal returns (uint224 oldValue, uint224 newValue) {\n return _insert(self._checkpoints, key, value);\n }\n\n /**\n * @dev Returns the value in the first (oldest) checkpoint with key greater or equal than the search key, or zero if\n * there is none.\n */\n function lowerLookup(Trace224 storage self, uint32 key) internal view returns (uint224) {\n uint256 len = self._checkpoints.length;\n uint256 pos = _lowerBinaryLookup(self._checkpoints, key, 0, len);\n return pos == len ? 0 : _unsafeAccess(self._checkpoints, pos)._value;\n }\n\n /**\n * @dev Returns the value in the last (most recent) checkpoint with key lower or equal than the search key, or zero\n * if there is none.\n */\n function upperLookup(Trace224 storage self, uint32 key) internal view returns (uint224) {\n uint256 len = self._checkpoints.length;\n uint256 pos = _upperBinaryLookup(self._checkpoints, key, 0, len);\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\n }\n\n /**\n * @dev Returns the value in the last (most recent) checkpoint with key lower or equal than the search key, or zero\n * if there is none.\n *\n * NOTE: This is a variant of {upperLookup} that is optimised to find \"recent\" checkpoint (checkpoints with high\n * keys).\n */\n function upperLookupRecent(Trace224 storage self, uint32 key) internal view returns (uint224) {\n uint256 len = self._checkpoints.length;\n\n uint256 low = 0;\n uint256 high = len;\n\n if (len > 5) {\n uint256 mid = len - Math.sqrt(len);\n if (key < _unsafeAccess(self._checkpoints, mid)._key) {\n high = mid;\n } else {\n low = mid + 1;\n }\n }\n\n uint256 pos = _upperBinaryLookup(self._checkpoints, key, low, high);\n\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\n }\n\n /**\n * @dev Returns the value in the most recent checkpoint, or zero if there are no checkpoints.\n */\n function latest(Trace224 storage self) internal view returns (uint224) {\n uint256 pos = self._checkpoints.length;\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\n }\n\n /**\n * @dev Returns whether there is a checkpoint in the structure (i.e. it is not empty), and if so the key and value\n * in the most recent checkpoint.\n */\n function latestCheckpoint(Trace224 storage self) internal view returns (bool exists, uint32 _key, uint224 _value) {\n uint256 pos = self._checkpoints.length;\n if (pos == 0) {\n return (false, 0, 0);\n } else {\n Checkpoint224 storage ckpt = _unsafeAccess(self._checkpoints, pos - 1);\n return (true, ckpt._key, ckpt._value);\n }\n }\n\n /**\n * @dev Returns the number of checkpoint.\n */\n function length(Trace224 storage self) internal view returns (uint256) {\n return self._checkpoints.length;\n }\n\n /**\n * @dev Returns checkpoint at given position.\n */\n function at(Trace224 storage self, uint32 pos) internal view returns (Checkpoint224 memory) {\n return self._checkpoints[pos];\n }\n\n /**\n * @dev Pushes a (`key`, `value`) pair into an ordered list of checkpoints, either by inserting a new checkpoint,\n * or by updating the last one.\n */\n function _insert(\n Checkpoint224[] storage self,\n uint32 key,\n uint224 value\n ) private returns (uint224 oldValue, uint224 newValue) {\n uint256 pos = self.length;\n\n if (pos > 0) {\n Checkpoint224 storage last = _unsafeAccess(self, pos - 1);\n uint32 lastKey = last._key;\n uint224 lastValue = last._value;\n\n // Checkpoint keys must be non-decreasing.\n if (lastKey > key) {\n revert CheckpointUnorderedInsertion();\n }\n\n // Update or push new checkpoint\n if (lastKey == key) {\n last._value = value;\n } else {\n self.push(Checkpoint224({_key: key, _value: value}));\n }\n return (lastValue, value);\n } else {\n self.push(Checkpoint224({_key: key, _value: value}));\n return (0, value);\n }\n }\n\n /**\n * @dev Return the index of the first (oldest) checkpoint with key strictly bigger than the search key, or `high`\n * if there is none. `low` and `high` define a section where to do the search, with inclusive `low` and exclusive\n * `high`.\n *\n * WARNING: `high` should not be greater than the array's length.\n */\n function _upperBinaryLookup(\n Checkpoint224[] storage self,\n uint32 key,\n uint256 low,\n uint256 high\n ) private view returns (uint256) {\n while (low < high) {\n uint256 mid = Math.average(low, high);\n if (_unsafeAccess(self, mid)._key > key) {\n high = mid;\n } else {\n low = mid + 1;\n }\n }\n return high;\n }\n\n /**\n * @dev Return the index of the first (oldest) checkpoint with key greater or equal than the search key, or `high`\n * if there is none. `low` and `high` define a section where to do the search, with inclusive `low` and exclusive\n * `high`.\n *\n * WARNING: `high` should not be greater than the array's length.\n */\n function _lowerBinaryLookup(\n Checkpoint224[] storage self,\n uint32 key,\n uint256 low,\n uint256 high\n ) private view returns (uint256) {\n while (low < high) {\n uint256 mid = Math.average(low, high);\n if (_unsafeAccess(self, mid)._key < key) {\n low = mid + 1;\n } else {\n high = mid;\n }\n }\n return high;\n }\n\n /**\n * @dev Access an element of the array without performing bounds check. The position is assumed to be within bounds.\n */\n function _unsafeAccess(\n Checkpoint224[] storage self,\n uint256 pos\n ) private pure returns (Checkpoint224 storage result) {\n assembly {\n mstore(0, self.slot)\n result.slot := add(keccak256(0, 0x20), pos)\n }\n }\n\n struct Trace208 {\n Checkpoint208[] _checkpoints;\n }\n\n struct Checkpoint208 {\n uint48 _key;\n uint208 _value;\n }\n\n /**\n * @dev Pushes a (`key`, `value`) pair into a Trace208 so that it is stored as the checkpoint.\n *\n * Returns previous value and new value.\n *\n * IMPORTANT: Never accept `key` as a user input, since an arbitrary `type(uint48).max` key set will disable the\n * library.\n */\n function push(\n Trace208 storage self,\n uint48 key,\n uint208 value\n ) internal returns (uint208 oldValue, uint208 newValue) {\n return _insert(self._checkpoints, key, value);\n }\n\n /**\n * @dev Returns the value in the first (oldest) checkpoint with key greater or equal than the search key, or zero if\n * there is none.\n */\n function lowerLookup(Trace208 storage self, uint48 key) internal view returns (uint208) {\n uint256 len = self._checkpoints.length;\n uint256 pos = _lowerBinaryLookup(self._checkpoints, key, 0, len);\n return pos == len ? 0 : _unsafeAccess(self._checkpoints, pos)._value;\n }\n\n /**\n * @dev Returns the value in the last (most recent) checkpoint with key lower or equal than the search key, or zero\n * if there is none.\n */\n function upperLookup(Trace208 storage self, uint48 key) internal view returns (uint208) {\n uint256 len = self._checkpoints.length;\n uint256 pos = _upperBinaryLookup(self._checkpoints, key, 0, len);\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\n }\n\n /**\n * @dev Returns the value in the last (most recent) checkpoint with key lower or equal than the search key, or zero\n * if there is none.\n *\n * NOTE: This is a variant of {upperLookup} that is optimised to find \"recent\" checkpoint (checkpoints with high\n * keys).\n */\n function upperLookupRecent(Trace208 storage self, uint48 key) internal view returns (uint208) {\n uint256 len = self._checkpoints.length;\n\n uint256 low = 0;\n uint256 high = len;\n\n if (len > 5) {\n uint256 mid = len - Math.sqrt(len);\n if (key < _unsafeAccess(self._checkpoints, mid)._key) {\n high = mid;\n } else {\n low = mid + 1;\n }\n }\n\n uint256 pos = _upperBinaryLookup(self._checkpoints, key, low, high);\n\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\n }\n\n /**\n * @dev Returns the value in the most recent checkpoint, or zero if there are no checkpoints.\n */\n function latest(Trace208 storage self) internal view returns (uint208) {\n uint256 pos = self._checkpoints.length;\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\n }\n\n /**\n * @dev Returns whether there is a checkpoint in the structure (i.e. it is not empty), and if so the key and value\n * in the most recent checkpoint.\n */\n function latestCheckpoint(Trace208 storage self) internal view returns (bool exists, uint48 _key, uint208 _value) {\n uint256 pos = self._checkpoints.length;\n if (pos == 0) {\n return (false, 0, 0);\n } else {\n Checkpoint208 storage ckpt = _unsafeAccess(self._checkpoints, pos - 1);\n return (true, ckpt._key, ckpt._value);\n }\n }\n\n /**\n * @dev Returns the number of checkpoint.\n */\n function length(Trace208 storage self) internal view returns (uint256) {\n return self._checkpoints.length;\n }\n\n /**\n * @dev Returns checkpoint at given position.\n */\n function at(Trace208 storage self, uint32 pos) internal view returns (Checkpoint208 memory) {\n return self._checkpoints[pos];\n }\n\n /**\n * @dev Pushes a (`key`, `value`) pair into an ordered list of checkpoints, either by inserting a new checkpoint,\n * or by updating the last one.\n */\n function _insert(\n Checkpoint208[] storage self,\n uint48 key,\n uint208 value\n ) private returns (uint208 oldValue, uint208 newValue) {\n uint256 pos = self.length;\n\n if (pos > 0) {\n Checkpoint208 storage last = _unsafeAccess(self, pos - 1);\n uint48 lastKey = last._key;\n uint208 lastValue = last._value;\n\n // Checkpoint keys must be non-decreasing.\n if (lastKey > key) {\n revert CheckpointUnorderedInsertion();\n }\n\n // Update or push new checkpoint\n if (lastKey == key) {\n last._value = value;\n } else {\n self.push(Checkpoint208({_key: key, _value: value}));\n }\n return (lastValue, value);\n } else {\n self.push(Checkpoint208({_key: key, _value: value}));\n return (0, value);\n }\n }\n\n /**\n * @dev Return the index of the first (oldest) checkpoint with key strictly bigger than the search key, or `high`\n * if there is none. `low` and `high` define a section where to do the search, with inclusive `low` and exclusive\n * `high`.\n *\n * WARNING: `high` should not be greater than the array's length.\n */\n function _upperBinaryLookup(\n Checkpoint208[] storage self,\n uint48 key,\n uint256 low,\n uint256 high\n ) private view returns (uint256) {\n while (low < high) {\n uint256 mid = Math.average(low, high);\n if (_unsafeAccess(self, mid)._key > key) {\n high = mid;\n } else {\n low = mid + 1;\n }\n }\n return high;\n }\n\n /**\n * @dev Return the index of the first (oldest) checkpoint with key greater or equal than the search key, or `high`\n * if there is none. `low` and `high` define a section where to do the search, with inclusive `low` and exclusive\n * `high`.\n *\n * WARNING: `high` should not be greater than the array's length.\n */\n function _lowerBinaryLookup(\n Checkpoint208[] storage self,\n uint48 key,\n uint256 low,\n uint256 high\n ) private view returns (uint256) {\n while (low < high) {\n uint256 mid = Math.average(low, high);\n if (_unsafeAccess(self, mid)._key < key) {\n low = mid + 1;\n } else {\n high = mid;\n }\n }\n return high;\n }\n\n /**\n * @dev Access an element of the array without performing bounds check. The position is assumed to be within bounds.\n */\n function _unsafeAccess(\n Checkpoint208[] storage self,\n uint256 pos\n ) private pure returns (Checkpoint208 storage result) {\n assembly {\n mstore(0, self.slot)\n result.slot := add(keccak256(0, 0x20), pos)\n }\n }\n\n struct Trace160 {\n Checkpoint160[] _checkpoints;\n }\n\n struct Checkpoint160 {\n uint96 _key;\n uint160 _value;\n }\n\n /**\n * @dev Pushes a (`key`, `value`) pair into a Trace160 so that it is stored as the checkpoint.\n *\n * Returns previous value and new value.\n *\n * IMPORTANT: Never accept `key` as a user input, since an arbitrary `type(uint96).max` key set will disable the\n * library.\n */\n function push(\n Trace160 storage self,\n uint96 key,\n uint160 value\n ) internal returns (uint160 oldValue, uint160 newValue) {\n return _insert(self._checkpoints, key, value);\n }\n\n /**\n * @dev Returns the value in the first (oldest) checkpoint with key greater or equal than the search key, or zero if\n * there is none.\n */\n function lowerLookup(Trace160 storage self, uint96 key) internal view returns (uint160) {\n uint256 len = self._checkpoints.length;\n uint256 pos = _lowerBinaryLookup(self._checkpoints, key, 0, len);\n return pos == len ? 0 : _unsafeAccess(self._checkpoints, pos)._value;\n }\n\n /**\n * @dev Returns the value in the last (most recent) checkpoint with key lower or equal than the search key, or zero\n * if there is none.\n */\n function upperLookup(Trace160 storage self, uint96 key) internal view returns (uint160) {\n uint256 len = self._checkpoints.length;\n uint256 pos = _upperBinaryLookup(self._checkpoints, key, 0, len);\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\n }\n\n /**\n * @dev Returns the value in the last (most recent) checkpoint with key lower or equal than the search key, or zero\n * if there is none.\n *\n * NOTE: This is a variant of {upperLookup} that is optimised to find \"recent\" checkpoint (checkpoints with high\n * keys).\n */\n function upperLookupRecent(Trace160 storage self, uint96 key) internal view returns (uint160) {\n uint256 len = self._checkpoints.length;\n\n uint256 low = 0;\n uint256 high = len;\n\n if (len > 5) {\n uint256 mid = len - Math.sqrt(len);\n if (key < _unsafeAccess(self._checkpoints, mid)._key) {\n high = mid;\n } else {\n low = mid + 1;\n }\n }\n\n uint256 pos = _upperBinaryLookup(self._checkpoints, key, low, high);\n\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\n }\n\n /**\n * @dev Returns the value in the most recent checkpoint, or zero if there are no checkpoints.\n */\n function latest(Trace160 storage self) internal view returns (uint160) {\n uint256 pos = self._checkpoints.length;\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\n }\n\n /**\n * @dev Returns whether there is a checkpoint in the structure (i.e. it is not empty), and if so the key and value\n * in the most recent checkpoint.\n */\n function latestCheckpoint(Trace160 storage self) internal view returns (bool exists, uint96 _key, uint160 _value) {\n uint256 pos = self._checkpoints.length;\n if (pos == 0) {\n return (false, 0, 0);\n } else {\n Checkpoint160 storage ckpt = _unsafeAccess(self._checkpoints, pos - 1);\n return (true, ckpt._key, ckpt._value);\n }\n }\n\n /**\n * @dev Returns the number of checkpoint.\n */\n function length(Trace160 storage self) internal view returns (uint256) {\n return self._checkpoints.length;\n }\n\n /**\n * @dev Returns checkpoint at given position.\n */\n function at(Trace160 storage self, uint32 pos) internal view returns (Checkpoint160 memory) {\n return self._checkpoints[pos];\n }\n\n /**\n * @dev Pushes a (`key`, `value`) pair into an ordered list of checkpoints, either by inserting a new checkpoint,\n * or by updating the last one.\n */\n function _insert(\n Checkpoint160[] storage self,\n uint96 key,\n uint160 value\n ) private returns (uint160 oldValue, uint160 newValue) {\n uint256 pos = self.length;\n\n if (pos > 0) {\n Checkpoint160 storage last = _unsafeAccess(self, pos - 1);\n uint96 lastKey = last._key;\n uint160 lastValue = last._value;\n\n // Checkpoint keys must be non-decreasing.\n if (lastKey > key) {\n revert CheckpointUnorderedInsertion();\n }\n\n // Update or push new checkpoint\n if (lastKey == key) {\n last._value = value;\n } else {\n self.push(Checkpoint160({_key: key, _value: value}));\n }\n return (lastValue, value);\n } else {\n self.push(Checkpoint160({_key: key, _value: value}));\n return (0, value);\n }\n }\n\n /**\n * @dev Return the index of the first (oldest) checkpoint with key strictly bigger than the search key, or `high`\n * if there is none. `low` and `high` define a section where to do the search, with inclusive `low` and exclusive\n * `high`.\n *\n * WARNING: `high` should not be greater than the array's length.\n */\n function _upperBinaryLookup(\n Checkpoint160[] storage self,\n uint96 key,\n uint256 low,\n uint256 high\n ) private view returns (uint256) {\n while (low < high) {\n uint256 mid = Math.average(low, high);\n if (_unsafeAccess(self, mid)._key > key) {\n high = mid;\n } else {\n low = mid + 1;\n }\n }\n return high;\n }\n\n /**\n * @dev Return the index of the first (oldest) checkpoint with key greater or equal than the search key, or `high`\n * if there is none. `low` and `high` define a section where to do the search, with inclusive `low` and exclusive\n * `high`.\n *\n * WARNING: `high` should not be greater than the array's length.\n */\n function _lowerBinaryLookup(\n Checkpoint160[] storage self,\n uint96 key,\n uint256 low,\n uint256 high\n ) private view returns (uint256) {\n while (low < high) {\n uint256 mid = Math.average(low, high);\n if (_unsafeAccess(self, mid)._key < key) {\n low = mid + 1;\n } else {\n high = mid;\n }\n }\n return high;\n }\n\n /**\n * @dev Access an element of the array without performing bounds check. The position is assumed to be within bounds.\n */\n function _unsafeAccess(\n Checkpoint160[] storage self,\n uint256 pos\n ) private pure returns (Checkpoint160 storage result) {\n assembly {\n mstore(0, self.slot)\n result.slot := add(keccak256(0, 0x20), pos)\n }\n }\n}\n" + }, + "@openzeppelin/contracts/utils/types/Time.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/types/Time.sol)\n\npragma solidity ^0.8.20;\n\nimport {Math} from \"../math/Math.sol\";\nimport {SafeCast} from \"../math/SafeCast.sol\";\n\n/**\n * @dev This library provides helpers for manipulating time-related objects.\n *\n * It uses the following types:\n * - `uint48` for timepoints\n * - `uint32` for durations\n *\n * While the library doesn't provide specific types for timepoints and duration, it does provide:\n * - a `Delay` type to represent duration that can be programmed to change value automatically at a given point\n * - additional helper functions\n */\nlibrary Time {\n using Time for *;\n\n /**\n * @dev Get the block timestamp as a Timepoint.\n */\n function timestamp() internal view returns (uint48) {\n return SafeCast.toUint48(block.timestamp);\n }\n\n /**\n * @dev Get the block number as a Timepoint.\n */\n function blockNumber() internal view returns (uint48) {\n return SafeCast.toUint48(block.number);\n }\n\n // ==================================================== Delay =====================================================\n /**\n * @dev A `Delay` is a uint32 duration that can be programmed to change value automatically at a given point in the\n * future. The \"effect\" timepoint describes when the transitions happens from the \"old\" value to the \"new\" value.\n * This allows updating the delay applied to some operation while keeping some guarantees.\n *\n * In particular, the {update} function guarantees that if the delay is reduced, the old delay still applies for\n * some time. For example if the delay is currently 7 days to do an upgrade, the admin should not be able to set\n * the delay to 0 and upgrade immediately. If the admin wants to reduce the delay, the old delay (7 days) should\n * still apply for some time.\n *\n *\n * The `Delay` type is 112 bits long, and packs the following:\n *\n * ```\n * | [uint48]: effect date (timepoint)\n * | | [uint32]: value before (duration)\n * ↓ ↓ ↓ [uint32]: value after (duration)\n * 0xAAAAAAAAAAAABBBBBBBBCCCCCCCC\n * ```\n *\n * NOTE: The {get} and {withUpdate} functions operate using timestamps. Block number based delays are not currently\n * supported.\n */\n type Delay is uint112;\n\n /**\n * @dev Wrap a duration into a Delay to add the one-step \"update in the future\" feature\n */\n function toDelay(uint32 duration) internal pure returns (Delay) {\n return Delay.wrap(duration);\n }\n\n /**\n * @dev Get the value at a given timepoint plus the pending value and effect timepoint if there is a scheduled\n * change after this timepoint. If the effect timepoint is 0, then the pending value should not be considered.\n */\n function _getFullAt(\n Delay self,\n uint48 timepoint\n ) private pure returns (uint32 valueBefore, uint32 valueAfter, uint48 effect) {\n (valueBefore, valueAfter, effect) = self.unpack();\n return effect <= timepoint ? (valueAfter, 0, 0) : (valueBefore, valueAfter, effect);\n }\n\n /**\n * @dev Get the current value plus the pending value and effect timepoint if there is a scheduled change. If the\n * effect timepoint is 0, then the pending value should not be considered.\n */\n function getFull(Delay self) internal view returns (uint32 valueBefore, uint32 valueAfter, uint48 effect) {\n return _getFullAt(self, timestamp());\n }\n\n /**\n * @dev Get the current value.\n */\n function get(Delay self) internal view returns (uint32) {\n (uint32 delay, , ) = self.getFull();\n return delay;\n }\n\n /**\n * @dev Update a Delay object so that it takes a new duration after a timepoint that is automatically computed to\n * enforce the old delay at the moment of the update. Returns the updated Delay object and the timestamp when the\n * new delay becomes effective.\n */\n function withUpdate(\n Delay self,\n uint32 newValue,\n uint32 minSetback\n ) internal view returns (Delay updatedDelay, uint48 effect) {\n uint32 value = self.get();\n uint32 setback = uint32(Math.max(minSetback, value > newValue ? value - newValue : 0));\n effect = timestamp() + setback;\n return (pack(value, newValue, effect), effect);\n }\n\n /**\n * @dev Split a delay into its components: valueBefore, valueAfter and effect (transition timepoint).\n */\n function unpack(Delay self) internal pure returns (uint32 valueBefore, uint32 valueAfter, uint48 effect) {\n uint112 raw = Delay.unwrap(self);\n\n valueAfter = uint32(raw);\n valueBefore = uint32(raw >> 32);\n effect = uint48(raw >> 64);\n\n return (valueBefore, valueAfter, effect);\n }\n\n /**\n * @dev pack the components into a Delay object.\n */\n function pack(uint32 valueBefore, uint32 valueAfter, uint48 effect) internal pure returns (Delay) {\n return Delay.wrap((uint112(effect) << 64) | (uint112(valueBefore) << 32) | uint112(valueAfter));\n }\n}\n" + }, + "contracts/variants/crosschain/NFT.sol": { + "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity ^0.8.20;\n\nimport \"@openzeppelin/contracts/token/ERC721/ERC721.sol\";\nimport \"@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol\";\nimport \"@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol\";\nimport \"@openzeppelin/contracts/token/ERC721/extensions/ERC721Burnable.sol\";\nimport \"@openzeppelin/contracts/access/Ownable.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/EIP712.sol\";\nimport \"@openzeppelin/contracts/token/ERC721/extensions/ERC721Votes.sol\";\nimport \"./ProofHandler.sol\";\n\n/**\n * @title Cross-chain Membership NFT Contract\n * @author Web3 Hackers Collective\n * @notice Non-transferable NFT implementation for DAO membership with cross-chain capabilities\n * @dev Extends OpenZeppelin's NFT standards with cross-chain operation support and delegation\n * @custom:security-contact julien@strat.cc\n */\ncontract NFT is\n ERC721,\n ERC721Enumerable,\n ERC721URIStorage,\n ERC721Burnable,\n Ownable,\n EIP712,\n ERC721Votes\n{\n using ProofHandler for ProofHandler.ProofStorage;\n\n /// @notice Chain ID where contract was originally deployed\n uint256 public immutable home;\n\n /// @notice Next token ID to be minted\n uint256 private _nextTokenId;\n\n /// @notice Storage for proof handling\n ProofHandler.ProofStorage private _proofStorage;\n\n /// @notice Types of operations that can be synchronized across chains\n enum OperationType {\n MINT,\n BURN,\n SET_METADATA,\n DELEGATE\n }\n\n /// @notice Emitted when a membership is claimed\n /// @param tokenId The ID of the claimed token\n /// @param member The address receiving the membership\n /// @param nonce Operation sequence number\n event MembershipClaimed(uint256 indexed tokenId, address indexed member, uint256 nonce);\n\n /// @notice Emitted when a membership is revoked\n /// @param tokenId The ID of the revoked token\n /// @param member The address losing membership\n /// @param nonce Operation sequence number\n event MembershipRevoked(uint256 indexed tokenId, address indexed member, uint256 nonce);\n\n /// @notice Emitted when metadata is updated\n /// @param tokenId The ID of the updated token\n /// @param newUri The new metadata URI\n /// @param nonce Operation sequence number\n event MetadataUpdated(uint256 indexed tokenId, string newUri, uint256 nonce);\n\n /// @notice Emitted when delegation is synchronized across chains\n /// @param delegator The address delegating their voting power\n /// @param delegatee The address receiving the delegation\n /// @param nonce Operation sequence number\n event DelegationSynced(address indexed delegator, address indexed delegatee, uint256 nonce);\n\n /// @notice Restricts functions to home chain\n modifier onlyHomeChain() {\n require(block.chainid == home, \"Operation only allowed on home chain\");\n _;\n }\n\n /**\n * @notice Initializes the NFT contract\n * @param _home Chain ID where contract is considered home\n * @param initialOwner Initial contract owner\n * @param _firstMembers Array of initial member addresses\n * @param _uri Initial token URI\n * @param _name Token collection name\n * @param _symbol Token collection symbol\n */\n constructor(\n uint256 _home,\n address initialOwner,\n address[] memory _firstMembers,\n string memory _uri,\n string memory _name,\n string memory _symbol\n ) ERC721(_name, _symbol) Ownable(initialOwner) EIP712(_name, \"1\") {\n home = _home;\n for (uint i; i < _firstMembers.length; i++) {\n _govMint(_firstMembers[i], _uri);\n _delegate(_firstMembers[i], _firstMembers[i]);\n }\n }\n\n /**\n * @notice Adds a new member on home chain\n * @dev Only callable by owner (governance) on home chain\n * @param to Address to mint token to\n * @param uri Token metadata URI\n */\n function safeMint(address to, string memory uri) public onlyOwner onlyHomeChain {\n uint256 nonce = _proofStorage.incrementNonce(uint8(OperationType.MINT));\n _govMint(to, uri);\n emit MembershipClaimed(_nextTokenId - 1, to, nonce);\n }\n\n /**\n * @notice Burns token on home chain\n * @dev Only callable by owner (governance) on home chain\n * @param tokenId ID of token to burn\n */\n function govBurn(uint256 tokenId) public onlyOwner onlyHomeChain {\n uint256 nonce = _proofStorage.incrementNonce(uint8(OperationType.BURN));\n address owner = ownerOf(tokenId);\n _burn(tokenId);\n emit MembershipRevoked(tokenId, owner, nonce);\n }\n\n /**\n * @notice Updates token metadata on home chain\n * @dev Only callable by owner (governance) on home chain\n * @param tokenId ID of token to update\n * @param uri New metadata URI\n */\n function setMetadata(uint256 tokenId, string memory uri) public onlyOwner onlyHomeChain {\n uint256 nonce = _proofStorage.incrementNonce(uint8(OperationType.SET_METADATA));\n _setTokenURI(tokenId, uri);\n emit MetadataUpdated(tokenId, uri, nonce);\n }\n\n /**\n * @notice Delegates voting power to another address on home chain\n * @dev Overrides ERC721Votes delegate function to add cross-chain functionality\n * @param delegatee Address to delegate voting power to\n */\n function delegate(address delegatee) public virtual override onlyHomeChain {\n uint256 nonce = _proofStorage.incrementNonce(uint8(OperationType.DELEGATE));\n _delegate(_msgSender(), delegatee);\n emit DelegationSynced(_msgSender(), delegatee, nonce);\n }\n\n /**\n * @notice Generates proof for NFT operations\n * @dev Only callable on home chain\n * @param operationType Type of operation\n * @param params Operation parameters\n * @return Encoded proof data\n */\n function generateOperationProof(\n uint8 operationType,\n bytes memory params\n ) external view returns (bytes memory) {\n require(block.chainid == home, \"Proofs only generated on home chain\");\n uint256 nextNonce = _proofStorage.getNextNonce(operationType);\n return ProofHandler.generateProof(address(this), operationType, params, nextNonce);\n }\n\n /**\n * @notice Generates proof for delegation\n * @dev Only callable on home chain\n * @param delegator Address delegating voting power\n * @param delegatee Address receiving delegation\n * @return Encoded proof data\n */\n function generateDelegationProof(\n address delegator,\n address delegatee\n ) external view returns (bytes memory) {\n require(block.chainid == home, \"Proofs only generated on home chain\");\n uint256 nextNonce = _proofStorage.getNextNonce(uint8(OperationType.DELEGATE));\n bytes memory params = abi.encode(delegator, delegatee);\n return\n ProofHandler.generateProof(\n address(this),\n uint8(OperationType.DELEGATE),\n params,\n nextNonce\n );\n }\n\n // Claim operations\n\n /**\n * @notice Claims an NFT operation on a foreign chain\n * @param proof Proof generated by home chain\n */\n function claimOperation(bytes memory proof) external {\n (uint8 operationType, bytes memory params, uint256 nonce) = ProofHandler\n .verifyAndClaimProof(proof, address(this), _proofStorage);\n\n if (operationType == uint8(OperationType.MINT)) {\n (address to, string memory uri) = abi.decode(params, (address, string));\n _govMint(to, uri);\n emit MembershipClaimed(_nextTokenId - 1, to, nonce);\n } else if (operationType == uint8(OperationType.BURN)) {\n uint256 tokenId = abi.decode(params, (uint256));\n address owner = ownerOf(tokenId);\n _burn(tokenId);\n emit MembershipRevoked(tokenId, owner, nonce);\n } else if (operationType == uint8(OperationType.SET_METADATA)) {\n (uint256 tokenId, string memory uri) = abi.decode(params, (uint256, string));\n _setTokenURI(tokenId, uri);\n emit MetadataUpdated(tokenId, uri, nonce);\n } else if (operationType == uint8(OperationType.DELEGATE)) {\n (address delegator, address delegatee) = abi.decode(params, (address, address));\n _delegate(delegator, delegatee);\n emit DelegationSynced(delegator, delegatee, nonce);\n }\n }\n\n /**\n * @notice Claims a delegation operation on a foreign chain\n * @param proof Proof generated by home chain\n */\n function claimDelegation(bytes memory proof) external {\n (uint8 operationType, bytes memory params, uint256 nonce) = ProofHandler\n .verifyAndClaimProof(proof, address(this), _proofStorage);\n\n require(operationType == uint8(OperationType.DELEGATE), \"Invalid operation type\");\n (address delegator, address delegatee) = abi.decode(params, (address, address));\n\n _delegate(delegator, delegatee);\n emit DelegationSynced(delegator, delegatee, nonce);\n }\n\n /**\n * @notice Internal function for minting without proof verification\n * @param to Address to receive token\n * @param uri Token metadata URI\n */\n function _govMint(address to, string memory uri) internal {\n uint256 tokenId = _nextTokenId++;\n _safeMint(to, tokenId);\n _setTokenURI(tokenId, uri);\n _delegate(to, to);\n }\n\n // Required overrides\n\n /**\n * @notice Updates token data\n * @dev Overrides ERC721 _update to make NFTs non-transferable\n * @param to Recipient address\n * @param tokenId Token ID\n * @param auth Address authorized for transfer\n * @return Previous owner address\n */\n function _update(\n address to,\n uint256 tokenId,\n address auth\n ) internal override(ERC721, ERC721Enumerable, ERC721Votes) returns (address) {\n require(auth == address(0) || to == address(0), \"NFT is not transferable\");\n return super._update(to, tokenId, auth);\n }\n\n /**\n * @notice Increments account balance\n * @dev Internal override to maintain compatibility\n * @param account Account to update\n * @param value Amount to increase by\n */\n function _increaseBalance(\n address account,\n uint128 value\n ) internal override(ERC721, ERC721Enumerable, ERC721Votes) {\n super._increaseBalance(account, value);\n }\n\n /**\n * @notice Gets token URI\n * @param tokenId Token ID to query\n * @return URI string\n */\n function tokenURI(\n uint256 tokenId\n ) public view override(ERC721, ERC721URIStorage) returns (string memory) {\n return super.tokenURI(tokenId);\n }\n\n /**\n * @notice Checks interface support\n * @param interfaceId Interface identifier to check\n * @return bool True if interface is supported\n */\n function supportsInterface(\n bytes4 interfaceId\n ) public view override(ERC721, ERC721Enumerable, ERC721URIStorage) returns (bool) {\n return super.supportsInterface(interfaceId);\n }\n\n /**\n * @notice Gets current timestamp\n * @dev Used for voting snapshots\n * @return Current block timestamp\n */\n function clock() public view override returns (uint48) {\n return uint48(block.timestamp);\n }\n\n /**\n * @notice Gets clock mode description\n * @return String indicating timestamp-based voting\n */\n function CLOCK_MODE() public pure override returns (string memory) {\n return \"mode=timestamp\";\n }\n}\n" + }, + "contracts/variants/crosschain/ProofHandler.sol": { + "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity ^0.8.20;\n\n/**\n * @title Proof Handler Library\n * @author Web3 Hackers Collective\n * @notice Library for standardized cross-chain proof generation and verification\n * @dev Handles proof generation, verification, and tracking for cross-chain operations\n * @custom:security-contact julien@strat.cc\n */\nlibrary ProofHandler {\n /// @notice Tracks which proofs have been applied on each chain\n struct ProofStorage {\n mapping(bytes32 => bool) updateAppliedOnChain;\n mapping(uint8 => uint256) currentNonce;\n }\n\n /// @dev Emitted when a proof is claimed\n event ProofClaimed(uint8 indexed operationType, bytes params, uint256 nonce);\n\n /**\n * @notice Generates a proof for cross-chain operations\n * @param contractAddress Address of contract generating the proof\n * @param operationType Type of operation being performed\n * @param params Operation parameters\n * @param nonce Current nonce for this operation type\n * @return proof Encoded proof data\n */\n function generateProof(\n address contractAddress,\n uint8 operationType,\n bytes memory params,\n uint256 nonce\n ) public pure returns (bytes memory proof) {\n bytes32 message = keccak256(\n abi.encodePacked(contractAddress, operationType, params, nonce)\n );\n bytes32 digest = keccak256(abi.encodePacked(\"\\x19Ethereum Signed Message:\\n32\", message));\n\n return abi.encode(operationType, params, nonce, digest);\n }\n\n /**\n * @notice Verifies and claims a proof\n * @param proof Proof to verify and claim\n * @param contractAddress Address of contract claiming the proof\n * @param storage_ Proof storage struct\n * @return operationType The type of operation being performed\n * @return params The operation parameters\n * @return nonce The operation sequence number\n */\n function verifyAndClaimProof(\n bytes memory proof,\n address contractAddress,\n ProofStorage storage storage_\n ) public returns (uint8 operationType, bytes memory params, uint256 nonce) {\n bytes32 digest;\n (operationType, params, nonce, digest) = abi.decode(\n proof,\n (uint8, bytes, uint256, bytes32)\n );\n\n bytes32 proofHash = keccak256(proof);\n require(!storage_.updateAppliedOnChain[proofHash], \"Proof already claimed\");\n require(nonce == storage_.currentNonce[operationType] + 1, \"Invalid nonce\");\n\n bytes32 message = keccak256(\n abi.encodePacked(contractAddress, operationType, params, nonce)\n );\n bytes32 expectedDigest = keccak256(\n abi.encodePacked(\"\\x19Ethereum Signed Message:\\n32\", message)\n );\n require(digest == expectedDigest, \"Invalid proof\");\n\n storage_.updateAppliedOnChain[proofHash] = true;\n storage_.currentNonce[operationType] = nonce;\n\n emit ProofClaimed(operationType, params, nonce);\n\n return (operationType, params, nonce);\n }\n\n /**\n * @notice Gets the next nonce for an operation type\n * @param storage_ Proof storage struct\n * @param operationType Type of operation\n * @return nonce Next nonce value\n */\n function getNextNonce(\n ProofStorage storage storage_,\n uint8 operationType\n ) public view returns (uint256 nonce) {\n return storage_.currentNonce[operationType] + 1;\n }\n\n /**\n * @notice Increments the nonce for an operation type\n * @param storage_ Proof storage struct\n * @param operationType Type of operation\n * @return nonce New nonce value\n */\n function incrementNonce(\n ProofStorage storage storage_,\n uint8 operationType\n ) public returns (uint256 nonce) {\n storage_.currentNonce[operationType]++;\n return storage_.currentNonce[operationType];\n }\n}\n" + } + }, + "settings": { + "optimizer": { + "enabled": true, + "runs": 200 + }, + "evmVersion": "paris", + "outputSelection": { + "*": { + "*": [ + "abi", + "evm.bytecode", + "evm.deployedBytecode", + "evm.methodIdentifiers", + "metadata", + "devdoc", + "userdoc", + "storageLayout", + "evm.gasEstimates" + ], + "": [ + "ast" + ] + } + }, + "metadata": { + "useLiteralContent": true + } + } +} \ No newline at end of file diff --git a/deployments/sepolia/CrosschainGov.json b/deployments/sepolia/CrosschainGov.json index dbe68fb..f8a4317 100644 --- a/deployments/sepolia/CrosschainGov.json +++ b/deployments/sepolia/CrosschainGov.json @@ -1,5 +1,5 @@ { - "address": "0xB8de4177BAf7365DFc7E6ad860E4B223b40f91A0", + "address": "0x3F92DdC0c99d9B873C424f4066F252adb72192D9", "abi": [ { "inputs": [ @@ -1738,74 +1738,74 @@ "type": "receive" } ], - "transactionHash": "0x2471963ac17e71348e611d9aa2ed4e474b035cb43e7220cafd950643ce2e2421", + "transactionHash": "0x34400862096e51c2a9bddbe8e0a3eb22d3c1fa2faea6692f8117cbfe1b8100f7", "receipt": { "to": "0x4e59b44847b379578588920cA78FbF26c0B4956C", "from": "0x27292E1a901E3E0bE7d144aDba4CAD07da2d8a42", "contractAddress": null, - "transactionIndex": 45, - "gasUsed": "4474021", - "logsBloom": "0x00000400000000000100000000001000000000000000000000000000000008000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000080002000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000080000800000000000000000200000000000000000000000200000000000000000000000000000", - "blockHash": "0xbc503f92ee5122b7398e42d3e54c3d3abd5588f9aa6675fdede2a2186ef537a6", - "transactionHash": "0x2471963ac17e71348e611d9aa2ed4e474b035cb43e7220cafd950643ce2e2421", + "transactionIndex": 52, + "gasUsed": "4474043", + "logsBloom": "0x00000000000000000100000000001000000000000000000000000000000008000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000080002000000010000000000000000000000000000000000001000000000020000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000200000000000000000080000800000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0xcbf7ae97ee111fbf6882b406430dfea8322664b498f20a9c75974380af07b10e", + "transactionHash": "0x34400862096e51c2a9bddbe8e0a3eb22d3c1fa2faea6692f8117cbfe1b8100f7", "logs": [ { - "transactionIndex": 45, - "blockNumber": 7191168, - "transactionHash": "0x2471963ac17e71348e611d9aa2ed4e474b035cb43e7220cafd950643ce2e2421", - "address": "0xB8de4177BAf7365DFc7E6ad860E4B223b40f91A0", + "transactionIndex": 52, + "blockNumber": 7198671, + "transactionHash": "0x34400862096e51c2a9bddbe8e0a3eb22d3c1fa2faea6692f8117cbfe1b8100f7", + "address": "0x3F92DdC0c99d9B873C424f4066F252adb72192D9", "topics": [ "0xc565b045403dc03c2eea82b81a0465edad9e2e7fc4d97e11421c209da93d7a93" ], "data": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "logIndex": 69, - "blockHash": "0xbc503f92ee5122b7398e42d3e54c3d3abd5588f9aa6675fdede2a2186ef537a6" + "logIndex": 90, + "blockHash": "0xcbf7ae97ee111fbf6882b406430dfea8322664b498f20a9c75974380af07b10e" }, { - "transactionIndex": 45, - "blockNumber": 7191168, - "transactionHash": "0x2471963ac17e71348e611d9aa2ed4e474b035cb43e7220cafd950643ce2e2421", - "address": "0xB8de4177BAf7365DFc7E6ad860E4B223b40f91A0", + "transactionIndex": 52, + "blockNumber": 7198671, + "transactionHash": "0x34400862096e51c2a9bddbe8e0a3eb22d3c1fa2faea6692f8117cbfe1b8100f7", + "address": "0x3F92DdC0c99d9B873C424f4066F252adb72192D9", "topics": [ "0x7e3f7f0708a84de9203036abaa450dccc85ad5ff52f78c170f3edb55cf5e8828" ], "data": "0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c8", - "logIndex": 70, - "blockHash": "0xbc503f92ee5122b7398e42d3e54c3d3abd5588f9aa6675fdede2a2186ef537a6" + "logIndex": 91, + "blockHash": "0xcbf7ae97ee111fbf6882b406430dfea8322664b498f20a9c75974380af07b10e" }, { - "transactionIndex": 45, - "blockNumber": 7191168, - "transactionHash": "0x2471963ac17e71348e611d9aa2ed4e474b035cb43e7220cafd950643ce2e2421", - "address": "0xB8de4177BAf7365DFc7E6ad860E4B223b40f91A0", + "transactionIndex": 52, + "blockNumber": 7198671, + "transactionHash": "0x34400862096e51c2a9bddbe8e0a3eb22d3c1fa2faea6692f8117cbfe1b8100f7", + "address": "0x3F92DdC0c99d9B873C424f4066F252adb72192D9", "topics": [ "0xccb45da8d5717e6c4544694297c4ba5cf151d455c9bb0ed4fc7a38411bc05461" ], "data": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001", - "logIndex": 71, - "blockHash": "0xbc503f92ee5122b7398e42d3e54c3d3abd5588f9aa6675fdede2a2186ef537a6" + "logIndex": 92, + "blockHash": "0xcbf7ae97ee111fbf6882b406430dfea8322664b498f20a9c75974380af07b10e" }, { - "transactionIndex": 45, - "blockNumber": 7191168, - "transactionHash": "0x2471963ac17e71348e611d9aa2ed4e474b035cb43e7220cafd950643ce2e2421", - "address": "0xB8de4177BAf7365DFc7E6ad860E4B223b40f91A0", + "transactionIndex": 52, + "blockNumber": 7198671, + "transactionHash": "0x34400862096e51c2a9bddbe8e0a3eb22d3c1fa2faea6692f8117cbfe1b8100f7", + "address": "0x3F92DdC0c99d9B873C424f4066F252adb72192D9", "topics": [ "0x0553476bf02ef2726e8ce5ced78d63e26e602e4a2257b1f559418e24b4633997" ], "data": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005", - "logIndex": 72, - "blockHash": "0xbc503f92ee5122b7398e42d3e54c3d3abd5588f9aa6675fdede2a2186ef537a6" + "logIndex": 93, + "blockHash": "0xcbf7ae97ee111fbf6882b406430dfea8322664b498f20a9c75974380af07b10e" } ], - "blockNumber": 7191168, - "cumulativeGasUsed": "9348381", + "blockNumber": 7198671, + "cumulativeGasUsed": "10127257", "status": 1, "byzantium": true }, "args": [ 11155111, - "0xe74bC6A3Ee4ED824708DD88465BD2CdD6b869620", + "0x8583CEbA0d2C5cAe1a1BCff975Faa97063D14953", "https://bafkreifnnreoxxgkhty7v2w3qwiie6cfxpv3vcco2xldekfvbiem3nm6dm.ipfs.w3s.link/", "Test DAO", 0, @@ -1814,17 +1814,17 @@ 5 ], "numDeployments": 1, - "solcInputHash": "96a9008abeaccbd30a9b75989ce7f0fd", - "metadata": "{\"compiler\":{\"version\":\"0.8.20+commit.a1b79de6\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_home\",\"type\":\"uint256\"},{\"internalType\":\"contract IVotes\",\"name\":\"_token\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"_manifestoCid\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"_name\",\"type\":\"string\"},{\"internalType\":\"uint48\",\"name\":\"_votingDelay\",\"type\":\"uint48\"},{\"internalType\":\"uint32\",\"name\":\"_votingPeriod\",\"type\":\"uint32\"},{\"internalType\":\"uint256\",\"name\":\"_proposalThreshold\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_quorum\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"CheckpointUnorderedInsertion\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"FailedCall\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"voter\",\"type\":\"address\"}],\"name\":\"GovernorAlreadyCastVote\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"proposalId\",\"type\":\"uint256\"}],\"name\":\"GovernorAlreadyQueuedProposal\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"GovernorDisabledDeposit\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"proposer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"votes\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"threshold\",\"type\":\"uint256\"}],\"name\":\"GovernorInsufficientProposerVotes\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"targets\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"calldatas\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"values\",\"type\":\"uint256\"}],\"name\":\"GovernorInvalidProposalLength\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"quorumNumerator\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"quorumDenominator\",\"type\":\"uint256\"}],\"name\":\"GovernorInvalidQuorumFraction\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"voter\",\"type\":\"address\"}],\"name\":\"GovernorInvalidSignature\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"GovernorInvalidVoteParams\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"GovernorInvalidVoteType\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"votingPeriod\",\"type\":\"uint256\"}],\"name\":\"GovernorInvalidVotingPeriod\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"proposalId\",\"type\":\"uint256\"}],\"name\":\"GovernorNonexistentProposal\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"proposalId\",\"type\":\"uint256\"}],\"name\":\"GovernorNotQueuedProposal\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"GovernorOnlyExecutor\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"GovernorOnlyProposer\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"GovernorQueueNotImplemented\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"proposer\",\"type\":\"address\"}],\"name\":\"GovernorRestrictedProposer\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"proposalId\",\"type\":\"uint256\"},{\"internalType\":\"enum IGovernor.ProposalState\",\"name\":\"current\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"expectedStates\",\"type\":\"bytes32\"}],\"name\":\"GovernorUnexpectedProposalState\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"currentNonce\",\"type\":\"uint256\"}],\"name\":\"InvalidAccountNonce\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidShortString\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint8\",\"name\":\"bits\",\"type\":\"uint8\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"SafeCastOverflowedUintDowncast\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"str\",\"type\":\"string\"}],\"name\":\"StringTooLong\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[],\"name\":\"EIP712DomainChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"enum Gov.OperationType\",\"name\":\"operationType\",\"type\":\"uint8\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"oldValue\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newValue\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"}],\"name\":\"GovernanceParameterUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"string\",\"name\":\"oldManifesto\",\"type\":\"string\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"newManifesto\",\"type\":\"string\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"}],\"name\":\"ManifestoUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"proposalId\",\"type\":\"uint256\"}],\"name\":\"ProposalCanceled\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"proposalId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"proposer\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address[]\",\"name\":\"targets\",\"type\":\"address[]\"},{\"indexed\":false,\"internalType\":\"uint256[]\",\"name\":\"values\",\"type\":\"uint256[]\"},{\"indexed\":false,\"internalType\":\"string[]\",\"name\":\"signatures\",\"type\":\"string[]\"},{\"indexed\":false,\"internalType\":\"bytes[]\",\"name\":\"calldatas\",\"type\":\"bytes[]\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"voteStart\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"voteEnd\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"description\",\"type\":\"string\"}],\"name\":\"ProposalCreated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"proposalId\",\"type\":\"uint256\"}],\"name\":\"ProposalExecuted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"proposalId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"etaSeconds\",\"type\":\"uint256\"}],\"name\":\"ProposalQueued\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"oldProposalThreshold\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newProposalThreshold\",\"type\":\"uint256\"}],\"name\":\"ProposalThresholdSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"oldQuorumNumerator\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newQuorumNumerator\",\"type\":\"uint256\"}],\"name\":\"QuorumNumeratorUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"voter\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"proposalId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"support\",\"type\":\"uint8\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"weight\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"reason\",\"type\":\"string\"}],\"name\":\"VoteCast\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"voter\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"proposalId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"support\",\"type\":\"uint8\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"weight\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"reason\",\"type\":\"string\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"params\",\"type\":\"bytes\"}],\"name\":\"VoteCastWithParams\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"oldVotingDelay\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newVotingDelay\",\"type\":\"uint256\"}],\"name\":\"VotingDelaySet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"oldVotingPeriod\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newVotingPeriod\",\"type\":\"uint256\"}],\"name\":\"VotingPeriodSet\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"BALLOT_TYPEHASH\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"CLOCK_MODE\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"COUNTING_MODE\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"EXTENDED_BALLOT_TYPEHASH\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"targets\",\"type\":\"address[]\"},{\"internalType\":\"uint256[]\",\"name\":\"values\",\"type\":\"uint256[]\"},{\"internalType\":\"bytes[]\",\"name\":\"calldatas\",\"type\":\"bytes[]\"},{\"internalType\":\"bytes32\",\"name\":\"descriptionHash\",\"type\":\"bytes32\"}],\"name\":\"cancel\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"proposalId\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"support\",\"type\":\"uint8\"}],\"name\":\"castVote\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"proposalId\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"support\",\"type\":\"uint8\"},{\"internalType\":\"address\",\"name\":\"voter\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"signature\",\"type\":\"bytes\"}],\"name\":\"castVoteBySig\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"proposalId\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"support\",\"type\":\"uint8\"},{\"internalType\":\"string\",\"name\":\"reason\",\"type\":\"string\"}],\"name\":\"castVoteWithReason\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"proposalId\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"support\",\"type\":\"uint8\"},{\"internalType\":\"string\",\"name\":\"reason\",\"type\":\"string\"},{\"internalType\":\"bytes\",\"name\":\"params\",\"type\":\"bytes\"}],\"name\":\"castVoteWithReasonAndParams\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"proposalId\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"support\",\"type\":\"uint8\"},{\"internalType\":\"address\",\"name\":\"voter\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"reason\",\"type\":\"string\"},{\"internalType\":\"bytes\",\"name\":\"params\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"signature\",\"type\":\"bytes\"}],\"name\":\"castVoteWithReasonAndParamsBySig\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"proof\",\"type\":\"bytes\"}],\"name\":\"claimParameterUpdate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"clock\",\"outputs\":[{\"internalType\":\"uint48\",\"name\":\"\",\"type\":\"uint48\"}],\"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\":[{\"internalType\":\"address[]\",\"name\":\"targets\",\"type\":\"address[]\"},{\"internalType\":\"uint256[]\",\"name\":\"values\",\"type\":\"uint256[]\"},{\"internalType\":\"bytes[]\",\"name\":\"calldatas\",\"type\":\"bytes[]\"},{\"internalType\":\"bytes32\",\"name\":\"descriptionHash\",\"type\":\"bytes32\"}],\"name\":\"execute\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint8\",\"name\":\"operationType\",\"type\":\"uint8\"},{\"internalType\":\"bytes\",\"name\":\"value\",\"type\":\"bytes\"}],\"name\":\"generateParameterProof\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"proof\",\"type\":\"bytes\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"timepoint\",\"type\":\"uint256\"}],\"name\":\"getVotes\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"timepoint\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"params\",\"type\":\"bytes\"}],\"name\":\"getVotesWithParams\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"proposalId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"hasVoted\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"targets\",\"type\":\"address[]\"},{\"internalType\":\"uint256[]\",\"name\":\"values\",\"type\":\"uint256[]\"},{\"internalType\":\"bytes[]\",\"name\":\"calldatas\",\"type\":\"bytes[]\"},{\"internalType\":\"bytes32\",\"name\":\"descriptionHash\",\"type\":\"bytes32\"}],\"name\":\"hashProposal\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"home\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"manifesto\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"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\":\"\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"uint256[]\",\"name\":\"\",\"type\":\"uint256[]\"},{\"internalType\":\"uint256[]\",\"name\":\"\",\"type\":\"uint256[]\"},{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"name\":\"onERC1155BatchReceived\",\"outputs\":[{\"internalType\":\"bytes4\",\"name\":\"\",\"type\":\"bytes4\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"name\":\"onERC1155Received\",\"outputs\":[{\"internalType\":\"bytes4\",\"name\":\"\",\"type\":\"bytes4\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"name\":\"onERC721Received\",\"outputs\":[{\"internalType\":\"bytes4\",\"name\":\"\",\"type\":\"bytes4\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"proposalId\",\"type\":\"uint256\"}],\"name\":\"proposalDeadline\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"proposalId\",\"type\":\"uint256\"}],\"name\":\"proposalEta\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"proposalNeedsQueuing\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"proposalId\",\"type\":\"uint256\"}],\"name\":\"proposalProposer\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"proposalId\",\"type\":\"uint256\"}],\"name\":\"proposalSnapshot\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"proposalThreshold\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"proposalId\",\"type\":\"uint256\"}],\"name\":\"proposalVotes\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"againstVotes\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"forVotes\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"abstainVotes\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"targets\",\"type\":\"address[]\"},{\"internalType\":\"uint256[]\",\"name\":\"values\",\"type\":\"uint256[]\"},{\"internalType\":\"bytes[]\",\"name\":\"calldatas\",\"type\":\"bytes[]\"},{\"internalType\":\"string\",\"name\":\"description\",\"type\":\"string\"}],\"name\":\"propose\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"targets\",\"type\":\"address[]\"},{\"internalType\":\"uint256[]\",\"name\":\"values\",\"type\":\"uint256[]\"},{\"internalType\":\"bytes[]\",\"name\":\"calldatas\",\"type\":\"bytes[]\"},{\"internalType\":\"bytes32\",\"name\":\"descriptionHash\",\"type\":\"bytes32\"}],\"name\":\"queue\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"blockNumber\",\"type\":\"uint256\"}],\"name\":\"quorum\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"quorumDenominator\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"timepoint\",\"type\":\"uint256\"}],\"name\":\"quorumNumerator\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"quorumNumerator\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"target\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"relay\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"newManifesto\",\"type\":\"string\"}],\"name\":\"setManifesto\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"newProposalThreshold\",\"type\":\"uint256\"}],\"name\":\"setProposalThreshold\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint48\",\"name\":\"newVotingDelay\",\"type\":\"uint48\"}],\"name\":\"setVotingDelay\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"newVotingPeriod\",\"type\":\"uint32\"}],\"name\":\"setVotingPeriod\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"proposalId\",\"type\":\"uint256\"}],\"name\":\"state\",\"outputs\":[{\"internalType\":\"enum IGovernor.ProposalState\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"interfaceId\",\"type\":\"bytes4\"}],\"name\":\"supportsInterface\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"token\",\"outputs\":[{\"internalType\":\"contract IERC5805\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"newQuorumNumerator\",\"type\":\"uint256\"}],\"name\":\"updateQuorumNumerator\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"version\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"votingDelay\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"votingPeriod\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"author\":\"Web3 Hackers Collective\",\"custom:security-contact\":\"julien@strat.cc\",\"details\":\"Uses ProofHandler library for managing cross-chain parameter updates\",\"errors\":{\"CheckpointUnorderedInsertion()\":[{\"details\":\"A value was attempted to be inserted on a past checkpoint.\"}],\"FailedCall()\":[{\"details\":\"A call to an address target failed. The target may have reverted.\"}],\"GovernorAlreadyCastVote(address)\":[{\"details\":\"The vote was already cast.\"}],\"GovernorAlreadyQueuedProposal(uint256)\":[{\"details\":\"The proposal has already been queued.\"}],\"GovernorDisabledDeposit()\":[{\"details\":\"Token deposits are disabled in this contract.\"}],\"GovernorInsufficientProposerVotes(address,uint256,uint256)\":[{\"details\":\"The `proposer` does not have the required votes to create a proposal.\"}],\"GovernorInvalidProposalLength(uint256,uint256,uint256)\":[{\"details\":\"Empty proposal or a mismatch between the parameters length for a proposal call.\"}],\"GovernorInvalidQuorumFraction(uint256,uint256)\":[{\"details\":\"The quorum set is not a valid fraction.\"}],\"GovernorInvalidSignature(address)\":[{\"details\":\"The provided signature is not valid for the expected `voter`. If the `voter` is a contract, the signature is not valid using {IERC1271-isValidSignature}.\"}],\"GovernorInvalidVoteParams()\":[{\"details\":\"The provided params buffer is not supported by the counting module.\"}],\"GovernorInvalidVoteType()\":[{\"details\":\"The vote type used is not valid for the corresponding counting module.\"}],\"GovernorInvalidVotingPeriod(uint256)\":[{\"details\":\"The voting period set is not a valid period.\"}],\"GovernorNonexistentProposal(uint256)\":[{\"details\":\"The `proposalId` doesn't exist.\"}],\"GovernorNotQueuedProposal(uint256)\":[{\"details\":\"The proposal hasn't been queued yet.\"}],\"GovernorOnlyExecutor(address)\":[{\"details\":\"The `account` is not the governance executor.\"}],\"GovernorOnlyProposer(address)\":[{\"details\":\"The `account` is not a proposer.\"}],\"GovernorQueueNotImplemented()\":[{\"details\":\"Queue operation is not implemented for this governor. Execute should be called directly.\"}],\"GovernorRestrictedProposer(address)\":[{\"details\":\"The `proposer` is not allowed to create a proposal.\"}],\"GovernorUnexpectedProposalState(uint256,uint8,bytes32)\":[{\"details\":\"The current state of a proposal is not the required for performing an operation. The `expectedStates` is a bitmap with the bits enabled for each ProposalState enum position counting from right to left. NOTE: If `expectedState` is `bytes32(0)`, the proposal is expected to not be in any state (i.e. not exist). This is the case when a proposal that is expected to be unset is already initiated (the proposal is duplicated). See {Governor-_encodeStateBitmap}.\"}],\"InvalidAccountNonce(address,uint256)\":[{\"details\":\"The nonce used for an `account` is not the expected current nonce.\"}],\"SafeCastOverflowedUintDowncast(uint8,uint256)\":[{\"details\":\"Value doesn't fit in an uint of `bits` size.\"}]},\"events\":{\"EIP712DomainChanged()\":{\"details\":\"MAY be emitted to signal that the domain could have changed.\"},\"GovernanceParameterUpdated(uint8,uint256,uint256,uint256)\":{\"params\":{\"newValue\":\"New value\",\"nonce\":\"Update sequence number\",\"oldValue\":\"Previous value\",\"operationType\":\"Type of parameter updated\"}},\"ManifestoUpdated(string,string,uint256)\":{\"params\":{\"newManifesto\":\"New manifesto CID\",\"nonce\":\"Update sequence number\",\"oldManifesto\":\"Previous manifesto CID\"}},\"ProposalCanceled(uint256)\":{\"details\":\"Emitted when a proposal is canceled.\"},\"ProposalCreated(uint256,address,address[],uint256[],string[],bytes[],uint256,uint256,string)\":{\"details\":\"Emitted when a proposal is created.\"},\"ProposalExecuted(uint256)\":{\"details\":\"Emitted when a proposal is executed.\"},\"ProposalQueued(uint256,uint256)\":{\"details\":\"Emitted when a proposal is queued.\"},\"VoteCast(address,uint256,uint8,uint256,string)\":{\"details\":\"Emitted when a vote is cast without params. Note: `support` values should be seen as buckets. Their interpretation depends on the voting module used.\"},\"VoteCastWithParams(address,uint256,uint8,uint256,string,bytes)\":{\"details\":\"Emitted when a vote is cast with params. Note: `support` values should be seen as buckets. Their interpretation depends on the voting module used. `params` are additional encoded parameters. Their interpretation also depends on the voting module used.\"}},\"kind\":\"dev\",\"methods\":{\"CLOCK_MODE()\":{\"details\":\"Machine-readable description of the clock as specified in ERC-6372.\"},\"COUNTING_MODE()\":{\"details\":\"See {IGovernor-COUNTING_MODE}.\"},\"cancel(address[],uint256[],bytes[],bytes32)\":{\"details\":\"See {IGovernor-cancel}.\"},\"castVote(uint256,uint8)\":{\"details\":\"See {IGovernor-castVote}.\"},\"castVoteBySig(uint256,uint8,address,bytes)\":{\"details\":\"See {IGovernor-castVoteBySig}.\"},\"castVoteWithReason(uint256,uint8,string)\":{\"details\":\"See {IGovernor-castVoteWithReason}.\"},\"castVoteWithReasonAndParams(uint256,uint8,string,bytes)\":{\"details\":\"See {IGovernor-castVoteWithReasonAndParams}.\"},\"castVoteWithReasonAndParamsBySig(uint256,uint8,address,string,bytes,bytes)\":{\"details\":\"See {IGovernor-castVoteWithReasonAndParamsBySig}.\"},\"claimParameterUpdate(bytes)\":{\"params\":{\"proof\":\"Proof generated by home chain\"}},\"clock()\":{\"details\":\"Clock (as specified in ERC-6372) is set to match the token's clock. Fallback to block numbers if the token does not implement ERC-6372.\"},\"constructor\":{\"params\":{\"_home\":\"Chain ID where this contract is considered home\",\"_manifestoCid\":\"Initial manifesto CID\",\"_name\":\"Name of the governance contract\",\"_proposalThreshold\":\"Minimum votes needed for proposal\",\"_quorum\":\"Minimum participation percentage required\",\"_token\":\"The voting token contract address\",\"_votingDelay\":\"Time before voting begins\",\"_votingPeriod\":\"Duration of voting period\"}},\"eip712Domain()\":{\"details\":\"See {IERC-5267}.\"},\"execute(address[],uint256[],bytes[],bytes32)\":{\"details\":\"See {IGovernor-execute}.\"},\"generateParameterProof(uint8,bytes)\":{\"params\":{\"operationType\":\"Type of parameter being updated\",\"value\":\"Encoded parameter value\"},\"returns\":{\"proof\":\"Encoded proof data\"}},\"getVotes(address,uint256)\":{\"details\":\"See {IGovernor-getVotes}.\"},\"getVotesWithParams(address,uint256,bytes)\":{\"details\":\"See {IGovernor-getVotesWithParams}.\"},\"hasVoted(uint256,address)\":{\"details\":\"See {IGovernor-hasVoted}.\"},\"hashProposal(address[],uint256[],bytes[],bytes32)\":{\"details\":\"See {IGovernor-hashProposal}. The proposal id is produced by hashing the ABI encoded `targets` array, the `values` array, the `calldatas` array and the descriptionHash (bytes32 which itself is the keccak256 hash of the description string). This proposal id can be produced from the proposal data which is part of the {ProposalCreated} event. It can even be computed in advance, before the proposal is submitted. Note that the chainId and the governor address are not part of the proposal id computation. Consequently, the same proposal (with same operation and same description) will have the same id if submitted on multiple governors across multiple networks. This also means that in order to execute the same operation twice (on the same governor) the proposer will have to change the description in order to avoid proposal id conflicts.\"},\"name()\":{\"details\":\"See {IGovernor-name}.\"},\"nonces(address)\":{\"details\":\"Returns the next unused nonce for an address.\"},\"onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)\":{\"details\":\"See {IERC1155Receiver-onERC1155BatchReceived}. Receiving tokens is disabled if the governance executor is other than the governor itself (eg. when using with a timelock).\"},\"onERC1155Received(address,address,uint256,uint256,bytes)\":{\"details\":\"See {IERC1155Receiver-onERC1155Received}. Receiving tokens is disabled if the governance executor is other than the governor itself (eg. when using with a timelock).\"},\"onERC721Received(address,address,uint256,bytes)\":{\"details\":\"See {IERC721Receiver-onERC721Received}. Receiving tokens is disabled if the governance executor is other than the governor itself (eg. when using with a timelock).\"},\"proposalDeadline(uint256)\":{\"details\":\"See {IGovernor-proposalDeadline}.\"},\"proposalEta(uint256)\":{\"details\":\"See {IGovernor-proposalEta}.\"},\"proposalNeedsQueuing(uint256)\":{\"details\":\"See {IGovernor-proposalNeedsQueuing}.\"},\"proposalProposer(uint256)\":{\"details\":\"See {IGovernor-proposalProposer}.\"},\"proposalSnapshot(uint256)\":{\"details\":\"See {IGovernor-proposalSnapshot}.\"},\"proposalVotes(uint256)\":{\"details\":\"Accessor to the internal vote counts.\"},\"propose(address[],uint256[],bytes[],string)\":{\"details\":\"See {IGovernor-propose}. This function has opt-in frontrunning protection, described in {_isValidDescriptionForProposer}.\"},\"queue(address[],uint256[],bytes[],bytes32)\":{\"details\":\"See {IGovernor-queue}.\"},\"quorumDenominator()\":{\"details\":\"Returns the quorum denominator. Defaults to 100, but may be overridden.\"},\"quorumNumerator()\":{\"details\":\"Returns the current quorum numerator. See {quorumDenominator}.\"},\"quorumNumerator(uint256)\":{\"details\":\"Returns the quorum numerator at a specific timepoint. See {quorumDenominator}.\"},\"relay(address,uint256,bytes)\":{\"details\":\"Relays a transaction or function call to an arbitrary target. In cases where the governance executor is some contract other than the governor itself, like when using a timelock, this function can be invoked in a governance proposal to recover tokens or Ether that was sent to the governor contract by mistake. Note that if the executor is simply the governor itself, use of `relay` is redundant.\"},\"setManifesto(string)\":{\"params\":{\"newManifesto\":\"New manifesto CID\"}},\"setProposalThreshold(uint256)\":{\"params\":{\"newProposalThreshold\":\"New proposal threshold value\"}},\"setVotingDelay(uint48)\":{\"params\":{\"newVotingDelay\":\"New voting delay value\"}},\"setVotingPeriod(uint32)\":{\"params\":{\"newVotingPeriod\":\"New voting period value\"}},\"state(uint256)\":{\"details\":\"See {IGovernor-state}.\"},\"supportsInterface(bytes4)\":{\"details\":\"See {IERC165-supportsInterface}.\"},\"token()\":{\"details\":\"The token that voting power is sourced from.\"},\"updateQuorumNumerator(uint256)\":{\"params\":{\"newQuorumNumerator\":\"New quorum numerator value\"}},\"version()\":{\"details\":\"See {IGovernor-version}.\"}},\"title\":\"Cross-chain Governance Contract\",\"version\":1},\"userdoc\":{\"events\":{\"GovernanceParameterUpdated(uint8,uint256,uint256,uint256)\":{\"notice\":\"Emitted when a governance parameter is updated\"},\"ManifestoUpdated(string,string,uint256)\":{\"notice\":\"Emitted when the manifesto is updated\"}},\"kind\":\"user\",\"methods\":{\"claimParameterUpdate(bytes)\":{\"notice\":\"Claims a parameter update on a foreign chain\"},\"constructor\":{\"notice\":\"Initializes the governance contract\"},\"generateParameterProof(uint8,bytes)\":{\"notice\":\"Generates proof for parameter updates\"},\"home()\":{\"notice\":\"Chain ID where this contract was originally deployed\"},\"manifesto()\":{\"notice\":\"IPFS CID of the DAO's manifesto\"},\"setManifesto(string)\":{\"notice\":\"Updates the DAO's manifesto on the home chain\"},\"setProposalThreshold(uint256)\":{\"notice\":\"Updates the proposal threshold parameter on the home chain\"},\"setVotingDelay(uint48)\":{\"notice\":\"Updates the voting delay parameter on the home chain\"},\"setVotingPeriod(uint32)\":{\"notice\":\"Updates the voting period parameter on the home chain\"},\"updateQuorumNumerator(uint256)\":{\"notice\":\"Updates the quorum numerator on the home chain\"}},\"notice\":\"Implementation of a DAO with secure cross-chain synchronization capabilities\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/variants/crosschain/Gov.sol\":\"Gov\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/governance/Governor.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (governance/Governor.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {IERC721Receiver} from \\\"../token/ERC721/IERC721Receiver.sol\\\";\\nimport {IERC1155Receiver} from \\\"../token/ERC1155/IERC1155Receiver.sol\\\";\\nimport {EIP712} from \\\"../utils/cryptography/EIP712.sol\\\";\\nimport {SignatureChecker} from \\\"../utils/cryptography/SignatureChecker.sol\\\";\\nimport {IERC165, ERC165} from \\\"../utils/introspection/ERC165.sol\\\";\\nimport {SafeCast} from \\\"../utils/math/SafeCast.sol\\\";\\nimport {DoubleEndedQueue} from \\\"../utils/structs/DoubleEndedQueue.sol\\\";\\nimport {Address} from \\\"../utils/Address.sol\\\";\\nimport {Context} from \\\"../utils/Context.sol\\\";\\nimport {Nonces} from \\\"../utils/Nonces.sol\\\";\\nimport {IGovernor, IERC6372} from \\\"./IGovernor.sol\\\";\\n\\n/**\\n * @dev Core of the governance system, designed to be extended through various modules.\\n *\\n * This contract is abstract and requires several functions to be implemented in various modules:\\n *\\n * - A counting module must implement {quorum}, {_quorumReached}, {_voteSucceeded} and {_countVote}\\n * - A voting module must implement {_getVotes}\\n * - Additionally, {votingPeriod} must also be implemented\\n */\\nabstract contract Governor is Context, ERC165, EIP712, Nonces, IGovernor, IERC721Receiver, IERC1155Receiver {\\n using DoubleEndedQueue for DoubleEndedQueue.Bytes32Deque;\\n\\n bytes32 public constant BALLOT_TYPEHASH =\\n keccak256(\\\"Ballot(uint256 proposalId,uint8 support,address voter,uint256 nonce)\\\");\\n bytes32 public constant EXTENDED_BALLOT_TYPEHASH =\\n keccak256(\\n \\\"ExtendedBallot(uint256 proposalId,uint8 support,address voter,uint256 nonce,string reason,bytes params)\\\"\\n );\\n\\n struct ProposalCore {\\n address proposer;\\n uint48 voteStart;\\n uint32 voteDuration;\\n bool executed;\\n bool canceled;\\n uint48 etaSeconds;\\n }\\n\\n bytes32 private constant ALL_PROPOSAL_STATES_BITMAP = bytes32((2 ** (uint8(type(ProposalState).max) + 1)) - 1);\\n string private _name;\\n\\n mapping(uint256 proposalId => ProposalCore) private _proposals;\\n\\n // This queue keeps track of the governor operating on itself. Calls to functions protected by the {onlyGovernance}\\n // modifier needs to be whitelisted in this queue. Whitelisting is set in {execute}, consumed by the\\n // {onlyGovernance} modifier and eventually reset after {_executeOperations} completes. This ensures that the\\n // execution of {onlyGovernance} protected calls can only be achieved through successful proposals.\\n DoubleEndedQueue.Bytes32Deque private _governanceCall;\\n\\n /**\\n * @dev Restricts a function so it can only be executed through governance proposals. For example, governance\\n * parameter setters in {GovernorSettings} are protected using this modifier.\\n *\\n * The governance executing address may be different from the Governor's own address, for example it could be a\\n * timelock. This can be customized by modules by overriding {_executor}. The executor is only able to invoke these\\n * functions during the execution of the governor's {execute} function, and not under any other circumstances. Thus,\\n * for example, additional timelock proposers are not able to change governance parameters without going through the\\n * governance protocol (since v4.6).\\n */\\n modifier onlyGovernance() {\\n _checkGovernance();\\n _;\\n }\\n\\n /**\\n * @dev Sets the value for {name} and {version}\\n */\\n constructor(string memory name_) EIP712(name_, version()) {\\n _name = name_;\\n }\\n\\n /**\\n * @dev Function to receive ETH that will be handled by the governor (disabled if executor is a third party contract)\\n */\\n receive() external payable virtual {\\n if (_executor() != address(this)) {\\n revert GovernorDisabledDeposit();\\n }\\n }\\n\\n /**\\n * @dev See {IERC165-supportsInterface}.\\n */\\n function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165, ERC165) returns (bool) {\\n return\\n interfaceId == type(IGovernor).interfaceId ||\\n interfaceId == type(IERC1155Receiver).interfaceId ||\\n super.supportsInterface(interfaceId);\\n }\\n\\n /**\\n * @dev See {IGovernor-name}.\\n */\\n function name() public view virtual returns (string memory) {\\n return _name;\\n }\\n\\n /**\\n * @dev See {IGovernor-version}.\\n */\\n function version() public view virtual returns (string memory) {\\n return \\\"1\\\";\\n }\\n\\n /**\\n * @dev See {IGovernor-hashProposal}.\\n *\\n * The proposal id is produced by hashing the ABI encoded `targets` array, the `values` array, the `calldatas` array\\n * and the descriptionHash (bytes32 which itself is the keccak256 hash of the description string). This proposal id\\n * can be produced from the proposal data which is part of the {ProposalCreated} event. It can even be computed in\\n * advance, before the proposal is submitted.\\n *\\n * Note that the chainId and the governor address are not part of the proposal id computation. Consequently, the\\n * same proposal (with same operation and same description) will have the same id if submitted on multiple governors\\n * across multiple networks. This also means that in order to execute the same operation twice (on the same\\n * governor) the proposer will have to change the description in order to avoid proposal id conflicts.\\n */\\n function hashProposal(\\n address[] memory targets,\\n uint256[] memory values,\\n bytes[] memory calldatas,\\n bytes32 descriptionHash\\n ) public pure virtual returns (uint256) {\\n return uint256(keccak256(abi.encode(targets, values, calldatas, descriptionHash)));\\n }\\n\\n /**\\n * @dev See {IGovernor-state}.\\n */\\n function state(uint256 proposalId) public view virtual returns (ProposalState) {\\n // We read the struct fields into the stack at once so Solidity emits a single SLOAD\\n ProposalCore storage proposal = _proposals[proposalId];\\n bool proposalExecuted = proposal.executed;\\n bool proposalCanceled = proposal.canceled;\\n\\n if (proposalExecuted) {\\n return ProposalState.Executed;\\n }\\n\\n if (proposalCanceled) {\\n return ProposalState.Canceled;\\n }\\n\\n uint256 snapshot = proposalSnapshot(proposalId);\\n\\n if (snapshot == 0) {\\n revert GovernorNonexistentProposal(proposalId);\\n }\\n\\n uint256 currentTimepoint = clock();\\n\\n if (snapshot >= currentTimepoint) {\\n return ProposalState.Pending;\\n }\\n\\n uint256 deadline = proposalDeadline(proposalId);\\n\\n if (deadline >= currentTimepoint) {\\n return ProposalState.Active;\\n } else if (!_quorumReached(proposalId) || !_voteSucceeded(proposalId)) {\\n return ProposalState.Defeated;\\n } else if (proposalEta(proposalId) == 0) {\\n return ProposalState.Succeeded;\\n } else {\\n return ProposalState.Queued;\\n }\\n }\\n\\n /**\\n * @dev See {IGovernor-proposalThreshold}.\\n */\\n function proposalThreshold() public view virtual returns (uint256) {\\n return 0;\\n }\\n\\n /**\\n * @dev See {IGovernor-proposalSnapshot}.\\n */\\n function proposalSnapshot(uint256 proposalId) public view virtual returns (uint256) {\\n return _proposals[proposalId].voteStart;\\n }\\n\\n /**\\n * @dev See {IGovernor-proposalDeadline}.\\n */\\n function proposalDeadline(uint256 proposalId) public view virtual returns (uint256) {\\n return _proposals[proposalId].voteStart + _proposals[proposalId].voteDuration;\\n }\\n\\n /**\\n * @dev See {IGovernor-proposalProposer}.\\n */\\n function proposalProposer(uint256 proposalId) public view virtual returns (address) {\\n return _proposals[proposalId].proposer;\\n }\\n\\n /**\\n * @dev See {IGovernor-proposalEta}.\\n */\\n function proposalEta(uint256 proposalId) public view virtual returns (uint256) {\\n return _proposals[proposalId].etaSeconds;\\n }\\n\\n /**\\n * @dev See {IGovernor-proposalNeedsQueuing}.\\n */\\n function proposalNeedsQueuing(uint256) public view virtual returns (bool) {\\n return false;\\n }\\n\\n /**\\n * @dev Reverts if the `msg.sender` is not the executor. In case the executor is not this contract\\n * itself, the function reverts if `msg.data` is not whitelisted as a result of an {execute}\\n * operation. See {onlyGovernance}.\\n */\\n function _checkGovernance() internal virtual {\\n if (_executor() != _msgSender()) {\\n revert GovernorOnlyExecutor(_msgSender());\\n }\\n if (_executor() != address(this)) {\\n bytes32 msgDataHash = keccak256(_msgData());\\n // loop until popping the expected operation - throw if deque is empty (operation not authorized)\\n while (_governanceCall.popFront() != msgDataHash) {}\\n }\\n }\\n\\n /**\\n * @dev Amount of votes already cast passes the threshold limit.\\n */\\n function _quorumReached(uint256 proposalId) internal view virtual returns (bool);\\n\\n /**\\n * @dev Is the proposal successful or not.\\n */\\n function _voteSucceeded(uint256 proposalId) internal view virtual returns (bool);\\n\\n /**\\n * @dev Get the voting weight of `account` at a specific `timepoint`, for a vote as described by `params`.\\n */\\n function _getVotes(address account, uint256 timepoint, bytes memory params) internal view virtual returns (uint256);\\n\\n /**\\n * @dev Register a vote for `proposalId` by `account` with a given `support`, voting `weight` and voting `params`.\\n *\\n * Note: Support is generic and can represent various things depending on the voting system used.\\n */\\n function _countVote(\\n uint256 proposalId,\\n address account,\\n uint8 support,\\n uint256 totalWeight,\\n bytes memory params\\n ) internal virtual returns (uint256);\\n\\n /**\\n * @dev Default additional encoded parameters used by castVote methods that don't include them\\n *\\n * Note: Should be overridden by specific implementations to use an appropriate value, the\\n * meaning of the additional params, in the context of that implementation\\n */\\n function _defaultParams() internal view virtual returns (bytes memory) {\\n return \\\"\\\";\\n }\\n\\n /**\\n * @dev See {IGovernor-propose}. This function has opt-in frontrunning protection, described in {_isValidDescriptionForProposer}.\\n */\\n function propose(\\n address[] memory targets,\\n uint256[] memory values,\\n bytes[] memory calldatas,\\n string memory description\\n ) public virtual returns (uint256) {\\n address proposer = _msgSender();\\n\\n // check description restriction\\n if (!_isValidDescriptionForProposer(proposer, description)) {\\n revert GovernorRestrictedProposer(proposer);\\n }\\n\\n // check proposal threshold\\n uint256 votesThreshold = proposalThreshold();\\n if (votesThreshold > 0) {\\n uint256 proposerVotes = getVotes(proposer, clock() - 1);\\n if (proposerVotes < votesThreshold) {\\n revert GovernorInsufficientProposerVotes(proposer, proposerVotes, votesThreshold);\\n }\\n }\\n\\n return _propose(targets, values, calldatas, description, proposer);\\n }\\n\\n /**\\n * @dev Internal propose mechanism. Can be overridden to add more logic on proposal creation.\\n *\\n * Emits a {IGovernor-ProposalCreated} event.\\n */\\n function _propose(\\n address[] memory targets,\\n uint256[] memory values,\\n bytes[] memory calldatas,\\n string memory description,\\n address proposer\\n ) internal virtual returns (uint256 proposalId) {\\n proposalId = hashProposal(targets, values, calldatas, keccak256(bytes(description)));\\n\\n if (targets.length != values.length || targets.length != calldatas.length || targets.length == 0) {\\n revert GovernorInvalidProposalLength(targets.length, calldatas.length, values.length);\\n }\\n if (_proposals[proposalId].voteStart != 0) {\\n revert GovernorUnexpectedProposalState(proposalId, state(proposalId), bytes32(0));\\n }\\n\\n uint256 snapshot = clock() + votingDelay();\\n uint256 duration = votingPeriod();\\n\\n ProposalCore storage proposal = _proposals[proposalId];\\n proposal.proposer = proposer;\\n proposal.voteStart = SafeCast.toUint48(snapshot);\\n proposal.voteDuration = SafeCast.toUint32(duration);\\n\\n emit ProposalCreated(\\n proposalId,\\n proposer,\\n targets,\\n values,\\n new string[](targets.length),\\n calldatas,\\n snapshot,\\n snapshot + duration,\\n description\\n );\\n\\n // Using a named return variable to avoid stack too deep errors\\n }\\n\\n /**\\n * @dev See {IGovernor-queue}.\\n */\\n function queue(\\n address[] memory targets,\\n uint256[] memory values,\\n bytes[] memory calldatas,\\n bytes32 descriptionHash\\n ) public virtual returns (uint256) {\\n uint256 proposalId = hashProposal(targets, values, calldatas, descriptionHash);\\n\\n _validateStateBitmap(proposalId, _encodeStateBitmap(ProposalState.Succeeded));\\n\\n uint48 etaSeconds = _queueOperations(proposalId, targets, values, calldatas, descriptionHash);\\n\\n if (etaSeconds != 0) {\\n _proposals[proposalId].etaSeconds = etaSeconds;\\n emit ProposalQueued(proposalId, etaSeconds);\\n } else {\\n revert GovernorQueueNotImplemented();\\n }\\n\\n return proposalId;\\n }\\n\\n /**\\n * @dev Internal queuing mechanism. Can be overridden (without a super call) to modify the way queuing is\\n * performed (for example adding a vault/timelock).\\n *\\n * This is empty by default, and must be overridden to implement queuing.\\n *\\n * This function returns a timestamp that describes the expected ETA for execution. If the returned value is 0\\n * (which is the default value), the core will consider queueing did not succeed, and the public {queue} function\\n * will revert.\\n *\\n * NOTE: Calling this function directly will NOT check the current state of the proposal, or emit the\\n * `ProposalQueued` event. Queuing a proposal should be done using {queue}.\\n */\\n function _queueOperations(\\n uint256 /*proposalId*/,\\n address[] memory /*targets*/,\\n uint256[] memory /*values*/,\\n bytes[] memory /*calldatas*/,\\n bytes32 /*descriptionHash*/\\n ) internal virtual returns (uint48) {\\n return 0;\\n }\\n\\n /**\\n * @dev See {IGovernor-execute}.\\n */\\n function execute(\\n address[] memory targets,\\n uint256[] memory values,\\n bytes[] memory calldatas,\\n bytes32 descriptionHash\\n ) public payable virtual returns (uint256) {\\n uint256 proposalId = hashProposal(targets, values, calldatas, descriptionHash);\\n\\n _validateStateBitmap(\\n proposalId,\\n _encodeStateBitmap(ProposalState.Succeeded) | _encodeStateBitmap(ProposalState.Queued)\\n );\\n\\n // mark as executed before calls to avoid reentrancy\\n _proposals[proposalId].executed = true;\\n\\n // before execute: register governance call in queue.\\n if (_executor() != address(this)) {\\n for (uint256 i = 0; i < targets.length; ++i) {\\n if (targets[i] == address(this)) {\\n _governanceCall.pushBack(keccak256(calldatas[i]));\\n }\\n }\\n }\\n\\n _executeOperations(proposalId, targets, values, calldatas, descriptionHash);\\n\\n // after execute: cleanup governance call queue.\\n if (_executor() != address(this) && !_governanceCall.empty()) {\\n _governanceCall.clear();\\n }\\n\\n emit ProposalExecuted(proposalId);\\n\\n return proposalId;\\n }\\n\\n /**\\n * @dev Internal execution mechanism. Can be overridden (without a super call) to modify the way execution is\\n * performed (for example adding a vault/timelock).\\n *\\n * NOTE: Calling this function directly will NOT check the current state of the proposal, set the executed flag to\\n * true or emit the `ProposalExecuted` event. Executing a proposal should be done using {execute} or {_execute}.\\n */\\n function _executeOperations(\\n uint256 /* proposalId */,\\n address[] memory targets,\\n uint256[] memory values,\\n bytes[] memory calldatas,\\n bytes32 /*descriptionHash*/\\n ) internal virtual {\\n for (uint256 i = 0; i < targets.length; ++i) {\\n (bool success, bytes memory returndata) = targets[i].call{value: values[i]}(calldatas[i]);\\n Address.verifyCallResult(success, returndata);\\n }\\n }\\n\\n /**\\n * @dev See {IGovernor-cancel}.\\n */\\n function cancel(\\n address[] memory targets,\\n uint256[] memory values,\\n bytes[] memory calldatas,\\n bytes32 descriptionHash\\n ) public virtual returns (uint256) {\\n // The proposalId will be recomputed in the `_cancel` call further down. However we need the value before we\\n // do the internal call, because we need to check the proposal state BEFORE the internal `_cancel` call\\n // changes it. The `hashProposal` duplication has a cost that is limited, and that we accept.\\n uint256 proposalId = hashProposal(targets, values, calldatas, descriptionHash);\\n\\n // public cancel restrictions (on top of existing _cancel restrictions).\\n _validateStateBitmap(proposalId, _encodeStateBitmap(ProposalState.Pending));\\n if (_msgSender() != proposalProposer(proposalId)) {\\n revert GovernorOnlyProposer(_msgSender());\\n }\\n\\n return _cancel(targets, values, calldatas, descriptionHash);\\n }\\n\\n /**\\n * @dev Internal cancel mechanism with minimal restrictions. A proposal can be cancelled in any state other than\\n * Canceled, Expired, or Executed. Once cancelled a proposal can't be re-submitted.\\n *\\n * Emits a {IGovernor-ProposalCanceled} event.\\n */\\n function _cancel(\\n address[] memory targets,\\n uint256[] memory values,\\n bytes[] memory calldatas,\\n bytes32 descriptionHash\\n ) internal virtual returns (uint256) {\\n uint256 proposalId = hashProposal(targets, values, calldatas, descriptionHash);\\n\\n _validateStateBitmap(\\n proposalId,\\n ALL_PROPOSAL_STATES_BITMAP ^\\n _encodeStateBitmap(ProposalState.Canceled) ^\\n _encodeStateBitmap(ProposalState.Expired) ^\\n _encodeStateBitmap(ProposalState.Executed)\\n );\\n\\n _proposals[proposalId].canceled = true;\\n emit ProposalCanceled(proposalId);\\n\\n return proposalId;\\n }\\n\\n /**\\n * @dev See {IGovernor-getVotes}.\\n */\\n function getVotes(address account, uint256 timepoint) public view virtual returns (uint256) {\\n return _getVotes(account, timepoint, _defaultParams());\\n }\\n\\n /**\\n * @dev See {IGovernor-getVotesWithParams}.\\n */\\n function getVotesWithParams(\\n address account,\\n uint256 timepoint,\\n bytes memory params\\n ) public view virtual returns (uint256) {\\n return _getVotes(account, timepoint, params);\\n }\\n\\n /**\\n * @dev See {IGovernor-castVote}.\\n */\\n function castVote(uint256 proposalId, uint8 support) public virtual returns (uint256) {\\n address voter = _msgSender();\\n return _castVote(proposalId, voter, support, \\\"\\\");\\n }\\n\\n /**\\n * @dev See {IGovernor-castVoteWithReason}.\\n */\\n function castVoteWithReason(\\n uint256 proposalId,\\n uint8 support,\\n string calldata reason\\n ) public virtual returns (uint256) {\\n address voter = _msgSender();\\n return _castVote(proposalId, voter, support, reason);\\n }\\n\\n /**\\n * @dev See {IGovernor-castVoteWithReasonAndParams}.\\n */\\n function castVoteWithReasonAndParams(\\n uint256 proposalId,\\n uint8 support,\\n string calldata reason,\\n bytes memory params\\n ) public virtual returns (uint256) {\\n address voter = _msgSender();\\n return _castVote(proposalId, voter, support, reason, params);\\n }\\n\\n /**\\n * @dev See {IGovernor-castVoteBySig}.\\n */\\n function castVoteBySig(\\n uint256 proposalId,\\n uint8 support,\\n address voter,\\n bytes memory signature\\n ) public virtual returns (uint256) {\\n bool valid = SignatureChecker.isValidSignatureNow(\\n voter,\\n _hashTypedDataV4(keccak256(abi.encode(BALLOT_TYPEHASH, proposalId, support, voter, _useNonce(voter)))),\\n signature\\n );\\n\\n if (!valid) {\\n revert GovernorInvalidSignature(voter);\\n }\\n\\n return _castVote(proposalId, voter, support, \\\"\\\");\\n }\\n\\n /**\\n * @dev See {IGovernor-castVoteWithReasonAndParamsBySig}.\\n */\\n function castVoteWithReasonAndParamsBySig(\\n uint256 proposalId,\\n uint8 support,\\n address voter,\\n string calldata reason,\\n bytes memory params,\\n bytes memory signature\\n ) public virtual returns (uint256) {\\n bool valid = SignatureChecker.isValidSignatureNow(\\n voter,\\n _hashTypedDataV4(\\n keccak256(\\n abi.encode(\\n EXTENDED_BALLOT_TYPEHASH,\\n proposalId,\\n support,\\n voter,\\n _useNonce(voter),\\n keccak256(bytes(reason)),\\n keccak256(params)\\n )\\n )\\n ),\\n signature\\n );\\n\\n if (!valid) {\\n revert GovernorInvalidSignature(voter);\\n }\\n\\n return _castVote(proposalId, voter, support, reason, params);\\n }\\n\\n /**\\n * @dev Internal vote casting mechanism: Check that the vote is pending, that it has not been cast yet, retrieve\\n * voting weight using {IGovernor-getVotes} and call the {_countVote} internal function. Uses the _defaultParams().\\n *\\n * Emits a {IGovernor-VoteCast} event.\\n */\\n function _castVote(\\n uint256 proposalId,\\n address account,\\n uint8 support,\\n string memory reason\\n ) internal virtual returns (uint256) {\\n return _castVote(proposalId, account, support, reason, _defaultParams());\\n }\\n\\n /**\\n * @dev Internal vote casting mechanism: Check that the vote is pending, that it has not been cast yet, retrieve\\n * voting weight using {IGovernor-getVotes} and call the {_countVote} internal function.\\n *\\n * Emits a {IGovernor-VoteCast} event.\\n */\\n function _castVote(\\n uint256 proposalId,\\n address account,\\n uint8 support,\\n string memory reason,\\n bytes memory params\\n ) internal virtual returns (uint256) {\\n _validateStateBitmap(proposalId, _encodeStateBitmap(ProposalState.Active));\\n\\n uint256 totalWeight = _getVotes(account, proposalSnapshot(proposalId), params);\\n uint256 votedWeight = _countVote(proposalId, account, support, totalWeight, params);\\n\\n if (params.length == 0) {\\n emit VoteCast(account, proposalId, support, votedWeight, reason);\\n } else {\\n emit VoteCastWithParams(account, proposalId, support, votedWeight, reason, params);\\n }\\n\\n return votedWeight;\\n }\\n\\n /**\\n * @dev Relays a transaction or function call to an arbitrary target. In cases where the governance executor\\n * is some contract other than the governor itself, like when using a timelock, this function can be invoked\\n * in a governance proposal to recover tokens or Ether that was sent to the governor contract by mistake.\\n * Note that if the executor is simply the governor itself, use of `relay` is redundant.\\n */\\n function relay(address target, uint256 value, bytes calldata data) external payable virtual onlyGovernance {\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n Address.verifyCallResult(success, returndata);\\n }\\n\\n /**\\n * @dev Address through which the governor executes action. Will be overloaded by module that execute actions\\n * through another contract such as a timelock.\\n */\\n function _executor() internal view virtual returns (address) {\\n return address(this);\\n }\\n\\n /**\\n * @dev See {IERC721Receiver-onERC721Received}.\\n * Receiving tokens is disabled if the governance executor is other than the governor itself (eg. when using with a timelock).\\n */\\n function onERC721Received(address, address, uint256, bytes memory) public virtual returns (bytes4) {\\n if (_executor() != address(this)) {\\n revert GovernorDisabledDeposit();\\n }\\n return this.onERC721Received.selector;\\n }\\n\\n /**\\n * @dev See {IERC1155Receiver-onERC1155Received}.\\n * Receiving tokens is disabled if the governance executor is other than the governor itself (eg. when using with a timelock).\\n */\\n function onERC1155Received(address, address, uint256, uint256, bytes memory) public virtual returns (bytes4) {\\n if (_executor() != address(this)) {\\n revert GovernorDisabledDeposit();\\n }\\n return this.onERC1155Received.selector;\\n }\\n\\n /**\\n * @dev See {IERC1155Receiver-onERC1155BatchReceived}.\\n * Receiving tokens is disabled if the governance executor is other than the governor itself (eg. when using with a timelock).\\n */\\n function onERC1155BatchReceived(\\n address,\\n address,\\n uint256[] memory,\\n uint256[] memory,\\n bytes memory\\n ) public virtual returns (bytes4) {\\n if (_executor() != address(this)) {\\n revert GovernorDisabledDeposit();\\n }\\n return this.onERC1155BatchReceived.selector;\\n }\\n\\n /**\\n * @dev Encodes a `ProposalState` into a `bytes32` representation where each bit enabled corresponds to\\n * the underlying position in the `ProposalState` enum. For example:\\n *\\n * 0x000...10000\\n * ^^^^^^------ ...\\n * ^----- Succeeded\\n * ^---- Defeated\\n * ^--- Canceled\\n * ^-- Active\\n * ^- Pending\\n */\\n function _encodeStateBitmap(ProposalState proposalState) internal pure returns (bytes32) {\\n return bytes32(1 << uint8(proposalState));\\n }\\n\\n /**\\n * @dev Check that the current state of a proposal matches the requirements described by the `allowedStates` bitmap.\\n * This bitmap should be built using `_encodeStateBitmap`.\\n *\\n * If requirements are not met, reverts with a {GovernorUnexpectedProposalState} error.\\n */\\n function _validateStateBitmap(uint256 proposalId, bytes32 allowedStates) private view returns (ProposalState) {\\n ProposalState currentState = state(proposalId);\\n if (_encodeStateBitmap(currentState) & allowedStates == bytes32(0)) {\\n revert GovernorUnexpectedProposalState(proposalId, currentState, allowedStates);\\n }\\n return currentState;\\n }\\n\\n /*\\n * @dev Check if the proposer is authorized to submit a proposal with the given description.\\n *\\n * If the proposal description ends with `#proposer=0x???`, where `0x???` is an address written as a hex string\\n * (case insensitive), then the submission of this proposal will only be authorized to said address.\\n *\\n * This is used for frontrunning protection. By adding this pattern at the end of their proposal, one can ensure\\n * that no other address can submit the same proposal. An attacker would have to either remove or change that part,\\n * which would result in a different proposal id.\\n *\\n * If the description does not match this pattern, it is unrestricted and anyone can submit it. This includes:\\n * - If the `0x???` part is not a valid hex string.\\n * - If the `0x???` part is a valid hex string, but does not contain exactly 40 hex digits.\\n * - If it ends with the expected suffix followed by newlines or other whitespace.\\n * - If it ends with some other similar suffix, e.g. `#other=abc`.\\n * - If it does not end with any such suffix.\\n */\\n function _isValidDescriptionForProposer(\\n address proposer,\\n string memory description\\n ) internal view virtual returns (bool) {\\n uint256 len = bytes(description).length;\\n\\n // Length is too short to contain a valid proposer suffix\\n if (len < 52) {\\n return true;\\n }\\n\\n // Extract what would be the `#proposer=0x` marker beginning the suffix\\n bytes12 marker;\\n assembly (\\\"memory-safe\\\") {\\n // - Start of the string contents in memory = description + 32\\n // - First character of the marker = len - 52\\n // - Length of \\\"#proposer=0x0000000000000000000000000000000000000000\\\" = 52\\n // - We read the memory word starting at the first character of the marker:\\n // - (description + 32) + (len - 52) = description + (len - 20)\\n // - Note: Solidity will ignore anything past the first 12 bytes\\n marker := mload(add(description, sub(len, 20)))\\n }\\n\\n // If the marker is not found, there is no proposer suffix to check\\n if (marker != bytes12(\\\"#proposer=0x\\\")) {\\n return true;\\n }\\n\\n // Parse the 40 characters following the marker as uint160\\n uint160 recovered = 0;\\n for (uint256 i = len - 40; i < len; ++i) {\\n (bool isHex, uint8 value) = _tryHexToUint(bytes(description)[i]);\\n // If any of the characters is not a hex digit, ignore the suffix entirely\\n if (!isHex) {\\n return true;\\n }\\n recovered = (recovered << 4) | value;\\n }\\n\\n return recovered == uint160(proposer);\\n }\\n\\n /**\\n * @dev Try to parse a character from a string as a hex value. Returns `(true, value)` if the char is in\\n * `[0-9a-fA-F]` and `(false, 0)` otherwise. Value is guaranteed to be in the range `0 <= value < 16`\\n */\\n function _tryHexToUint(bytes1 char) private pure returns (bool isHex, uint8 value) {\\n uint8 c = uint8(char);\\n unchecked {\\n // Case 0-9\\n if (47 < c && c < 58) {\\n return (true, c - 48);\\n }\\n // Case A-F\\n else if (64 < c && c < 71) {\\n return (true, c - 55);\\n }\\n // Case a-f\\n else if (96 < c && c < 103) {\\n return (true, c - 87);\\n }\\n // Else: not a hex char\\n else {\\n return (false, 0);\\n }\\n }\\n }\\n\\n /**\\n * @inheritdoc IERC6372\\n */\\n function clock() public view virtual returns (uint48);\\n\\n /**\\n * @inheritdoc IERC6372\\n */\\n // solhint-disable-next-line func-name-mixedcase\\n function CLOCK_MODE() public view virtual returns (string memory);\\n\\n /**\\n * @inheritdoc IGovernor\\n */\\n function votingDelay() public view virtual returns (uint256);\\n\\n /**\\n * @inheritdoc IGovernor\\n */\\n function votingPeriod() public view virtual returns (uint256);\\n\\n /**\\n * @inheritdoc IGovernor\\n */\\n function quorum(uint256 timepoint) public view virtual returns (uint256);\\n}\\n\",\"keccak256\":\"0xe0f387e99c7dfcb1d3e7d2f36e408ab59a851a5e0502d21889568466a2a491bc\",\"license\":\"MIT\"},\"@openzeppelin/contracts/governance/IGovernor.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (governance/IGovernor.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {IERC165} from \\\"../interfaces/IERC165.sol\\\";\\nimport {IERC6372} from \\\"../interfaces/IERC6372.sol\\\";\\n\\n/**\\n * @dev Interface of the {Governor} core.\\n *\\n * NOTE: Event parameters lack the `indexed` keyword for compatibility with GovernorBravo events.\\n * Making event parameters `indexed` affects how events are decoded, potentially breaking existing indexers.\\n */\\ninterface IGovernor is IERC165, IERC6372 {\\n enum ProposalState {\\n Pending,\\n Active,\\n Canceled,\\n Defeated,\\n Succeeded,\\n Queued,\\n Expired,\\n Executed\\n }\\n\\n /**\\n * @dev Empty proposal or a mismatch between the parameters length for a proposal call.\\n */\\n error GovernorInvalidProposalLength(uint256 targets, uint256 calldatas, uint256 values);\\n\\n /**\\n * @dev The vote was already cast.\\n */\\n error GovernorAlreadyCastVote(address voter);\\n\\n /**\\n * @dev Token deposits are disabled in this contract.\\n */\\n error GovernorDisabledDeposit();\\n\\n /**\\n * @dev The `account` is not a proposer.\\n */\\n error GovernorOnlyProposer(address account);\\n\\n /**\\n * @dev The `account` is not the governance executor.\\n */\\n error GovernorOnlyExecutor(address account);\\n\\n /**\\n * @dev The `proposalId` doesn't exist.\\n */\\n error GovernorNonexistentProposal(uint256 proposalId);\\n\\n /**\\n * @dev The current state of a proposal is not the required for performing an operation.\\n * The `expectedStates` is a bitmap with the bits enabled for each ProposalState enum position\\n * counting from right to left.\\n *\\n * NOTE: If `expectedState` is `bytes32(0)`, the proposal is expected to not be in any state (i.e. not exist).\\n * This is the case when a proposal that is expected to be unset is already initiated (the proposal is duplicated).\\n *\\n * See {Governor-_encodeStateBitmap}.\\n */\\n error GovernorUnexpectedProposalState(uint256 proposalId, ProposalState current, bytes32 expectedStates);\\n\\n /**\\n * @dev The voting period set is not a valid period.\\n */\\n error GovernorInvalidVotingPeriod(uint256 votingPeriod);\\n\\n /**\\n * @dev The `proposer` does not have the required votes to create a proposal.\\n */\\n error GovernorInsufficientProposerVotes(address proposer, uint256 votes, uint256 threshold);\\n\\n /**\\n * @dev The `proposer` is not allowed to create a proposal.\\n */\\n error GovernorRestrictedProposer(address proposer);\\n\\n /**\\n * @dev The vote type used is not valid for the corresponding counting module.\\n */\\n error GovernorInvalidVoteType();\\n\\n /**\\n * @dev The provided params buffer is not supported by the counting module.\\n */\\n error GovernorInvalidVoteParams();\\n\\n /**\\n * @dev Queue operation is not implemented for this governor. Execute should be called directly.\\n */\\n error GovernorQueueNotImplemented();\\n\\n /**\\n * @dev The proposal hasn't been queued yet.\\n */\\n error GovernorNotQueuedProposal(uint256 proposalId);\\n\\n /**\\n * @dev The proposal has already been queued.\\n */\\n error GovernorAlreadyQueuedProposal(uint256 proposalId);\\n\\n /**\\n * @dev The provided signature is not valid for the expected `voter`.\\n * If the `voter` is a contract, the signature is not valid using {IERC1271-isValidSignature}.\\n */\\n error GovernorInvalidSignature(address voter);\\n\\n /**\\n * @dev Emitted when a proposal is created.\\n */\\n event ProposalCreated(\\n uint256 proposalId,\\n address proposer,\\n address[] targets,\\n uint256[] values,\\n string[] signatures,\\n bytes[] calldatas,\\n uint256 voteStart,\\n uint256 voteEnd,\\n string description\\n );\\n\\n /**\\n * @dev Emitted when a proposal is queued.\\n */\\n event ProposalQueued(uint256 proposalId, uint256 etaSeconds);\\n\\n /**\\n * @dev Emitted when a proposal is executed.\\n */\\n event ProposalExecuted(uint256 proposalId);\\n\\n /**\\n * @dev Emitted when a proposal is canceled.\\n */\\n event ProposalCanceled(uint256 proposalId);\\n\\n /**\\n * @dev Emitted when a vote is cast without params.\\n *\\n * Note: `support` values should be seen as buckets. Their interpretation depends on the voting module used.\\n */\\n event VoteCast(address indexed voter, uint256 proposalId, uint8 support, uint256 weight, string reason);\\n\\n /**\\n * @dev Emitted when a vote is cast with params.\\n *\\n * Note: `support` values should be seen as buckets. Their interpretation depends on the voting module used.\\n * `params` are additional encoded parameters. Their interpretation also depends on the voting module used.\\n */\\n event VoteCastWithParams(\\n address indexed voter,\\n uint256 proposalId,\\n uint8 support,\\n uint256 weight,\\n string reason,\\n bytes params\\n );\\n\\n /**\\n * @notice module:core\\n * @dev Name of the governor instance (used in building the EIP-712 domain separator).\\n */\\n function name() external view returns (string memory);\\n\\n /**\\n * @notice module:core\\n * @dev Version of the governor instance (used in building the EIP-712 domain separator). Default: \\\"1\\\"\\n */\\n function version() external view returns (string memory);\\n\\n /**\\n * @notice module:voting\\n * @dev A description of the possible `support` values for {castVote} and the way these votes are counted, meant to\\n * be consumed by UIs to show correct vote options and interpret the results. The string is a URL-encoded sequence of\\n * key-value pairs that each describe one aspect, for example `support=bravo&quorum=for,abstain`.\\n *\\n * There are 2 standard keys: `support` and `quorum`.\\n *\\n * - `support=bravo` refers to the vote options 0 = Against, 1 = For, 2 = Abstain, as in `GovernorBravo`.\\n * - `quorum=bravo` means that only For votes are counted towards quorum.\\n * - `quorum=for,abstain` means that both For and Abstain votes are counted towards quorum.\\n *\\n * If a counting module makes use of encoded `params`, it should include this under a `params` key with a unique\\n * name that describes the behavior. For example:\\n *\\n * - `params=fractional` might refer to a scheme where votes are divided fractionally between for/against/abstain.\\n * - `params=erc721` might refer to a scheme where specific NFTs are delegated to vote.\\n *\\n * NOTE: The string can be decoded by the standard\\n * https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams[`URLSearchParams`]\\n * JavaScript class.\\n */\\n // solhint-disable-next-line func-name-mixedcase\\n function COUNTING_MODE() external view returns (string memory);\\n\\n /**\\n * @notice module:core\\n * @dev Hashing function used to (re)build the proposal id from the proposal details..\\n */\\n function hashProposal(\\n address[] memory targets,\\n uint256[] memory values,\\n bytes[] memory calldatas,\\n bytes32 descriptionHash\\n ) external pure returns (uint256);\\n\\n /**\\n * @notice module:core\\n * @dev Current state of a proposal, following Compound's convention\\n */\\n function state(uint256 proposalId) external view returns (ProposalState);\\n\\n /**\\n * @notice module:core\\n * @dev The number of votes required in order for a voter to become a proposer.\\n */\\n function proposalThreshold() external view returns (uint256);\\n\\n /**\\n * @notice module:core\\n * @dev Timepoint used to retrieve user's votes and quorum. If using block number (as per Compound's Comp), the\\n * snapshot is performed at the end of this block. Hence, voting for this proposal starts at the beginning of the\\n * following block.\\n */\\n function proposalSnapshot(uint256 proposalId) external view returns (uint256);\\n\\n /**\\n * @notice module:core\\n * @dev Timepoint at which votes close. If using block number, votes close at the end of this block, so it is\\n * possible to cast a vote during this block.\\n */\\n function proposalDeadline(uint256 proposalId) external view returns (uint256);\\n\\n /**\\n * @notice module:core\\n * @dev The account that created a proposal.\\n */\\n function proposalProposer(uint256 proposalId) external view returns (address);\\n\\n /**\\n * @notice module:core\\n * @dev The time when a queued proposal becomes executable (\\\"ETA\\\"). Unlike {proposalSnapshot} and\\n * {proposalDeadline}, this doesn't use the governor clock, and instead relies on the executor's clock which may be\\n * different. In most cases this will be a timestamp.\\n */\\n function proposalEta(uint256 proposalId) external view returns (uint256);\\n\\n /**\\n * @notice module:core\\n * @dev Whether a proposal needs to be queued before execution.\\n */\\n function proposalNeedsQueuing(uint256 proposalId) external view returns (bool);\\n\\n /**\\n * @notice module:user-config\\n * @dev Delay, between the proposal is created and the vote starts. The unit this duration is expressed in depends\\n * on the clock (see ERC-6372) this contract uses.\\n *\\n * This can be increased to leave time for users to buy voting power, or delegate it, before the voting of a\\n * proposal starts.\\n *\\n * NOTE: While this interface returns a uint256, timepoints are stored as uint48 following the ERC-6372 clock type.\\n * Consequently this value must fit in a uint48 (when added to the current clock). See {IERC6372-clock}.\\n */\\n function votingDelay() external view returns (uint256);\\n\\n /**\\n * @notice module:user-config\\n * @dev Delay between the vote start and vote end. The unit this duration is expressed in depends on the clock\\n * (see ERC-6372) this contract uses.\\n *\\n * NOTE: The {votingDelay} can delay the start of the vote. This must be considered when setting the voting\\n * duration compared to the voting delay.\\n *\\n * NOTE: This value is stored when the proposal is submitted so that possible changes to the value do not affect\\n * proposals that have already been submitted. The type used to save it is a uint32. Consequently, while this\\n * interface returns a uint256, the value it returns should fit in a uint32.\\n */\\n function votingPeriod() external view returns (uint256);\\n\\n /**\\n * @notice module:user-config\\n * @dev Minimum number of cast voted required for a proposal to be successful.\\n *\\n * NOTE: The `timepoint` parameter corresponds to the snapshot used for counting vote. This allows to scale the\\n * quorum depending on values such as the totalSupply of a token at this timepoint (see {ERC20Votes}).\\n */\\n function quorum(uint256 timepoint) external view returns (uint256);\\n\\n /**\\n * @notice module:reputation\\n * @dev Voting power of an `account` at a specific `timepoint`.\\n *\\n * Note: this can be implemented in a number of ways, for example by reading the delegated balance from one (or\\n * multiple), {ERC20Votes} tokens.\\n */\\n function getVotes(address account, uint256 timepoint) external view returns (uint256);\\n\\n /**\\n * @notice module:reputation\\n * @dev Voting power of an `account` at a specific `timepoint` given additional encoded parameters.\\n */\\n function getVotesWithParams(\\n address account,\\n uint256 timepoint,\\n bytes memory params\\n ) external view returns (uint256);\\n\\n /**\\n * @notice module:voting\\n * @dev Returns whether `account` has cast a vote on `proposalId`.\\n */\\n function hasVoted(uint256 proposalId, address account) external view returns (bool);\\n\\n /**\\n * @dev Create a new proposal. Vote start after a delay specified by {IGovernor-votingDelay} and lasts for a\\n * duration specified by {IGovernor-votingPeriod}.\\n *\\n * Emits a {ProposalCreated} event.\\n *\\n * NOTE: The state of the Governor and `targets` may change between the proposal creation and its execution.\\n * This may be the result of third party actions on the targeted contracts, or other governor proposals.\\n * For example, the balance of this contract could be updated or its access control permissions may be modified,\\n * possibly compromising the proposal's ability to execute successfully (e.g. the governor doesn't have enough\\n * value to cover a proposal with multiple transfers).\\n */\\n function propose(\\n address[] memory targets,\\n uint256[] memory values,\\n bytes[] memory calldatas,\\n string memory description\\n ) external returns (uint256 proposalId);\\n\\n /**\\n * @dev Queue a proposal. Some governors require this step to be performed before execution can happen. If queuing\\n * is not necessary, this function may revert.\\n * Queuing a proposal requires the quorum to be reached, the vote to be successful, and the deadline to be reached.\\n *\\n * Emits a {ProposalQueued} event.\\n */\\n function queue(\\n address[] memory targets,\\n uint256[] memory values,\\n bytes[] memory calldatas,\\n bytes32 descriptionHash\\n ) external returns (uint256 proposalId);\\n\\n /**\\n * @dev Execute a successful proposal. This requires the quorum to be reached, the vote to be successful, and the\\n * deadline to be reached. Depending on the governor it might also be required that the proposal was queued and\\n * that some delay passed.\\n *\\n * Emits a {ProposalExecuted} event.\\n *\\n * NOTE: Some modules can modify the requirements for execution, for example by adding an additional timelock.\\n */\\n function execute(\\n address[] memory targets,\\n uint256[] memory values,\\n bytes[] memory calldatas,\\n bytes32 descriptionHash\\n ) external payable returns (uint256 proposalId);\\n\\n /**\\n * @dev Cancel a proposal. A proposal is cancellable by the proposer, but only while it is Pending state, i.e.\\n * before the vote starts.\\n *\\n * Emits a {ProposalCanceled} event.\\n */\\n function cancel(\\n address[] memory targets,\\n uint256[] memory values,\\n bytes[] memory calldatas,\\n bytes32 descriptionHash\\n ) external returns (uint256 proposalId);\\n\\n /**\\n * @dev Cast a vote\\n *\\n * Emits a {VoteCast} event.\\n */\\n function castVote(uint256 proposalId, uint8 support) external returns (uint256 balance);\\n\\n /**\\n * @dev Cast a vote with a reason\\n *\\n * Emits a {VoteCast} event.\\n */\\n function castVoteWithReason(\\n uint256 proposalId,\\n uint8 support,\\n string calldata reason\\n ) external returns (uint256 balance);\\n\\n /**\\n * @dev Cast a vote with a reason and additional encoded parameters\\n *\\n * Emits a {VoteCast} or {VoteCastWithParams} event depending on the length of params.\\n */\\n function castVoteWithReasonAndParams(\\n uint256 proposalId,\\n uint8 support,\\n string calldata reason,\\n bytes memory params\\n ) external returns (uint256 balance);\\n\\n /**\\n * @dev Cast a vote using the voter's signature, including ERC-1271 signature support.\\n *\\n * Emits a {VoteCast} event.\\n */\\n function castVoteBySig(\\n uint256 proposalId,\\n uint8 support,\\n address voter,\\n bytes memory signature\\n ) external returns (uint256 balance);\\n\\n /**\\n * @dev Cast a vote with a reason and additional encoded parameters using the voter's signature,\\n * including ERC-1271 signature support.\\n *\\n * Emits a {VoteCast} or {VoteCastWithParams} event depending on the length of params.\\n */\\n function castVoteWithReasonAndParamsBySig(\\n uint256 proposalId,\\n uint8 support,\\n address voter,\\n string calldata reason,\\n bytes memory params,\\n bytes memory signature\\n ) external returns (uint256 balance);\\n}\\n\",\"keccak256\":\"0x9406604436e6925413ab70149fec16f3b28cc9e492b2baaa09c0acefd315b2a7\",\"license\":\"MIT\"},\"@openzeppelin/contracts/governance/extensions/GovernorCountingSimple.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (governance/extensions/GovernorCountingSimple.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {Governor} from \\\"../Governor.sol\\\";\\n\\n/**\\n * @dev Extension of {Governor} for simple, 3 options, vote counting.\\n */\\nabstract contract GovernorCountingSimple is Governor {\\n /**\\n * @dev Supported vote types. Matches Governor Bravo ordering.\\n */\\n enum VoteType {\\n Against,\\n For,\\n Abstain\\n }\\n\\n struct ProposalVote {\\n uint256 againstVotes;\\n uint256 forVotes;\\n uint256 abstainVotes;\\n mapping(address voter => bool) hasVoted;\\n }\\n\\n mapping(uint256 proposalId => ProposalVote) private _proposalVotes;\\n\\n /**\\n * @dev See {IGovernor-COUNTING_MODE}.\\n */\\n // solhint-disable-next-line func-name-mixedcase\\n function COUNTING_MODE() public pure virtual override returns (string memory) {\\n return \\\"support=bravo&quorum=for,abstain\\\";\\n }\\n\\n /**\\n * @dev See {IGovernor-hasVoted}.\\n */\\n function hasVoted(uint256 proposalId, address account) public view virtual override returns (bool) {\\n return _proposalVotes[proposalId].hasVoted[account];\\n }\\n\\n /**\\n * @dev Accessor to the internal vote counts.\\n */\\n function proposalVotes(\\n uint256 proposalId\\n ) public view virtual returns (uint256 againstVotes, uint256 forVotes, uint256 abstainVotes) {\\n ProposalVote storage proposalVote = _proposalVotes[proposalId];\\n return (proposalVote.againstVotes, proposalVote.forVotes, proposalVote.abstainVotes);\\n }\\n\\n /**\\n * @dev See {Governor-_quorumReached}.\\n */\\n function _quorumReached(uint256 proposalId) internal view virtual override returns (bool) {\\n ProposalVote storage proposalVote = _proposalVotes[proposalId];\\n\\n return quorum(proposalSnapshot(proposalId)) <= proposalVote.forVotes + proposalVote.abstainVotes;\\n }\\n\\n /**\\n * @dev See {Governor-_voteSucceeded}. In this module, the forVotes must be strictly over the againstVotes.\\n */\\n function _voteSucceeded(uint256 proposalId) internal view virtual override returns (bool) {\\n ProposalVote storage proposalVote = _proposalVotes[proposalId];\\n\\n return proposalVote.forVotes > proposalVote.againstVotes;\\n }\\n\\n /**\\n * @dev See {Governor-_countVote}. In this module, the support follows the `VoteType` enum (from Governor Bravo).\\n */\\n function _countVote(\\n uint256 proposalId,\\n address account,\\n uint8 support,\\n uint256 totalWeight,\\n bytes memory // params\\n ) internal virtual override returns (uint256) {\\n ProposalVote storage proposalVote = _proposalVotes[proposalId];\\n\\n if (proposalVote.hasVoted[account]) {\\n revert GovernorAlreadyCastVote(account);\\n }\\n proposalVote.hasVoted[account] = true;\\n\\n if (support == uint8(VoteType.Against)) {\\n proposalVote.againstVotes += totalWeight;\\n } else if (support == uint8(VoteType.For)) {\\n proposalVote.forVotes += totalWeight;\\n } else if (support == uint8(VoteType.Abstain)) {\\n proposalVote.abstainVotes += totalWeight;\\n } else {\\n revert GovernorInvalidVoteType();\\n }\\n\\n return totalWeight;\\n }\\n}\\n\",\"keccak256\":\"0xdc21c15a8582ca58529bf4b63209718a86fd944cbb206a492687333fe8cce0ff\",\"license\":\"MIT\"},\"@openzeppelin/contracts/governance/extensions/GovernorSettings.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (governance/extensions/GovernorSettings.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {Governor} from \\\"../Governor.sol\\\";\\n\\n/**\\n * @dev Extension of {Governor} for settings updatable through governance.\\n */\\nabstract contract GovernorSettings is Governor {\\n // amount of token\\n uint256 private _proposalThreshold;\\n // timepoint: limited to uint48 in core (same as clock() type)\\n uint48 private _votingDelay;\\n // duration: limited to uint32 in core\\n uint32 private _votingPeriod;\\n\\n event VotingDelaySet(uint256 oldVotingDelay, uint256 newVotingDelay);\\n event VotingPeriodSet(uint256 oldVotingPeriod, uint256 newVotingPeriod);\\n event ProposalThresholdSet(uint256 oldProposalThreshold, uint256 newProposalThreshold);\\n\\n /**\\n * @dev Initialize the governance parameters.\\n */\\n constructor(uint48 initialVotingDelay, uint32 initialVotingPeriod, uint256 initialProposalThreshold) {\\n _setVotingDelay(initialVotingDelay);\\n _setVotingPeriod(initialVotingPeriod);\\n _setProposalThreshold(initialProposalThreshold);\\n }\\n\\n /**\\n * @dev See {IGovernor-votingDelay}.\\n */\\n function votingDelay() public view virtual override returns (uint256) {\\n return _votingDelay;\\n }\\n\\n /**\\n * @dev See {IGovernor-votingPeriod}.\\n */\\n function votingPeriod() public view virtual override returns (uint256) {\\n return _votingPeriod;\\n }\\n\\n /**\\n * @dev See {Governor-proposalThreshold}.\\n */\\n function proposalThreshold() public view virtual override returns (uint256) {\\n return _proposalThreshold;\\n }\\n\\n /**\\n * @dev Update the voting delay. This operation can only be performed through a governance proposal.\\n *\\n * Emits a {VotingDelaySet} event.\\n */\\n function setVotingDelay(uint48 newVotingDelay) public virtual onlyGovernance {\\n _setVotingDelay(newVotingDelay);\\n }\\n\\n /**\\n * @dev Update the voting period. This operation can only be performed through a governance proposal.\\n *\\n * Emits a {VotingPeriodSet} event.\\n */\\n function setVotingPeriod(uint32 newVotingPeriod) public virtual onlyGovernance {\\n _setVotingPeriod(newVotingPeriod);\\n }\\n\\n /**\\n * @dev Update the proposal threshold. This operation can only be performed through a governance proposal.\\n *\\n * Emits a {ProposalThresholdSet} event.\\n */\\n function setProposalThreshold(uint256 newProposalThreshold) public virtual onlyGovernance {\\n _setProposalThreshold(newProposalThreshold);\\n }\\n\\n /**\\n * @dev Internal setter for the voting delay.\\n *\\n * Emits a {VotingDelaySet} event.\\n */\\n function _setVotingDelay(uint48 newVotingDelay) internal virtual {\\n emit VotingDelaySet(_votingDelay, newVotingDelay);\\n _votingDelay = newVotingDelay;\\n }\\n\\n /**\\n * @dev Internal setter for the voting period.\\n *\\n * Emits a {VotingPeriodSet} event.\\n */\\n function _setVotingPeriod(uint32 newVotingPeriod) internal virtual {\\n if (newVotingPeriod == 0) {\\n revert GovernorInvalidVotingPeriod(0);\\n }\\n emit VotingPeriodSet(_votingPeriod, newVotingPeriod);\\n _votingPeriod = newVotingPeriod;\\n }\\n\\n /**\\n * @dev Internal setter for the proposal threshold.\\n *\\n * Emits a {ProposalThresholdSet} event.\\n */\\n function _setProposalThreshold(uint256 newProposalThreshold) internal virtual {\\n emit ProposalThresholdSet(_proposalThreshold, newProposalThreshold);\\n _proposalThreshold = newProposalThreshold;\\n }\\n}\\n\",\"keccak256\":\"0x1e0810708b8f5de8d3db73240ccee2d36a305cb904aa5acd4588834ebce6acce\",\"license\":\"MIT\"},\"@openzeppelin/contracts/governance/extensions/GovernorVotes.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (governance/extensions/GovernorVotes.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {Governor} from \\\"../Governor.sol\\\";\\nimport {IVotes} from \\\"../utils/IVotes.sol\\\";\\nimport {IERC5805} from \\\"../../interfaces/IERC5805.sol\\\";\\nimport {SafeCast} from \\\"../../utils/math/SafeCast.sol\\\";\\nimport {Time} from \\\"../../utils/types/Time.sol\\\";\\n\\n/**\\n * @dev Extension of {Governor} for voting weight extraction from an {ERC20Votes} token, or since v4.5 an {ERC721Votes}\\n * token.\\n */\\nabstract contract GovernorVotes is Governor {\\n IERC5805 private immutable _token;\\n\\n constructor(IVotes tokenAddress) {\\n _token = IERC5805(address(tokenAddress));\\n }\\n\\n /**\\n * @dev The token that voting power is sourced from.\\n */\\n function token() public view virtual returns (IERC5805) {\\n return _token;\\n }\\n\\n /**\\n * @dev Clock (as specified in ERC-6372) is set to match the token's clock. Fallback to block numbers if the token\\n * does not implement ERC-6372.\\n */\\n function clock() public view virtual override returns (uint48) {\\n try token().clock() returns (uint48 timepoint) {\\n return timepoint;\\n } catch {\\n return Time.blockNumber();\\n }\\n }\\n\\n /**\\n * @dev Machine-readable description of the clock as specified in ERC-6372.\\n */\\n // solhint-disable-next-line func-name-mixedcase\\n function CLOCK_MODE() public view virtual override returns (string memory) {\\n try token().CLOCK_MODE() returns (string memory clockmode) {\\n return clockmode;\\n } catch {\\n return \\\"mode=blocknumber&from=default\\\";\\n }\\n }\\n\\n /**\\n * Read the voting weight from the token's built in snapshot mechanism (see {Governor-_getVotes}).\\n */\\n function _getVotes(\\n address account,\\n uint256 timepoint,\\n bytes memory /*params*/\\n ) internal view virtual override returns (uint256) {\\n return token().getPastVotes(account, timepoint);\\n }\\n}\\n\",\"keccak256\":\"0x6fc0e9e0c3ed137dc2281a120cdc01b92010a26e6fd5fc4e6af08fc0f28bdb9e\",\"license\":\"MIT\"},\"@openzeppelin/contracts/governance/extensions/GovernorVotesQuorumFraction.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (governance/extensions/GovernorVotesQuorumFraction.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {GovernorVotes} from \\\"./GovernorVotes.sol\\\";\\nimport {SafeCast} from \\\"../../utils/math/SafeCast.sol\\\";\\nimport {Checkpoints} from \\\"../../utils/structs/Checkpoints.sol\\\";\\n\\n/**\\n * @dev Extension of {Governor} for voting weight extraction from an {ERC20Votes} token and a quorum expressed as a\\n * fraction of the total supply.\\n */\\nabstract contract GovernorVotesQuorumFraction is GovernorVotes {\\n using Checkpoints for Checkpoints.Trace208;\\n\\n Checkpoints.Trace208 private _quorumNumeratorHistory;\\n\\n event QuorumNumeratorUpdated(uint256 oldQuorumNumerator, uint256 newQuorumNumerator);\\n\\n /**\\n * @dev The quorum set is not a valid fraction.\\n */\\n error GovernorInvalidQuorumFraction(uint256 quorumNumerator, uint256 quorumDenominator);\\n\\n /**\\n * @dev Initialize quorum as a fraction of the token's total supply.\\n *\\n * The fraction is specified as `numerator / denominator`. By default the denominator is 100, so quorum is\\n * specified as a percent: a numerator of 10 corresponds to quorum being 10% of total supply. The denominator can be\\n * customized by overriding {quorumDenominator}.\\n */\\n constructor(uint256 quorumNumeratorValue) {\\n _updateQuorumNumerator(quorumNumeratorValue);\\n }\\n\\n /**\\n * @dev Returns the current quorum numerator. See {quorumDenominator}.\\n */\\n function quorumNumerator() public view virtual returns (uint256) {\\n return _quorumNumeratorHistory.latest();\\n }\\n\\n /**\\n * @dev Returns the quorum numerator at a specific timepoint. See {quorumDenominator}.\\n */\\n function quorumNumerator(uint256 timepoint) public view virtual returns (uint256) {\\n uint256 length = _quorumNumeratorHistory._checkpoints.length;\\n\\n // Optimistic search, check the latest checkpoint\\n Checkpoints.Checkpoint208 storage latest = _quorumNumeratorHistory._checkpoints[length - 1];\\n uint48 latestKey = latest._key;\\n uint208 latestValue = latest._value;\\n if (latestKey <= timepoint) {\\n return latestValue;\\n }\\n\\n // Otherwise, do the binary search\\n return _quorumNumeratorHistory.upperLookupRecent(SafeCast.toUint48(timepoint));\\n }\\n\\n /**\\n * @dev Returns the quorum denominator. Defaults to 100, but may be overridden.\\n */\\n function quorumDenominator() public view virtual returns (uint256) {\\n return 100;\\n }\\n\\n /**\\n * @dev Returns the quorum for a timepoint, in terms of number of votes: `supply * numerator / denominator`.\\n */\\n function quorum(uint256 timepoint) public view virtual override returns (uint256) {\\n return (token().getPastTotalSupply(timepoint) * quorumNumerator(timepoint)) / quorumDenominator();\\n }\\n\\n /**\\n * @dev Changes the quorum numerator.\\n *\\n * Emits a {QuorumNumeratorUpdated} event.\\n *\\n * Requirements:\\n *\\n * - Must be called through a governance proposal.\\n * - New numerator must be smaller or equal to the denominator.\\n */\\n function updateQuorumNumerator(uint256 newQuorumNumerator) external virtual onlyGovernance {\\n _updateQuorumNumerator(newQuorumNumerator);\\n }\\n\\n /**\\n * @dev Changes the quorum numerator.\\n *\\n * Emits a {QuorumNumeratorUpdated} event.\\n *\\n * Requirements:\\n *\\n * - New numerator must be smaller or equal to the denominator.\\n */\\n function _updateQuorumNumerator(uint256 newQuorumNumerator) internal virtual {\\n uint256 denominator = quorumDenominator();\\n if (newQuorumNumerator > denominator) {\\n revert GovernorInvalidQuorumFraction(newQuorumNumerator, denominator);\\n }\\n\\n uint256 oldQuorumNumerator = quorumNumerator();\\n _quorumNumeratorHistory.push(clock(), SafeCast.toUint208(newQuorumNumerator));\\n\\n emit QuorumNumeratorUpdated(oldQuorumNumerator, newQuorumNumerator);\\n }\\n}\\n\",\"keccak256\":\"0x5b5cdb361ed018c0162942d673c17e187c1a52ded2ce4f41e8a3f3f5d1656e00\",\"license\":\"MIT\"},\"@openzeppelin/contracts/governance/utils/IVotes.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (governance/utils/IVotes.sol)\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Common interface for {ERC20Votes}, {ERC721Votes}, and other {Votes}-enabled contracts.\\n */\\ninterface IVotes {\\n /**\\n * @dev The signature used has expired.\\n */\\n error VotesExpiredSignature(uint256 expiry);\\n\\n /**\\n * @dev Emitted when an account changes their delegate.\\n */\\n event DelegateChanged(address indexed delegator, address indexed fromDelegate, address indexed toDelegate);\\n\\n /**\\n * @dev Emitted when a token transfer or delegate change results in changes to a delegate's number of voting units.\\n */\\n event DelegateVotesChanged(address indexed delegate, uint256 previousVotes, uint256 newVotes);\\n\\n /**\\n * @dev Returns the current amount of votes that `account` has.\\n */\\n function getVotes(address account) external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of votes that `account` had at a specific moment in the past. If the `clock()` is\\n * configured to use block numbers, this will return the value at the end of the corresponding block.\\n */\\n function getPastVotes(address account, uint256 timepoint) external view returns (uint256);\\n\\n /**\\n * @dev Returns the total supply of votes available at a specific moment in the past. If the `clock()` is\\n * configured to use block numbers, this will return the value at the end of the corresponding block.\\n *\\n * NOTE: This value is the sum of all available votes, which is not necessarily the sum of all delegated votes.\\n * Votes that have not been delegated are still part of total supply, even though they would not participate in a\\n * vote.\\n */\\n function getPastTotalSupply(uint256 timepoint) external view returns (uint256);\\n\\n /**\\n * @dev Returns the delegate that `account` has chosen.\\n */\\n function delegates(address account) external view returns (address);\\n\\n /**\\n * @dev Delegates votes from the sender to `delegatee`.\\n */\\n function delegate(address delegatee) external;\\n\\n /**\\n * @dev Delegates votes from signer to `delegatee`.\\n */\\n function delegateBySig(address delegatee, uint256 nonce, uint256 expiry, uint8 v, bytes32 r, bytes32 s) external;\\n}\\n\",\"keccak256\":\"0x5e2b397ae88fd5c68e4f6762eb9f65f65c36702eb57796495f471d024ce70947\",\"license\":\"MIT\"},\"@openzeppelin/contracts/interfaces/IERC1271.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (interfaces/IERC1271.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Interface of the ERC-1271 standard signature validation method for\\n * contracts as defined in https://eips.ethereum.org/EIPS/eip-1271[ERC-1271].\\n */\\ninterface IERC1271 {\\n /**\\n * @dev Should return whether the signature provided is valid for the provided data\\n * @param hash Hash of the data to be signed\\n * @param signature Signature byte array associated with _data\\n */\\n function isValidSignature(bytes32 hash, bytes memory signature) external view returns (bytes4 magicValue);\\n}\\n\",\"keccak256\":\"0x4aaaf1c0737dd16e81f0d2b9833c549747a5ede6873bf1444bc72aa572d03e98\",\"license\":\"MIT\"},\"@openzeppelin/contracts/interfaces/IERC165.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC165.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {IERC165} from \\\"../utils/introspection/IERC165.sol\\\";\\n\",\"keccak256\":\"0xde7e9fd9aee8d4f40772f96bb3b58836cbc6dfc0227014a061947f8821ea9724\",\"license\":\"MIT\"},\"@openzeppelin/contracts/interfaces/IERC5267.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC5267.sol)\\n\\npragma solidity ^0.8.20;\\n\\ninterface IERC5267 {\\n /**\\n * @dev MAY be emitted to signal that the domain could have changed.\\n */\\n event EIP712DomainChanged();\\n\\n /**\\n * @dev returns the fields and values that describe the domain separator used by this contract for EIP-712\\n * signature.\\n */\\n function eip712Domain()\\n external\\n view\\n returns (\\n bytes1 fields,\\n string memory name,\\n string memory version,\\n uint256 chainId,\\n address verifyingContract,\\n bytes32 salt,\\n uint256[] memory extensions\\n );\\n}\\n\",\"keccak256\":\"0x92aa1df62dc3d33f1656d63bede0923e0df0b706ad4137c8b10b0a8fe549fd92\",\"license\":\"MIT\"},\"@openzeppelin/contracts/interfaces/IERC5805.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC5805.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {IVotes} from \\\"../governance/utils/IVotes.sol\\\";\\nimport {IERC6372} from \\\"./IERC6372.sol\\\";\\n\\ninterface IERC5805 is IERC6372, IVotes {}\\n\",\"keccak256\":\"0x4b9b89f91adbb7d3574f85394754cfb08c5b4eafca8a7061e2094a019ab8f818\",\"license\":\"MIT\"},\"@openzeppelin/contracts/interfaces/IERC6372.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC6372.sol)\\n\\npragma solidity ^0.8.20;\\n\\ninterface IERC6372 {\\n /**\\n * @dev Clock used for flagging checkpoints. Can be overridden to implement timestamp based checkpoints (and voting).\\n */\\n function clock() external view returns (uint48);\\n\\n /**\\n * @dev Description of the clock\\n */\\n // solhint-disable-next-line func-name-mixedcase\\n function CLOCK_MODE() external view returns (string memory);\\n}\\n\",\"keccak256\":\"0xeb2857b7dafb7e0d8526dbfe794e6c047df2851c9e6ee91dc4a55f3c34af5d33\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC1155/IERC1155Receiver.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC1155/IERC1155Receiver.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {IERC165} from \\\"../../utils/introspection/IERC165.sol\\\";\\n\\n/**\\n * @dev Interface that must be implemented by smart contracts in order to receive\\n * ERC-1155 token transfers.\\n */\\ninterface IERC1155Receiver is IERC165 {\\n /**\\n * @dev Handles the receipt of a single ERC-1155 token type. This function is\\n * called at the end of a `safeTransferFrom` after the balance has been updated.\\n *\\n * NOTE: To accept the transfer, this must return\\n * `bytes4(keccak256(\\\"onERC1155Received(address,address,uint256,uint256,bytes)\\\"))`\\n * (i.e. 0xf23a6e61, or its own function selector).\\n *\\n * @param operator The address which initiated the transfer (i.e. msg.sender)\\n * @param from The address which previously owned the token\\n * @param id The ID of the token being transferred\\n * @param value The amount of tokens being transferred\\n * @param data Additional data with no specified format\\n * @return `bytes4(keccak256(\\\"onERC1155Received(address,address,uint256,uint256,bytes)\\\"))` if transfer is allowed\\n */\\n function onERC1155Received(\\n address operator,\\n address from,\\n uint256 id,\\n uint256 value,\\n bytes calldata data\\n ) external returns (bytes4);\\n\\n /**\\n * @dev Handles the receipt of a multiple ERC-1155 token types. This function\\n * is called at the end of a `safeBatchTransferFrom` after the balances have\\n * been updated.\\n *\\n * NOTE: To accept the transfer(s), this must return\\n * `bytes4(keccak256(\\\"onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)\\\"))`\\n * (i.e. 0xbc197c81, or its own function selector).\\n *\\n * @param operator The address which initiated the batch transfer (i.e. msg.sender)\\n * @param from The address which previously owned the token\\n * @param ids An array containing ids of each token being transferred (order and length must match values array)\\n * @param values An array containing amounts of each token being transferred (order and length must match ids array)\\n * @param data Additional data with no specified format\\n * @return `bytes4(keccak256(\\\"onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)\\\"))` if transfer is allowed\\n */\\n function onERC1155BatchReceived(\\n address operator,\\n address from,\\n uint256[] calldata ids,\\n uint256[] calldata values,\\n bytes calldata data\\n ) external returns (bytes4);\\n}\\n\",\"keccak256\":\"0x61a23d601c2ab69dd726ac55058604cbda98e1d728ba31a51c379a3f9eeea715\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC721/IERC721Receiver.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @title ERC-721 token receiver interface\\n * @dev Interface for any contract that wants to support safeTransfers\\n * from ERC-721 asset contracts.\\n */\\ninterface IERC721Receiver {\\n /**\\n * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom}\\n * by `operator` from `from`, this function is called.\\n *\\n * It must return its Solidity selector to confirm the token transfer.\\n * If any other value is returned or the interface is not implemented by the recipient, the transfer will be\\n * reverted.\\n *\\n * The selector can be obtained in Solidity with `IERC721Receiver.onERC721Received.selector`.\\n */\\n function onERC721Received(\\n address operator,\\n address from,\\n uint256 tokenId,\\n bytes calldata data\\n ) external returns (bytes4);\\n}\\n\",\"keccak256\":\"0xb5afb8e8eebc4d1c6404df2f5e1e6d2c3d24fd01e5dfc855314951ecfaae462d\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {Errors} from \\\"./Errors.sol\\\";\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev There's no code at `target` (it is not a contract).\\n */\\n error AddressEmptyCode(address target);\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.8.20/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n if (address(this).balance < amount) {\\n revert Errors.InsufficientBalance(address(this).balance, amount);\\n }\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n if (!success) {\\n revert Errors.FailedCall();\\n }\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason or custom error, it is bubbled\\n * up by this function (like regular Solidity function calls). However, if\\n * the call reverted with no returned reason, this function reverts with a\\n * {Errors.FailedCall} error.\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n */\\n function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {\\n if (address(this).balance < value) {\\n revert Errors.InsufficientBalance(address(this).balance, value);\\n }\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResultFromTarget(target, success, returndata);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResultFromTarget(target, success, returndata);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResultFromTarget(target, success, returndata);\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call to smart-contract was successful, and reverts if the target\\n * was not a contract or bubbling up the revert reason (falling back to {Errors.FailedCall}) in case\\n * of an unsuccessful call.\\n */\\n function verifyCallResultFromTarget(\\n address target,\\n bool success,\\n bytes memory returndata\\n ) internal view returns (bytes memory) {\\n if (!success) {\\n _revert(returndata);\\n } else {\\n // only check if target is a contract if the call was successful and the return data is empty\\n // otherwise we already know that it was a contract\\n if (returndata.length == 0 && target.code.length == 0) {\\n revert AddressEmptyCode(target);\\n }\\n return returndata;\\n }\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call was successful, and reverts if it wasn't, either by bubbling the\\n * revert reason or with a default {Errors.FailedCall} error.\\n */\\n function verifyCallResult(bool success, bytes memory returndata) internal pure returns (bytes memory) {\\n if (!success) {\\n _revert(returndata);\\n } else {\\n return returndata;\\n }\\n }\\n\\n /**\\n * @dev Reverts with returndata if present. Otherwise reverts with {Errors.FailedCall}.\\n */\\n function _revert(bytes memory returndata) private pure {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n assembly (\\\"memory-safe\\\") {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert Errors.FailedCall();\\n }\\n }\\n}\\n\",\"keccak256\":\"0x9d8da059267bac779a2dbbb9a26c2acf00ca83085e105d62d5d4ef96054a47f5\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)\\n\\npragma solidity ^0.8.20;\\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\":\"0x493033a8d1b176a037b2cc6a04dad01a5c157722049bbecf632ca876224dd4b2\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Errors.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/Errors.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Collection of common custom errors used in multiple contracts\\n *\\n * IMPORTANT: Backwards compatibility is not guaranteed in future versions of the library.\\n * It is recommended to avoid relying on the error API for critical functionality.\\n *\\n * _Available since v5.1._\\n */\\nlibrary Errors {\\n /**\\n * @dev The ETH balance of the account is not enough to perform the operation.\\n */\\n error InsufficientBalance(uint256 balance, uint256 needed);\\n\\n /**\\n * @dev A call to an address target failed. The target may have reverted.\\n */\\n error FailedCall();\\n\\n /**\\n * @dev The deployment failed.\\n */\\n error FailedDeployment();\\n\\n /**\\n * @dev A necessary precompile is missing.\\n */\\n error MissingPrecompile(address);\\n}\\n\",\"keccak256\":\"0x6afa713bfd42cf0f7656efa91201007ac465e42049d7de1d50753a373648c123\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Nonces.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/Nonces.sol)\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Provides tracking nonces for addresses. Nonces will only increment.\\n */\\nabstract contract Nonces {\\n /**\\n * @dev The nonce used for an `account` is not the expected current nonce.\\n */\\n error InvalidAccountNonce(address account, uint256 currentNonce);\\n\\n mapping(address account => uint256) private _nonces;\\n\\n /**\\n * @dev Returns the next unused nonce for an address.\\n */\\n function nonces(address owner) public view virtual returns (uint256) {\\n return _nonces[owner];\\n }\\n\\n /**\\n * @dev Consumes a nonce.\\n *\\n * Returns the current value and increments nonce.\\n */\\n function _useNonce(address owner) internal virtual returns (uint256) {\\n // For each account, the nonce has an initial value of 0, can only be incremented by one, and cannot be\\n // decremented or reset. This guarantees that the nonce never overflows.\\n unchecked {\\n // It is important to do x++ and not ++x here.\\n return _nonces[owner]++;\\n }\\n }\\n\\n /**\\n * @dev Same as {_useNonce} but checking that `nonce` is the next valid for `owner`.\\n */\\n function _useCheckedNonce(address owner, uint256 nonce) internal virtual {\\n uint256 current = _useNonce(owner);\\n if (nonce != current) {\\n revert InvalidAccountNonce(owner, current);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x0082767004fca261c332e9ad100868327a863a88ef724e844857128845ab350f\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Panic.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/Panic.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Helper library for emitting standardized panic codes.\\n *\\n * ```solidity\\n * contract Example {\\n * using Panic for uint256;\\n *\\n * // Use any of the declared internal constants\\n * function foo() { Panic.GENERIC.panic(); }\\n *\\n * // Alternatively\\n * function foo() { Panic.panic(Panic.GENERIC); }\\n * }\\n * ```\\n *\\n * Follows the list from https://github.com/ethereum/solidity/blob/v0.8.24/libsolutil/ErrorCodes.h[libsolutil].\\n *\\n * _Available since v5.1._\\n */\\n// slither-disable-next-line unused-state\\nlibrary Panic {\\n /// @dev generic / unspecified error\\n uint256 internal constant GENERIC = 0x00;\\n /// @dev used by the assert() builtin\\n uint256 internal constant ASSERT = 0x01;\\n /// @dev arithmetic underflow or overflow\\n uint256 internal constant UNDER_OVERFLOW = 0x11;\\n /// @dev division or modulo by zero\\n uint256 internal constant DIVISION_BY_ZERO = 0x12;\\n /// @dev enum conversion error\\n uint256 internal constant ENUM_CONVERSION_ERROR = 0x21;\\n /// @dev invalid encoding in storage\\n uint256 internal constant STORAGE_ENCODING_ERROR = 0x22;\\n /// @dev empty array pop\\n uint256 internal constant EMPTY_ARRAY_POP = 0x31;\\n /// @dev array out of bounds access\\n uint256 internal constant ARRAY_OUT_OF_BOUNDS = 0x32;\\n /// @dev resource error (too large allocation or too large array)\\n uint256 internal constant RESOURCE_ERROR = 0x41;\\n /// @dev calling invalid internal function\\n uint256 internal constant INVALID_INTERNAL_FUNCTION = 0x51;\\n\\n /// @dev Reverts with a panic code. Recommended to use with\\n /// the internal constants with predefined codes.\\n function panic(uint256 code) internal pure {\\n assembly (\\\"memory-safe\\\") {\\n mstore(0x00, 0x4e487b71)\\n mstore(0x20, code)\\n revert(0x1c, 0x24)\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf7fe324703a64fc51702311dc51562d5cb1497734f074e4f483bfb6717572d7a\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/ShortStrings.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/ShortStrings.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {StorageSlot} from \\\"./StorageSlot.sol\\\";\\n\\n// | string | 0xAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA |\\n// | length | 0x BB |\\ntype ShortString is bytes32;\\n\\n/**\\n * @dev This library provides functions to convert short memory strings\\n * into a `ShortString` type that can be used as an immutable variable.\\n *\\n * Strings of arbitrary length can be optimized using this library if\\n * they are short enough (up to 31 bytes) by packing them with their\\n * length (1 byte) in a single EVM word (32 bytes). Additionally, a\\n * fallback mechanism can be used for every other case.\\n *\\n * Usage example:\\n *\\n * ```solidity\\n * contract Named {\\n * using ShortStrings for *;\\n *\\n * ShortString private immutable _name;\\n * string private _nameFallback;\\n *\\n * constructor(string memory contractName) {\\n * _name = contractName.toShortStringWithFallback(_nameFallback);\\n * }\\n *\\n * function name() external view returns (string memory) {\\n * return _name.toStringWithFallback(_nameFallback);\\n * }\\n * }\\n * ```\\n */\\nlibrary ShortStrings {\\n // Used as an identifier for strings longer than 31 bytes.\\n bytes32 private constant FALLBACK_SENTINEL = 0x00000000000000000000000000000000000000000000000000000000000000FF;\\n\\n error StringTooLong(string str);\\n error InvalidShortString();\\n\\n /**\\n * @dev Encode a string of at most 31 chars into a `ShortString`.\\n *\\n * This will trigger a `StringTooLong` error is the input string is too long.\\n */\\n function toShortString(string memory str) internal pure returns (ShortString) {\\n bytes memory bstr = bytes(str);\\n if (bstr.length > 31) {\\n revert StringTooLong(str);\\n }\\n return ShortString.wrap(bytes32(uint256(bytes32(bstr)) | bstr.length));\\n }\\n\\n /**\\n * @dev Decode a `ShortString` back to a \\\"normal\\\" string.\\n */\\n function toString(ShortString sstr) internal pure returns (string memory) {\\n uint256 len = byteLength(sstr);\\n // using `new string(len)` would work locally but is not memory safe.\\n string memory str = new string(32);\\n assembly (\\\"memory-safe\\\") {\\n mstore(str, len)\\n mstore(add(str, 0x20), sstr)\\n }\\n return str;\\n }\\n\\n /**\\n * @dev Return the length of a `ShortString`.\\n */\\n function byteLength(ShortString sstr) internal pure returns (uint256) {\\n uint256 result = uint256(ShortString.unwrap(sstr)) & 0xFF;\\n if (result > 31) {\\n revert InvalidShortString();\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Encode a string into a `ShortString`, or write it to storage if it is too long.\\n */\\n function toShortStringWithFallback(string memory value, string storage store) internal returns (ShortString) {\\n if (bytes(value).length < 32) {\\n return toShortString(value);\\n } else {\\n StorageSlot.getStringSlot(store).value = value;\\n return ShortString.wrap(FALLBACK_SENTINEL);\\n }\\n }\\n\\n /**\\n * @dev Decode a string that was encoded to `ShortString` or written to storage using {setWithFallback}.\\n */\\n function toStringWithFallback(ShortString value, string storage store) internal pure returns (string memory) {\\n if (ShortString.unwrap(value) != FALLBACK_SENTINEL) {\\n return toString(value);\\n } else {\\n return store;\\n }\\n }\\n\\n /**\\n * @dev Return the length of a string that was encoded to `ShortString` or written to storage using\\n * {setWithFallback}.\\n *\\n * WARNING: This will return the \\\"byte length\\\" of the string. This may not reflect the actual length in terms of\\n * actual characters as the UTF-8 encoding of a single character can span over multiple bytes.\\n */\\n function byteLengthWithFallback(ShortString value, string storage store) internal view returns (uint256) {\\n if (ShortString.unwrap(value) != FALLBACK_SENTINEL) {\\n return byteLength(value);\\n } else {\\n return bytes(store).length;\\n }\\n }\\n}\\n\",\"keccak256\":\"0x7d94fa0af099a2172eb01f9c8a8a443cbe7e0e43654841563e4e09968efdb549\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/StorageSlot.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/StorageSlot.sol)\\n// This file was procedurally generated from scripts/generate/templates/StorageSlot.js.\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Library for reading and writing primitive types to specific storage slots.\\n *\\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\\n * This library helps with reading and writing to such slots without the need for inline assembly.\\n *\\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\\n *\\n * Example usage to set ERC-1967 implementation slot:\\n * ```solidity\\n * contract ERC1967 {\\n * // Define the slot. Alternatively, use the SlotDerivation library to derive the slot.\\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n *\\n * function _getImplementation() internal view returns (address) {\\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n * }\\n *\\n * function _setImplementation(address newImplementation) internal {\\n * require(newImplementation.code.length > 0);\\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n * }\\n * }\\n * ```\\n *\\n * TIP: Consider using this library along with {SlotDerivation}.\\n */\\nlibrary StorageSlot {\\n struct AddressSlot {\\n address value;\\n }\\n\\n struct BooleanSlot {\\n bool value;\\n }\\n\\n struct Bytes32Slot {\\n bytes32 value;\\n }\\n\\n struct Uint256Slot {\\n uint256 value;\\n }\\n\\n struct Int256Slot {\\n int256 value;\\n }\\n\\n struct StringSlot {\\n string value;\\n }\\n\\n struct BytesSlot {\\n bytes value;\\n }\\n\\n /**\\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\\n */\\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\\n assembly (\\\"memory-safe\\\") {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns a `BooleanSlot` with member `value` located at `slot`.\\n */\\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\\n assembly (\\\"memory-safe\\\") {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns a `Bytes32Slot` with member `value` located at `slot`.\\n */\\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\\n assembly (\\\"memory-safe\\\") {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns a `Uint256Slot` with member `value` located at `slot`.\\n */\\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\\n assembly (\\\"memory-safe\\\") {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns a `Int256Slot` with member `value` located at `slot`.\\n */\\n function getInt256Slot(bytes32 slot) internal pure returns (Int256Slot storage r) {\\n assembly (\\\"memory-safe\\\") {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns a `StringSlot` with member `value` located at `slot`.\\n */\\n function getStringSlot(bytes32 slot) internal pure returns (StringSlot storage r) {\\n assembly (\\\"memory-safe\\\") {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `StringSlot` representation of the string storage pointer `store`.\\n */\\n function getStringSlot(string storage store) internal pure returns (StringSlot storage r) {\\n assembly (\\\"memory-safe\\\") {\\n r.slot := store.slot\\n }\\n }\\n\\n /**\\n * @dev Returns a `BytesSlot` with member `value` located at `slot`.\\n */\\n function getBytesSlot(bytes32 slot) internal pure returns (BytesSlot storage r) {\\n assembly (\\\"memory-safe\\\") {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `BytesSlot` representation of the bytes storage pointer `store`.\\n */\\n function getBytesSlot(bytes storage store) internal pure returns (BytesSlot storage r) {\\n assembly (\\\"memory-safe\\\") {\\n r.slot := store.slot\\n }\\n }\\n}\\n\",\"keccak256\":\"0xcf74f855663ce2ae00ed8352666b7935f6cddea2932fdf2c3ecd30a9b1cd0e97\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Strings.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/Strings.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {Math} from \\\"./math/Math.sol\\\";\\nimport {SignedMath} from \\\"./math/SignedMath.sol\\\";\\n\\n/**\\n * @dev String operations.\\n */\\nlibrary Strings {\\n bytes16 private constant HEX_DIGITS = \\\"0123456789abcdef\\\";\\n uint8 private constant ADDRESS_LENGTH = 20;\\n\\n /**\\n * @dev The `value` string doesn't fit in the specified `length`.\\n */\\n error StringsInsufficientHexLength(uint256 value, uint256 length);\\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 assembly (\\\"memory-safe\\\") {\\n ptr := add(buffer, add(32, length))\\n }\\n while (true) {\\n ptr--;\\n assembly (\\\"memory-safe\\\") {\\n mstore8(ptr, byte(mod(value, 10), HEX_DIGITS))\\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 toStringSigned(int256 value) internal pure returns (string memory) {\\n return string.concat(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 uint256 localValue = value;\\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] = HEX_DIGITS[localValue & 0xf];\\n localValue >>= 4;\\n }\\n if (localValue != 0) {\\n revert StringsInsufficientHexLength(value, length);\\n }\\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\\n * 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 Converts an `address` with fixed length of 20 bytes to its checksummed ASCII `string` hexadecimal\\n * representation, according to EIP-55.\\n */\\n function toChecksumHexString(address addr) internal pure returns (string memory) {\\n bytes memory buffer = bytes(toHexString(addr));\\n\\n // hash the hex part of buffer (skip length + 2 bytes, length 40)\\n uint256 hashValue;\\n assembly (\\\"memory-safe\\\") {\\n hashValue := shr(96, keccak256(add(buffer, 0x22), 40))\\n }\\n\\n for (uint256 i = 41; i > 1; --i) {\\n // possible values for buffer[i] are 48 (0) to 57 (9) and 97 (a) to 102 (f)\\n if (hashValue & 0xf > 7 && uint8(buffer[i]) > 96) {\\n // case shift by xoring with 0x20\\n buffer[i] ^= 0x20;\\n }\\n hashValue >>= 4;\\n }\\n return string(buffer);\\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 bytes(a).length == bytes(b).length && keccak256(bytes(a)) == keccak256(bytes(b));\\n }\\n}\\n\",\"keccak256\":\"0x725209b582291bb83058e3078624b53d15a133f7401c30295e7f3704181d2aed\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/cryptography/ECDSA.sol)\\n\\npragma solidity ^0.8.20;\\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 }\\n\\n /**\\n * @dev The signature derives the `address(0)`.\\n */\\n error ECDSAInvalidSignature();\\n\\n /**\\n * @dev The signature has an invalid length.\\n */\\n error ECDSAInvalidSignatureLength(uint256 length);\\n\\n /**\\n * @dev The signature has an S value that is in the upper half order.\\n */\\n error ECDSAInvalidSignatureS(bytes32 s);\\n\\n /**\\n * @dev Returns the address that signed a hashed message (`hash`) with `signature` or an error. This will not\\n * return address(0) without also returning an error description. Errors are documented using an enum (error type)\\n * and a bytes32 providing additional information about the error.\\n *\\n * If no error is returned, then the address can be used for verification purposes.\\n *\\n * The `ecrecover` EVM precompile 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 {MessageHashUtils-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 function tryRecover(\\n bytes32 hash,\\n bytes memory signature\\n ) internal pure returns (address recovered, RecoverError err, bytes32 errArg) {\\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 assembly (\\\"memory-safe\\\") {\\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, bytes32(signature.length));\\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 precompile 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 {MessageHashUtils-toEthSignedMessageHash} on it.\\n */\\n function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {\\n (address recovered, RecoverError error, bytes32 errorArg) = tryRecover(hash, signature);\\n _throwError(error, errorArg);\\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[ERC-2098 short signatures]\\n */\\n function tryRecover(\\n bytes32 hash,\\n bytes32 r,\\n bytes32 vs\\n ) internal pure returns (address recovered, RecoverError err, bytes32 errArg) {\\n unchecked {\\n bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff);\\n // We do not check for an overflow here since the shift operation results in 0 or 1.\\n uint8 v = uint8((uint256(vs) >> 255) + 27);\\n return tryRecover(hash, v, r, s);\\n }\\n }\\n\\n /**\\n * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately.\\n */\\n function recover(bytes32 hash, bytes32 r, bytes32 vs) internal pure returns (address) {\\n (address recovered, RecoverError error, bytes32 errorArg) = tryRecover(hash, r, vs);\\n _throwError(error, errorArg);\\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 function tryRecover(\\n bytes32 hash,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) internal pure returns (address recovered, RecoverError err, bytes32 errArg) {\\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, s);\\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, bytes32(0));\\n }\\n\\n return (signer, RecoverError.NoError, bytes32(0));\\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, bytes32 errorArg) = tryRecover(hash, v, r, s);\\n _throwError(error, errorArg);\\n return recovered;\\n }\\n\\n /**\\n * @dev Optionally reverts with the corresponding custom error according to the `error` argument provided.\\n */\\n function _throwError(RecoverError error, bytes32 errorArg) private pure {\\n if (error == RecoverError.NoError) {\\n return; // no error: do nothing\\n } else if (error == RecoverError.InvalidSignature) {\\n revert ECDSAInvalidSignature();\\n } else if (error == RecoverError.InvalidSignatureLength) {\\n revert ECDSAInvalidSignatureLength(uint256(errorArg));\\n } else if (error == RecoverError.InvalidSignatureS) {\\n revert ECDSAInvalidSignatureS(errorArg);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x69f54c02b7d81d505910ec198c11ed4c6a728418a868b906b4a0cf29946fda84\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/cryptography/EIP712.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/cryptography/EIP712.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {MessageHashUtils} from \\\"./MessageHashUtils.sol\\\";\\nimport {ShortStrings, ShortString} from \\\"../ShortStrings.sol\\\";\\nimport {IERC5267} from \\\"../../interfaces/IERC5267.sol\\\";\\n\\n/**\\n * @dev https://eips.ethereum.org/EIPS/eip-712[EIP-712] is a standard for hashing and signing of typed structured data.\\n *\\n * The encoding scheme specified in the EIP requires a domain separator and a hash of the typed structured data, whose\\n * encoding is very generic and therefore its implementation in Solidity is not feasible, thus this contract\\n * does not implement the encoding itself. Protocols need to implement the type-specific encoding they need in order to\\n * produce the hash of their typed data using a combination of `abi.encode` and `keccak256`.\\n *\\n * This contract implements the EIP-712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding\\n * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA\\n * ({_hashTypedDataV4}).\\n *\\n * The implementation of the domain separator was designed to be as efficient as possible while still properly updating\\n * the chain id to protect against replay attacks on an eventual fork of the chain.\\n *\\n * NOTE: This contract implements the version of the encoding known as \\\"v4\\\", as implemented by the JSON RPC method\\n * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask].\\n *\\n * NOTE: In the upgradeable version of this contract, the cached values will correspond to the address, and the domain\\n * separator of the implementation contract. This will cause the {_domainSeparatorV4} function to always rebuild the\\n * separator from the immutable values, which is cheaper than accessing a cached version in cold storage.\\n *\\n * @custom:oz-upgrades-unsafe-allow state-variable-immutable\\n */\\nabstract contract EIP712 is IERC5267 {\\n using ShortStrings for *;\\n\\n bytes32 private constant TYPE_HASH =\\n keccak256(\\\"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)\\\");\\n\\n // Cache the domain separator as an immutable value, but also store the chain id that it corresponds to, in order to\\n // invalidate the cached domain separator if the chain id changes.\\n bytes32 private immutable _cachedDomainSeparator;\\n uint256 private immutable _cachedChainId;\\n address private immutable _cachedThis;\\n\\n bytes32 private immutable _hashedName;\\n bytes32 private immutable _hashedVersion;\\n\\n ShortString private immutable _name;\\n ShortString private immutable _version;\\n string private _nameFallback;\\n string private _versionFallback;\\n\\n /**\\n * @dev Initializes the domain separator and parameter caches.\\n *\\n * The meaning of `name` and `version` is specified in\\n * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP-712]:\\n *\\n * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol.\\n * - `version`: the current major version of the signing domain.\\n *\\n * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart\\n * contract upgrade].\\n */\\n constructor(string memory name, string memory version) {\\n _name = name.toShortStringWithFallback(_nameFallback);\\n _version = version.toShortStringWithFallback(_versionFallback);\\n _hashedName = keccak256(bytes(name));\\n _hashedVersion = keccak256(bytes(version));\\n\\n _cachedChainId = block.chainid;\\n _cachedDomainSeparator = _buildDomainSeparator();\\n _cachedThis = address(this);\\n }\\n\\n /**\\n * @dev Returns the domain separator for the current chain.\\n */\\n function _domainSeparatorV4() internal view returns (bytes32) {\\n if (address(this) == _cachedThis && block.chainid == _cachedChainId) {\\n return _cachedDomainSeparator;\\n } else {\\n return _buildDomainSeparator();\\n }\\n }\\n\\n function _buildDomainSeparator() private view returns (bytes32) {\\n return keccak256(abi.encode(TYPE_HASH, _hashedName, _hashedVersion, block.chainid, address(this)));\\n }\\n\\n /**\\n * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this\\n * function returns the hash of the fully encoded EIP712 message for this domain.\\n *\\n * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example:\\n *\\n * ```solidity\\n * bytes32 digest = _hashTypedDataV4(keccak256(abi.encode(\\n * keccak256(\\\"Mail(address to,string contents)\\\"),\\n * mailTo,\\n * keccak256(bytes(mailContents))\\n * )));\\n * address signer = ECDSA.recover(digest, signature);\\n * ```\\n */\\n function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) {\\n return MessageHashUtils.toTypedDataHash(_domainSeparatorV4(), structHash);\\n }\\n\\n /**\\n * @dev See {IERC-5267}.\\n */\\n function eip712Domain()\\n public\\n view\\n virtual\\n returns (\\n bytes1 fields,\\n string memory name,\\n string memory version,\\n uint256 chainId,\\n address verifyingContract,\\n bytes32 salt,\\n uint256[] memory extensions\\n )\\n {\\n return (\\n hex\\\"0f\\\", // 01111\\n _EIP712Name(),\\n _EIP712Version(),\\n block.chainid,\\n address(this),\\n bytes32(0),\\n new uint256[](0)\\n );\\n }\\n\\n /**\\n * @dev The name parameter for the EIP712 domain.\\n *\\n * NOTE: By default this function reads _name which is an immutable value.\\n * It only reads from storage if necessary (in case the value is too large to fit in a ShortString).\\n */\\n // solhint-disable-next-line func-name-mixedcase\\n function _EIP712Name() internal view returns (string memory) {\\n return _name.toStringWithFallback(_nameFallback);\\n }\\n\\n /**\\n * @dev The version parameter for the EIP712 domain.\\n *\\n * NOTE: By default this function reads _version which is an immutable value.\\n * It only reads from storage if necessary (in case the value is too large to fit in a ShortString).\\n */\\n // solhint-disable-next-line func-name-mixedcase\\n function _EIP712Version() internal view returns (string memory) {\\n return _version.toStringWithFallback(_versionFallback);\\n }\\n}\\n\",\"keccak256\":\"0x10eb97d047f8d84fe263a02bb4a656ac6674f6679d74532cc37546289e073a9d\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/cryptography/MessageHashUtils.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/cryptography/MessageHashUtils.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {Strings} from \\\"../Strings.sol\\\";\\n\\n/**\\n * @dev Signature message hash utilities for producing digests to be consumed by {ECDSA} recovery or signing.\\n *\\n * The library provides methods for generating a hash of a message that conforms to the\\n * https://eips.ethereum.org/EIPS/eip-191[ERC-191] and https://eips.ethereum.org/EIPS/eip-712[EIP 712]\\n * specifications.\\n */\\nlibrary MessageHashUtils {\\n /**\\n * @dev Returns the keccak256 digest of an ERC-191 signed data with version\\n * `0x45` (`personal_sign` messages).\\n *\\n * The digest is calculated by prefixing a bytes32 `messageHash` with\\n * `\\\"\\\\x19Ethereum Signed Message:\\\\n32\\\"` and hashing the result. It corresponds with the\\n * hash signed when using the https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] JSON-RPC method.\\n *\\n * NOTE: The `messageHash` parameter is intended to be the result of hashing a raw message with\\n * keccak256, although any bytes32 value can be safely used because the final digest will\\n * be re-hashed.\\n *\\n * See {ECDSA-recover}.\\n */\\n function toEthSignedMessageHash(bytes32 messageHash) internal pure returns (bytes32 digest) {\\n assembly (\\\"memory-safe\\\") {\\n mstore(0x00, \\\"\\\\x19Ethereum Signed Message:\\\\n32\\\") // 32 is the bytes-length of messageHash\\n mstore(0x1c, messageHash) // 0x1c (28) is the length of the prefix\\n digest := keccak256(0x00, 0x3c) // 0x3c is the length of the prefix (0x1c) + messageHash (0x20)\\n }\\n }\\n\\n /**\\n * @dev Returns the keccak256 digest of an ERC-191 signed data with version\\n * `0x45` (`personal_sign` messages).\\n *\\n * The digest is calculated by prefixing an arbitrary `message` with\\n * `\\\"\\\\x19Ethereum Signed Message:\\\\n\\\" + len(message)` and hashing the result. It corresponds with the\\n * hash signed when using the https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] JSON-RPC method.\\n *\\n * See {ECDSA-recover}.\\n */\\n function toEthSignedMessageHash(bytes memory message) internal pure returns (bytes32) {\\n return\\n keccak256(bytes.concat(\\\"\\\\x19Ethereum Signed Message:\\\\n\\\", bytes(Strings.toString(message.length)), message));\\n }\\n\\n /**\\n * @dev Returns the keccak256 digest of an ERC-191 signed data with version\\n * `0x00` (data with intended validator).\\n *\\n * The digest is calculated by prefixing an arbitrary `data` with `\\\"\\\\x19\\\\x00\\\"` and the intended\\n * `validator` address. Then hashing the result.\\n *\\n * See {ECDSA-recover}.\\n */\\n function toDataWithIntendedValidatorHash(address validator, bytes memory data) internal pure returns (bytes32) {\\n return keccak256(abi.encodePacked(hex\\\"19_00\\\", validator, data));\\n }\\n\\n /**\\n * @dev Returns the keccak256 digest of an EIP-712 typed data (ERC-191 version `0x01`).\\n *\\n * The digest is calculated from a `domainSeparator` and a `structHash`, by prefixing them with\\n * `\\\\x19\\\\x01` and hashing the result. It corresponds to the hash signed by the\\n * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`] JSON-RPC method as part of EIP-712.\\n *\\n * See {ECDSA-recover}.\\n */\\n function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32 digest) {\\n assembly (\\\"memory-safe\\\") {\\n let ptr := mload(0x40)\\n mstore(ptr, hex\\\"19_01\\\")\\n mstore(add(ptr, 0x02), domainSeparator)\\n mstore(add(ptr, 0x22), structHash)\\n digest := keccak256(ptr, 0x42)\\n }\\n }\\n}\\n\",\"keccak256\":\"0x4515543bc4c78561f6bea83ecfdfc3dead55bd59858287d682045b11de1ae575\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/cryptography/SignatureChecker.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/cryptography/SignatureChecker.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {ECDSA} from \\\"./ECDSA.sol\\\";\\nimport {IERC1271} from \\\"../../interfaces/IERC1271.sol\\\";\\n\\n/**\\n * @dev Signature verification helper that can be used instead of `ECDSA.recover` to seamlessly support both ECDSA\\n * signatures from externally owned accounts (EOAs) as well as ERC-1271 signatures from smart contract wallets like\\n * Argent and Safe Wallet (previously Gnosis Safe).\\n */\\nlibrary SignatureChecker {\\n /**\\n * @dev Checks if a signature is valid for a given signer and data hash. If the signer is a smart contract, the\\n * signature is validated against that smart contract using ERC-1271, otherwise it's validated using `ECDSA.recover`.\\n *\\n * NOTE: Unlike ECDSA signatures, contract signatures are revocable, and the outcome of this function can thus\\n * change through time. It could return true at block N and false at block N+1 (or the opposite).\\n */\\n function isValidSignatureNow(address signer, bytes32 hash, bytes memory signature) internal view returns (bool) {\\n if (signer.code.length == 0) {\\n (address recovered, ECDSA.RecoverError err, ) = ECDSA.tryRecover(hash, signature);\\n return err == ECDSA.RecoverError.NoError && recovered == signer;\\n } else {\\n return isValidERC1271SignatureNow(signer, hash, signature);\\n }\\n }\\n\\n /**\\n * @dev Checks if a signature is valid for a given signer and data hash. The signature is validated\\n * against the signer smart contract using ERC-1271.\\n *\\n * NOTE: Unlike ECDSA signatures, contract signatures are revocable, and the outcome of this function can thus\\n * change through time. It could return true at block N and false at block N+1 (or the opposite).\\n */\\n function isValidERC1271SignatureNow(\\n address signer,\\n bytes32 hash,\\n bytes memory signature\\n ) internal view returns (bool) {\\n (bool success, bytes memory result) = signer.staticcall(\\n abi.encodeCall(IERC1271.isValidSignature, (hash, signature))\\n );\\n return (success &&\\n result.length >= 32 &&\\n abi.decode(result, (bytes32)) == bytes32(IERC1271.isValidSignature.selector));\\n }\\n}\\n\",\"keccak256\":\"0xbdc3bb48ccedb818cd75a6d74a16df55a822e9f6d3cc54c59f576f10aab67b5f\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/introspection/ERC165.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/introspection/ERC165.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {IERC165} from \\\"./IERC165.sol\\\";\\n\\n/**\\n * @dev Implementation of the {IERC165} interface.\\n *\\n * Contracts that want to implement ERC-165 should inherit from this contract and override {supportsInterface} to check\\n * for the additional interface id that will be supported. For example:\\n *\\n * ```solidity\\n * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\\n * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);\\n * }\\n * ```\\n */\\nabstract contract ERC165 is IERC165 {\\n /**\\n * @dev See {IERC165-supportsInterface}.\\n */\\n function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) {\\n return interfaceId == type(IERC165).interfaceId;\\n }\\n}\\n\",\"keccak256\":\"0xddce8e17e3d3f9ed818b4f4c4478a8262aab8b11ed322f1bf5ed705bb4bd97fa\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/introspection/IERC165.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/introspection/IERC165.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Interface of the ERC-165 standard, as defined in the\\n * https://eips.ethereum.org/EIPS/eip-165[ERC].\\n *\\n * Implementers can declare support of contract interfaces, which can then be\\n * queried by others ({ERC165Checker}).\\n *\\n * For an implementation, see {ERC165}.\\n */\\ninterface IERC165 {\\n /**\\n * @dev Returns true if this contract implements the interface defined by\\n * `interfaceId`. See the corresponding\\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[ERC section]\\n * to learn more about how these ids are created.\\n *\\n * This function call must use less than 30 000 gas.\\n */\\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x79796192ec90263f21b464d5bc90b777a525971d3de8232be80d9c4f9fb353b8\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/math/Math.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/math/Math.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {Panic} from \\\"../Panic.sol\\\";\\nimport {SafeCast} from \\\"./SafeCast.sol\\\";\\n\\n/**\\n * @dev Standard math utilities missing in the Solidity language.\\n */\\nlibrary Math {\\n enum Rounding {\\n Floor, // Toward negative infinity\\n Ceil, // Toward positive infinity\\n Trunc, // Toward zero\\n Expand // Away from zero\\n }\\n\\n /**\\n * @dev Returns the addition of two unsigned integers, with an success flag (no overflow).\\n */\\n function tryAdd(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\\n unchecked {\\n uint256 c = a + b;\\n if (c < a) return (false, 0);\\n return (true, c);\\n }\\n }\\n\\n /**\\n * @dev Returns the subtraction of two unsigned integers, with an success flag (no overflow).\\n */\\n function trySub(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\\n unchecked {\\n if (b > a) return (false, 0);\\n return (true, a - b);\\n }\\n }\\n\\n /**\\n * @dev Returns the multiplication of two unsigned integers, with an success flag (no overflow).\\n */\\n function tryMul(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\\n unchecked {\\n // Gas optimization: this is cheaper than requiring 'a' not being zero, but the\\n // benefit is lost if 'b' is also tested.\\n // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522\\n if (a == 0) return (true, 0);\\n uint256 c = a * b;\\n if (c / a != b) return (false, 0);\\n return (true, c);\\n }\\n }\\n\\n /**\\n * @dev Returns the division of two unsigned integers, with a success flag (no division by zero).\\n */\\n function tryDiv(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\\n unchecked {\\n if (b == 0) return (false, 0);\\n return (true, a / b);\\n }\\n }\\n\\n /**\\n * @dev Returns the remainder of dividing two unsigned integers, with a success flag (no division by zero).\\n */\\n function tryMod(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\\n unchecked {\\n if (b == 0) return (false, 0);\\n return (true, a % b);\\n }\\n }\\n\\n /**\\n * @dev Branchless ternary evaluation for `a ? b : c`. Gas costs are constant.\\n *\\n * IMPORTANT: This function may reduce bytecode size and consume less gas when used standalone.\\n * However, the compiler may optimize Solidity ternary operations (i.e. `a ? b : c`) to only compute\\n * one branch when needed, making this function more expensive.\\n */\\n function ternary(bool condition, uint256 a, uint256 b) internal pure returns (uint256) {\\n unchecked {\\n // branchless ternary works because:\\n // b ^ (a ^ b) == a\\n // b ^ 0 == b\\n return b ^ ((a ^ b) * SafeCast.toUint(condition));\\n }\\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 ternary(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 ternary(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 towards infinity instead\\n * of rounding towards zero.\\n */\\n function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {\\n if (b == 0) {\\n // Guarantee the same behavior as in a regular Solidity division.\\n Panic.panic(Panic.DIVISION_BY_ZERO);\\n }\\n\\n // The following calculation ensures accurate ceiling division without overflow.\\n // Since a is non-zero, (a - 1) / b will not overflow.\\n // The largest possible result occurs when (a - 1) / b is type(uint256).max,\\n // but the largest value we can obtain is type(uint256).max - 1, which happens\\n // when a = type(uint256).max and b = 1.\\n unchecked {\\n return SafeCast.toUint(a > 0) * ((a - 1) / b + 1);\\n }\\n }\\n\\n /**\\n * @dev Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or\\n * denominator == 0.\\n *\\n * Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv) with further edits by\\n * 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\\u00b2\\u2075\\u2076 and mod 2\\u00b2\\u2075\\u2076 - 1, then use\\n // the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256\\n // variables such that product = prod1 * 2\\u00b2\\u2075\\u2076 + prod0.\\n uint256 prod0 = x * y; // 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 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\\u00b2\\u2075\\u2076. Also prevents denominator == 0.\\n if (denominator <= prod1) {\\n Panic.panic(ternary(denominator == 0, Panic.DIVISION_BY_ZERO, Panic.UNDER_OVERFLOW));\\n }\\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.\\n // Always >= 1. See https://cs.stackexchange.com/q/138556/92363.\\n\\n uint256 twos = denominator & (0 - denominator);\\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\\u00b2\\u2075\\u2076 / 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\\u00b2\\u2075\\u2076. Now that denominator is an odd number, it has an inverse modulo 2\\u00b2\\u2075\\u2076 such\\n // that denominator * inv \\u2261 1 mod 2\\u00b2\\u2075\\u2076. Compute the inverse by starting with a seed that is correct for\\n // four bits. That is, denominator * inv \\u2261 1 mod 2\\u2074.\\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\\n // works in modular arithmetic, doubling the correct bits in each step.\\n inverse *= 2 - denominator * inverse; // inverse mod 2\\u2078\\n inverse *= 2 - denominator * inverse; // inverse mod 2\\u00b9\\u2076\\n inverse *= 2 - denominator * inverse; // inverse mod 2\\u00b3\\u00b2\\n inverse *= 2 - denominator * inverse; // inverse mod 2\\u2076\\u2074\\n inverse *= 2 - denominator * inverse; // inverse mod 2\\u00b9\\u00b2\\u2078\\n inverse *= 2 - denominator * inverse; // inverse mod 2\\u00b2\\u2075\\u2076\\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\\u00b2\\u2075\\u2076. Since the preconditions guarantee that the outcome is\\n // less than 2\\u00b2\\u2075\\u2076, 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 * @dev 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 return mulDiv(x, y, denominator) + SafeCast.toUint(unsignedRoundsUp(rounding) && mulmod(x, y, denominator) > 0);\\n }\\n\\n /**\\n * @dev Calculate the modular multiplicative inverse of a number in Z/nZ.\\n *\\n * If n is a prime, then Z/nZ is a field. In that case all elements are inversible, except 0.\\n * If n is not a prime, then Z/nZ is not a field, and some elements might not be inversible.\\n *\\n * If the input value is not inversible, 0 is returned.\\n *\\n * NOTE: If you know for sure that n is (big) a prime, it may be cheaper to use Fermat's little theorem and get the\\n * inverse using `Math.modExp(a, n - 2, n)`. See {invModPrime}.\\n */\\n function invMod(uint256 a, uint256 n) internal pure returns (uint256) {\\n unchecked {\\n if (n == 0) return 0;\\n\\n // The inverse modulo is calculated using the Extended Euclidean Algorithm (iterative version)\\n // Used to compute integers x and y such that: ax + ny = gcd(a, n).\\n // When the gcd is 1, then the inverse of a modulo n exists and it's x.\\n // ax + ny = 1\\n // ax = 1 + (-y)n\\n // ax \\u2261 1 (mod n) # x is the inverse of a modulo n\\n\\n // If the remainder is 0 the gcd is n right away.\\n uint256 remainder = a % n;\\n uint256 gcd = n;\\n\\n // Therefore the initial coefficients are:\\n // ax + ny = gcd(a, n) = n\\n // 0a + 1n = n\\n int256 x = 0;\\n int256 y = 1;\\n\\n while (remainder != 0) {\\n uint256 quotient = gcd / remainder;\\n\\n (gcd, remainder) = (\\n // The old remainder is the next gcd to try.\\n remainder,\\n // Compute the next remainder.\\n // Can't overflow given that (a % gcd) * (gcd // (a % gcd)) <= gcd\\n // where gcd is at most n (capped to type(uint256).max)\\n gcd - remainder * quotient\\n );\\n\\n (x, y) = (\\n // Increment the coefficient of a.\\n y,\\n // Decrement the coefficient of n.\\n // Can overflow, but the result is casted to uint256 so that the\\n // next value of y is \\\"wrapped around\\\" to a value between 0 and n - 1.\\n x - y * int256(quotient)\\n );\\n }\\n\\n if (gcd != 1) return 0; // No inverse exists.\\n return ternary(x < 0, n - uint256(-x), uint256(x)); // Wrap the result if it's negative.\\n }\\n }\\n\\n /**\\n * @dev Variant of {invMod}. More efficient, but only works if `p` is known to be a prime greater than `2`.\\n *\\n * From https://en.wikipedia.org/wiki/Fermat%27s_little_theorem[Fermat's little theorem], we know that if p is\\n * prime, then `a**(p-1) \\u2261 1 mod p`. As a consequence, we have `a * a**(p-2) \\u2261 1 mod p`, which means that\\n * `a**(p-2)` is the modular multiplicative inverse of a in Fp.\\n *\\n * NOTE: this function does NOT check that `p` is a prime greater than `2`.\\n */\\n function invModPrime(uint256 a, uint256 p) internal view returns (uint256) {\\n unchecked {\\n return Math.modExp(a, p - 2, p);\\n }\\n }\\n\\n /**\\n * @dev Returns the modular exponentiation of the specified base, exponent and modulus (b ** e % m)\\n *\\n * Requirements:\\n * - modulus can't be zero\\n * - underlying staticcall to precompile must succeed\\n *\\n * IMPORTANT: The result is only valid if the underlying call succeeds. When using this function, make\\n * sure the chain you're using it on supports the precompiled contract for modular exponentiation\\n * at address 0x05 as specified in https://eips.ethereum.org/EIPS/eip-198[EIP-198]. Otherwise,\\n * the underlying function will succeed given the lack of a revert, but the result may be incorrectly\\n * interpreted as 0.\\n */\\n function modExp(uint256 b, uint256 e, uint256 m) internal view returns (uint256) {\\n (bool success, uint256 result) = tryModExp(b, e, m);\\n if (!success) {\\n Panic.panic(Panic.DIVISION_BY_ZERO);\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Returns the modular exponentiation of the specified base, exponent and modulus (b ** e % m).\\n * It includes a success flag indicating if the operation succeeded. Operation will be marked as failed if trying\\n * to operate modulo 0 or if the underlying precompile reverted.\\n *\\n * IMPORTANT: The result is only valid if the success flag is true. When using this function, make sure the chain\\n * you're using it on supports the precompiled contract for modular exponentiation at address 0x05 as specified in\\n * https://eips.ethereum.org/EIPS/eip-198[EIP-198]. Otherwise, the underlying function will succeed given the lack\\n * of a revert, but the result may be incorrectly interpreted as 0.\\n */\\n function tryModExp(uint256 b, uint256 e, uint256 m) internal view returns (bool success, uint256 result) {\\n if (m == 0) return (false, 0);\\n assembly (\\\"memory-safe\\\") {\\n let ptr := mload(0x40)\\n // | Offset | Content | Content (Hex) |\\n // |-----------|------------|--------------------------------------------------------------------|\\n // | 0x00:0x1f | size of b | 0x0000000000000000000000000000000000000000000000000000000000000020 |\\n // | 0x20:0x3f | size of e | 0x0000000000000000000000000000000000000000000000000000000000000020 |\\n // | 0x40:0x5f | size of m | 0x0000000000000000000000000000000000000000000000000000000000000020 |\\n // | 0x60:0x7f | value of b | 0x<.............................................................b> |\\n // | 0x80:0x9f | value of e | 0x<.............................................................e> |\\n // | 0xa0:0xbf | value of m | 0x<.............................................................m> |\\n mstore(ptr, 0x20)\\n mstore(add(ptr, 0x20), 0x20)\\n mstore(add(ptr, 0x40), 0x20)\\n mstore(add(ptr, 0x60), b)\\n mstore(add(ptr, 0x80), e)\\n mstore(add(ptr, 0xa0), m)\\n\\n // Given the result < m, it's guaranteed to fit in 32 bytes,\\n // so we can use the memory scratch space located at offset 0.\\n success := staticcall(gas(), 0x05, ptr, 0xc0, 0x00, 0x20)\\n result := mload(0x00)\\n }\\n }\\n\\n /**\\n * @dev Variant of {modExp} that supports inputs of arbitrary length.\\n */\\n function modExp(bytes memory b, bytes memory e, bytes memory m) internal view returns (bytes memory) {\\n (bool success, bytes memory result) = tryModExp(b, e, m);\\n if (!success) {\\n Panic.panic(Panic.DIVISION_BY_ZERO);\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Variant of {tryModExp} that supports inputs of arbitrary length.\\n */\\n function tryModExp(\\n bytes memory b,\\n bytes memory e,\\n bytes memory m\\n ) internal view returns (bool success, bytes memory result) {\\n if (_zeroBytes(m)) return (false, new bytes(0));\\n\\n uint256 mLen = m.length;\\n\\n // Encode call args in result and move the free memory pointer\\n result = abi.encodePacked(b.length, e.length, mLen, b, e, m);\\n\\n assembly (\\\"memory-safe\\\") {\\n let dataPtr := add(result, 0x20)\\n // Write result on top of args to avoid allocating extra memory.\\n success := staticcall(gas(), 0x05, dataPtr, mload(result), dataPtr, mLen)\\n // Overwrite the length.\\n // result.length > returndatasize() is guaranteed because returndatasize() == m.length\\n mstore(result, mLen)\\n // Set the memory pointer after the returned data.\\n mstore(0x40, add(dataPtr, mLen))\\n }\\n }\\n\\n /**\\n * @dev Returns whether the provided byte array is zero.\\n */\\n function _zeroBytes(bytes memory byteArray) private pure returns (bool) {\\n for (uint256 i = 0; i < byteArray.length; ++i) {\\n if (byteArray[i] != 0) {\\n return false;\\n }\\n }\\n return true;\\n }\\n\\n /**\\n * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded\\n * towards zero.\\n *\\n * This method is based on Newton's method for computing square roots; the algorithm is restricted to only\\n * using integer operations.\\n */\\n function sqrt(uint256 a) internal pure returns (uint256) {\\n unchecked {\\n // Take care of easy edge cases when a == 0 or a == 1\\n if (a <= 1) {\\n return a;\\n }\\n\\n // In this function, we use Newton's method to get a root of `f(x) := x\\u00b2 - a`. It involves building a\\n // sequence x_n that converges toward sqrt(a). For each iteration x_n, we also define the error between\\n // the current value as `\\u03b5_n = | x_n - sqrt(a) |`.\\n //\\n // For our first estimation, we consider `e` the smallest power of 2 which is bigger than the square root\\n // of the target. (i.e. `2**(e-1) \\u2264 sqrt(a) < 2**e`). We know that `e \\u2264 128` because `(2\\u00b9\\u00b2\\u2078)\\u00b2 = 2\\u00b2\\u2075\\u2076` is\\n // bigger than any uint256.\\n //\\n // By noticing that\\n // `2**(e-1) \\u2264 sqrt(a) < 2**e \\u2192 (2**(e-1))\\u00b2 \\u2264 a < (2**e)\\u00b2 \\u2192 2**(2*e-2) \\u2264 a < 2**(2*e)`\\n // we can deduce that `e - 1` is `log2(a) / 2`. We can thus compute `x_n = 2**(e-1)` using a method similar\\n // to the msb function.\\n uint256 aa = a;\\n uint256 xn = 1;\\n\\n if (aa >= (1 << 128)) {\\n aa >>= 128;\\n xn <<= 64;\\n }\\n if (aa >= (1 << 64)) {\\n aa >>= 64;\\n xn <<= 32;\\n }\\n if (aa >= (1 << 32)) {\\n aa >>= 32;\\n xn <<= 16;\\n }\\n if (aa >= (1 << 16)) {\\n aa >>= 16;\\n xn <<= 8;\\n }\\n if (aa >= (1 << 8)) {\\n aa >>= 8;\\n xn <<= 4;\\n }\\n if (aa >= (1 << 4)) {\\n aa >>= 4;\\n xn <<= 2;\\n }\\n if (aa >= (1 << 2)) {\\n xn <<= 1;\\n }\\n\\n // We now have x_n such that `x_n = 2**(e-1) \\u2264 sqrt(a) < 2**e = 2 * x_n`. This implies \\u03b5_n \\u2264 2**(e-1).\\n //\\n // We can refine our estimation by noticing that the middle of that interval minimizes the error.\\n // If we move x_n to equal 2**(e-1) + 2**(e-2), then we reduce the error to \\u03b5_n \\u2264 2**(e-2).\\n // This is going to be our x_0 (and \\u03b5_0)\\n xn = (3 * xn) >> 1; // \\u03b5_0 := | x_0 - sqrt(a) | \\u2264 2**(e-2)\\n\\n // From here, Newton's method give us:\\n // x_{n+1} = (x_n + a / x_n) / 2\\n //\\n // One should note that:\\n // x_{n+1}\\u00b2 - a = ((x_n + a / x_n) / 2)\\u00b2 - a\\n // = ((x_n\\u00b2 + a) / (2 * x_n))\\u00b2 - a\\n // = (x_n\\u2074 + 2 * a * x_n\\u00b2 + a\\u00b2) / (4 * x_n\\u00b2) - a\\n // = (x_n\\u2074 + 2 * a * x_n\\u00b2 + a\\u00b2 - 4 * a * x_n\\u00b2) / (4 * x_n\\u00b2)\\n // = (x_n\\u2074 - 2 * a * x_n\\u00b2 + a\\u00b2) / (4 * x_n\\u00b2)\\n // = (x_n\\u00b2 - a)\\u00b2 / (2 * x_n)\\u00b2\\n // = ((x_n\\u00b2 - a) / (2 * x_n))\\u00b2\\n // \\u2265 0\\n // Which proves that for all n \\u2265 1, sqrt(a) \\u2264 x_n\\n //\\n // This gives us the proof of quadratic convergence of the sequence:\\n // \\u03b5_{n+1} = | x_{n+1} - sqrt(a) |\\n // = | (x_n + a / x_n) / 2 - sqrt(a) |\\n // = | (x_n\\u00b2 + a - 2*x_n*sqrt(a)) / (2 * x_n) |\\n // = | (x_n - sqrt(a))\\u00b2 / (2 * x_n) |\\n // = | \\u03b5_n\\u00b2 / (2 * x_n) |\\n // = \\u03b5_n\\u00b2 / | (2 * x_n) |\\n //\\n // For the first iteration, we have a special case where x_0 is known:\\n // \\u03b5_1 = \\u03b5_0\\u00b2 / | (2 * x_0) |\\n // \\u2264 (2**(e-2))\\u00b2 / (2 * (2**(e-1) + 2**(e-2)))\\n // \\u2264 2**(2*e-4) / (3 * 2**(e-1))\\n // \\u2264 2**(e-3) / 3\\n // \\u2264 2**(e-3-log2(3))\\n // \\u2264 2**(e-4.5)\\n //\\n // For the following iterations, we use the fact that, 2**(e-1) \\u2264 sqrt(a) \\u2264 x_n:\\n // \\u03b5_{n+1} = \\u03b5_n\\u00b2 / | (2 * x_n) |\\n // \\u2264 (2**(e-k))\\u00b2 / (2 * 2**(e-1))\\n // \\u2264 2**(2*e-2*k) / 2**e\\n // \\u2264 2**(e-2*k)\\n xn = (xn + a / xn) >> 1; // \\u03b5_1 := | x_1 - sqrt(a) | \\u2264 2**(e-4.5) -- special case, see above\\n xn = (xn + a / xn) >> 1; // \\u03b5_2 := | x_2 - sqrt(a) | \\u2264 2**(e-9) -- general case with k = 4.5\\n xn = (xn + a / xn) >> 1; // \\u03b5_3 := | x_3 - sqrt(a) | \\u2264 2**(e-18) -- general case with k = 9\\n xn = (xn + a / xn) >> 1; // \\u03b5_4 := | x_4 - sqrt(a) | \\u2264 2**(e-36) -- general case with k = 18\\n xn = (xn + a / xn) >> 1; // \\u03b5_5 := | x_5 - sqrt(a) | \\u2264 2**(e-72) -- general case with k = 36\\n xn = (xn + a / xn) >> 1; // \\u03b5_6 := | x_6 - sqrt(a) | \\u2264 2**(e-144) -- general case with k = 72\\n\\n // Because e \\u2264 128 (as discussed during the first estimation phase), we know have reached a precision\\n // \\u03b5_6 \\u2264 2**(e-144) < 1. Given we're operating on integers, then we can ensure that xn is now either\\n // sqrt(a) or sqrt(a) + 1.\\n return xn - SafeCast.toUint(xn > a / xn);\\n }\\n }\\n\\n /**\\n * @dev 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 + SafeCast.toUint(unsignedRoundsUp(rounding) && result * result < a);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 2 of a positive value rounded towards zero.\\n * Returns 0 if given 0.\\n */\\n function log2(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n uint256 exp;\\n unchecked {\\n exp = 128 * SafeCast.toUint(value > (1 << 128) - 1);\\n value >>= exp;\\n result += exp;\\n\\n exp = 64 * SafeCast.toUint(value > (1 << 64) - 1);\\n value >>= exp;\\n result += exp;\\n\\n exp = 32 * SafeCast.toUint(value > (1 << 32) - 1);\\n value >>= exp;\\n result += exp;\\n\\n exp = 16 * SafeCast.toUint(value > (1 << 16) - 1);\\n value >>= exp;\\n result += exp;\\n\\n exp = 8 * SafeCast.toUint(value > (1 << 8) - 1);\\n value >>= exp;\\n result += exp;\\n\\n exp = 4 * SafeCast.toUint(value > (1 << 4) - 1);\\n value >>= exp;\\n result += exp;\\n\\n exp = 2 * SafeCast.toUint(value > (1 << 2) - 1);\\n value >>= exp;\\n result += exp;\\n\\n result += SafeCast.toUint(value > 1);\\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 + SafeCast.toUint(unsignedRoundsUp(rounding) && 1 << result < value);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 10 of a positive value rounded towards zero.\\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 + SafeCast.toUint(unsignedRoundsUp(rounding) && 10 ** result < value);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 256 of a positive value rounded towards zero.\\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 uint256 isGt;\\n unchecked {\\n isGt = SafeCast.toUint(value > (1 << 128) - 1);\\n value >>= isGt * 128;\\n result += isGt * 16;\\n\\n isGt = SafeCast.toUint(value > (1 << 64) - 1);\\n value >>= isGt * 64;\\n result += isGt * 8;\\n\\n isGt = SafeCast.toUint(value > (1 << 32) - 1);\\n value >>= isGt * 32;\\n result += isGt * 4;\\n\\n isGt = SafeCast.toUint(value > (1 << 16) - 1);\\n value >>= isGt * 16;\\n result += isGt * 2;\\n\\n result += SafeCast.toUint(value > (1 << 8) - 1);\\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 + SafeCast.toUint(unsignedRoundsUp(rounding) && 1 << (result << 3) < value);\\n }\\n }\\n\\n /**\\n * @dev Returns whether a provided rounding mode is considered rounding up for unsigned integers.\\n */\\n function unsignedRoundsUp(Rounding rounding) internal pure returns (bool) {\\n return uint8(rounding) % 2 == 1;\\n }\\n}\\n\",\"keccak256\":\"0xa00be322d7db5786750ce0ac7e2f5b633ac30a5ed5fa1ced1e74acfc19acecea\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/math/SafeCast.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/math/SafeCast.sol)\\n// This file was procedurally generated from scripts/generate/templates/SafeCast.js.\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Wrappers over Solidity's uintXX/intXX/bool casting operators with added overflow\\n * checks.\\n *\\n * Downcasting from uint256/int256 in Solidity does not revert on overflow. This can\\n * easily result in undesired exploitation or bugs, since developers usually\\n * assume that overflows raise errors. `SafeCast` restores this intuition by\\n * reverting the transaction when such an operation overflows.\\n *\\n * Using this library instead of the unchecked operations eliminates an entire\\n * class of bugs, so it's recommended to use it always.\\n */\\nlibrary SafeCast {\\n /**\\n * @dev Value doesn't fit in an uint of `bits` size.\\n */\\n error SafeCastOverflowedUintDowncast(uint8 bits, uint256 value);\\n\\n /**\\n * @dev An int value doesn't fit in an uint of `bits` size.\\n */\\n error SafeCastOverflowedIntToUint(int256 value);\\n\\n /**\\n * @dev Value doesn't fit in an int of `bits` size.\\n */\\n error SafeCastOverflowedIntDowncast(uint8 bits, int256 value);\\n\\n /**\\n * @dev An uint value doesn't fit in an int of `bits` size.\\n */\\n error SafeCastOverflowedUintToInt(uint256 value);\\n\\n /**\\n * @dev Returns the downcasted uint248 from uint256, reverting on\\n * overflow (when the input is greater than largest uint248).\\n *\\n * Counterpart to Solidity's `uint248` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 248 bits\\n */\\n function toUint248(uint256 value) internal pure returns (uint248) {\\n if (value > type(uint248).max) {\\n revert SafeCastOverflowedUintDowncast(248, value);\\n }\\n return uint248(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint240 from uint256, reverting on\\n * overflow (when the input is greater than largest uint240).\\n *\\n * Counterpart to Solidity's `uint240` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 240 bits\\n */\\n function toUint240(uint256 value) internal pure returns (uint240) {\\n if (value > type(uint240).max) {\\n revert SafeCastOverflowedUintDowncast(240, value);\\n }\\n return uint240(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint232 from uint256, reverting on\\n * overflow (when the input is greater than largest uint232).\\n *\\n * Counterpart to Solidity's `uint232` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 232 bits\\n */\\n function toUint232(uint256 value) internal pure returns (uint232) {\\n if (value > type(uint232).max) {\\n revert SafeCastOverflowedUintDowncast(232, value);\\n }\\n return uint232(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint224 from uint256, reverting on\\n * overflow (when the input is greater than largest uint224).\\n *\\n * Counterpart to Solidity's `uint224` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 224 bits\\n */\\n function toUint224(uint256 value) internal pure returns (uint224) {\\n if (value > type(uint224).max) {\\n revert SafeCastOverflowedUintDowncast(224, value);\\n }\\n return uint224(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint216 from uint256, reverting on\\n * overflow (when the input is greater than largest uint216).\\n *\\n * Counterpart to Solidity's `uint216` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 216 bits\\n */\\n function toUint216(uint256 value) internal pure returns (uint216) {\\n if (value > type(uint216).max) {\\n revert SafeCastOverflowedUintDowncast(216, value);\\n }\\n return uint216(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint208 from uint256, reverting on\\n * overflow (when the input is greater than largest uint208).\\n *\\n * Counterpart to Solidity's `uint208` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 208 bits\\n */\\n function toUint208(uint256 value) internal pure returns (uint208) {\\n if (value > type(uint208).max) {\\n revert SafeCastOverflowedUintDowncast(208, value);\\n }\\n return uint208(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint200 from uint256, reverting on\\n * overflow (when the input is greater than largest uint200).\\n *\\n * Counterpart to Solidity's `uint200` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 200 bits\\n */\\n function toUint200(uint256 value) internal pure returns (uint200) {\\n if (value > type(uint200).max) {\\n revert SafeCastOverflowedUintDowncast(200, value);\\n }\\n return uint200(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint192 from uint256, reverting on\\n * overflow (when the input is greater than largest uint192).\\n *\\n * Counterpart to Solidity's `uint192` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 192 bits\\n */\\n function toUint192(uint256 value) internal pure returns (uint192) {\\n if (value > type(uint192).max) {\\n revert SafeCastOverflowedUintDowncast(192, value);\\n }\\n return uint192(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint184 from uint256, reverting on\\n * overflow (when the input is greater than largest uint184).\\n *\\n * Counterpart to Solidity's `uint184` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 184 bits\\n */\\n function toUint184(uint256 value) internal pure returns (uint184) {\\n if (value > type(uint184).max) {\\n revert SafeCastOverflowedUintDowncast(184, value);\\n }\\n return uint184(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint176 from uint256, reverting on\\n * overflow (when the input is greater than largest uint176).\\n *\\n * Counterpart to Solidity's `uint176` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 176 bits\\n */\\n function toUint176(uint256 value) internal pure returns (uint176) {\\n if (value > type(uint176).max) {\\n revert SafeCastOverflowedUintDowncast(176, value);\\n }\\n return uint176(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint168 from uint256, reverting on\\n * overflow (when the input is greater than largest uint168).\\n *\\n * Counterpart to Solidity's `uint168` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 168 bits\\n */\\n function toUint168(uint256 value) internal pure returns (uint168) {\\n if (value > type(uint168).max) {\\n revert SafeCastOverflowedUintDowncast(168, value);\\n }\\n return uint168(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint160 from uint256, reverting on\\n * overflow (when the input is greater than largest uint160).\\n *\\n * Counterpart to Solidity's `uint160` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 160 bits\\n */\\n function toUint160(uint256 value) internal pure returns (uint160) {\\n if (value > type(uint160).max) {\\n revert SafeCastOverflowedUintDowncast(160, value);\\n }\\n return uint160(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint152 from uint256, reverting on\\n * overflow (when the input is greater than largest uint152).\\n *\\n * Counterpart to Solidity's `uint152` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 152 bits\\n */\\n function toUint152(uint256 value) internal pure returns (uint152) {\\n if (value > type(uint152).max) {\\n revert SafeCastOverflowedUintDowncast(152, value);\\n }\\n return uint152(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint144 from uint256, reverting on\\n * overflow (when the input is greater than largest uint144).\\n *\\n * Counterpart to Solidity's `uint144` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 144 bits\\n */\\n function toUint144(uint256 value) internal pure returns (uint144) {\\n if (value > type(uint144).max) {\\n revert SafeCastOverflowedUintDowncast(144, value);\\n }\\n return uint144(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint136 from uint256, reverting on\\n * overflow (when the input is greater than largest uint136).\\n *\\n * Counterpart to Solidity's `uint136` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 136 bits\\n */\\n function toUint136(uint256 value) internal pure returns (uint136) {\\n if (value > type(uint136).max) {\\n revert SafeCastOverflowedUintDowncast(136, value);\\n }\\n return uint136(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint128 from uint256, reverting on\\n * overflow (when the input is greater than largest uint128).\\n *\\n * Counterpart to Solidity's `uint128` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 128 bits\\n */\\n function toUint128(uint256 value) internal pure returns (uint128) {\\n if (value > type(uint128).max) {\\n revert SafeCastOverflowedUintDowncast(128, value);\\n }\\n return uint128(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint120 from uint256, reverting on\\n * overflow (when the input is greater than largest uint120).\\n *\\n * Counterpart to Solidity's `uint120` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 120 bits\\n */\\n function toUint120(uint256 value) internal pure returns (uint120) {\\n if (value > type(uint120).max) {\\n revert SafeCastOverflowedUintDowncast(120, value);\\n }\\n return uint120(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint112 from uint256, reverting on\\n * overflow (when the input is greater than largest uint112).\\n *\\n * Counterpart to Solidity's `uint112` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 112 bits\\n */\\n function toUint112(uint256 value) internal pure returns (uint112) {\\n if (value > type(uint112).max) {\\n revert SafeCastOverflowedUintDowncast(112, value);\\n }\\n return uint112(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint104 from uint256, reverting on\\n * overflow (when the input is greater than largest uint104).\\n *\\n * Counterpart to Solidity's `uint104` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 104 bits\\n */\\n function toUint104(uint256 value) internal pure returns (uint104) {\\n if (value > type(uint104).max) {\\n revert SafeCastOverflowedUintDowncast(104, value);\\n }\\n return uint104(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint96 from uint256, reverting on\\n * overflow (when the input is greater than largest uint96).\\n *\\n * Counterpart to Solidity's `uint96` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 96 bits\\n */\\n function toUint96(uint256 value) internal pure returns (uint96) {\\n if (value > type(uint96).max) {\\n revert SafeCastOverflowedUintDowncast(96, value);\\n }\\n return uint96(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint88 from uint256, reverting on\\n * overflow (when the input is greater than largest uint88).\\n *\\n * Counterpart to Solidity's `uint88` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 88 bits\\n */\\n function toUint88(uint256 value) internal pure returns (uint88) {\\n if (value > type(uint88).max) {\\n revert SafeCastOverflowedUintDowncast(88, value);\\n }\\n return uint88(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint80 from uint256, reverting on\\n * overflow (when the input is greater than largest uint80).\\n *\\n * Counterpart to Solidity's `uint80` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 80 bits\\n */\\n function toUint80(uint256 value) internal pure returns (uint80) {\\n if (value > type(uint80).max) {\\n revert SafeCastOverflowedUintDowncast(80, value);\\n }\\n return uint80(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint72 from uint256, reverting on\\n * overflow (when the input is greater than largest uint72).\\n *\\n * Counterpart to Solidity's `uint72` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 72 bits\\n */\\n function toUint72(uint256 value) internal pure returns (uint72) {\\n if (value > type(uint72).max) {\\n revert SafeCastOverflowedUintDowncast(72, value);\\n }\\n return uint72(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint64 from uint256, reverting on\\n * overflow (when the input is greater than largest uint64).\\n *\\n * Counterpart to Solidity's `uint64` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 64 bits\\n */\\n function toUint64(uint256 value) internal pure returns (uint64) {\\n if (value > type(uint64).max) {\\n revert SafeCastOverflowedUintDowncast(64, value);\\n }\\n return uint64(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint56 from uint256, reverting on\\n * overflow (when the input is greater than largest uint56).\\n *\\n * Counterpart to Solidity's `uint56` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 56 bits\\n */\\n function toUint56(uint256 value) internal pure returns (uint56) {\\n if (value > type(uint56).max) {\\n revert SafeCastOverflowedUintDowncast(56, value);\\n }\\n return uint56(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint48 from uint256, reverting on\\n * overflow (when the input is greater than largest uint48).\\n *\\n * Counterpart to Solidity's `uint48` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 48 bits\\n */\\n function toUint48(uint256 value) internal pure returns (uint48) {\\n if (value > type(uint48).max) {\\n revert SafeCastOverflowedUintDowncast(48, value);\\n }\\n return uint48(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint40 from uint256, reverting on\\n * overflow (when the input is greater than largest uint40).\\n *\\n * Counterpart to Solidity's `uint40` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 40 bits\\n */\\n function toUint40(uint256 value) internal pure returns (uint40) {\\n if (value > type(uint40).max) {\\n revert SafeCastOverflowedUintDowncast(40, value);\\n }\\n return uint40(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint32 from uint256, reverting on\\n * overflow (when the input is greater than largest uint32).\\n *\\n * Counterpart to Solidity's `uint32` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 32 bits\\n */\\n function toUint32(uint256 value) internal pure returns (uint32) {\\n if (value > type(uint32).max) {\\n revert SafeCastOverflowedUintDowncast(32, value);\\n }\\n return uint32(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint24 from uint256, reverting on\\n * overflow (when the input is greater than largest uint24).\\n *\\n * Counterpart to Solidity's `uint24` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 24 bits\\n */\\n function toUint24(uint256 value) internal pure returns (uint24) {\\n if (value > type(uint24).max) {\\n revert SafeCastOverflowedUintDowncast(24, value);\\n }\\n return uint24(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint16 from uint256, reverting on\\n * overflow (when the input is greater than largest uint16).\\n *\\n * Counterpart to Solidity's `uint16` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 16 bits\\n */\\n function toUint16(uint256 value) internal pure returns (uint16) {\\n if (value > type(uint16).max) {\\n revert SafeCastOverflowedUintDowncast(16, value);\\n }\\n return uint16(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint8 from uint256, reverting on\\n * overflow (when the input is greater than largest uint8).\\n *\\n * Counterpart to Solidity's `uint8` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 8 bits\\n */\\n function toUint8(uint256 value) internal pure returns (uint8) {\\n if (value > type(uint8).max) {\\n revert SafeCastOverflowedUintDowncast(8, value);\\n }\\n return uint8(value);\\n }\\n\\n /**\\n * @dev Converts a signed int256 into an unsigned uint256.\\n *\\n * Requirements:\\n *\\n * - input must be greater than or equal to 0.\\n */\\n function toUint256(int256 value) internal pure returns (uint256) {\\n if (value < 0) {\\n revert SafeCastOverflowedIntToUint(value);\\n }\\n return uint256(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted int248 from int256, reverting on\\n * overflow (when the input is less than smallest int248 or\\n * greater than largest int248).\\n *\\n * Counterpart to Solidity's `int248` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 248 bits\\n */\\n function toInt248(int256 value) internal pure returns (int248 downcasted) {\\n downcasted = int248(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(248, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int240 from int256, reverting on\\n * overflow (when the input is less than smallest int240 or\\n * greater than largest int240).\\n *\\n * Counterpart to Solidity's `int240` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 240 bits\\n */\\n function toInt240(int256 value) internal pure returns (int240 downcasted) {\\n downcasted = int240(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(240, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int232 from int256, reverting on\\n * overflow (when the input is less than smallest int232 or\\n * greater than largest int232).\\n *\\n * Counterpart to Solidity's `int232` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 232 bits\\n */\\n function toInt232(int256 value) internal pure returns (int232 downcasted) {\\n downcasted = int232(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(232, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int224 from int256, reverting on\\n * overflow (when the input is less than smallest int224 or\\n * greater than largest int224).\\n *\\n * Counterpart to Solidity's `int224` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 224 bits\\n */\\n function toInt224(int256 value) internal pure returns (int224 downcasted) {\\n downcasted = int224(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(224, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int216 from int256, reverting on\\n * overflow (when the input is less than smallest int216 or\\n * greater than largest int216).\\n *\\n * Counterpart to Solidity's `int216` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 216 bits\\n */\\n function toInt216(int256 value) internal pure returns (int216 downcasted) {\\n downcasted = int216(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(216, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int208 from int256, reverting on\\n * overflow (when the input is less than smallest int208 or\\n * greater than largest int208).\\n *\\n * Counterpart to Solidity's `int208` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 208 bits\\n */\\n function toInt208(int256 value) internal pure returns (int208 downcasted) {\\n downcasted = int208(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(208, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int200 from int256, reverting on\\n * overflow (when the input is less than smallest int200 or\\n * greater than largest int200).\\n *\\n * Counterpart to Solidity's `int200` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 200 bits\\n */\\n function toInt200(int256 value) internal pure returns (int200 downcasted) {\\n downcasted = int200(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(200, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int192 from int256, reverting on\\n * overflow (when the input is less than smallest int192 or\\n * greater than largest int192).\\n *\\n * Counterpart to Solidity's `int192` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 192 bits\\n */\\n function toInt192(int256 value) internal pure returns (int192 downcasted) {\\n downcasted = int192(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(192, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int184 from int256, reverting on\\n * overflow (when the input is less than smallest int184 or\\n * greater than largest int184).\\n *\\n * Counterpart to Solidity's `int184` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 184 bits\\n */\\n function toInt184(int256 value) internal pure returns (int184 downcasted) {\\n downcasted = int184(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(184, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int176 from int256, reverting on\\n * overflow (when the input is less than smallest int176 or\\n * greater than largest int176).\\n *\\n * Counterpart to Solidity's `int176` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 176 bits\\n */\\n function toInt176(int256 value) internal pure returns (int176 downcasted) {\\n downcasted = int176(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(176, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int168 from int256, reverting on\\n * overflow (when the input is less than smallest int168 or\\n * greater than largest int168).\\n *\\n * Counterpart to Solidity's `int168` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 168 bits\\n */\\n function toInt168(int256 value) internal pure returns (int168 downcasted) {\\n downcasted = int168(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(168, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int160 from int256, reverting on\\n * overflow (when the input is less than smallest int160 or\\n * greater than largest int160).\\n *\\n * Counterpart to Solidity's `int160` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 160 bits\\n */\\n function toInt160(int256 value) internal pure returns (int160 downcasted) {\\n downcasted = int160(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(160, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int152 from int256, reverting on\\n * overflow (when the input is less than smallest int152 or\\n * greater than largest int152).\\n *\\n * Counterpart to Solidity's `int152` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 152 bits\\n */\\n function toInt152(int256 value) internal pure returns (int152 downcasted) {\\n downcasted = int152(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(152, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int144 from int256, reverting on\\n * overflow (when the input is less than smallest int144 or\\n * greater than largest int144).\\n *\\n * Counterpart to Solidity's `int144` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 144 bits\\n */\\n function toInt144(int256 value) internal pure returns (int144 downcasted) {\\n downcasted = int144(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(144, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int136 from int256, reverting on\\n * overflow (when the input is less than smallest int136 or\\n * greater than largest int136).\\n *\\n * Counterpart to Solidity's `int136` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 136 bits\\n */\\n function toInt136(int256 value) internal pure returns (int136 downcasted) {\\n downcasted = int136(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(136, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int128 from int256, reverting on\\n * overflow (when the input is less than smallest int128 or\\n * greater than largest int128).\\n *\\n * Counterpart to Solidity's `int128` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 128 bits\\n */\\n function toInt128(int256 value) internal pure returns (int128 downcasted) {\\n downcasted = int128(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(128, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int120 from int256, reverting on\\n * overflow (when the input is less than smallest int120 or\\n * greater than largest int120).\\n *\\n * Counterpart to Solidity's `int120` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 120 bits\\n */\\n function toInt120(int256 value) internal pure returns (int120 downcasted) {\\n downcasted = int120(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(120, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int112 from int256, reverting on\\n * overflow (when the input is less than smallest int112 or\\n * greater than largest int112).\\n *\\n * Counterpart to Solidity's `int112` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 112 bits\\n */\\n function toInt112(int256 value) internal pure returns (int112 downcasted) {\\n downcasted = int112(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(112, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int104 from int256, reverting on\\n * overflow (when the input is less than smallest int104 or\\n * greater than largest int104).\\n *\\n * Counterpart to Solidity's `int104` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 104 bits\\n */\\n function toInt104(int256 value) internal pure returns (int104 downcasted) {\\n downcasted = int104(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(104, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int96 from int256, reverting on\\n * overflow (when the input is less than smallest int96 or\\n * greater than largest int96).\\n *\\n * Counterpart to Solidity's `int96` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 96 bits\\n */\\n function toInt96(int256 value) internal pure returns (int96 downcasted) {\\n downcasted = int96(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(96, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int88 from int256, reverting on\\n * overflow (when the input is less than smallest int88 or\\n * greater than largest int88).\\n *\\n * Counterpart to Solidity's `int88` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 88 bits\\n */\\n function toInt88(int256 value) internal pure returns (int88 downcasted) {\\n downcasted = int88(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(88, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int80 from int256, reverting on\\n * overflow (when the input is less than smallest int80 or\\n * greater than largest int80).\\n *\\n * Counterpart to Solidity's `int80` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 80 bits\\n */\\n function toInt80(int256 value) internal pure returns (int80 downcasted) {\\n downcasted = int80(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(80, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int72 from int256, reverting on\\n * overflow (when the input is less than smallest int72 or\\n * greater than largest int72).\\n *\\n * Counterpart to Solidity's `int72` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 72 bits\\n */\\n function toInt72(int256 value) internal pure returns (int72 downcasted) {\\n downcasted = int72(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(72, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int64 from int256, reverting on\\n * overflow (when the input is less than smallest int64 or\\n * greater than largest int64).\\n *\\n * Counterpart to Solidity's `int64` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 64 bits\\n */\\n function toInt64(int256 value) internal pure returns (int64 downcasted) {\\n downcasted = int64(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(64, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int56 from int256, reverting on\\n * overflow (when the input is less than smallest int56 or\\n * greater than largest int56).\\n *\\n * Counterpart to Solidity's `int56` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 56 bits\\n */\\n function toInt56(int256 value) internal pure returns (int56 downcasted) {\\n downcasted = int56(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(56, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int48 from int256, reverting on\\n * overflow (when the input is less than smallest int48 or\\n * greater than largest int48).\\n *\\n * Counterpart to Solidity's `int48` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 48 bits\\n */\\n function toInt48(int256 value) internal pure returns (int48 downcasted) {\\n downcasted = int48(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(48, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int40 from int256, reverting on\\n * overflow (when the input is less than smallest int40 or\\n * greater than largest int40).\\n *\\n * Counterpart to Solidity's `int40` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 40 bits\\n */\\n function toInt40(int256 value) internal pure returns (int40 downcasted) {\\n downcasted = int40(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(40, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int32 from int256, reverting on\\n * overflow (when the input is less than smallest int32 or\\n * greater than largest int32).\\n *\\n * Counterpart to Solidity's `int32` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 32 bits\\n */\\n function toInt32(int256 value) internal pure returns (int32 downcasted) {\\n downcasted = int32(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(32, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int24 from int256, reverting on\\n * overflow (when the input is less than smallest int24 or\\n * greater than largest int24).\\n *\\n * Counterpart to Solidity's `int24` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 24 bits\\n */\\n function toInt24(int256 value) internal pure returns (int24 downcasted) {\\n downcasted = int24(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(24, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int16 from int256, reverting on\\n * overflow (when the input is less than smallest int16 or\\n * greater than largest int16).\\n *\\n * Counterpart to Solidity's `int16` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 16 bits\\n */\\n function toInt16(int256 value) internal pure returns (int16 downcasted) {\\n downcasted = int16(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(16, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int8 from int256, reverting on\\n * overflow (when the input is less than smallest int8 or\\n * greater than largest int8).\\n *\\n * Counterpart to Solidity's `int8` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 8 bits\\n */\\n function toInt8(int256 value) internal pure returns (int8 downcasted) {\\n downcasted = int8(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(8, value);\\n }\\n }\\n\\n /**\\n * @dev Converts an unsigned uint256 into a signed int256.\\n *\\n * Requirements:\\n *\\n * - input must be less than or equal to maxInt256.\\n */\\n function toInt256(uint256 value) internal pure returns (int256) {\\n // Note: Unsafe cast below is okay because `type(int256).max` is guaranteed to be positive\\n if (value > uint256(type(int256).max)) {\\n revert SafeCastOverflowedUintToInt(value);\\n }\\n return int256(value);\\n }\\n\\n /**\\n * @dev Cast a boolean (false or true) to a uint256 (0 or 1) with no jump.\\n */\\n function toUint(bool b) internal pure returns (uint256 u) {\\n assembly (\\\"memory-safe\\\") {\\n u := iszero(iszero(b))\\n }\\n }\\n}\\n\",\"keccak256\":\"0x195533c86d0ef72bcc06456a4f66a9b941f38eb403739b00f21fd7c1abd1ae54\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/math/SignedMath.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/math/SignedMath.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {SafeCast} from \\\"./SafeCast.sol\\\";\\n\\n/**\\n * @dev Standard signed math utilities missing in the Solidity language.\\n */\\nlibrary SignedMath {\\n /**\\n * @dev Branchless ternary evaluation for `a ? b : c`. Gas costs are constant.\\n *\\n * IMPORTANT: This function may reduce bytecode size and consume less gas when used standalone.\\n * However, the compiler may optimize Solidity ternary operations (i.e. `a ? b : c`) to only compute\\n * one branch when needed, making this function more expensive.\\n */\\n function ternary(bool condition, int256 a, int256 b) internal pure returns (int256) {\\n unchecked {\\n // branchless ternary works because:\\n // b ^ (a ^ b) == a\\n // b ^ 0 == b\\n return b ^ ((a ^ b) * int256(SafeCast.toUint(condition)));\\n }\\n }\\n\\n /**\\n * @dev Returns the largest of two signed numbers.\\n */\\n function max(int256 a, int256 b) internal pure returns (int256) {\\n return ternary(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 ternary(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 // Formula from the \\\"Bit Twiddling Hacks\\\" by Sean Eron Anderson.\\n // Since `n` is a signed integer, the generated bytecode will use the SAR opcode to perform the right shift,\\n // taking advantage of the most significant (or \\\"sign\\\" bit) in two's complement representation.\\n // This opcode adds new most significant bits set to the value of the previous most significant bit. As a result,\\n // the mask will either be `bytes32(0)` (if n is positive) or `~bytes32(0)` (if n is negative).\\n int256 mask = n >> 255;\\n\\n // A `bytes32(0)` mask leaves the input unchanged, while a `~bytes32(0)` mask complements it.\\n return uint256((n + mask) ^ mask);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xb1970fac7b64e6c09611e6691791e848d5e3fe410fa5899e7df2e0afd77a99e3\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/structs/Checkpoints.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/structs/Checkpoints.sol)\\n// This file was procedurally generated from scripts/generate/templates/Checkpoints.js.\\n\\npragma solidity ^0.8.20;\\n\\nimport {Math} from \\\"../math/Math.sol\\\";\\n\\n/**\\n * @dev This library defines the `Trace*` struct, for checkpointing values as they change at different points in\\n * time, and later looking up past values by block number. See {Votes} as an example.\\n *\\n * To create a history of checkpoints define a variable type `Checkpoints.Trace*` in your contract, and store a new\\n * checkpoint for the current transaction block using the {push} function.\\n */\\nlibrary Checkpoints {\\n /**\\n * @dev A value was attempted to be inserted on a past checkpoint.\\n */\\n error CheckpointUnorderedInsertion();\\n\\n struct Trace224 {\\n Checkpoint224[] _checkpoints;\\n }\\n\\n struct Checkpoint224 {\\n uint32 _key;\\n uint224 _value;\\n }\\n\\n /**\\n * @dev Pushes a (`key`, `value`) pair into a Trace224 so that it is stored as the checkpoint.\\n *\\n * Returns previous value and new value.\\n *\\n * IMPORTANT: Never accept `key` as a user input, since an arbitrary `type(uint32).max` key set will disable the\\n * library.\\n */\\n function push(\\n Trace224 storage self,\\n uint32 key,\\n uint224 value\\n ) internal returns (uint224 oldValue, uint224 newValue) {\\n return _insert(self._checkpoints, key, value);\\n }\\n\\n /**\\n * @dev Returns the value in the first (oldest) checkpoint with key greater or equal than the search key, or zero if\\n * there is none.\\n */\\n function lowerLookup(Trace224 storage self, uint32 key) internal view returns (uint224) {\\n uint256 len = self._checkpoints.length;\\n uint256 pos = _lowerBinaryLookup(self._checkpoints, key, 0, len);\\n return pos == len ? 0 : _unsafeAccess(self._checkpoints, pos)._value;\\n }\\n\\n /**\\n * @dev Returns the value in the last (most recent) checkpoint with key lower or equal than the search key, or zero\\n * if there is none.\\n */\\n function upperLookup(Trace224 storage self, uint32 key) internal view returns (uint224) {\\n uint256 len = self._checkpoints.length;\\n uint256 pos = _upperBinaryLookup(self._checkpoints, key, 0, len);\\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\\n }\\n\\n /**\\n * @dev Returns the value in the last (most recent) checkpoint with key lower or equal than the search key, or zero\\n * if there is none.\\n *\\n * NOTE: This is a variant of {upperLookup} that is optimised to find \\\"recent\\\" checkpoint (checkpoints with high\\n * keys).\\n */\\n function upperLookupRecent(Trace224 storage self, uint32 key) internal view returns (uint224) {\\n uint256 len = self._checkpoints.length;\\n\\n uint256 low = 0;\\n uint256 high = len;\\n\\n if (len > 5) {\\n uint256 mid = len - Math.sqrt(len);\\n if (key < _unsafeAccess(self._checkpoints, mid)._key) {\\n high = mid;\\n } else {\\n low = mid + 1;\\n }\\n }\\n\\n uint256 pos = _upperBinaryLookup(self._checkpoints, key, low, high);\\n\\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\\n }\\n\\n /**\\n * @dev Returns the value in the most recent checkpoint, or zero if there are no checkpoints.\\n */\\n function latest(Trace224 storage self) internal view returns (uint224) {\\n uint256 pos = self._checkpoints.length;\\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\\n }\\n\\n /**\\n * @dev Returns whether there is a checkpoint in the structure (i.e. it is not empty), and if so the key and value\\n * in the most recent checkpoint.\\n */\\n function latestCheckpoint(Trace224 storage self) internal view returns (bool exists, uint32 _key, uint224 _value) {\\n uint256 pos = self._checkpoints.length;\\n if (pos == 0) {\\n return (false, 0, 0);\\n } else {\\n Checkpoint224 storage ckpt = _unsafeAccess(self._checkpoints, pos - 1);\\n return (true, ckpt._key, ckpt._value);\\n }\\n }\\n\\n /**\\n * @dev Returns the number of checkpoint.\\n */\\n function length(Trace224 storage self) internal view returns (uint256) {\\n return self._checkpoints.length;\\n }\\n\\n /**\\n * @dev Returns checkpoint at given position.\\n */\\n function at(Trace224 storage self, uint32 pos) internal view returns (Checkpoint224 memory) {\\n return self._checkpoints[pos];\\n }\\n\\n /**\\n * @dev Pushes a (`key`, `value`) pair into an ordered list of checkpoints, either by inserting a new checkpoint,\\n * or by updating the last one.\\n */\\n function _insert(\\n Checkpoint224[] storage self,\\n uint32 key,\\n uint224 value\\n ) private returns (uint224 oldValue, uint224 newValue) {\\n uint256 pos = self.length;\\n\\n if (pos > 0) {\\n Checkpoint224 storage last = _unsafeAccess(self, pos - 1);\\n uint32 lastKey = last._key;\\n uint224 lastValue = last._value;\\n\\n // Checkpoint keys must be non-decreasing.\\n if (lastKey > key) {\\n revert CheckpointUnorderedInsertion();\\n }\\n\\n // Update or push new checkpoint\\n if (lastKey == key) {\\n last._value = value;\\n } else {\\n self.push(Checkpoint224({_key: key, _value: value}));\\n }\\n return (lastValue, value);\\n } else {\\n self.push(Checkpoint224({_key: key, _value: value}));\\n return (0, value);\\n }\\n }\\n\\n /**\\n * @dev Return the index of the first (oldest) checkpoint with key strictly bigger than the search key, or `high`\\n * if there is none. `low` and `high` define a section where to do the search, with inclusive `low` and exclusive\\n * `high`.\\n *\\n * WARNING: `high` should not be greater than the array's length.\\n */\\n function _upperBinaryLookup(\\n Checkpoint224[] storage self,\\n uint32 key,\\n uint256 low,\\n uint256 high\\n ) private view returns (uint256) {\\n while (low < high) {\\n uint256 mid = Math.average(low, high);\\n if (_unsafeAccess(self, mid)._key > key) {\\n high = mid;\\n } else {\\n low = mid + 1;\\n }\\n }\\n return high;\\n }\\n\\n /**\\n * @dev Return the index of the first (oldest) checkpoint with key greater or equal than the search key, or `high`\\n * if there is none. `low` and `high` define a section where to do the search, with inclusive `low` and exclusive\\n * `high`.\\n *\\n * WARNING: `high` should not be greater than the array's length.\\n */\\n function _lowerBinaryLookup(\\n Checkpoint224[] storage self,\\n uint32 key,\\n uint256 low,\\n uint256 high\\n ) private view returns (uint256) {\\n while (low < high) {\\n uint256 mid = Math.average(low, high);\\n if (_unsafeAccess(self, mid)._key < key) {\\n low = mid + 1;\\n } else {\\n high = mid;\\n }\\n }\\n return high;\\n }\\n\\n /**\\n * @dev Access an element of the array without performing bounds check. The position is assumed to be within bounds.\\n */\\n function _unsafeAccess(\\n Checkpoint224[] storage self,\\n uint256 pos\\n ) private pure returns (Checkpoint224 storage result) {\\n assembly {\\n mstore(0, self.slot)\\n result.slot := add(keccak256(0, 0x20), pos)\\n }\\n }\\n\\n struct Trace208 {\\n Checkpoint208[] _checkpoints;\\n }\\n\\n struct Checkpoint208 {\\n uint48 _key;\\n uint208 _value;\\n }\\n\\n /**\\n * @dev Pushes a (`key`, `value`) pair into a Trace208 so that it is stored as the checkpoint.\\n *\\n * Returns previous value and new value.\\n *\\n * IMPORTANT: Never accept `key` as a user input, since an arbitrary `type(uint48).max` key set will disable the\\n * library.\\n */\\n function push(\\n Trace208 storage self,\\n uint48 key,\\n uint208 value\\n ) internal returns (uint208 oldValue, uint208 newValue) {\\n return _insert(self._checkpoints, key, value);\\n }\\n\\n /**\\n * @dev Returns the value in the first (oldest) checkpoint with key greater or equal than the search key, or zero if\\n * there is none.\\n */\\n function lowerLookup(Trace208 storage self, uint48 key) internal view returns (uint208) {\\n uint256 len = self._checkpoints.length;\\n uint256 pos = _lowerBinaryLookup(self._checkpoints, key, 0, len);\\n return pos == len ? 0 : _unsafeAccess(self._checkpoints, pos)._value;\\n }\\n\\n /**\\n * @dev Returns the value in the last (most recent) checkpoint with key lower or equal than the search key, or zero\\n * if there is none.\\n */\\n function upperLookup(Trace208 storage self, uint48 key) internal view returns (uint208) {\\n uint256 len = self._checkpoints.length;\\n uint256 pos = _upperBinaryLookup(self._checkpoints, key, 0, len);\\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\\n }\\n\\n /**\\n * @dev Returns the value in the last (most recent) checkpoint with key lower or equal than the search key, or zero\\n * if there is none.\\n *\\n * NOTE: This is a variant of {upperLookup} that is optimised to find \\\"recent\\\" checkpoint (checkpoints with high\\n * keys).\\n */\\n function upperLookupRecent(Trace208 storage self, uint48 key) internal view returns (uint208) {\\n uint256 len = self._checkpoints.length;\\n\\n uint256 low = 0;\\n uint256 high = len;\\n\\n if (len > 5) {\\n uint256 mid = len - Math.sqrt(len);\\n if (key < _unsafeAccess(self._checkpoints, mid)._key) {\\n high = mid;\\n } else {\\n low = mid + 1;\\n }\\n }\\n\\n uint256 pos = _upperBinaryLookup(self._checkpoints, key, low, high);\\n\\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\\n }\\n\\n /**\\n * @dev Returns the value in the most recent checkpoint, or zero if there are no checkpoints.\\n */\\n function latest(Trace208 storage self) internal view returns (uint208) {\\n uint256 pos = self._checkpoints.length;\\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\\n }\\n\\n /**\\n * @dev Returns whether there is a checkpoint in the structure (i.e. it is not empty), and if so the key and value\\n * in the most recent checkpoint.\\n */\\n function latestCheckpoint(Trace208 storage self) internal view returns (bool exists, uint48 _key, uint208 _value) {\\n uint256 pos = self._checkpoints.length;\\n if (pos == 0) {\\n return (false, 0, 0);\\n } else {\\n Checkpoint208 storage ckpt = _unsafeAccess(self._checkpoints, pos - 1);\\n return (true, ckpt._key, ckpt._value);\\n }\\n }\\n\\n /**\\n * @dev Returns the number of checkpoint.\\n */\\n function length(Trace208 storage self) internal view returns (uint256) {\\n return self._checkpoints.length;\\n }\\n\\n /**\\n * @dev Returns checkpoint at given position.\\n */\\n function at(Trace208 storage self, uint32 pos) internal view returns (Checkpoint208 memory) {\\n return self._checkpoints[pos];\\n }\\n\\n /**\\n * @dev Pushes a (`key`, `value`) pair into an ordered list of checkpoints, either by inserting a new checkpoint,\\n * or by updating the last one.\\n */\\n function _insert(\\n Checkpoint208[] storage self,\\n uint48 key,\\n uint208 value\\n ) private returns (uint208 oldValue, uint208 newValue) {\\n uint256 pos = self.length;\\n\\n if (pos > 0) {\\n Checkpoint208 storage last = _unsafeAccess(self, pos - 1);\\n uint48 lastKey = last._key;\\n uint208 lastValue = last._value;\\n\\n // Checkpoint keys must be non-decreasing.\\n if (lastKey > key) {\\n revert CheckpointUnorderedInsertion();\\n }\\n\\n // Update or push new checkpoint\\n if (lastKey == key) {\\n last._value = value;\\n } else {\\n self.push(Checkpoint208({_key: key, _value: value}));\\n }\\n return (lastValue, value);\\n } else {\\n self.push(Checkpoint208({_key: key, _value: value}));\\n return (0, value);\\n }\\n }\\n\\n /**\\n * @dev Return the index of the first (oldest) checkpoint with key strictly bigger than the search key, or `high`\\n * if there is none. `low` and `high` define a section where to do the search, with inclusive `low` and exclusive\\n * `high`.\\n *\\n * WARNING: `high` should not be greater than the array's length.\\n */\\n function _upperBinaryLookup(\\n Checkpoint208[] storage self,\\n uint48 key,\\n uint256 low,\\n uint256 high\\n ) private view returns (uint256) {\\n while (low < high) {\\n uint256 mid = Math.average(low, high);\\n if (_unsafeAccess(self, mid)._key > key) {\\n high = mid;\\n } else {\\n low = mid + 1;\\n }\\n }\\n return high;\\n }\\n\\n /**\\n * @dev Return the index of the first (oldest) checkpoint with key greater or equal than the search key, or `high`\\n * if there is none. `low` and `high` define a section where to do the search, with inclusive `low` and exclusive\\n * `high`.\\n *\\n * WARNING: `high` should not be greater than the array's length.\\n */\\n function _lowerBinaryLookup(\\n Checkpoint208[] storage self,\\n uint48 key,\\n uint256 low,\\n uint256 high\\n ) private view returns (uint256) {\\n while (low < high) {\\n uint256 mid = Math.average(low, high);\\n if (_unsafeAccess(self, mid)._key < key) {\\n low = mid + 1;\\n } else {\\n high = mid;\\n }\\n }\\n return high;\\n }\\n\\n /**\\n * @dev Access an element of the array without performing bounds check. The position is assumed to be within bounds.\\n */\\n function _unsafeAccess(\\n Checkpoint208[] storage self,\\n uint256 pos\\n ) private pure returns (Checkpoint208 storage result) {\\n assembly {\\n mstore(0, self.slot)\\n result.slot := add(keccak256(0, 0x20), pos)\\n }\\n }\\n\\n struct Trace160 {\\n Checkpoint160[] _checkpoints;\\n }\\n\\n struct Checkpoint160 {\\n uint96 _key;\\n uint160 _value;\\n }\\n\\n /**\\n * @dev Pushes a (`key`, `value`) pair into a Trace160 so that it is stored as the checkpoint.\\n *\\n * Returns previous value and new value.\\n *\\n * IMPORTANT: Never accept `key` as a user input, since an arbitrary `type(uint96).max` key set will disable the\\n * library.\\n */\\n function push(\\n Trace160 storage self,\\n uint96 key,\\n uint160 value\\n ) internal returns (uint160 oldValue, uint160 newValue) {\\n return _insert(self._checkpoints, key, value);\\n }\\n\\n /**\\n * @dev Returns the value in the first (oldest) checkpoint with key greater or equal than the search key, or zero if\\n * there is none.\\n */\\n function lowerLookup(Trace160 storage self, uint96 key) internal view returns (uint160) {\\n uint256 len = self._checkpoints.length;\\n uint256 pos = _lowerBinaryLookup(self._checkpoints, key, 0, len);\\n return pos == len ? 0 : _unsafeAccess(self._checkpoints, pos)._value;\\n }\\n\\n /**\\n * @dev Returns the value in the last (most recent) checkpoint with key lower or equal than the search key, or zero\\n * if there is none.\\n */\\n function upperLookup(Trace160 storage self, uint96 key) internal view returns (uint160) {\\n uint256 len = self._checkpoints.length;\\n uint256 pos = _upperBinaryLookup(self._checkpoints, key, 0, len);\\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\\n }\\n\\n /**\\n * @dev Returns the value in the last (most recent) checkpoint with key lower or equal than the search key, or zero\\n * if there is none.\\n *\\n * NOTE: This is a variant of {upperLookup} that is optimised to find \\\"recent\\\" checkpoint (checkpoints with high\\n * keys).\\n */\\n function upperLookupRecent(Trace160 storage self, uint96 key) internal view returns (uint160) {\\n uint256 len = self._checkpoints.length;\\n\\n uint256 low = 0;\\n uint256 high = len;\\n\\n if (len > 5) {\\n uint256 mid = len - Math.sqrt(len);\\n if (key < _unsafeAccess(self._checkpoints, mid)._key) {\\n high = mid;\\n } else {\\n low = mid + 1;\\n }\\n }\\n\\n uint256 pos = _upperBinaryLookup(self._checkpoints, key, low, high);\\n\\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\\n }\\n\\n /**\\n * @dev Returns the value in the most recent checkpoint, or zero if there are no checkpoints.\\n */\\n function latest(Trace160 storage self) internal view returns (uint160) {\\n uint256 pos = self._checkpoints.length;\\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\\n }\\n\\n /**\\n * @dev Returns whether there is a checkpoint in the structure (i.e. it is not empty), and if so the key and value\\n * in the most recent checkpoint.\\n */\\n function latestCheckpoint(Trace160 storage self) internal view returns (bool exists, uint96 _key, uint160 _value) {\\n uint256 pos = self._checkpoints.length;\\n if (pos == 0) {\\n return (false, 0, 0);\\n } else {\\n Checkpoint160 storage ckpt = _unsafeAccess(self._checkpoints, pos - 1);\\n return (true, ckpt._key, ckpt._value);\\n }\\n }\\n\\n /**\\n * @dev Returns the number of checkpoint.\\n */\\n function length(Trace160 storage self) internal view returns (uint256) {\\n return self._checkpoints.length;\\n }\\n\\n /**\\n * @dev Returns checkpoint at given position.\\n */\\n function at(Trace160 storage self, uint32 pos) internal view returns (Checkpoint160 memory) {\\n return self._checkpoints[pos];\\n }\\n\\n /**\\n * @dev Pushes a (`key`, `value`) pair into an ordered list of checkpoints, either by inserting a new checkpoint,\\n * or by updating the last one.\\n */\\n function _insert(\\n Checkpoint160[] storage self,\\n uint96 key,\\n uint160 value\\n ) private returns (uint160 oldValue, uint160 newValue) {\\n uint256 pos = self.length;\\n\\n if (pos > 0) {\\n Checkpoint160 storage last = _unsafeAccess(self, pos - 1);\\n uint96 lastKey = last._key;\\n uint160 lastValue = last._value;\\n\\n // Checkpoint keys must be non-decreasing.\\n if (lastKey > key) {\\n revert CheckpointUnorderedInsertion();\\n }\\n\\n // Update or push new checkpoint\\n if (lastKey == key) {\\n last._value = value;\\n } else {\\n self.push(Checkpoint160({_key: key, _value: value}));\\n }\\n return (lastValue, value);\\n } else {\\n self.push(Checkpoint160({_key: key, _value: value}));\\n return (0, value);\\n }\\n }\\n\\n /**\\n * @dev Return the index of the first (oldest) checkpoint with key strictly bigger than the search key, or `high`\\n * if there is none. `low` and `high` define a section where to do the search, with inclusive `low` and exclusive\\n * `high`.\\n *\\n * WARNING: `high` should not be greater than the array's length.\\n */\\n function _upperBinaryLookup(\\n Checkpoint160[] storage self,\\n uint96 key,\\n uint256 low,\\n uint256 high\\n ) private view returns (uint256) {\\n while (low < high) {\\n uint256 mid = Math.average(low, high);\\n if (_unsafeAccess(self, mid)._key > key) {\\n high = mid;\\n } else {\\n low = mid + 1;\\n }\\n }\\n return high;\\n }\\n\\n /**\\n * @dev Return the index of the first (oldest) checkpoint with key greater or equal than the search key, or `high`\\n * if there is none. `low` and `high` define a section where to do the search, with inclusive `low` and exclusive\\n * `high`.\\n *\\n * WARNING: `high` should not be greater than the array's length.\\n */\\n function _lowerBinaryLookup(\\n Checkpoint160[] storage self,\\n uint96 key,\\n uint256 low,\\n uint256 high\\n ) private view returns (uint256) {\\n while (low < high) {\\n uint256 mid = Math.average(low, high);\\n if (_unsafeAccess(self, mid)._key < key) {\\n low = mid + 1;\\n } else {\\n high = mid;\\n }\\n }\\n return high;\\n }\\n\\n /**\\n * @dev Access an element of the array without performing bounds check. The position is assumed to be within bounds.\\n */\\n function _unsafeAccess(\\n Checkpoint160[] storage self,\\n uint256 pos\\n ) private pure returns (Checkpoint160 storage result) {\\n assembly {\\n mstore(0, self.slot)\\n result.slot := add(keccak256(0, 0x20), pos)\\n }\\n }\\n}\\n\",\"keccak256\":\"0x66364cd3247ea71cdb58f080f5d5ed6732433a8001413139661841535494692f\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/structs/DoubleEndedQueue.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/structs/DoubleEndedQueue.sol)\\npragma solidity ^0.8.20;\\n\\nimport {Panic} from \\\"../Panic.sol\\\";\\n\\n/**\\n * @dev A sequence of items with the ability to efficiently push and pop items (i.e. insert and remove) on both ends of\\n * the sequence (called front and back). Among other access patterns, it can be used to implement efficient LIFO and\\n * FIFO queues. Storage use is optimized, and all operations are O(1) constant time. This includes {clear}, given that\\n * the existing queue contents are left in storage.\\n *\\n * The struct is called `Bytes32Deque`. Other types can be cast to and from `bytes32`. This data structure can only be\\n * used in storage, and not in memory.\\n * ```solidity\\n * DoubleEndedQueue.Bytes32Deque queue;\\n * ```\\n */\\nlibrary DoubleEndedQueue {\\n /**\\n * @dev Indices are 128 bits so begin and end are packed in a single storage slot for efficient access.\\n *\\n * Struct members have an underscore prefix indicating that they are \\\"private\\\" and should not be read or written to\\n * directly. Use the functions provided below instead. Modifying the struct manually may violate assumptions and\\n * lead to unexpected behavior.\\n *\\n * The first item is at data[begin] and the last item is at data[end - 1]. This range can wrap around.\\n */\\n struct Bytes32Deque {\\n uint128 _begin;\\n uint128 _end;\\n mapping(uint128 index => bytes32) _data;\\n }\\n\\n /**\\n * @dev Inserts an item at the end of the queue.\\n *\\n * Reverts with {Panic-RESOURCE_ERROR} if the queue is full.\\n */\\n function pushBack(Bytes32Deque storage deque, bytes32 value) internal {\\n unchecked {\\n uint128 backIndex = deque._end;\\n if (backIndex + 1 == deque._begin) Panic.panic(Panic.RESOURCE_ERROR);\\n deque._data[backIndex] = value;\\n deque._end = backIndex + 1;\\n }\\n }\\n\\n /**\\n * @dev Removes the item at the end of the queue and returns it.\\n *\\n * Reverts with {Panic-EMPTY_ARRAY_POP} if the queue is empty.\\n */\\n function popBack(Bytes32Deque storage deque) internal returns (bytes32 value) {\\n unchecked {\\n uint128 backIndex = deque._end;\\n if (backIndex == deque._begin) Panic.panic(Panic.EMPTY_ARRAY_POP);\\n --backIndex;\\n value = deque._data[backIndex];\\n delete deque._data[backIndex];\\n deque._end = backIndex;\\n }\\n }\\n\\n /**\\n * @dev Inserts an item at the beginning of the queue.\\n *\\n * Reverts with {Panic-RESOURCE_ERROR} if the queue is full.\\n */\\n function pushFront(Bytes32Deque storage deque, bytes32 value) internal {\\n unchecked {\\n uint128 frontIndex = deque._begin - 1;\\n if (frontIndex == deque._end) Panic.panic(Panic.RESOURCE_ERROR);\\n deque._data[frontIndex] = value;\\n deque._begin = frontIndex;\\n }\\n }\\n\\n /**\\n * @dev Removes the item at the beginning of the queue and returns it.\\n *\\n * Reverts with {Panic-EMPTY_ARRAY_POP} if the queue is empty.\\n */\\n function popFront(Bytes32Deque storage deque) internal returns (bytes32 value) {\\n unchecked {\\n uint128 frontIndex = deque._begin;\\n if (frontIndex == deque._end) Panic.panic(Panic.EMPTY_ARRAY_POP);\\n value = deque._data[frontIndex];\\n delete deque._data[frontIndex];\\n deque._begin = frontIndex + 1;\\n }\\n }\\n\\n /**\\n * @dev Returns the item at the beginning of the queue.\\n *\\n * Reverts with {Panic-ARRAY_OUT_OF_BOUNDS} if the queue is empty.\\n */\\n function front(Bytes32Deque storage deque) internal view returns (bytes32 value) {\\n if (empty(deque)) Panic.panic(Panic.ARRAY_OUT_OF_BOUNDS);\\n return deque._data[deque._begin];\\n }\\n\\n /**\\n * @dev Returns the item at the end of the queue.\\n *\\n * Reverts with {Panic-ARRAY_OUT_OF_BOUNDS} if the queue is empty.\\n */\\n function back(Bytes32Deque storage deque) internal view returns (bytes32 value) {\\n if (empty(deque)) Panic.panic(Panic.ARRAY_OUT_OF_BOUNDS);\\n unchecked {\\n return deque._data[deque._end - 1];\\n }\\n }\\n\\n /**\\n * @dev Return the item at a position in the queue given by `index`, with the first item at 0 and last item at\\n * `length(deque) - 1`.\\n *\\n * Reverts with {Panic-ARRAY_OUT_OF_BOUNDS} if the index is out of bounds.\\n */\\n function at(Bytes32Deque storage deque, uint256 index) internal view returns (bytes32 value) {\\n if (index >= length(deque)) Panic.panic(Panic.ARRAY_OUT_OF_BOUNDS);\\n // By construction, length is a uint128, so the check above ensures that index can be safely downcast to uint128\\n unchecked {\\n return deque._data[deque._begin + uint128(index)];\\n }\\n }\\n\\n /**\\n * @dev Resets the queue back to being empty.\\n *\\n * NOTE: The current items are left behind in storage. This does not affect the functioning of the queue, but misses\\n * out on potential gas refunds.\\n */\\n function clear(Bytes32Deque storage deque) internal {\\n deque._begin = 0;\\n deque._end = 0;\\n }\\n\\n /**\\n * @dev Returns the number of items in the queue.\\n */\\n function length(Bytes32Deque storage deque) internal view returns (uint256) {\\n unchecked {\\n return uint256(deque._end - deque._begin);\\n }\\n }\\n\\n /**\\n * @dev Returns true if the queue is empty.\\n */\\n function empty(Bytes32Deque storage deque) internal view returns (bool) {\\n return deque._end == deque._begin;\\n }\\n}\\n\",\"keccak256\":\"0x1e1d74658d7f4eab3d4f8fb0c6c5953bc5f629d9425e978d557dabff7b58b217\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/types/Time.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/types/Time.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {Math} from \\\"../math/Math.sol\\\";\\nimport {SafeCast} from \\\"../math/SafeCast.sol\\\";\\n\\n/**\\n * @dev This library provides helpers for manipulating time-related objects.\\n *\\n * It uses the following types:\\n * - `uint48` for timepoints\\n * - `uint32` for durations\\n *\\n * While the library doesn't provide specific types for timepoints and duration, it does provide:\\n * - a `Delay` type to represent duration that can be programmed to change value automatically at a given point\\n * - additional helper functions\\n */\\nlibrary Time {\\n using Time for *;\\n\\n /**\\n * @dev Get the block timestamp as a Timepoint.\\n */\\n function timestamp() internal view returns (uint48) {\\n return SafeCast.toUint48(block.timestamp);\\n }\\n\\n /**\\n * @dev Get the block number as a Timepoint.\\n */\\n function blockNumber() internal view returns (uint48) {\\n return SafeCast.toUint48(block.number);\\n }\\n\\n // ==================================================== Delay =====================================================\\n /**\\n * @dev A `Delay` is a uint32 duration that can be programmed to change value automatically at a given point in the\\n * future. The \\\"effect\\\" timepoint describes when the transitions happens from the \\\"old\\\" value to the \\\"new\\\" value.\\n * This allows updating the delay applied to some operation while keeping some guarantees.\\n *\\n * In particular, the {update} function guarantees that if the delay is reduced, the old delay still applies for\\n * some time. For example if the delay is currently 7 days to do an upgrade, the admin should not be able to set\\n * the delay to 0 and upgrade immediately. If the admin wants to reduce the delay, the old delay (7 days) should\\n * still apply for some time.\\n *\\n *\\n * The `Delay` type is 112 bits long, and packs the following:\\n *\\n * ```\\n * | [uint48]: effect date (timepoint)\\n * | | [uint32]: value before (duration)\\n * \\u2193 \\u2193 \\u2193 [uint32]: value after (duration)\\n * 0xAAAAAAAAAAAABBBBBBBBCCCCCCCC\\n * ```\\n *\\n * NOTE: The {get} and {withUpdate} functions operate using timestamps. Block number based delays are not currently\\n * supported.\\n */\\n type Delay is uint112;\\n\\n /**\\n * @dev Wrap a duration into a Delay to add the one-step \\\"update in the future\\\" feature\\n */\\n function toDelay(uint32 duration) internal pure returns (Delay) {\\n return Delay.wrap(duration);\\n }\\n\\n /**\\n * @dev Get the value at a given timepoint plus the pending value and effect timepoint if there is a scheduled\\n * change after this timepoint. If the effect timepoint is 0, then the pending value should not be considered.\\n */\\n function _getFullAt(\\n Delay self,\\n uint48 timepoint\\n ) private pure returns (uint32 valueBefore, uint32 valueAfter, uint48 effect) {\\n (valueBefore, valueAfter, effect) = self.unpack();\\n return effect <= timepoint ? (valueAfter, 0, 0) : (valueBefore, valueAfter, effect);\\n }\\n\\n /**\\n * @dev Get the current value plus the pending value and effect timepoint if there is a scheduled change. If the\\n * effect timepoint is 0, then the pending value should not be considered.\\n */\\n function getFull(Delay self) internal view returns (uint32 valueBefore, uint32 valueAfter, uint48 effect) {\\n return _getFullAt(self, timestamp());\\n }\\n\\n /**\\n * @dev Get the current value.\\n */\\n function get(Delay self) internal view returns (uint32) {\\n (uint32 delay, , ) = self.getFull();\\n return delay;\\n }\\n\\n /**\\n * @dev Update a Delay object so that it takes a new duration after a timepoint that is automatically computed to\\n * enforce the old delay at the moment of the update. Returns the updated Delay object and the timestamp when the\\n * new delay becomes effective.\\n */\\n function withUpdate(\\n Delay self,\\n uint32 newValue,\\n uint32 minSetback\\n ) internal view returns (Delay updatedDelay, uint48 effect) {\\n uint32 value = self.get();\\n uint32 setback = uint32(Math.max(minSetback, value > newValue ? value - newValue : 0));\\n effect = timestamp() + setback;\\n return (pack(value, newValue, effect), effect);\\n }\\n\\n /**\\n * @dev Split a delay into its components: valueBefore, valueAfter and effect (transition timepoint).\\n */\\n function unpack(Delay self) internal pure returns (uint32 valueBefore, uint32 valueAfter, uint48 effect) {\\n uint112 raw = Delay.unwrap(self);\\n\\n valueAfter = uint32(raw);\\n valueBefore = uint32(raw >> 32);\\n effect = uint48(raw >> 64);\\n\\n return (valueBefore, valueAfter, effect);\\n }\\n\\n /**\\n * @dev pack the components into a Delay object.\\n */\\n function pack(uint32 valueBefore, uint32 valueAfter, uint48 effect) internal pure returns (Delay) {\\n return Delay.wrap((uint112(effect) << 64) | (uint112(valueBefore) << 32) | uint112(valueAfter));\\n }\\n}\\n\",\"keccak256\":\"0x36776530f012618bc7526ceb28e77b85e582cb12d9b9466a71d4bd6bf952e4cc\",\"license\":\"MIT\"},\"contracts/variants/crosschain/Gov.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity ^0.8.20;\\n\\nimport \\\"@openzeppelin/contracts/governance/Governor.sol\\\";\\nimport \\\"@openzeppelin/contracts/governance/extensions/GovernorSettings.sol\\\";\\nimport \\\"@openzeppelin/contracts/governance/extensions/GovernorCountingSimple.sol\\\";\\nimport \\\"@openzeppelin/contracts/governance/extensions/GovernorVotes.sol\\\";\\nimport \\\"@openzeppelin/contracts/governance/extensions/GovernorVotesQuorumFraction.sol\\\";\\nimport \\\"./ProofHandler.sol\\\";\\n\\n/**\\n * @title Cross-chain Governance Contract\\n * @author Web3 Hackers Collective\\n * @notice Implementation of a DAO with secure cross-chain synchronization capabilities\\n * @dev Uses ProofHandler library for managing cross-chain parameter updates\\n * @custom:security-contact julien@strat.cc\\n */\\ncontract Gov is\\n Governor,\\n GovernorSettings,\\n GovernorCountingSimple,\\n GovernorVotes,\\n GovernorVotesQuorumFraction\\n{\\n /// @notice Chain ID where this contract was originally deployed\\n uint256 public immutable home;\\n\\n /// @notice IPFS CID of the DAO's manifesto\\n string public manifesto;\\n\\n /// @notice Storage for proof handling\\n ProofHandler.ProofStorage private _proofStorage;\\n\\n /// @notice Types of operations that can be synchronized across chains\\n enum OperationType {\\n SET_MANIFESTO,\\n UPDATE_VOTING_DELAY,\\n UPDATE_VOTING_PERIOD,\\n UPDATE_PROPOSAL_THRESHOLD,\\n UPDATE_QUORUM\\n }\\n\\n /// @notice Emitted when the manifesto is updated\\n /// @param oldManifesto Previous manifesto CID\\n /// @param newManifesto New manifesto CID\\n /// @param nonce Update sequence number\\n event ManifestoUpdated(string oldManifesto, string newManifesto, uint256 nonce);\\n\\n /// @notice Emitted when a governance parameter is updated\\n /// @param operationType Type of parameter updated\\n /// @param oldValue Previous value\\n /// @param newValue New value\\n /// @param nonce Update sequence number\\n event GovernanceParameterUpdated(\\n OperationType indexed operationType,\\n uint256 oldValue,\\n uint256 newValue,\\n uint256 nonce\\n );\\n\\n /// @notice Restricts functions to be called only on the home chain\\n modifier onlyHomeChain() {\\n require(block.chainid == home, \\\"Operation only allowed on home chain\\\");\\n _;\\n }\\n\\n /**\\n * @notice Initializes the governance contract\\n * @param _home Chain ID where this contract is considered home\\n * @param _token The voting token contract address\\n * @param _manifestoCid Initial manifesto CID\\n * @param _name Name of the governance contract\\n * @param _votingDelay Time before voting begins\\n * @param _votingPeriod Duration of voting period\\n * @param _proposalThreshold Minimum votes needed for proposal\\n * @param _quorum Minimum participation percentage required\\n */\\n constructor(\\n uint256 _home,\\n IVotes _token,\\n string memory _manifestoCid,\\n string memory _name,\\n uint48 _votingDelay,\\n uint32 _votingPeriod,\\n uint256 _proposalThreshold,\\n uint256 _quorum\\n )\\n Governor(_name)\\n GovernorSettings(_votingDelay, _votingPeriod, _proposalThreshold)\\n GovernorVotes(_token)\\n GovernorVotesQuorumFraction(_quorum)\\n {\\n home = _home;\\n manifesto = _manifestoCid;\\n }\\n\\n /**\\n * @notice Updates the DAO's manifesto on the home chain\\n * @param newManifesto New manifesto CID\\n */\\n function setManifesto(string memory newManifesto) public onlyGovernance onlyHomeChain {\\n uint256 nonce = ProofHandler.incrementNonce(\\n _proofStorage,\\n uint8(OperationType.SET_MANIFESTO)\\n );\\n string memory oldManifesto = manifesto;\\n manifesto = newManifesto;\\n emit ManifestoUpdated(oldManifesto, newManifesto, nonce);\\n }\\n\\n /**\\n * @notice Updates the voting delay parameter on the home chain\\n * @param newVotingDelay New voting delay value\\n */\\n function setVotingDelay(\\n uint48 newVotingDelay\\n ) public virtual override onlyGovernance onlyHomeChain {\\n uint256 nonce = ProofHandler.incrementNonce(\\n _proofStorage,\\n uint8(OperationType.UPDATE_VOTING_DELAY)\\n );\\n uint256 oldValue = votingDelay();\\n _setVotingDelay(newVotingDelay);\\n emit GovernanceParameterUpdated(\\n OperationType.UPDATE_VOTING_DELAY,\\n oldValue,\\n newVotingDelay,\\n nonce\\n );\\n }\\n\\n /**\\n * @notice Updates the voting period parameter on the home chain\\n * @param newVotingPeriod New voting period value\\n */\\n function setVotingPeriod(\\n uint32 newVotingPeriod\\n ) public virtual override onlyGovernance onlyHomeChain {\\n uint256 nonce = ProofHandler.incrementNonce(\\n _proofStorage,\\n uint8(OperationType.UPDATE_VOTING_PERIOD)\\n );\\n uint256 oldValue = votingPeriod();\\n _setVotingPeriod(newVotingPeriod);\\n emit GovernanceParameterUpdated(\\n OperationType.UPDATE_VOTING_PERIOD,\\n oldValue,\\n newVotingPeriod,\\n nonce\\n );\\n }\\n\\n /**\\n * @notice Updates the proposal threshold parameter on the home chain\\n * @param newProposalThreshold New proposal threshold value\\n */\\n function setProposalThreshold(\\n uint256 newProposalThreshold\\n ) public virtual override onlyGovernance onlyHomeChain {\\n uint256 nonce = ProofHandler.incrementNonce(\\n _proofStorage,\\n uint8(OperationType.UPDATE_PROPOSAL_THRESHOLD)\\n );\\n uint256 oldValue = proposalThreshold();\\n _setProposalThreshold(newProposalThreshold);\\n emit GovernanceParameterUpdated(\\n OperationType.UPDATE_PROPOSAL_THRESHOLD,\\n oldValue,\\n newProposalThreshold,\\n nonce\\n );\\n }\\n\\n /**\\n * @notice Updates the quorum numerator on the home chain\\n * @param newQuorumNumerator New quorum numerator value\\n */\\n function updateQuorumNumerator(\\n uint256 newQuorumNumerator\\n ) public virtual override onlyGovernance onlyHomeChain {\\n uint256 nonce = ProofHandler.incrementNonce(\\n _proofStorage,\\n uint8(OperationType.UPDATE_QUORUM)\\n );\\n uint256 oldValue = quorumNumerator();\\n _updateQuorumNumerator(newQuorumNumerator);\\n emit GovernanceParameterUpdated(\\n OperationType.UPDATE_QUORUM,\\n oldValue,\\n newQuorumNumerator,\\n nonce\\n );\\n }\\n\\n /**\\n * @notice Generates proof for parameter updates\\n * @param operationType Type of parameter being updated\\n * @param value Encoded parameter value\\n * @return proof Encoded proof data\\n */\\n function generateParameterProof(\\n uint8 operationType,\\n bytes memory value\\n ) external view returns (bytes memory proof) {\\n require(block.chainid == home, \\\"Proofs only generated on home chain\\\");\\n uint256 nextNonce = ProofHandler.getNextNonce(_proofStorage, operationType);\\n return ProofHandler.generateProof(address(this), operationType, value, nextNonce);\\n }\\n\\n /**\\n * @notice Claims a parameter update on a foreign chain\\n * @param proof Proof generated by home chain\\n */\\n function claimParameterUpdate(bytes memory proof) external {\\n (uint8 operationType, bytes memory value, uint256 nonce) = ProofHandler.verifyAndClaimProof(\\n proof,\\n address(this),\\n _proofStorage\\n );\\n\\n if (operationType == uint8(OperationType.SET_MANIFESTO)) {\\n string memory newManifesto = abi.decode(value, (string));\\n string memory oldManifesto = manifesto;\\n manifesto = newManifesto;\\n emit ManifestoUpdated(oldManifesto, newManifesto, nonce);\\n } else if (operationType == uint8(OperationType.UPDATE_VOTING_DELAY)) {\\n uint48 newValue = uint48(bytes6(value));\\n uint256 oldValue = votingDelay();\\n _setVotingDelay(newValue);\\n emit GovernanceParameterUpdated(\\n OperationType.UPDATE_VOTING_DELAY,\\n oldValue,\\n newValue,\\n nonce\\n );\\n } else if (operationType == uint8(OperationType.UPDATE_VOTING_PERIOD)) {\\n uint32 newValue = uint32(bytes4(value));\\n uint256 oldValue = votingPeriod();\\n _setVotingPeriod(newValue);\\n emit GovernanceParameterUpdated(\\n OperationType.UPDATE_VOTING_PERIOD,\\n oldValue,\\n newValue,\\n nonce\\n );\\n } else if (operationType == uint8(OperationType.UPDATE_PROPOSAL_THRESHOLD)) {\\n uint256 newValue = abi.decode(value, (uint256));\\n uint256 oldValue = proposalThreshold();\\n _setProposalThreshold(newValue);\\n emit GovernanceParameterUpdated(\\n OperationType.UPDATE_PROPOSAL_THRESHOLD,\\n oldValue,\\n newValue,\\n nonce\\n );\\n } else if (operationType == uint8(OperationType.UPDATE_QUORUM)) {\\n uint256 newValue = abi.decode(value, (uint256));\\n uint256 oldValue = quorumNumerator();\\n _updateQuorumNumerator(newValue);\\n emit GovernanceParameterUpdated(OperationType.UPDATE_QUORUM, oldValue, newValue, nonce);\\n }\\n }\\n\\n // Required overrides\\n\\n function votingDelay() public view override(Governor, GovernorSettings) returns (uint256) {\\n return super.votingDelay();\\n }\\n\\n function votingPeriod() public view override(Governor, GovernorSettings) returns (uint256) {\\n return super.votingPeriod();\\n }\\n\\n function quorum(\\n uint256 blockNumber\\n ) public view override(Governor, GovernorVotesQuorumFraction) returns (uint256) {\\n return super.quorum(blockNumber);\\n }\\n\\n function proposalThreshold()\\n public\\n view\\n override(Governor, GovernorSettings)\\n returns (uint256)\\n {\\n return super.proposalThreshold();\\n }\\n}\\n\",\"keccak256\":\"0xf4500a14a3a21a6ded0cd8df07f4c3d173e3108f1bcee5cfaadf2d3892b50734\",\"license\":\"GPL-3.0\"},\"contracts/variants/crosschain/ProofHandler.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity ^0.8.20;\\n\\n/**\\n * @title Proof Handler Library\\n * @author Web3 Hackers Collective\\n * @notice Library for standardized cross-chain proof generation and verification\\n * @dev Handles proof generation, verification, and tracking for cross-chain operations\\n * @custom:security-contact julien@strat.cc\\n */\\nlibrary ProofHandler {\\n /// @notice Tracks which proofs have been applied on each chain\\n struct ProofStorage {\\n mapping(bytes32 => bool) updateAppliedOnChain;\\n mapping(uint8 => uint256) currentNonce;\\n }\\n\\n /// @dev Emitted when a proof is claimed\\n event ProofClaimed(uint8 indexed operationType, bytes params, uint256 nonce);\\n\\n /**\\n * @notice Generates a proof for cross-chain operations\\n * @param contractAddress Address of contract generating the proof\\n * @param operationType Type of operation being performed\\n * @param params Operation parameters\\n * @param nonce Current nonce for this operation type\\n * @return proof Encoded proof data\\n */\\n function generateProof(\\n address contractAddress,\\n uint8 operationType,\\n bytes memory params,\\n uint256 nonce\\n ) public pure returns (bytes memory proof) {\\n bytes32 message = keccak256(\\n abi.encodePacked(contractAddress, operationType, params, nonce)\\n );\\n bytes32 digest = keccak256(abi.encodePacked(\\\"\\\\x19Ethereum Signed Message:\\\\n32\\\", message));\\n\\n return abi.encode(operationType, params, nonce, digest);\\n }\\n\\n /**\\n * @notice Verifies and claims a proof\\n * @param proof Proof to verify and claim\\n * @param contractAddress Address of contract claiming the proof\\n * @param storage_ Proof storage struct\\n * @return operationType The type of operation being performed\\n * @return params The operation parameters\\n * @return nonce The operation sequence number\\n */\\n function verifyAndClaimProof(\\n bytes memory proof,\\n address contractAddress,\\n ProofStorage storage storage_\\n ) public returns (uint8 operationType, bytes memory params, uint256 nonce) {\\n bytes32 digest;\\n (operationType, params, nonce, digest) = abi.decode(\\n proof,\\n (uint8, bytes, uint256, bytes32)\\n );\\n\\n bytes32 proofHash = keccak256(proof);\\n require(!storage_.updateAppliedOnChain[proofHash], \\\"Proof already claimed\\\");\\n require(nonce == storage_.currentNonce[operationType] + 1, \\\"Invalid nonce\\\");\\n\\n bytes32 message = keccak256(\\n abi.encodePacked(contractAddress, operationType, params, nonce)\\n );\\n bytes32 expectedDigest = keccak256(\\n abi.encodePacked(\\\"\\\\x19Ethereum Signed Message:\\\\n32\\\", message)\\n );\\n require(digest == expectedDigest, \\\"Invalid proof\\\");\\n\\n storage_.updateAppliedOnChain[proofHash] = true;\\n storage_.currentNonce[operationType] = nonce;\\n\\n emit ProofClaimed(operationType, params, nonce);\\n\\n return (operationType, params, nonce);\\n }\\n\\n /**\\n * @notice Gets the next nonce for an operation type\\n * @param storage_ Proof storage struct\\n * @param operationType Type of operation\\n * @return nonce Next nonce value\\n */\\n function getNextNonce(\\n ProofStorage storage storage_,\\n uint8 operationType\\n ) public view returns (uint256 nonce) {\\n return storage_.currentNonce[operationType] + 1;\\n }\\n\\n /**\\n * @notice Increments the nonce for an operation type\\n * @param storage_ Proof storage struct\\n * @param operationType Type of operation\\n * @return nonce New nonce value\\n */\\n function incrementNonce(\\n ProofStorage storage storage_,\\n uint8 operationType\\n ) public returns (uint256 nonce) {\\n storage_.currentNonce[operationType]++;\\n return storage_.currentNonce[operationType];\\n }\\n}\\n\",\"keccak256\":\"0x3719e47c508f29977d48842c5c1d27cce7cb289cbb592526f170f98135ff41a7\",\"license\":\"GPL-3.0\"}},\"version\":1}", - "bytecode": "0x6101a06040523480156200001257600080fd5b5060405162005684380380620056848339810160408190526200003591620007d4565b808785858589806200005b6040805180820190915260018152603160f81b602082015290565b6200006882600062000181565b610120526200007981600162000181565b61014052815160208084019190912060e052815190820120610100524660a0526200010760e05161010051604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f60208201529081019290925260608201524660808201523060a082015260009060c00160405160208183030381529060405280519060200120905090565b60805250503060c05260036200011e828262000930565b506200012c905083620001ba565b620001378262000220565b6200014281620002c7565b5050506001600160a01b0316610160526200015d8162000308565b50610180889052600b62000172878262000930565b50505050505050505062000a96565b6000602083511015620001a1576200019983620003a8565b9050620001b4565b81620001ae848262000930565b5060ff90505b92915050565b6008546040805165ffffffffffff928316815291831660208301527fc565b045403dc03c2eea82b81a0465edad9e2e7fc4d97e11421c209da93d7a93910160405180910390a16008805465ffffffffffff191665ffffffffffff92909216919091179055565b8063ffffffff16600003620002505760405163f1cfbf0560e01b8152600060048201526024015b60405180910390fd5b6008546040805163ffffffff66010000000000009093048316815291831660208301527f7e3f7f0708a84de9203036abaa450dccc85ad5ff52f78c170f3edb55cf5e8828910160405180910390a16008805463ffffffff90921666010000000000000263ffffffff60301b19909216919091179055565b60075460408051918252602082018390527fccb45da8d5717e6c4544694297c4ba5cf151d455c9bb0ed4fc7a38411bc05461910160405180910390a1600755565b606480821115620003375760405163243e544560e01b8152600481018390526024810182905260440162000247565b600062000343620003eb565b9050620003686200035362000407565b6200035e8562000489565b600a9190620004c3565b505060408051828152602081018590527f0553476bf02ef2726e8ce5ced78d63e26e602e4a2257b1f559418e24b4633997910160405180910390a1505050565b600080829050601f81511115620003d6578260405163305a27a960e01b8152600401620002479190620009fc565b8051620003e38262000a31565b179392505050565b6000620003f9600a620004e0565b6001600160d01b0316905090565b6000620004146101605190565b6001600160a01b03166391ddadf46040518163ffffffff1660e01b8152600401602060405180830381865afa92505050801562000470575060408051601f3d908101601f191682019092526200046d9181019062000a56565b60015b62000484576200047f62000530565b905090565b919050565b60006001600160d01b03821115620004bf576040516306dfcc6560e41b815260d060048201526024810183905260440162000247565b5090565b600080620004d38585856200053d565b915091505b935093915050565b8054600090801562000526576200050c83620004fe60018462000a74565b600091825260209091200190565b54660100000000000090046001600160d01b031662000529565b60005b9392505050565b60006200047f43620006a6565b825460009081908015620006475760006200055f87620004fe60018562000a74565b805490915065ffffffffffff80821691660100000000000090046001600160d01b0316908816821115620005a657604051632520601d60e01b815260040160405180910390fd5b8765ffffffffffff168265ffffffffffff1603620005e457825465ffffffffffff1666010000000000006001600160d01b0389160217835562000638565b6040805180820190915265ffffffffffff808a1682526001600160d01b03808a1660208085019182528d54600181018f5560008f815291909120945191519092166601000000000000029216919091179101555b9450859350620004d892505050565b50506040805180820190915265ffffffffffff80851682526001600160d01b0380851660208085019182528854600181018a5560008a8152918220955192519093166601000000000000029190931617920191909155905081620004d8565b600065ffffffffffff821115620004bf576040516306dfcc6560e41b8152603060048201526024810183905260440162000247565b634e487b7160e01b600052604160045260246000fd5b60005b838110156200070e578181015183820152602001620006f4565b50506000910152565b600082601f8301126200072957600080fd5b81516001600160401b0380821115620007465762000746620006db565b604051601f8301601f19908116603f01168101908282118183101715620007715762000771620006db565b816040528381528660208588010111156200078b57600080fd5b6200079e846020830160208901620006f1565b9695505050505050565b805165ffffffffffff811681146200048457600080fd5b805163ffffffff811681146200048457600080fd5b600080600080600080600080610100898b031215620007f257600080fd5b885160208a01519098506001600160a01b03811681146200081257600080fd5b60408a01519097506001600160401b03808211156200083057600080fd5b6200083e8c838d0162000717565b975060608b01519150808211156200085557600080fd5b50620008648b828c0162000717565b9550506200087560808a01620007a8565b93506200088560a08a01620007bf565b60c08a015160e0909a0151989b979a5095989497939692505050565b600181811c90821680620008b657607f821691505b602082108103620008d757634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200092b57600081815260208120601f850160051c81016020861015620009065750805b601f850160051c820191505b81811015620009275782815560010162000912565b5050505b505050565b81516001600160401b038111156200094c576200094c620006db565b62000964816200095d8454620008a1565b84620008dd565b602080601f8311600181146200099c5760008415620009835750858301515b600019600386901b1c1916600185901b17855562000927565b600085815260208120601f198616915b82811015620009cd57888601518255948401946001909101908401620009ac565b5085821015620009ec5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b602081526000825180602084015262000a1d816040850160208701620006f1565b601f01601f19169190910160400192915050565b80516020808301519190811015620008d75760001960209190910360031b1b16919050565b60006020828403121562000a6957600080fd5b6200052982620007a8565b81810381811115620001b457634e487b7160e01b600052601160045260246000fd5b60805160a05160c05160e0516101005161012051610140516101605161018051614b3762000b4d600039600081816107e201528181610b1501528181610d06015281816114e901528181611d1a01528181611f30015261206f015260008181610a90015281816111b60152818161180d01528181612b200152612d1101526000612aeb01526000612abe01526000612f3a01526000612f1201526000612e6d01526000612e9701526000612ec10152614b376000f3fe6080604052600436106102e85760003560e01c80637ecebe0011610190578063c01f9e37116100dc578063e2f3dce011610095578063ece40cc11161006f578063ece40cc114610a15578063f23a6e6114610a35578063f8ce560a14610a61578063fc0c546a14610a8157600080fd5b8063e2f3dce0146109c0578063e540d01d146109d5578063eb9019d4146109f557600080fd5b8063c01f9e37146108d3578063c28bc2fa146108f3578063c59057e414610906578063cc31491c14610926578063dd4e2ba514610946578063deaaa7cc1461098c57600080fd5b80639fa92f9d11610149578063ab58fb8e11610123578063ab58fb8e1461083a578063b47a321814610872578063b58131b014610892578063bc197c81146108a757600080fd5b80639fa92f9d146107d0578063a7713a7014610804578063a9a952941461081957600080fd5b80637ecebe00146106f257806384b0196e146107285780638ff262e31461075057806391ddadf41461077057806397c3d3341461079c5780639a802a6d146107b057600080fd5b80633e4f49e61161024f578063567813881161020857806360c4247f116101e257806360c4247f1461067257806379051887146106925780637b3c71d3146106b25780637d5e81e2146106d257600080fd5b806356781388146106125780635b8d0e0d146106325780635f398a141461065257600080fd5b80633e4f49e6146104e75780634385963214610514578063452115d61461055e5780634bf5d7e91461057e578063544ffc9c1461059357806354fd4d50146105e857600080fd5b8063160cbed7116102a1578063160cbed71461042b5780631985ba761461044b5780632656227d1461046b5780632d63f6931461047e5780632fe3e2611461049e5780633932abb1146104d257600080fd5b806301ffc9a7146102f657806302a251a31461032b57806306f3f9e61461035757806306fdde0314610377578063143489d014610399578063150b7a02146103e757600080fd5b366102f157005b005b600080fd5b34801561030257600080fd5b506103166103113660046137ad565b610ab4565b60405190151581526020015b60405180910390f35b34801561033757600080fd5b50600854600160301b900463ffffffff165b604051908152602001610322565b34801561036357600080fd5b506102ef6103723660046137d7565b610b0b565b34801561038357600080fd5b5061038c610c2a565b6040516103229190613840565b3480156103a557600080fd5b506103cf6103b43660046137d7565b6000908152600460205260409020546001600160a01b031690565b6040516001600160a01b039091168152602001610322565b3480156103f357600080fd5b5061041261040236600461392d565b630a85bd0160e11b949350505050565b6040516001600160e01b03199091168152602001610322565b34801561043757600080fd5b50610349610446366004613afe565b610cbc565b34801561045757600080fd5b506102ef610466366004613b8d565b610cfc565b610349610479366004613afe565b610ea2565b34801561048a57600080fd5b506103496104993660046137d7565b610fd5565b3480156104aa57600080fd5b506103497f3e83946653575f9a39005e1545185629e92736b7528ab20ca3816f315424a81181565b3480156104de57600080fd5b50610349610ff6565b3480156104f357600080fd5b506105076105023660046137d7565b611009565b6040516103229190613bf9565b34801561052057600080fd5b5061031661052f366004613c07565b60008281526009602090815260408083206001600160a01b038516845260030190915290205460ff1692915050565b34801561056a57600080fd5b50610349610579366004613afe565b611143565b34801561058a57600080fd5b5061038c6111b2565b34801561059f57600080fd5b506105cd6105ae3660046137d7565b6000908152600960205260409020805460018201546002909201549092565b60408051938452602084019290925290820152606001610322565b3480156105f457600080fd5b506040805180820190915260018152603160f81b602082015261038c565b34801561061e57600080fd5b5061034961062d366004613c42565b611274565b34801561063e57600080fd5b5061034961064d366004613cba565b61129d565b34801561065e57600080fd5b5061034961066d366004613d74565b6113fc565b34801561067e57600080fd5b5061034961068d3660046137d7565b611451565b34801561069e57600080fd5b506102ef6106ad366004613e0d565b6114df565b3480156106be57600080fd5b506103496106cd366004613e2a565b6115f0565b3480156106de57600080fd5b506103496106ed366004613e85565b611638565b3480156106fe57600080fd5b5061034961070d366004613f25565b6001600160a01b031660009081526002602052604090205490565b34801561073457600080fd5b5061073d6116f1565b6040516103229796959493929190613f7b565b34801561075c57600080fd5b5061034961076b366004613feb565b611737565b34801561077c57600080fd5b50610785611809565b60405165ffffffffffff9091168152602001610322565b3480156107a857600080fd5b506064610349565b3480156107bc57600080fd5b506103496107cb36600461403c565b611891565b3480156107dc57600080fd5b506103497f000000000000000000000000000000000000000000000000000000000000000081565b34801561081057600080fd5b506103496118a8565b34801561082557600080fd5b506103166108343660046137d7565b50600090565b34801561084657600080fd5b506103496108553660046137d7565b60009081526004602052604090206001015465ffffffffffff1690565b34801561087e57600080fd5b506102ef61088d366004613b8d565b6118c2565b34801561089e57600080fd5b50610349611c0e565b3480156108b357600080fd5b506104126108c2366004614092565b63bc197c8160e01b95945050505050565b3480156108df57600080fd5b506103496108ee3660046137d7565b611c19565b6102ef610901366004614121565b611c5c565b34801561091257600080fd5b50610349610921366004613afe565b611cdc565b34801561093257600080fd5b5061038c610941366004614162565b611d16565b34801561095257600080fd5b506040805180820190915260208082527f737570706f72743d627261766f2671756f72756d3d666f722c6162737461696e9082015261038c565b34801561099857600080fd5b506103497ff2aad550cf55f045cb27e9c559f9889fdfb6e6cdaa032301d6ea397784ae51d781565b3480156109cc57600080fd5b5061038c611e98565b3480156109e157600080fd5b506102ef6109f03660046141b1565b611f26565b348015610a0157600080fd5b50610349610a103660046141d7565b612044565b348015610a2157600080fd5b506102ef610a303660046137d7565b612065565b348015610a4157600080fd5b50610412610a50366004614201565b63f23a6e6160e01b95945050505050565b348015610a6d57600080fd5b50610349610a7c3660046137d7565b612148565b348015610a8d57600080fd5b507f00000000000000000000000000000000000000000000000000000000000000006103cf565b60006001600160e01b031982166332a2ad4360e11b1480610ae557506001600160e01b03198216630271189760e51b145b80610b0057506301ffc9a760e01b6001600160e01b03198316145b92915050565b905090565b610b13612153565b7f00000000000000000000000000000000000000000000000000000000000000004614610b5b5760405162461bcd60e51b8152600401610b5290614265565b60405180910390fd5b604051633b0d4dd760e01b8152600c6004828101919091526024820152600090730152ee45780385dACCCCB128D816031CfFe5F36B90633b0d4dd790604401602060405180830381865af4158015610bb7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bdb91906142a9565b90506000610be76118a8565b9050610bf28361218b565b60045b6040805183815260208101869052908101849052600080516020614ae2833981519152906060015b60405180910390a2505050565b606060038054610c39906142c2565b80601f0160208091040260200160405190810160405280929190818152602001828054610c65906142c2565b8015610cb25780601f10610c8757610100808354040283529160200191610cb2565b820191906000526020600020905b815481529060010190602001808311610c9557829003601f168201915b5050505050905090565b600080610ccb86868686611cdc565b9050610ce081610cdb6004612219565b61223c565b506000604051634844252360e11b815260040160405180910390fd5b610d04612153565b7f00000000000000000000000000000000000000000000000000000000000000004614610d435760405162461bcd60e51b8152600401610b5290614265565b604051633b0d4dd760e01b8152600c600482015260006024820181905290730152ee45780385dACCCCB128D816031CfFe5F36B90633b0d4dd790604401602060405180830381865af4158015610d9d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dc191906142a9565b90506000600b8054610dd2906142c2565b80601f0160208091040260200160405190810160405280929190818152602001828054610dfe906142c2565b8015610e4b5780601f10610e2057610100808354040283529160200191610e4b565b820191906000526020600020905b815481529060010190602001808311610e2e57829003601f168201915b5050505050905082600b9081610e619190614347565b507f67c6aa39e9b4a701119ddc2f40a18145fff9b6f4fa224d5f29c28755f719ffb2818484604051610e9593929190614406565b60405180910390a1505050565b600080610eb186868686611cdc565b9050610ed181610ec16005612219565b610ecb6004612219565b1761223c565b506000818152600460205260409020805460ff60f01b1916600160f01b17905530610ef93090565b6001600160a01b031614610f8b5760005b8651811015610f8957306001600160a01b0316878281518110610f2f57610f2f61443c565b60200260200101516001600160a01b031603610f7957610f79858281518110610f5a57610f5a61443c565b602002602001015180519060200120600561227b90919063ffffffff16565b610f8281614468565b9050610f0a565b505b610f9881878787876122dd565b6040518181527f712ae1383f79ac853f8d882153778e0260ef8f03b504e2866e0593e04d2b291f906020015b60405180910390a195945050505050565b600090815260046020526040902054600160a01b900465ffffffffffff1690565b6000610b0660085465ffffffffffff1690565b6000818152600460205260408120805460ff600160f01b8204811691600160f81b900416811561103e57506007949350505050565b801561104f57506002949350505050565b600061105a86610fd5565b90508060000361108057604051636ad0607560e01b815260048101879052602401610b52565b600061108a611809565b65ffffffffffff1690508082106110a8575060009695505050505050565b60006110b388611c19565b90508181106110ca57506001979650505050505050565b6110d3886123bd565b15806110f357506000888152600960205260409020805460019091015411155b1561110657506003979650505050505050565b60008881526004602052604090206001015465ffffffffffff1660000361113557506004979650505050505050565b506005979650505050505050565b60008061115286868686611cdc565b905061116281610cdb6000612219565b506000818152600460205260409020546001600160a01b0316331461119c5760405163233d98e360e01b8152336004820152602401610b52565b6111a8868686866123f4565b9695505050505050565b60607f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316634bf5d7e96040518163ffffffff1660e01b8152600401600060405180830381865afa92505050801561123357506040513d6000823e601f3d908101601f1916820160405261123091908101906144b1565b60015b61126f575060408051808201909152601d81527f6d6f64653d626c6f636b6e756d6265722666726f6d3d64656661756c74000000602082015290565b919050565b600080339050611295848285604051806020016040528060008152506124a5565b949350505050565b6000806113808761137a7f3e83946653575f9a39005e1545185629e92736b7528ab20ca3816f315424a8118c8c8c6112f28e6001600160a01b0316600090815260026020526040902080546001810190915590565b8d8d6040516113029291906144f9565b60405180910390208c8051906020012060405160200161135f9796959493929190968752602087019590955260ff9390931660408601526001600160a01b03919091166060850152608084015260a083015260c082015260e00190565b604051602081830303815290604052805190602001206124d1565b856124fe565b9050806113ab576040516394ab6c0760e01b81526001600160a01b0388166004820152602401610b52565b6113ef89888a89898080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508b9250612572915050565b9998505050505050505050565b60008033905061144687828888888080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508a9250612572915050565b979650505050505050565b600a80546000918290611465600184614509565b815481106114755761147561443c565b6000918252602090912001805490915065ffffffffffff811690600160301b90046001600160d01b03168582116114b8576001600160d01b031695945050505050565b6114cc6114c487612654565b600a9061268b565b6001600160d01b03169695505050505050565b6114e7612153565b7f000000000000000000000000000000000000000000000000000000000000000046146115265760405162461bcd60e51b8152600401610b5290614265565b604051633b0d4dd760e01b8152600c600482015260016024820152600090730152ee45780385dACCCCB128D816031CfFe5F36B90633b0d4dd790604401602060405180830381865af4158015611580573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115a491906142a9565b905060006115b0610ff6565b90506115bb83612740565b60016040805183815265ffffffffffff86166020820152908101849052600080516020614ae283398151915290606001610c1d565b6000803390506111a886828787878080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506124a592505050565b60003361164581846127a6565b61166d5760405163d9b3955760e01b81526001600160a01b0382166004820152602401610b52565b6000611677611c0e565b905080156116e45760006116a683600161168f611809565b611699919061451c565b65ffffffffffff16612044565b9050818110156116e257604051636121770b60e11b81526001600160a01b03841660048201526024810182905260448101839052606401610b52565b505b6114468787878786612897565b600060608060008060006060611705612ab7565b61170d612ae4565b60408051600080825260208201909252600f60f81b9b939a50919850469750309650945092509050565b6000806117c38461137a7ff2aad550cf55f045cb27e9c559f9889fdfb6e6cdaa032301d6ea397784ae51d789898961178c8b6001600160a01b0316600090815260026020526040902080546001810190915590565b60408051602081019690965285019390935260ff90911660608401526001600160a01b0316608083015260a082015260c00161135f565b9050806117ee576040516394ab6c0760e01b81526001600160a01b0385166004820152602401610b52565b6111a8868587604051806020016040528060008152506124a5565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166391ddadf46040518163ffffffff1660e01b8152600401602060405180830381865afa925050508015611885575060408051601f3d908101601f1916820190925261188291810190614542565b60015b61126f57610b06612b11565b600061189e848484612b1c565b90505b9392505050565b60006118b4600a612bb2565b6001600160d01b0316905090565b6000806000730152ee45780385dACCCCB128D816031CfFe5F36B63c0af65918530600c6040518463ffffffff1660e01b81526004016119039392919061455f565b600060405180830381865af4158015611920573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261194891908101906145ad565b9194509250905060ff8316611a505760008280602001905181019061196d91906144b1565b90506000600b805461197e906142c2565b80601f01602080910402602001604051908101604052809291908181526020018280546119aa906142c2565b80156119f75780601f106119cc576101008083540402835291602001916119f7565b820191906000526020600020905b8154815290600101906020018083116119da57829003601f168201915b5050505050905081600b9081611a0d9190614347565b507f67c6aa39e9b4a701119ddc2f40a18145fff9b6f4fa224d5f29c28755f719ffb2818385604051611a4193929190614406565b60405180910390a15050611c08565b60001960ff841601611ac1576000611a6783614606565b60d01c90506000611a76610ff6565b9050611a8182612740565b60016040805183815265ffffffffffff85166020820152908101859052600080516020614ae2833981519152906060015b60405180910390a25050611c08565b60011960ff841601611b34576000611ad88361463d565b60e01c90506000611af660085463ffffffff600160301b9091041690565b9050611b0182612beb565b60026040805183815263ffffffff85166020820152908101859052600080516020614ae283398151915290606001611ab2565b60021960ff841601611b9b57600082806020019051810190611b5691906142a9565b90506000611b62611c0e565b9050611b6d82612c89565b60036040805183815260208101859052908101859052600080516020614ae283398151915290606001611ab2565b60031960ff841601611c0857600082806020019051810190611bbd91906142a9565b90506000611bc96118a8565b9050611bd48261218b565b60046040805183815260208101859052908101859052600080516020614ae28339815191529060600160405180910390a250505b50505050565b6000610b0660075490565b600081815260046020526040812054611c4e90600160d01b810463ffffffff1690600160a01b900465ffffffffffff16614670565b65ffffffffffff1692915050565b611c64612153565b600080856001600160a01b0316858585604051611c829291906144f9565b60006040518083038185875af1925050503d8060008114611cbf576040519150601f19603f3d011682016040523d82523d6000602084013e611cc4565b606091505b5091509150611cd38282612cca565b50505050505050565b600084848484604051602001611cf5949392919061471a565b60408051601f19818403018152919052805160209091012095945050505050565b60607f00000000000000000000000000000000000000000000000000000000000000004614611d935760405162461bcd60e51b815260206004820152602360248201527f50726f6f6673206f6e6c792067656e657261746564206f6e20686f6d6520636860448201526230b4b760e91b6064820152608401610b52565b604051630564edeb60e31b8152600c600482015260ff84166024820152600090730152ee45780385dACCCCB128D816031CfFe5F36B90632b276f5890604401602060405180830381865af4158015611def573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e1391906142a9565b604051637352178160e01b8152909150730152ee45780385dACCCCB128D816031CfFe5F36B90637352178190611e53903090889088908790600401614765565b600060405180830381865af4158015611e70573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261129591908101906147a3565b600b8054611ea5906142c2565b80601f0160208091040260200160405190810160405280929190818152602001828054611ed1906142c2565b8015611f1e5780601f10611ef357610100808354040283529160200191611f1e565b820191906000526020600020905b815481529060010190602001808311611f0157829003601f168201915b505050505081565b611f2e612153565b7f00000000000000000000000000000000000000000000000000000000000000004614611f6d5760405162461bcd60e51b8152600401610b5290614265565b604051633b0d4dd760e01b8152600c600482015260026024820152600090730152ee45780385dACCCCB128D816031CfFe5F36B90633b0d4dd790604401602060405180830381865af4158015611fc7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611feb91906142a9565b9050600061200660085463ffffffff600160301b9091041690565b905061201183612beb565b60026040805183815263ffffffff86166020820152908101849052600080516020614ae283398151915290606001610c1d565b60006118a1838361206060408051602081019091526000815290565b612b1c565b61206d612153565b7f000000000000000000000000000000000000000000000000000000000000000046146120ac5760405162461bcd60e51b8152600401610b5290614265565b604051633b0d4dd760e01b8152600c600482015260036024820152600090730152ee45780385dACCCCB128D816031CfFe5F36B90633b0d4dd790604401602060405180830381865af4158015612106573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061212a91906142a9565b90506000612136611c0e565b905061214183612c89565b6003610bf5565b6000610b0082612ce6565b303314612175576040516347096e4760e01b8152336004820152602401610b52565b565b806121826005612d90565b03612177575b50565b6064808211156121b85760405163243e544560e01b81526004810183905260248101829052604401610b52565b60006121c26118a8565b90506121e16121cf611809565b6121d885612dff565b600a9190612e33565b505060408051828152602081018590527f0553476bf02ef2726e8ce5ced78d63e26e602e4a2257b1f559418e24b46339979101610e95565b600081600781111561222d5761222d613bc1565b600160ff919091161b92915050565b60008061224884611009565b905060008361225683612219565b16036118a1578381846040516331b75e4d60e01b8152600401610b52939291906147d7565b81546001600160801b03600160801b8204811691811660018301909116036122a7576122a76041612e4e565b6001600160801b03808216600090815260018086016020526040909120939093558354919092018216600160801b029116179055565b60005b84518110156123b5576000808683815181106122fe576122fe61443c565b60200260200101516001600160a01b03168684815181106123215761232161443c565b602002602001015186858151811061233b5761233b61443c565b602002602001015160405161235091906147f9565b60006040518083038185875af1925050503d806000811461238d576040519150601f19603f3d011682016040523d82523d6000602084013e612392565b606091505b50915091506123a18282612cca565b505050806123ae90614468565b90506122e0565b505050505050565b6000818152600960205260408120600281015460018201546123df9190614815565b6123eb610a7c85610fd5565b11159392505050565b60008061240386868686611cdc565b9050612451816124136007612219565b61241d6006612219565b6124276002612219565b6001612434600782614828565b61243f906002614925565b6124499190614509565b18181861223c565b506000818152600460205260409081902080546001600160f81b0316600160f81b179055517f789cf55be980739dad1d0699b93b58e806b51c9d96619bfa8fe0a28abaa7b30c90610fc49083815260200190565b60006124c8858585856124c360408051602081019091526000815290565b612572565b95945050505050565b6000610b006124de612e60565b8360405161190160f01b8152600281019290925260228201526042902090565b6000836001600160a01b03163b6000036125605760008061251f8585612f8b565b509092509050600081600381111561253957612539613bc1565b1480156125575750856001600160a01b0316826001600160a01b0316145b925050506118a1565b61256b848484612fd8565b90506118a1565b600061258286610cdb6001612219565b5060006125988661259289610fd5565b85612b1c565b905060006125a988888885886130b3565b9050835160000361260057866001600160a01b03167fb8e138887d0aa13bab447e82de9d5c1777041ecd21ca36ba824ff1e6c07ddda4898884896040516125f39493929190614934565b60405180910390a2611446565b866001600160a01b03167fe2babfbac5889a709b63bb7f598b324e08bc5a4fb9ec647fb3cbc9ec07eb8712898884898960405161264195949392919061495c565b60405180910390a2979650505050505050565b600065ffffffffffff821115612687576040516306dfcc6560e41b81526030600482015260248101839052604401610b52565b5090565b8154600090818160058111156126ea5760006126a6846131b6565b6126b09085614509565b60008881526020902090915081015465ffffffffffff90811690871610156126da578091506126e8565b6126e5816001614815565b92505b505b60006126f88787858561330f565b905080156127335761271d8761270f600184614509565b600091825260209091200190565b54600160301b90046001600160d01b0316611446565b6000979650505050505050565b6008546040805165ffffffffffff928316815291831660208301527fc565b045403dc03c2eea82b81a0465edad9e2e7fc4d97e11421c209da93d7a93910160405180910390a16008805465ffffffffffff191665ffffffffffff92909216919091179055565b805160009060348110156127be576001915050610b00565b82810160131901516001600160a01b031981166b046e0e4dee0dee6cae47a60f60a31b146127f157600192505050610b00565b6000806127ff602885614509565b90505b83811015612876576000806128368884815181106128225761282261443c565b01602001516001600160f81b031916613371565b915091508161284e5760019650505050505050610b00565b8060ff166004856001600160a01b0316901b17935050508061286f90614468565b9050612802565b50856001600160a01b0316816001600160a01b031614935050505092915050565b60006128ac8686868680519060200120611cdc565b9050845186511415806128c157508351865114155b806128cb57508551155b1561290057855184518651604051630447b05d60e41b8152600481019390935260248301919091526044820152606401610b52565b600081815260046020526040902054600160a01b900465ffffffffffff161561294b578061292d82611009565b6040516331b75e4d60e01b8152610b529291906000906004016147d7565b6000612955610ff6565b61295d611809565b65ffffffffffff1661296f9190614815565b9050600061298a60085463ffffffff600160301b9091041690565b600084815260046020526040902080546001600160a01b0319166001600160a01b0387161781559091506129bd83612654565b815465ffffffffffff91909116600160a01b0265ffffffffffff60a01b199091161781556129ea82613403565b815463ffffffff91909116600160d01b0263ffffffff60d01b1990911617815588517f7d84a6263ae0d98d3329bd7b46bb4e8d6f98cd35a7adb45c274c8b7fd5ebd5e090859087908c908c906001600160401b03811115612a4d57612a4d61386a565b604051908082528060200260200182016040528015612a8057816020015b6060815260200190600190039081612a6b5790505b508c89612a8d8a82614815565b8e604051612aa3999897969594939291906149a2565b60405180910390a150505095945050505050565b6060610b067f00000000000000000000000000000000000000000000000000000000000000006000613434565b6060610b067f00000000000000000000000000000000000000000000000000000000000000006001613434565b6000610b0643612654565b60007f0000000000000000000000000000000000000000000000000000000000000000604051630748d63560e31b81526001600160a01b038681166004830152602482018690529190911690633a46b1a890604401602060405180830381865afa158015612b8e573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061189e91906142a9565b80546000908015612be257612bcc8361270f600184614509565b54600160301b90046001600160d01b03166118a1565b60009392505050565b8063ffffffff16600003612c155760405163f1cfbf0560e01b815260006004820152602401610b52565b6008546040805163ffffffff600160301b9093048316815291831660208301527f7e3f7f0708a84de9203036abaa450dccc85ad5ff52f78c170f3edb55cf5e8828910160405180910390a16008805463ffffffff909216600160301b0269ffffffff00000000000019909216919091179055565b60075460408051918252602082018390527fccb45da8d5717e6c4544694297c4ba5cf151d455c9bb0ed4fc7a38411bc05461910160405180910390a1600755565b606082612cdf57612cda826134df565b610b00565b5080610b00565b60006064612cf383611451565b604051632394e7a360e21b8152600481018590526001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001690638e539e8c90602401602060405180830381865afa158015612d58573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612d7c91906142a9565b612d869190614a79565b610b009190614aa6565b80546000906001600160801b0380821691600160801b9004168103612db957612db96031612e4e565b6001600160801b038181166000908152600185810160205260408220805492905585546fffffffffffffffffffffffffffffffff19169301909116919091179092555090565b60006001600160d01b03821115612687576040516306dfcc6560e41b815260d0600482015260248101839052604401610b52565b600080612e41858585613508565b915091505b935093915050565b634e487b71600052806020526024601cfd5b6000306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016148015612eb957507f000000000000000000000000000000000000000000000000000000000000000046145b15612ee357507f000000000000000000000000000000000000000000000000000000000000000090565b610b06604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f60208201527f0000000000000000000000000000000000000000000000000000000000000000918101919091527f000000000000000000000000000000000000000000000000000000000000000060608201524660808201523060a082015260009060c00160405160208183030381529060405280519060200120905090565b60008060008351604103612fc55760208401516040850151606086015160001a612fb78882858561365c565b955095509550505050612fd1565b50508151600091506002905b9250925092565b6000806000856001600160a01b03168585604051602401612ffa929190614ac8565b60408051601f198184030181529181526020820180516001600160e01b0316630b135d3f60e11b1790525161302f91906147f9565b600060405180830381855afa9150503d806000811461306a576040519150601f19603f3d011682016040523d82523d6000602084013e61306f565b606091505b509150915081801561308357506020815110155b80156111a857508051630b135d3f60e11b906130a890830160209081019084016142a9565b149695505050505050565b60008581526009602090815260408083206001600160a01b03881684526003810190925282205460ff1615613106576040516371c6af4960e01b81526001600160a01b0387166004820152602401610b52565b6001600160a01b03861660009081526003820160205260409020805460ff1916600117905560ff851661315257838160000160008282546131479190614815565b909155506131ab9050565b60001960ff86160161317257838160010160008282546131479190614815565b60011960ff86160161319257838160020160008282546131479190614815565b6040516303599be160e11b815260040160405180910390fd5b509195945050505050565b6000600182116131c4575090565b816001600160801b82106131dd5760809190911c9060401b5b6801000000000000000082106131f85760409190911c9060201b5b640100000000821061320f5760209190911c9060101b5b6201000082106132245760109190911c9060081b5b61010082106132385760089190911c9060041b5b6010821061324b5760049190911c9060021b5b600482106132575760011b5b600302600190811c9081858161326f5761326f614a90565b048201901c9050600181858161328757613287614a90565b048201901c9050600181858161329f5761329f614a90565b048201901c905060018185816132b7576132b7614a90565b048201901c905060018185816132cf576132cf614a90565b048201901c905060018185816132e7576132e7614a90565b048201901c905061330681858161330057613300614a90565b04821190565b90039392505050565b60005b81831015613369576000613326848461372b565b60008781526020902090915065ffffffffffff86169082015465ffffffffffff16111561335557809250613363565b613360816001614815565b93505b50613312565b509392505050565b60008060f883901c602f8111801561338c5750603a8160ff16105b156133a157600194602f199091019350915050565b8060ff1660401080156133b7575060478160ff16105b156133cc576001946036199091019350915050565b8060ff1660601080156133e2575060678160ff16105b156133f7576001946056199091019350915050565b50600093849350915050565b600063ffffffff821115612687576040516306dfcc6560e41b81526020600482015260248101839052604401610b52565b606060ff831461344e5761344783613746565b9050610b00565b81805461345a906142c2565b80601f0160208091040260200160405190810160405280929190818152602001828054613486906142c2565b80156134d35780601f106134a8576101008083540402835291602001916134d3565b820191906000526020600020905b8154815290600101906020018083116134b657829003601f168201915b50505050509050610b00565b8051156134ef5780518082602001fd5b60405163d6bda27560e01b815260040160405180910390fd5b8254600090819080156136015760006135268761270f600185614509565b805490915065ffffffffffff80821691600160301b90046001600160d01b031690881682111561356957604051632520601d60e01b815260040160405180910390fd5b8765ffffffffffff168265ffffffffffff16036135a257825465ffffffffffff16600160301b6001600160d01b038916021783556135f3565b6040805180820190915265ffffffffffff808a1682526001600160d01b03808a1660208085019182528d54600181018f5560008f81529190912094519151909216600160301b029216919091179101555b9450859350612e4692505050565b50506040805180820190915265ffffffffffff80851682526001600160d01b0380851660208085019182528854600181018a5560008a815291822095519251909316600160301b029190931617920191909155905081612e46565b600080807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08411156136975750600091506003905082613721565b604080516000808252602082018084528a905260ff891692820192909252606081018790526080810186905260019060a0016020604051602081039080840390855afa1580156136eb573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b03811661371757506000925060019150829050613721565b9250600091508190505b9450945094915050565b600061373a6002848418614aa6565b6118a190848416614815565b6060600061375383613785565b604080516020808252818301909252919250600091906020820181803683375050509182525060208101929092525090565b600060ff8216601f811115610b0057604051632cd44ac360e21b815260040160405180910390fd5b6000602082840312156137bf57600080fd5b81356001600160e01b0319811681146118a157600080fd5b6000602082840312156137e957600080fd5b5035919050565b60005b8381101561380b5781810151838201526020016137f3565b50506000910152565b6000815180845261382c8160208601602086016137f0565b601f01601f19169290920160200192915050565b6020815260006118a16020830184613814565b80356001600160a01b038116811461126f57600080fd5b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b03811182821017156138a8576138a861386a565b604052919050565b60006001600160401b038211156138c9576138c961386a565b50601f01601f191660200190565b600082601f8301126138e857600080fd5b81356138fb6138f6826138b0565b613880565b81815284602083860101111561391057600080fd5b816020850160208301376000918101602001919091529392505050565b6000806000806080858703121561394357600080fd5b61394c85613853565b935061395a60208601613853565b92506040850135915060608501356001600160401b0381111561397c57600080fd5b613988878288016138d7565b91505092959194509250565b60006001600160401b038211156139ad576139ad61386a565b5060051b60200190565b600082601f8301126139c857600080fd5b813560206139d86138f683613994565b82815260059290921b840181019181810190868411156139f757600080fd5b8286015b84811015613a1957613a0c81613853565b83529183019183016139fb565b509695505050505050565b600082601f830112613a3557600080fd5b81356020613a456138f683613994565b82815260059290921b84018101918181019086841115613a6457600080fd5b8286015b84811015613a195780358352918301918301613a68565b600082601f830112613a9057600080fd5b81356020613aa06138f683613994565b82815260059290921b84018101918181019086841115613abf57600080fd5b8286015b84811015613a195780356001600160401b03811115613ae25760008081fd5b613af08986838b01016138d7565b845250918301918301613ac3565b60008060008060808587031215613b1457600080fd5b84356001600160401b0380821115613b2b57600080fd5b613b37888389016139b7565b95506020870135915080821115613b4d57600080fd5b613b5988838901613a24565b94506040870135915080821115613b6f57600080fd5b50613b7c87828801613a7f565b949793965093946060013593505050565b600060208284031215613b9f57600080fd5b81356001600160401b03811115613bb557600080fd5b611295848285016138d7565b634e487b7160e01b600052602160045260246000fd5b60088110613bf557634e487b7160e01b600052602160045260246000fd5b9052565b60208101610b008284613bd7565b60008060408385031215613c1a57600080fd5b82359150613c2a60208401613853565b90509250929050565b60ff8116811461218857600080fd5b60008060408385031215613c5557600080fd5b823591506020830135613c6781613c33565b809150509250929050565b60008083601f840112613c8457600080fd5b5081356001600160401b03811115613c9b57600080fd5b602083019150836020828501011115613cb357600080fd5b9250929050565b600080600080600080600060c0888a031215613cd557600080fd5b873596506020880135613ce781613c33565b9550613cf560408901613853565b945060608801356001600160401b0380821115613d1157600080fd5b613d1d8b838c01613c72565b909650945060808a0135915080821115613d3657600080fd5b613d428b838c016138d7565b935060a08a0135915080821115613d5857600080fd5b50613d658a828b016138d7565b91505092959891949750929550565b600080600080600060808688031215613d8c57600080fd5b853594506020860135613d9e81613c33565b935060408601356001600160401b0380821115613dba57600080fd5b613dc689838a01613c72565b90955093506060880135915080821115613ddf57600080fd5b50613dec888289016138d7565b9150509295509295909350565b65ffffffffffff8116811461218857600080fd5b600060208284031215613e1f57600080fd5b81356118a181613df9565b60008060008060608587031215613e4057600080fd5b843593506020850135613e5281613c33565b925060408501356001600160401b03811115613e6d57600080fd5b613e7987828801613c72565b95989497509550505050565b60008060008060808587031215613e9b57600080fd5b84356001600160401b0380821115613eb257600080fd5b613ebe888389016139b7565b95506020870135915080821115613ed457600080fd5b613ee088838901613a24565b94506040870135915080821115613ef657600080fd5b613f0288838901613a7f565b93506060870135915080821115613f1857600080fd5b50613988878288016138d7565b600060208284031215613f3757600080fd5b6118a182613853565b600081518084526020808501945080840160005b83811015613f7057815187529582019590820190600101613f54565b509495945050505050565b60ff60f81b8816815260e060208201526000613f9a60e0830189613814565b8281036040840152613fac8189613814565b606084018890526001600160a01b038716608085015260a0840186905283810360c08501529050613fdd8185613f40565b9a9950505050505050505050565b6000806000806080858703121561400157600080fd5b84359350602085013561401381613c33565b925061402160408601613853565b915060608501356001600160401b0381111561397c57600080fd5b60008060006060848603121561405157600080fd5b61405a84613853565b92506020840135915060408401356001600160401b0381111561407c57600080fd5b614088868287016138d7565b9150509250925092565b600080600080600060a086880312156140aa57600080fd5b6140b386613853565b94506140c160208701613853565b935060408601356001600160401b03808211156140dd57600080fd5b6140e989838a01613a24565b945060608801359150808211156140ff57600080fd5b61410b89838a01613a24565b93506080880135915080821115613ddf57600080fd5b6000806000806060858703121561413757600080fd5b61414085613853565b93506020850135925060408501356001600160401b03811115613e6d57600080fd5b6000806040838503121561417557600080fd5b823561418081613c33565b915060208301356001600160401b0381111561419b57600080fd5b6141a7858286016138d7565b9150509250929050565b6000602082840312156141c357600080fd5b813563ffffffff811681146118a157600080fd5b600080604083850312156141ea57600080fd5b6141f383613853565b946020939093013593505050565b600080600080600060a0868803121561421957600080fd5b61422286613853565b945061423060208701613853565b9350604086013592506060860135915060808601356001600160401b0381111561425957600080fd5b613dec888289016138d7565b60208082526024908201527f4f7065726174696f6e206f6e6c7920616c6c6f776564206f6e20686f6d6520636040820152633430b4b760e11b606082015260800190565b6000602082840312156142bb57600080fd5b5051919050565b600181811c908216806142d657607f821691505b6020821081036142f657634e487b7160e01b600052602260045260246000fd5b50919050565b601f82111561434257600081815260208120601f850160051c810160208610156143235750805b601f850160051c820191505b818110156123b55782815560010161432f565b505050565b81516001600160401b038111156143605761436061386a565b6143748161436e84546142c2565b846142fc565b602080601f8311600181146143a957600084156143915750858301515b600019600386901b1c1916600185901b1785556123b5565b600085815260208120601f198616915b828110156143d8578886015182559484019460019091019084016143b9565b50858210156143f65787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6060815260006144196060830186613814565b828103602084015261442b8186613814565b915050826040830152949350505050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60006001820161447a5761447a614452565b5060010190565b600061448f6138f6846138b0565b90508281528383830111156144a357600080fd5b6118a18360208301846137f0565b6000602082840312156144c357600080fd5b81516001600160401b038111156144d957600080fd5b8201601f810184136144ea57600080fd5b61129584825160208401614481565b8183823760009101908152919050565b81810381811115610b0057610b00614452565b65ffffffffffff82811682821603908082111561453b5761453b614452565b5092915050565b60006020828403121561455457600080fd5b81516118a181613df9565b6060815260006145726060830186613814565b6001600160a01b039490941660208301525060400152919050565b600082601f83011261459e57600080fd5b6118a183835160208501614481565b6000806000606084860312156145c257600080fd5b83516145cd81613c33565b60208501519093506001600160401b038111156145e957600080fd5b6145f58682870161458d565b925050604084015190509250925092565b805160208201516001600160d01b031980821692919060068310156146355780818460060360031b1b83161693505b505050919050565b805160208201516001600160e01b031980821692919060048310156146355760049290920360031b82901b161692915050565b65ffffffffffff81811683821601908082111561453b5761453b614452565b600081518084526020808501945080840160005b83811015613f705781516001600160a01b0316875295820195908201906001016146a3565b6000815180845260208085019450848260051b860182860160005b8581101561470d5783830389526146fb838351613814565b988501989250908401906001016146e3565b5090979650505050505050565b60808152600061472d608083018761468f565b828103602084015261473f8187613f40565b9050828103604084015261475381866146c8565b91505082606083015295945050505050565b6001600160a01b038516815260ff8416602082015260806040820181905260009061479290830185613814565b905082606083015295945050505050565b6000602082840312156147b557600080fd5b81516001600160401b038111156147cb57600080fd5b6112958482850161458d565b838152606081016147eb6020830185613bd7565b826040830152949350505050565b6000825161480b8184602087016137f0565b9190910192915050565b80820180821115610b0057610b00614452565b60ff8181168382160190811115610b0057610b00614452565b600181815b8085111561487c57816000190482111561486257614862614452565b8085161561486f57918102915b93841c9390800290614846565b509250929050565b60008261489357506001610b00565b816148a057506000610b00565b81600181146148b657600281146148c0576148dc565b6001915050610b00565b60ff8411156148d1576148d1614452565b50506001821b610b00565b5060208310610133831016604e8410600b84101617156148ff575081810a610b00565b6149098383614841565b806000190482111561491d5761491d614452565b029392505050565b60006118a160ff841683614884565b84815260ff841660208201528260408201526080606082015260006111a86080830184613814565b85815260ff8516602082015283604082015260a06060820152600061498460a0830185613814565b82810360808401526149968185613814565b98975050505050505050565b60006101208b8352602060018060a01b038c16818501528160408501526149cb8285018c61468f565b915083820360608501526149df828b613f40565b915083820360808501528189518084528284019150828160051b850101838c0160005b83811015614a3057601f19878403018552614a1e838351613814565b94860194925090850190600101614a02565b505086810360a0880152614a44818c6146c8565b9450505050508560c08401528460e0840152828103610100840152614a698185613814565b9c9b505050505050505050505050565b8082028115828204841417610b0057610b00614452565b634e487b7160e01b600052601260045260246000fd5b600082614ac357634e487b7160e01b600052601260045260246000fd5b500490565b82815260406020820152600061189e604083018461381456fe80c51ad8a7db1a7a86cc355b77bd5cd7ea08f6071ea91d85a8f792734700a0eca2646970667358221220a295bf4977b633b13f69388b67ec678a5025198475985e252038973de715a24d64736f6c63430008140033", - "deployedBytecode": "0x6080604052600436106102e85760003560e01c80637ecebe0011610190578063c01f9e37116100dc578063e2f3dce011610095578063ece40cc11161006f578063ece40cc114610a15578063f23a6e6114610a35578063f8ce560a14610a61578063fc0c546a14610a8157600080fd5b8063e2f3dce0146109c0578063e540d01d146109d5578063eb9019d4146109f557600080fd5b8063c01f9e37146108d3578063c28bc2fa146108f3578063c59057e414610906578063cc31491c14610926578063dd4e2ba514610946578063deaaa7cc1461098c57600080fd5b80639fa92f9d11610149578063ab58fb8e11610123578063ab58fb8e1461083a578063b47a321814610872578063b58131b014610892578063bc197c81146108a757600080fd5b80639fa92f9d146107d0578063a7713a7014610804578063a9a952941461081957600080fd5b80637ecebe00146106f257806384b0196e146107285780638ff262e31461075057806391ddadf41461077057806397c3d3341461079c5780639a802a6d146107b057600080fd5b80633e4f49e61161024f578063567813881161020857806360c4247f116101e257806360c4247f1461067257806379051887146106925780637b3c71d3146106b25780637d5e81e2146106d257600080fd5b806356781388146106125780635b8d0e0d146106325780635f398a141461065257600080fd5b80633e4f49e6146104e75780634385963214610514578063452115d61461055e5780634bf5d7e91461057e578063544ffc9c1461059357806354fd4d50146105e857600080fd5b8063160cbed7116102a1578063160cbed71461042b5780631985ba761461044b5780632656227d1461046b5780632d63f6931461047e5780632fe3e2611461049e5780633932abb1146104d257600080fd5b806301ffc9a7146102f657806302a251a31461032b57806306f3f9e61461035757806306fdde0314610377578063143489d014610399578063150b7a02146103e757600080fd5b366102f157005b005b600080fd5b34801561030257600080fd5b506103166103113660046137ad565b610ab4565b60405190151581526020015b60405180910390f35b34801561033757600080fd5b50600854600160301b900463ffffffff165b604051908152602001610322565b34801561036357600080fd5b506102ef6103723660046137d7565b610b0b565b34801561038357600080fd5b5061038c610c2a565b6040516103229190613840565b3480156103a557600080fd5b506103cf6103b43660046137d7565b6000908152600460205260409020546001600160a01b031690565b6040516001600160a01b039091168152602001610322565b3480156103f357600080fd5b5061041261040236600461392d565b630a85bd0160e11b949350505050565b6040516001600160e01b03199091168152602001610322565b34801561043757600080fd5b50610349610446366004613afe565b610cbc565b34801561045757600080fd5b506102ef610466366004613b8d565b610cfc565b610349610479366004613afe565b610ea2565b34801561048a57600080fd5b506103496104993660046137d7565b610fd5565b3480156104aa57600080fd5b506103497f3e83946653575f9a39005e1545185629e92736b7528ab20ca3816f315424a81181565b3480156104de57600080fd5b50610349610ff6565b3480156104f357600080fd5b506105076105023660046137d7565b611009565b6040516103229190613bf9565b34801561052057600080fd5b5061031661052f366004613c07565b60008281526009602090815260408083206001600160a01b038516845260030190915290205460ff1692915050565b34801561056a57600080fd5b50610349610579366004613afe565b611143565b34801561058a57600080fd5b5061038c6111b2565b34801561059f57600080fd5b506105cd6105ae3660046137d7565b6000908152600960205260409020805460018201546002909201549092565b60408051938452602084019290925290820152606001610322565b3480156105f457600080fd5b506040805180820190915260018152603160f81b602082015261038c565b34801561061e57600080fd5b5061034961062d366004613c42565b611274565b34801561063e57600080fd5b5061034961064d366004613cba565b61129d565b34801561065e57600080fd5b5061034961066d366004613d74565b6113fc565b34801561067e57600080fd5b5061034961068d3660046137d7565b611451565b34801561069e57600080fd5b506102ef6106ad366004613e0d565b6114df565b3480156106be57600080fd5b506103496106cd366004613e2a565b6115f0565b3480156106de57600080fd5b506103496106ed366004613e85565b611638565b3480156106fe57600080fd5b5061034961070d366004613f25565b6001600160a01b031660009081526002602052604090205490565b34801561073457600080fd5b5061073d6116f1565b6040516103229796959493929190613f7b565b34801561075c57600080fd5b5061034961076b366004613feb565b611737565b34801561077c57600080fd5b50610785611809565b60405165ffffffffffff9091168152602001610322565b3480156107a857600080fd5b506064610349565b3480156107bc57600080fd5b506103496107cb36600461403c565b611891565b3480156107dc57600080fd5b506103497f000000000000000000000000000000000000000000000000000000000000000081565b34801561081057600080fd5b506103496118a8565b34801561082557600080fd5b506103166108343660046137d7565b50600090565b34801561084657600080fd5b506103496108553660046137d7565b60009081526004602052604090206001015465ffffffffffff1690565b34801561087e57600080fd5b506102ef61088d366004613b8d565b6118c2565b34801561089e57600080fd5b50610349611c0e565b3480156108b357600080fd5b506104126108c2366004614092565b63bc197c8160e01b95945050505050565b3480156108df57600080fd5b506103496108ee3660046137d7565b611c19565b6102ef610901366004614121565b611c5c565b34801561091257600080fd5b50610349610921366004613afe565b611cdc565b34801561093257600080fd5b5061038c610941366004614162565b611d16565b34801561095257600080fd5b506040805180820190915260208082527f737570706f72743d627261766f2671756f72756d3d666f722c6162737461696e9082015261038c565b34801561099857600080fd5b506103497ff2aad550cf55f045cb27e9c559f9889fdfb6e6cdaa032301d6ea397784ae51d781565b3480156109cc57600080fd5b5061038c611e98565b3480156109e157600080fd5b506102ef6109f03660046141b1565b611f26565b348015610a0157600080fd5b50610349610a103660046141d7565b612044565b348015610a2157600080fd5b506102ef610a303660046137d7565b612065565b348015610a4157600080fd5b50610412610a50366004614201565b63f23a6e6160e01b95945050505050565b348015610a6d57600080fd5b50610349610a7c3660046137d7565b612148565b348015610a8d57600080fd5b507f00000000000000000000000000000000000000000000000000000000000000006103cf565b60006001600160e01b031982166332a2ad4360e11b1480610ae557506001600160e01b03198216630271189760e51b145b80610b0057506301ffc9a760e01b6001600160e01b03198316145b92915050565b905090565b610b13612153565b7f00000000000000000000000000000000000000000000000000000000000000004614610b5b5760405162461bcd60e51b8152600401610b5290614265565b60405180910390fd5b604051633b0d4dd760e01b8152600c600482810191909152602482015260009073__$b1c1335e68417b4234016f4aa58fdfac77$__90633b0d4dd790604401602060405180830381865af4158015610bb7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bdb91906142a9565b90506000610be76118a8565b9050610bf28361218b565b60045b6040805183815260208101869052908101849052600080516020614ae2833981519152906060015b60405180910390a2505050565b606060038054610c39906142c2565b80601f0160208091040260200160405190810160405280929190818152602001828054610c65906142c2565b8015610cb25780601f10610c8757610100808354040283529160200191610cb2565b820191906000526020600020905b815481529060010190602001808311610c9557829003601f168201915b5050505050905090565b600080610ccb86868686611cdc565b9050610ce081610cdb6004612219565b61223c565b506000604051634844252360e11b815260040160405180910390fd5b610d04612153565b7f00000000000000000000000000000000000000000000000000000000000000004614610d435760405162461bcd60e51b8152600401610b5290614265565b604051633b0d4dd760e01b8152600c60048201526000602482018190529073__$b1c1335e68417b4234016f4aa58fdfac77$__90633b0d4dd790604401602060405180830381865af4158015610d9d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dc191906142a9565b90506000600b8054610dd2906142c2565b80601f0160208091040260200160405190810160405280929190818152602001828054610dfe906142c2565b8015610e4b5780601f10610e2057610100808354040283529160200191610e4b565b820191906000526020600020905b815481529060010190602001808311610e2e57829003601f168201915b5050505050905082600b9081610e619190614347565b507f67c6aa39e9b4a701119ddc2f40a18145fff9b6f4fa224d5f29c28755f719ffb2818484604051610e9593929190614406565b60405180910390a1505050565b600080610eb186868686611cdc565b9050610ed181610ec16005612219565b610ecb6004612219565b1761223c565b506000818152600460205260409020805460ff60f01b1916600160f01b17905530610ef93090565b6001600160a01b031614610f8b5760005b8651811015610f8957306001600160a01b0316878281518110610f2f57610f2f61443c565b60200260200101516001600160a01b031603610f7957610f79858281518110610f5a57610f5a61443c565b602002602001015180519060200120600561227b90919063ffffffff16565b610f8281614468565b9050610f0a565b505b610f9881878787876122dd565b6040518181527f712ae1383f79ac853f8d882153778e0260ef8f03b504e2866e0593e04d2b291f906020015b60405180910390a195945050505050565b600090815260046020526040902054600160a01b900465ffffffffffff1690565b6000610b0660085465ffffffffffff1690565b6000818152600460205260408120805460ff600160f01b8204811691600160f81b900416811561103e57506007949350505050565b801561104f57506002949350505050565b600061105a86610fd5565b90508060000361108057604051636ad0607560e01b815260048101879052602401610b52565b600061108a611809565b65ffffffffffff1690508082106110a8575060009695505050505050565b60006110b388611c19565b90508181106110ca57506001979650505050505050565b6110d3886123bd565b15806110f357506000888152600960205260409020805460019091015411155b1561110657506003979650505050505050565b60008881526004602052604090206001015465ffffffffffff1660000361113557506004979650505050505050565b506005979650505050505050565b60008061115286868686611cdc565b905061116281610cdb6000612219565b506000818152600460205260409020546001600160a01b0316331461119c5760405163233d98e360e01b8152336004820152602401610b52565b6111a8868686866123f4565b9695505050505050565b60607f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316634bf5d7e96040518163ffffffff1660e01b8152600401600060405180830381865afa92505050801561123357506040513d6000823e601f3d908101601f1916820160405261123091908101906144b1565b60015b61126f575060408051808201909152601d81527f6d6f64653d626c6f636b6e756d6265722666726f6d3d64656661756c74000000602082015290565b919050565b600080339050611295848285604051806020016040528060008152506124a5565b949350505050565b6000806113808761137a7f3e83946653575f9a39005e1545185629e92736b7528ab20ca3816f315424a8118c8c8c6112f28e6001600160a01b0316600090815260026020526040902080546001810190915590565b8d8d6040516113029291906144f9565b60405180910390208c8051906020012060405160200161135f9796959493929190968752602087019590955260ff9390931660408601526001600160a01b03919091166060850152608084015260a083015260c082015260e00190565b604051602081830303815290604052805190602001206124d1565b856124fe565b9050806113ab576040516394ab6c0760e01b81526001600160a01b0388166004820152602401610b52565b6113ef89888a89898080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508b9250612572915050565b9998505050505050505050565b60008033905061144687828888888080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508a9250612572915050565b979650505050505050565b600a80546000918290611465600184614509565b815481106114755761147561443c565b6000918252602090912001805490915065ffffffffffff811690600160301b90046001600160d01b03168582116114b8576001600160d01b031695945050505050565b6114cc6114c487612654565b600a9061268b565b6001600160d01b03169695505050505050565b6114e7612153565b7f000000000000000000000000000000000000000000000000000000000000000046146115265760405162461bcd60e51b8152600401610b5290614265565b604051633b0d4dd760e01b8152600c60048201526001602482015260009073__$b1c1335e68417b4234016f4aa58fdfac77$__90633b0d4dd790604401602060405180830381865af4158015611580573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115a491906142a9565b905060006115b0610ff6565b90506115bb83612740565b60016040805183815265ffffffffffff86166020820152908101849052600080516020614ae283398151915290606001610c1d565b6000803390506111a886828787878080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506124a592505050565b60003361164581846127a6565b61166d5760405163d9b3955760e01b81526001600160a01b0382166004820152602401610b52565b6000611677611c0e565b905080156116e45760006116a683600161168f611809565b611699919061451c565b65ffffffffffff16612044565b9050818110156116e257604051636121770b60e11b81526001600160a01b03841660048201526024810182905260448101839052606401610b52565b505b6114468787878786612897565b600060608060008060006060611705612ab7565b61170d612ae4565b60408051600080825260208201909252600f60f81b9b939a50919850469750309650945092509050565b6000806117c38461137a7ff2aad550cf55f045cb27e9c559f9889fdfb6e6cdaa032301d6ea397784ae51d789898961178c8b6001600160a01b0316600090815260026020526040902080546001810190915590565b60408051602081019690965285019390935260ff90911660608401526001600160a01b0316608083015260a082015260c00161135f565b9050806117ee576040516394ab6c0760e01b81526001600160a01b0385166004820152602401610b52565b6111a8868587604051806020016040528060008152506124a5565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166391ddadf46040518163ffffffff1660e01b8152600401602060405180830381865afa925050508015611885575060408051601f3d908101601f1916820190925261188291810190614542565b60015b61126f57610b06612b11565b600061189e848484612b1c565b90505b9392505050565b60006118b4600a612bb2565b6001600160d01b0316905090565b600080600073__$b1c1335e68417b4234016f4aa58fdfac77$__63c0af65918530600c6040518463ffffffff1660e01b81526004016119039392919061455f565b600060405180830381865af4158015611920573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261194891908101906145ad565b9194509250905060ff8316611a505760008280602001905181019061196d91906144b1565b90506000600b805461197e906142c2565b80601f01602080910402602001604051908101604052809291908181526020018280546119aa906142c2565b80156119f75780601f106119cc576101008083540402835291602001916119f7565b820191906000526020600020905b8154815290600101906020018083116119da57829003601f168201915b5050505050905081600b9081611a0d9190614347565b507f67c6aa39e9b4a701119ddc2f40a18145fff9b6f4fa224d5f29c28755f719ffb2818385604051611a4193929190614406565b60405180910390a15050611c08565b60001960ff841601611ac1576000611a6783614606565b60d01c90506000611a76610ff6565b9050611a8182612740565b60016040805183815265ffffffffffff85166020820152908101859052600080516020614ae2833981519152906060015b60405180910390a25050611c08565b60011960ff841601611b34576000611ad88361463d565b60e01c90506000611af660085463ffffffff600160301b9091041690565b9050611b0182612beb565b60026040805183815263ffffffff85166020820152908101859052600080516020614ae283398151915290606001611ab2565b60021960ff841601611b9b57600082806020019051810190611b5691906142a9565b90506000611b62611c0e565b9050611b6d82612c89565b60036040805183815260208101859052908101859052600080516020614ae283398151915290606001611ab2565b60031960ff841601611c0857600082806020019051810190611bbd91906142a9565b90506000611bc96118a8565b9050611bd48261218b565b60046040805183815260208101859052908101859052600080516020614ae28339815191529060600160405180910390a250505b50505050565b6000610b0660075490565b600081815260046020526040812054611c4e90600160d01b810463ffffffff1690600160a01b900465ffffffffffff16614670565b65ffffffffffff1692915050565b611c64612153565b600080856001600160a01b0316858585604051611c829291906144f9565b60006040518083038185875af1925050503d8060008114611cbf576040519150601f19603f3d011682016040523d82523d6000602084013e611cc4565b606091505b5091509150611cd38282612cca565b50505050505050565b600084848484604051602001611cf5949392919061471a565b60408051601f19818403018152919052805160209091012095945050505050565b60607f00000000000000000000000000000000000000000000000000000000000000004614611d935760405162461bcd60e51b815260206004820152602360248201527f50726f6f6673206f6e6c792067656e657261746564206f6e20686f6d6520636860448201526230b4b760e91b6064820152608401610b52565b604051630564edeb60e31b8152600c600482015260ff8416602482015260009073__$b1c1335e68417b4234016f4aa58fdfac77$__90632b276f5890604401602060405180830381865af4158015611def573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e1391906142a9565b604051637352178160e01b815290915073__$b1c1335e68417b4234016f4aa58fdfac77$__90637352178190611e53903090889088908790600401614765565b600060405180830381865af4158015611e70573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261129591908101906147a3565b600b8054611ea5906142c2565b80601f0160208091040260200160405190810160405280929190818152602001828054611ed1906142c2565b8015611f1e5780601f10611ef357610100808354040283529160200191611f1e565b820191906000526020600020905b815481529060010190602001808311611f0157829003601f168201915b505050505081565b611f2e612153565b7f00000000000000000000000000000000000000000000000000000000000000004614611f6d5760405162461bcd60e51b8152600401610b5290614265565b604051633b0d4dd760e01b8152600c60048201526002602482015260009073__$b1c1335e68417b4234016f4aa58fdfac77$__90633b0d4dd790604401602060405180830381865af4158015611fc7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611feb91906142a9565b9050600061200660085463ffffffff600160301b9091041690565b905061201183612beb565b60026040805183815263ffffffff86166020820152908101849052600080516020614ae283398151915290606001610c1d565b60006118a1838361206060408051602081019091526000815290565b612b1c565b61206d612153565b7f000000000000000000000000000000000000000000000000000000000000000046146120ac5760405162461bcd60e51b8152600401610b5290614265565b604051633b0d4dd760e01b8152600c60048201526003602482015260009073__$b1c1335e68417b4234016f4aa58fdfac77$__90633b0d4dd790604401602060405180830381865af4158015612106573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061212a91906142a9565b90506000612136611c0e565b905061214183612c89565b6003610bf5565b6000610b0082612ce6565b303314612175576040516347096e4760e01b8152336004820152602401610b52565b565b806121826005612d90565b03612177575b50565b6064808211156121b85760405163243e544560e01b81526004810183905260248101829052604401610b52565b60006121c26118a8565b90506121e16121cf611809565b6121d885612dff565b600a9190612e33565b505060408051828152602081018590527f0553476bf02ef2726e8ce5ced78d63e26e602e4a2257b1f559418e24b46339979101610e95565b600081600781111561222d5761222d613bc1565b600160ff919091161b92915050565b60008061224884611009565b905060008361225683612219565b16036118a1578381846040516331b75e4d60e01b8152600401610b52939291906147d7565b81546001600160801b03600160801b8204811691811660018301909116036122a7576122a76041612e4e565b6001600160801b03808216600090815260018086016020526040909120939093558354919092018216600160801b029116179055565b60005b84518110156123b5576000808683815181106122fe576122fe61443c565b60200260200101516001600160a01b03168684815181106123215761232161443c565b602002602001015186858151811061233b5761233b61443c565b602002602001015160405161235091906147f9565b60006040518083038185875af1925050503d806000811461238d576040519150601f19603f3d011682016040523d82523d6000602084013e612392565b606091505b50915091506123a18282612cca565b505050806123ae90614468565b90506122e0565b505050505050565b6000818152600960205260408120600281015460018201546123df9190614815565b6123eb610a7c85610fd5565b11159392505050565b60008061240386868686611cdc565b9050612451816124136007612219565b61241d6006612219565b6124276002612219565b6001612434600782614828565b61243f906002614925565b6124499190614509565b18181861223c565b506000818152600460205260409081902080546001600160f81b0316600160f81b179055517f789cf55be980739dad1d0699b93b58e806b51c9d96619bfa8fe0a28abaa7b30c90610fc49083815260200190565b60006124c8858585856124c360408051602081019091526000815290565b612572565b95945050505050565b6000610b006124de612e60565b8360405161190160f01b8152600281019290925260228201526042902090565b6000836001600160a01b03163b6000036125605760008061251f8585612f8b565b509092509050600081600381111561253957612539613bc1565b1480156125575750856001600160a01b0316826001600160a01b0316145b925050506118a1565b61256b848484612fd8565b90506118a1565b600061258286610cdb6001612219565b5060006125988661259289610fd5565b85612b1c565b905060006125a988888885886130b3565b9050835160000361260057866001600160a01b03167fb8e138887d0aa13bab447e82de9d5c1777041ecd21ca36ba824ff1e6c07ddda4898884896040516125f39493929190614934565b60405180910390a2611446565b866001600160a01b03167fe2babfbac5889a709b63bb7f598b324e08bc5a4fb9ec647fb3cbc9ec07eb8712898884898960405161264195949392919061495c565b60405180910390a2979650505050505050565b600065ffffffffffff821115612687576040516306dfcc6560e41b81526030600482015260248101839052604401610b52565b5090565b8154600090818160058111156126ea5760006126a6846131b6565b6126b09085614509565b60008881526020902090915081015465ffffffffffff90811690871610156126da578091506126e8565b6126e5816001614815565b92505b505b60006126f88787858561330f565b905080156127335761271d8761270f600184614509565b600091825260209091200190565b54600160301b90046001600160d01b0316611446565b6000979650505050505050565b6008546040805165ffffffffffff928316815291831660208301527fc565b045403dc03c2eea82b81a0465edad9e2e7fc4d97e11421c209da93d7a93910160405180910390a16008805465ffffffffffff191665ffffffffffff92909216919091179055565b805160009060348110156127be576001915050610b00565b82810160131901516001600160a01b031981166b046e0e4dee0dee6cae47a60f60a31b146127f157600192505050610b00565b6000806127ff602885614509565b90505b83811015612876576000806128368884815181106128225761282261443c565b01602001516001600160f81b031916613371565b915091508161284e5760019650505050505050610b00565b8060ff166004856001600160a01b0316901b17935050508061286f90614468565b9050612802565b50856001600160a01b0316816001600160a01b031614935050505092915050565b60006128ac8686868680519060200120611cdc565b9050845186511415806128c157508351865114155b806128cb57508551155b1561290057855184518651604051630447b05d60e41b8152600481019390935260248301919091526044820152606401610b52565b600081815260046020526040902054600160a01b900465ffffffffffff161561294b578061292d82611009565b6040516331b75e4d60e01b8152610b529291906000906004016147d7565b6000612955610ff6565b61295d611809565b65ffffffffffff1661296f9190614815565b9050600061298a60085463ffffffff600160301b9091041690565b600084815260046020526040902080546001600160a01b0319166001600160a01b0387161781559091506129bd83612654565b815465ffffffffffff91909116600160a01b0265ffffffffffff60a01b199091161781556129ea82613403565b815463ffffffff91909116600160d01b0263ffffffff60d01b1990911617815588517f7d84a6263ae0d98d3329bd7b46bb4e8d6f98cd35a7adb45c274c8b7fd5ebd5e090859087908c908c906001600160401b03811115612a4d57612a4d61386a565b604051908082528060200260200182016040528015612a8057816020015b6060815260200190600190039081612a6b5790505b508c89612a8d8a82614815565b8e604051612aa3999897969594939291906149a2565b60405180910390a150505095945050505050565b6060610b067f00000000000000000000000000000000000000000000000000000000000000006000613434565b6060610b067f00000000000000000000000000000000000000000000000000000000000000006001613434565b6000610b0643612654565b60007f0000000000000000000000000000000000000000000000000000000000000000604051630748d63560e31b81526001600160a01b038681166004830152602482018690529190911690633a46b1a890604401602060405180830381865afa158015612b8e573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061189e91906142a9565b80546000908015612be257612bcc8361270f600184614509565b54600160301b90046001600160d01b03166118a1565b60009392505050565b8063ffffffff16600003612c155760405163f1cfbf0560e01b815260006004820152602401610b52565b6008546040805163ffffffff600160301b9093048316815291831660208301527f7e3f7f0708a84de9203036abaa450dccc85ad5ff52f78c170f3edb55cf5e8828910160405180910390a16008805463ffffffff909216600160301b0269ffffffff00000000000019909216919091179055565b60075460408051918252602082018390527fccb45da8d5717e6c4544694297c4ba5cf151d455c9bb0ed4fc7a38411bc05461910160405180910390a1600755565b606082612cdf57612cda826134df565b610b00565b5080610b00565b60006064612cf383611451565b604051632394e7a360e21b8152600481018590526001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001690638e539e8c90602401602060405180830381865afa158015612d58573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612d7c91906142a9565b612d869190614a79565b610b009190614aa6565b80546000906001600160801b0380821691600160801b9004168103612db957612db96031612e4e565b6001600160801b038181166000908152600185810160205260408220805492905585546fffffffffffffffffffffffffffffffff19169301909116919091179092555090565b60006001600160d01b03821115612687576040516306dfcc6560e41b815260d0600482015260248101839052604401610b52565b600080612e41858585613508565b915091505b935093915050565b634e487b71600052806020526024601cfd5b6000306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016148015612eb957507f000000000000000000000000000000000000000000000000000000000000000046145b15612ee357507f000000000000000000000000000000000000000000000000000000000000000090565b610b06604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f60208201527f0000000000000000000000000000000000000000000000000000000000000000918101919091527f000000000000000000000000000000000000000000000000000000000000000060608201524660808201523060a082015260009060c00160405160208183030381529060405280519060200120905090565b60008060008351604103612fc55760208401516040850151606086015160001a612fb78882858561365c565b955095509550505050612fd1565b50508151600091506002905b9250925092565b6000806000856001600160a01b03168585604051602401612ffa929190614ac8565b60408051601f198184030181529181526020820180516001600160e01b0316630b135d3f60e11b1790525161302f91906147f9565b600060405180830381855afa9150503d806000811461306a576040519150601f19603f3d011682016040523d82523d6000602084013e61306f565b606091505b509150915081801561308357506020815110155b80156111a857508051630b135d3f60e11b906130a890830160209081019084016142a9565b149695505050505050565b60008581526009602090815260408083206001600160a01b03881684526003810190925282205460ff1615613106576040516371c6af4960e01b81526001600160a01b0387166004820152602401610b52565b6001600160a01b03861660009081526003820160205260409020805460ff1916600117905560ff851661315257838160000160008282546131479190614815565b909155506131ab9050565b60001960ff86160161317257838160010160008282546131479190614815565b60011960ff86160161319257838160020160008282546131479190614815565b6040516303599be160e11b815260040160405180910390fd5b509195945050505050565b6000600182116131c4575090565b816001600160801b82106131dd5760809190911c9060401b5b6801000000000000000082106131f85760409190911c9060201b5b640100000000821061320f5760209190911c9060101b5b6201000082106132245760109190911c9060081b5b61010082106132385760089190911c9060041b5b6010821061324b5760049190911c9060021b5b600482106132575760011b5b600302600190811c9081858161326f5761326f614a90565b048201901c9050600181858161328757613287614a90565b048201901c9050600181858161329f5761329f614a90565b048201901c905060018185816132b7576132b7614a90565b048201901c905060018185816132cf576132cf614a90565b048201901c905060018185816132e7576132e7614a90565b048201901c905061330681858161330057613300614a90565b04821190565b90039392505050565b60005b81831015613369576000613326848461372b565b60008781526020902090915065ffffffffffff86169082015465ffffffffffff16111561335557809250613363565b613360816001614815565b93505b50613312565b509392505050565b60008060f883901c602f8111801561338c5750603a8160ff16105b156133a157600194602f199091019350915050565b8060ff1660401080156133b7575060478160ff16105b156133cc576001946036199091019350915050565b8060ff1660601080156133e2575060678160ff16105b156133f7576001946056199091019350915050565b50600093849350915050565b600063ffffffff821115612687576040516306dfcc6560e41b81526020600482015260248101839052604401610b52565b606060ff831461344e5761344783613746565b9050610b00565b81805461345a906142c2565b80601f0160208091040260200160405190810160405280929190818152602001828054613486906142c2565b80156134d35780601f106134a8576101008083540402835291602001916134d3565b820191906000526020600020905b8154815290600101906020018083116134b657829003601f168201915b50505050509050610b00565b8051156134ef5780518082602001fd5b60405163d6bda27560e01b815260040160405180910390fd5b8254600090819080156136015760006135268761270f600185614509565b805490915065ffffffffffff80821691600160301b90046001600160d01b031690881682111561356957604051632520601d60e01b815260040160405180910390fd5b8765ffffffffffff168265ffffffffffff16036135a257825465ffffffffffff16600160301b6001600160d01b038916021783556135f3565b6040805180820190915265ffffffffffff808a1682526001600160d01b03808a1660208085019182528d54600181018f5560008f81529190912094519151909216600160301b029216919091179101555b9450859350612e4692505050565b50506040805180820190915265ffffffffffff80851682526001600160d01b0380851660208085019182528854600181018a5560008a815291822095519251909316600160301b029190931617920191909155905081612e46565b600080807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08411156136975750600091506003905082613721565b604080516000808252602082018084528a905260ff891692820192909252606081018790526080810186905260019060a0016020604051602081039080840390855afa1580156136eb573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b03811661371757506000925060019150829050613721565b9250600091508190505b9450945094915050565b600061373a6002848418614aa6565b6118a190848416614815565b6060600061375383613785565b604080516020808252818301909252919250600091906020820181803683375050509182525060208101929092525090565b600060ff8216601f811115610b0057604051632cd44ac360e21b815260040160405180910390fd5b6000602082840312156137bf57600080fd5b81356001600160e01b0319811681146118a157600080fd5b6000602082840312156137e957600080fd5b5035919050565b60005b8381101561380b5781810151838201526020016137f3565b50506000910152565b6000815180845261382c8160208601602086016137f0565b601f01601f19169290920160200192915050565b6020815260006118a16020830184613814565b80356001600160a01b038116811461126f57600080fd5b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b03811182821017156138a8576138a861386a565b604052919050565b60006001600160401b038211156138c9576138c961386a565b50601f01601f191660200190565b600082601f8301126138e857600080fd5b81356138fb6138f6826138b0565b613880565b81815284602083860101111561391057600080fd5b816020850160208301376000918101602001919091529392505050565b6000806000806080858703121561394357600080fd5b61394c85613853565b935061395a60208601613853565b92506040850135915060608501356001600160401b0381111561397c57600080fd5b613988878288016138d7565b91505092959194509250565b60006001600160401b038211156139ad576139ad61386a565b5060051b60200190565b600082601f8301126139c857600080fd5b813560206139d86138f683613994565b82815260059290921b840181019181810190868411156139f757600080fd5b8286015b84811015613a1957613a0c81613853565b83529183019183016139fb565b509695505050505050565b600082601f830112613a3557600080fd5b81356020613a456138f683613994565b82815260059290921b84018101918181019086841115613a6457600080fd5b8286015b84811015613a195780358352918301918301613a68565b600082601f830112613a9057600080fd5b81356020613aa06138f683613994565b82815260059290921b84018101918181019086841115613abf57600080fd5b8286015b84811015613a195780356001600160401b03811115613ae25760008081fd5b613af08986838b01016138d7565b845250918301918301613ac3565b60008060008060808587031215613b1457600080fd5b84356001600160401b0380821115613b2b57600080fd5b613b37888389016139b7565b95506020870135915080821115613b4d57600080fd5b613b5988838901613a24565b94506040870135915080821115613b6f57600080fd5b50613b7c87828801613a7f565b949793965093946060013593505050565b600060208284031215613b9f57600080fd5b81356001600160401b03811115613bb557600080fd5b611295848285016138d7565b634e487b7160e01b600052602160045260246000fd5b60088110613bf557634e487b7160e01b600052602160045260246000fd5b9052565b60208101610b008284613bd7565b60008060408385031215613c1a57600080fd5b82359150613c2a60208401613853565b90509250929050565b60ff8116811461218857600080fd5b60008060408385031215613c5557600080fd5b823591506020830135613c6781613c33565b809150509250929050565b60008083601f840112613c8457600080fd5b5081356001600160401b03811115613c9b57600080fd5b602083019150836020828501011115613cb357600080fd5b9250929050565b600080600080600080600060c0888a031215613cd557600080fd5b873596506020880135613ce781613c33565b9550613cf560408901613853565b945060608801356001600160401b0380821115613d1157600080fd5b613d1d8b838c01613c72565b909650945060808a0135915080821115613d3657600080fd5b613d428b838c016138d7565b935060a08a0135915080821115613d5857600080fd5b50613d658a828b016138d7565b91505092959891949750929550565b600080600080600060808688031215613d8c57600080fd5b853594506020860135613d9e81613c33565b935060408601356001600160401b0380821115613dba57600080fd5b613dc689838a01613c72565b90955093506060880135915080821115613ddf57600080fd5b50613dec888289016138d7565b9150509295509295909350565b65ffffffffffff8116811461218857600080fd5b600060208284031215613e1f57600080fd5b81356118a181613df9565b60008060008060608587031215613e4057600080fd5b843593506020850135613e5281613c33565b925060408501356001600160401b03811115613e6d57600080fd5b613e7987828801613c72565b95989497509550505050565b60008060008060808587031215613e9b57600080fd5b84356001600160401b0380821115613eb257600080fd5b613ebe888389016139b7565b95506020870135915080821115613ed457600080fd5b613ee088838901613a24565b94506040870135915080821115613ef657600080fd5b613f0288838901613a7f565b93506060870135915080821115613f1857600080fd5b50613988878288016138d7565b600060208284031215613f3757600080fd5b6118a182613853565b600081518084526020808501945080840160005b83811015613f7057815187529582019590820190600101613f54565b509495945050505050565b60ff60f81b8816815260e060208201526000613f9a60e0830189613814565b8281036040840152613fac8189613814565b606084018890526001600160a01b038716608085015260a0840186905283810360c08501529050613fdd8185613f40565b9a9950505050505050505050565b6000806000806080858703121561400157600080fd5b84359350602085013561401381613c33565b925061402160408601613853565b915060608501356001600160401b0381111561397c57600080fd5b60008060006060848603121561405157600080fd5b61405a84613853565b92506020840135915060408401356001600160401b0381111561407c57600080fd5b614088868287016138d7565b9150509250925092565b600080600080600060a086880312156140aa57600080fd5b6140b386613853565b94506140c160208701613853565b935060408601356001600160401b03808211156140dd57600080fd5b6140e989838a01613a24565b945060608801359150808211156140ff57600080fd5b61410b89838a01613a24565b93506080880135915080821115613ddf57600080fd5b6000806000806060858703121561413757600080fd5b61414085613853565b93506020850135925060408501356001600160401b03811115613e6d57600080fd5b6000806040838503121561417557600080fd5b823561418081613c33565b915060208301356001600160401b0381111561419b57600080fd5b6141a7858286016138d7565b9150509250929050565b6000602082840312156141c357600080fd5b813563ffffffff811681146118a157600080fd5b600080604083850312156141ea57600080fd5b6141f383613853565b946020939093013593505050565b600080600080600060a0868803121561421957600080fd5b61422286613853565b945061423060208701613853565b9350604086013592506060860135915060808601356001600160401b0381111561425957600080fd5b613dec888289016138d7565b60208082526024908201527f4f7065726174696f6e206f6e6c7920616c6c6f776564206f6e20686f6d6520636040820152633430b4b760e11b606082015260800190565b6000602082840312156142bb57600080fd5b5051919050565b600181811c908216806142d657607f821691505b6020821081036142f657634e487b7160e01b600052602260045260246000fd5b50919050565b601f82111561434257600081815260208120601f850160051c810160208610156143235750805b601f850160051c820191505b818110156123b55782815560010161432f565b505050565b81516001600160401b038111156143605761436061386a565b6143748161436e84546142c2565b846142fc565b602080601f8311600181146143a957600084156143915750858301515b600019600386901b1c1916600185901b1785556123b5565b600085815260208120601f198616915b828110156143d8578886015182559484019460019091019084016143b9565b50858210156143f65787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6060815260006144196060830186613814565b828103602084015261442b8186613814565b915050826040830152949350505050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60006001820161447a5761447a614452565b5060010190565b600061448f6138f6846138b0565b90508281528383830111156144a357600080fd5b6118a18360208301846137f0565b6000602082840312156144c357600080fd5b81516001600160401b038111156144d957600080fd5b8201601f810184136144ea57600080fd5b61129584825160208401614481565b8183823760009101908152919050565b81810381811115610b0057610b00614452565b65ffffffffffff82811682821603908082111561453b5761453b614452565b5092915050565b60006020828403121561455457600080fd5b81516118a181613df9565b6060815260006145726060830186613814565b6001600160a01b039490941660208301525060400152919050565b600082601f83011261459e57600080fd5b6118a183835160208501614481565b6000806000606084860312156145c257600080fd5b83516145cd81613c33565b60208501519093506001600160401b038111156145e957600080fd5b6145f58682870161458d565b925050604084015190509250925092565b805160208201516001600160d01b031980821692919060068310156146355780818460060360031b1b83161693505b505050919050565b805160208201516001600160e01b031980821692919060048310156146355760049290920360031b82901b161692915050565b65ffffffffffff81811683821601908082111561453b5761453b614452565b600081518084526020808501945080840160005b83811015613f705781516001600160a01b0316875295820195908201906001016146a3565b6000815180845260208085019450848260051b860182860160005b8581101561470d5783830389526146fb838351613814565b988501989250908401906001016146e3565b5090979650505050505050565b60808152600061472d608083018761468f565b828103602084015261473f8187613f40565b9050828103604084015261475381866146c8565b91505082606083015295945050505050565b6001600160a01b038516815260ff8416602082015260806040820181905260009061479290830185613814565b905082606083015295945050505050565b6000602082840312156147b557600080fd5b81516001600160401b038111156147cb57600080fd5b6112958482850161458d565b838152606081016147eb6020830185613bd7565b826040830152949350505050565b6000825161480b8184602087016137f0565b9190910192915050565b80820180821115610b0057610b00614452565b60ff8181168382160190811115610b0057610b00614452565b600181815b8085111561487c57816000190482111561486257614862614452565b8085161561486f57918102915b93841c9390800290614846565b509250929050565b60008261489357506001610b00565b816148a057506000610b00565b81600181146148b657600281146148c0576148dc565b6001915050610b00565b60ff8411156148d1576148d1614452565b50506001821b610b00565b5060208310610133831016604e8410600b84101617156148ff575081810a610b00565b6149098383614841565b806000190482111561491d5761491d614452565b029392505050565b60006118a160ff841683614884565b84815260ff841660208201528260408201526080606082015260006111a86080830184613814565b85815260ff8516602082015283604082015260a06060820152600061498460a0830185613814565b82810360808401526149968185613814565b98975050505050505050565b60006101208b8352602060018060a01b038c16818501528160408501526149cb8285018c61468f565b915083820360608501526149df828b613f40565b915083820360808501528189518084528284019150828160051b850101838c0160005b83811015614a3057601f19878403018552614a1e838351613814565b94860194925090850190600101614a02565b505086810360a0880152614a44818c6146c8565b9450505050508560c08401528460e0840152828103610100840152614a698185613814565b9c9b505050505050505050505050565b8082028115828204841417610b0057610b00614452565b634e487b7160e01b600052601260045260246000fd5b600082614ac357634e487b7160e01b600052601260045260246000fd5b500490565b82815260406020820152600061189e604083018461381456fe80c51ad8a7db1a7a86cc355b77bd5cd7ea08f6071ea91d85a8f792734700a0eca2646970667358221220a295bf4977b633b13f69388b67ec678a5025198475985e252038973de715a24d64736f6c63430008140033", + "solcInputHash": "77ec5f062950e8c4875fd27ffb65d267", + "metadata": "{\"compiler\":{\"version\":\"0.8.20+commit.a1b79de6\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_home\",\"type\":\"uint256\"},{\"internalType\":\"contract IVotes\",\"name\":\"_token\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"_manifestoCid\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"_name\",\"type\":\"string\"},{\"internalType\":\"uint48\",\"name\":\"_votingDelay\",\"type\":\"uint48\"},{\"internalType\":\"uint32\",\"name\":\"_votingPeriod\",\"type\":\"uint32\"},{\"internalType\":\"uint256\",\"name\":\"_proposalThreshold\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_quorum\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"CheckpointUnorderedInsertion\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"FailedCall\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"voter\",\"type\":\"address\"}],\"name\":\"GovernorAlreadyCastVote\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"proposalId\",\"type\":\"uint256\"}],\"name\":\"GovernorAlreadyQueuedProposal\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"GovernorDisabledDeposit\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"proposer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"votes\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"threshold\",\"type\":\"uint256\"}],\"name\":\"GovernorInsufficientProposerVotes\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"targets\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"calldatas\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"values\",\"type\":\"uint256\"}],\"name\":\"GovernorInvalidProposalLength\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"quorumNumerator\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"quorumDenominator\",\"type\":\"uint256\"}],\"name\":\"GovernorInvalidQuorumFraction\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"voter\",\"type\":\"address\"}],\"name\":\"GovernorInvalidSignature\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"GovernorInvalidVoteParams\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"GovernorInvalidVoteType\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"votingPeriod\",\"type\":\"uint256\"}],\"name\":\"GovernorInvalidVotingPeriod\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"proposalId\",\"type\":\"uint256\"}],\"name\":\"GovernorNonexistentProposal\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"proposalId\",\"type\":\"uint256\"}],\"name\":\"GovernorNotQueuedProposal\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"GovernorOnlyExecutor\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"GovernorOnlyProposer\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"GovernorQueueNotImplemented\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"proposer\",\"type\":\"address\"}],\"name\":\"GovernorRestrictedProposer\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"proposalId\",\"type\":\"uint256\"},{\"internalType\":\"enum IGovernor.ProposalState\",\"name\":\"current\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"expectedStates\",\"type\":\"bytes32\"}],\"name\":\"GovernorUnexpectedProposalState\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"currentNonce\",\"type\":\"uint256\"}],\"name\":\"InvalidAccountNonce\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidShortString\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint8\",\"name\":\"bits\",\"type\":\"uint8\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"SafeCastOverflowedUintDowncast\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"str\",\"type\":\"string\"}],\"name\":\"StringTooLong\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[],\"name\":\"EIP712DomainChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"enum Gov.OperationType\",\"name\":\"operationType\",\"type\":\"uint8\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"oldValue\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newValue\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"}],\"name\":\"GovernanceParameterUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"string\",\"name\":\"oldManifesto\",\"type\":\"string\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"newManifesto\",\"type\":\"string\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"}],\"name\":\"ManifestoUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"proposalId\",\"type\":\"uint256\"}],\"name\":\"ProposalCanceled\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"proposalId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"proposer\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address[]\",\"name\":\"targets\",\"type\":\"address[]\"},{\"indexed\":false,\"internalType\":\"uint256[]\",\"name\":\"values\",\"type\":\"uint256[]\"},{\"indexed\":false,\"internalType\":\"string[]\",\"name\":\"signatures\",\"type\":\"string[]\"},{\"indexed\":false,\"internalType\":\"bytes[]\",\"name\":\"calldatas\",\"type\":\"bytes[]\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"voteStart\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"voteEnd\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"description\",\"type\":\"string\"}],\"name\":\"ProposalCreated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"proposalId\",\"type\":\"uint256\"}],\"name\":\"ProposalExecuted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"proposalId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"etaSeconds\",\"type\":\"uint256\"}],\"name\":\"ProposalQueued\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"oldProposalThreshold\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newProposalThreshold\",\"type\":\"uint256\"}],\"name\":\"ProposalThresholdSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"oldQuorumNumerator\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newQuorumNumerator\",\"type\":\"uint256\"}],\"name\":\"QuorumNumeratorUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"voter\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"proposalId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"support\",\"type\":\"uint8\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"weight\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"reason\",\"type\":\"string\"}],\"name\":\"VoteCast\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"voter\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"proposalId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"support\",\"type\":\"uint8\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"weight\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"reason\",\"type\":\"string\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"params\",\"type\":\"bytes\"}],\"name\":\"VoteCastWithParams\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"oldVotingDelay\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newVotingDelay\",\"type\":\"uint256\"}],\"name\":\"VotingDelaySet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"oldVotingPeriod\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newVotingPeriod\",\"type\":\"uint256\"}],\"name\":\"VotingPeriodSet\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"BALLOT_TYPEHASH\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"CLOCK_MODE\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"COUNTING_MODE\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"EXTENDED_BALLOT_TYPEHASH\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"targets\",\"type\":\"address[]\"},{\"internalType\":\"uint256[]\",\"name\":\"values\",\"type\":\"uint256[]\"},{\"internalType\":\"bytes[]\",\"name\":\"calldatas\",\"type\":\"bytes[]\"},{\"internalType\":\"bytes32\",\"name\":\"descriptionHash\",\"type\":\"bytes32\"}],\"name\":\"cancel\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"proposalId\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"support\",\"type\":\"uint8\"}],\"name\":\"castVote\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"proposalId\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"support\",\"type\":\"uint8\"},{\"internalType\":\"address\",\"name\":\"voter\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"signature\",\"type\":\"bytes\"}],\"name\":\"castVoteBySig\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"proposalId\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"support\",\"type\":\"uint8\"},{\"internalType\":\"string\",\"name\":\"reason\",\"type\":\"string\"}],\"name\":\"castVoteWithReason\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"proposalId\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"support\",\"type\":\"uint8\"},{\"internalType\":\"string\",\"name\":\"reason\",\"type\":\"string\"},{\"internalType\":\"bytes\",\"name\":\"params\",\"type\":\"bytes\"}],\"name\":\"castVoteWithReasonAndParams\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"proposalId\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"support\",\"type\":\"uint8\"},{\"internalType\":\"address\",\"name\":\"voter\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"reason\",\"type\":\"string\"},{\"internalType\":\"bytes\",\"name\":\"params\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"signature\",\"type\":\"bytes\"}],\"name\":\"castVoteWithReasonAndParamsBySig\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"proof\",\"type\":\"bytes\"}],\"name\":\"claimParameterUpdate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"clock\",\"outputs\":[{\"internalType\":\"uint48\",\"name\":\"\",\"type\":\"uint48\"}],\"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\":[{\"internalType\":\"address[]\",\"name\":\"targets\",\"type\":\"address[]\"},{\"internalType\":\"uint256[]\",\"name\":\"values\",\"type\":\"uint256[]\"},{\"internalType\":\"bytes[]\",\"name\":\"calldatas\",\"type\":\"bytes[]\"},{\"internalType\":\"bytes32\",\"name\":\"descriptionHash\",\"type\":\"bytes32\"}],\"name\":\"execute\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint8\",\"name\":\"operationType\",\"type\":\"uint8\"},{\"internalType\":\"bytes\",\"name\":\"value\",\"type\":\"bytes\"}],\"name\":\"generateParameterProof\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"proof\",\"type\":\"bytes\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"timepoint\",\"type\":\"uint256\"}],\"name\":\"getVotes\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"timepoint\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"params\",\"type\":\"bytes\"}],\"name\":\"getVotesWithParams\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"proposalId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"hasVoted\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"targets\",\"type\":\"address[]\"},{\"internalType\":\"uint256[]\",\"name\":\"values\",\"type\":\"uint256[]\"},{\"internalType\":\"bytes[]\",\"name\":\"calldatas\",\"type\":\"bytes[]\"},{\"internalType\":\"bytes32\",\"name\":\"descriptionHash\",\"type\":\"bytes32\"}],\"name\":\"hashProposal\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"home\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"manifesto\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"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\":\"\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"uint256[]\",\"name\":\"\",\"type\":\"uint256[]\"},{\"internalType\":\"uint256[]\",\"name\":\"\",\"type\":\"uint256[]\"},{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"name\":\"onERC1155BatchReceived\",\"outputs\":[{\"internalType\":\"bytes4\",\"name\":\"\",\"type\":\"bytes4\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"name\":\"onERC1155Received\",\"outputs\":[{\"internalType\":\"bytes4\",\"name\":\"\",\"type\":\"bytes4\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"name\":\"onERC721Received\",\"outputs\":[{\"internalType\":\"bytes4\",\"name\":\"\",\"type\":\"bytes4\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"proposalId\",\"type\":\"uint256\"}],\"name\":\"proposalDeadline\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"proposalId\",\"type\":\"uint256\"}],\"name\":\"proposalEta\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"proposalNeedsQueuing\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"proposalId\",\"type\":\"uint256\"}],\"name\":\"proposalProposer\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"proposalId\",\"type\":\"uint256\"}],\"name\":\"proposalSnapshot\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"proposalThreshold\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"proposalId\",\"type\":\"uint256\"}],\"name\":\"proposalVotes\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"againstVotes\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"forVotes\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"abstainVotes\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"targets\",\"type\":\"address[]\"},{\"internalType\":\"uint256[]\",\"name\":\"values\",\"type\":\"uint256[]\"},{\"internalType\":\"bytes[]\",\"name\":\"calldatas\",\"type\":\"bytes[]\"},{\"internalType\":\"string\",\"name\":\"description\",\"type\":\"string\"}],\"name\":\"propose\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"targets\",\"type\":\"address[]\"},{\"internalType\":\"uint256[]\",\"name\":\"values\",\"type\":\"uint256[]\"},{\"internalType\":\"bytes[]\",\"name\":\"calldatas\",\"type\":\"bytes[]\"},{\"internalType\":\"bytes32\",\"name\":\"descriptionHash\",\"type\":\"bytes32\"}],\"name\":\"queue\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"blockNumber\",\"type\":\"uint256\"}],\"name\":\"quorum\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"quorumDenominator\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"timepoint\",\"type\":\"uint256\"}],\"name\":\"quorumNumerator\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"quorumNumerator\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"target\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"relay\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"newManifesto\",\"type\":\"string\"}],\"name\":\"setManifesto\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"newProposalThreshold\",\"type\":\"uint256\"}],\"name\":\"setProposalThreshold\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint48\",\"name\":\"newVotingDelay\",\"type\":\"uint48\"}],\"name\":\"setVotingDelay\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"newVotingPeriod\",\"type\":\"uint32\"}],\"name\":\"setVotingPeriod\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"proposalId\",\"type\":\"uint256\"}],\"name\":\"state\",\"outputs\":[{\"internalType\":\"enum IGovernor.ProposalState\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"interfaceId\",\"type\":\"bytes4\"}],\"name\":\"supportsInterface\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"token\",\"outputs\":[{\"internalType\":\"contract IERC5805\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"newQuorumNumerator\",\"type\":\"uint256\"}],\"name\":\"updateQuorumNumerator\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"version\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"votingDelay\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"votingPeriod\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"author\":\"Web3 Hackers Collective\",\"custom:security-contact\":\"julien@strat.cc\",\"details\":\"Extends OpenZeppelin's Governor contract with cross-chain parameter updates\",\"errors\":{\"CheckpointUnorderedInsertion()\":[{\"details\":\"A value was attempted to be inserted on a past checkpoint.\"}],\"FailedCall()\":[{\"details\":\"A call to an address target failed. The target may have reverted.\"}],\"GovernorAlreadyCastVote(address)\":[{\"details\":\"The vote was already cast.\"}],\"GovernorAlreadyQueuedProposal(uint256)\":[{\"details\":\"The proposal has already been queued.\"}],\"GovernorDisabledDeposit()\":[{\"details\":\"Token deposits are disabled in this contract.\"}],\"GovernorInsufficientProposerVotes(address,uint256,uint256)\":[{\"details\":\"The `proposer` does not have the required votes to create a proposal.\"}],\"GovernorInvalidProposalLength(uint256,uint256,uint256)\":[{\"details\":\"Empty proposal or a mismatch between the parameters length for a proposal call.\"}],\"GovernorInvalidQuorumFraction(uint256,uint256)\":[{\"details\":\"The quorum set is not a valid fraction.\"}],\"GovernorInvalidSignature(address)\":[{\"details\":\"The provided signature is not valid for the expected `voter`. If the `voter` is a contract, the signature is not valid using {IERC1271-isValidSignature}.\"}],\"GovernorInvalidVoteParams()\":[{\"details\":\"The provided params buffer is not supported by the counting module.\"}],\"GovernorInvalidVoteType()\":[{\"details\":\"The vote type used is not valid for the corresponding counting module.\"}],\"GovernorInvalidVotingPeriod(uint256)\":[{\"details\":\"The voting period set is not a valid period.\"}],\"GovernorNonexistentProposal(uint256)\":[{\"details\":\"The `proposalId` doesn't exist.\"}],\"GovernorNotQueuedProposal(uint256)\":[{\"details\":\"The proposal hasn't been queued yet.\"}],\"GovernorOnlyExecutor(address)\":[{\"details\":\"The `account` is not the governance executor.\"}],\"GovernorOnlyProposer(address)\":[{\"details\":\"The `account` is not a proposer.\"}],\"GovernorQueueNotImplemented()\":[{\"details\":\"Queue operation is not implemented for this governor. Execute should be called directly.\"}],\"GovernorRestrictedProposer(address)\":[{\"details\":\"The `proposer` is not allowed to create a proposal.\"}],\"GovernorUnexpectedProposalState(uint256,uint8,bytes32)\":[{\"details\":\"The current state of a proposal is not the required for performing an operation. The `expectedStates` is a bitmap with the bits enabled for each ProposalState enum position counting from right to left. NOTE: If `expectedState` is `bytes32(0)`, the proposal is expected to not be in any state (i.e. not exist). This is the case when a proposal that is expected to be unset is already initiated (the proposal is duplicated). See {Governor-_encodeStateBitmap}.\"}],\"InvalidAccountNonce(address,uint256)\":[{\"details\":\"The nonce used for an `account` is not the expected current nonce.\"}],\"SafeCastOverflowedUintDowncast(uint8,uint256)\":[{\"details\":\"Value doesn't fit in an uint of `bits` size.\"}]},\"events\":{\"EIP712DomainChanged()\":{\"details\":\"MAY be emitted to signal that the domain could have changed.\"},\"GovernanceParameterUpdated(uint8,uint256,uint256,uint256)\":{\"params\":{\"newValue\":\"New value\",\"nonce\":\"Update sequence number\",\"oldValue\":\"Previous value\",\"operationType\":\"Type of parameter updated\"}},\"ManifestoUpdated(string,string,uint256)\":{\"params\":{\"newManifesto\":\"New manifesto CID\",\"nonce\":\"Update sequence number\",\"oldManifesto\":\"Previous manifesto CID\"}},\"ProposalCanceled(uint256)\":{\"details\":\"Emitted when a proposal is canceled.\"},\"ProposalCreated(uint256,address,address[],uint256[],string[],bytes[],uint256,uint256,string)\":{\"details\":\"Emitted when a proposal is created.\"},\"ProposalExecuted(uint256)\":{\"details\":\"Emitted when a proposal is executed.\"},\"ProposalQueued(uint256,uint256)\":{\"details\":\"Emitted when a proposal is queued.\"},\"VoteCast(address,uint256,uint8,uint256,string)\":{\"details\":\"Emitted when a vote is cast without params. Note: `support` values should be seen as buckets. Their interpretation depends on the voting module used.\"},\"VoteCastWithParams(address,uint256,uint8,uint256,string,bytes)\":{\"details\":\"Emitted when a vote is cast with params. Note: `support` values should be seen as buckets. Their interpretation depends on the voting module used. `params` are additional encoded parameters. Their interpretation also depends on the voting module used.\"}},\"kind\":\"dev\",\"methods\":{\"CLOCK_MODE()\":{\"details\":\"Machine-readable description of the clock as specified in ERC-6372.\"},\"COUNTING_MODE()\":{\"details\":\"See {IGovernor-COUNTING_MODE}.\"},\"cancel(address[],uint256[],bytes[],bytes32)\":{\"details\":\"See {IGovernor-cancel}.\"},\"castVote(uint256,uint8)\":{\"details\":\"See {IGovernor-castVote}.\"},\"castVoteBySig(uint256,uint8,address,bytes)\":{\"details\":\"See {IGovernor-castVoteBySig}.\"},\"castVoteWithReason(uint256,uint8,string)\":{\"details\":\"See {IGovernor-castVoteWithReason}.\"},\"castVoteWithReasonAndParams(uint256,uint8,string,bytes)\":{\"details\":\"See {IGovernor-castVoteWithReasonAndParams}.\"},\"castVoteWithReasonAndParamsBySig(uint256,uint8,address,string,bytes,bytes)\":{\"details\":\"See {IGovernor-castVoteWithReasonAndParamsBySig}.\"},\"claimParameterUpdate(bytes)\":{\"params\":{\"proof\":\"Proof generated by home chain\"}},\"clock()\":{\"details\":\"Clock (as specified in ERC-6372) is set to match the token's clock. Fallback to block numbers if the token does not implement ERC-6372.\"},\"constructor\":{\"details\":\"Sets up initial governance parameters and manifesto\",\"params\":{\"_home\":\"Chain ID where this contract is considered home\",\"_manifestoCid\":\"Initial manifesto CID\",\"_name\":\"Name of the governance contract\",\"_proposalThreshold\":\"Minimum votes needed to create a proposal\",\"_quorum\":\"Minimum participation percentage required\",\"_token\":\"The voting token contract address\",\"_votingDelay\":\"Time before voting begins\",\"_votingPeriod\":\"Duration of voting period\"}},\"eip712Domain()\":{\"details\":\"See {IERC-5267}.\"},\"execute(address[],uint256[],bytes[],bytes32)\":{\"details\":\"See {IGovernor-execute}.\"},\"generateParameterProof(uint8,bytes)\":{\"params\":{\"operationType\":\"Type of parameter being updated\",\"value\":\"Encoded parameter value\"},\"returns\":{\"proof\":\"Encoded proof data\"}},\"getVotes(address,uint256)\":{\"details\":\"See {IGovernor-getVotes}.\"},\"getVotesWithParams(address,uint256,bytes)\":{\"details\":\"See {IGovernor-getVotesWithParams}.\"},\"hasVoted(uint256,address)\":{\"details\":\"See {IGovernor-hasVoted}.\"},\"hashProposal(address[],uint256[],bytes[],bytes32)\":{\"details\":\"See {IGovernor-hashProposal}. The proposal id is produced by hashing the ABI encoded `targets` array, the `values` array, the `calldatas` array and the descriptionHash (bytes32 which itself is the keccak256 hash of the description string). This proposal id can be produced from the proposal data which is part of the {ProposalCreated} event. It can even be computed in advance, before the proposal is submitted. Note that the chainId and the governor address are not part of the proposal id computation. Consequently, the same proposal (with same operation and same description) will have the same id if submitted on multiple governors across multiple networks. This also means that in order to execute the same operation twice (on the same governor) the proposer will have to change the description in order to avoid proposal id conflicts.\"},\"name()\":{\"details\":\"See {IGovernor-name}.\"},\"nonces(address)\":{\"details\":\"Returns the next unused nonce for an address.\"},\"onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)\":{\"details\":\"See {IERC1155Receiver-onERC1155BatchReceived}. Receiving tokens is disabled if the governance executor is other than the governor itself (eg. when using with a timelock).\"},\"onERC1155Received(address,address,uint256,uint256,bytes)\":{\"details\":\"See {IERC1155Receiver-onERC1155Received}. Receiving tokens is disabled if the governance executor is other than the governor itself (eg. when using with a timelock).\"},\"onERC721Received(address,address,uint256,bytes)\":{\"details\":\"See {IERC721Receiver-onERC721Received}. Receiving tokens is disabled if the governance executor is other than the governor itself (eg. when using with a timelock).\"},\"proposalDeadline(uint256)\":{\"details\":\"See {IGovernor-proposalDeadline}.\"},\"proposalEta(uint256)\":{\"details\":\"See {IGovernor-proposalEta}.\"},\"proposalNeedsQueuing(uint256)\":{\"details\":\"See {IGovernor-proposalNeedsQueuing}.\"},\"proposalProposer(uint256)\":{\"details\":\"See {IGovernor-proposalProposer}.\"},\"proposalSnapshot(uint256)\":{\"details\":\"See {IGovernor-proposalSnapshot}.\"},\"proposalVotes(uint256)\":{\"details\":\"Accessor to the internal vote counts.\"},\"propose(address[],uint256[],bytes[],string)\":{\"details\":\"See {IGovernor-propose}. This function has opt-in frontrunning protection, described in {_isValidDescriptionForProposer}.\"},\"queue(address[],uint256[],bytes[],bytes32)\":{\"details\":\"See {IGovernor-queue}.\"},\"quorumDenominator()\":{\"details\":\"Returns the quorum denominator. Defaults to 100, but may be overridden.\"},\"quorumNumerator()\":{\"details\":\"Returns the current quorum numerator. See {quorumDenominator}.\"},\"quorumNumerator(uint256)\":{\"details\":\"Returns the quorum numerator at a specific timepoint. See {quorumDenominator}.\"},\"relay(address,uint256,bytes)\":{\"details\":\"Relays a transaction or function call to an arbitrary target. In cases where the governance executor is some contract other than the governor itself, like when using a timelock, this function can be invoked in a governance proposal to recover tokens or Ether that was sent to the governor contract by mistake. Note that if the executor is simply the governor itself, use of `relay` is redundant.\"},\"setManifesto(string)\":{\"params\":{\"newManifesto\":\"New manifesto CID\"}},\"setProposalThreshold(uint256)\":{\"params\":{\"newProposalThreshold\":\"New proposal threshold value\"}},\"setVotingDelay(uint48)\":{\"params\":{\"newVotingDelay\":\"New voting delay value\"}},\"setVotingPeriod(uint32)\":{\"params\":{\"newVotingPeriod\":\"New voting period value\"}},\"state(uint256)\":{\"details\":\"See {IGovernor-state}.\"},\"supportsInterface(bytes4)\":{\"details\":\"See {IERC165-supportsInterface}.\"},\"token()\":{\"details\":\"The token that voting power is sourced from.\"},\"updateQuorumNumerator(uint256)\":{\"params\":{\"newQuorumNumerator\":\"New quorum numerator value\"}},\"version()\":{\"details\":\"See {IGovernor-version}.\"}},\"title\":\"Cross-chain Governance Contract\",\"version\":1},\"userdoc\":{\"events\":{\"GovernanceParameterUpdated(uint8,uint256,uint256,uint256)\":{\"notice\":\"Emitted when a governance parameter is updated\"},\"ManifestoUpdated(string,string,uint256)\":{\"notice\":\"Emitted when the manifesto is updated\"}},\"kind\":\"user\",\"methods\":{\"claimParameterUpdate(bytes)\":{\"notice\":\"Claims a parameter update on a foreign chain\"},\"constructor\":{\"notice\":\"Initializes the governance contract\"},\"generateParameterProof(uint8,bytes)\":{\"notice\":\"Generates proof for parameter updates\"},\"home()\":{\"notice\":\"Chain ID where this contract was originally deployed\"},\"manifesto()\":{\"notice\":\"IPFS CID of the DAO's manifesto\"},\"setManifesto(string)\":{\"notice\":\"Updates the DAO's manifesto on the home chain\"},\"setProposalThreshold(uint256)\":{\"notice\":\"Updates the proposal threshold parameter on the home chain\"},\"setVotingDelay(uint48)\":{\"notice\":\"Updates the voting delay parameter on the home chain\"},\"setVotingPeriod(uint32)\":{\"notice\":\"Updates the voting period parameter on the home chain\"},\"updateQuorumNumerator(uint256)\":{\"notice\":\"Updates the quorum numerator on the home chain\"}},\"notice\":\"Implementation of a DAO with cross-chain synchronization capabilities\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/variants/crosschain/Gov.sol\":\"Gov\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/governance/Governor.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (governance/Governor.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {IERC721Receiver} from \\\"../token/ERC721/IERC721Receiver.sol\\\";\\nimport {IERC1155Receiver} from \\\"../token/ERC1155/IERC1155Receiver.sol\\\";\\nimport {EIP712} from \\\"../utils/cryptography/EIP712.sol\\\";\\nimport {SignatureChecker} from \\\"../utils/cryptography/SignatureChecker.sol\\\";\\nimport {IERC165, ERC165} from \\\"../utils/introspection/ERC165.sol\\\";\\nimport {SafeCast} from \\\"../utils/math/SafeCast.sol\\\";\\nimport {DoubleEndedQueue} from \\\"../utils/structs/DoubleEndedQueue.sol\\\";\\nimport {Address} from \\\"../utils/Address.sol\\\";\\nimport {Context} from \\\"../utils/Context.sol\\\";\\nimport {Nonces} from \\\"../utils/Nonces.sol\\\";\\nimport {IGovernor, IERC6372} from \\\"./IGovernor.sol\\\";\\n\\n/**\\n * @dev Core of the governance system, designed to be extended through various modules.\\n *\\n * This contract is abstract and requires several functions to be implemented in various modules:\\n *\\n * - A counting module must implement {quorum}, {_quorumReached}, {_voteSucceeded} and {_countVote}\\n * - A voting module must implement {_getVotes}\\n * - Additionally, {votingPeriod} must also be implemented\\n */\\nabstract contract Governor is Context, ERC165, EIP712, Nonces, IGovernor, IERC721Receiver, IERC1155Receiver {\\n using DoubleEndedQueue for DoubleEndedQueue.Bytes32Deque;\\n\\n bytes32 public constant BALLOT_TYPEHASH =\\n keccak256(\\\"Ballot(uint256 proposalId,uint8 support,address voter,uint256 nonce)\\\");\\n bytes32 public constant EXTENDED_BALLOT_TYPEHASH =\\n keccak256(\\n \\\"ExtendedBallot(uint256 proposalId,uint8 support,address voter,uint256 nonce,string reason,bytes params)\\\"\\n );\\n\\n struct ProposalCore {\\n address proposer;\\n uint48 voteStart;\\n uint32 voteDuration;\\n bool executed;\\n bool canceled;\\n uint48 etaSeconds;\\n }\\n\\n bytes32 private constant ALL_PROPOSAL_STATES_BITMAP = bytes32((2 ** (uint8(type(ProposalState).max) + 1)) - 1);\\n string private _name;\\n\\n mapping(uint256 proposalId => ProposalCore) private _proposals;\\n\\n // This queue keeps track of the governor operating on itself. Calls to functions protected by the {onlyGovernance}\\n // modifier needs to be whitelisted in this queue. Whitelisting is set in {execute}, consumed by the\\n // {onlyGovernance} modifier and eventually reset after {_executeOperations} completes. This ensures that the\\n // execution of {onlyGovernance} protected calls can only be achieved through successful proposals.\\n DoubleEndedQueue.Bytes32Deque private _governanceCall;\\n\\n /**\\n * @dev Restricts a function so it can only be executed through governance proposals. For example, governance\\n * parameter setters in {GovernorSettings} are protected using this modifier.\\n *\\n * The governance executing address may be different from the Governor's own address, for example it could be a\\n * timelock. This can be customized by modules by overriding {_executor}. The executor is only able to invoke these\\n * functions during the execution of the governor's {execute} function, and not under any other circumstances. Thus,\\n * for example, additional timelock proposers are not able to change governance parameters without going through the\\n * governance protocol (since v4.6).\\n */\\n modifier onlyGovernance() {\\n _checkGovernance();\\n _;\\n }\\n\\n /**\\n * @dev Sets the value for {name} and {version}\\n */\\n constructor(string memory name_) EIP712(name_, version()) {\\n _name = name_;\\n }\\n\\n /**\\n * @dev Function to receive ETH that will be handled by the governor (disabled if executor is a third party contract)\\n */\\n receive() external payable virtual {\\n if (_executor() != address(this)) {\\n revert GovernorDisabledDeposit();\\n }\\n }\\n\\n /**\\n * @dev See {IERC165-supportsInterface}.\\n */\\n function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165, ERC165) returns (bool) {\\n return\\n interfaceId == type(IGovernor).interfaceId ||\\n interfaceId == type(IERC1155Receiver).interfaceId ||\\n super.supportsInterface(interfaceId);\\n }\\n\\n /**\\n * @dev See {IGovernor-name}.\\n */\\n function name() public view virtual returns (string memory) {\\n return _name;\\n }\\n\\n /**\\n * @dev See {IGovernor-version}.\\n */\\n function version() public view virtual returns (string memory) {\\n return \\\"1\\\";\\n }\\n\\n /**\\n * @dev See {IGovernor-hashProposal}.\\n *\\n * The proposal id is produced by hashing the ABI encoded `targets` array, the `values` array, the `calldatas` array\\n * and the descriptionHash (bytes32 which itself is the keccak256 hash of the description string). This proposal id\\n * can be produced from the proposal data which is part of the {ProposalCreated} event. It can even be computed in\\n * advance, before the proposal is submitted.\\n *\\n * Note that the chainId and the governor address are not part of the proposal id computation. Consequently, the\\n * same proposal (with same operation and same description) will have the same id if submitted on multiple governors\\n * across multiple networks. This also means that in order to execute the same operation twice (on the same\\n * governor) the proposer will have to change the description in order to avoid proposal id conflicts.\\n */\\n function hashProposal(\\n address[] memory targets,\\n uint256[] memory values,\\n bytes[] memory calldatas,\\n bytes32 descriptionHash\\n ) public pure virtual returns (uint256) {\\n return uint256(keccak256(abi.encode(targets, values, calldatas, descriptionHash)));\\n }\\n\\n /**\\n * @dev See {IGovernor-state}.\\n */\\n function state(uint256 proposalId) public view virtual returns (ProposalState) {\\n // We read the struct fields into the stack at once so Solidity emits a single SLOAD\\n ProposalCore storage proposal = _proposals[proposalId];\\n bool proposalExecuted = proposal.executed;\\n bool proposalCanceled = proposal.canceled;\\n\\n if (proposalExecuted) {\\n return ProposalState.Executed;\\n }\\n\\n if (proposalCanceled) {\\n return ProposalState.Canceled;\\n }\\n\\n uint256 snapshot = proposalSnapshot(proposalId);\\n\\n if (snapshot == 0) {\\n revert GovernorNonexistentProposal(proposalId);\\n }\\n\\n uint256 currentTimepoint = clock();\\n\\n if (snapshot >= currentTimepoint) {\\n return ProposalState.Pending;\\n }\\n\\n uint256 deadline = proposalDeadline(proposalId);\\n\\n if (deadline >= currentTimepoint) {\\n return ProposalState.Active;\\n } else if (!_quorumReached(proposalId) || !_voteSucceeded(proposalId)) {\\n return ProposalState.Defeated;\\n } else if (proposalEta(proposalId) == 0) {\\n return ProposalState.Succeeded;\\n } else {\\n return ProposalState.Queued;\\n }\\n }\\n\\n /**\\n * @dev See {IGovernor-proposalThreshold}.\\n */\\n function proposalThreshold() public view virtual returns (uint256) {\\n return 0;\\n }\\n\\n /**\\n * @dev See {IGovernor-proposalSnapshot}.\\n */\\n function proposalSnapshot(uint256 proposalId) public view virtual returns (uint256) {\\n return _proposals[proposalId].voteStart;\\n }\\n\\n /**\\n * @dev See {IGovernor-proposalDeadline}.\\n */\\n function proposalDeadline(uint256 proposalId) public view virtual returns (uint256) {\\n return _proposals[proposalId].voteStart + _proposals[proposalId].voteDuration;\\n }\\n\\n /**\\n * @dev See {IGovernor-proposalProposer}.\\n */\\n function proposalProposer(uint256 proposalId) public view virtual returns (address) {\\n return _proposals[proposalId].proposer;\\n }\\n\\n /**\\n * @dev See {IGovernor-proposalEta}.\\n */\\n function proposalEta(uint256 proposalId) public view virtual returns (uint256) {\\n return _proposals[proposalId].etaSeconds;\\n }\\n\\n /**\\n * @dev See {IGovernor-proposalNeedsQueuing}.\\n */\\n function proposalNeedsQueuing(uint256) public view virtual returns (bool) {\\n return false;\\n }\\n\\n /**\\n * @dev Reverts if the `msg.sender` is not the executor. In case the executor is not this contract\\n * itself, the function reverts if `msg.data` is not whitelisted as a result of an {execute}\\n * operation. See {onlyGovernance}.\\n */\\n function _checkGovernance() internal virtual {\\n if (_executor() != _msgSender()) {\\n revert GovernorOnlyExecutor(_msgSender());\\n }\\n if (_executor() != address(this)) {\\n bytes32 msgDataHash = keccak256(_msgData());\\n // loop until popping the expected operation - throw if deque is empty (operation not authorized)\\n while (_governanceCall.popFront() != msgDataHash) {}\\n }\\n }\\n\\n /**\\n * @dev Amount of votes already cast passes the threshold limit.\\n */\\n function _quorumReached(uint256 proposalId) internal view virtual returns (bool);\\n\\n /**\\n * @dev Is the proposal successful or not.\\n */\\n function _voteSucceeded(uint256 proposalId) internal view virtual returns (bool);\\n\\n /**\\n * @dev Get the voting weight of `account` at a specific `timepoint`, for a vote as described by `params`.\\n */\\n function _getVotes(address account, uint256 timepoint, bytes memory params) internal view virtual returns (uint256);\\n\\n /**\\n * @dev Register a vote for `proposalId` by `account` with a given `support`, voting `weight` and voting `params`.\\n *\\n * Note: Support is generic and can represent various things depending on the voting system used.\\n */\\n function _countVote(\\n uint256 proposalId,\\n address account,\\n uint8 support,\\n uint256 totalWeight,\\n bytes memory params\\n ) internal virtual returns (uint256);\\n\\n /**\\n * @dev Default additional encoded parameters used by castVote methods that don't include them\\n *\\n * Note: Should be overridden by specific implementations to use an appropriate value, the\\n * meaning of the additional params, in the context of that implementation\\n */\\n function _defaultParams() internal view virtual returns (bytes memory) {\\n return \\\"\\\";\\n }\\n\\n /**\\n * @dev See {IGovernor-propose}. This function has opt-in frontrunning protection, described in {_isValidDescriptionForProposer}.\\n */\\n function propose(\\n address[] memory targets,\\n uint256[] memory values,\\n bytes[] memory calldatas,\\n string memory description\\n ) public virtual returns (uint256) {\\n address proposer = _msgSender();\\n\\n // check description restriction\\n if (!_isValidDescriptionForProposer(proposer, description)) {\\n revert GovernorRestrictedProposer(proposer);\\n }\\n\\n // check proposal threshold\\n uint256 votesThreshold = proposalThreshold();\\n if (votesThreshold > 0) {\\n uint256 proposerVotes = getVotes(proposer, clock() - 1);\\n if (proposerVotes < votesThreshold) {\\n revert GovernorInsufficientProposerVotes(proposer, proposerVotes, votesThreshold);\\n }\\n }\\n\\n return _propose(targets, values, calldatas, description, proposer);\\n }\\n\\n /**\\n * @dev Internal propose mechanism. Can be overridden to add more logic on proposal creation.\\n *\\n * Emits a {IGovernor-ProposalCreated} event.\\n */\\n function _propose(\\n address[] memory targets,\\n uint256[] memory values,\\n bytes[] memory calldatas,\\n string memory description,\\n address proposer\\n ) internal virtual returns (uint256 proposalId) {\\n proposalId = hashProposal(targets, values, calldatas, keccak256(bytes(description)));\\n\\n if (targets.length != values.length || targets.length != calldatas.length || targets.length == 0) {\\n revert GovernorInvalidProposalLength(targets.length, calldatas.length, values.length);\\n }\\n if (_proposals[proposalId].voteStart != 0) {\\n revert GovernorUnexpectedProposalState(proposalId, state(proposalId), bytes32(0));\\n }\\n\\n uint256 snapshot = clock() + votingDelay();\\n uint256 duration = votingPeriod();\\n\\n ProposalCore storage proposal = _proposals[proposalId];\\n proposal.proposer = proposer;\\n proposal.voteStart = SafeCast.toUint48(snapshot);\\n proposal.voteDuration = SafeCast.toUint32(duration);\\n\\n emit ProposalCreated(\\n proposalId,\\n proposer,\\n targets,\\n values,\\n new string[](targets.length),\\n calldatas,\\n snapshot,\\n snapshot + duration,\\n description\\n );\\n\\n // Using a named return variable to avoid stack too deep errors\\n }\\n\\n /**\\n * @dev See {IGovernor-queue}.\\n */\\n function queue(\\n address[] memory targets,\\n uint256[] memory values,\\n bytes[] memory calldatas,\\n bytes32 descriptionHash\\n ) public virtual returns (uint256) {\\n uint256 proposalId = hashProposal(targets, values, calldatas, descriptionHash);\\n\\n _validateStateBitmap(proposalId, _encodeStateBitmap(ProposalState.Succeeded));\\n\\n uint48 etaSeconds = _queueOperations(proposalId, targets, values, calldatas, descriptionHash);\\n\\n if (etaSeconds != 0) {\\n _proposals[proposalId].etaSeconds = etaSeconds;\\n emit ProposalQueued(proposalId, etaSeconds);\\n } else {\\n revert GovernorQueueNotImplemented();\\n }\\n\\n return proposalId;\\n }\\n\\n /**\\n * @dev Internal queuing mechanism. Can be overridden (without a super call) to modify the way queuing is\\n * performed (for example adding a vault/timelock).\\n *\\n * This is empty by default, and must be overridden to implement queuing.\\n *\\n * This function returns a timestamp that describes the expected ETA for execution. If the returned value is 0\\n * (which is the default value), the core will consider queueing did not succeed, and the public {queue} function\\n * will revert.\\n *\\n * NOTE: Calling this function directly will NOT check the current state of the proposal, or emit the\\n * `ProposalQueued` event. Queuing a proposal should be done using {queue}.\\n */\\n function _queueOperations(\\n uint256 /*proposalId*/,\\n address[] memory /*targets*/,\\n uint256[] memory /*values*/,\\n bytes[] memory /*calldatas*/,\\n bytes32 /*descriptionHash*/\\n ) internal virtual returns (uint48) {\\n return 0;\\n }\\n\\n /**\\n * @dev See {IGovernor-execute}.\\n */\\n function execute(\\n address[] memory targets,\\n uint256[] memory values,\\n bytes[] memory calldatas,\\n bytes32 descriptionHash\\n ) public payable virtual returns (uint256) {\\n uint256 proposalId = hashProposal(targets, values, calldatas, descriptionHash);\\n\\n _validateStateBitmap(\\n proposalId,\\n _encodeStateBitmap(ProposalState.Succeeded) | _encodeStateBitmap(ProposalState.Queued)\\n );\\n\\n // mark as executed before calls to avoid reentrancy\\n _proposals[proposalId].executed = true;\\n\\n // before execute: register governance call in queue.\\n if (_executor() != address(this)) {\\n for (uint256 i = 0; i < targets.length; ++i) {\\n if (targets[i] == address(this)) {\\n _governanceCall.pushBack(keccak256(calldatas[i]));\\n }\\n }\\n }\\n\\n _executeOperations(proposalId, targets, values, calldatas, descriptionHash);\\n\\n // after execute: cleanup governance call queue.\\n if (_executor() != address(this) && !_governanceCall.empty()) {\\n _governanceCall.clear();\\n }\\n\\n emit ProposalExecuted(proposalId);\\n\\n return proposalId;\\n }\\n\\n /**\\n * @dev Internal execution mechanism. Can be overridden (without a super call) to modify the way execution is\\n * performed (for example adding a vault/timelock).\\n *\\n * NOTE: Calling this function directly will NOT check the current state of the proposal, set the executed flag to\\n * true or emit the `ProposalExecuted` event. Executing a proposal should be done using {execute} or {_execute}.\\n */\\n function _executeOperations(\\n uint256 /* proposalId */,\\n address[] memory targets,\\n uint256[] memory values,\\n bytes[] memory calldatas,\\n bytes32 /*descriptionHash*/\\n ) internal virtual {\\n for (uint256 i = 0; i < targets.length; ++i) {\\n (bool success, bytes memory returndata) = targets[i].call{value: values[i]}(calldatas[i]);\\n Address.verifyCallResult(success, returndata);\\n }\\n }\\n\\n /**\\n * @dev See {IGovernor-cancel}.\\n */\\n function cancel(\\n address[] memory targets,\\n uint256[] memory values,\\n bytes[] memory calldatas,\\n bytes32 descriptionHash\\n ) public virtual returns (uint256) {\\n // The proposalId will be recomputed in the `_cancel` call further down. However we need the value before we\\n // do the internal call, because we need to check the proposal state BEFORE the internal `_cancel` call\\n // changes it. The `hashProposal` duplication has a cost that is limited, and that we accept.\\n uint256 proposalId = hashProposal(targets, values, calldatas, descriptionHash);\\n\\n // public cancel restrictions (on top of existing _cancel restrictions).\\n _validateStateBitmap(proposalId, _encodeStateBitmap(ProposalState.Pending));\\n if (_msgSender() != proposalProposer(proposalId)) {\\n revert GovernorOnlyProposer(_msgSender());\\n }\\n\\n return _cancel(targets, values, calldatas, descriptionHash);\\n }\\n\\n /**\\n * @dev Internal cancel mechanism with minimal restrictions. A proposal can be cancelled in any state other than\\n * Canceled, Expired, or Executed. Once cancelled a proposal can't be re-submitted.\\n *\\n * Emits a {IGovernor-ProposalCanceled} event.\\n */\\n function _cancel(\\n address[] memory targets,\\n uint256[] memory values,\\n bytes[] memory calldatas,\\n bytes32 descriptionHash\\n ) internal virtual returns (uint256) {\\n uint256 proposalId = hashProposal(targets, values, calldatas, descriptionHash);\\n\\n _validateStateBitmap(\\n proposalId,\\n ALL_PROPOSAL_STATES_BITMAP ^\\n _encodeStateBitmap(ProposalState.Canceled) ^\\n _encodeStateBitmap(ProposalState.Expired) ^\\n _encodeStateBitmap(ProposalState.Executed)\\n );\\n\\n _proposals[proposalId].canceled = true;\\n emit ProposalCanceled(proposalId);\\n\\n return proposalId;\\n }\\n\\n /**\\n * @dev See {IGovernor-getVotes}.\\n */\\n function getVotes(address account, uint256 timepoint) public view virtual returns (uint256) {\\n return _getVotes(account, timepoint, _defaultParams());\\n }\\n\\n /**\\n * @dev See {IGovernor-getVotesWithParams}.\\n */\\n function getVotesWithParams(\\n address account,\\n uint256 timepoint,\\n bytes memory params\\n ) public view virtual returns (uint256) {\\n return _getVotes(account, timepoint, params);\\n }\\n\\n /**\\n * @dev See {IGovernor-castVote}.\\n */\\n function castVote(uint256 proposalId, uint8 support) public virtual returns (uint256) {\\n address voter = _msgSender();\\n return _castVote(proposalId, voter, support, \\\"\\\");\\n }\\n\\n /**\\n * @dev See {IGovernor-castVoteWithReason}.\\n */\\n function castVoteWithReason(\\n uint256 proposalId,\\n uint8 support,\\n string calldata reason\\n ) public virtual returns (uint256) {\\n address voter = _msgSender();\\n return _castVote(proposalId, voter, support, reason);\\n }\\n\\n /**\\n * @dev See {IGovernor-castVoteWithReasonAndParams}.\\n */\\n function castVoteWithReasonAndParams(\\n uint256 proposalId,\\n uint8 support,\\n string calldata reason,\\n bytes memory params\\n ) public virtual returns (uint256) {\\n address voter = _msgSender();\\n return _castVote(proposalId, voter, support, reason, params);\\n }\\n\\n /**\\n * @dev See {IGovernor-castVoteBySig}.\\n */\\n function castVoteBySig(\\n uint256 proposalId,\\n uint8 support,\\n address voter,\\n bytes memory signature\\n ) public virtual returns (uint256) {\\n bool valid = SignatureChecker.isValidSignatureNow(\\n voter,\\n _hashTypedDataV4(keccak256(abi.encode(BALLOT_TYPEHASH, proposalId, support, voter, _useNonce(voter)))),\\n signature\\n );\\n\\n if (!valid) {\\n revert GovernorInvalidSignature(voter);\\n }\\n\\n return _castVote(proposalId, voter, support, \\\"\\\");\\n }\\n\\n /**\\n * @dev See {IGovernor-castVoteWithReasonAndParamsBySig}.\\n */\\n function castVoteWithReasonAndParamsBySig(\\n uint256 proposalId,\\n uint8 support,\\n address voter,\\n string calldata reason,\\n bytes memory params,\\n bytes memory signature\\n ) public virtual returns (uint256) {\\n bool valid = SignatureChecker.isValidSignatureNow(\\n voter,\\n _hashTypedDataV4(\\n keccak256(\\n abi.encode(\\n EXTENDED_BALLOT_TYPEHASH,\\n proposalId,\\n support,\\n voter,\\n _useNonce(voter),\\n keccak256(bytes(reason)),\\n keccak256(params)\\n )\\n )\\n ),\\n signature\\n );\\n\\n if (!valid) {\\n revert GovernorInvalidSignature(voter);\\n }\\n\\n return _castVote(proposalId, voter, support, reason, params);\\n }\\n\\n /**\\n * @dev Internal vote casting mechanism: Check that the vote is pending, that it has not been cast yet, retrieve\\n * voting weight using {IGovernor-getVotes} and call the {_countVote} internal function. Uses the _defaultParams().\\n *\\n * Emits a {IGovernor-VoteCast} event.\\n */\\n function _castVote(\\n uint256 proposalId,\\n address account,\\n uint8 support,\\n string memory reason\\n ) internal virtual returns (uint256) {\\n return _castVote(proposalId, account, support, reason, _defaultParams());\\n }\\n\\n /**\\n * @dev Internal vote casting mechanism: Check that the vote is pending, that it has not been cast yet, retrieve\\n * voting weight using {IGovernor-getVotes} and call the {_countVote} internal function.\\n *\\n * Emits a {IGovernor-VoteCast} event.\\n */\\n function _castVote(\\n uint256 proposalId,\\n address account,\\n uint8 support,\\n string memory reason,\\n bytes memory params\\n ) internal virtual returns (uint256) {\\n _validateStateBitmap(proposalId, _encodeStateBitmap(ProposalState.Active));\\n\\n uint256 totalWeight = _getVotes(account, proposalSnapshot(proposalId), params);\\n uint256 votedWeight = _countVote(proposalId, account, support, totalWeight, params);\\n\\n if (params.length == 0) {\\n emit VoteCast(account, proposalId, support, votedWeight, reason);\\n } else {\\n emit VoteCastWithParams(account, proposalId, support, votedWeight, reason, params);\\n }\\n\\n return votedWeight;\\n }\\n\\n /**\\n * @dev Relays a transaction or function call to an arbitrary target. In cases where the governance executor\\n * is some contract other than the governor itself, like when using a timelock, this function can be invoked\\n * in a governance proposal to recover tokens or Ether that was sent to the governor contract by mistake.\\n * Note that if the executor is simply the governor itself, use of `relay` is redundant.\\n */\\n function relay(address target, uint256 value, bytes calldata data) external payable virtual onlyGovernance {\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n Address.verifyCallResult(success, returndata);\\n }\\n\\n /**\\n * @dev Address through which the governor executes action. Will be overloaded by module that execute actions\\n * through another contract such as a timelock.\\n */\\n function _executor() internal view virtual returns (address) {\\n return address(this);\\n }\\n\\n /**\\n * @dev See {IERC721Receiver-onERC721Received}.\\n * Receiving tokens is disabled if the governance executor is other than the governor itself (eg. when using with a timelock).\\n */\\n function onERC721Received(address, address, uint256, bytes memory) public virtual returns (bytes4) {\\n if (_executor() != address(this)) {\\n revert GovernorDisabledDeposit();\\n }\\n return this.onERC721Received.selector;\\n }\\n\\n /**\\n * @dev See {IERC1155Receiver-onERC1155Received}.\\n * Receiving tokens is disabled if the governance executor is other than the governor itself (eg. when using with a timelock).\\n */\\n function onERC1155Received(address, address, uint256, uint256, bytes memory) public virtual returns (bytes4) {\\n if (_executor() != address(this)) {\\n revert GovernorDisabledDeposit();\\n }\\n return this.onERC1155Received.selector;\\n }\\n\\n /**\\n * @dev See {IERC1155Receiver-onERC1155BatchReceived}.\\n * Receiving tokens is disabled if the governance executor is other than the governor itself (eg. when using with a timelock).\\n */\\n function onERC1155BatchReceived(\\n address,\\n address,\\n uint256[] memory,\\n uint256[] memory,\\n bytes memory\\n ) public virtual returns (bytes4) {\\n if (_executor() != address(this)) {\\n revert GovernorDisabledDeposit();\\n }\\n return this.onERC1155BatchReceived.selector;\\n }\\n\\n /**\\n * @dev Encodes a `ProposalState` into a `bytes32` representation where each bit enabled corresponds to\\n * the underlying position in the `ProposalState` enum. For example:\\n *\\n * 0x000...10000\\n * ^^^^^^------ ...\\n * ^----- Succeeded\\n * ^---- Defeated\\n * ^--- Canceled\\n * ^-- Active\\n * ^- Pending\\n */\\n function _encodeStateBitmap(ProposalState proposalState) internal pure returns (bytes32) {\\n return bytes32(1 << uint8(proposalState));\\n }\\n\\n /**\\n * @dev Check that the current state of a proposal matches the requirements described by the `allowedStates` bitmap.\\n * This bitmap should be built using `_encodeStateBitmap`.\\n *\\n * If requirements are not met, reverts with a {GovernorUnexpectedProposalState} error.\\n */\\n function _validateStateBitmap(uint256 proposalId, bytes32 allowedStates) private view returns (ProposalState) {\\n ProposalState currentState = state(proposalId);\\n if (_encodeStateBitmap(currentState) & allowedStates == bytes32(0)) {\\n revert GovernorUnexpectedProposalState(proposalId, currentState, allowedStates);\\n }\\n return currentState;\\n }\\n\\n /*\\n * @dev Check if the proposer is authorized to submit a proposal with the given description.\\n *\\n * If the proposal description ends with `#proposer=0x???`, where `0x???` is an address written as a hex string\\n * (case insensitive), then the submission of this proposal will only be authorized to said address.\\n *\\n * This is used for frontrunning protection. By adding this pattern at the end of their proposal, one can ensure\\n * that no other address can submit the same proposal. An attacker would have to either remove or change that part,\\n * which would result in a different proposal id.\\n *\\n * If the description does not match this pattern, it is unrestricted and anyone can submit it. This includes:\\n * - If the `0x???` part is not a valid hex string.\\n * - If the `0x???` part is a valid hex string, but does not contain exactly 40 hex digits.\\n * - If it ends with the expected suffix followed by newlines or other whitespace.\\n * - If it ends with some other similar suffix, e.g. `#other=abc`.\\n * - If it does not end with any such suffix.\\n */\\n function _isValidDescriptionForProposer(\\n address proposer,\\n string memory description\\n ) internal view virtual returns (bool) {\\n uint256 len = bytes(description).length;\\n\\n // Length is too short to contain a valid proposer suffix\\n if (len < 52) {\\n return true;\\n }\\n\\n // Extract what would be the `#proposer=0x` marker beginning the suffix\\n bytes12 marker;\\n assembly (\\\"memory-safe\\\") {\\n // - Start of the string contents in memory = description + 32\\n // - First character of the marker = len - 52\\n // - Length of \\\"#proposer=0x0000000000000000000000000000000000000000\\\" = 52\\n // - We read the memory word starting at the first character of the marker:\\n // - (description + 32) + (len - 52) = description + (len - 20)\\n // - Note: Solidity will ignore anything past the first 12 bytes\\n marker := mload(add(description, sub(len, 20)))\\n }\\n\\n // If the marker is not found, there is no proposer suffix to check\\n if (marker != bytes12(\\\"#proposer=0x\\\")) {\\n return true;\\n }\\n\\n // Parse the 40 characters following the marker as uint160\\n uint160 recovered = 0;\\n for (uint256 i = len - 40; i < len; ++i) {\\n (bool isHex, uint8 value) = _tryHexToUint(bytes(description)[i]);\\n // If any of the characters is not a hex digit, ignore the suffix entirely\\n if (!isHex) {\\n return true;\\n }\\n recovered = (recovered << 4) | value;\\n }\\n\\n return recovered == uint160(proposer);\\n }\\n\\n /**\\n * @dev Try to parse a character from a string as a hex value. Returns `(true, value)` if the char is in\\n * `[0-9a-fA-F]` and `(false, 0)` otherwise. Value is guaranteed to be in the range `0 <= value < 16`\\n */\\n function _tryHexToUint(bytes1 char) private pure returns (bool isHex, uint8 value) {\\n uint8 c = uint8(char);\\n unchecked {\\n // Case 0-9\\n if (47 < c && c < 58) {\\n return (true, c - 48);\\n }\\n // Case A-F\\n else if (64 < c && c < 71) {\\n return (true, c - 55);\\n }\\n // Case a-f\\n else if (96 < c && c < 103) {\\n return (true, c - 87);\\n }\\n // Else: not a hex char\\n else {\\n return (false, 0);\\n }\\n }\\n }\\n\\n /**\\n * @inheritdoc IERC6372\\n */\\n function clock() public view virtual returns (uint48);\\n\\n /**\\n * @inheritdoc IERC6372\\n */\\n // solhint-disable-next-line func-name-mixedcase\\n function CLOCK_MODE() public view virtual returns (string memory);\\n\\n /**\\n * @inheritdoc IGovernor\\n */\\n function votingDelay() public view virtual returns (uint256);\\n\\n /**\\n * @inheritdoc IGovernor\\n */\\n function votingPeriod() public view virtual returns (uint256);\\n\\n /**\\n * @inheritdoc IGovernor\\n */\\n function quorum(uint256 timepoint) public view virtual returns (uint256);\\n}\\n\",\"keccak256\":\"0xe0f387e99c7dfcb1d3e7d2f36e408ab59a851a5e0502d21889568466a2a491bc\",\"license\":\"MIT\"},\"@openzeppelin/contracts/governance/IGovernor.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (governance/IGovernor.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {IERC165} from \\\"../interfaces/IERC165.sol\\\";\\nimport {IERC6372} from \\\"../interfaces/IERC6372.sol\\\";\\n\\n/**\\n * @dev Interface of the {Governor} core.\\n *\\n * NOTE: Event parameters lack the `indexed` keyword for compatibility with GovernorBravo events.\\n * Making event parameters `indexed` affects how events are decoded, potentially breaking existing indexers.\\n */\\ninterface IGovernor is IERC165, IERC6372 {\\n enum ProposalState {\\n Pending,\\n Active,\\n Canceled,\\n Defeated,\\n Succeeded,\\n Queued,\\n Expired,\\n Executed\\n }\\n\\n /**\\n * @dev Empty proposal or a mismatch between the parameters length for a proposal call.\\n */\\n error GovernorInvalidProposalLength(uint256 targets, uint256 calldatas, uint256 values);\\n\\n /**\\n * @dev The vote was already cast.\\n */\\n error GovernorAlreadyCastVote(address voter);\\n\\n /**\\n * @dev Token deposits are disabled in this contract.\\n */\\n error GovernorDisabledDeposit();\\n\\n /**\\n * @dev The `account` is not a proposer.\\n */\\n error GovernorOnlyProposer(address account);\\n\\n /**\\n * @dev The `account` is not the governance executor.\\n */\\n error GovernorOnlyExecutor(address account);\\n\\n /**\\n * @dev The `proposalId` doesn't exist.\\n */\\n error GovernorNonexistentProposal(uint256 proposalId);\\n\\n /**\\n * @dev The current state of a proposal is not the required for performing an operation.\\n * The `expectedStates` is a bitmap with the bits enabled for each ProposalState enum position\\n * counting from right to left.\\n *\\n * NOTE: If `expectedState` is `bytes32(0)`, the proposal is expected to not be in any state (i.e. not exist).\\n * This is the case when a proposal that is expected to be unset is already initiated (the proposal is duplicated).\\n *\\n * See {Governor-_encodeStateBitmap}.\\n */\\n error GovernorUnexpectedProposalState(uint256 proposalId, ProposalState current, bytes32 expectedStates);\\n\\n /**\\n * @dev The voting period set is not a valid period.\\n */\\n error GovernorInvalidVotingPeriod(uint256 votingPeriod);\\n\\n /**\\n * @dev The `proposer` does not have the required votes to create a proposal.\\n */\\n error GovernorInsufficientProposerVotes(address proposer, uint256 votes, uint256 threshold);\\n\\n /**\\n * @dev The `proposer` is not allowed to create a proposal.\\n */\\n error GovernorRestrictedProposer(address proposer);\\n\\n /**\\n * @dev The vote type used is not valid for the corresponding counting module.\\n */\\n error GovernorInvalidVoteType();\\n\\n /**\\n * @dev The provided params buffer is not supported by the counting module.\\n */\\n error GovernorInvalidVoteParams();\\n\\n /**\\n * @dev Queue operation is not implemented for this governor. Execute should be called directly.\\n */\\n error GovernorQueueNotImplemented();\\n\\n /**\\n * @dev The proposal hasn't been queued yet.\\n */\\n error GovernorNotQueuedProposal(uint256 proposalId);\\n\\n /**\\n * @dev The proposal has already been queued.\\n */\\n error GovernorAlreadyQueuedProposal(uint256 proposalId);\\n\\n /**\\n * @dev The provided signature is not valid for the expected `voter`.\\n * If the `voter` is a contract, the signature is not valid using {IERC1271-isValidSignature}.\\n */\\n error GovernorInvalidSignature(address voter);\\n\\n /**\\n * @dev Emitted when a proposal is created.\\n */\\n event ProposalCreated(\\n uint256 proposalId,\\n address proposer,\\n address[] targets,\\n uint256[] values,\\n string[] signatures,\\n bytes[] calldatas,\\n uint256 voteStart,\\n uint256 voteEnd,\\n string description\\n );\\n\\n /**\\n * @dev Emitted when a proposal is queued.\\n */\\n event ProposalQueued(uint256 proposalId, uint256 etaSeconds);\\n\\n /**\\n * @dev Emitted when a proposal is executed.\\n */\\n event ProposalExecuted(uint256 proposalId);\\n\\n /**\\n * @dev Emitted when a proposal is canceled.\\n */\\n event ProposalCanceled(uint256 proposalId);\\n\\n /**\\n * @dev Emitted when a vote is cast without params.\\n *\\n * Note: `support` values should be seen as buckets. Their interpretation depends on the voting module used.\\n */\\n event VoteCast(address indexed voter, uint256 proposalId, uint8 support, uint256 weight, string reason);\\n\\n /**\\n * @dev Emitted when a vote is cast with params.\\n *\\n * Note: `support` values should be seen as buckets. Their interpretation depends on the voting module used.\\n * `params` are additional encoded parameters. Their interpretation also depends on the voting module used.\\n */\\n event VoteCastWithParams(\\n address indexed voter,\\n uint256 proposalId,\\n uint8 support,\\n uint256 weight,\\n string reason,\\n bytes params\\n );\\n\\n /**\\n * @notice module:core\\n * @dev Name of the governor instance (used in building the EIP-712 domain separator).\\n */\\n function name() external view returns (string memory);\\n\\n /**\\n * @notice module:core\\n * @dev Version of the governor instance (used in building the EIP-712 domain separator). Default: \\\"1\\\"\\n */\\n function version() external view returns (string memory);\\n\\n /**\\n * @notice module:voting\\n * @dev A description of the possible `support` values for {castVote} and the way these votes are counted, meant to\\n * be consumed by UIs to show correct vote options and interpret the results. The string is a URL-encoded sequence of\\n * key-value pairs that each describe one aspect, for example `support=bravo&quorum=for,abstain`.\\n *\\n * There are 2 standard keys: `support` and `quorum`.\\n *\\n * - `support=bravo` refers to the vote options 0 = Against, 1 = For, 2 = Abstain, as in `GovernorBravo`.\\n * - `quorum=bravo` means that only For votes are counted towards quorum.\\n * - `quorum=for,abstain` means that both For and Abstain votes are counted towards quorum.\\n *\\n * If a counting module makes use of encoded `params`, it should include this under a `params` key with a unique\\n * name that describes the behavior. For example:\\n *\\n * - `params=fractional` might refer to a scheme where votes are divided fractionally between for/against/abstain.\\n * - `params=erc721` might refer to a scheme where specific NFTs are delegated to vote.\\n *\\n * NOTE: The string can be decoded by the standard\\n * https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams[`URLSearchParams`]\\n * JavaScript class.\\n */\\n // solhint-disable-next-line func-name-mixedcase\\n function COUNTING_MODE() external view returns (string memory);\\n\\n /**\\n * @notice module:core\\n * @dev Hashing function used to (re)build the proposal id from the proposal details..\\n */\\n function hashProposal(\\n address[] memory targets,\\n uint256[] memory values,\\n bytes[] memory calldatas,\\n bytes32 descriptionHash\\n ) external pure returns (uint256);\\n\\n /**\\n * @notice module:core\\n * @dev Current state of a proposal, following Compound's convention\\n */\\n function state(uint256 proposalId) external view returns (ProposalState);\\n\\n /**\\n * @notice module:core\\n * @dev The number of votes required in order for a voter to become a proposer.\\n */\\n function proposalThreshold() external view returns (uint256);\\n\\n /**\\n * @notice module:core\\n * @dev Timepoint used to retrieve user's votes and quorum. If using block number (as per Compound's Comp), the\\n * snapshot is performed at the end of this block. Hence, voting for this proposal starts at the beginning of the\\n * following block.\\n */\\n function proposalSnapshot(uint256 proposalId) external view returns (uint256);\\n\\n /**\\n * @notice module:core\\n * @dev Timepoint at which votes close. If using block number, votes close at the end of this block, so it is\\n * possible to cast a vote during this block.\\n */\\n function proposalDeadline(uint256 proposalId) external view returns (uint256);\\n\\n /**\\n * @notice module:core\\n * @dev The account that created a proposal.\\n */\\n function proposalProposer(uint256 proposalId) external view returns (address);\\n\\n /**\\n * @notice module:core\\n * @dev The time when a queued proposal becomes executable (\\\"ETA\\\"). Unlike {proposalSnapshot} and\\n * {proposalDeadline}, this doesn't use the governor clock, and instead relies on the executor's clock which may be\\n * different. In most cases this will be a timestamp.\\n */\\n function proposalEta(uint256 proposalId) external view returns (uint256);\\n\\n /**\\n * @notice module:core\\n * @dev Whether a proposal needs to be queued before execution.\\n */\\n function proposalNeedsQueuing(uint256 proposalId) external view returns (bool);\\n\\n /**\\n * @notice module:user-config\\n * @dev Delay, between the proposal is created and the vote starts. The unit this duration is expressed in depends\\n * on the clock (see ERC-6372) this contract uses.\\n *\\n * This can be increased to leave time for users to buy voting power, or delegate it, before the voting of a\\n * proposal starts.\\n *\\n * NOTE: While this interface returns a uint256, timepoints are stored as uint48 following the ERC-6372 clock type.\\n * Consequently this value must fit in a uint48 (when added to the current clock). See {IERC6372-clock}.\\n */\\n function votingDelay() external view returns (uint256);\\n\\n /**\\n * @notice module:user-config\\n * @dev Delay between the vote start and vote end. The unit this duration is expressed in depends on the clock\\n * (see ERC-6372) this contract uses.\\n *\\n * NOTE: The {votingDelay} can delay the start of the vote. This must be considered when setting the voting\\n * duration compared to the voting delay.\\n *\\n * NOTE: This value is stored when the proposal is submitted so that possible changes to the value do not affect\\n * proposals that have already been submitted. The type used to save it is a uint32. Consequently, while this\\n * interface returns a uint256, the value it returns should fit in a uint32.\\n */\\n function votingPeriod() external view returns (uint256);\\n\\n /**\\n * @notice module:user-config\\n * @dev Minimum number of cast voted required for a proposal to be successful.\\n *\\n * NOTE: The `timepoint` parameter corresponds to the snapshot used for counting vote. This allows to scale the\\n * quorum depending on values such as the totalSupply of a token at this timepoint (see {ERC20Votes}).\\n */\\n function quorum(uint256 timepoint) external view returns (uint256);\\n\\n /**\\n * @notice module:reputation\\n * @dev Voting power of an `account` at a specific `timepoint`.\\n *\\n * Note: this can be implemented in a number of ways, for example by reading the delegated balance from one (or\\n * multiple), {ERC20Votes} tokens.\\n */\\n function getVotes(address account, uint256 timepoint) external view returns (uint256);\\n\\n /**\\n * @notice module:reputation\\n * @dev Voting power of an `account` at a specific `timepoint` given additional encoded parameters.\\n */\\n function getVotesWithParams(\\n address account,\\n uint256 timepoint,\\n bytes memory params\\n ) external view returns (uint256);\\n\\n /**\\n * @notice module:voting\\n * @dev Returns whether `account` has cast a vote on `proposalId`.\\n */\\n function hasVoted(uint256 proposalId, address account) external view returns (bool);\\n\\n /**\\n * @dev Create a new proposal. Vote start after a delay specified by {IGovernor-votingDelay} and lasts for a\\n * duration specified by {IGovernor-votingPeriod}.\\n *\\n * Emits a {ProposalCreated} event.\\n *\\n * NOTE: The state of the Governor and `targets` may change between the proposal creation and its execution.\\n * This may be the result of third party actions on the targeted contracts, or other governor proposals.\\n * For example, the balance of this contract could be updated or its access control permissions may be modified,\\n * possibly compromising the proposal's ability to execute successfully (e.g. the governor doesn't have enough\\n * value to cover a proposal with multiple transfers).\\n */\\n function propose(\\n address[] memory targets,\\n uint256[] memory values,\\n bytes[] memory calldatas,\\n string memory description\\n ) external returns (uint256 proposalId);\\n\\n /**\\n * @dev Queue a proposal. Some governors require this step to be performed before execution can happen. If queuing\\n * is not necessary, this function may revert.\\n * Queuing a proposal requires the quorum to be reached, the vote to be successful, and the deadline to be reached.\\n *\\n * Emits a {ProposalQueued} event.\\n */\\n function queue(\\n address[] memory targets,\\n uint256[] memory values,\\n bytes[] memory calldatas,\\n bytes32 descriptionHash\\n ) external returns (uint256 proposalId);\\n\\n /**\\n * @dev Execute a successful proposal. This requires the quorum to be reached, the vote to be successful, and the\\n * deadline to be reached. Depending on the governor it might also be required that the proposal was queued and\\n * that some delay passed.\\n *\\n * Emits a {ProposalExecuted} event.\\n *\\n * NOTE: Some modules can modify the requirements for execution, for example by adding an additional timelock.\\n */\\n function execute(\\n address[] memory targets,\\n uint256[] memory values,\\n bytes[] memory calldatas,\\n bytes32 descriptionHash\\n ) external payable returns (uint256 proposalId);\\n\\n /**\\n * @dev Cancel a proposal. A proposal is cancellable by the proposer, but only while it is Pending state, i.e.\\n * before the vote starts.\\n *\\n * Emits a {ProposalCanceled} event.\\n */\\n function cancel(\\n address[] memory targets,\\n uint256[] memory values,\\n bytes[] memory calldatas,\\n bytes32 descriptionHash\\n ) external returns (uint256 proposalId);\\n\\n /**\\n * @dev Cast a vote\\n *\\n * Emits a {VoteCast} event.\\n */\\n function castVote(uint256 proposalId, uint8 support) external returns (uint256 balance);\\n\\n /**\\n * @dev Cast a vote with a reason\\n *\\n * Emits a {VoteCast} event.\\n */\\n function castVoteWithReason(\\n uint256 proposalId,\\n uint8 support,\\n string calldata reason\\n ) external returns (uint256 balance);\\n\\n /**\\n * @dev Cast a vote with a reason and additional encoded parameters\\n *\\n * Emits a {VoteCast} or {VoteCastWithParams} event depending on the length of params.\\n */\\n function castVoteWithReasonAndParams(\\n uint256 proposalId,\\n uint8 support,\\n string calldata reason,\\n bytes memory params\\n ) external returns (uint256 balance);\\n\\n /**\\n * @dev Cast a vote using the voter's signature, including ERC-1271 signature support.\\n *\\n * Emits a {VoteCast} event.\\n */\\n function castVoteBySig(\\n uint256 proposalId,\\n uint8 support,\\n address voter,\\n bytes memory signature\\n ) external returns (uint256 balance);\\n\\n /**\\n * @dev Cast a vote with a reason and additional encoded parameters using the voter's signature,\\n * including ERC-1271 signature support.\\n *\\n * Emits a {VoteCast} or {VoteCastWithParams} event depending on the length of params.\\n */\\n function castVoteWithReasonAndParamsBySig(\\n uint256 proposalId,\\n uint8 support,\\n address voter,\\n string calldata reason,\\n bytes memory params,\\n bytes memory signature\\n ) external returns (uint256 balance);\\n}\\n\",\"keccak256\":\"0x9406604436e6925413ab70149fec16f3b28cc9e492b2baaa09c0acefd315b2a7\",\"license\":\"MIT\"},\"@openzeppelin/contracts/governance/extensions/GovernorCountingSimple.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (governance/extensions/GovernorCountingSimple.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {Governor} from \\\"../Governor.sol\\\";\\n\\n/**\\n * @dev Extension of {Governor} for simple, 3 options, vote counting.\\n */\\nabstract contract GovernorCountingSimple is Governor {\\n /**\\n * @dev Supported vote types. Matches Governor Bravo ordering.\\n */\\n enum VoteType {\\n Against,\\n For,\\n Abstain\\n }\\n\\n struct ProposalVote {\\n uint256 againstVotes;\\n uint256 forVotes;\\n uint256 abstainVotes;\\n mapping(address voter => bool) hasVoted;\\n }\\n\\n mapping(uint256 proposalId => ProposalVote) private _proposalVotes;\\n\\n /**\\n * @dev See {IGovernor-COUNTING_MODE}.\\n */\\n // solhint-disable-next-line func-name-mixedcase\\n function COUNTING_MODE() public pure virtual override returns (string memory) {\\n return \\\"support=bravo&quorum=for,abstain\\\";\\n }\\n\\n /**\\n * @dev See {IGovernor-hasVoted}.\\n */\\n function hasVoted(uint256 proposalId, address account) public view virtual override returns (bool) {\\n return _proposalVotes[proposalId].hasVoted[account];\\n }\\n\\n /**\\n * @dev Accessor to the internal vote counts.\\n */\\n function proposalVotes(\\n uint256 proposalId\\n ) public view virtual returns (uint256 againstVotes, uint256 forVotes, uint256 abstainVotes) {\\n ProposalVote storage proposalVote = _proposalVotes[proposalId];\\n return (proposalVote.againstVotes, proposalVote.forVotes, proposalVote.abstainVotes);\\n }\\n\\n /**\\n * @dev See {Governor-_quorumReached}.\\n */\\n function _quorumReached(uint256 proposalId) internal view virtual override returns (bool) {\\n ProposalVote storage proposalVote = _proposalVotes[proposalId];\\n\\n return quorum(proposalSnapshot(proposalId)) <= proposalVote.forVotes + proposalVote.abstainVotes;\\n }\\n\\n /**\\n * @dev See {Governor-_voteSucceeded}. In this module, the forVotes must be strictly over the againstVotes.\\n */\\n function _voteSucceeded(uint256 proposalId) internal view virtual override returns (bool) {\\n ProposalVote storage proposalVote = _proposalVotes[proposalId];\\n\\n return proposalVote.forVotes > proposalVote.againstVotes;\\n }\\n\\n /**\\n * @dev See {Governor-_countVote}. In this module, the support follows the `VoteType` enum (from Governor Bravo).\\n */\\n function _countVote(\\n uint256 proposalId,\\n address account,\\n uint8 support,\\n uint256 totalWeight,\\n bytes memory // params\\n ) internal virtual override returns (uint256) {\\n ProposalVote storage proposalVote = _proposalVotes[proposalId];\\n\\n if (proposalVote.hasVoted[account]) {\\n revert GovernorAlreadyCastVote(account);\\n }\\n proposalVote.hasVoted[account] = true;\\n\\n if (support == uint8(VoteType.Against)) {\\n proposalVote.againstVotes += totalWeight;\\n } else if (support == uint8(VoteType.For)) {\\n proposalVote.forVotes += totalWeight;\\n } else if (support == uint8(VoteType.Abstain)) {\\n proposalVote.abstainVotes += totalWeight;\\n } else {\\n revert GovernorInvalidVoteType();\\n }\\n\\n return totalWeight;\\n }\\n}\\n\",\"keccak256\":\"0xdc21c15a8582ca58529bf4b63209718a86fd944cbb206a492687333fe8cce0ff\",\"license\":\"MIT\"},\"@openzeppelin/contracts/governance/extensions/GovernorSettings.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (governance/extensions/GovernorSettings.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {Governor} from \\\"../Governor.sol\\\";\\n\\n/**\\n * @dev Extension of {Governor} for settings updatable through governance.\\n */\\nabstract contract GovernorSettings is Governor {\\n // amount of token\\n uint256 private _proposalThreshold;\\n // timepoint: limited to uint48 in core (same as clock() type)\\n uint48 private _votingDelay;\\n // duration: limited to uint32 in core\\n uint32 private _votingPeriod;\\n\\n event VotingDelaySet(uint256 oldVotingDelay, uint256 newVotingDelay);\\n event VotingPeriodSet(uint256 oldVotingPeriod, uint256 newVotingPeriod);\\n event ProposalThresholdSet(uint256 oldProposalThreshold, uint256 newProposalThreshold);\\n\\n /**\\n * @dev Initialize the governance parameters.\\n */\\n constructor(uint48 initialVotingDelay, uint32 initialVotingPeriod, uint256 initialProposalThreshold) {\\n _setVotingDelay(initialVotingDelay);\\n _setVotingPeriod(initialVotingPeriod);\\n _setProposalThreshold(initialProposalThreshold);\\n }\\n\\n /**\\n * @dev See {IGovernor-votingDelay}.\\n */\\n function votingDelay() public view virtual override returns (uint256) {\\n return _votingDelay;\\n }\\n\\n /**\\n * @dev See {IGovernor-votingPeriod}.\\n */\\n function votingPeriod() public view virtual override returns (uint256) {\\n return _votingPeriod;\\n }\\n\\n /**\\n * @dev See {Governor-proposalThreshold}.\\n */\\n function proposalThreshold() public view virtual override returns (uint256) {\\n return _proposalThreshold;\\n }\\n\\n /**\\n * @dev Update the voting delay. This operation can only be performed through a governance proposal.\\n *\\n * Emits a {VotingDelaySet} event.\\n */\\n function setVotingDelay(uint48 newVotingDelay) public virtual onlyGovernance {\\n _setVotingDelay(newVotingDelay);\\n }\\n\\n /**\\n * @dev Update the voting period. This operation can only be performed through a governance proposal.\\n *\\n * Emits a {VotingPeriodSet} event.\\n */\\n function setVotingPeriod(uint32 newVotingPeriod) public virtual onlyGovernance {\\n _setVotingPeriod(newVotingPeriod);\\n }\\n\\n /**\\n * @dev Update the proposal threshold. This operation can only be performed through a governance proposal.\\n *\\n * Emits a {ProposalThresholdSet} event.\\n */\\n function setProposalThreshold(uint256 newProposalThreshold) public virtual onlyGovernance {\\n _setProposalThreshold(newProposalThreshold);\\n }\\n\\n /**\\n * @dev Internal setter for the voting delay.\\n *\\n * Emits a {VotingDelaySet} event.\\n */\\n function _setVotingDelay(uint48 newVotingDelay) internal virtual {\\n emit VotingDelaySet(_votingDelay, newVotingDelay);\\n _votingDelay = newVotingDelay;\\n }\\n\\n /**\\n * @dev Internal setter for the voting period.\\n *\\n * Emits a {VotingPeriodSet} event.\\n */\\n function _setVotingPeriod(uint32 newVotingPeriod) internal virtual {\\n if (newVotingPeriod == 0) {\\n revert GovernorInvalidVotingPeriod(0);\\n }\\n emit VotingPeriodSet(_votingPeriod, newVotingPeriod);\\n _votingPeriod = newVotingPeriod;\\n }\\n\\n /**\\n * @dev Internal setter for the proposal threshold.\\n *\\n * Emits a {ProposalThresholdSet} event.\\n */\\n function _setProposalThreshold(uint256 newProposalThreshold) internal virtual {\\n emit ProposalThresholdSet(_proposalThreshold, newProposalThreshold);\\n _proposalThreshold = newProposalThreshold;\\n }\\n}\\n\",\"keccak256\":\"0x1e0810708b8f5de8d3db73240ccee2d36a305cb904aa5acd4588834ebce6acce\",\"license\":\"MIT\"},\"@openzeppelin/contracts/governance/extensions/GovernorVotes.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (governance/extensions/GovernorVotes.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {Governor} from \\\"../Governor.sol\\\";\\nimport {IVotes} from \\\"../utils/IVotes.sol\\\";\\nimport {IERC5805} from \\\"../../interfaces/IERC5805.sol\\\";\\nimport {SafeCast} from \\\"../../utils/math/SafeCast.sol\\\";\\nimport {Time} from \\\"../../utils/types/Time.sol\\\";\\n\\n/**\\n * @dev Extension of {Governor} for voting weight extraction from an {ERC20Votes} token, or since v4.5 an {ERC721Votes}\\n * token.\\n */\\nabstract contract GovernorVotes is Governor {\\n IERC5805 private immutable _token;\\n\\n constructor(IVotes tokenAddress) {\\n _token = IERC5805(address(tokenAddress));\\n }\\n\\n /**\\n * @dev The token that voting power is sourced from.\\n */\\n function token() public view virtual returns (IERC5805) {\\n return _token;\\n }\\n\\n /**\\n * @dev Clock (as specified in ERC-6372) is set to match the token's clock. Fallback to block numbers if the token\\n * does not implement ERC-6372.\\n */\\n function clock() public view virtual override returns (uint48) {\\n try token().clock() returns (uint48 timepoint) {\\n return timepoint;\\n } catch {\\n return Time.blockNumber();\\n }\\n }\\n\\n /**\\n * @dev Machine-readable description of the clock as specified in ERC-6372.\\n */\\n // solhint-disable-next-line func-name-mixedcase\\n function CLOCK_MODE() public view virtual override returns (string memory) {\\n try token().CLOCK_MODE() returns (string memory clockmode) {\\n return clockmode;\\n } catch {\\n return \\\"mode=blocknumber&from=default\\\";\\n }\\n }\\n\\n /**\\n * Read the voting weight from the token's built in snapshot mechanism (see {Governor-_getVotes}).\\n */\\n function _getVotes(\\n address account,\\n uint256 timepoint,\\n bytes memory /*params*/\\n ) internal view virtual override returns (uint256) {\\n return token().getPastVotes(account, timepoint);\\n }\\n}\\n\",\"keccak256\":\"0x6fc0e9e0c3ed137dc2281a120cdc01b92010a26e6fd5fc4e6af08fc0f28bdb9e\",\"license\":\"MIT\"},\"@openzeppelin/contracts/governance/extensions/GovernorVotesQuorumFraction.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (governance/extensions/GovernorVotesQuorumFraction.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {GovernorVotes} from \\\"./GovernorVotes.sol\\\";\\nimport {SafeCast} from \\\"../../utils/math/SafeCast.sol\\\";\\nimport {Checkpoints} from \\\"../../utils/structs/Checkpoints.sol\\\";\\n\\n/**\\n * @dev Extension of {Governor} for voting weight extraction from an {ERC20Votes} token and a quorum expressed as a\\n * fraction of the total supply.\\n */\\nabstract contract GovernorVotesQuorumFraction is GovernorVotes {\\n using Checkpoints for Checkpoints.Trace208;\\n\\n Checkpoints.Trace208 private _quorumNumeratorHistory;\\n\\n event QuorumNumeratorUpdated(uint256 oldQuorumNumerator, uint256 newQuorumNumerator);\\n\\n /**\\n * @dev The quorum set is not a valid fraction.\\n */\\n error GovernorInvalidQuorumFraction(uint256 quorumNumerator, uint256 quorumDenominator);\\n\\n /**\\n * @dev Initialize quorum as a fraction of the token's total supply.\\n *\\n * The fraction is specified as `numerator / denominator`. By default the denominator is 100, so quorum is\\n * specified as a percent: a numerator of 10 corresponds to quorum being 10% of total supply. The denominator can be\\n * customized by overriding {quorumDenominator}.\\n */\\n constructor(uint256 quorumNumeratorValue) {\\n _updateQuorumNumerator(quorumNumeratorValue);\\n }\\n\\n /**\\n * @dev Returns the current quorum numerator. See {quorumDenominator}.\\n */\\n function quorumNumerator() public view virtual returns (uint256) {\\n return _quorumNumeratorHistory.latest();\\n }\\n\\n /**\\n * @dev Returns the quorum numerator at a specific timepoint. See {quorumDenominator}.\\n */\\n function quorumNumerator(uint256 timepoint) public view virtual returns (uint256) {\\n uint256 length = _quorumNumeratorHistory._checkpoints.length;\\n\\n // Optimistic search, check the latest checkpoint\\n Checkpoints.Checkpoint208 storage latest = _quorumNumeratorHistory._checkpoints[length - 1];\\n uint48 latestKey = latest._key;\\n uint208 latestValue = latest._value;\\n if (latestKey <= timepoint) {\\n return latestValue;\\n }\\n\\n // Otherwise, do the binary search\\n return _quorumNumeratorHistory.upperLookupRecent(SafeCast.toUint48(timepoint));\\n }\\n\\n /**\\n * @dev Returns the quorum denominator. Defaults to 100, but may be overridden.\\n */\\n function quorumDenominator() public view virtual returns (uint256) {\\n return 100;\\n }\\n\\n /**\\n * @dev Returns the quorum for a timepoint, in terms of number of votes: `supply * numerator / denominator`.\\n */\\n function quorum(uint256 timepoint) public view virtual override returns (uint256) {\\n return (token().getPastTotalSupply(timepoint) * quorumNumerator(timepoint)) / quorumDenominator();\\n }\\n\\n /**\\n * @dev Changes the quorum numerator.\\n *\\n * Emits a {QuorumNumeratorUpdated} event.\\n *\\n * Requirements:\\n *\\n * - Must be called through a governance proposal.\\n * - New numerator must be smaller or equal to the denominator.\\n */\\n function updateQuorumNumerator(uint256 newQuorumNumerator) external virtual onlyGovernance {\\n _updateQuorumNumerator(newQuorumNumerator);\\n }\\n\\n /**\\n * @dev Changes the quorum numerator.\\n *\\n * Emits a {QuorumNumeratorUpdated} event.\\n *\\n * Requirements:\\n *\\n * - New numerator must be smaller or equal to the denominator.\\n */\\n function _updateQuorumNumerator(uint256 newQuorumNumerator) internal virtual {\\n uint256 denominator = quorumDenominator();\\n if (newQuorumNumerator > denominator) {\\n revert GovernorInvalidQuorumFraction(newQuorumNumerator, denominator);\\n }\\n\\n uint256 oldQuorumNumerator = quorumNumerator();\\n _quorumNumeratorHistory.push(clock(), SafeCast.toUint208(newQuorumNumerator));\\n\\n emit QuorumNumeratorUpdated(oldQuorumNumerator, newQuorumNumerator);\\n }\\n}\\n\",\"keccak256\":\"0x5b5cdb361ed018c0162942d673c17e187c1a52ded2ce4f41e8a3f3f5d1656e00\",\"license\":\"MIT\"},\"@openzeppelin/contracts/governance/utils/IVotes.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (governance/utils/IVotes.sol)\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Common interface for {ERC20Votes}, {ERC721Votes}, and other {Votes}-enabled contracts.\\n */\\ninterface IVotes {\\n /**\\n * @dev The signature used has expired.\\n */\\n error VotesExpiredSignature(uint256 expiry);\\n\\n /**\\n * @dev Emitted when an account changes their delegate.\\n */\\n event DelegateChanged(address indexed delegator, address indexed fromDelegate, address indexed toDelegate);\\n\\n /**\\n * @dev Emitted when a token transfer or delegate change results in changes to a delegate's number of voting units.\\n */\\n event DelegateVotesChanged(address indexed delegate, uint256 previousVotes, uint256 newVotes);\\n\\n /**\\n * @dev Returns the current amount of votes that `account` has.\\n */\\n function getVotes(address account) external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of votes that `account` had at a specific moment in the past. If the `clock()` is\\n * configured to use block numbers, this will return the value at the end of the corresponding block.\\n */\\n function getPastVotes(address account, uint256 timepoint) external view returns (uint256);\\n\\n /**\\n * @dev Returns the total supply of votes available at a specific moment in the past. If the `clock()` is\\n * configured to use block numbers, this will return the value at the end of the corresponding block.\\n *\\n * NOTE: This value is the sum of all available votes, which is not necessarily the sum of all delegated votes.\\n * Votes that have not been delegated are still part of total supply, even though they would not participate in a\\n * vote.\\n */\\n function getPastTotalSupply(uint256 timepoint) external view returns (uint256);\\n\\n /**\\n * @dev Returns the delegate that `account` has chosen.\\n */\\n function delegates(address account) external view returns (address);\\n\\n /**\\n * @dev Delegates votes from the sender to `delegatee`.\\n */\\n function delegate(address delegatee) external;\\n\\n /**\\n * @dev Delegates votes from signer to `delegatee`.\\n */\\n function delegateBySig(address delegatee, uint256 nonce, uint256 expiry, uint8 v, bytes32 r, bytes32 s) external;\\n}\\n\",\"keccak256\":\"0x5e2b397ae88fd5c68e4f6762eb9f65f65c36702eb57796495f471d024ce70947\",\"license\":\"MIT\"},\"@openzeppelin/contracts/interfaces/IERC1271.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (interfaces/IERC1271.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Interface of the ERC-1271 standard signature validation method for\\n * contracts as defined in https://eips.ethereum.org/EIPS/eip-1271[ERC-1271].\\n */\\ninterface IERC1271 {\\n /**\\n * @dev Should return whether the signature provided is valid for the provided data\\n * @param hash Hash of the data to be signed\\n * @param signature Signature byte array associated with _data\\n */\\n function isValidSignature(bytes32 hash, bytes memory signature) external view returns (bytes4 magicValue);\\n}\\n\",\"keccak256\":\"0x4aaaf1c0737dd16e81f0d2b9833c549747a5ede6873bf1444bc72aa572d03e98\",\"license\":\"MIT\"},\"@openzeppelin/contracts/interfaces/IERC165.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC165.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {IERC165} from \\\"../utils/introspection/IERC165.sol\\\";\\n\",\"keccak256\":\"0xde7e9fd9aee8d4f40772f96bb3b58836cbc6dfc0227014a061947f8821ea9724\",\"license\":\"MIT\"},\"@openzeppelin/contracts/interfaces/IERC5267.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC5267.sol)\\n\\npragma solidity ^0.8.20;\\n\\ninterface IERC5267 {\\n /**\\n * @dev MAY be emitted to signal that the domain could have changed.\\n */\\n event EIP712DomainChanged();\\n\\n /**\\n * @dev returns the fields and values that describe the domain separator used by this contract for EIP-712\\n * signature.\\n */\\n function eip712Domain()\\n external\\n view\\n returns (\\n bytes1 fields,\\n string memory name,\\n string memory version,\\n uint256 chainId,\\n address verifyingContract,\\n bytes32 salt,\\n uint256[] memory extensions\\n );\\n}\\n\",\"keccak256\":\"0x92aa1df62dc3d33f1656d63bede0923e0df0b706ad4137c8b10b0a8fe549fd92\",\"license\":\"MIT\"},\"@openzeppelin/contracts/interfaces/IERC5805.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC5805.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {IVotes} from \\\"../governance/utils/IVotes.sol\\\";\\nimport {IERC6372} from \\\"./IERC6372.sol\\\";\\n\\ninterface IERC5805 is IERC6372, IVotes {}\\n\",\"keccak256\":\"0x4b9b89f91adbb7d3574f85394754cfb08c5b4eafca8a7061e2094a019ab8f818\",\"license\":\"MIT\"},\"@openzeppelin/contracts/interfaces/IERC6372.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC6372.sol)\\n\\npragma solidity ^0.8.20;\\n\\ninterface IERC6372 {\\n /**\\n * @dev Clock used for flagging checkpoints. Can be overridden to implement timestamp based checkpoints (and voting).\\n */\\n function clock() external view returns (uint48);\\n\\n /**\\n * @dev Description of the clock\\n */\\n // solhint-disable-next-line func-name-mixedcase\\n function CLOCK_MODE() external view returns (string memory);\\n}\\n\",\"keccak256\":\"0xeb2857b7dafb7e0d8526dbfe794e6c047df2851c9e6ee91dc4a55f3c34af5d33\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC1155/IERC1155Receiver.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC1155/IERC1155Receiver.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {IERC165} from \\\"../../utils/introspection/IERC165.sol\\\";\\n\\n/**\\n * @dev Interface that must be implemented by smart contracts in order to receive\\n * ERC-1155 token transfers.\\n */\\ninterface IERC1155Receiver is IERC165 {\\n /**\\n * @dev Handles the receipt of a single ERC-1155 token type. This function is\\n * called at the end of a `safeTransferFrom` after the balance has been updated.\\n *\\n * NOTE: To accept the transfer, this must return\\n * `bytes4(keccak256(\\\"onERC1155Received(address,address,uint256,uint256,bytes)\\\"))`\\n * (i.e. 0xf23a6e61, or its own function selector).\\n *\\n * @param operator The address which initiated the transfer (i.e. msg.sender)\\n * @param from The address which previously owned the token\\n * @param id The ID of the token being transferred\\n * @param value The amount of tokens being transferred\\n * @param data Additional data with no specified format\\n * @return `bytes4(keccak256(\\\"onERC1155Received(address,address,uint256,uint256,bytes)\\\"))` if transfer is allowed\\n */\\n function onERC1155Received(\\n address operator,\\n address from,\\n uint256 id,\\n uint256 value,\\n bytes calldata data\\n ) external returns (bytes4);\\n\\n /**\\n * @dev Handles the receipt of a multiple ERC-1155 token types. This function\\n * is called at the end of a `safeBatchTransferFrom` after the balances have\\n * been updated.\\n *\\n * NOTE: To accept the transfer(s), this must return\\n * `bytes4(keccak256(\\\"onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)\\\"))`\\n * (i.e. 0xbc197c81, or its own function selector).\\n *\\n * @param operator The address which initiated the batch transfer (i.e. msg.sender)\\n * @param from The address which previously owned the token\\n * @param ids An array containing ids of each token being transferred (order and length must match values array)\\n * @param values An array containing amounts of each token being transferred (order and length must match ids array)\\n * @param data Additional data with no specified format\\n * @return `bytes4(keccak256(\\\"onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)\\\"))` if transfer is allowed\\n */\\n function onERC1155BatchReceived(\\n address operator,\\n address from,\\n uint256[] calldata ids,\\n uint256[] calldata values,\\n bytes calldata data\\n ) external returns (bytes4);\\n}\\n\",\"keccak256\":\"0x61a23d601c2ab69dd726ac55058604cbda98e1d728ba31a51c379a3f9eeea715\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC721/IERC721Receiver.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @title ERC-721 token receiver interface\\n * @dev Interface for any contract that wants to support safeTransfers\\n * from ERC-721 asset contracts.\\n */\\ninterface IERC721Receiver {\\n /**\\n * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom}\\n * by `operator` from `from`, this function is called.\\n *\\n * It must return its Solidity selector to confirm the token transfer.\\n * If any other value is returned or the interface is not implemented by the recipient, the transfer will be\\n * reverted.\\n *\\n * The selector can be obtained in Solidity with `IERC721Receiver.onERC721Received.selector`.\\n */\\n function onERC721Received(\\n address operator,\\n address from,\\n uint256 tokenId,\\n bytes calldata data\\n ) external returns (bytes4);\\n}\\n\",\"keccak256\":\"0xb5afb8e8eebc4d1c6404df2f5e1e6d2c3d24fd01e5dfc855314951ecfaae462d\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {Errors} from \\\"./Errors.sol\\\";\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev There's no code at `target` (it is not a contract).\\n */\\n error AddressEmptyCode(address target);\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.8.20/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n if (address(this).balance < amount) {\\n revert Errors.InsufficientBalance(address(this).balance, amount);\\n }\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n if (!success) {\\n revert Errors.FailedCall();\\n }\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason or custom error, it is bubbled\\n * up by this function (like regular Solidity function calls). However, if\\n * the call reverted with no returned reason, this function reverts with a\\n * {Errors.FailedCall} error.\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n */\\n function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {\\n if (address(this).balance < value) {\\n revert Errors.InsufficientBalance(address(this).balance, value);\\n }\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResultFromTarget(target, success, returndata);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResultFromTarget(target, success, returndata);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResultFromTarget(target, success, returndata);\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call to smart-contract was successful, and reverts if the target\\n * was not a contract or bubbling up the revert reason (falling back to {Errors.FailedCall}) in case\\n * of an unsuccessful call.\\n */\\n function verifyCallResultFromTarget(\\n address target,\\n bool success,\\n bytes memory returndata\\n ) internal view returns (bytes memory) {\\n if (!success) {\\n _revert(returndata);\\n } else {\\n // only check if target is a contract if the call was successful and the return data is empty\\n // otherwise we already know that it was a contract\\n if (returndata.length == 0 && target.code.length == 0) {\\n revert AddressEmptyCode(target);\\n }\\n return returndata;\\n }\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call was successful, and reverts if it wasn't, either by bubbling the\\n * revert reason or with a default {Errors.FailedCall} error.\\n */\\n function verifyCallResult(bool success, bytes memory returndata) internal pure returns (bytes memory) {\\n if (!success) {\\n _revert(returndata);\\n } else {\\n return returndata;\\n }\\n }\\n\\n /**\\n * @dev Reverts with returndata if present. Otherwise reverts with {Errors.FailedCall}.\\n */\\n function _revert(bytes memory returndata) private pure {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n assembly (\\\"memory-safe\\\") {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert Errors.FailedCall();\\n }\\n }\\n}\\n\",\"keccak256\":\"0x9d8da059267bac779a2dbbb9a26c2acf00ca83085e105d62d5d4ef96054a47f5\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)\\n\\npragma solidity ^0.8.20;\\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\":\"0x493033a8d1b176a037b2cc6a04dad01a5c157722049bbecf632ca876224dd4b2\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Errors.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/Errors.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Collection of common custom errors used in multiple contracts\\n *\\n * IMPORTANT: Backwards compatibility is not guaranteed in future versions of the library.\\n * It is recommended to avoid relying on the error API for critical functionality.\\n *\\n * _Available since v5.1._\\n */\\nlibrary Errors {\\n /**\\n * @dev The ETH balance of the account is not enough to perform the operation.\\n */\\n error InsufficientBalance(uint256 balance, uint256 needed);\\n\\n /**\\n * @dev A call to an address target failed. The target may have reverted.\\n */\\n error FailedCall();\\n\\n /**\\n * @dev The deployment failed.\\n */\\n error FailedDeployment();\\n\\n /**\\n * @dev A necessary precompile is missing.\\n */\\n error MissingPrecompile(address);\\n}\\n\",\"keccak256\":\"0x6afa713bfd42cf0f7656efa91201007ac465e42049d7de1d50753a373648c123\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Nonces.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/Nonces.sol)\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Provides tracking nonces for addresses. Nonces will only increment.\\n */\\nabstract contract Nonces {\\n /**\\n * @dev The nonce used for an `account` is not the expected current nonce.\\n */\\n error InvalidAccountNonce(address account, uint256 currentNonce);\\n\\n mapping(address account => uint256) private _nonces;\\n\\n /**\\n * @dev Returns the next unused nonce for an address.\\n */\\n function nonces(address owner) public view virtual returns (uint256) {\\n return _nonces[owner];\\n }\\n\\n /**\\n * @dev Consumes a nonce.\\n *\\n * Returns the current value and increments nonce.\\n */\\n function _useNonce(address owner) internal virtual returns (uint256) {\\n // For each account, the nonce has an initial value of 0, can only be incremented by one, and cannot be\\n // decremented or reset. This guarantees that the nonce never overflows.\\n unchecked {\\n // It is important to do x++ and not ++x here.\\n return _nonces[owner]++;\\n }\\n }\\n\\n /**\\n * @dev Same as {_useNonce} but checking that `nonce` is the next valid for `owner`.\\n */\\n function _useCheckedNonce(address owner, uint256 nonce) internal virtual {\\n uint256 current = _useNonce(owner);\\n if (nonce != current) {\\n revert InvalidAccountNonce(owner, current);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x0082767004fca261c332e9ad100868327a863a88ef724e844857128845ab350f\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Panic.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/Panic.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Helper library for emitting standardized panic codes.\\n *\\n * ```solidity\\n * contract Example {\\n * using Panic for uint256;\\n *\\n * // Use any of the declared internal constants\\n * function foo() { Panic.GENERIC.panic(); }\\n *\\n * // Alternatively\\n * function foo() { Panic.panic(Panic.GENERIC); }\\n * }\\n * ```\\n *\\n * Follows the list from https://github.com/ethereum/solidity/blob/v0.8.24/libsolutil/ErrorCodes.h[libsolutil].\\n *\\n * _Available since v5.1._\\n */\\n// slither-disable-next-line unused-state\\nlibrary Panic {\\n /// @dev generic / unspecified error\\n uint256 internal constant GENERIC = 0x00;\\n /// @dev used by the assert() builtin\\n uint256 internal constant ASSERT = 0x01;\\n /// @dev arithmetic underflow or overflow\\n uint256 internal constant UNDER_OVERFLOW = 0x11;\\n /// @dev division or modulo by zero\\n uint256 internal constant DIVISION_BY_ZERO = 0x12;\\n /// @dev enum conversion error\\n uint256 internal constant ENUM_CONVERSION_ERROR = 0x21;\\n /// @dev invalid encoding in storage\\n uint256 internal constant STORAGE_ENCODING_ERROR = 0x22;\\n /// @dev empty array pop\\n uint256 internal constant EMPTY_ARRAY_POP = 0x31;\\n /// @dev array out of bounds access\\n uint256 internal constant ARRAY_OUT_OF_BOUNDS = 0x32;\\n /// @dev resource error (too large allocation or too large array)\\n uint256 internal constant RESOURCE_ERROR = 0x41;\\n /// @dev calling invalid internal function\\n uint256 internal constant INVALID_INTERNAL_FUNCTION = 0x51;\\n\\n /// @dev Reverts with a panic code. Recommended to use with\\n /// the internal constants with predefined codes.\\n function panic(uint256 code) internal pure {\\n assembly (\\\"memory-safe\\\") {\\n mstore(0x00, 0x4e487b71)\\n mstore(0x20, code)\\n revert(0x1c, 0x24)\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf7fe324703a64fc51702311dc51562d5cb1497734f074e4f483bfb6717572d7a\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/ShortStrings.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/ShortStrings.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {StorageSlot} from \\\"./StorageSlot.sol\\\";\\n\\n// | string | 0xAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA |\\n// | length | 0x BB |\\ntype ShortString is bytes32;\\n\\n/**\\n * @dev This library provides functions to convert short memory strings\\n * into a `ShortString` type that can be used as an immutable variable.\\n *\\n * Strings of arbitrary length can be optimized using this library if\\n * they are short enough (up to 31 bytes) by packing them with their\\n * length (1 byte) in a single EVM word (32 bytes). Additionally, a\\n * fallback mechanism can be used for every other case.\\n *\\n * Usage example:\\n *\\n * ```solidity\\n * contract Named {\\n * using ShortStrings for *;\\n *\\n * ShortString private immutable _name;\\n * string private _nameFallback;\\n *\\n * constructor(string memory contractName) {\\n * _name = contractName.toShortStringWithFallback(_nameFallback);\\n * }\\n *\\n * function name() external view returns (string memory) {\\n * return _name.toStringWithFallback(_nameFallback);\\n * }\\n * }\\n * ```\\n */\\nlibrary ShortStrings {\\n // Used as an identifier for strings longer than 31 bytes.\\n bytes32 private constant FALLBACK_SENTINEL = 0x00000000000000000000000000000000000000000000000000000000000000FF;\\n\\n error StringTooLong(string str);\\n error InvalidShortString();\\n\\n /**\\n * @dev Encode a string of at most 31 chars into a `ShortString`.\\n *\\n * This will trigger a `StringTooLong` error is the input string is too long.\\n */\\n function toShortString(string memory str) internal pure returns (ShortString) {\\n bytes memory bstr = bytes(str);\\n if (bstr.length > 31) {\\n revert StringTooLong(str);\\n }\\n return ShortString.wrap(bytes32(uint256(bytes32(bstr)) | bstr.length));\\n }\\n\\n /**\\n * @dev Decode a `ShortString` back to a \\\"normal\\\" string.\\n */\\n function toString(ShortString sstr) internal pure returns (string memory) {\\n uint256 len = byteLength(sstr);\\n // using `new string(len)` would work locally but is not memory safe.\\n string memory str = new string(32);\\n assembly (\\\"memory-safe\\\") {\\n mstore(str, len)\\n mstore(add(str, 0x20), sstr)\\n }\\n return str;\\n }\\n\\n /**\\n * @dev Return the length of a `ShortString`.\\n */\\n function byteLength(ShortString sstr) internal pure returns (uint256) {\\n uint256 result = uint256(ShortString.unwrap(sstr)) & 0xFF;\\n if (result > 31) {\\n revert InvalidShortString();\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Encode a string into a `ShortString`, or write it to storage if it is too long.\\n */\\n function toShortStringWithFallback(string memory value, string storage store) internal returns (ShortString) {\\n if (bytes(value).length < 32) {\\n return toShortString(value);\\n } else {\\n StorageSlot.getStringSlot(store).value = value;\\n return ShortString.wrap(FALLBACK_SENTINEL);\\n }\\n }\\n\\n /**\\n * @dev Decode a string that was encoded to `ShortString` or written to storage using {setWithFallback}.\\n */\\n function toStringWithFallback(ShortString value, string storage store) internal pure returns (string memory) {\\n if (ShortString.unwrap(value) != FALLBACK_SENTINEL) {\\n return toString(value);\\n } else {\\n return store;\\n }\\n }\\n\\n /**\\n * @dev Return the length of a string that was encoded to `ShortString` or written to storage using\\n * {setWithFallback}.\\n *\\n * WARNING: This will return the \\\"byte length\\\" of the string. This may not reflect the actual length in terms of\\n * actual characters as the UTF-8 encoding of a single character can span over multiple bytes.\\n */\\n function byteLengthWithFallback(ShortString value, string storage store) internal view returns (uint256) {\\n if (ShortString.unwrap(value) != FALLBACK_SENTINEL) {\\n return byteLength(value);\\n } else {\\n return bytes(store).length;\\n }\\n }\\n}\\n\",\"keccak256\":\"0x7d94fa0af099a2172eb01f9c8a8a443cbe7e0e43654841563e4e09968efdb549\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/StorageSlot.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/StorageSlot.sol)\\n// This file was procedurally generated from scripts/generate/templates/StorageSlot.js.\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Library for reading and writing primitive types to specific storage slots.\\n *\\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\\n * This library helps with reading and writing to such slots without the need for inline assembly.\\n *\\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\\n *\\n * Example usage to set ERC-1967 implementation slot:\\n * ```solidity\\n * contract ERC1967 {\\n * // Define the slot. Alternatively, use the SlotDerivation library to derive the slot.\\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n *\\n * function _getImplementation() internal view returns (address) {\\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n * }\\n *\\n * function _setImplementation(address newImplementation) internal {\\n * require(newImplementation.code.length > 0);\\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n * }\\n * }\\n * ```\\n *\\n * TIP: Consider using this library along with {SlotDerivation}.\\n */\\nlibrary StorageSlot {\\n struct AddressSlot {\\n address value;\\n }\\n\\n struct BooleanSlot {\\n bool value;\\n }\\n\\n struct Bytes32Slot {\\n bytes32 value;\\n }\\n\\n struct Uint256Slot {\\n uint256 value;\\n }\\n\\n struct Int256Slot {\\n int256 value;\\n }\\n\\n struct StringSlot {\\n string value;\\n }\\n\\n struct BytesSlot {\\n bytes value;\\n }\\n\\n /**\\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\\n */\\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\\n assembly (\\\"memory-safe\\\") {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns a `BooleanSlot` with member `value` located at `slot`.\\n */\\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\\n assembly (\\\"memory-safe\\\") {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns a `Bytes32Slot` with member `value` located at `slot`.\\n */\\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\\n assembly (\\\"memory-safe\\\") {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns a `Uint256Slot` with member `value` located at `slot`.\\n */\\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\\n assembly (\\\"memory-safe\\\") {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns a `Int256Slot` with member `value` located at `slot`.\\n */\\n function getInt256Slot(bytes32 slot) internal pure returns (Int256Slot storage r) {\\n assembly (\\\"memory-safe\\\") {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns a `StringSlot` with member `value` located at `slot`.\\n */\\n function getStringSlot(bytes32 slot) internal pure returns (StringSlot storage r) {\\n assembly (\\\"memory-safe\\\") {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `StringSlot` representation of the string storage pointer `store`.\\n */\\n function getStringSlot(string storage store) internal pure returns (StringSlot storage r) {\\n assembly (\\\"memory-safe\\\") {\\n r.slot := store.slot\\n }\\n }\\n\\n /**\\n * @dev Returns a `BytesSlot` with member `value` located at `slot`.\\n */\\n function getBytesSlot(bytes32 slot) internal pure returns (BytesSlot storage r) {\\n assembly (\\\"memory-safe\\\") {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `BytesSlot` representation of the bytes storage pointer `store`.\\n */\\n function getBytesSlot(bytes storage store) internal pure returns (BytesSlot storage r) {\\n assembly (\\\"memory-safe\\\") {\\n r.slot := store.slot\\n }\\n }\\n}\\n\",\"keccak256\":\"0xcf74f855663ce2ae00ed8352666b7935f6cddea2932fdf2c3ecd30a9b1cd0e97\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Strings.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/Strings.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {Math} from \\\"./math/Math.sol\\\";\\nimport {SignedMath} from \\\"./math/SignedMath.sol\\\";\\n\\n/**\\n * @dev String operations.\\n */\\nlibrary Strings {\\n bytes16 private constant HEX_DIGITS = \\\"0123456789abcdef\\\";\\n uint8 private constant ADDRESS_LENGTH = 20;\\n\\n /**\\n * @dev The `value` string doesn't fit in the specified `length`.\\n */\\n error StringsInsufficientHexLength(uint256 value, uint256 length);\\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 assembly (\\\"memory-safe\\\") {\\n ptr := add(buffer, add(32, length))\\n }\\n while (true) {\\n ptr--;\\n assembly (\\\"memory-safe\\\") {\\n mstore8(ptr, byte(mod(value, 10), HEX_DIGITS))\\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 toStringSigned(int256 value) internal pure returns (string memory) {\\n return string.concat(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 uint256 localValue = value;\\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] = HEX_DIGITS[localValue & 0xf];\\n localValue >>= 4;\\n }\\n if (localValue != 0) {\\n revert StringsInsufficientHexLength(value, length);\\n }\\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\\n * 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 Converts an `address` with fixed length of 20 bytes to its checksummed ASCII `string` hexadecimal\\n * representation, according to EIP-55.\\n */\\n function toChecksumHexString(address addr) internal pure returns (string memory) {\\n bytes memory buffer = bytes(toHexString(addr));\\n\\n // hash the hex part of buffer (skip length + 2 bytes, length 40)\\n uint256 hashValue;\\n assembly (\\\"memory-safe\\\") {\\n hashValue := shr(96, keccak256(add(buffer, 0x22), 40))\\n }\\n\\n for (uint256 i = 41; i > 1; --i) {\\n // possible values for buffer[i] are 48 (0) to 57 (9) and 97 (a) to 102 (f)\\n if (hashValue & 0xf > 7 && uint8(buffer[i]) > 96) {\\n // case shift by xoring with 0x20\\n buffer[i] ^= 0x20;\\n }\\n hashValue >>= 4;\\n }\\n return string(buffer);\\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 bytes(a).length == bytes(b).length && keccak256(bytes(a)) == keccak256(bytes(b));\\n }\\n}\\n\",\"keccak256\":\"0x725209b582291bb83058e3078624b53d15a133f7401c30295e7f3704181d2aed\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/cryptography/ECDSA.sol)\\n\\npragma solidity ^0.8.20;\\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 }\\n\\n /**\\n * @dev The signature derives the `address(0)`.\\n */\\n error ECDSAInvalidSignature();\\n\\n /**\\n * @dev The signature has an invalid length.\\n */\\n error ECDSAInvalidSignatureLength(uint256 length);\\n\\n /**\\n * @dev The signature has an S value that is in the upper half order.\\n */\\n error ECDSAInvalidSignatureS(bytes32 s);\\n\\n /**\\n * @dev Returns the address that signed a hashed message (`hash`) with `signature` or an error. This will not\\n * return address(0) without also returning an error description. Errors are documented using an enum (error type)\\n * and a bytes32 providing additional information about the error.\\n *\\n * If no error is returned, then the address can be used for verification purposes.\\n *\\n * The `ecrecover` EVM precompile 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 {MessageHashUtils-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 function tryRecover(\\n bytes32 hash,\\n bytes memory signature\\n ) internal pure returns (address recovered, RecoverError err, bytes32 errArg) {\\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 assembly (\\\"memory-safe\\\") {\\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, bytes32(signature.length));\\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 precompile 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 {MessageHashUtils-toEthSignedMessageHash} on it.\\n */\\n function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {\\n (address recovered, RecoverError error, bytes32 errorArg) = tryRecover(hash, signature);\\n _throwError(error, errorArg);\\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[ERC-2098 short signatures]\\n */\\n function tryRecover(\\n bytes32 hash,\\n bytes32 r,\\n bytes32 vs\\n ) internal pure returns (address recovered, RecoverError err, bytes32 errArg) {\\n unchecked {\\n bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff);\\n // We do not check for an overflow here since the shift operation results in 0 or 1.\\n uint8 v = uint8((uint256(vs) >> 255) + 27);\\n return tryRecover(hash, v, r, s);\\n }\\n }\\n\\n /**\\n * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately.\\n */\\n function recover(bytes32 hash, bytes32 r, bytes32 vs) internal pure returns (address) {\\n (address recovered, RecoverError error, bytes32 errorArg) = tryRecover(hash, r, vs);\\n _throwError(error, errorArg);\\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 function tryRecover(\\n bytes32 hash,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) internal pure returns (address recovered, RecoverError err, bytes32 errArg) {\\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, s);\\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, bytes32(0));\\n }\\n\\n return (signer, RecoverError.NoError, bytes32(0));\\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, bytes32 errorArg) = tryRecover(hash, v, r, s);\\n _throwError(error, errorArg);\\n return recovered;\\n }\\n\\n /**\\n * @dev Optionally reverts with the corresponding custom error according to the `error` argument provided.\\n */\\n function _throwError(RecoverError error, bytes32 errorArg) private pure {\\n if (error == RecoverError.NoError) {\\n return; // no error: do nothing\\n } else if (error == RecoverError.InvalidSignature) {\\n revert ECDSAInvalidSignature();\\n } else if (error == RecoverError.InvalidSignatureLength) {\\n revert ECDSAInvalidSignatureLength(uint256(errorArg));\\n } else if (error == RecoverError.InvalidSignatureS) {\\n revert ECDSAInvalidSignatureS(errorArg);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x69f54c02b7d81d505910ec198c11ed4c6a728418a868b906b4a0cf29946fda84\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/cryptography/EIP712.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/cryptography/EIP712.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {MessageHashUtils} from \\\"./MessageHashUtils.sol\\\";\\nimport {ShortStrings, ShortString} from \\\"../ShortStrings.sol\\\";\\nimport {IERC5267} from \\\"../../interfaces/IERC5267.sol\\\";\\n\\n/**\\n * @dev https://eips.ethereum.org/EIPS/eip-712[EIP-712] is a standard for hashing and signing of typed structured data.\\n *\\n * The encoding scheme specified in the EIP requires a domain separator and a hash of the typed structured data, whose\\n * encoding is very generic and therefore its implementation in Solidity is not feasible, thus this contract\\n * does not implement the encoding itself. Protocols need to implement the type-specific encoding they need in order to\\n * produce the hash of their typed data using a combination of `abi.encode` and `keccak256`.\\n *\\n * This contract implements the EIP-712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding\\n * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA\\n * ({_hashTypedDataV4}).\\n *\\n * The implementation of the domain separator was designed to be as efficient as possible while still properly updating\\n * the chain id to protect against replay attacks on an eventual fork of the chain.\\n *\\n * NOTE: This contract implements the version of the encoding known as \\\"v4\\\", as implemented by the JSON RPC method\\n * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask].\\n *\\n * NOTE: In the upgradeable version of this contract, the cached values will correspond to the address, and the domain\\n * separator of the implementation contract. This will cause the {_domainSeparatorV4} function to always rebuild the\\n * separator from the immutable values, which is cheaper than accessing a cached version in cold storage.\\n *\\n * @custom:oz-upgrades-unsafe-allow state-variable-immutable\\n */\\nabstract contract EIP712 is IERC5267 {\\n using ShortStrings for *;\\n\\n bytes32 private constant TYPE_HASH =\\n keccak256(\\\"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)\\\");\\n\\n // Cache the domain separator as an immutable value, but also store the chain id that it corresponds to, in order to\\n // invalidate the cached domain separator if the chain id changes.\\n bytes32 private immutable _cachedDomainSeparator;\\n uint256 private immutable _cachedChainId;\\n address private immutable _cachedThis;\\n\\n bytes32 private immutable _hashedName;\\n bytes32 private immutable _hashedVersion;\\n\\n ShortString private immutable _name;\\n ShortString private immutable _version;\\n string private _nameFallback;\\n string private _versionFallback;\\n\\n /**\\n * @dev Initializes the domain separator and parameter caches.\\n *\\n * The meaning of `name` and `version` is specified in\\n * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP-712]:\\n *\\n * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol.\\n * - `version`: the current major version of the signing domain.\\n *\\n * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart\\n * contract upgrade].\\n */\\n constructor(string memory name, string memory version) {\\n _name = name.toShortStringWithFallback(_nameFallback);\\n _version = version.toShortStringWithFallback(_versionFallback);\\n _hashedName = keccak256(bytes(name));\\n _hashedVersion = keccak256(bytes(version));\\n\\n _cachedChainId = block.chainid;\\n _cachedDomainSeparator = _buildDomainSeparator();\\n _cachedThis = address(this);\\n }\\n\\n /**\\n * @dev Returns the domain separator for the current chain.\\n */\\n function _domainSeparatorV4() internal view returns (bytes32) {\\n if (address(this) == _cachedThis && block.chainid == _cachedChainId) {\\n return _cachedDomainSeparator;\\n } else {\\n return _buildDomainSeparator();\\n }\\n }\\n\\n function _buildDomainSeparator() private view returns (bytes32) {\\n return keccak256(abi.encode(TYPE_HASH, _hashedName, _hashedVersion, block.chainid, address(this)));\\n }\\n\\n /**\\n * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this\\n * function returns the hash of the fully encoded EIP712 message for this domain.\\n *\\n * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example:\\n *\\n * ```solidity\\n * bytes32 digest = _hashTypedDataV4(keccak256(abi.encode(\\n * keccak256(\\\"Mail(address to,string contents)\\\"),\\n * mailTo,\\n * keccak256(bytes(mailContents))\\n * )));\\n * address signer = ECDSA.recover(digest, signature);\\n * ```\\n */\\n function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) {\\n return MessageHashUtils.toTypedDataHash(_domainSeparatorV4(), structHash);\\n }\\n\\n /**\\n * @dev See {IERC-5267}.\\n */\\n function eip712Domain()\\n public\\n view\\n virtual\\n returns (\\n bytes1 fields,\\n string memory name,\\n string memory version,\\n uint256 chainId,\\n address verifyingContract,\\n bytes32 salt,\\n uint256[] memory extensions\\n )\\n {\\n return (\\n hex\\\"0f\\\", // 01111\\n _EIP712Name(),\\n _EIP712Version(),\\n block.chainid,\\n address(this),\\n bytes32(0),\\n new uint256[](0)\\n );\\n }\\n\\n /**\\n * @dev The name parameter for the EIP712 domain.\\n *\\n * NOTE: By default this function reads _name which is an immutable value.\\n * It only reads from storage if necessary (in case the value is too large to fit in a ShortString).\\n */\\n // solhint-disable-next-line func-name-mixedcase\\n function _EIP712Name() internal view returns (string memory) {\\n return _name.toStringWithFallback(_nameFallback);\\n }\\n\\n /**\\n * @dev The version parameter for the EIP712 domain.\\n *\\n * NOTE: By default this function reads _version which is an immutable value.\\n * It only reads from storage if necessary (in case the value is too large to fit in a ShortString).\\n */\\n // solhint-disable-next-line func-name-mixedcase\\n function _EIP712Version() internal view returns (string memory) {\\n return _version.toStringWithFallback(_versionFallback);\\n }\\n}\\n\",\"keccak256\":\"0x10eb97d047f8d84fe263a02bb4a656ac6674f6679d74532cc37546289e073a9d\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/cryptography/MessageHashUtils.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/cryptography/MessageHashUtils.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {Strings} from \\\"../Strings.sol\\\";\\n\\n/**\\n * @dev Signature message hash utilities for producing digests to be consumed by {ECDSA} recovery or signing.\\n *\\n * The library provides methods for generating a hash of a message that conforms to the\\n * https://eips.ethereum.org/EIPS/eip-191[ERC-191] and https://eips.ethereum.org/EIPS/eip-712[EIP 712]\\n * specifications.\\n */\\nlibrary MessageHashUtils {\\n /**\\n * @dev Returns the keccak256 digest of an ERC-191 signed data with version\\n * `0x45` (`personal_sign` messages).\\n *\\n * The digest is calculated by prefixing a bytes32 `messageHash` with\\n * `\\\"\\\\x19Ethereum Signed Message:\\\\n32\\\"` and hashing the result. It corresponds with the\\n * hash signed when using the https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] JSON-RPC method.\\n *\\n * NOTE: The `messageHash` parameter is intended to be the result of hashing a raw message with\\n * keccak256, although any bytes32 value can be safely used because the final digest will\\n * be re-hashed.\\n *\\n * See {ECDSA-recover}.\\n */\\n function toEthSignedMessageHash(bytes32 messageHash) internal pure returns (bytes32 digest) {\\n assembly (\\\"memory-safe\\\") {\\n mstore(0x00, \\\"\\\\x19Ethereum Signed Message:\\\\n32\\\") // 32 is the bytes-length of messageHash\\n mstore(0x1c, messageHash) // 0x1c (28) is the length of the prefix\\n digest := keccak256(0x00, 0x3c) // 0x3c is the length of the prefix (0x1c) + messageHash (0x20)\\n }\\n }\\n\\n /**\\n * @dev Returns the keccak256 digest of an ERC-191 signed data with version\\n * `0x45` (`personal_sign` messages).\\n *\\n * The digest is calculated by prefixing an arbitrary `message` with\\n * `\\\"\\\\x19Ethereum Signed Message:\\\\n\\\" + len(message)` and hashing the result. It corresponds with the\\n * hash signed when using the https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] JSON-RPC method.\\n *\\n * See {ECDSA-recover}.\\n */\\n function toEthSignedMessageHash(bytes memory message) internal pure returns (bytes32) {\\n return\\n keccak256(bytes.concat(\\\"\\\\x19Ethereum Signed Message:\\\\n\\\", bytes(Strings.toString(message.length)), message));\\n }\\n\\n /**\\n * @dev Returns the keccak256 digest of an ERC-191 signed data with version\\n * `0x00` (data with intended validator).\\n *\\n * The digest is calculated by prefixing an arbitrary `data` with `\\\"\\\\x19\\\\x00\\\"` and the intended\\n * `validator` address. Then hashing the result.\\n *\\n * See {ECDSA-recover}.\\n */\\n function toDataWithIntendedValidatorHash(address validator, bytes memory data) internal pure returns (bytes32) {\\n return keccak256(abi.encodePacked(hex\\\"19_00\\\", validator, data));\\n }\\n\\n /**\\n * @dev Returns the keccak256 digest of an EIP-712 typed data (ERC-191 version `0x01`).\\n *\\n * The digest is calculated from a `domainSeparator` and a `structHash`, by prefixing them with\\n * `\\\\x19\\\\x01` and hashing the result. It corresponds to the hash signed by the\\n * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`] JSON-RPC method as part of EIP-712.\\n *\\n * See {ECDSA-recover}.\\n */\\n function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32 digest) {\\n assembly (\\\"memory-safe\\\") {\\n let ptr := mload(0x40)\\n mstore(ptr, hex\\\"19_01\\\")\\n mstore(add(ptr, 0x02), domainSeparator)\\n mstore(add(ptr, 0x22), structHash)\\n digest := keccak256(ptr, 0x42)\\n }\\n }\\n}\\n\",\"keccak256\":\"0x4515543bc4c78561f6bea83ecfdfc3dead55bd59858287d682045b11de1ae575\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/cryptography/SignatureChecker.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/cryptography/SignatureChecker.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {ECDSA} from \\\"./ECDSA.sol\\\";\\nimport {IERC1271} from \\\"../../interfaces/IERC1271.sol\\\";\\n\\n/**\\n * @dev Signature verification helper that can be used instead of `ECDSA.recover` to seamlessly support both ECDSA\\n * signatures from externally owned accounts (EOAs) as well as ERC-1271 signatures from smart contract wallets like\\n * Argent and Safe Wallet (previously Gnosis Safe).\\n */\\nlibrary SignatureChecker {\\n /**\\n * @dev Checks if a signature is valid for a given signer and data hash. If the signer is a smart contract, the\\n * signature is validated against that smart contract using ERC-1271, otherwise it's validated using `ECDSA.recover`.\\n *\\n * NOTE: Unlike ECDSA signatures, contract signatures are revocable, and the outcome of this function can thus\\n * change through time. It could return true at block N and false at block N+1 (or the opposite).\\n */\\n function isValidSignatureNow(address signer, bytes32 hash, bytes memory signature) internal view returns (bool) {\\n if (signer.code.length == 0) {\\n (address recovered, ECDSA.RecoverError err, ) = ECDSA.tryRecover(hash, signature);\\n return err == ECDSA.RecoverError.NoError && recovered == signer;\\n } else {\\n return isValidERC1271SignatureNow(signer, hash, signature);\\n }\\n }\\n\\n /**\\n * @dev Checks if a signature is valid for a given signer and data hash. The signature is validated\\n * against the signer smart contract using ERC-1271.\\n *\\n * NOTE: Unlike ECDSA signatures, contract signatures are revocable, and the outcome of this function can thus\\n * change through time. It could return true at block N and false at block N+1 (or the opposite).\\n */\\n function isValidERC1271SignatureNow(\\n address signer,\\n bytes32 hash,\\n bytes memory signature\\n ) internal view returns (bool) {\\n (bool success, bytes memory result) = signer.staticcall(\\n abi.encodeCall(IERC1271.isValidSignature, (hash, signature))\\n );\\n return (success &&\\n result.length >= 32 &&\\n abi.decode(result, (bytes32)) == bytes32(IERC1271.isValidSignature.selector));\\n }\\n}\\n\",\"keccak256\":\"0xbdc3bb48ccedb818cd75a6d74a16df55a822e9f6d3cc54c59f576f10aab67b5f\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/introspection/ERC165.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/introspection/ERC165.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {IERC165} from \\\"./IERC165.sol\\\";\\n\\n/**\\n * @dev Implementation of the {IERC165} interface.\\n *\\n * Contracts that want to implement ERC-165 should inherit from this contract and override {supportsInterface} to check\\n * for the additional interface id that will be supported. For example:\\n *\\n * ```solidity\\n * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\\n * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);\\n * }\\n * ```\\n */\\nabstract contract ERC165 is IERC165 {\\n /**\\n * @dev See {IERC165-supportsInterface}.\\n */\\n function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) {\\n return interfaceId == type(IERC165).interfaceId;\\n }\\n}\\n\",\"keccak256\":\"0xddce8e17e3d3f9ed818b4f4c4478a8262aab8b11ed322f1bf5ed705bb4bd97fa\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/introspection/IERC165.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/introspection/IERC165.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Interface of the ERC-165 standard, as defined in the\\n * https://eips.ethereum.org/EIPS/eip-165[ERC].\\n *\\n * Implementers can declare support of contract interfaces, which can then be\\n * queried by others ({ERC165Checker}).\\n *\\n * For an implementation, see {ERC165}.\\n */\\ninterface IERC165 {\\n /**\\n * @dev Returns true if this contract implements the interface defined by\\n * `interfaceId`. See the corresponding\\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[ERC section]\\n * to learn more about how these ids are created.\\n *\\n * This function call must use less than 30 000 gas.\\n */\\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x79796192ec90263f21b464d5bc90b777a525971d3de8232be80d9c4f9fb353b8\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/math/Math.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/math/Math.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {Panic} from \\\"../Panic.sol\\\";\\nimport {SafeCast} from \\\"./SafeCast.sol\\\";\\n\\n/**\\n * @dev Standard math utilities missing in the Solidity language.\\n */\\nlibrary Math {\\n enum Rounding {\\n Floor, // Toward negative infinity\\n Ceil, // Toward positive infinity\\n Trunc, // Toward zero\\n Expand // Away from zero\\n }\\n\\n /**\\n * @dev Returns the addition of two unsigned integers, with an success flag (no overflow).\\n */\\n function tryAdd(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\\n unchecked {\\n uint256 c = a + b;\\n if (c < a) return (false, 0);\\n return (true, c);\\n }\\n }\\n\\n /**\\n * @dev Returns the subtraction of two unsigned integers, with an success flag (no overflow).\\n */\\n function trySub(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\\n unchecked {\\n if (b > a) return (false, 0);\\n return (true, a - b);\\n }\\n }\\n\\n /**\\n * @dev Returns the multiplication of two unsigned integers, with an success flag (no overflow).\\n */\\n function tryMul(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\\n unchecked {\\n // Gas optimization: this is cheaper than requiring 'a' not being zero, but the\\n // benefit is lost if 'b' is also tested.\\n // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522\\n if (a == 0) return (true, 0);\\n uint256 c = a * b;\\n if (c / a != b) return (false, 0);\\n return (true, c);\\n }\\n }\\n\\n /**\\n * @dev Returns the division of two unsigned integers, with a success flag (no division by zero).\\n */\\n function tryDiv(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\\n unchecked {\\n if (b == 0) return (false, 0);\\n return (true, a / b);\\n }\\n }\\n\\n /**\\n * @dev Returns the remainder of dividing two unsigned integers, with a success flag (no division by zero).\\n */\\n function tryMod(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\\n unchecked {\\n if (b == 0) return (false, 0);\\n return (true, a % b);\\n }\\n }\\n\\n /**\\n * @dev Branchless ternary evaluation for `a ? b : c`. Gas costs are constant.\\n *\\n * IMPORTANT: This function may reduce bytecode size and consume less gas when used standalone.\\n * However, the compiler may optimize Solidity ternary operations (i.e. `a ? b : c`) to only compute\\n * one branch when needed, making this function more expensive.\\n */\\n function ternary(bool condition, uint256 a, uint256 b) internal pure returns (uint256) {\\n unchecked {\\n // branchless ternary works because:\\n // b ^ (a ^ b) == a\\n // b ^ 0 == b\\n return b ^ ((a ^ b) * SafeCast.toUint(condition));\\n }\\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 ternary(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 ternary(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 towards infinity instead\\n * of rounding towards zero.\\n */\\n function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {\\n if (b == 0) {\\n // Guarantee the same behavior as in a regular Solidity division.\\n Panic.panic(Panic.DIVISION_BY_ZERO);\\n }\\n\\n // The following calculation ensures accurate ceiling division without overflow.\\n // Since a is non-zero, (a - 1) / b will not overflow.\\n // The largest possible result occurs when (a - 1) / b is type(uint256).max,\\n // but the largest value we can obtain is type(uint256).max - 1, which happens\\n // when a = type(uint256).max and b = 1.\\n unchecked {\\n return SafeCast.toUint(a > 0) * ((a - 1) / b + 1);\\n }\\n }\\n\\n /**\\n * @dev Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or\\n * denominator == 0.\\n *\\n * Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv) with further edits by\\n * 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\\u00b2\\u2075\\u2076 and mod 2\\u00b2\\u2075\\u2076 - 1, then use\\n // the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256\\n // variables such that product = prod1 * 2\\u00b2\\u2075\\u2076 + prod0.\\n uint256 prod0 = x * y; // 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 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\\u00b2\\u2075\\u2076. Also prevents denominator == 0.\\n if (denominator <= prod1) {\\n Panic.panic(ternary(denominator == 0, Panic.DIVISION_BY_ZERO, Panic.UNDER_OVERFLOW));\\n }\\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.\\n // Always >= 1. See https://cs.stackexchange.com/q/138556/92363.\\n\\n uint256 twos = denominator & (0 - denominator);\\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\\u00b2\\u2075\\u2076 / 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\\u00b2\\u2075\\u2076. Now that denominator is an odd number, it has an inverse modulo 2\\u00b2\\u2075\\u2076 such\\n // that denominator * inv \\u2261 1 mod 2\\u00b2\\u2075\\u2076. Compute the inverse by starting with a seed that is correct for\\n // four bits. That is, denominator * inv \\u2261 1 mod 2\\u2074.\\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\\n // works in modular arithmetic, doubling the correct bits in each step.\\n inverse *= 2 - denominator * inverse; // inverse mod 2\\u2078\\n inverse *= 2 - denominator * inverse; // inverse mod 2\\u00b9\\u2076\\n inverse *= 2 - denominator * inverse; // inverse mod 2\\u00b3\\u00b2\\n inverse *= 2 - denominator * inverse; // inverse mod 2\\u2076\\u2074\\n inverse *= 2 - denominator * inverse; // inverse mod 2\\u00b9\\u00b2\\u2078\\n inverse *= 2 - denominator * inverse; // inverse mod 2\\u00b2\\u2075\\u2076\\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\\u00b2\\u2075\\u2076. Since the preconditions guarantee that the outcome is\\n // less than 2\\u00b2\\u2075\\u2076, 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 * @dev 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 return mulDiv(x, y, denominator) + SafeCast.toUint(unsignedRoundsUp(rounding) && mulmod(x, y, denominator) > 0);\\n }\\n\\n /**\\n * @dev Calculate the modular multiplicative inverse of a number in Z/nZ.\\n *\\n * If n is a prime, then Z/nZ is a field. In that case all elements are inversible, except 0.\\n * If n is not a prime, then Z/nZ is not a field, and some elements might not be inversible.\\n *\\n * If the input value is not inversible, 0 is returned.\\n *\\n * NOTE: If you know for sure that n is (big) a prime, it may be cheaper to use Fermat's little theorem and get the\\n * inverse using `Math.modExp(a, n - 2, n)`. See {invModPrime}.\\n */\\n function invMod(uint256 a, uint256 n) internal pure returns (uint256) {\\n unchecked {\\n if (n == 0) return 0;\\n\\n // The inverse modulo is calculated using the Extended Euclidean Algorithm (iterative version)\\n // Used to compute integers x and y such that: ax + ny = gcd(a, n).\\n // When the gcd is 1, then the inverse of a modulo n exists and it's x.\\n // ax + ny = 1\\n // ax = 1 + (-y)n\\n // ax \\u2261 1 (mod n) # x is the inverse of a modulo n\\n\\n // If the remainder is 0 the gcd is n right away.\\n uint256 remainder = a % n;\\n uint256 gcd = n;\\n\\n // Therefore the initial coefficients are:\\n // ax + ny = gcd(a, n) = n\\n // 0a + 1n = n\\n int256 x = 0;\\n int256 y = 1;\\n\\n while (remainder != 0) {\\n uint256 quotient = gcd / remainder;\\n\\n (gcd, remainder) = (\\n // The old remainder is the next gcd to try.\\n remainder,\\n // Compute the next remainder.\\n // Can't overflow given that (a % gcd) * (gcd // (a % gcd)) <= gcd\\n // where gcd is at most n (capped to type(uint256).max)\\n gcd - remainder * quotient\\n );\\n\\n (x, y) = (\\n // Increment the coefficient of a.\\n y,\\n // Decrement the coefficient of n.\\n // Can overflow, but the result is casted to uint256 so that the\\n // next value of y is \\\"wrapped around\\\" to a value between 0 and n - 1.\\n x - y * int256(quotient)\\n );\\n }\\n\\n if (gcd != 1) return 0; // No inverse exists.\\n return ternary(x < 0, n - uint256(-x), uint256(x)); // Wrap the result if it's negative.\\n }\\n }\\n\\n /**\\n * @dev Variant of {invMod}. More efficient, but only works if `p` is known to be a prime greater than `2`.\\n *\\n * From https://en.wikipedia.org/wiki/Fermat%27s_little_theorem[Fermat's little theorem], we know that if p is\\n * prime, then `a**(p-1) \\u2261 1 mod p`. As a consequence, we have `a * a**(p-2) \\u2261 1 mod p`, which means that\\n * `a**(p-2)` is the modular multiplicative inverse of a in Fp.\\n *\\n * NOTE: this function does NOT check that `p` is a prime greater than `2`.\\n */\\n function invModPrime(uint256 a, uint256 p) internal view returns (uint256) {\\n unchecked {\\n return Math.modExp(a, p - 2, p);\\n }\\n }\\n\\n /**\\n * @dev Returns the modular exponentiation of the specified base, exponent and modulus (b ** e % m)\\n *\\n * Requirements:\\n * - modulus can't be zero\\n * - underlying staticcall to precompile must succeed\\n *\\n * IMPORTANT: The result is only valid if the underlying call succeeds. When using this function, make\\n * sure the chain you're using it on supports the precompiled contract for modular exponentiation\\n * at address 0x05 as specified in https://eips.ethereum.org/EIPS/eip-198[EIP-198]. Otherwise,\\n * the underlying function will succeed given the lack of a revert, but the result may be incorrectly\\n * interpreted as 0.\\n */\\n function modExp(uint256 b, uint256 e, uint256 m) internal view returns (uint256) {\\n (bool success, uint256 result) = tryModExp(b, e, m);\\n if (!success) {\\n Panic.panic(Panic.DIVISION_BY_ZERO);\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Returns the modular exponentiation of the specified base, exponent and modulus (b ** e % m).\\n * It includes a success flag indicating if the operation succeeded. Operation will be marked as failed if trying\\n * to operate modulo 0 or if the underlying precompile reverted.\\n *\\n * IMPORTANT: The result is only valid if the success flag is true. When using this function, make sure the chain\\n * you're using it on supports the precompiled contract for modular exponentiation at address 0x05 as specified in\\n * https://eips.ethereum.org/EIPS/eip-198[EIP-198]. Otherwise, the underlying function will succeed given the lack\\n * of a revert, but the result may be incorrectly interpreted as 0.\\n */\\n function tryModExp(uint256 b, uint256 e, uint256 m) internal view returns (bool success, uint256 result) {\\n if (m == 0) return (false, 0);\\n assembly (\\\"memory-safe\\\") {\\n let ptr := mload(0x40)\\n // | Offset | Content | Content (Hex) |\\n // |-----------|------------|--------------------------------------------------------------------|\\n // | 0x00:0x1f | size of b | 0x0000000000000000000000000000000000000000000000000000000000000020 |\\n // | 0x20:0x3f | size of e | 0x0000000000000000000000000000000000000000000000000000000000000020 |\\n // | 0x40:0x5f | size of m | 0x0000000000000000000000000000000000000000000000000000000000000020 |\\n // | 0x60:0x7f | value of b | 0x<.............................................................b> |\\n // | 0x80:0x9f | value of e | 0x<.............................................................e> |\\n // | 0xa0:0xbf | value of m | 0x<.............................................................m> |\\n mstore(ptr, 0x20)\\n mstore(add(ptr, 0x20), 0x20)\\n mstore(add(ptr, 0x40), 0x20)\\n mstore(add(ptr, 0x60), b)\\n mstore(add(ptr, 0x80), e)\\n mstore(add(ptr, 0xa0), m)\\n\\n // Given the result < m, it's guaranteed to fit in 32 bytes,\\n // so we can use the memory scratch space located at offset 0.\\n success := staticcall(gas(), 0x05, ptr, 0xc0, 0x00, 0x20)\\n result := mload(0x00)\\n }\\n }\\n\\n /**\\n * @dev Variant of {modExp} that supports inputs of arbitrary length.\\n */\\n function modExp(bytes memory b, bytes memory e, bytes memory m) internal view returns (bytes memory) {\\n (bool success, bytes memory result) = tryModExp(b, e, m);\\n if (!success) {\\n Panic.panic(Panic.DIVISION_BY_ZERO);\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Variant of {tryModExp} that supports inputs of arbitrary length.\\n */\\n function tryModExp(\\n bytes memory b,\\n bytes memory e,\\n bytes memory m\\n ) internal view returns (bool success, bytes memory result) {\\n if (_zeroBytes(m)) return (false, new bytes(0));\\n\\n uint256 mLen = m.length;\\n\\n // Encode call args in result and move the free memory pointer\\n result = abi.encodePacked(b.length, e.length, mLen, b, e, m);\\n\\n assembly (\\\"memory-safe\\\") {\\n let dataPtr := add(result, 0x20)\\n // Write result on top of args to avoid allocating extra memory.\\n success := staticcall(gas(), 0x05, dataPtr, mload(result), dataPtr, mLen)\\n // Overwrite the length.\\n // result.length > returndatasize() is guaranteed because returndatasize() == m.length\\n mstore(result, mLen)\\n // Set the memory pointer after the returned data.\\n mstore(0x40, add(dataPtr, mLen))\\n }\\n }\\n\\n /**\\n * @dev Returns whether the provided byte array is zero.\\n */\\n function _zeroBytes(bytes memory byteArray) private pure returns (bool) {\\n for (uint256 i = 0; i < byteArray.length; ++i) {\\n if (byteArray[i] != 0) {\\n return false;\\n }\\n }\\n return true;\\n }\\n\\n /**\\n * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded\\n * towards zero.\\n *\\n * This method is based on Newton's method for computing square roots; the algorithm is restricted to only\\n * using integer operations.\\n */\\n function sqrt(uint256 a) internal pure returns (uint256) {\\n unchecked {\\n // Take care of easy edge cases when a == 0 or a == 1\\n if (a <= 1) {\\n return a;\\n }\\n\\n // In this function, we use Newton's method to get a root of `f(x) := x\\u00b2 - a`. It involves building a\\n // sequence x_n that converges toward sqrt(a). For each iteration x_n, we also define the error between\\n // the current value as `\\u03b5_n = | x_n - sqrt(a) |`.\\n //\\n // For our first estimation, we consider `e` the smallest power of 2 which is bigger than the square root\\n // of the target. (i.e. `2**(e-1) \\u2264 sqrt(a) < 2**e`). We know that `e \\u2264 128` because `(2\\u00b9\\u00b2\\u2078)\\u00b2 = 2\\u00b2\\u2075\\u2076` is\\n // bigger than any uint256.\\n //\\n // By noticing that\\n // `2**(e-1) \\u2264 sqrt(a) < 2**e \\u2192 (2**(e-1))\\u00b2 \\u2264 a < (2**e)\\u00b2 \\u2192 2**(2*e-2) \\u2264 a < 2**(2*e)`\\n // we can deduce that `e - 1` is `log2(a) / 2`. We can thus compute `x_n = 2**(e-1)` using a method similar\\n // to the msb function.\\n uint256 aa = a;\\n uint256 xn = 1;\\n\\n if (aa >= (1 << 128)) {\\n aa >>= 128;\\n xn <<= 64;\\n }\\n if (aa >= (1 << 64)) {\\n aa >>= 64;\\n xn <<= 32;\\n }\\n if (aa >= (1 << 32)) {\\n aa >>= 32;\\n xn <<= 16;\\n }\\n if (aa >= (1 << 16)) {\\n aa >>= 16;\\n xn <<= 8;\\n }\\n if (aa >= (1 << 8)) {\\n aa >>= 8;\\n xn <<= 4;\\n }\\n if (aa >= (1 << 4)) {\\n aa >>= 4;\\n xn <<= 2;\\n }\\n if (aa >= (1 << 2)) {\\n xn <<= 1;\\n }\\n\\n // We now have x_n such that `x_n = 2**(e-1) \\u2264 sqrt(a) < 2**e = 2 * x_n`. This implies \\u03b5_n \\u2264 2**(e-1).\\n //\\n // We can refine our estimation by noticing that the middle of that interval minimizes the error.\\n // If we move x_n to equal 2**(e-1) + 2**(e-2), then we reduce the error to \\u03b5_n \\u2264 2**(e-2).\\n // This is going to be our x_0 (and \\u03b5_0)\\n xn = (3 * xn) >> 1; // \\u03b5_0 := | x_0 - sqrt(a) | \\u2264 2**(e-2)\\n\\n // From here, Newton's method give us:\\n // x_{n+1} = (x_n + a / x_n) / 2\\n //\\n // One should note that:\\n // x_{n+1}\\u00b2 - a = ((x_n + a / x_n) / 2)\\u00b2 - a\\n // = ((x_n\\u00b2 + a) / (2 * x_n))\\u00b2 - a\\n // = (x_n\\u2074 + 2 * a * x_n\\u00b2 + a\\u00b2) / (4 * x_n\\u00b2) - a\\n // = (x_n\\u2074 + 2 * a * x_n\\u00b2 + a\\u00b2 - 4 * a * x_n\\u00b2) / (4 * x_n\\u00b2)\\n // = (x_n\\u2074 - 2 * a * x_n\\u00b2 + a\\u00b2) / (4 * x_n\\u00b2)\\n // = (x_n\\u00b2 - a)\\u00b2 / (2 * x_n)\\u00b2\\n // = ((x_n\\u00b2 - a) / (2 * x_n))\\u00b2\\n // \\u2265 0\\n // Which proves that for all n \\u2265 1, sqrt(a) \\u2264 x_n\\n //\\n // This gives us the proof of quadratic convergence of the sequence:\\n // \\u03b5_{n+1} = | x_{n+1} - sqrt(a) |\\n // = | (x_n + a / x_n) / 2 - sqrt(a) |\\n // = | (x_n\\u00b2 + a - 2*x_n*sqrt(a)) / (2 * x_n) |\\n // = | (x_n - sqrt(a))\\u00b2 / (2 * x_n) |\\n // = | \\u03b5_n\\u00b2 / (2 * x_n) |\\n // = \\u03b5_n\\u00b2 / | (2 * x_n) |\\n //\\n // For the first iteration, we have a special case where x_0 is known:\\n // \\u03b5_1 = \\u03b5_0\\u00b2 / | (2 * x_0) |\\n // \\u2264 (2**(e-2))\\u00b2 / (2 * (2**(e-1) + 2**(e-2)))\\n // \\u2264 2**(2*e-4) / (3 * 2**(e-1))\\n // \\u2264 2**(e-3) / 3\\n // \\u2264 2**(e-3-log2(3))\\n // \\u2264 2**(e-4.5)\\n //\\n // For the following iterations, we use the fact that, 2**(e-1) \\u2264 sqrt(a) \\u2264 x_n:\\n // \\u03b5_{n+1} = \\u03b5_n\\u00b2 / | (2 * x_n) |\\n // \\u2264 (2**(e-k))\\u00b2 / (2 * 2**(e-1))\\n // \\u2264 2**(2*e-2*k) / 2**e\\n // \\u2264 2**(e-2*k)\\n xn = (xn + a / xn) >> 1; // \\u03b5_1 := | x_1 - sqrt(a) | \\u2264 2**(e-4.5) -- special case, see above\\n xn = (xn + a / xn) >> 1; // \\u03b5_2 := | x_2 - sqrt(a) | \\u2264 2**(e-9) -- general case with k = 4.5\\n xn = (xn + a / xn) >> 1; // \\u03b5_3 := | x_3 - sqrt(a) | \\u2264 2**(e-18) -- general case with k = 9\\n xn = (xn + a / xn) >> 1; // \\u03b5_4 := | x_4 - sqrt(a) | \\u2264 2**(e-36) -- general case with k = 18\\n xn = (xn + a / xn) >> 1; // \\u03b5_5 := | x_5 - sqrt(a) | \\u2264 2**(e-72) -- general case with k = 36\\n xn = (xn + a / xn) >> 1; // \\u03b5_6 := | x_6 - sqrt(a) | \\u2264 2**(e-144) -- general case with k = 72\\n\\n // Because e \\u2264 128 (as discussed during the first estimation phase), we know have reached a precision\\n // \\u03b5_6 \\u2264 2**(e-144) < 1. Given we're operating on integers, then we can ensure that xn is now either\\n // sqrt(a) or sqrt(a) + 1.\\n return xn - SafeCast.toUint(xn > a / xn);\\n }\\n }\\n\\n /**\\n * @dev 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 + SafeCast.toUint(unsignedRoundsUp(rounding) && result * result < a);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 2 of a positive value rounded towards zero.\\n * Returns 0 if given 0.\\n */\\n function log2(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n uint256 exp;\\n unchecked {\\n exp = 128 * SafeCast.toUint(value > (1 << 128) - 1);\\n value >>= exp;\\n result += exp;\\n\\n exp = 64 * SafeCast.toUint(value > (1 << 64) - 1);\\n value >>= exp;\\n result += exp;\\n\\n exp = 32 * SafeCast.toUint(value > (1 << 32) - 1);\\n value >>= exp;\\n result += exp;\\n\\n exp = 16 * SafeCast.toUint(value > (1 << 16) - 1);\\n value >>= exp;\\n result += exp;\\n\\n exp = 8 * SafeCast.toUint(value > (1 << 8) - 1);\\n value >>= exp;\\n result += exp;\\n\\n exp = 4 * SafeCast.toUint(value > (1 << 4) - 1);\\n value >>= exp;\\n result += exp;\\n\\n exp = 2 * SafeCast.toUint(value > (1 << 2) - 1);\\n value >>= exp;\\n result += exp;\\n\\n result += SafeCast.toUint(value > 1);\\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 + SafeCast.toUint(unsignedRoundsUp(rounding) && 1 << result < value);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 10 of a positive value rounded towards zero.\\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 + SafeCast.toUint(unsignedRoundsUp(rounding) && 10 ** result < value);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 256 of a positive value rounded towards zero.\\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 uint256 isGt;\\n unchecked {\\n isGt = SafeCast.toUint(value > (1 << 128) - 1);\\n value >>= isGt * 128;\\n result += isGt * 16;\\n\\n isGt = SafeCast.toUint(value > (1 << 64) - 1);\\n value >>= isGt * 64;\\n result += isGt * 8;\\n\\n isGt = SafeCast.toUint(value > (1 << 32) - 1);\\n value >>= isGt * 32;\\n result += isGt * 4;\\n\\n isGt = SafeCast.toUint(value > (1 << 16) - 1);\\n value >>= isGt * 16;\\n result += isGt * 2;\\n\\n result += SafeCast.toUint(value > (1 << 8) - 1);\\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 + SafeCast.toUint(unsignedRoundsUp(rounding) && 1 << (result << 3) < value);\\n }\\n }\\n\\n /**\\n * @dev Returns whether a provided rounding mode is considered rounding up for unsigned integers.\\n */\\n function unsignedRoundsUp(Rounding rounding) internal pure returns (bool) {\\n return uint8(rounding) % 2 == 1;\\n }\\n}\\n\",\"keccak256\":\"0xa00be322d7db5786750ce0ac7e2f5b633ac30a5ed5fa1ced1e74acfc19acecea\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/math/SafeCast.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/math/SafeCast.sol)\\n// This file was procedurally generated from scripts/generate/templates/SafeCast.js.\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Wrappers over Solidity's uintXX/intXX/bool casting operators with added overflow\\n * checks.\\n *\\n * Downcasting from uint256/int256 in Solidity does not revert on overflow. This can\\n * easily result in undesired exploitation or bugs, since developers usually\\n * assume that overflows raise errors. `SafeCast` restores this intuition by\\n * reverting the transaction when such an operation overflows.\\n *\\n * Using this library instead of the unchecked operations eliminates an entire\\n * class of bugs, so it's recommended to use it always.\\n */\\nlibrary SafeCast {\\n /**\\n * @dev Value doesn't fit in an uint of `bits` size.\\n */\\n error SafeCastOverflowedUintDowncast(uint8 bits, uint256 value);\\n\\n /**\\n * @dev An int value doesn't fit in an uint of `bits` size.\\n */\\n error SafeCastOverflowedIntToUint(int256 value);\\n\\n /**\\n * @dev Value doesn't fit in an int of `bits` size.\\n */\\n error SafeCastOverflowedIntDowncast(uint8 bits, int256 value);\\n\\n /**\\n * @dev An uint value doesn't fit in an int of `bits` size.\\n */\\n error SafeCastOverflowedUintToInt(uint256 value);\\n\\n /**\\n * @dev Returns the downcasted uint248 from uint256, reverting on\\n * overflow (when the input is greater than largest uint248).\\n *\\n * Counterpart to Solidity's `uint248` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 248 bits\\n */\\n function toUint248(uint256 value) internal pure returns (uint248) {\\n if (value > type(uint248).max) {\\n revert SafeCastOverflowedUintDowncast(248, value);\\n }\\n return uint248(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint240 from uint256, reverting on\\n * overflow (when the input is greater than largest uint240).\\n *\\n * Counterpart to Solidity's `uint240` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 240 bits\\n */\\n function toUint240(uint256 value) internal pure returns (uint240) {\\n if (value > type(uint240).max) {\\n revert SafeCastOverflowedUintDowncast(240, value);\\n }\\n return uint240(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint232 from uint256, reverting on\\n * overflow (when the input is greater than largest uint232).\\n *\\n * Counterpart to Solidity's `uint232` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 232 bits\\n */\\n function toUint232(uint256 value) internal pure returns (uint232) {\\n if (value > type(uint232).max) {\\n revert SafeCastOverflowedUintDowncast(232, value);\\n }\\n return uint232(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint224 from uint256, reverting on\\n * overflow (when the input is greater than largest uint224).\\n *\\n * Counterpart to Solidity's `uint224` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 224 bits\\n */\\n function toUint224(uint256 value) internal pure returns (uint224) {\\n if (value > type(uint224).max) {\\n revert SafeCastOverflowedUintDowncast(224, value);\\n }\\n return uint224(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint216 from uint256, reverting on\\n * overflow (when the input is greater than largest uint216).\\n *\\n * Counterpart to Solidity's `uint216` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 216 bits\\n */\\n function toUint216(uint256 value) internal pure returns (uint216) {\\n if (value > type(uint216).max) {\\n revert SafeCastOverflowedUintDowncast(216, value);\\n }\\n return uint216(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint208 from uint256, reverting on\\n * overflow (when the input is greater than largest uint208).\\n *\\n * Counterpart to Solidity's `uint208` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 208 bits\\n */\\n function toUint208(uint256 value) internal pure returns (uint208) {\\n if (value > type(uint208).max) {\\n revert SafeCastOverflowedUintDowncast(208, value);\\n }\\n return uint208(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint200 from uint256, reverting on\\n * overflow (when the input is greater than largest uint200).\\n *\\n * Counterpart to Solidity's `uint200` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 200 bits\\n */\\n function toUint200(uint256 value) internal pure returns (uint200) {\\n if (value > type(uint200).max) {\\n revert SafeCastOverflowedUintDowncast(200, value);\\n }\\n return uint200(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint192 from uint256, reverting on\\n * overflow (when the input is greater than largest uint192).\\n *\\n * Counterpart to Solidity's `uint192` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 192 bits\\n */\\n function toUint192(uint256 value) internal pure returns (uint192) {\\n if (value > type(uint192).max) {\\n revert SafeCastOverflowedUintDowncast(192, value);\\n }\\n return uint192(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint184 from uint256, reverting on\\n * overflow (when the input is greater than largest uint184).\\n *\\n * Counterpart to Solidity's `uint184` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 184 bits\\n */\\n function toUint184(uint256 value) internal pure returns (uint184) {\\n if (value > type(uint184).max) {\\n revert SafeCastOverflowedUintDowncast(184, value);\\n }\\n return uint184(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint176 from uint256, reverting on\\n * overflow (when the input is greater than largest uint176).\\n *\\n * Counterpart to Solidity's `uint176` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 176 bits\\n */\\n function toUint176(uint256 value) internal pure returns (uint176) {\\n if (value > type(uint176).max) {\\n revert SafeCastOverflowedUintDowncast(176, value);\\n }\\n return uint176(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint168 from uint256, reverting on\\n * overflow (when the input is greater than largest uint168).\\n *\\n * Counterpart to Solidity's `uint168` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 168 bits\\n */\\n function toUint168(uint256 value) internal pure returns (uint168) {\\n if (value > type(uint168).max) {\\n revert SafeCastOverflowedUintDowncast(168, value);\\n }\\n return uint168(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint160 from uint256, reverting on\\n * overflow (when the input is greater than largest uint160).\\n *\\n * Counterpart to Solidity's `uint160` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 160 bits\\n */\\n function toUint160(uint256 value) internal pure returns (uint160) {\\n if (value > type(uint160).max) {\\n revert SafeCastOverflowedUintDowncast(160, value);\\n }\\n return uint160(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint152 from uint256, reverting on\\n * overflow (when the input is greater than largest uint152).\\n *\\n * Counterpart to Solidity's `uint152` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 152 bits\\n */\\n function toUint152(uint256 value) internal pure returns (uint152) {\\n if (value > type(uint152).max) {\\n revert SafeCastOverflowedUintDowncast(152, value);\\n }\\n return uint152(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint144 from uint256, reverting on\\n * overflow (when the input is greater than largest uint144).\\n *\\n * Counterpart to Solidity's `uint144` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 144 bits\\n */\\n function toUint144(uint256 value) internal pure returns (uint144) {\\n if (value > type(uint144).max) {\\n revert SafeCastOverflowedUintDowncast(144, value);\\n }\\n return uint144(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint136 from uint256, reverting on\\n * overflow (when the input is greater than largest uint136).\\n *\\n * Counterpart to Solidity's `uint136` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 136 bits\\n */\\n function toUint136(uint256 value) internal pure returns (uint136) {\\n if (value > type(uint136).max) {\\n revert SafeCastOverflowedUintDowncast(136, value);\\n }\\n return uint136(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint128 from uint256, reverting on\\n * overflow (when the input is greater than largest uint128).\\n *\\n * Counterpart to Solidity's `uint128` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 128 bits\\n */\\n function toUint128(uint256 value) internal pure returns (uint128) {\\n if (value > type(uint128).max) {\\n revert SafeCastOverflowedUintDowncast(128, value);\\n }\\n return uint128(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint120 from uint256, reverting on\\n * overflow (when the input is greater than largest uint120).\\n *\\n * Counterpart to Solidity's `uint120` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 120 bits\\n */\\n function toUint120(uint256 value) internal pure returns (uint120) {\\n if (value > type(uint120).max) {\\n revert SafeCastOverflowedUintDowncast(120, value);\\n }\\n return uint120(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint112 from uint256, reverting on\\n * overflow (when the input is greater than largest uint112).\\n *\\n * Counterpart to Solidity's `uint112` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 112 bits\\n */\\n function toUint112(uint256 value) internal pure returns (uint112) {\\n if (value > type(uint112).max) {\\n revert SafeCastOverflowedUintDowncast(112, value);\\n }\\n return uint112(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint104 from uint256, reverting on\\n * overflow (when the input is greater than largest uint104).\\n *\\n * Counterpart to Solidity's `uint104` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 104 bits\\n */\\n function toUint104(uint256 value) internal pure returns (uint104) {\\n if (value > type(uint104).max) {\\n revert SafeCastOverflowedUintDowncast(104, value);\\n }\\n return uint104(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint96 from uint256, reverting on\\n * overflow (when the input is greater than largest uint96).\\n *\\n * Counterpart to Solidity's `uint96` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 96 bits\\n */\\n function toUint96(uint256 value) internal pure returns (uint96) {\\n if (value > type(uint96).max) {\\n revert SafeCastOverflowedUintDowncast(96, value);\\n }\\n return uint96(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint88 from uint256, reverting on\\n * overflow (when the input is greater than largest uint88).\\n *\\n * Counterpart to Solidity's `uint88` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 88 bits\\n */\\n function toUint88(uint256 value) internal pure returns (uint88) {\\n if (value > type(uint88).max) {\\n revert SafeCastOverflowedUintDowncast(88, value);\\n }\\n return uint88(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint80 from uint256, reverting on\\n * overflow (when the input is greater than largest uint80).\\n *\\n * Counterpart to Solidity's `uint80` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 80 bits\\n */\\n function toUint80(uint256 value) internal pure returns (uint80) {\\n if (value > type(uint80).max) {\\n revert SafeCastOverflowedUintDowncast(80, value);\\n }\\n return uint80(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint72 from uint256, reverting on\\n * overflow (when the input is greater than largest uint72).\\n *\\n * Counterpart to Solidity's `uint72` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 72 bits\\n */\\n function toUint72(uint256 value) internal pure returns (uint72) {\\n if (value > type(uint72).max) {\\n revert SafeCastOverflowedUintDowncast(72, value);\\n }\\n return uint72(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint64 from uint256, reverting on\\n * overflow (when the input is greater than largest uint64).\\n *\\n * Counterpart to Solidity's `uint64` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 64 bits\\n */\\n function toUint64(uint256 value) internal pure returns (uint64) {\\n if (value > type(uint64).max) {\\n revert SafeCastOverflowedUintDowncast(64, value);\\n }\\n return uint64(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint56 from uint256, reverting on\\n * overflow (when the input is greater than largest uint56).\\n *\\n * Counterpart to Solidity's `uint56` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 56 bits\\n */\\n function toUint56(uint256 value) internal pure returns (uint56) {\\n if (value > type(uint56).max) {\\n revert SafeCastOverflowedUintDowncast(56, value);\\n }\\n return uint56(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint48 from uint256, reverting on\\n * overflow (when the input is greater than largest uint48).\\n *\\n * Counterpart to Solidity's `uint48` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 48 bits\\n */\\n function toUint48(uint256 value) internal pure returns (uint48) {\\n if (value > type(uint48).max) {\\n revert SafeCastOverflowedUintDowncast(48, value);\\n }\\n return uint48(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint40 from uint256, reverting on\\n * overflow (when the input is greater than largest uint40).\\n *\\n * Counterpart to Solidity's `uint40` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 40 bits\\n */\\n function toUint40(uint256 value) internal pure returns (uint40) {\\n if (value > type(uint40).max) {\\n revert SafeCastOverflowedUintDowncast(40, value);\\n }\\n return uint40(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint32 from uint256, reverting on\\n * overflow (when the input is greater than largest uint32).\\n *\\n * Counterpart to Solidity's `uint32` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 32 bits\\n */\\n function toUint32(uint256 value) internal pure returns (uint32) {\\n if (value > type(uint32).max) {\\n revert SafeCastOverflowedUintDowncast(32, value);\\n }\\n return uint32(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint24 from uint256, reverting on\\n * overflow (when the input is greater than largest uint24).\\n *\\n * Counterpart to Solidity's `uint24` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 24 bits\\n */\\n function toUint24(uint256 value) internal pure returns (uint24) {\\n if (value > type(uint24).max) {\\n revert SafeCastOverflowedUintDowncast(24, value);\\n }\\n return uint24(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint16 from uint256, reverting on\\n * overflow (when the input is greater than largest uint16).\\n *\\n * Counterpart to Solidity's `uint16` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 16 bits\\n */\\n function toUint16(uint256 value) internal pure returns (uint16) {\\n if (value > type(uint16).max) {\\n revert SafeCastOverflowedUintDowncast(16, value);\\n }\\n return uint16(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint8 from uint256, reverting on\\n * overflow (when the input is greater than largest uint8).\\n *\\n * Counterpart to Solidity's `uint8` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 8 bits\\n */\\n function toUint8(uint256 value) internal pure returns (uint8) {\\n if (value > type(uint8).max) {\\n revert SafeCastOverflowedUintDowncast(8, value);\\n }\\n return uint8(value);\\n }\\n\\n /**\\n * @dev Converts a signed int256 into an unsigned uint256.\\n *\\n * Requirements:\\n *\\n * - input must be greater than or equal to 0.\\n */\\n function toUint256(int256 value) internal pure returns (uint256) {\\n if (value < 0) {\\n revert SafeCastOverflowedIntToUint(value);\\n }\\n return uint256(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted int248 from int256, reverting on\\n * overflow (when the input is less than smallest int248 or\\n * greater than largest int248).\\n *\\n * Counterpart to Solidity's `int248` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 248 bits\\n */\\n function toInt248(int256 value) internal pure returns (int248 downcasted) {\\n downcasted = int248(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(248, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int240 from int256, reverting on\\n * overflow (when the input is less than smallest int240 or\\n * greater than largest int240).\\n *\\n * Counterpart to Solidity's `int240` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 240 bits\\n */\\n function toInt240(int256 value) internal pure returns (int240 downcasted) {\\n downcasted = int240(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(240, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int232 from int256, reverting on\\n * overflow (when the input is less than smallest int232 or\\n * greater than largest int232).\\n *\\n * Counterpart to Solidity's `int232` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 232 bits\\n */\\n function toInt232(int256 value) internal pure returns (int232 downcasted) {\\n downcasted = int232(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(232, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int224 from int256, reverting on\\n * overflow (when the input is less than smallest int224 or\\n * greater than largest int224).\\n *\\n * Counterpart to Solidity's `int224` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 224 bits\\n */\\n function toInt224(int256 value) internal pure returns (int224 downcasted) {\\n downcasted = int224(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(224, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int216 from int256, reverting on\\n * overflow (when the input is less than smallest int216 or\\n * greater than largest int216).\\n *\\n * Counterpart to Solidity's `int216` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 216 bits\\n */\\n function toInt216(int256 value) internal pure returns (int216 downcasted) {\\n downcasted = int216(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(216, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int208 from int256, reverting on\\n * overflow (when the input is less than smallest int208 or\\n * greater than largest int208).\\n *\\n * Counterpart to Solidity's `int208` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 208 bits\\n */\\n function toInt208(int256 value) internal pure returns (int208 downcasted) {\\n downcasted = int208(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(208, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int200 from int256, reverting on\\n * overflow (when the input is less than smallest int200 or\\n * greater than largest int200).\\n *\\n * Counterpart to Solidity's `int200` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 200 bits\\n */\\n function toInt200(int256 value) internal pure returns (int200 downcasted) {\\n downcasted = int200(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(200, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int192 from int256, reverting on\\n * overflow (when the input is less than smallest int192 or\\n * greater than largest int192).\\n *\\n * Counterpart to Solidity's `int192` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 192 bits\\n */\\n function toInt192(int256 value) internal pure returns (int192 downcasted) {\\n downcasted = int192(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(192, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int184 from int256, reverting on\\n * overflow (when the input is less than smallest int184 or\\n * greater than largest int184).\\n *\\n * Counterpart to Solidity's `int184` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 184 bits\\n */\\n function toInt184(int256 value) internal pure returns (int184 downcasted) {\\n downcasted = int184(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(184, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int176 from int256, reverting on\\n * overflow (when the input is less than smallest int176 or\\n * greater than largest int176).\\n *\\n * Counterpart to Solidity's `int176` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 176 bits\\n */\\n function toInt176(int256 value) internal pure returns (int176 downcasted) {\\n downcasted = int176(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(176, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int168 from int256, reverting on\\n * overflow (when the input is less than smallest int168 or\\n * greater than largest int168).\\n *\\n * Counterpart to Solidity's `int168` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 168 bits\\n */\\n function toInt168(int256 value) internal pure returns (int168 downcasted) {\\n downcasted = int168(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(168, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int160 from int256, reverting on\\n * overflow (when the input is less than smallest int160 or\\n * greater than largest int160).\\n *\\n * Counterpart to Solidity's `int160` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 160 bits\\n */\\n function toInt160(int256 value) internal pure returns (int160 downcasted) {\\n downcasted = int160(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(160, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int152 from int256, reverting on\\n * overflow (when the input is less than smallest int152 or\\n * greater than largest int152).\\n *\\n * Counterpart to Solidity's `int152` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 152 bits\\n */\\n function toInt152(int256 value) internal pure returns (int152 downcasted) {\\n downcasted = int152(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(152, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int144 from int256, reverting on\\n * overflow (when the input is less than smallest int144 or\\n * greater than largest int144).\\n *\\n * Counterpart to Solidity's `int144` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 144 bits\\n */\\n function toInt144(int256 value) internal pure returns (int144 downcasted) {\\n downcasted = int144(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(144, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int136 from int256, reverting on\\n * overflow (when the input is less than smallest int136 or\\n * greater than largest int136).\\n *\\n * Counterpart to Solidity's `int136` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 136 bits\\n */\\n function toInt136(int256 value) internal pure returns (int136 downcasted) {\\n downcasted = int136(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(136, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int128 from int256, reverting on\\n * overflow (when the input is less than smallest int128 or\\n * greater than largest int128).\\n *\\n * Counterpart to Solidity's `int128` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 128 bits\\n */\\n function toInt128(int256 value) internal pure returns (int128 downcasted) {\\n downcasted = int128(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(128, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int120 from int256, reverting on\\n * overflow (when the input is less than smallest int120 or\\n * greater than largest int120).\\n *\\n * Counterpart to Solidity's `int120` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 120 bits\\n */\\n function toInt120(int256 value) internal pure returns (int120 downcasted) {\\n downcasted = int120(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(120, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int112 from int256, reverting on\\n * overflow (when the input is less than smallest int112 or\\n * greater than largest int112).\\n *\\n * Counterpart to Solidity's `int112` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 112 bits\\n */\\n function toInt112(int256 value) internal pure returns (int112 downcasted) {\\n downcasted = int112(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(112, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int104 from int256, reverting on\\n * overflow (when the input is less than smallest int104 or\\n * greater than largest int104).\\n *\\n * Counterpart to Solidity's `int104` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 104 bits\\n */\\n function toInt104(int256 value) internal pure returns (int104 downcasted) {\\n downcasted = int104(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(104, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int96 from int256, reverting on\\n * overflow (when the input is less than smallest int96 or\\n * greater than largest int96).\\n *\\n * Counterpart to Solidity's `int96` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 96 bits\\n */\\n function toInt96(int256 value) internal pure returns (int96 downcasted) {\\n downcasted = int96(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(96, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int88 from int256, reverting on\\n * overflow (when the input is less than smallest int88 or\\n * greater than largest int88).\\n *\\n * Counterpart to Solidity's `int88` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 88 bits\\n */\\n function toInt88(int256 value) internal pure returns (int88 downcasted) {\\n downcasted = int88(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(88, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int80 from int256, reverting on\\n * overflow (when the input is less than smallest int80 or\\n * greater than largest int80).\\n *\\n * Counterpart to Solidity's `int80` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 80 bits\\n */\\n function toInt80(int256 value) internal pure returns (int80 downcasted) {\\n downcasted = int80(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(80, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int72 from int256, reverting on\\n * overflow (when the input is less than smallest int72 or\\n * greater than largest int72).\\n *\\n * Counterpart to Solidity's `int72` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 72 bits\\n */\\n function toInt72(int256 value) internal pure returns (int72 downcasted) {\\n downcasted = int72(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(72, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int64 from int256, reverting on\\n * overflow (when the input is less than smallest int64 or\\n * greater than largest int64).\\n *\\n * Counterpart to Solidity's `int64` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 64 bits\\n */\\n function toInt64(int256 value) internal pure returns (int64 downcasted) {\\n downcasted = int64(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(64, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int56 from int256, reverting on\\n * overflow (when the input is less than smallest int56 or\\n * greater than largest int56).\\n *\\n * Counterpart to Solidity's `int56` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 56 bits\\n */\\n function toInt56(int256 value) internal pure returns (int56 downcasted) {\\n downcasted = int56(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(56, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int48 from int256, reverting on\\n * overflow (when the input is less than smallest int48 or\\n * greater than largest int48).\\n *\\n * Counterpart to Solidity's `int48` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 48 bits\\n */\\n function toInt48(int256 value) internal pure returns (int48 downcasted) {\\n downcasted = int48(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(48, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int40 from int256, reverting on\\n * overflow (when the input is less than smallest int40 or\\n * greater than largest int40).\\n *\\n * Counterpart to Solidity's `int40` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 40 bits\\n */\\n function toInt40(int256 value) internal pure returns (int40 downcasted) {\\n downcasted = int40(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(40, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int32 from int256, reverting on\\n * overflow (when the input is less than smallest int32 or\\n * greater than largest int32).\\n *\\n * Counterpart to Solidity's `int32` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 32 bits\\n */\\n function toInt32(int256 value) internal pure returns (int32 downcasted) {\\n downcasted = int32(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(32, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int24 from int256, reverting on\\n * overflow (when the input is less than smallest int24 or\\n * greater than largest int24).\\n *\\n * Counterpart to Solidity's `int24` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 24 bits\\n */\\n function toInt24(int256 value) internal pure returns (int24 downcasted) {\\n downcasted = int24(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(24, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int16 from int256, reverting on\\n * overflow (when the input is less than smallest int16 or\\n * greater than largest int16).\\n *\\n * Counterpart to Solidity's `int16` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 16 bits\\n */\\n function toInt16(int256 value) internal pure returns (int16 downcasted) {\\n downcasted = int16(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(16, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int8 from int256, reverting on\\n * overflow (when the input is less than smallest int8 or\\n * greater than largest int8).\\n *\\n * Counterpart to Solidity's `int8` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 8 bits\\n */\\n function toInt8(int256 value) internal pure returns (int8 downcasted) {\\n downcasted = int8(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(8, value);\\n }\\n }\\n\\n /**\\n * @dev Converts an unsigned uint256 into a signed int256.\\n *\\n * Requirements:\\n *\\n * - input must be less than or equal to maxInt256.\\n */\\n function toInt256(uint256 value) internal pure returns (int256) {\\n // Note: Unsafe cast below is okay because `type(int256).max` is guaranteed to be positive\\n if (value > uint256(type(int256).max)) {\\n revert SafeCastOverflowedUintToInt(value);\\n }\\n return int256(value);\\n }\\n\\n /**\\n * @dev Cast a boolean (false or true) to a uint256 (0 or 1) with no jump.\\n */\\n function toUint(bool b) internal pure returns (uint256 u) {\\n assembly (\\\"memory-safe\\\") {\\n u := iszero(iszero(b))\\n }\\n }\\n}\\n\",\"keccak256\":\"0x195533c86d0ef72bcc06456a4f66a9b941f38eb403739b00f21fd7c1abd1ae54\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/math/SignedMath.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/math/SignedMath.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {SafeCast} from \\\"./SafeCast.sol\\\";\\n\\n/**\\n * @dev Standard signed math utilities missing in the Solidity language.\\n */\\nlibrary SignedMath {\\n /**\\n * @dev Branchless ternary evaluation for `a ? b : c`. Gas costs are constant.\\n *\\n * IMPORTANT: This function may reduce bytecode size and consume less gas when used standalone.\\n * However, the compiler may optimize Solidity ternary operations (i.e. `a ? b : c`) to only compute\\n * one branch when needed, making this function more expensive.\\n */\\n function ternary(bool condition, int256 a, int256 b) internal pure returns (int256) {\\n unchecked {\\n // branchless ternary works because:\\n // b ^ (a ^ b) == a\\n // b ^ 0 == b\\n return b ^ ((a ^ b) * int256(SafeCast.toUint(condition)));\\n }\\n }\\n\\n /**\\n * @dev Returns the largest of two signed numbers.\\n */\\n function max(int256 a, int256 b) internal pure returns (int256) {\\n return ternary(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 ternary(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 // Formula from the \\\"Bit Twiddling Hacks\\\" by Sean Eron Anderson.\\n // Since `n` is a signed integer, the generated bytecode will use the SAR opcode to perform the right shift,\\n // taking advantage of the most significant (or \\\"sign\\\" bit) in two's complement representation.\\n // This opcode adds new most significant bits set to the value of the previous most significant bit. As a result,\\n // the mask will either be `bytes32(0)` (if n is positive) or `~bytes32(0)` (if n is negative).\\n int256 mask = n >> 255;\\n\\n // A `bytes32(0)` mask leaves the input unchanged, while a `~bytes32(0)` mask complements it.\\n return uint256((n + mask) ^ mask);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xb1970fac7b64e6c09611e6691791e848d5e3fe410fa5899e7df2e0afd77a99e3\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/structs/Checkpoints.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/structs/Checkpoints.sol)\\n// This file was procedurally generated from scripts/generate/templates/Checkpoints.js.\\n\\npragma solidity ^0.8.20;\\n\\nimport {Math} from \\\"../math/Math.sol\\\";\\n\\n/**\\n * @dev This library defines the `Trace*` struct, for checkpointing values as they change at different points in\\n * time, and later looking up past values by block number. See {Votes} as an example.\\n *\\n * To create a history of checkpoints define a variable type `Checkpoints.Trace*` in your contract, and store a new\\n * checkpoint for the current transaction block using the {push} function.\\n */\\nlibrary Checkpoints {\\n /**\\n * @dev A value was attempted to be inserted on a past checkpoint.\\n */\\n error CheckpointUnorderedInsertion();\\n\\n struct Trace224 {\\n Checkpoint224[] _checkpoints;\\n }\\n\\n struct Checkpoint224 {\\n uint32 _key;\\n uint224 _value;\\n }\\n\\n /**\\n * @dev Pushes a (`key`, `value`) pair into a Trace224 so that it is stored as the checkpoint.\\n *\\n * Returns previous value and new value.\\n *\\n * IMPORTANT: Never accept `key` as a user input, since an arbitrary `type(uint32).max` key set will disable the\\n * library.\\n */\\n function push(\\n Trace224 storage self,\\n uint32 key,\\n uint224 value\\n ) internal returns (uint224 oldValue, uint224 newValue) {\\n return _insert(self._checkpoints, key, value);\\n }\\n\\n /**\\n * @dev Returns the value in the first (oldest) checkpoint with key greater or equal than the search key, or zero if\\n * there is none.\\n */\\n function lowerLookup(Trace224 storage self, uint32 key) internal view returns (uint224) {\\n uint256 len = self._checkpoints.length;\\n uint256 pos = _lowerBinaryLookup(self._checkpoints, key, 0, len);\\n return pos == len ? 0 : _unsafeAccess(self._checkpoints, pos)._value;\\n }\\n\\n /**\\n * @dev Returns the value in the last (most recent) checkpoint with key lower or equal than the search key, or zero\\n * if there is none.\\n */\\n function upperLookup(Trace224 storage self, uint32 key) internal view returns (uint224) {\\n uint256 len = self._checkpoints.length;\\n uint256 pos = _upperBinaryLookup(self._checkpoints, key, 0, len);\\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\\n }\\n\\n /**\\n * @dev Returns the value in the last (most recent) checkpoint with key lower or equal than the search key, or zero\\n * if there is none.\\n *\\n * NOTE: This is a variant of {upperLookup} that is optimised to find \\\"recent\\\" checkpoint (checkpoints with high\\n * keys).\\n */\\n function upperLookupRecent(Trace224 storage self, uint32 key) internal view returns (uint224) {\\n uint256 len = self._checkpoints.length;\\n\\n uint256 low = 0;\\n uint256 high = len;\\n\\n if (len > 5) {\\n uint256 mid = len - Math.sqrt(len);\\n if (key < _unsafeAccess(self._checkpoints, mid)._key) {\\n high = mid;\\n } else {\\n low = mid + 1;\\n }\\n }\\n\\n uint256 pos = _upperBinaryLookup(self._checkpoints, key, low, high);\\n\\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\\n }\\n\\n /**\\n * @dev Returns the value in the most recent checkpoint, or zero if there are no checkpoints.\\n */\\n function latest(Trace224 storage self) internal view returns (uint224) {\\n uint256 pos = self._checkpoints.length;\\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\\n }\\n\\n /**\\n * @dev Returns whether there is a checkpoint in the structure (i.e. it is not empty), and if so the key and value\\n * in the most recent checkpoint.\\n */\\n function latestCheckpoint(Trace224 storage self) internal view returns (bool exists, uint32 _key, uint224 _value) {\\n uint256 pos = self._checkpoints.length;\\n if (pos == 0) {\\n return (false, 0, 0);\\n } else {\\n Checkpoint224 storage ckpt = _unsafeAccess(self._checkpoints, pos - 1);\\n return (true, ckpt._key, ckpt._value);\\n }\\n }\\n\\n /**\\n * @dev Returns the number of checkpoint.\\n */\\n function length(Trace224 storage self) internal view returns (uint256) {\\n return self._checkpoints.length;\\n }\\n\\n /**\\n * @dev Returns checkpoint at given position.\\n */\\n function at(Trace224 storage self, uint32 pos) internal view returns (Checkpoint224 memory) {\\n return self._checkpoints[pos];\\n }\\n\\n /**\\n * @dev Pushes a (`key`, `value`) pair into an ordered list of checkpoints, either by inserting a new checkpoint,\\n * or by updating the last one.\\n */\\n function _insert(\\n Checkpoint224[] storage self,\\n uint32 key,\\n uint224 value\\n ) private returns (uint224 oldValue, uint224 newValue) {\\n uint256 pos = self.length;\\n\\n if (pos > 0) {\\n Checkpoint224 storage last = _unsafeAccess(self, pos - 1);\\n uint32 lastKey = last._key;\\n uint224 lastValue = last._value;\\n\\n // Checkpoint keys must be non-decreasing.\\n if (lastKey > key) {\\n revert CheckpointUnorderedInsertion();\\n }\\n\\n // Update or push new checkpoint\\n if (lastKey == key) {\\n last._value = value;\\n } else {\\n self.push(Checkpoint224({_key: key, _value: value}));\\n }\\n return (lastValue, value);\\n } else {\\n self.push(Checkpoint224({_key: key, _value: value}));\\n return (0, value);\\n }\\n }\\n\\n /**\\n * @dev Return the index of the first (oldest) checkpoint with key strictly bigger than the search key, or `high`\\n * if there is none. `low` and `high` define a section where to do the search, with inclusive `low` and exclusive\\n * `high`.\\n *\\n * WARNING: `high` should not be greater than the array's length.\\n */\\n function _upperBinaryLookup(\\n Checkpoint224[] storage self,\\n uint32 key,\\n uint256 low,\\n uint256 high\\n ) private view returns (uint256) {\\n while (low < high) {\\n uint256 mid = Math.average(low, high);\\n if (_unsafeAccess(self, mid)._key > key) {\\n high = mid;\\n } else {\\n low = mid + 1;\\n }\\n }\\n return high;\\n }\\n\\n /**\\n * @dev Return the index of the first (oldest) checkpoint with key greater or equal than the search key, or `high`\\n * if there is none. `low` and `high` define a section where to do the search, with inclusive `low` and exclusive\\n * `high`.\\n *\\n * WARNING: `high` should not be greater than the array's length.\\n */\\n function _lowerBinaryLookup(\\n Checkpoint224[] storage self,\\n uint32 key,\\n uint256 low,\\n uint256 high\\n ) private view returns (uint256) {\\n while (low < high) {\\n uint256 mid = Math.average(low, high);\\n if (_unsafeAccess(self, mid)._key < key) {\\n low = mid + 1;\\n } else {\\n high = mid;\\n }\\n }\\n return high;\\n }\\n\\n /**\\n * @dev Access an element of the array without performing bounds check. The position is assumed to be within bounds.\\n */\\n function _unsafeAccess(\\n Checkpoint224[] storage self,\\n uint256 pos\\n ) private pure returns (Checkpoint224 storage result) {\\n assembly {\\n mstore(0, self.slot)\\n result.slot := add(keccak256(0, 0x20), pos)\\n }\\n }\\n\\n struct Trace208 {\\n Checkpoint208[] _checkpoints;\\n }\\n\\n struct Checkpoint208 {\\n uint48 _key;\\n uint208 _value;\\n }\\n\\n /**\\n * @dev Pushes a (`key`, `value`) pair into a Trace208 so that it is stored as the checkpoint.\\n *\\n * Returns previous value and new value.\\n *\\n * IMPORTANT: Never accept `key` as a user input, since an arbitrary `type(uint48).max` key set will disable the\\n * library.\\n */\\n function push(\\n Trace208 storage self,\\n uint48 key,\\n uint208 value\\n ) internal returns (uint208 oldValue, uint208 newValue) {\\n return _insert(self._checkpoints, key, value);\\n }\\n\\n /**\\n * @dev Returns the value in the first (oldest) checkpoint with key greater or equal than the search key, or zero if\\n * there is none.\\n */\\n function lowerLookup(Trace208 storage self, uint48 key) internal view returns (uint208) {\\n uint256 len = self._checkpoints.length;\\n uint256 pos = _lowerBinaryLookup(self._checkpoints, key, 0, len);\\n return pos == len ? 0 : _unsafeAccess(self._checkpoints, pos)._value;\\n }\\n\\n /**\\n * @dev Returns the value in the last (most recent) checkpoint with key lower or equal than the search key, or zero\\n * if there is none.\\n */\\n function upperLookup(Trace208 storage self, uint48 key) internal view returns (uint208) {\\n uint256 len = self._checkpoints.length;\\n uint256 pos = _upperBinaryLookup(self._checkpoints, key, 0, len);\\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\\n }\\n\\n /**\\n * @dev Returns the value in the last (most recent) checkpoint with key lower or equal than the search key, or zero\\n * if there is none.\\n *\\n * NOTE: This is a variant of {upperLookup} that is optimised to find \\\"recent\\\" checkpoint (checkpoints with high\\n * keys).\\n */\\n function upperLookupRecent(Trace208 storage self, uint48 key) internal view returns (uint208) {\\n uint256 len = self._checkpoints.length;\\n\\n uint256 low = 0;\\n uint256 high = len;\\n\\n if (len > 5) {\\n uint256 mid = len - Math.sqrt(len);\\n if (key < _unsafeAccess(self._checkpoints, mid)._key) {\\n high = mid;\\n } else {\\n low = mid + 1;\\n }\\n }\\n\\n uint256 pos = _upperBinaryLookup(self._checkpoints, key, low, high);\\n\\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\\n }\\n\\n /**\\n * @dev Returns the value in the most recent checkpoint, or zero if there are no checkpoints.\\n */\\n function latest(Trace208 storage self) internal view returns (uint208) {\\n uint256 pos = self._checkpoints.length;\\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\\n }\\n\\n /**\\n * @dev Returns whether there is a checkpoint in the structure (i.e. it is not empty), and if so the key and value\\n * in the most recent checkpoint.\\n */\\n function latestCheckpoint(Trace208 storage self) internal view returns (bool exists, uint48 _key, uint208 _value) {\\n uint256 pos = self._checkpoints.length;\\n if (pos == 0) {\\n return (false, 0, 0);\\n } else {\\n Checkpoint208 storage ckpt = _unsafeAccess(self._checkpoints, pos - 1);\\n return (true, ckpt._key, ckpt._value);\\n }\\n }\\n\\n /**\\n * @dev Returns the number of checkpoint.\\n */\\n function length(Trace208 storage self) internal view returns (uint256) {\\n return self._checkpoints.length;\\n }\\n\\n /**\\n * @dev Returns checkpoint at given position.\\n */\\n function at(Trace208 storage self, uint32 pos) internal view returns (Checkpoint208 memory) {\\n return self._checkpoints[pos];\\n }\\n\\n /**\\n * @dev Pushes a (`key`, `value`) pair into an ordered list of checkpoints, either by inserting a new checkpoint,\\n * or by updating the last one.\\n */\\n function _insert(\\n Checkpoint208[] storage self,\\n uint48 key,\\n uint208 value\\n ) private returns (uint208 oldValue, uint208 newValue) {\\n uint256 pos = self.length;\\n\\n if (pos > 0) {\\n Checkpoint208 storage last = _unsafeAccess(self, pos - 1);\\n uint48 lastKey = last._key;\\n uint208 lastValue = last._value;\\n\\n // Checkpoint keys must be non-decreasing.\\n if (lastKey > key) {\\n revert CheckpointUnorderedInsertion();\\n }\\n\\n // Update or push new checkpoint\\n if (lastKey == key) {\\n last._value = value;\\n } else {\\n self.push(Checkpoint208({_key: key, _value: value}));\\n }\\n return (lastValue, value);\\n } else {\\n self.push(Checkpoint208({_key: key, _value: value}));\\n return (0, value);\\n }\\n }\\n\\n /**\\n * @dev Return the index of the first (oldest) checkpoint with key strictly bigger than the search key, or `high`\\n * if there is none. `low` and `high` define a section where to do the search, with inclusive `low` and exclusive\\n * `high`.\\n *\\n * WARNING: `high` should not be greater than the array's length.\\n */\\n function _upperBinaryLookup(\\n Checkpoint208[] storage self,\\n uint48 key,\\n uint256 low,\\n uint256 high\\n ) private view returns (uint256) {\\n while (low < high) {\\n uint256 mid = Math.average(low, high);\\n if (_unsafeAccess(self, mid)._key > key) {\\n high = mid;\\n } else {\\n low = mid + 1;\\n }\\n }\\n return high;\\n }\\n\\n /**\\n * @dev Return the index of the first (oldest) checkpoint with key greater or equal than the search key, or `high`\\n * if there is none. `low` and `high` define a section where to do the search, with inclusive `low` and exclusive\\n * `high`.\\n *\\n * WARNING: `high` should not be greater than the array's length.\\n */\\n function _lowerBinaryLookup(\\n Checkpoint208[] storage self,\\n uint48 key,\\n uint256 low,\\n uint256 high\\n ) private view returns (uint256) {\\n while (low < high) {\\n uint256 mid = Math.average(low, high);\\n if (_unsafeAccess(self, mid)._key < key) {\\n low = mid + 1;\\n } else {\\n high = mid;\\n }\\n }\\n return high;\\n }\\n\\n /**\\n * @dev Access an element of the array without performing bounds check. The position is assumed to be within bounds.\\n */\\n function _unsafeAccess(\\n Checkpoint208[] storage self,\\n uint256 pos\\n ) private pure returns (Checkpoint208 storage result) {\\n assembly {\\n mstore(0, self.slot)\\n result.slot := add(keccak256(0, 0x20), pos)\\n }\\n }\\n\\n struct Trace160 {\\n Checkpoint160[] _checkpoints;\\n }\\n\\n struct Checkpoint160 {\\n uint96 _key;\\n uint160 _value;\\n }\\n\\n /**\\n * @dev Pushes a (`key`, `value`) pair into a Trace160 so that it is stored as the checkpoint.\\n *\\n * Returns previous value and new value.\\n *\\n * IMPORTANT: Never accept `key` as a user input, since an arbitrary `type(uint96).max` key set will disable the\\n * library.\\n */\\n function push(\\n Trace160 storage self,\\n uint96 key,\\n uint160 value\\n ) internal returns (uint160 oldValue, uint160 newValue) {\\n return _insert(self._checkpoints, key, value);\\n }\\n\\n /**\\n * @dev Returns the value in the first (oldest) checkpoint with key greater or equal than the search key, or zero if\\n * there is none.\\n */\\n function lowerLookup(Trace160 storage self, uint96 key) internal view returns (uint160) {\\n uint256 len = self._checkpoints.length;\\n uint256 pos = _lowerBinaryLookup(self._checkpoints, key, 0, len);\\n return pos == len ? 0 : _unsafeAccess(self._checkpoints, pos)._value;\\n }\\n\\n /**\\n * @dev Returns the value in the last (most recent) checkpoint with key lower or equal than the search key, or zero\\n * if there is none.\\n */\\n function upperLookup(Trace160 storage self, uint96 key) internal view returns (uint160) {\\n uint256 len = self._checkpoints.length;\\n uint256 pos = _upperBinaryLookup(self._checkpoints, key, 0, len);\\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\\n }\\n\\n /**\\n * @dev Returns the value in the last (most recent) checkpoint with key lower or equal than the search key, or zero\\n * if there is none.\\n *\\n * NOTE: This is a variant of {upperLookup} that is optimised to find \\\"recent\\\" checkpoint (checkpoints with high\\n * keys).\\n */\\n function upperLookupRecent(Trace160 storage self, uint96 key) internal view returns (uint160) {\\n uint256 len = self._checkpoints.length;\\n\\n uint256 low = 0;\\n uint256 high = len;\\n\\n if (len > 5) {\\n uint256 mid = len - Math.sqrt(len);\\n if (key < _unsafeAccess(self._checkpoints, mid)._key) {\\n high = mid;\\n } else {\\n low = mid + 1;\\n }\\n }\\n\\n uint256 pos = _upperBinaryLookup(self._checkpoints, key, low, high);\\n\\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\\n }\\n\\n /**\\n * @dev Returns the value in the most recent checkpoint, or zero if there are no checkpoints.\\n */\\n function latest(Trace160 storage self) internal view returns (uint160) {\\n uint256 pos = self._checkpoints.length;\\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\\n }\\n\\n /**\\n * @dev Returns whether there is a checkpoint in the structure (i.e. it is not empty), and if so the key and value\\n * in the most recent checkpoint.\\n */\\n function latestCheckpoint(Trace160 storage self) internal view returns (bool exists, uint96 _key, uint160 _value) {\\n uint256 pos = self._checkpoints.length;\\n if (pos == 0) {\\n return (false, 0, 0);\\n } else {\\n Checkpoint160 storage ckpt = _unsafeAccess(self._checkpoints, pos - 1);\\n return (true, ckpt._key, ckpt._value);\\n }\\n }\\n\\n /**\\n * @dev Returns the number of checkpoint.\\n */\\n function length(Trace160 storage self) internal view returns (uint256) {\\n return self._checkpoints.length;\\n }\\n\\n /**\\n * @dev Returns checkpoint at given position.\\n */\\n function at(Trace160 storage self, uint32 pos) internal view returns (Checkpoint160 memory) {\\n return self._checkpoints[pos];\\n }\\n\\n /**\\n * @dev Pushes a (`key`, `value`) pair into an ordered list of checkpoints, either by inserting a new checkpoint,\\n * or by updating the last one.\\n */\\n function _insert(\\n Checkpoint160[] storage self,\\n uint96 key,\\n uint160 value\\n ) private returns (uint160 oldValue, uint160 newValue) {\\n uint256 pos = self.length;\\n\\n if (pos > 0) {\\n Checkpoint160 storage last = _unsafeAccess(self, pos - 1);\\n uint96 lastKey = last._key;\\n uint160 lastValue = last._value;\\n\\n // Checkpoint keys must be non-decreasing.\\n if (lastKey > key) {\\n revert CheckpointUnorderedInsertion();\\n }\\n\\n // Update or push new checkpoint\\n if (lastKey == key) {\\n last._value = value;\\n } else {\\n self.push(Checkpoint160({_key: key, _value: value}));\\n }\\n return (lastValue, value);\\n } else {\\n self.push(Checkpoint160({_key: key, _value: value}));\\n return (0, value);\\n }\\n }\\n\\n /**\\n * @dev Return the index of the first (oldest) checkpoint with key strictly bigger than the search key, or `high`\\n * if there is none. `low` and `high` define a section where to do the search, with inclusive `low` and exclusive\\n * `high`.\\n *\\n * WARNING: `high` should not be greater than the array's length.\\n */\\n function _upperBinaryLookup(\\n Checkpoint160[] storage self,\\n uint96 key,\\n uint256 low,\\n uint256 high\\n ) private view returns (uint256) {\\n while (low < high) {\\n uint256 mid = Math.average(low, high);\\n if (_unsafeAccess(self, mid)._key > key) {\\n high = mid;\\n } else {\\n low = mid + 1;\\n }\\n }\\n return high;\\n }\\n\\n /**\\n * @dev Return the index of the first (oldest) checkpoint with key greater or equal than the search key, or `high`\\n * if there is none. `low` and `high` define a section where to do the search, with inclusive `low` and exclusive\\n * `high`.\\n *\\n * WARNING: `high` should not be greater than the array's length.\\n */\\n function _lowerBinaryLookup(\\n Checkpoint160[] storage self,\\n uint96 key,\\n uint256 low,\\n uint256 high\\n ) private view returns (uint256) {\\n while (low < high) {\\n uint256 mid = Math.average(low, high);\\n if (_unsafeAccess(self, mid)._key < key) {\\n low = mid + 1;\\n } else {\\n high = mid;\\n }\\n }\\n return high;\\n }\\n\\n /**\\n * @dev Access an element of the array without performing bounds check. The position is assumed to be within bounds.\\n */\\n function _unsafeAccess(\\n Checkpoint160[] storage self,\\n uint256 pos\\n ) private pure returns (Checkpoint160 storage result) {\\n assembly {\\n mstore(0, self.slot)\\n result.slot := add(keccak256(0, 0x20), pos)\\n }\\n }\\n}\\n\",\"keccak256\":\"0x66364cd3247ea71cdb58f080f5d5ed6732433a8001413139661841535494692f\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/structs/DoubleEndedQueue.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/structs/DoubleEndedQueue.sol)\\npragma solidity ^0.8.20;\\n\\nimport {Panic} from \\\"../Panic.sol\\\";\\n\\n/**\\n * @dev A sequence of items with the ability to efficiently push and pop items (i.e. insert and remove) on both ends of\\n * the sequence (called front and back). Among other access patterns, it can be used to implement efficient LIFO and\\n * FIFO queues. Storage use is optimized, and all operations are O(1) constant time. This includes {clear}, given that\\n * the existing queue contents are left in storage.\\n *\\n * The struct is called `Bytes32Deque`. Other types can be cast to and from `bytes32`. This data structure can only be\\n * used in storage, and not in memory.\\n * ```solidity\\n * DoubleEndedQueue.Bytes32Deque queue;\\n * ```\\n */\\nlibrary DoubleEndedQueue {\\n /**\\n * @dev Indices are 128 bits so begin and end are packed in a single storage slot for efficient access.\\n *\\n * Struct members have an underscore prefix indicating that they are \\\"private\\\" and should not be read or written to\\n * directly. Use the functions provided below instead. Modifying the struct manually may violate assumptions and\\n * lead to unexpected behavior.\\n *\\n * The first item is at data[begin] and the last item is at data[end - 1]. This range can wrap around.\\n */\\n struct Bytes32Deque {\\n uint128 _begin;\\n uint128 _end;\\n mapping(uint128 index => bytes32) _data;\\n }\\n\\n /**\\n * @dev Inserts an item at the end of the queue.\\n *\\n * Reverts with {Panic-RESOURCE_ERROR} if the queue is full.\\n */\\n function pushBack(Bytes32Deque storage deque, bytes32 value) internal {\\n unchecked {\\n uint128 backIndex = deque._end;\\n if (backIndex + 1 == deque._begin) Panic.panic(Panic.RESOURCE_ERROR);\\n deque._data[backIndex] = value;\\n deque._end = backIndex + 1;\\n }\\n }\\n\\n /**\\n * @dev Removes the item at the end of the queue and returns it.\\n *\\n * Reverts with {Panic-EMPTY_ARRAY_POP} if the queue is empty.\\n */\\n function popBack(Bytes32Deque storage deque) internal returns (bytes32 value) {\\n unchecked {\\n uint128 backIndex = deque._end;\\n if (backIndex == deque._begin) Panic.panic(Panic.EMPTY_ARRAY_POP);\\n --backIndex;\\n value = deque._data[backIndex];\\n delete deque._data[backIndex];\\n deque._end = backIndex;\\n }\\n }\\n\\n /**\\n * @dev Inserts an item at the beginning of the queue.\\n *\\n * Reverts with {Panic-RESOURCE_ERROR} if the queue is full.\\n */\\n function pushFront(Bytes32Deque storage deque, bytes32 value) internal {\\n unchecked {\\n uint128 frontIndex = deque._begin - 1;\\n if (frontIndex == deque._end) Panic.panic(Panic.RESOURCE_ERROR);\\n deque._data[frontIndex] = value;\\n deque._begin = frontIndex;\\n }\\n }\\n\\n /**\\n * @dev Removes the item at the beginning of the queue and returns it.\\n *\\n * Reverts with {Panic-EMPTY_ARRAY_POP} if the queue is empty.\\n */\\n function popFront(Bytes32Deque storage deque) internal returns (bytes32 value) {\\n unchecked {\\n uint128 frontIndex = deque._begin;\\n if (frontIndex == deque._end) Panic.panic(Panic.EMPTY_ARRAY_POP);\\n value = deque._data[frontIndex];\\n delete deque._data[frontIndex];\\n deque._begin = frontIndex + 1;\\n }\\n }\\n\\n /**\\n * @dev Returns the item at the beginning of the queue.\\n *\\n * Reverts with {Panic-ARRAY_OUT_OF_BOUNDS} if the queue is empty.\\n */\\n function front(Bytes32Deque storage deque) internal view returns (bytes32 value) {\\n if (empty(deque)) Panic.panic(Panic.ARRAY_OUT_OF_BOUNDS);\\n return deque._data[deque._begin];\\n }\\n\\n /**\\n * @dev Returns the item at the end of the queue.\\n *\\n * Reverts with {Panic-ARRAY_OUT_OF_BOUNDS} if the queue is empty.\\n */\\n function back(Bytes32Deque storage deque) internal view returns (bytes32 value) {\\n if (empty(deque)) Panic.panic(Panic.ARRAY_OUT_OF_BOUNDS);\\n unchecked {\\n return deque._data[deque._end - 1];\\n }\\n }\\n\\n /**\\n * @dev Return the item at a position in the queue given by `index`, with the first item at 0 and last item at\\n * `length(deque) - 1`.\\n *\\n * Reverts with {Panic-ARRAY_OUT_OF_BOUNDS} if the index is out of bounds.\\n */\\n function at(Bytes32Deque storage deque, uint256 index) internal view returns (bytes32 value) {\\n if (index >= length(deque)) Panic.panic(Panic.ARRAY_OUT_OF_BOUNDS);\\n // By construction, length is a uint128, so the check above ensures that index can be safely downcast to uint128\\n unchecked {\\n return deque._data[deque._begin + uint128(index)];\\n }\\n }\\n\\n /**\\n * @dev Resets the queue back to being empty.\\n *\\n * NOTE: The current items are left behind in storage. This does not affect the functioning of the queue, but misses\\n * out on potential gas refunds.\\n */\\n function clear(Bytes32Deque storage deque) internal {\\n deque._begin = 0;\\n deque._end = 0;\\n }\\n\\n /**\\n * @dev Returns the number of items in the queue.\\n */\\n function length(Bytes32Deque storage deque) internal view returns (uint256) {\\n unchecked {\\n return uint256(deque._end - deque._begin);\\n }\\n }\\n\\n /**\\n * @dev Returns true if the queue is empty.\\n */\\n function empty(Bytes32Deque storage deque) internal view returns (bool) {\\n return deque._end == deque._begin;\\n }\\n}\\n\",\"keccak256\":\"0x1e1d74658d7f4eab3d4f8fb0c6c5953bc5f629d9425e978d557dabff7b58b217\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/types/Time.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/types/Time.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {Math} from \\\"../math/Math.sol\\\";\\nimport {SafeCast} from \\\"../math/SafeCast.sol\\\";\\n\\n/**\\n * @dev This library provides helpers for manipulating time-related objects.\\n *\\n * It uses the following types:\\n * - `uint48` for timepoints\\n * - `uint32` for durations\\n *\\n * While the library doesn't provide specific types for timepoints and duration, it does provide:\\n * - a `Delay` type to represent duration that can be programmed to change value automatically at a given point\\n * - additional helper functions\\n */\\nlibrary Time {\\n using Time for *;\\n\\n /**\\n * @dev Get the block timestamp as a Timepoint.\\n */\\n function timestamp() internal view returns (uint48) {\\n return SafeCast.toUint48(block.timestamp);\\n }\\n\\n /**\\n * @dev Get the block number as a Timepoint.\\n */\\n function blockNumber() internal view returns (uint48) {\\n return SafeCast.toUint48(block.number);\\n }\\n\\n // ==================================================== Delay =====================================================\\n /**\\n * @dev A `Delay` is a uint32 duration that can be programmed to change value automatically at a given point in the\\n * future. The \\\"effect\\\" timepoint describes when the transitions happens from the \\\"old\\\" value to the \\\"new\\\" value.\\n * This allows updating the delay applied to some operation while keeping some guarantees.\\n *\\n * In particular, the {update} function guarantees that if the delay is reduced, the old delay still applies for\\n * some time. For example if the delay is currently 7 days to do an upgrade, the admin should not be able to set\\n * the delay to 0 and upgrade immediately. If the admin wants to reduce the delay, the old delay (7 days) should\\n * still apply for some time.\\n *\\n *\\n * The `Delay` type is 112 bits long, and packs the following:\\n *\\n * ```\\n * | [uint48]: effect date (timepoint)\\n * | | [uint32]: value before (duration)\\n * \\u2193 \\u2193 \\u2193 [uint32]: value after (duration)\\n * 0xAAAAAAAAAAAABBBBBBBBCCCCCCCC\\n * ```\\n *\\n * NOTE: The {get} and {withUpdate} functions operate using timestamps. Block number based delays are not currently\\n * supported.\\n */\\n type Delay is uint112;\\n\\n /**\\n * @dev Wrap a duration into a Delay to add the one-step \\\"update in the future\\\" feature\\n */\\n function toDelay(uint32 duration) internal pure returns (Delay) {\\n return Delay.wrap(duration);\\n }\\n\\n /**\\n * @dev Get the value at a given timepoint plus the pending value and effect timepoint if there is a scheduled\\n * change after this timepoint. If the effect timepoint is 0, then the pending value should not be considered.\\n */\\n function _getFullAt(\\n Delay self,\\n uint48 timepoint\\n ) private pure returns (uint32 valueBefore, uint32 valueAfter, uint48 effect) {\\n (valueBefore, valueAfter, effect) = self.unpack();\\n return effect <= timepoint ? (valueAfter, 0, 0) : (valueBefore, valueAfter, effect);\\n }\\n\\n /**\\n * @dev Get the current value plus the pending value and effect timepoint if there is a scheduled change. If the\\n * effect timepoint is 0, then the pending value should not be considered.\\n */\\n function getFull(Delay self) internal view returns (uint32 valueBefore, uint32 valueAfter, uint48 effect) {\\n return _getFullAt(self, timestamp());\\n }\\n\\n /**\\n * @dev Get the current value.\\n */\\n function get(Delay self) internal view returns (uint32) {\\n (uint32 delay, , ) = self.getFull();\\n return delay;\\n }\\n\\n /**\\n * @dev Update a Delay object so that it takes a new duration after a timepoint that is automatically computed to\\n * enforce the old delay at the moment of the update. Returns the updated Delay object and the timestamp when the\\n * new delay becomes effective.\\n */\\n function withUpdate(\\n Delay self,\\n uint32 newValue,\\n uint32 minSetback\\n ) internal view returns (Delay updatedDelay, uint48 effect) {\\n uint32 value = self.get();\\n uint32 setback = uint32(Math.max(minSetback, value > newValue ? value - newValue : 0));\\n effect = timestamp() + setback;\\n return (pack(value, newValue, effect), effect);\\n }\\n\\n /**\\n * @dev Split a delay into its components: valueBefore, valueAfter and effect (transition timepoint).\\n */\\n function unpack(Delay self) internal pure returns (uint32 valueBefore, uint32 valueAfter, uint48 effect) {\\n uint112 raw = Delay.unwrap(self);\\n\\n valueAfter = uint32(raw);\\n valueBefore = uint32(raw >> 32);\\n effect = uint48(raw >> 64);\\n\\n return (valueBefore, valueAfter, effect);\\n }\\n\\n /**\\n * @dev pack the components into a Delay object.\\n */\\n function pack(uint32 valueBefore, uint32 valueAfter, uint48 effect) internal pure returns (Delay) {\\n return Delay.wrap((uint112(effect) << 64) | (uint112(valueBefore) << 32) | uint112(valueAfter));\\n }\\n}\\n\",\"keccak256\":\"0x36776530f012618bc7526ceb28e77b85e582cb12d9b9466a71d4bd6bf952e4cc\",\"license\":\"MIT\"},\"contracts/variants/crosschain/Gov.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity ^0.8.20;\\n\\nimport \\\"@openzeppelin/contracts/governance/Governor.sol\\\";\\nimport \\\"@openzeppelin/contracts/governance/extensions/GovernorSettings.sol\\\";\\nimport \\\"@openzeppelin/contracts/governance/extensions/GovernorCountingSimple.sol\\\";\\nimport \\\"@openzeppelin/contracts/governance/extensions/GovernorVotes.sol\\\";\\nimport \\\"@openzeppelin/contracts/governance/extensions/GovernorVotesQuorumFraction.sol\\\";\\nimport \\\"./ProofHandler.sol\\\";\\n\\n/**\\n * @title Cross-chain Governance Contract\\n * @author Web3 Hackers Collective\\n * @notice Implementation of a DAO with cross-chain synchronization capabilities\\n * @dev Extends OpenZeppelin's Governor contract with cross-chain parameter updates\\n * @custom:security-contact julien@strat.cc\\n */\\ncontract Gov is\\n Governor,\\n GovernorSettings,\\n GovernorCountingSimple,\\n GovernorVotes,\\n GovernorVotesQuorumFraction\\n{\\n /// @notice Chain ID where this contract was originally deployed\\n uint256 public immutable home;\\n\\n /// @notice IPFS CID of the DAO's manifesto\\n string public manifesto;\\n\\n /// @notice Storage for proof handling\\n ProofHandler.ProofStorage private _proofStorage;\\n\\n /// @notice Types of operations that can be synchronized across chains\\n enum OperationType {\\n SET_MANIFESTO,\\n UPDATE_VOTING_DELAY,\\n UPDATE_VOTING_PERIOD,\\n UPDATE_PROPOSAL_THRESHOLD,\\n UPDATE_QUORUM\\n }\\n\\n /// @notice Emitted when the manifesto is updated\\n /// @param oldManifesto Previous manifesto CID\\n /// @param newManifesto New manifesto CID\\n /// @param nonce Update sequence number\\n event ManifestoUpdated(string oldManifesto, string newManifesto, uint256 nonce);\\n\\n /// @notice Emitted when a governance parameter is updated\\n /// @param operationType Type of parameter updated\\n /// @param oldValue Previous value\\n /// @param newValue New value\\n /// @param nonce Update sequence number\\n event GovernanceParameterUpdated(\\n OperationType indexed operationType,\\n uint256 oldValue,\\n uint256 newValue,\\n uint256 nonce\\n );\\n\\n /// @notice Restricts functions to be called only on the home chain\\n modifier onlyHomeChain() {\\n require(block.chainid == home, \\\"Operation only allowed on home chain\\\");\\n _;\\n }\\n\\n /**\\n * @notice Initializes the governance contract\\n * @dev Sets up initial governance parameters and manifesto\\n * @param _home Chain ID where this contract is considered home\\n * @param _token The voting token contract address\\n * @param _manifestoCid Initial manifesto CID\\n * @param _name Name of the governance contract\\n * @param _votingDelay Time before voting begins\\n * @param _votingPeriod Duration of voting period\\n * @param _proposalThreshold Minimum votes needed to create a proposal\\n * @param _quorum Minimum participation percentage required\\n */\\n constructor(\\n uint256 _home,\\n IVotes _token,\\n string memory _manifestoCid,\\n string memory _name,\\n uint48 _votingDelay,\\n uint32 _votingPeriod,\\n uint256 _proposalThreshold,\\n uint256 _quorum\\n )\\n Governor(_name)\\n GovernorSettings(_votingDelay, _votingPeriod, _proposalThreshold)\\n GovernorVotes(_token)\\n GovernorVotesQuorumFraction(_quorum)\\n {\\n home = _home;\\n manifesto = _manifestoCid;\\n }\\n\\n /**\\n * @notice Updates the DAO's manifesto on the home chain\\n * @param newManifesto New manifesto CID\\n */\\n function setManifesto(string memory newManifesto) public onlyGovernance onlyHomeChain {\\n uint256 nonce = ProofHandler.incrementNonce(\\n _proofStorage,\\n uint8(OperationType.SET_MANIFESTO)\\n );\\n string memory oldManifesto = manifesto;\\n manifesto = newManifesto;\\n emit ManifestoUpdated(oldManifesto, newManifesto, nonce);\\n }\\n\\n /**\\n * @notice Updates the voting delay parameter on the home chain\\n * @param newVotingDelay New voting delay value\\n */\\n function setVotingDelay(\\n uint48 newVotingDelay\\n ) public virtual override onlyGovernance onlyHomeChain {\\n uint256 nonce = ProofHandler.incrementNonce(\\n _proofStorage,\\n uint8(OperationType.UPDATE_VOTING_DELAY)\\n );\\n uint256 oldValue = votingDelay();\\n _setVotingDelay(newVotingDelay);\\n emit GovernanceParameterUpdated(\\n OperationType.UPDATE_VOTING_DELAY,\\n oldValue,\\n newVotingDelay,\\n nonce\\n );\\n }\\n\\n /**\\n * @notice Updates the voting period parameter on the home chain\\n * @param newVotingPeriod New voting period value\\n */\\n function setVotingPeriod(\\n uint32 newVotingPeriod\\n ) public virtual override onlyGovernance onlyHomeChain {\\n uint256 nonce = ProofHandler.incrementNonce(\\n _proofStorage,\\n uint8(OperationType.UPDATE_VOTING_PERIOD)\\n );\\n uint256 oldValue = votingPeriod();\\n _setVotingPeriod(newVotingPeriod);\\n emit GovernanceParameterUpdated(\\n OperationType.UPDATE_VOTING_PERIOD,\\n oldValue,\\n newVotingPeriod,\\n nonce\\n );\\n }\\n\\n /**\\n * @notice Updates the proposal threshold parameter on the home chain\\n * @param newProposalThreshold New proposal threshold value\\n */\\n function setProposalThreshold(\\n uint256 newProposalThreshold\\n ) public virtual override onlyGovernance onlyHomeChain {\\n uint256 nonce = ProofHandler.incrementNonce(\\n _proofStorage,\\n uint8(OperationType.UPDATE_PROPOSAL_THRESHOLD)\\n );\\n uint256 oldValue = proposalThreshold();\\n _setProposalThreshold(newProposalThreshold);\\n emit GovernanceParameterUpdated(\\n OperationType.UPDATE_PROPOSAL_THRESHOLD,\\n oldValue,\\n newProposalThreshold,\\n nonce\\n );\\n }\\n\\n /**\\n * @notice Updates the quorum numerator on the home chain\\n * @param newQuorumNumerator New quorum numerator value\\n */\\n function updateQuorumNumerator(\\n uint256 newQuorumNumerator\\n ) public virtual override onlyGovernance onlyHomeChain {\\n uint256 nonce = ProofHandler.incrementNonce(\\n _proofStorage,\\n uint8(OperationType.UPDATE_QUORUM)\\n );\\n uint256 oldValue = quorumNumerator();\\n _updateQuorumNumerator(newQuorumNumerator);\\n emit GovernanceParameterUpdated(\\n OperationType.UPDATE_QUORUM,\\n oldValue,\\n newQuorumNumerator,\\n nonce\\n );\\n }\\n\\n /**\\n * @notice Generates proof for parameter updates\\n * @param operationType Type of parameter being updated\\n * @param value Encoded parameter value\\n * @return proof Encoded proof data\\n */\\n function generateParameterProof(\\n uint8 operationType,\\n bytes memory value\\n ) external view returns (bytes memory proof) {\\n require(block.chainid == home, \\\"Proofs only generated on home chain\\\");\\n uint256 nextNonce = ProofHandler.getNextNonce(_proofStorage, operationType);\\n return ProofHandler.generateProof(address(this), operationType, value, nextNonce);\\n }\\n\\n /**\\n * @notice Claims a parameter update on a foreign chain\\n * @param proof Proof generated by home chain\\n */\\n function claimParameterUpdate(bytes memory proof) external {\\n (uint8 operationType, bytes memory value, uint256 nonce) = ProofHandler.verifyAndClaimProof(\\n proof,\\n address(this),\\n _proofStorage\\n );\\n\\n if (operationType == uint8(OperationType.SET_MANIFESTO)) {\\n string memory newManifesto = abi.decode(value, (string));\\n string memory oldManifesto = manifesto;\\n manifesto = newManifesto;\\n emit ManifestoUpdated(oldManifesto, newManifesto, nonce);\\n } else if (operationType == uint8(OperationType.UPDATE_VOTING_DELAY)) {\\n uint48 newValue = uint48(bytes6(value));\\n uint256 oldValue = votingDelay();\\n _setVotingDelay(newValue);\\n emit GovernanceParameterUpdated(\\n OperationType.UPDATE_VOTING_DELAY,\\n oldValue,\\n newValue,\\n nonce\\n );\\n } else if (operationType == uint8(OperationType.UPDATE_VOTING_PERIOD)) {\\n uint32 newValue = uint32(bytes4(value));\\n uint256 oldValue = votingPeriod();\\n _setVotingPeriod(newValue);\\n emit GovernanceParameterUpdated(\\n OperationType.UPDATE_VOTING_PERIOD,\\n oldValue,\\n newValue,\\n nonce\\n );\\n } else if (operationType == uint8(OperationType.UPDATE_PROPOSAL_THRESHOLD)) {\\n uint256 newValue = abi.decode(value, (uint256));\\n uint256 oldValue = proposalThreshold();\\n _setProposalThreshold(newValue);\\n emit GovernanceParameterUpdated(\\n OperationType.UPDATE_PROPOSAL_THRESHOLD,\\n oldValue,\\n newValue,\\n nonce\\n );\\n } else if (operationType == uint8(OperationType.UPDATE_QUORUM)) {\\n uint256 newValue = abi.decode(value, (uint256));\\n uint256 oldValue = quorumNumerator();\\n _updateQuorumNumerator(newValue);\\n emit GovernanceParameterUpdated(OperationType.UPDATE_QUORUM, oldValue, newValue, nonce);\\n }\\n }\\n\\n // Required overrides\\n\\n function votingDelay() public view override(Governor, GovernorSettings) returns (uint256) {\\n return super.votingDelay();\\n }\\n\\n function votingPeriod() public view override(Governor, GovernorSettings) returns (uint256) {\\n return super.votingPeriod();\\n }\\n\\n function quorum(\\n uint256 blockNumber\\n ) public view override(Governor, GovernorVotesQuorumFraction) returns (uint256) {\\n return super.quorum(blockNumber);\\n }\\n\\n function proposalThreshold()\\n public\\n view\\n override(Governor, GovernorSettings)\\n returns (uint256)\\n {\\n return super.proposalThreshold();\\n }\\n}\\n\",\"keccak256\":\"0x9c3d392f452d79e03804790803c0f295a48390537eba2be45250a71219800bcc\",\"license\":\"GPL-3.0\"},\"contracts/variants/crosschain/ProofHandler.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity ^0.8.20;\\n\\n/**\\n * @title Proof Handler Library\\n * @author Web3 Hackers Collective\\n * @notice Library for standardized cross-chain proof generation and verification\\n * @dev Handles proof generation, verification, and tracking for cross-chain operations\\n * @custom:security-contact julien@strat.cc\\n */\\nlibrary ProofHandler {\\n /// @notice Tracks which proofs have been applied on each chain\\n struct ProofStorage {\\n mapping(bytes32 => bool) updateAppliedOnChain;\\n mapping(uint8 => uint256) currentNonce;\\n }\\n\\n /// @dev Emitted when a proof is claimed\\n event ProofClaimed(uint8 indexed operationType, bytes params, uint256 nonce);\\n\\n /**\\n * @notice Generates a proof for cross-chain operations\\n * @param contractAddress Address of contract generating the proof\\n * @param operationType Type of operation being performed\\n * @param params Operation parameters\\n * @param nonce Current nonce for this operation type\\n * @return proof Encoded proof data\\n */\\n function generateProof(\\n address contractAddress,\\n uint8 operationType,\\n bytes memory params,\\n uint256 nonce\\n ) public pure returns (bytes memory proof) {\\n bytes32 message = keccak256(\\n abi.encodePacked(contractAddress, operationType, params, nonce)\\n );\\n bytes32 digest = keccak256(abi.encodePacked(\\\"\\\\x19Ethereum Signed Message:\\\\n32\\\", message));\\n\\n return abi.encode(operationType, params, nonce, digest);\\n }\\n\\n /**\\n * @notice Verifies and claims a proof\\n * @param proof Proof to verify and claim\\n * @param contractAddress Address of contract claiming the proof\\n * @param storage_ Proof storage struct\\n * @return operationType The type of operation being performed\\n * @return params The operation parameters\\n * @return nonce The operation sequence number\\n */\\n function verifyAndClaimProof(\\n bytes memory proof,\\n address contractAddress,\\n ProofStorage storage storage_\\n ) public returns (uint8 operationType, bytes memory params, uint256 nonce) {\\n bytes32 digest;\\n (operationType, params, nonce, digest) = abi.decode(\\n proof,\\n (uint8, bytes, uint256, bytes32)\\n );\\n\\n bytes32 proofHash = keccak256(proof);\\n require(!storage_.updateAppliedOnChain[proofHash], \\\"Proof already claimed\\\");\\n require(nonce == storage_.currentNonce[operationType] + 1, \\\"Invalid nonce\\\");\\n\\n bytes32 message = keccak256(\\n abi.encodePacked(contractAddress, operationType, params, nonce)\\n );\\n bytes32 expectedDigest = keccak256(\\n abi.encodePacked(\\\"\\\\x19Ethereum Signed Message:\\\\n32\\\", message)\\n );\\n require(digest == expectedDigest, \\\"Invalid proof\\\");\\n\\n storage_.updateAppliedOnChain[proofHash] = true;\\n storage_.currentNonce[operationType] = nonce;\\n\\n emit ProofClaimed(operationType, params, nonce);\\n\\n return (operationType, params, nonce);\\n }\\n\\n /**\\n * @notice Gets the next nonce for an operation type\\n * @param storage_ Proof storage struct\\n * @param operationType Type of operation\\n * @return nonce Next nonce value\\n */\\n function getNextNonce(\\n ProofStorage storage storage_,\\n uint8 operationType\\n ) public view returns (uint256 nonce) {\\n return storage_.currentNonce[operationType] + 1;\\n }\\n\\n /**\\n * @notice Increments the nonce for an operation type\\n * @param storage_ Proof storage struct\\n * @param operationType Type of operation\\n * @return nonce New nonce value\\n */\\n function incrementNonce(\\n ProofStorage storage storage_,\\n uint8 operationType\\n ) public returns (uint256 nonce) {\\n storage_.currentNonce[operationType]++;\\n return storage_.currentNonce[operationType];\\n }\\n}\\n\",\"keccak256\":\"0x3719e47c508f29977d48842c5c1d27cce7cb289cbb592526f170f98135ff41a7\",\"license\":\"GPL-3.0\"}},\"version\":1}", + "bytecode": "0x6101a06040523480156200001257600080fd5b5060405162005684380380620056848339810160408190526200003591620007d4565b808785858589806200005b6040805180820190915260018152603160f81b602082015290565b6200006882600062000181565b610120526200007981600162000181565b61014052815160208084019190912060e052815190820120610100524660a0526200010760e05161010051604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f60208201529081019290925260608201524660808201523060a082015260009060c00160405160208183030381529060405280519060200120905090565b60805250503060c05260036200011e828262000930565b506200012c905083620001ba565b620001378262000220565b6200014281620002c7565b5050506001600160a01b0316610160526200015d8162000308565b50610180889052600b62000172878262000930565b50505050505050505062000a96565b6000602083511015620001a1576200019983620003a8565b9050620001b4565b81620001ae848262000930565b5060ff90505b92915050565b6008546040805165ffffffffffff928316815291831660208301527fc565b045403dc03c2eea82b81a0465edad9e2e7fc4d97e11421c209da93d7a93910160405180910390a16008805465ffffffffffff191665ffffffffffff92909216919091179055565b8063ffffffff16600003620002505760405163f1cfbf0560e01b8152600060048201526024015b60405180910390fd5b6008546040805163ffffffff66010000000000009093048316815291831660208301527f7e3f7f0708a84de9203036abaa450dccc85ad5ff52f78c170f3edb55cf5e8828910160405180910390a16008805463ffffffff90921666010000000000000263ffffffff60301b19909216919091179055565b60075460408051918252602082018390527fccb45da8d5717e6c4544694297c4ba5cf151d455c9bb0ed4fc7a38411bc05461910160405180910390a1600755565b606480821115620003375760405163243e544560e01b8152600481018390526024810182905260440162000247565b600062000343620003eb565b9050620003686200035362000407565b6200035e8562000489565b600a9190620004c3565b505060408051828152602081018590527f0553476bf02ef2726e8ce5ced78d63e26e602e4a2257b1f559418e24b4633997910160405180910390a1505050565b600080829050601f81511115620003d6578260405163305a27a960e01b8152600401620002479190620009fc565b8051620003e38262000a31565b179392505050565b6000620003f9600a620004e0565b6001600160d01b0316905090565b6000620004146101605190565b6001600160a01b03166391ddadf46040518163ffffffff1660e01b8152600401602060405180830381865afa92505050801562000470575060408051601f3d908101601f191682019092526200046d9181019062000a56565b60015b62000484576200047f62000530565b905090565b919050565b60006001600160d01b03821115620004bf576040516306dfcc6560e41b815260d060048201526024810183905260440162000247565b5090565b600080620004d38585856200053d565b915091505b935093915050565b8054600090801562000526576200050c83620004fe60018462000a74565b600091825260209091200190565b54660100000000000090046001600160d01b031662000529565b60005b9392505050565b60006200047f43620006a6565b825460009081908015620006475760006200055f87620004fe60018562000a74565b805490915065ffffffffffff80821691660100000000000090046001600160d01b0316908816821115620005a657604051632520601d60e01b815260040160405180910390fd5b8765ffffffffffff168265ffffffffffff1603620005e457825465ffffffffffff1666010000000000006001600160d01b0389160217835562000638565b6040805180820190915265ffffffffffff808a1682526001600160d01b03808a1660208085019182528d54600181018f5560008f815291909120945191519092166601000000000000029216919091179101555b9450859350620004d892505050565b50506040805180820190915265ffffffffffff80851682526001600160d01b0380851660208085019182528854600181018a5560008a8152918220955192519093166601000000000000029190931617920191909155905081620004d8565b600065ffffffffffff821115620004bf576040516306dfcc6560e41b8152603060048201526024810183905260440162000247565b634e487b7160e01b600052604160045260246000fd5b60005b838110156200070e578181015183820152602001620006f4565b50506000910152565b600082601f8301126200072957600080fd5b81516001600160401b0380821115620007465762000746620006db565b604051601f8301601f19908116603f01168101908282118183101715620007715762000771620006db565b816040528381528660208588010111156200078b57600080fd5b6200079e846020830160208901620006f1565b9695505050505050565b805165ffffffffffff811681146200048457600080fd5b805163ffffffff811681146200048457600080fd5b600080600080600080600080610100898b031215620007f257600080fd5b885160208a01519098506001600160a01b03811681146200081257600080fd5b60408a01519097506001600160401b03808211156200083057600080fd5b6200083e8c838d0162000717565b975060608b01519150808211156200085557600080fd5b50620008648b828c0162000717565b9550506200087560808a01620007a8565b93506200088560a08a01620007bf565b60c08a015160e0909a0151989b979a5095989497939692505050565b600181811c90821680620008b657607f821691505b602082108103620008d757634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200092b57600081815260208120601f850160051c81016020861015620009065750805b601f850160051c820191505b81811015620009275782815560010162000912565b5050505b505050565b81516001600160401b038111156200094c576200094c620006db565b62000964816200095d8454620008a1565b84620008dd565b602080601f8311600181146200099c5760008415620009835750858301515b600019600386901b1c1916600185901b17855562000927565b600085815260208120601f198616915b82811015620009cd57888601518255948401946001909101908401620009ac565b5085821015620009ec5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b602081526000825180602084015262000a1d816040850160208701620006f1565b601f01601f19169190910160400192915050565b80516020808301519190811015620008d75760001960209190910360031b1b16919050565b60006020828403121562000a6957600080fd5b6200052982620007a8565b81810381811115620001b457634e487b7160e01b600052601160045260246000fd5b60805160a05160c05160e0516101005161012051610140516101605161018051614b3762000b4d600039600081816107e201528181610b1501528181610d06015281816114e901528181611d1a01528181611f30015261206f015260008181610a90015281816111b60152818161180d01528181612b200152612d1101526000612aeb01526000612abe01526000612f3a01526000612f1201526000612e6d01526000612e9701526000612ec10152614b376000f3fe6080604052600436106102e85760003560e01c80637ecebe0011610190578063c01f9e37116100dc578063e2f3dce011610095578063ece40cc11161006f578063ece40cc114610a15578063f23a6e6114610a35578063f8ce560a14610a61578063fc0c546a14610a8157600080fd5b8063e2f3dce0146109c0578063e540d01d146109d5578063eb9019d4146109f557600080fd5b8063c01f9e37146108d3578063c28bc2fa146108f3578063c59057e414610906578063cc31491c14610926578063dd4e2ba514610946578063deaaa7cc1461098c57600080fd5b80639fa92f9d11610149578063ab58fb8e11610123578063ab58fb8e1461083a578063b47a321814610872578063b58131b014610892578063bc197c81146108a757600080fd5b80639fa92f9d146107d0578063a7713a7014610804578063a9a952941461081957600080fd5b80637ecebe00146106f257806384b0196e146107285780638ff262e31461075057806391ddadf41461077057806397c3d3341461079c5780639a802a6d146107b057600080fd5b80633e4f49e61161024f578063567813881161020857806360c4247f116101e257806360c4247f1461067257806379051887146106925780637b3c71d3146106b25780637d5e81e2146106d257600080fd5b806356781388146106125780635b8d0e0d146106325780635f398a141461065257600080fd5b80633e4f49e6146104e75780634385963214610514578063452115d61461055e5780634bf5d7e91461057e578063544ffc9c1461059357806354fd4d50146105e857600080fd5b8063160cbed7116102a1578063160cbed71461042b5780631985ba761461044b5780632656227d1461046b5780632d63f6931461047e5780632fe3e2611461049e5780633932abb1146104d257600080fd5b806301ffc9a7146102f657806302a251a31461032b57806306f3f9e61461035757806306fdde0314610377578063143489d014610399578063150b7a02146103e757600080fd5b366102f157005b005b600080fd5b34801561030257600080fd5b506103166103113660046137ad565b610ab4565b60405190151581526020015b60405180910390f35b34801561033757600080fd5b50600854600160301b900463ffffffff165b604051908152602001610322565b34801561036357600080fd5b506102ef6103723660046137d7565b610b0b565b34801561038357600080fd5b5061038c610c2a565b6040516103229190613840565b3480156103a557600080fd5b506103cf6103b43660046137d7565b6000908152600460205260409020546001600160a01b031690565b6040516001600160a01b039091168152602001610322565b3480156103f357600080fd5b5061041261040236600461392d565b630a85bd0160e11b949350505050565b6040516001600160e01b03199091168152602001610322565b34801561043757600080fd5b50610349610446366004613afe565b610cbc565b34801561045757600080fd5b506102ef610466366004613b8d565b610cfc565b610349610479366004613afe565b610ea2565b34801561048a57600080fd5b506103496104993660046137d7565b610fd5565b3480156104aa57600080fd5b506103497f3e83946653575f9a39005e1545185629e92736b7528ab20ca3816f315424a81181565b3480156104de57600080fd5b50610349610ff6565b3480156104f357600080fd5b506105076105023660046137d7565b611009565b6040516103229190613bf9565b34801561052057600080fd5b5061031661052f366004613c07565b60008281526009602090815260408083206001600160a01b038516845260030190915290205460ff1692915050565b34801561056a57600080fd5b50610349610579366004613afe565b611143565b34801561058a57600080fd5b5061038c6111b2565b34801561059f57600080fd5b506105cd6105ae3660046137d7565b6000908152600960205260409020805460018201546002909201549092565b60408051938452602084019290925290820152606001610322565b3480156105f457600080fd5b506040805180820190915260018152603160f81b602082015261038c565b34801561061e57600080fd5b5061034961062d366004613c42565b611274565b34801561063e57600080fd5b5061034961064d366004613cba565b61129d565b34801561065e57600080fd5b5061034961066d366004613d74565b6113fc565b34801561067e57600080fd5b5061034961068d3660046137d7565b611451565b34801561069e57600080fd5b506102ef6106ad366004613e0d565b6114df565b3480156106be57600080fd5b506103496106cd366004613e2a565b6115f0565b3480156106de57600080fd5b506103496106ed366004613e85565b611638565b3480156106fe57600080fd5b5061034961070d366004613f25565b6001600160a01b031660009081526002602052604090205490565b34801561073457600080fd5b5061073d6116f1565b6040516103229796959493929190613f7b565b34801561075c57600080fd5b5061034961076b366004613feb565b611737565b34801561077c57600080fd5b50610785611809565b60405165ffffffffffff9091168152602001610322565b3480156107a857600080fd5b506064610349565b3480156107bc57600080fd5b506103496107cb36600461403c565b611891565b3480156107dc57600080fd5b506103497f000000000000000000000000000000000000000000000000000000000000000081565b34801561081057600080fd5b506103496118a8565b34801561082557600080fd5b506103166108343660046137d7565b50600090565b34801561084657600080fd5b506103496108553660046137d7565b60009081526004602052604090206001015465ffffffffffff1690565b34801561087e57600080fd5b506102ef61088d366004613b8d565b6118c2565b34801561089e57600080fd5b50610349611c0e565b3480156108b357600080fd5b506104126108c2366004614092565b63bc197c8160e01b95945050505050565b3480156108df57600080fd5b506103496108ee3660046137d7565b611c19565b6102ef610901366004614121565b611c5c565b34801561091257600080fd5b50610349610921366004613afe565b611cdc565b34801561093257600080fd5b5061038c610941366004614162565b611d16565b34801561095257600080fd5b506040805180820190915260208082527f737570706f72743d627261766f2671756f72756d3d666f722c6162737461696e9082015261038c565b34801561099857600080fd5b506103497ff2aad550cf55f045cb27e9c559f9889fdfb6e6cdaa032301d6ea397784ae51d781565b3480156109cc57600080fd5b5061038c611e98565b3480156109e157600080fd5b506102ef6109f03660046141b1565b611f26565b348015610a0157600080fd5b50610349610a103660046141d7565b612044565b348015610a2157600080fd5b506102ef610a303660046137d7565b612065565b348015610a4157600080fd5b50610412610a50366004614201565b63f23a6e6160e01b95945050505050565b348015610a6d57600080fd5b50610349610a7c3660046137d7565b612148565b348015610a8d57600080fd5b507f00000000000000000000000000000000000000000000000000000000000000006103cf565b60006001600160e01b031982166332a2ad4360e11b1480610ae557506001600160e01b03198216630271189760e51b145b80610b0057506301ffc9a760e01b6001600160e01b03198316145b92915050565b905090565b610b13612153565b7f00000000000000000000000000000000000000000000000000000000000000004614610b5b5760405162461bcd60e51b8152600401610b5290614265565b60405180910390fd5b604051633b0d4dd760e01b8152600c6004828101919091526024820152600090730152ee45780385dACCCCB128D816031CfFe5F36B90633b0d4dd790604401602060405180830381865af4158015610bb7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bdb91906142a9565b90506000610be76118a8565b9050610bf28361218b565b60045b6040805183815260208101869052908101849052600080516020614ae2833981519152906060015b60405180910390a2505050565b606060038054610c39906142c2565b80601f0160208091040260200160405190810160405280929190818152602001828054610c65906142c2565b8015610cb25780601f10610c8757610100808354040283529160200191610cb2565b820191906000526020600020905b815481529060010190602001808311610c9557829003601f168201915b5050505050905090565b600080610ccb86868686611cdc565b9050610ce081610cdb6004612219565b61223c565b506000604051634844252360e11b815260040160405180910390fd5b610d04612153565b7f00000000000000000000000000000000000000000000000000000000000000004614610d435760405162461bcd60e51b8152600401610b5290614265565b604051633b0d4dd760e01b8152600c600482015260006024820181905290730152ee45780385dACCCCB128D816031CfFe5F36B90633b0d4dd790604401602060405180830381865af4158015610d9d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dc191906142a9565b90506000600b8054610dd2906142c2565b80601f0160208091040260200160405190810160405280929190818152602001828054610dfe906142c2565b8015610e4b5780601f10610e2057610100808354040283529160200191610e4b565b820191906000526020600020905b815481529060010190602001808311610e2e57829003601f168201915b5050505050905082600b9081610e619190614347565b507f67c6aa39e9b4a701119ddc2f40a18145fff9b6f4fa224d5f29c28755f719ffb2818484604051610e9593929190614406565b60405180910390a1505050565b600080610eb186868686611cdc565b9050610ed181610ec16005612219565b610ecb6004612219565b1761223c565b506000818152600460205260409020805460ff60f01b1916600160f01b17905530610ef93090565b6001600160a01b031614610f8b5760005b8651811015610f8957306001600160a01b0316878281518110610f2f57610f2f61443c565b60200260200101516001600160a01b031603610f7957610f79858281518110610f5a57610f5a61443c565b602002602001015180519060200120600561227b90919063ffffffff16565b610f8281614468565b9050610f0a565b505b610f9881878787876122dd565b6040518181527f712ae1383f79ac853f8d882153778e0260ef8f03b504e2866e0593e04d2b291f906020015b60405180910390a195945050505050565b600090815260046020526040902054600160a01b900465ffffffffffff1690565b6000610b0660085465ffffffffffff1690565b6000818152600460205260408120805460ff600160f01b8204811691600160f81b900416811561103e57506007949350505050565b801561104f57506002949350505050565b600061105a86610fd5565b90508060000361108057604051636ad0607560e01b815260048101879052602401610b52565b600061108a611809565b65ffffffffffff1690508082106110a8575060009695505050505050565b60006110b388611c19565b90508181106110ca57506001979650505050505050565b6110d3886123bd565b15806110f357506000888152600960205260409020805460019091015411155b1561110657506003979650505050505050565b60008881526004602052604090206001015465ffffffffffff1660000361113557506004979650505050505050565b506005979650505050505050565b60008061115286868686611cdc565b905061116281610cdb6000612219565b506000818152600460205260409020546001600160a01b0316331461119c5760405163233d98e360e01b8152336004820152602401610b52565b6111a8868686866123f4565b9695505050505050565b60607f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316634bf5d7e96040518163ffffffff1660e01b8152600401600060405180830381865afa92505050801561123357506040513d6000823e601f3d908101601f1916820160405261123091908101906144b1565b60015b61126f575060408051808201909152601d81527f6d6f64653d626c6f636b6e756d6265722666726f6d3d64656661756c74000000602082015290565b919050565b600080339050611295848285604051806020016040528060008152506124a5565b949350505050565b6000806113808761137a7f3e83946653575f9a39005e1545185629e92736b7528ab20ca3816f315424a8118c8c8c6112f28e6001600160a01b0316600090815260026020526040902080546001810190915590565b8d8d6040516113029291906144f9565b60405180910390208c8051906020012060405160200161135f9796959493929190968752602087019590955260ff9390931660408601526001600160a01b03919091166060850152608084015260a083015260c082015260e00190565b604051602081830303815290604052805190602001206124d1565b856124fe565b9050806113ab576040516394ab6c0760e01b81526001600160a01b0388166004820152602401610b52565b6113ef89888a89898080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508b9250612572915050565b9998505050505050505050565b60008033905061144687828888888080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508a9250612572915050565b979650505050505050565b600a80546000918290611465600184614509565b815481106114755761147561443c565b6000918252602090912001805490915065ffffffffffff811690600160301b90046001600160d01b03168582116114b8576001600160d01b031695945050505050565b6114cc6114c487612654565b600a9061268b565b6001600160d01b03169695505050505050565b6114e7612153565b7f000000000000000000000000000000000000000000000000000000000000000046146115265760405162461bcd60e51b8152600401610b5290614265565b604051633b0d4dd760e01b8152600c600482015260016024820152600090730152ee45780385dACCCCB128D816031CfFe5F36B90633b0d4dd790604401602060405180830381865af4158015611580573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115a491906142a9565b905060006115b0610ff6565b90506115bb83612740565b60016040805183815265ffffffffffff86166020820152908101849052600080516020614ae283398151915290606001610c1d565b6000803390506111a886828787878080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506124a592505050565b60003361164581846127a6565b61166d5760405163d9b3955760e01b81526001600160a01b0382166004820152602401610b52565b6000611677611c0e565b905080156116e45760006116a683600161168f611809565b611699919061451c565b65ffffffffffff16612044565b9050818110156116e257604051636121770b60e11b81526001600160a01b03841660048201526024810182905260448101839052606401610b52565b505b6114468787878786612897565b600060608060008060006060611705612ab7565b61170d612ae4565b60408051600080825260208201909252600f60f81b9b939a50919850469750309650945092509050565b6000806117c38461137a7ff2aad550cf55f045cb27e9c559f9889fdfb6e6cdaa032301d6ea397784ae51d789898961178c8b6001600160a01b0316600090815260026020526040902080546001810190915590565b60408051602081019690965285019390935260ff90911660608401526001600160a01b0316608083015260a082015260c00161135f565b9050806117ee576040516394ab6c0760e01b81526001600160a01b0385166004820152602401610b52565b6111a8868587604051806020016040528060008152506124a5565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166391ddadf46040518163ffffffff1660e01b8152600401602060405180830381865afa925050508015611885575060408051601f3d908101601f1916820190925261188291810190614542565b60015b61126f57610b06612b11565b600061189e848484612b1c565b90505b9392505050565b60006118b4600a612bb2565b6001600160d01b0316905090565b6000806000730152ee45780385dACCCCB128D816031CfFe5F36B63c0af65918530600c6040518463ffffffff1660e01b81526004016119039392919061455f565b600060405180830381865af4158015611920573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261194891908101906145ad565b9194509250905060ff8316611a505760008280602001905181019061196d91906144b1565b90506000600b805461197e906142c2565b80601f01602080910402602001604051908101604052809291908181526020018280546119aa906142c2565b80156119f75780601f106119cc576101008083540402835291602001916119f7565b820191906000526020600020905b8154815290600101906020018083116119da57829003601f168201915b5050505050905081600b9081611a0d9190614347565b507f67c6aa39e9b4a701119ddc2f40a18145fff9b6f4fa224d5f29c28755f719ffb2818385604051611a4193929190614406565b60405180910390a15050611c08565b60001960ff841601611ac1576000611a6783614606565b60d01c90506000611a76610ff6565b9050611a8182612740565b60016040805183815265ffffffffffff85166020820152908101859052600080516020614ae2833981519152906060015b60405180910390a25050611c08565b60011960ff841601611b34576000611ad88361463d565b60e01c90506000611af660085463ffffffff600160301b9091041690565b9050611b0182612beb565b60026040805183815263ffffffff85166020820152908101859052600080516020614ae283398151915290606001611ab2565b60021960ff841601611b9b57600082806020019051810190611b5691906142a9565b90506000611b62611c0e565b9050611b6d82612c89565b60036040805183815260208101859052908101859052600080516020614ae283398151915290606001611ab2565b60031960ff841601611c0857600082806020019051810190611bbd91906142a9565b90506000611bc96118a8565b9050611bd48261218b565b60046040805183815260208101859052908101859052600080516020614ae28339815191529060600160405180910390a250505b50505050565b6000610b0660075490565b600081815260046020526040812054611c4e90600160d01b810463ffffffff1690600160a01b900465ffffffffffff16614670565b65ffffffffffff1692915050565b611c64612153565b600080856001600160a01b0316858585604051611c829291906144f9565b60006040518083038185875af1925050503d8060008114611cbf576040519150601f19603f3d011682016040523d82523d6000602084013e611cc4565b606091505b5091509150611cd38282612cca565b50505050505050565b600084848484604051602001611cf5949392919061471a565b60408051601f19818403018152919052805160209091012095945050505050565b60607f00000000000000000000000000000000000000000000000000000000000000004614611d935760405162461bcd60e51b815260206004820152602360248201527f50726f6f6673206f6e6c792067656e657261746564206f6e20686f6d6520636860448201526230b4b760e91b6064820152608401610b52565b604051630564edeb60e31b8152600c600482015260ff84166024820152600090730152ee45780385dACCCCB128D816031CfFe5F36B90632b276f5890604401602060405180830381865af4158015611def573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e1391906142a9565b604051637352178160e01b8152909150730152ee45780385dACCCCB128D816031CfFe5F36B90637352178190611e53903090889088908790600401614765565b600060405180830381865af4158015611e70573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261129591908101906147a3565b600b8054611ea5906142c2565b80601f0160208091040260200160405190810160405280929190818152602001828054611ed1906142c2565b8015611f1e5780601f10611ef357610100808354040283529160200191611f1e565b820191906000526020600020905b815481529060010190602001808311611f0157829003601f168201915b505050505081565b611f2e612153565b7f00000000000000000000000000000000000000000000000000000000000000004614611f6d5760405162461bcd60e51b8152600401610b5290614265565b604051633b0d4dd760e01b8152600c600482015260026024820152600090730152ee45780385dACCCCB128D816031CfFe5F36B90633b0d4dd790604401602060405180830381865af4158015611fc7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611feb91906142a9565b9050600061200660085463ffffffff600160301b9091041690565b905061201183612beb565b60026040805183815263ffffffff86166020820152908101849052600080516020614ae283398151915290606001610c1d565b60006118a1838361206060408051602081019091526000815290565b612b1c565b61206d612153565b7f000000000000000000000000000000000000000000000000000000000000000046146120ac5760405162461bcd60e51b8152600401610b5290614265565b604051633b0d4dd760e01b8152600c600482015260036024820152600090730152ee45780385dACCCCB128D816031CfFe5F36B90633b0d4dd790604401602060405180830381865af4158015612106573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061212a91906142a9565b90506000612136611c0e565b905061214183612c89565b6003610bf5565b6000610b0082612ce6565b303314612175576040516347096e4760e01b8152336004820152602401610b52565b565b806121826005612d90565b03612177575b50565b6064808211156121b85760405163243e544560e01b81526004810183905260248101829052604401610b52565b60006121c26118a8565b90506121e16121cf611809565b6121d885612dff565b600a9190612e33565b505060408051828152602081018590527f0553476bf02ef2726e8ce5ced78d63e26e602e4a2257b1f559418e24b46339979101610e95565b600081600781111561222d5761222d613bc1565b600160ff919091161b92915050565b60008061224884611009565b905060008361225683612219565b16036118a1578381846040516331b75e4d60e01b8152600401610b52939291906147d7565b81546001600160801b03600160801b8204811691811660018301909116036122a7576122a76041612e4e565b6001600160801b03808216600090815260018086016020526040909120939093558354919092018216600160801b029116179055565b60005b84518110156123b5576000808683815181106122fe576122fe61443c565b60200260200101516001600160a01b03168684815181106123215761232161443c565b602002602001015186858151811061233b5761233b61443c565b602002602001015160405161235091906147f9565b60006040518083038185875af1925050503d806000811461238d576040519150601f19603f3d011682016040523d82523d6000602084013e612392565b606091505b50915091506123a18282612cca565b505050806123ae90614468565b90506122e0565b505050505050565b6000818152600960205260408120600281015460018201546123df9190614815565b6123eb610a7c85610fd5565b11159392505050565b60008061240386868686611cdc565b9050612451816124136007612219565b61241d6006612219565b6124276002612219565b6001612434600782614828565b61243f906002614925565b6124499190614509565b18181861223c565b506000818152600460205260409081902080546001600160f81b0316600160f81b179055517f789cf55be980739dad1d0699b93b58e806b51c9d96619bfa8fe0a28abaa7b30c90610fc49083815260200190565b60006124c8858585856124c360408051602081019091526000815290565b612572565b95945050505050565b6000610b006124de612e60565b8360405161190160f01b8152600281019290925260228201526042902090565b6000836001600160a01b03163b6000036125605760008061251f8585612f8b565b509092509050600081600381111561253957612539613bc1565b1480156125575750856001600160a01b0316826001600160a01b0316145b925050506118a1565b61256b848484612fd8565b90506118a1565b600061258286610cdb6001612219565b5060006125988661259289610fd5565b85612b1c565b905060006125a988888885886130b3565b9050835160000361260057866001600160a01b03167fb8e138887d0aa13bab447e82de9d5c1777041ecd21ca36ba824ff1e6c07ddda4898884896040516125f39493929190614934565b60405180910390a2611446565b866001600160a01b03167fe2babfbac5889a709b63bb7f598b324e08bc5a4fb9ec647fb3cbc9ec07eb8712898884898960405161264195949392919061495c565b60405180910390a2979650505050505050565b600065ffffffffffff821115612687576040516306dfcc6560e41b81526030600482015260248101839052604401610b52565b5090565b8154600090818160058111156126ea5760006126a6846131b6565b6126b09085614509565b60008881526020902090915081015465ffffffffffff90811690871610156126da578091506126e8565b6126e5816001614815565b92505b505b60006126f88787858561330f565b905080156127335761271d8761270f600184614509565b600091825260209091200190565b54600160301b90046001600160d01b0316611446565b6000979650505050505050565b6008546040805165ffffffffffff928316815291831660208301527fc565b045403dc03c2eea82b81a0465edad9e2e7fc4d97e11421c209da93d7a93910160405180910390a16008805465ffffffffffff191665ffffffffffff92909216919091179055565b805160009060348110156127be576001915050610b00565b82810160131901516001600160a01b031981166b046e0e4dee0dee6cae47a60f60a31b146127f157600192505050610b00565b6000806127ff602885614509565b90505b83811015612876576000806128368884815181106128225761282261443c565b01602001516001600160f81b031916613371565b915091508161284e5760019650505050505050610b00565b8060ff166004856001600160a01b0316901b17935050508061286f90614468565b9050612802565b50856001600160a01b0316816001600160a01b031614935050505092915050565b60006128ac8686868680519060200120611cdc565b9050845186511415806128c157508351865114155b806128cb57508551155b1561290057855184518651604051630447b05d60e41b8152600481019390935260248301919091526044820152606401610b52565b600081815260046020526040902054600160a01b900465ffffffffffff161561294b578061292d82611009565b6040516331b75e4d60e01b8152610b529291906000906004016147d7565b6000612955610ff6565b61295d611809565b65ffffffffffff1661296f9190614815565b9050600061298a60085463ffffffff600160301b9091041690565b600084815260046020526040902080546001600160a01b0319166001600160a01b0387161781559091506129bd83612654565b815465ffffffffffff91909116600160a01b0265ffffffffffff60a01b199091161781556129ea82613403565b815463ffffffff91909116600160d01b0263ffffffff60d01b1990911617815588517f7d84a6263ae0d98d3329bd7b46bb4e8d6f98cd35a7adb45c274c8b7fd5ebd5e090859087908c908c906001600160401b03811115612a4d57612a4d61386a565b604051908082528060200260200182016040528015612a8057816020015b6060815260200190600190039081612a6b5790505b508c89612a8d8a82614815565b8e604051612aa3999897969594939291906149a2565b60405180910390a150505095945050505050565b6060610b067f00000000000000000000000000000000000000000000000000000000000000006000613434565b6060610b067f00000000000000000000000000000000000000000000000000000000000000006001613434565b6000610b0643612654565b60007f0000000000000000000000000000000000000000000000000000000000000000604051630748d63560e31b81526001600160a01b038681166004830152602482018690529190911690633a46b1a890604401602060405180830381865afa158015612b8e573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061189e91906142a9565b80546000908015612be257612bcc8361270f600184614509565b54600160301b90046001600160d01b03166118a1565b60009392505050565b8063ffffffff16600003612c155760405163f1cfbf0560e01b815260006004820152602401610b52565b6008546040805163ffffffff600160301b9093048316815291831660208301527f7e3f7f0708a84de9203036abaa450dccc85ad5ff52f78c170f3edb55cf5e8828910160405180910390a16008805463ffffffff909216600160301b0269ffffffff00000000000019909216919091179055565b60075460408051918252602082018390527fccb45da8d5717e6c4544694297c4ba5cf151d455c9bb0ed4fc7a38411bc05461910160405180910390a1600755565b606082612cdf57612cda826134df565b610b00565b5080610b00565b60006064612cf383611451565b604051632394e7a360e21b8152600481018590526001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001690638e539e8c90602401602060405180830381865afa158015612d58573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612d7c91906142a9565b612d869190614a79565b610b009190614aa6565b80546000906001600160801b0380821691600160801b9004168103612db957612db96031612e4e565b6001600160801b038181166000908152600185810160205260408220805492905585546fffffffffffffffffffffffffffffffff19169301909116919091179092555090565b60006001600160d01b03821115612687576040516306dfcc6560e41b815260d0600482015260248101839052604401610b52565b600080612e41858585613508565b915091505b935093915050565b634e487b71600052806020526024601cfd5b6000306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016148015612eb957507f000000000000000000000000000000000000000000000000000000000000000046145b15612ee357507f000000000000000000000000000000000000000000000000000000000000000090565b610b06604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f60208201527f0000000000000000000000000000000000000000000000000000000000000000918101919091527f000000000000000000000000000000000000000000000000000000000000000060608201524660808201523060a082015260009060c00160405160208183030381529060405280519060200120905090565b60008060008351604103612fc55760208401516040850151606086015160001a612fb78882858561365c565b955095509550505050612fd1565b50508151600091506002905b9250925092565b6000806000856001600160a01b03168585604051602401612ffa929190614ac8565b60408051601f198184030181529181526020820180516001600160e01b0316630b135d3f60e11b1790525161302f91906147f9565b600060405180830381855afa9150503d806000811461306a576040519150601f19603f3d011682016040523d82523d6000602084013e61306f565b606091505b509150915081801561308357506020815110155b80156111a857508051630b135d3f60e11b906130a890830160209081019084016142a9565b149695505050505050565b60008581526009602090815260408083206001600160a01b03881684526003810190925282205460ff1615613106576040516371c6af4960e01b81526001600160a01b0387166004820152602401610b52565b6001600160a01b03861660009081526003820160205260409020805460ff1916600117905560ff851661315257838160000160008282546131479190614815565b909155506131ab9050565b60001960ff86160161317257838160010160008282546131479190614815565b60011960ff86160161319257838160020160008282546131479190614815565b6040516303599be160e11b815260040160405180910390fd5b509195945050505050565b6000600182116131c4575090565b816001600160801b82106131dd5760809190911c9060401b5b6801000000000000000082106131f85760409190911c9060201b5b640100000000821061320f5760209190911c9060101b5b6201000082106132245760109190911c9060081b5b61010082106132385760089190911c9060041b5b6010821061324b5760049190911c9060021b5b600482106132575760011b5b600302600190811c9081858161326f5761326f614a90565b048201901c9050600181858161328757613287614a90565b048201901c9050600181858161329f5761329f614a90565b048201901c905060018185816132b7576132b7614a90565b048201901c905060018185816132cf576132cf614a90565b048201901c905060018185816132e7576132e7614a90565b048201901c905061330681858161330057613300614a90565b04821190565b90039392505050565b60005b81831015613369576000613326848461372b565b60008781526020902090915065ffffffffffff86169082015465ffffffffffff16111561335557809250613363565b613360816001614815565b93505b50613312565b509392505050565b60008060f883901c602f8111801561338c5750603a8160ff16105b156133a157600194602f199091019350915050565b8060ff1660401080156133b7575060478160ff16105b156133cc576001946036199091019350915050565b8060ff1660601080156133e2575060678160ff16105b156133f7576001946056199091019350915050565b50600093849350915050565b600063ffffffff821115612687576040516306dfcc6560e41b81526020600482015260248101839052604401610b52565b606060ff831461344e5761344783613746565b9050610b00565b81805461345a906142c2565b80601f0160208091040260200160405190810160405280929190818152602001828054613486906142c2565b80156134d35780601f106134a8576101008083540402835291602001916134d3565b820191906000526020600020905b8154815290600101906020018083116134b657829003601f168201915b50505050509050610b00565b8051156134ef5780518082602001fd5b60405163d6bda27560e01b815260040160405180910390fd5b8254600090819080156136015760006135268761270f600185614509565b805490915065ffffffffffff80821691600160301b90046001600160d01b031690881682111561356957604051632520601d60e01b815260040160405180910390fd5b8765ffffffffffff168265ffffffffffff16036135a257825465ffffffffffff16600160301b6001600160d01b038916021783556135f3565b6040805180820190915265ffffffffffff808a1682526001600160d01b03808a1660208085019182528d54600181018f5560008f81529190912094519151909216600160301b029216919091179101555b9450859350612e4692505050565b50506040805180820190915265ffffffffffff80851682526001600160d01b0380851660208085019182528854600181018a5560008a815291822095519251909316600160301b029190931617920191909155905081612e46565b600080807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08411156136975750600091506003905082613721565b604080516000808252602082018084528a905260ff891692820192909252606081018790526080810186905260019060a0016020604051602081039080840390855afa1580156136eb573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b03811661371757506000925060019150829050613721565b9250600091508190505b9450945094915050565b600061373a6002848418614aa6565b6118a190848416614815565b6060600061375383613785565b604080516020808252818301909252919250600091906020820181803683375050509182525060208101929092525090565b600060ff8216601f811115610b0057604051632cd44ac360e21b815260040160405180910390fd5b6000602082840312156137bf57600080fd5b81356001600160e01b0319811681146118a157600080fd5b6000602082840312156137e957600080fd5b5035919050565b60005b8381101561380b5781810151838201526020016137f3565b50506000910152565b6000815180845261382c8160208601602086016137f0565b601f01601f19169290920160200192915050565b6020815260006118a16020830184613814565b80356001600160a01b038116811461126f57600080fd5b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b03811182821017156138a8576138a861386a565b604052919050565b60006001600160401b038211156138c9576138c961386a565b50601f01601f191660200190565b600082601f8301126138e857600080fd5b81356138fb6138f6826138b0565b613880565b81815284602083860101111561391057600080fd5b816020850160208301376000918101602001919091529392505050565b6000806000806080858703121561394357600080fd5b61394c85613853565b935061395a60208601613853565b92506040850135915060608501356001600160401b0381111561397c57600080fd5b613988878288016138d7565b91505092959194509250565b60006001600160401b038211156139ad576139ad61386a565b5060051b60200190565b600082601f8301126139c857600080fd5b813560206139d86138f683613994565b82815260059290921b840181019181810190868411156139f757600080fd5b8286015b84811015613a1957613a0c81613853565b83529183019183016139fb565b509695505050505050565b600082601f830112613a3557600080fd5b81356020613a456138f683613994565b82815260059290921b84018101918181019086841115613a6457600080fd5b8286015b84811015613a195780358352918301918301613a68565b600082601f830112613a9057600080fd5b81356020613aa06138f683613994565b82815260059290921b84018101918181019086841115613abf57600080fd5b8286015b84811015613a195780356001600160401b03811115613ae25760008081fd5b613af08986838b01016138d7565b845250918301918301613ac3565b60008060008060808587031215613b1457600080fd5b84356001600160401b0380821115613b2b57600080fd5b613b37888389016139b7565b95506020870135915080821115613b4d57600080fd5b613b5988838901613a24565b94506040870135915080821115613b6f57600080fd5b50613b7c87828801613a7f565b949793965093946060013593505050565b600060208284031215613b9f57600080fd5b81356001600160401b03811115613bb557600080fd5b611295848285016138d7565b634e487b7160e01b600052602160045260246000fd5b60088110613bf557634e487b7160e01b600052602160045260246000fd5b9052565b60208101610b008284613bd7565b60008060408385031215613c1a57600080fd5b82359150613c2a60208401613853565b90509250929050565b60ff8116811461218857600080fd5b60008060408385031215613c5557600080fd5b823591506020830135613c6781613c33565b809150509250929050565b60008083601f840112613c8457600080fd5b5081356001600160401b03811115613c9b57600080fd5b602083019150836020828501011115613cb357600080fd5b9250929050565b600080600080600080600060c0888a031215613cd557600080fd5b873596506020880135613ce781613c33565b9550613cf560408901613853565b945060608801356001600160401b0380821115613d1157600080fd5b613d1d8b838c01613c72565b909650945060808a0135915080821115613d3657600080fd5b613d428b838c016138d7565b935060a08a0135915080821115613d5857600080fd5b50613d658a828b016138d7565b91505092959891949750929550565b600080600080600060808688031215613d8c57600080fd5b853594506020860135613d9e81613c33565b935060408601356001600160401b0380821115613dba57600080fd5b613dc689838a01613c72565b90955093506060880135915080821115613ddf57600080fd5b50613dec888289016138d7565b9150509295509295909350565b65ffffffffffff8116811461218857600080fd5b600060208284031215613e1f57600080fd5b81356118a181613df9565b60008060008060608587031215613e4057600080fd5b843593506020850135613e5281613c33565b925060408501356001600160401b03811115613e6d57600080fd5b613e7987828801613c72565b95989497509550505050565b60008060008060808587031215613e9b57600080fd5b84356001600160401b0380821115613eb257600080fd5b613ebe888389016139b7565b95506020870135915080821115613ed457600080fd5b613ee088838901613a24565b94506040870135915080821115613ef657600080fd5b613f0288838901613a7f565b93506060870135915080821115613f1857600080fd5b50613988878288016138d7565b600060208284031215613f3757600080fd5b6118a182613853565b600081518084526020808501945080840160005b83811015613f7057815187529582019590820190600101613f54565b509495945050505050565b60ff60f81b8816815260e060208201526000613f9a60e0830189613814565b8281036040840152613fac8189613814565b606084018890526001600160a01b038716608085015260a0840186905283810360c08501529050613fdd8185613f40565b9a9950505050505050505050565b6000806000806080858703121561400157600080fd5b84359350602085013561401381613c33565b925061402160408601613853565b915060608501356001600160401b0381111561397c57600080fd5b60008060006060848603121561405157600080fd5b61405a84613853565b92506020840135915060408401356001600160401b0381111561407c57600080fd5b614088868287016138d7565b9150509250925092565b600080600080600060a086880312156140aa57600080fd5b6140b386613853565b94506140c160208701613853565b935060408601356001600160401b03808211156140dd57600080fd5b6140e989838a01613a24565b945060608801359150808211156140ff57600080fd5b61410b89838a01613a24565b93506080880135915080821115613ddf57600080fd5b6000806000806060858703121561413757600080fd5b61414085613853565b93506020850135925060408501356001600160401b03811115613e6d57600080fd5b6000806040838503121561417557600080fd5b823561418081613c33565b915060208301356001600160401b0381111561419b57600080fd5b6141a7858286016138d7565b9150509250929050565b6000602082840312156141c357600080fd5b813563ffffffff811681146118a157600080fd5b600080604083850312156141ea57600080fd5b6141f383613853565b946020939093013593505050565b600080600080600060a0868803121561421957600080fd5b61422286613853565b945061423060208701613853565b9350604086013592506060860135915060808601356001600160401b0381111561425957600080fd5b613dec888289016138d7565b60208082526024908201527f4f7065726174696f6e206f6e6c7920616c6c6f776564206f6e20686f6d6520636040820152633430b4b760e11b606082015260800190565b6000602082840312156142bb57600080fd5b5051919050565b600181811c908216806142d657607f821691505b6020821081036142f657634e487b7160e01b600052602260045260246000fd5b50919050565b601f82111561434257600081815260208120601f850160051c810160208610156143235750805b601f850160051c820191505b818110156123b55782815560010161432f565b505050565b81516001600160401b038111156143605761436061386a565b6143748161436e84546142c2565b846142fc565b602080601f8311600181146143a957600084156143915750858301515b600019600386901b1c1916600185901b1785556123b5565b600085815260208120601f198616915b828110156143d8578886015182559484019460019091019084016143b9565b50858210156143f65787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6060815260006144196060830186613814565b828103602084015261442b8186613814565b915050826040830152949350505050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60006001820161447a5761447a614452565b5060010190565b600061448f6138f6846138b0565b90508281528383830111156144a357600080fd5b6118a18360208301846137f0565b6000602082840312156144c357600080fd5b81516001600160401b038111156144d957600080fd5b8201601f810184136144ea57600080fd5b61129584825160208401614481565b8183823760009101908152919050565b81810381811115610b0057610b00614452565b65ffffffffffff82811682821603908082111561453b5761453b614452565b5092915050565b60006020828403121561455457600080fd5b81516118a181613df9565b6060815260006145726060830186613814565b6001600160a01b039490941660208301525060400152919050565b600082601f83011261459e57600080fd5b6118a183835160208501614481565b6000806000606084860312156145c257600080fd5b83516145cd81613c33565b60208501519093506001600160401b038111156145e957600080fd5b6145f58682870161458d565b925050604084015190509250925092565b805160208201516001600160d01b031980821692919060068310156146355780818460060360031b1b83161693505b505050919050565b805160208201516001600160e01b031980821692919060048310156146355760049290920360031b82901b161692915050565b65ffffffffffff81811683821601908082111561453b5761453b614452565b600081518084526020808501945080840160005b83811015613f705781516001600160a01b0316875295820195908201906001016146a3565b6000815180845260208085019450848260051b860182860160005b8581101561470d5783830389526146fb838351613814565b988501989250908401906001016146e3565b5090979650505050505050565b60808152600061472d608083018761468f565b828103602084015261473f8187613f40565b9050828103604084015261475381866146c8565b91505082606083015295945050505050565b6001600160a01b038516815260ff8416602082015260806040820181905260009061479290830185613814565b905082606083015295945050505050565b6000602082840312156147b557600080fd5b81516001600160401b038111156147cb57600080fd5b6112958482850161458d565b838152606081016147eb6020830185613bd7565b826040830152949350505050565b6000825161480b8184602087016137f0565b9190910192915050565b80820180821115610b0057610b00614452565b60ff8181168382160190811115610b0057610b00614452565b600181815b8085111561487c57816000190482111561486257614862614452565b8085161561486f57918102915b93841c9390800290614846565b509250929050565b60008261489357506001610b00565b816148a057506000610b00565b81600181146148b657600281146148c0576148dc565b6001915050610b00565b60ff8411156148d1576148d1614452565b50506001821b610b00565b5060208310610133831016604e8410600b84101617156148ff575081810a610b00565b6149098383614841565b806000190482111561491d5761491d614452565b029392505050565b60006118a160ff841683614884565b84815260ff841660208201528260408201526080606082015260006111a86080830184613814565b85815260ff8516602082015283604082015260a06060820152600061498460a0830185613814565b82810360808401526149968185613814565b98975050505050505050565b60006101208b8352602060018060a01b038c16818501528160408501526149cb8285018c61468f565b915083820360608501526149df828b613f40565b915083820360808501528189518084528284019150828160051b850101838c0160005b83811015614a3057601f19878403018552614a1e838351613814565b94860194925090850190600101614a02565b505086810360a0880152614a44818c6146c8565b9450505050508560c08401528460e0840152828103610100840152614a698185613814565b9c9b505050505050505050505050565b8082028115828204841417610b0057610b00614452565b634e487b7160e01b600052601260045260246000fd5b600082614ac357634e487b7160e01b600052601260045260246000fd5b500490565b82815260406020820152600061189e604083018461381456fe80c51ad8a7db1a7a86cc355b77bd5cd7ea08f6071ea91d85a8f792734700a0eca26469706673582212205c5a83ff074db246f409ffc8bc5a5c810ce8a95783beb88564ba8a597a7cef8c64736f6c63430008140033", + "deployedBytecode": "0x6080604052600436106102e85760003560e01c80637ecebe0011610190578063c01f9e37116100dc578063e2f3dce011610095578063ece40cc11161006f578063ece40cc114610a15578063f23a6e6114610a35578063f8ce560a14610a61578063fc0c546a14610a8157600080fd5b8063e2f3dce0146109c0578063e540d01d146109d5578063eb9019d4146109f557600080fd5b8063c01f9e37146108d3578063c28bc2fa146108f3578063c59057e414610906578063cc31491c14610926578063dd4e2ba514610946578063deaaa7cc1461098c57600080fd5b80639fa92f9d11610149578063ab58fb8e11610123578063ab58fb8e1461083a578063b47a321814610872578063b58131b014610892578063bc197c81146108a757600080fd5b80639fa92f9d146107d0578063a7713a7014610804578063a9a952941461081957600080fd5b80637ecebe00146106f257806384b0196e146107285780638ff262e31461075057806391ddadf41461077057806397c3d3341461079c5780639a802a6d146107b057600080fd5b80633e4f49e61161024f578063567813881161020857806360c4247f116101e257806360c4247f1461067257806379051887146106925780637b3c71d3146106b25780637d5e81e2146106d257600080fd5b806356781388146106125780635b8d0e0d146106325780635f398a141461065257600080fd5b80633e4f49e6146104e75780634385963214610514578063452115d61461055e5780634bf5d7e91461057e578063544ffc9c1461059357806354fd4d50146105e857600080fd5b8063160cbed7116102a1578063160cbed71461042b5780631985ba761461044b5780632656227d1461046b5780632d63f6931461047e5780632fe3e2611461049e5780633932abb1146104d257600080fd5b806301ffc9a7146102f657806302a251a31461032b57806306f3f9e61461035757806306fdde0314610377578063143489d014610399578063150b7a02146103e757600080fd5b366102f157005b005b600080fd5b34801561030257600080fd5b506103166103113660046137ad565b610ab4565b60405190151581526020015b60405180910390f35b34801561033757600080fd5b50600854600160301b900463ffffffff165b604051908152602001610322565b34801561036357600080fd5b506102ef6103723660046137d7565b610b0b565b34801561038357600080fd5b5061038c610c2a565b6040516103229190613840565b3480156103a557600080fd5b506103cf6103b43660046137d7565b6000908152600460205260409020546001600160a01b031690565b6040516001600160a01b039091168152602001610322565b3480156103f357600080fd5b5061041261040236600461392d565b630a85bd0160e11b949350505050565b6040516001600160e01b03199091168152602001610322565b34801561043757600080fd5b50610349610446366004613afe565b610cbc565b34801561045757600080fd5b506102ef610466366004613b8d565b610cfc565b610349610479366004613afe565b610ea2565b34801561048a57600080fd5b506103496104993660046137d7565b610fd5565b3480156104aa57600080fd5b506103497f3e83946653575f9a39005e1545185629e92736b7528ab20ca3816f315424a81181565b3480156104de57600080fd5b50610349610ff6565b3480156104f357600080fd5b506105076105023660046137d7565b611009565b6040516103229190613bf9565b34801561052057600080fd5b5061031661052f366004613c07565b60008281526009602090815260408083206001600160a01b038516845260030190915290205460ff1692915050565b34801561056a57600080fd5b50610349610579366004613afe565b611143565b34801561058a57600080fd5b5061038c6111b2565b34801561059f57600080fd5b506105cd6105ae3660046137d7565b6000908152600960205260409020805460018201546002909201549092565b60408051938452602084019290925290820152606001610322565b3480156105f457600080fd5b506040805180820190915260018152603160f81b602082015261038c565b34801561061e57600080fd5b5061034961062d366004613c42565b611274565b34801561063e57600080fd5b5061034961064d366004613cba565b61129d565b34801561065e57600080fd5b5061034961066d366004613d74565b6113fc565b34801561067e57600080fd5b5061034961068d3660046137d7565b611451565b34801561069e57600080fd5b506102ef6106ad366004613e0d565b6114df565b3480156106be57600080fd5b506103496106cd366004613e2a565b6115f0565b3480156106de57600080fd5b506103496106ed366004613e85565b611638565b3480156106fe57600080fd5b5061034961070d366004613f25565b6001600160a01b031660009081526002602052604090205490565b34801561073457600080fd5b5061073d6116f1565b6040516103229796959493929190613f7b565b34801561075c57600080fd5b5061034961076b366004613feb565b611737565b34801561077c57600080fd5b50610785611809565b60405165ffffffffffff9091168152602001610322565b3480156107a857600080fd5b506064610349565b3480156107bc57600080fd5b506103496107cb36600461403c565b611891565b3480156107dc57600080fd5b506103497f000000000000000000000000000000000000000000000000000000000000000081565b34801561081057600080fd5b506103496118a8565b34801561082557600080fd5b506103166108343660046137d7565b50600090565b34801561084657600080fd5b506103496108553660046137d7565b60009081526004602052604090206001015465ffffffffffff1690565b34801561087e57600080fd5b506102ef61088d366004613b8d565b6118c2565b34801561089e57600080fd5b50610349611c0e565b3480156108b357600080fd5b506104126108c2366004614092565b63bc197c8160e01b95945050505050565b3480156108df57600080fd5b506103496108ee3660046137d7565b611c19565b6102ef610901366004614121565b611c5c565b34801561091257600080fd5b50610349610921366004613afe565b611cdc565b34801561093257600080fd5b5061038c610941366004614162565b611d16565b34801561095257600080fd5b506040805180820190915260208082527f737570706f72743d627261766f2671756f72756d3d666f722c6162737461696e9082015261038c565b34801561099857600080fd5b506103497ff2aad550cf55f045cb27e9c559f9889fdfb6e6cdaa032301d6ea397784ae51d781565b3480156109cc57600080fd5b5061038c611e98565b3480156109e157600080fd5b506102ef6109f03660046141b1565b611f26565b348015610a0157600080fd5b50610349610a103660046141d7565b612044565b348015610a2157600080fd5b506102ef610a303660046137d7565b612065565b348015610a4157600080fd5b50610412610a50366004614201565b63f23a6e6160e01b95945050505050565b348015610a6d57600080fd5b50610349610a7c3660046137d7565b612148565b348015610a8d57600080fd5b507f00000000000000000000000000000000000000000000000000000000000000006103cf565b60006001600160e01b031982166332a2ad4360e11b1480610ae557506001600160e01b03198216630271189760e51b145b80610b0057506301ffc9a760e01b6001600160e01b03198316145b92915050565b905090565b610b13612153565b7f00000000000000000000000000000000000000000000000000000000000000004614610b5b5760405162461bcd60e51b8152600401610b5290614265565b60405180910390fd5b604051633b0d4dd760e01b8152600c600482810191909152602482015260009073__$b1c1335e68417b4234016f4aa58fdfac77$__90633b0d4dd790604401602060405180830381865af4158015610bb7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bdb91906142a9565b90506000610be76118a8565b9050610bf28361218b565b60045b6040805183815260208101869052908101849052600080516020614ae2833981519152906060015b60405180910390a2505050565b606060038054610c39906142c2565b80601f0160208091040260200160405190810160405280929190818152602001828054610c65906142c2565b8015610cb25780601f10610c8757610100808354040283529160200191610cb2565b820191906000526020600020905b815481529060010190602001808311610c9557829003601f168201915b5050505050905090565b600080610ccb86868686611cdc565b9050610ce081610cdb6004612219565b61223c565b506000604051634844252360e11b815260040160405180910390fd5b610d04612153565b7f00000000000000000000000000000000000000000000000000000000000000004614610d435760405162461bcd60e51b8152600401610b5290614265565b604051633b0d4dd760e01b8152600c60048201526000602482018190529073__$b1c1335e68417b4234016f4aa58fdfac77$__90633b0d4dd790604401602060405180830381865af4158015610d9d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dc191906142a9565b90506000600b8054610dd2906142c2565b80601f0160208091040260200160405190810160405280929190818152602001828054610dfe906142c2565b8015610e4b5780601f10610e2057610100808354040283529160200191610e4b565b820191906000526020600020905b815481529060010190602001808311610e2e57829003601f168201915b5050505050905082600b9081610e619190614347565b507f67c6aa39e9b4a701119ddc2f40a18145fff9b6f4fa224d5f29c28755f719ffb2818484604051610e9593929190614406565b60405180910390a1505050565b600080610eb186868686611cdc565b9050610ed181610ec16005612219565b610ecb6004612219565b1761223c565b506000818152600460205260409020805460ff60f01b1916600160f01b17905530610ef93090565b6001600160a01b031614610f8b5760005b8651811015610f8957306001600160a01b0316878281518110610f2f57610f2f61443c565b60200260200101516001600160a01b031603610f7957610f79858281518110610f5a57610f5a61443c565b602002602001015180519060200120600561227b90919063ffffffff16565b610f8281614468565b9050610f0a565b505b610f9881878787876122dd565b6040518181527f712ae1383f79ac853f8d882153778e0260ef8f03b504e2866e0593e04d2b291f906020015b60405180910390a195945050505050565b600090815260046020526040902054600160a01b900465ffffffffffff1690565b6000610b0660085465ffffffffffff1690565b6000818152600460205260408120805460ff600160f01b8204811691600160f81b900416811561103e57506007949350505050565b801561104f57506002949350505050565b600061105a86610fd5565b90508060000361108057604051636ad0607560e01b815260048101879052602401610b52565b600061108a611809565b65ffffffffffff1690508082106110a8575060009695505050505050565b60006110b388611c19565b90508181106110ca57506001979650505050505050565b6110d3886123bd565b15806110f357506000888152600960205260409020805460019091015411155b1561110657506003979650505050505050565b60008881526004602052604090206001015465ffffffffffff1660000361113557506004979650505050505050565b506005979650505050505050565b60008061115286868686611cdc565b905061116281610cdb6000612219565b506000818152600460205260409020546001600160a01b0316331461119c5760405163233d98e360e01b8152336004820152602401610b52565b6111a8868686866123f4565b9695505050505050565b60607f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316634bf5d7e96040518163ffffffff1660e01b8152600401600060405180830381865afa92505050801561123357506040513d6000823e601f3d908101601f1916820160405261123091908101906144b1565b60015b61126f575060408051808201909152601d81527f6d6f64653d626c6f636b6e756d6265722666726f6d3d64656661756c74000000602082015290565b919050565b600080339050611295848285604051806020016040528060008152506124a5565b949350505050565b6000806113808761137a7f3e83946653575f9a39005e1545185629e92736b7528ab20ca3816f315424a8118c8c8c6112f28e6001600160a01b0316600090815260026020526040902080546001810190915590565b8d8d6040516113029291906144f9565b60405180910390208c8051906020012060405160200161135f9796959493929190968752602087019590955260ff9390931660408601526001600160a01b03919091166060850152608084015260a083015260c082015260e00190565b604051602081830303815290604052805190602001206124d1565b856124fe565b9050806113ab576040516394ab6c0760e01b81526001600160a01b0388166004820152602401610b52565b6113ef89888a89898080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508b9250612572915050565b9998505050505050505050565b60008033905061144687828888888080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508a9250612572915050565b979650505050505050565b600a80546000918290611465600184614509565b815481106114755761147561443c565b6000918252602090912001805490915065ffffffffffff811690600160301b90046001600160d01b03168582116114b8576001600160d01b031695945050505050565b6114cc6114c487612654565b600a9061268b565b6001600160d01b03169695505050505050565b6114e7612153565b7f000000000000000000000000000000000000000000000000000000000000000046146115265760405162461bcd60e51b8152600401610b5290614265565b604051633b0d4dd760e01b8152600c60048201526001602482015260009073__$b1c1335e68417b4234016f4aa58fdfac77$__90633b0d4dd790604401602060405180830381865af4158015611580573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115a491906142a9565b905060006115b0610ff6565b90506115bb83612740565b60016040805183815265ffffffffffff86166020820152908101849052600080516020614ae283398151915290606001610c1d565b6000803390506111a886828787878080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506124a592505050565b60003361164581846127a6565b61166d5760405163d9b3955760e01b81526001600160a01b0382166004820152602401610b52565b6000611677611c0e565b905080156116e45760006116a683600161168f611809565b611699919061451c565b65ffffffffffff16612044565b9050818110156116e257604051636121770b60e11b81526001600160a01b03841660048201526024810182905260448101839052606401610b52565b505b6114468787878786612897565b600060608060008060006060611705612ab7565b61170d612ae4565b60408051600080825260208201909252600f60f81b9b939a50919850469750309650945092509050565b6000806117c38461137a7ff2aad550cf55f045cb27e9c559f9889fdfb6e6cdaa032301d6ea397784ae51d789898961178c8b6001600160a01b0316600090815260026020526040902080546001810190915590565b60408051602081019690965285019390935260ff90911660608401526001600160a01b0316608083015260a082015260c00161135f565b9050806117ee576040516394ab6c0760e01b81526001600160a01b0385166004820152602401610b52565b6111a8868587604051806020016040528060008152506124a5565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166391ddadf46040518163ffffffff1660e01b8152600401602060405180830381865afa925050508015611885575060408051601f3d908101601f1916820190925261188291810190614542565b60015b61126f57610b06612b11565b600061189e848484612b1c565b90505b9392505050565b60006118b4600a612bb2565b6001600160d01b0316905090565b600080600073__$b1c1335e68417b4234016f4aa58fdfac77$__63c0af65918530600c6040518463ffffffff1660e01b81526004016119039392919061455f565b600060405180830381865af4158015611920573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261194891908101906145ad565b9194509250905060ff8316611a505760008280602001905181019061196d91906144b1565b90506000600b805461197e906142c2565b80601f01602080910402602001604051908101604052809291908181526020018280546119aa906142c2565b80156119f75780601f106119cc576101008083540402835291602001916119f7565b820191906000526020600020905b8154815290600101906020018083116119da57829003601f168201915b5050505050905081600b9081611a0d9190614347565b507f67c6aa39e9b4a701119ddc2f40a18145fff9b6f4fa224d5f29c28755f719ffb2818385604051611a4193929190614406565b60405180910390a15050611c08565b60001960ff841601611ac1576000611a6783614606565b60d01c90506000611a76610ff6565b9050611a8182612740565b60016040805183815265ffffffffffff85166020820152908101859052600080516020614ae2833981519152906060015b60405180910390a25050611c08565b60011960ff841601611b34576000611ad88361463d565b60e01c90506000611af660085463ffffffff600160301b9091041690565b9050611b0182612beb565b60026040805183815263ffffffff85166020820152908101859052600080516020614ae283398151915290606001611ab2565b60021960ff841601611b9b57600082806020019051810190611b5691906142a9565b90506000611b62611c0e565b9050611b6d82612c89565b60036040805183815260208101859052908101859052600080516020614ae283398151915290606001611ab2565b60031960ff841601611c0857600082806020019051810190611bbd91906142a9565b90506000611bc96118a8565b9050611bd48261218b565b60046040805183815260208101859052908101859052600080516020614ae28339815191529060600160405180910390a250505b50505050565b6000610b0660075490565b600081815260046020526040812054611c4e90600160d01b810463ffffffff1690600160a01b900465ffffffffffff16614670565b65ffffffffffff1692915050565b611c64612153565b600080856001600160a01b0316858585604051611c829291906144f9565b60006040518083038185875af1925050503d8060008114611cbf576040519150601f19603f3d011682016040523d82523d6000602084013e611cc4565b606091505b5091509150611cd38282612cca565b50505050505050565b600084848484604051602001611cf5949392919061471a565b60408051601f19818403018152919052805160209091012095945050505050565b60607f00000000000000000000000000000000000000000000000000000000000000004614611d935760405162461bcd60e51b815260206004820152602360248201527f50726f6f6673206f6e6c792067656e657261746564206f6e20686f6d6520636860448201526230b4b760e91b6064820152608401610b52565b604051630564edeb60e31b8152600c600482015260ff8416602482015260009073__$b1c1335e68417b4234016f4aa58fdfac77$__90632b276f5890604401602060405180830381865af4158015611def573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e1391906142a9565b604051637352178160e01b815290915073__$b1c1335e68417b4234016f4aa58fdfac77$__90637352178190611e53903090889088908790600401614765565b600060405180830381865af4158015611e70573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261129591908101906147a3565b600b8054611ea5906142c2565b80601f0160208091040260200160405190810160405280929190818152602001828054611ed1906142c2565b8015611f1e5780601f10611ef357610100808354040283529160200191611f1e565b820191906000526020600020905b815481529060010190602001808311611f0157829003601f168201915b505050505081565b611f2e612153565b7f00000000000000000000000000000000000000000000000000000000000000004614611f6d5760405162461bcd60e51b8152600401610b5290614265565b604051633b0d4dd760e01b8152600c60048201526002602482015260009073__$b1c1335e68417b4234016f4aa58fdfac77$__90633b0d4dd790604401602060405180830381865af4158015611fc7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611feb91906142a9565b9050600061200660085463ffffffff600160301b9091041690565b905061201183612beb565b60026040805183815263ffffffff86166020820152908101849052600080516020614ae283398151915290606001610c1d565b60006118a1838361206060408051602081019091526000815290565b612b1c565b61206d612153565b7f000000000000000000000000000000000000000000000000000000000000000046146120ac5760405162461bcd60e51b8152600401610b5290614265565b604051633b0d4dd760e01b8152600c60048201526003602482015260009073__$b1c1335e68417b4234016f4aa58fdfac77$__90633b0d4dd790604401602060405180830381865af4158015612106573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061212a91906142a9565b90506000612136611c0e565b905061214183612c89565b6003610bf5565b6000610b0082612ce6565b303314612175576040516347096e4760e01b8152336004820152602401610b52565b565b806121826005612d90565b03612177575b50565b6064808211156121b85760405163243e544560e01b81526004810183905260248101829052604401610b52565b60006121c26118a8565b90506121e16121cf611809565b6121d885612dff565b600a9190612e33565b505060408051828152602081018590527f0553476bf02ef2726e8ce5ced78d63e26e602e4a2257b1f559418e24b46339979101610e95565b600081600781111561222d5761222d613bc1565b600160ff919091161b92915050565b60008061224884611009565b905060008361225683612219565b16036118a1578381846040516331b75e4d60e01b8152600401610b52939291906147d7565b81546001600160801b03600160801b8204811691811660018301909116036122a7576122a76041612e4e565b6001600160801b03808216600090815260018086016020526040909120939093558354919092018216600160801b029116179055565b60005b84518110156123b5576000808683815181106122fe576122fe61443c565b60200260200101516001600160a01b03168684815181106123215761232161443c565b602002602001015186858151811061233b5761233b61443c565b602002602001015160405161235091906147f9565b60006040518083038185875af1925050503d806000811461238d576040519150601f19603f3d011682016040523d82523d6000602084013e612392565b606091505b50915091506123a18282612cca565b505050806123ae90614468565b90506122e0565b505050505050565b6000818152600960205260408120600281015460018201546123df9190614815565b6123eb610a7c85610fd5565b11159392505050565b60008061240386868686611cdc565b9050612451816124136007612219565b61241d6006612219565b6124276002612219565b6001612434600782614828565b61243f906002614925565b6124499190614509565b18181861223c565b506000818152600460205260409081902080546001600160f81b0316600160f81b179055517f789cf55be980739dad1d0699b93b58e806b51c9d96619bfa8fe0a28abaa7b30c90610fc49083815260200190565b60006124c8858585856124c360408051602081019091526000815290565b612572565b95945050505050565b6000610b006124de612e60565b8360405161190160f01b8152600281019290925260228201526042902090565b6000836001600160a01b03163b6000036125605760008061251f8585612f8b565b509092509050600081600381111561253957612539613bc1565b1480156125575750856001600160a01b0316826001600160a01b0316145b925050506118a1565b61256b848484612fd8565b90506118a1565b600061258286610cdb6001612219565b5060006125988661259289610fd5565b85612b1c565b905060006125a988888885886130b3565b9050835160000361260057866001600160a01b03167fb8e138887d0aa13bab447e82de9d5c1777041ecd21ca36ba824ff1e6c07ddda4898884896040516125f39493929190614934565b60405180910390a2611446565b866001600160a01b03167fe2babfbac5889a709b63bb7f598b324e08bc5a4fb9ec647fb3cbc9ec07eb8712898884898960405161264195949392919061495c565b60405180910390a2979650505050505050565b600065ffffffffffff821115612687576040516306dfcc6560e41b81526030600482015260248101839052604401610b52565b5090565b8154600090818160058111156126ea5760006126a6846131b6565b6126b09085614509565b60008881526020902090915081015465ffffffffffff90811690871610156126da578091506126e8565b6126e5816001614815565b92505b505b60006126f88787858561330f565b905080156127335761271d8761270f600184614509565b600091825260209091200190565b54600160301b90046001600160d01b0316611446565b6000979650505050505050565b6008546040805165ffffffffffff928316815291831660208301527fc565b045403dc03c2eea82b81a0465edad9e2e7fc4d97e11421c209da93d7a93910160405180910390a16008805465ffffffffffff191665ffffffffffff92909216919091179055565b805160009060348110156127be576001915050610b00565b82810160131901516001600160a01b031981166b046e0e4dee0dee6cae47a60f60a31b146127f157600192505050610b00565b6000806127ff602885614509565b90505b83811015612876576000806128368884815181106128225761282261443c565b01602001516001600160f81b031916613371565b915091508161284e5760019650505050505050610b00565b8060ff166004856001600160a01b0316901b17935050508061286f90614468565b9050612802565b50856001600160a01b0316816001600160a01b031614935050505092915050565b60006128ac8686868680519060200120611cdc565b9050845186511415806128c157508351865114155b806128cb57508551155b1561290057855184518651604051630447b05d60e41b8152600481019390935260248301919091526044820152606401610b52565b600081815260046020526040902054600160a01b900465ffffffffffff161561294b578061292d82611009565b6040516331b75e4d60e01b8152610b529291906000906004016147d7565b6000612955610ff6565b61295d611809565b65ffffffffffff1661296f9190614815565b9050600061298a60085463ffffffff600160301b9091041690565b600084815260046020526040902080546001600160a01b0319166001600160a01b0387161781559091506129bd83612654565b815465ffffffffffff91909116600160a01b0265ffffffffffff60a01b199091161781556129ea82613403565b815463ffffffff91909116600160d01b0263ffffffff60d01b1990911617815588517f7d84a6263ae0d98d3329bd7b46bb4e8d6f98cd35a7adb45c274c8b7fd5ebd5e090859087908c908c906001600160401b03811115612a4d57612a4d61386a565b604051908082528060200260200182016040528015612a8057816020015b6060815260200190600190039081612a6b5790505b508c89612a8d8a82614815565b8e604051612aa3999897969594939291906149a2565b60405180910390a150505095945050505050565b6060610b067f00000000000000000000000000000000000000000000000000000000000000006000613434565b6060610b067f00000000000000000000000000000000000000000000000000000000000000006001613434565b6000610b0643612654565b60007f0000000000000000000000000000000000000000000000000000000000000000604051630748d63560e31b81526001600160a01b038681166004830152602482018690529190911690633a46b1a890604401602060405180830381865afa158015612b8e573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061189e91906142a9565b80546000908015612be257612bcc8361270f600184614509565b54600160301b90046001600160d01b03166118a1565b60009392505050565b8063ffffffff16600003612c155760405163f1cfbf0560e01b815260006004820152602401610b52565b6008546040805163ffffffff600160301b9093048316815291831660208301527f7e3f7f0708a84de9203036abaa450dccc85ad5ff52f78c170f3edb55cf5e8828910160405180910390a16008805463ffffffff909216600160301b0269ffffffff00000000000019909216919091179055565b60075460408051918252602082018390527fccb45da8d5717e6c4544694297c4ba5cf151d455c9bb0ed4fc7a38411bc05461910160405180910390a1600755565b606082612cdf57612cda826134df565b610b00565b5080610b00565b60006064612cf383611451565b604051632394e7a360e21b8152600481018590526001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001690638e539e8c90602401602060405180830381865afa158015612d58573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612d7c91906142a9565b612d869190614a79565b610b009190614aa6565b80546000906001600160801b0380821691600160801b9004168103612db957612db96031612e4e565b6001600160801b038181166000908152600185810160205260408220805492905585546fffffffffffffffffffffffffffffffff19169301909116919091179092555090565b60006001600160d01b03821115612687576040516306dfcc6560e41b815260d0600482015260248101839052604401610b52565b600080612e41858585613508565b915091505b935093915050565b634e487b71600052806020526024601cfd5b6000306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016148015612eb957507f000000000000000000000000000000000000000000000000000000000000000046145b15612ee357507f000000000000000000000000000000000000000000000000000000000000000090565b610b06604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f60208201527f0000000000000000000000000000000000000000000000000000000000000000918101919091527f000000000000000000000000000000000000000000000000000000000000000060608201524660808201523060a082015260009060c00160405160208183030381529060405280519060200120905090565b60008060008351604103612fc55760208401516040850151606086015160001a612fb78882858561365c565b955095509550505050612fd1565b50508151600091506002905b9250925092565b6000806000856001600160a01b03168585604051602401612ffa929190614ac8565b60408051601f198184030181529181526020820180516001600160e01b0316630b135d3f60e11b1790525161302f91906147f9565b600060405180830381855afa9150503d806000811461306a576040519150601f19603f3d011682016040523d82523d6000602084013e61306f565b606091505b509150915081801561308357506020815110155b80156111a857508051630b135d3f60e11b906130a890830160209081019084016142a9565b149695505050505050565b60008581526009602090815260408083206001600160a01b03881684526003810190925282205460ff1615613106576040516371c6af4960e01b81526001600160a01b0387166004820152602401610b52565b6001600160a01b03861660009081526003820160205260409020805460ff1916600117905560ff851661315257838160000160008282546131479190614815565b909155506131ab9050565b60001960ff86160161317257838160010160008282546131479190614815565b60011960ff86160161319257838160020160008282546131479190614815565b6040516303599be160e11b815260040160405180910390fd5b509195945050505050565b6000600182116131c4575090565b816001600160801b82106131dd5760809190911c9060401b5b6801000000000000000082106131f85760409190911c9060201b5b640100000000821061320f5760209190911c9060101b5b6201000082106132245760109190911c9060081b5b61010082106132385760089190911c9060041b5b6010821061324b5760049190911c9060021b5b600482106132575760011b5b600302600190811c9081858161326f5761326f614a90565b048201901c9050600181858161328757613287614a90565b048201901c9050600181858161329f5761329f614a90565b048201901c905060018185816132b7576132b7614a90565b048201901c905060018185816132cf576132cf614a90565b048201901c905060018185816132e7576132e7614a90565b048201901c905061330681858161330057613300614a90565b04821190565b90039392505050565b60005b81831015613369576000613326848461372b565b60008781526020902090915065ffffffffffff86169082015465ffffffffffff16111561335557809250613363565b613360816001614815565b93505b50613312565b509392505050565b60008060f883901c602f8111801561338c5750603a8160ff16105b156133a157600194602f199091019350915050565b8060ff1660401080156133b7575060478160ff16105b156133cc576001946036199091019350915050565b8060ff1660601080156133e2575060678160ff16105b156133f7576001946056199091019350915050565b50600093849350915050565b600063ffffffff821115612687576040516306dfcc6560e41b81526020600482015260248101839052604401610b52565b606060ff831461344e5761344783613746565b9050610b00565b81805461345a906142c2565b80601f0160208091040260200160405190810160405280929190818152602001828054613486906142c2565b80156134d35780601f106134a8576101008083540402835291602001916134d3565b820191906000526020600020905b8154815290600101906020018083116134b657829003601f168201915b50505050509050610b00565b8051156134ef5780518082602001fd5b60405163d6bda27560e01b815260040160405180910390fd5b8254600090819080156136015760006135268761270f600185614509565b805490915065ffffffffffff80821691600160301b90046001600160d01b031690881682111561356957604051632520601d60e01b815260040160405180910390fd5b8765ffffffffffff168265ffffffffffff16036135a257825465ffffffffffff16600160301b6001600160d01b038916021783556135f3565b6040805180820190915265ffffffffffff808a1682526001600160d01b03808a1660208085019182528d54600181018f5560008f81529190912094519151909216600160301b029216919091179101555b9450859350612e4692505050565b50506040805180820190915265ffffffffffff80851682526001600160d01b0380851660208085019182528854600181018a5560008a815291822095519251909316600160301b029190931617920191909155905081612e46565b600080807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08411156136975750600091506003905082613721565b604080516000808252602082018084528a905260ff891692820192909252606081018790526080810186905260019060a0016020604051602081039080840390855afa1580156136eb573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b03811661371757506000925060019150829050613721565b9250600091508190505b9450945094915050565b600061373a6002848418614aa6565b6118a190848416614815565b6060600061375383613785565b604080516020808252818301909252919250600091906020820181803683375050509182525060208101929092525090565b600060ff8216601f811115610b0057604051632cd44ac360e21b815260040160405180910390fd5b6000602082840312156137bf57600080fd5b81356001600160e01b0319811681146118a157600080fd5b6000602082840312156137e957600080fd5b5035919050565b60005b8381101561380b5781810151838201526020016137f3565b50506000910152565b6000815180845261382c8160208601602086016137f0565b601f01601f19169290920160200192915050565b6020815260006118a16020830184613814565b80356001600160a01b038116811461126f57600080fd5b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b03811182821017156138a8576138a861386a565b604052919050565b60006001600160401b038211156138c9576138c961386a565b50601f01601f191660200190565b600082601f8301126138e857600080fd5b81356138fb6138f6826138b0565b613880565b81815284602083860101111561391057600080fd5b816020850160208301376000918101602001919091529392505050565b6000806000806080858703121561394357600080fd5b61394c85613853565b935061395a60208601613853565b92506040850135915060608501356001600160401b0381111561397c57600080fd5b613988878288016138d7565b91505092959194509250565b60006001600160401b038211156139ad576139ad61386a565b5060051b60200190565b600082601f8301126139c857600080fd5b813560206139d86138f683613994565b82815260059290921b840181019181810190868411156139f757600080fd5b8286015b84811015613a1957613a0c81613853565b83529183019183016139fb565b509695505050505050565b600082601f830112613a3557600080fd5b81356020613a456138f683613994565b82815260059290921b84018101918181019086841115613a6457600080fd5b8286015b84811015613a195780358352918301918301613a68565b600082601f830112613a9057600080fd5b81356020613aa06138f683613994565b82815260059290921b84018101918181019086841115613abf57600080fd5b8286015b84811015613a195780356001600160401b03811115613ae25760008081fd5b613af08986838b01016138d7565b845250918301918301613ac3565b60008060008060808587031215613b1457600080fd5b84356001600160401b0380821115613b2b57600080fd5b613b37888389016139b7565b95506020870135915080821115613b4d57600080fd5b613b5988838901613a24565b94506040870135915080821115613b6f57600080fd5b50613b7c87828801613a7f565b949793965093946060013593505050565b600060208284031215613b9f57600080fd5b81356001600160401b03811115613bb557600080fd5b611295848285016138d7565b634e487b7160e01b600052602160045260246000fd5b60088110613bf557634e487b7160e01b600052602160045260246000fd5b9052565b60208101610b008284613bd7565b60008060408385031215613c1a57600080fd5b82359150613c2a60208401613853565b90509250929050565b60ff8116811461218857600080fd5b60008060408385031215613c5557600080fd5b823591506020830135613c6781613c33565b809150509250929050565b60008083601f840112613c8457600080fd5b5081356001600160401b03811115613c9b57600080fd5b602083019150836020828501011115613cb357600080fd5b9250929050565b600080600080600080600060c0888a031215613cd557600080fd5b873596506020880135613ce781613c33565b9550613cf560408901613853565b945060608801356001600160401b0380821115613d1157600080fd5b613d1d8b838c01613c72565b909650945060808a0135915080821115613d3657600080fd5b613d428b838c016138d7565b935060a08a0135915080821115613d5857600080fd5b50613d658a828b016138d7565b91505092959891949750929550565b600080600080600060808688031215613d8c57600080fd5b853594506020860135613d9e81613c33565b935060408601356001600160401b0380821115613dba57600080fd5b613dc689838a01613c72565b90955093506060880135915080821115613ddf57600080fd5b50613dec888289016138d7565b9150509295509295909350565b65ffffffffffff8116811461218857600080fd5b600060208284031215613e1f57600080fd5b81356118a181613df9565b60008060008060608587031215613e4057600080fd5b843593506020850135613e5281613c33565b925060408501356001600160401b03811115613e6d57600080fd5b613e7987828801613c72565b95989497509550505050565b60008060008060808587031215613e9b57600080fd5b84356001600160401b0380821115613eb257600080fd5b613ebe888389016139b7565b95506020870135915080821115613ed457600080fd5b613ee088838901613a24565b94506040870135915080821115613ef657600080fd5b613f0288838901613a7f565b93506060870135915080821115613f1857600080fd5b50613988878288016138d7565b600060208284031215613f3757600080fd5b6118a182613853565b600081518084526020808501945080840160005b83811015613f7057815187529582019590820190600101613f54565b509495945050505050565b60ff60f81b8816815260e060208201526000613f9a60e0830189613814565b8281036040840152613fac8189613814565b606084018890526001600160a01b038716608085015260a0840186905283810360c08501529050613fdd8185613f40565b9a9950505050505050505050565b6000806000806080858703121561400157600080fd5b84359350602085013561401381613c33565b925061402160408601613853565b915060608501356001600160401b0381111561397c57600080fd5b60008060006060848603121561405157600080fd5b61405a84613853565b92506020840135915060408401356001600160401b0381111561407c57600080fd5b614088868287016138d7565b9150509250925092565b600080600080600060a086880312156140aa57600080fd5b6140b386613853565b94506140c160208701613853565b935060408601356001600160401b03808211156140dd57600080fd5b6140e989838a01613a24565b945060608801359150808211156140ff57600080fd5b61410b89838a01613a24565b93506080880135915080821115613ddf57600080fd5b6000806000806060858703121561413757600080fd5b61414085613853565b93506020850135925060408501356001600160401b03811115613e6d57600080fd5b6000806040838503121561417557600080fd5b823561418081613c33565b915060208301356001600160401b0381111561419b57600080fd5b6141a7858286016138d7565b9150509250929050565b6000602082840312156141c357600080fd5b813563ffffffff811681146118a157600080fd5b600080604083850312156141ea57600080fd5b6141f383613853565b946020939093013593505050565b600080600080600060a0868803121561421957600080fd5b61422286613853565b945061423060208701613853565b9350604086013592506060860135915060808601356001600160401b0381111561425957600080fd5b613dec888289016138d7565b60208082526024908201527f4f7065726174696f6e206f6e6c7920616c6c6f776564206f6e20686f6d6520636040820152633430b4b760e11b606082015260800190565b6000602082840312156142bb57600080fd5b5051919050565b600181811c908216806142d657607f821691505b6020821081036142f657634e487b7160e01b600052602260045260246000fd5b50919050565b601f82111561434257600081815260208120601f850160051c810160208610156143235750805b601f850160051c820191505b818110156123b55782815560010161432f565b505050565b81516001600160401b038111156143605761436061386a565b6143748161436e84546142c2565b846142fc565b602080601f8311600181146143a957600084156143915750858301515b600019600386901b1c1916600185901b1785556123b5565b600085815260208120601f198616915b828110156143d8578886015182559484019460019091019084016143b9565b50858210156143f65787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6060815260006144196060830186613814565b828103602084015261442b8186613814565b915050826040830152949350505050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60006001820161447a5761447a614452565b5060010190565b600061448f6138f6846138b0565b90508281528383830111156144a357600080fd5b6118a18360208301846137f0565b6000602082840312156144c357600080fd5b81516001600160401b038111156144d957600080fd5b8201601f810184136144ea57600080fd5b61129584825160208401614481565b8183823760009101908152919050565b81810381811115610b0057610b00614452565b65ffffffffffff82811682821603908082111561453b5761453b614452565b5092915050565b60006020828403121561455457600080fd5b81516118a181613df9565b6060815260006145726060830186613814565b6001600160a01b039490941660208301525060400152919050565b600082601f83011261459e57600080fd5b6118a183835160208501614481565b6000806000606084860312156145c257600080fd5b83516145cd81613c33565b60208501519093506001600160401b038111156145e957600080fd5b6145f58682870161458d565b925050604084015190509250925092565b805160208201516001600160d01b031980821692919060068310156146355780818460060360031b1b83161693505b505050919050565b805160208201516001600160e01b031980821692919060048310156146355760049290920360031b82901b161692915050565b65ffffffffffff81811683821601908082111561453b5761453b614452565b600081518084526020808501945080840160005b83811015613f705781516001600160a01b0316875295820195908201906001016146a3565b6000815180845260208085019450848260051b860182860160005b8581101561470d5783830389526146fb838351613814565b988501989250908401906001016146e3565b5090979650505050505050565b60808152600061472d608083018761468f565b828103602084015261473f8187613f40565b9050828103604084015261475381866146c8565b91505082606083015295945050505050565b6001600160a01b038516815260ff8416602082015260806040820181905260009061479290830185613814565b905082606083015295945050505050565b6000602082840312156147b557600080fd5b81516001600160401b038111156147cb57600080fd5b6112958482850161458d565b838152606081016147eb6020830185613bd7565b826040830152949350505050565b6000825161480b8184602087016137f0565b9190910192915050565b80820180821115610b0057610b00614452565b60ff8181168382160190811115610b0057610b00614452565b600181815b8085111561487c57816000190482111561486257614862614452565b8085161561486f57918102915b93841c9390800290614846565b509250929050565b60008261489357506001610b00565b816148a057506000610b00565b81600181146148b657600281146148c0576148dc565b6001915050610b00565b60ff8411156148d1576148d1614452565b50506001821b610b00565b5060208310610133831016604e8410600b84101617156148ff575081810a610b00565b6149098383614841565b806000190482111561491d5761491d614452565b029392505050565b60006118a160ff841683614884565b84815260ff841660208201528260408201526080606082015260006111a86080830184613814565b85815260ff8516602082015283604082015260a06060820152600061498460a0830185613814565b82810360808401526149968185613814565b98975050505050505050565b60006101208b8352602060018060a01b038c16818501528160408501526149cb8285018c61468f565b915083820360608501526149df828b613f40565b915083820360808501528189518084528284019150828160051b850101838c0160005b83811015614a3057601f19878403018552614a1e838351613814565b94860194925090850190600101614a02565b505086810360a0880152614a44818c6146c8565b9450505050508560c08401528460e0840152828103610100840152614a698185613814565b9c9b505050505050505050505050565b8082028115828204841417610b0057610b00614452565b634e487b7160e01b600052601260045260246000fd5b600082614ac357634e487b7160e01b600052601260045260246000fd5b500490565b82815260406020820152600061189e604083018461381456fe80c51ad8a7db1a7a86cc355b77bd5cd7ea08f6071ea91d85a8f792734700a0eca26469706673582212205c5a83ff074db246f409ffc8bc5a5c810ce8a95783beb88564ba8a597a7cef8c64736f6c63430008140033", "libraries": { "ProofHandler": "0x0152ee45780385dACCCCB128D816031CfFe5F36B" }, "devdoc": { "author": "Web3 Hackers Collective", "custom:security-contact": "julien@strat.cc", - "details": "Uses ProofHandler library for managing cross-chain parameter updates", + "details": "Extends OpenZeppelin's Governor contract with cross-chain parameter updates", "errors": { "CheckpointUnorderedInsertion()": [ { @@ -2005,11 +2005,12 @@ "details": "Clock (as specified in ERC-6372) is set to match the token's clock. Fallback to block numbers if the token does not implement ERC-6372." }, "constructor": { + "details": "Sets up initial governance parameters and manifesto", "params": { "_home": "Chain ID where this contract is considered home", "_manifestoCid": "Initial manifesto CID", "_name": "Name of the governance contract", - "_proposalThreshold": "Minimum votes needed for proposal", + "_proposalThreshold": "Minimum votes needed to create a proposal", "_quorum": "Minimum participation percentage required", "_token": "The voting token contract address", "_votingDelay": "Time before voting begins", @@ -2177,7 +2178,7 @@ "notice": "Updates the quorum numerator on the home chain" } }, - "notice": "Implementation of a DAO with secure cross-chain synchronization capabilities", + "notice": "Implementation of a DAO with cross-chain synchronization capabilities", "version": 1 }, "storageLayout": { diff --git a/deployments/sepolia/CrosschainNFT.json b/deployments/sepolia/CrosschainNFT.json index 8895942..c9b56da 100644 --- a/deployments/sepolia/CrosschainNFT.json +++ b/deployments/sepolia/CrosschainNFT.json @@ -1,5 +1,5 @@ { - "address": "0xe74bC6A3Ee4ED824708DD88465BD2CdD6b869620", + "address": "0x8583CEbA0d2C5cAe1a1BCff975Faa97063D14953", "abi": [ { "inputs": [ @@ -414,6 +414,31 @@ "name": "DelegateVotesChanged", "type": "event" }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "delegator", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "delegatee", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + } + ], + "name": "DelegationSynced", + "type": "event" + }, { "anonymous": false, "inputs": [], @@ -615,6 +640,19 @@ "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "proof", + "type": "bytes" + } + ], + "name": "claimDelegation", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, { "inputs": [ { @@ -754,6 +792,30 @@ "stateMutability": "view", "type": "function" }, + { + "inputs": [ + { + "internalType": "address", + "name": "delegator", + "type": "address" + }, + { + "internalType": "address", + "name": "delegatee", + "type": "address" + } + ], + "name": "generateDelegationProof", + "outputs": [ + { + "internalType": "bytes", + "name": "", + "type": "bytes" + } + ], + "stateMutability": "view", + "type": "function" + }, { "inputs": [ { @@ -1229,36 +1291,36 @@ "type": "function" } ], - "transactionHash": "0x782a26cef57103e8fecddb769d589065bd4890b3bb3d8fbfc1d4d2aa931bb034", + "transactionHash": "0xfeaacff36018e09a8cefa7f513b7d8f8ed846aa6d2400aa2aa3096033b39203b", "receipt": { "to": "0x4e59b44847b379578588920cA78FbF26c0B4956C", "from": "0x27292E1a901E3E0bE7d144aDba4CAD07da2d8a42", "contractAddress": null, - "transactionIndex": 48, - "gasUsed": "3590483", - "logsBloom": "0x00000000008000000000000000000000000000000001000000800000000000000000400000000000000004000000000000000000000000000000000000040000000000000008000000000008000000000101000000040000800000000000000000000000020000000000000000000800000000000000000040000010000000400000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000002000000000000000000000000000008002000002000000000000000000000000000000000000000000000000000060000000000000000000200000002000000000000000000000000000000000004000", - "blockHash": "0x50f59d4a4b16e551eab59a6e916a6f4e67c4dd86a511b668f70fc5dfa844c0a1", - "transactionHash": "0x782a26cef57103e8fecddb769d589065bd4890b3bb3d8fbfc1d4d2aa931bb034", + "transactionIndex": 75, + "gasUsed": "3986664", + "logsBloom": "0x00000000008000000000000000000000000020000001000000800000000000000000400000000200000014000000000000020000000000000000000000040000000000000000000000000008000000000101000000040000800020000000000000000000020000000040000000000800000000000000000000000010000000400000000000000000000000000000000000000100000000000000000000000000040000000000000000000000000000002100000000000000000000000000008002000002000000000000000000000000000000000000000000000000000060000000000000000000200000040000000000000000000000000000000000004000", + "blockHash": "0xd734cc26afdc21722c9959093b6cc7f6550dadd48dd69fdcbd0902d726fc9fd2", + "transactionHash": "0xfeaacff36018e09a8cefa7f513b7d8f8ed846aa6d2400aa2aa3096033b39203b", "logs": [ { - "transactionIndex": 48, - "blockNumber": 7191167, - "transactionHash": "0x782a26cef57103e8fecddb769d589065bd4890b3bb3d8fbfc1d4d2aa931bb034", - "address": "0xe74bC6A3Ee4ED824708DD88465BD2CdD6b869620", + "transactionIndex": 75, + "blockNumber": 7198670, + "transactionHash": "0xfeaacff36018e09a8cefa7f513b7d8f8ed846aa6d2400aa2aa3096033b39203b", + "address": "0x8583CEbA0d2C5cAe1a1BCff975Faa97063D14953", "topics": [ "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", "0x0000000000000000000000000000000000000000000000000000000000000000", "0x00000000000000000000000027292e1a901e3e0be7d144adba4cad07da2d8a42" ], "data": "0x", - "logIndex": 89, - "blockHash": "0x50f59d4a4b16e551eab59a6e916a6f4e67c4dd86a511b668f70fc5dfa844c0a1" + "logIndex": 152, + "blockHash": "0xd734cc26afdc21722c9959093b6cc7f6550dadd48dd69fdcbd0902d726fc9fd2" }, { - "transactionIndex": 48, - "blockNumber": 7191167, - "transactionHash": "0x782a26cef57103e8fecddb769d589065bd4890b3bb3d8fbfc1d4d2aa931bb034", - "address": "0xe74bC6A3Ee4ED824708DD88465BD2CdD6b869620", + "transactionIndex": 75, + "blockNumber": 7198670, + "transactionHash": "0xfeaacff36018e09a8cefa7f513b7d8f8ed846aa6d2400aa2aa3096033b39203b", + "address": "0x8583CEbA0d2C5cAe1a1BCff975Faa97063D14953", "topics": [ "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", "0x0000000000000000000000000000000000000000000000000000000000000000", @@ -1266,26 +1328,69 @@ "0x0000000000000000000000000000000000000000000000000000000000000000" ], "data": "0x", - "logIndex": 90, - "blockHash": "0x50f59d4a4b16e551eab59a6e916a6f4e67c4dd86a511b668f70fc5dfa844c0a1" + "logIndex": 153, + "blockHash": "0xd734cc26afdc21722c9959093b6cc7f6550dadd48dd69fdcbd0902d726fc9fd2" }, { - "transactionIndex": 48, - "blockNumber": 7191167, - "transactionHash": "0x782a26cef57103e8fecddb769d589065bd4890b3bb3d8fbfc1d4d2aa931bb034", - "address": "0xe74bC6A3Ee4ED824708DD88465BD2CdD6b869620", + "transactionIndex": 75, + "blockNumber": 7198670, + "transactionHash": "0xfeaacff36018e09a8cefa7f513b7d8f8ed846aa6d2400aa2aa3096033b39203b", + "address": "0x8583CEbA0d2C5cAe1a1BCff975Faa97063D14953", "topics": [ "0xf8e1a15aba9398e019f0b49df1a4fde98ee17ae345cb5f6b5e2c27f5033e8ce7" ], "data": "0x0000000000000000000000000000000000000000000000000000000000000000", - "logIndex": 91, - "blockHash": "0x50f59d4a4b16e551eab59a6e916a6f4e67c4dd86a511b668f70fc5dfa844c0a1" + "logIndex": 154, + "blockHash": "0xd734cc26afdc21722c9959093b6cc7f6550dadd48dd69fdcbd0902d726fc9fd2" }, { - "transactionIndex": 48, - "blockNumber": 7191167, - "transactionHash": "0x782a26cef57103e8fecddb769d589065bd4890b3bb3d8fbfc1d4d2aa931bb034", - "address": "0xe74bC6A3Ee4ED824708DD88465BD2CdD6b869620", + "transactionIndex": 75, + "blockNumber": 7198670, + "transactionHash": "0xfeaacff36018e09a8cefa7f513b7d8f8ed846aa6d2400aa2aa3096033b39203b", + "address": "0x8583CEbA0d2C5cAe1a1BCff975Faa97063D14953", + "topics": [ + "0x3134e8a2e6d97e929a7e54011ea5485d7d196dd5f0ba4d4ef95803e8e3fc257f", + "0x000000000000000000000000d8a394e7d7894bdf2c57139ff17e5cbaa29dd977", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x000000000000000000000000d8a394e7d7894bdf2c57139ff17e5cbaa29dd977" + ], + "data": "0x", + "logIndex": 155, + "blockHash": "0xd734cc26afdc21722c9959093b6cc7f6550dadd48dd69fdcbd0902d726fc9fd2" + }, + { + "transactionIndex": 75, + "blockNumber": 7198670, + "transactionHash": "0xfeaacff36018e09a8cefa7f513b7d8f8ed846aa6d2400aa2aa3096033b39203b", + "address": "0x8583CEbA0d2C5cAe1a1BCff975Faa97063D14953", + "topics": [ + "0xdec2bacdd2f05b59de34da9b523dff8be42e5e38e818c82fdb0bae774387a724", + "0x000000000000000000000000d8a394e7d7894bdf2c57139ff17e5cbaa29dd977" + ], + "data": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001", + "logIndex": 156, + "blockHash": "0xd734cc26afdc21722c9959093b6cc7f6550dadd48dd69fdcbd0902d726fc9fd2" + }, + { + "transactionIndex": 75, + "blockNumber": 7198670, + "transactionHash": "0xfeaacff36018e09a8cefa7f513b7d8f8ed846aa6d2400aa2aa3096033b39203b", + "address": "0x8583CEbA0d2C5cAe1a1BCff975Faa97063D14953", + "topics": [ + "0x3134e8a2e6d97e929a7e54011ea5485d7d196dd5f0ba4d4ef95803e8e3fc257f", + "0x000000000000000000000000d8a394e7d7894bdf2c57139ff17e5cbaa29dd977", + "0x000000000000000000000000d8a394e7d7894bdf2c57139ff17e5cbaa29dd977", + "0x000000000000000000000000d8a394e7d7894bdf2c57139ff17e5cbaa29dd977" + ], + "data": "0x", + "logIndex": 157, + "blockHash": "0xd734cc26afdc21722c9959093b6cc7f6550dadd48dd69fdcbd0902d726fc9fd2" + }, + { + "transactionIndex": 75, + "blockNumber": 7198670, + "transactionHash": "0xfeaacff36018e09a8cefa7f513b7d8f8ed846aa6d2400aa2aa3096033b39203b", + "address": "0x8583CEbA0d2C5cAe1a1BCff975Faa97063D14953", "topics": [ "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", "0x0000000000000000000000000000000000000000000000000000000000000000", @@ -1293,24 +1398,67 @@ "0x0000000000000000000000000000000000000000000000000000000000000001" ], "data": "0x", - "logIndex": 92, - "blockHash": "0x50f59d4a4b16e551eab59a6e916a6f4e67c4dd86a511b668f70fc5dfa844c0a1" + "logIndex": 158, + "blockHash": "0xd734cc26afdc21722c9959093b6cc7f6550dadd48dd69fdcbd0902d726fc9fd2" }, { - "transactionIndex": 48, - "blockNumber": 7191167, - "transactionHash": "0x782a26cef57103e8fecddb769d589065bd4890b3bb3d8fbfc1d4d2aa931bb034", - "address": "0xe74bC6A3Ee4ED824708DD88465BD2CdD6b869620", + "transactionIndex": 75, + "blockNumber": 7198670, + "transactionHash": "0xfeaacff36018e09a8cefa7f513b7d8f8ed846aa6d2400aa2aa3096033b39203b", + "address": "0x8583CEbA0d2C5cAe1a1BCff975Faa97063D14953", "topics": [ "0xf8e1a15aba9398e019f0b49df1a4fde98ee17ae345cb5f6b5e2c27f5033e8ce7" ], "data": "0x0000000000000000000000000000000000000000000000000000000000000001", - "logIndex": 93, - "blockHash": "0x50f59d4a4b16e551eab59a6e916a6f4e67c4dd86a511b668f70fc5dfa844c0a1" + "logIndex": 159, + "blockHash": "0xd734cc26afdc21722c9959093b6cc7f6550dadd48dd69fdcbd0902d726fc9fd2" + }, + { + "transactionIndex": 75, + "blockNumber": 7198670, + "transactionHash": "0xfeaacff36018e09a8cefa7f513b7d8f8ed846aa6d2400aa2aa3096033b39203b", + "address": "0x8583CEbA0d2C5cAe1a1BCff975Faa97063D14953", + "topics": [ + "0x3134e8a2e6d97e929a7e54011ea5485d7d196dd5f0ba4d4ef95803e8e3fc257f", + "0x000000000000000000000000e61a1a5278290b6520f0cef3f2c71ba70cf5cf4c", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x000000000000000000000000e61a1a5278290b6520f0cef3f2c71ba70cf5cf4c" + ], + "data": "0x", + "logIndex": 160, + "blockHash": "0xd734cc26afdc21722c9959093b6cc7f6550dadd48dd69fdcbd0902d726fc9fd2" + }, + { + "transactionIndex": 75, + "blockNumber": 7198670, + "transactionHash": "0xfeaacff36018e09a8cefa7f513b7d8f8ed846aa6d2400aa2aa3096033b39203b", + "address": "0x8583CEbA0d2C5cAe1a1BCff975Faa97063D14953", + "topics": [ + "0xdec2bacdd2f05b59de34da9b523dff8be42e5e38e818c82fdb0bae774387a724", + "0x000000000000000000000000e61a1a5278290b6520f0cef3f2c71ba70cf5cf4c" + ], + "data": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001", + "logIndex": 161, + "blockHash": "0xd734cc26afdc21722c9959093b6cc7f6550dadd48dd69fdcbd0902d726fc9fd2" + }, + { + "transactionIndex": 75, + "blockNumber": 7198670, + "transactionHash": "0xfeaacff36018e09a8cefa7f513b7d8f8ed846aa6d2400aa2aa3096033b39203b", + "address": "0x8583CEbA0d2C5cAe1a1BCff975Faa97063D14953", + "topics": [ + "0x3134e8a2e6d97e929a7e54011ea5485d7d196dd5f0ba4d4ef95803e8e3fc257f", + "0x000000000000000000000000e61a1a5278290b6520f0cef3f2c71ba70cf5cf4c", + "0x000000000000000000000000e61a1a5278290b6520f0cef3f2c71ba70cf5cf4c", + "0x000000000000000000000000e61a1a5278290b6520f0cef3f2c71ba70cf5cf4c" + ], + "data": "0x", + "logIndex": 162, + "blockHash": "0xd734cc26afdc21722c9959093b6cc7f6550dadd48dd69fdcbd0902d726fc9fd2" } ], - "blockNumber": 7191167, - "cumulativeGasUsed": "9627400", + "blockNumber": 7198670, + "cumulativeGasUsed": "13755240", "status": 1, "byzantium": true }, @@ -1326,17 +1474,17 @@ "MEMBER" ], "numDeployments": 1, - "solcInputHash": "96a9008abeaccbd30a9b75989ce7f0fd", - "metadata": "{\"compiler\":{\"version\":\"0.8.20+commit.a1b79de6\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_home\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"initialOwner\",\"type\":\"address\"},{\"internalType\":\"address[]\",\"name\":\"_firstMembers\",\"type\":\"address[]\"},{\"internalType\":\"string\",\"name\":\"_uri\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"_name\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"_symbol\",\"type\":\"string\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"CheckpointUnorderedInsertion\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ECDSAInvalidSignature\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"length\",\"type\":\"uint256\"}],\"name\":\"ECDSAInvalidSignatureLength\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"name\":\"ECDSAInvalidSignatureS\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"timepoint\",\"type\":\"uint256\"},{\"internalType\":\"uint48\",\"name\":\"clock\",\"type\":\"uint48\"}],\"name\":\"ERC5805FutureLookup\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ERC6372InconsistentClock\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ERC721EnumerableForbiddenBatchMint\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"ERC721IncorrectOwner\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"ERC721InsufficientApproval\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"approver\",\"type\":\"address\"}],\"name\":\"ERC721InvalidApprover\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"}],\"name\":\"ERC721InvalidOperator\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"ERC721InvalidOwner\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"}],\"name\":\"ERC721InvalidReceiver\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"ERC721InvalidSender\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"ERC721NonexistentToken\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"index\",\"type\":\"uint256\"}],\"name\":\"ERC721OutOfBoundsIndex\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"currentNonce\",\"type\":\"uint256\"}],\"name\":\"InvalidAccountNonce\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidShortString\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"OwnableInvalidOwner\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"OwnableUnauthorizedAccount\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint8\",\"name\":\"bits\",\"type\":\"uint8\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"SafeCastOverflowedUintDowncast\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"str\",\"type\":\"string\"}],\"name\":\"StringTooLong\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expiry\",\"type\":\"uint256\"}],\"name\":\"VotesExpiredSignature\",\"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\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_fromTokenId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_toTokenId\",\"type\":\"uint256\"}],\"name\":\"BatchMetadataUpdate\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"delegator\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"fromDelegate\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"toDelegate\",\"type\":\"address\"}],\"name\":\"DelegateChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"delegate\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"previousVotes\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newVotes\",\"type\":\"uint256\"}],\"name\":\"DelegateVotesChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[],\"name\":\"EIP712DomainChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"member\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"}],\"name\":\"MembershipClaimed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"member\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"}],\"name\":\"MembershipRevoked\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_tokenId\",\"type\":\"uint256\"}],\"name\":\"MetadataUpdate\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"newUri\",\"type\":\"string\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"}],\"name\":\"MetadataUpdated\",\"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\":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\":\"CLOCK_MODE\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"pure\",\"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\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"burn\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"proof\",\"type\":\"bytes\"}],\"name\":\"claimOperation\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"clock\",\"outputs\":[{\"internalType\":\"uint48\",\"name\":\"\",\"type\":\"uint48\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"delegatee\",\"type\":\"address\"}],\"name\":\"delegate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"delegatee\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expiry\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"name\":\"delegateBySig\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"delegates\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"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\":[{\"internalType\":\"uint8\",\"name\":\"operationType\",\"type\":\"uint8\"},{\"internalType\":\"bytes\",\"name\":\"params\",\"type\":\"bytes\"}],\"name\":\"generateOperationProof\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"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\":\"uint256\",\"name\":\"timepoint\",\"type\":\"uint256\"}],\"name\":\"getPastTotalSupply\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"timepoint\",\"type\":\"uint256\"}],\"name\":\"getPastVotes\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"getVotes\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"govBurn\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"home\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"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\":[],\"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\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"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\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"uri\",\"type\":\"string\"}],\"name\":\"safeMint\",\"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\":[{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"approved\",\"type\":\"bool\"}],\"name\":\"setApprovalForAll\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"string\",\"name\":\"uri\",\"type\":\"string\"}],\"name\":\"setMetadata\",\"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\":\"index\",\"type\":\"uint256\"}],\"name\":\"tokenByIndex\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"index\",\"type\":\"uint256\"}],\"name\":\"tokenOfOwnerByIndex\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"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\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"author\":\"Web3 Hackers Collective\",\"custom:security-contact\":\"julien@strat.cc\",\"details\":\"Uses ProofHandler library for cross-chain proof management\",\"errors\":{\"CheckpointUnorderedInsertion()\":[{\"details\":\"A value was attempted to be inserted on a past checkpoint.\"}],\"ECDSAInvalidSignature()\":[{\"details\":\"The signature derives the `address(0)`.\"}],\"ECDSAInvalidSignatureLength(uint256)\":[{\"details\":\"The signature has an invalid length.\"}],\"ECDSAInvalidSignatureS(bytes32)\":[{\"details\":\"The signature has an S value that is in the upper half order.\"}],\"ERC5805FutureLookup(uint256,uint48)\":[{\"details\":\"Lookup to future votes is not available.\"}],\"ERC6372InconsistentClock()\":[{\"details\":\"The clock was incorrectly modified.\"}],\"ERC721EnumerableForbiddenBatchMint()\":[{\"details\":\"Batch mint is not allowed.\"}],\"ERC721IncorrectOwner(address,uint256,address)\":[{\"details\":\"Indicates an error related to the ownership over a particular token. Used in transfers.\",\"params\":{\"owner\":\"Address of the current owner of a token.\",\"sender\":\"Address whose tokens are being transferred.\",\"tokenId\":\"Identifier number of a token.\"}}],\"ERC721InsufficientApproval(address,uint256)\":[{\"details\":\"Indicates a failure with the `operator`\\u2019s approval. Used in transfers.\",\"params\":{\"operator\":\"Address that may be allowed to operate on tokens without being their owner.\",\"tokenId\":\"Identifier number of a token.\"}}],\"ERC721InvalidApprover(address)\":[{\"details\":\"Indicates a failure with the `approver` of a token to be approved. Used in approvals.\",\"params\":{\"approver\":\"Address initiating an approval operation.\"}}],\"ERC721InvalidOperator(address)\":[{\"details\":\"Indicates a failure with the `operator` to be approved. Used in approvals.\",\"params\":{\"operator\":\"Address that may be allowed to operate on tokens without being their owner.\"}}],\"ERC721InvalidOwner(address)\":[{\"details\":\"Indicates that an address can't be an owner. For example, `address(0)` is a forbidden owner in ERC-20. Used in balance queries.\",\"params\":{\"owner\":\"Address of the current owner of a token.\"}}],\"ERC721InvalidReceiver(address)\":[{\"details\":\"Indicates a failure with the token `receiver`. Used in transfers.\",\"params\":{\"receiver\":\"Address to which tokens are being transferred.\"}}],\"ERC721InvalidSender(address)\":[{\"details\":\"Indicates a failure with the token `sender`. Used in transfers.\",\"params\":{\"sender\":\"Address whose tokens are being transferred.\"}}],\"ERC721NonexistentToken(uint256)\":[{\"details\":\"Indicates a `tokenId` whose `owner` is the zero address.\",\"params\":{\"tokenId\":\"Identifier number of a token.\"}}],\"ERC721OutOfBoundsIndex(address,uint256)\":[{\"details\":\"An `owner`'s token query was out of bounds for `index`. NOTE: The owner being `address(0)` indicates a global out of bounds index.\"}],\"InvalidAccountNonce(address,uint256)\":[{\"details\":\"The nonce used for an `account` is not the expected current nonce.\"}],\"OwnableInvalidOwner(address)\":[{\"details\":\"The owner is not a valid owner account. (eg. `address(0)`)\"}],\"OwnableUnauthorizedAccount(address)\":[{\"details\":\"The caller account is not authorized to perform an operation.\"}],\"SafeCastOverflowedUintDowncast(uint8,uint256)\":[{\"details\":\"Value doesn't fit in an uint of `bits` size.\"}],\"VotesExpiredSignature(uint256)\":[{\"details\":\"The signature used has expired.\"}]},\"events\":{\"Approval(address,address,uint256)\":{\"details\":\"Emitted when `owner` enables `approved` to manage the `tokenId` token.\"},\"ApprovalForAll(address,address,bool)\":{\"details\":\"Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.\"},\"BatchMetadataUpdate(uint256,uint256)\":{\"details\":\"This event emits when the metadata of a range of tokens is changed. So that the third-party platforms such as NFT market could timely update the images and related attributes of the NFTs.\"},\"DelegateChanged(address,address,address)\":{\"details\":\"Emitted when an account changes their delegate.\"},\"DelegateVotesChanged(address,uint256,uint256)\":{\"details\":\"Emitted when a token transfer or delegate change results in changes to a delegate's number of voting units.\"},\"EIP712DomainChanged()\":{\"details\":\"MAY be emitted to signal that the domain could have changed.\"},\"MembershipClaimed(uint256,address,uint256)\":{\"params\":{\"member\":\"The address receiving the membership\",\"nonce\":\"Operation sequence number\",\"tokenId\":\"The ID of the claimed token\"}},\"MembershipRevoked(uint256,address,uint256)\":{\"params\":{\"member\":\"The address losing membership\",\"nonce\":\"Operation sequence number\",\"tokenId\":\"The ID of the revoked token\"}},\"MetadataUpdate(uint256)\":{\"details\":\"This event emits when the metadata of a token is changed. So that the third-party platforms such as NFT market could timely update the images and related attributes of the NFT.\"},\"MetadataUpdated(uint256,string,uint256)\":{\"params\":{\"newUri\":\"The new metadata URI\",\"nonce\":\"Operation sequence number\",\"tokenId\":\"The ID of the updated token\"}},\"Transfer(address,address,uint256)\":{\"details\":\"Emitted when `tokenId` token is transferred from `from` to `to`.\"}},\"kind\":\"dev\",\"methods\":{\"CLOCK_MODE()\":{\"details\":\"Machine-readable description of the clock as specified in ERC-6372.\"},\"approve(address,uint256)\":{\"details\":\"See {IERC721-approve}.\"},\"balanceOf(address)\":{\"details\":\"See {IERC721-balanceOf}.\"},\"burn(uint256)\":{\"details\":\"Burns `tokenId`. See {ERC721-_burn}. Requirements: - The caller must own `tokenId` or be an approved operator.\"},\"claimOperation(bytes)\":{\"params\":{\"proof\":\"Proof generated by home chain\"}},\"clock()\":{\"details\":\"Clock used for flagging checkpoints. Can be overridden to implement timestamp based checkpoints (and voting), in which case {CLOCK_MODE} should be overridden as well to match.\"},\"constructor\":{\"params\":{\"_firstMembers\":\"Array of initial member addresses\",\"_home\":\"Chain ID where contract is considered home\",\"_name\":\"Token collection name\",\"_symbol\":\"Token collection symbol\",\"_uri\":\"Initial token URI\",\"initialOwner\":\"Initial contract owner\"}},\"delegate(address)\":{\"details\":\"Delegates votes from the sender to `delegatee`.\"},\"delegateBySig(address,uint256,uint256,uint8,bytes32,bytes32)\":{\"details\":\"Delegates votes from signer to `delegatee`.\"},\"delegates(address)\":{\"details\":\"Returns the delegate that `account` has chosen.\"},\"eip712Domain()\":{\"details\":\"See {IERC-5267}.\"},\"generateOperationProof(uint8,bytes)\":{\"params\":{\"operationType\":\"Type of operation\",\"params\":\"Operation parameters\"},\"returns\":{\"_0\":\"Encoded proof data\"}},\"getApproved(uint256)\":{\"details\":\"See {IERC721-getApproved}.\"},\"getPastTotalSupply(uint256)\":{\"details\":\"Returns the total supply of votes available at a specific moment in the past. If the `clock()` is configured to use block numbers, this will return the value at the end of the corresponding block. NOTE: This value is the sum of all available votes, which is not necessarily the sum of all delegated votes. Votes that have not been delegated are still part of total supply, even though they would not participate in a vote. Requirements: - `timepoint` must be in the past. If operating using block numbers, the block must be already mined.\"},\"getPastVotes(address,uint256)\":{\"details\":\"Returns the amount of votes that `account` had at a specific moment in the past. If the `clock()` is configured to use block numbers, this will return the value at the end of the corresponding block. Requirements: - `timepoint` must be in the past. If operating using block numbers, the block must be already mined.\"},\"getVotes(address)\":{\"details\":\"Returns the current amount of votes that `account` has.\"},\"govBurn(uint256)\":{\"details\":\"Only callable by owner (governance) on home chain\",\"params\":{\"tokenId\":\"ID of token to burn\"}},\"isApprovedForAll(address,address)\":{\"details\":\"See {IERC721-isApprovedForAll}.\"},\"name()\":{\"details\":\"See {IERC721Metadata-name}.\"},\"nonces(address)\":{\"details\":\"Returns the next unused nonce for an address.\"},\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"ownerOf(uint256)\":{\"details\":\"See {IERC721-ownerOf}.\"},\"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.\"},\"safeMint(address,string)\":{\"details\":\"Only callable by owner (governance) on home chain\",\"params\":{\"to\":\"Address to mint token to\",\"uri\":\"Token metadata URI\"}},\"safeTransferFrom(address,address,uint256)\":{\"details\":\"See {IERC721-safeTransferFrom}.\"},\"safeTransferFrom(address,address,uint256,bytes)\":{\"details\":\"See {IERC721-safeTransferFrom}.\"},\"setApprovalForAll(address,bool)\":{\"details\":\"See {IERC721-setApprovalForAll}.\"},\"setMetadata(uint256,string)\":{\"details\":\"Only callable by owner (governance) on home chain\",\"params\":{\"tokenId\":\"ID of token to update\",\"uri\":\"New metadata URI\"}},\"symbol()\":{\"details\":\"See {IERC721Metadata-symbol}.\"},\"tokenByIndex(uint256)\":{\"details\":\"See {IERC721Enumerable-tokenByIndex}.\"},\"tokenOfOwnerByIndex(address,uint256)\":{\"details\":\"See {IERC721Enumerable-tokenOfOwnerByIndex}.\"},\"totalSupply()\":{\"details\":\"See {IERC721Enumerable-totalSupply}.\"},\"transferFrom(address,address,uint256)\":{\"details\":\"See {IERC721-transferFrom}.\"},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.\"}},\"title\":\"Cross-chain Membership NFT Contract\",\"version\":1},\"userdoc\":{\"events\":{\"MembershipClaimed(uint256,address,uint256)\":{\"notice\":\"Emitted when a membership is claimed\"},\"MembershipRevoked(uint256,address,uint256)\":{\"notice\":\"Emitted when a membership is revoked\"},\"MetadataUpdated(uint256,string,uint256)\":{\"notice\":\"Emitted when metadata is updated\"}},\"kind\":\"user\",\"methods\":{\"claimOperation(bytes)\":{\"notice\":\"Claims an NFT operation on a foreign chain\"},\"constructor\":{\"notice\":\"Initializes the NFT contract\"},\"generateOperationProof(uint8,bytes)\":{\"notice\":\"Generates proof for NFT operations\"},\"govBurn(uint256)\":{\"notice\":\"Burns token on home chain\"},\"home()\":{\"notice\":\"Chain ID where contract was originally deployed\"},\"safeMint(address,string)\":{\"notice\":\"Adds a new member on home chain\"},\"setMetadata(uint256,string)\":{\"notice\":\"Updates token metadata on home chain\"}},\"notice\":\"Non-transferable NFT implementation for DAO membership with cross-chain capabilities\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/variants/crosschain/NFT.sol\":\"NFT\"},\"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 v5.0.0) (access/Ownable.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {Context} from \\\"../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 * The initial owner is set to the address provided by the deployer. This can\\n * 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 /**\\n * @dev The caller account is not authorized to perform an operation.\\n */\\n error OwnableUnauthorizedAccount(address account);\\n\\n /**\\n * @dev The owner is not a valid owner account. (eg. `address(0)`)\\n */\\n error OwnableInvalidOwner(address owner);\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the address provided by the deployer as the initial owner.\\n */\\n constructor(address initialOwner) {\\n if (initialOwner == address(0)) {\\n revert OwnableInvalidOwner(address(0));\\n }\\n _transferOwnership(initialOwner);\\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 if (owner() != _msgSender()) {\\n revert OwnableUnauthorizedAccount(_msgSender());\\n }\\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 if (newOwner == address(0)) {\\n revert OwnableInvalidOwner(address(0));\\n }\\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\":\"0xff6d0bb2e285473e5311d9d3caacb525ae3538a80758c10649a4d61029b017bb\",\"license\":\"MIT\"},\"@openzeppelin/contracts/governance/utils/IVotes.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (governance/utils/IVotes.sol)\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Common interface for {ERC20Votes}, {ERC721Votes}, and other {Votes}-enabled contracts.\\n */\\ninterface IVotes {\\n /**\\n * @dev The signature used has expired.\\n */\\n error VotesExpiredSignature(uint256 expiry);\\n\\n /**\\n * @dev Emitted when an account changes their delegate.\\n */\\n event DelegateChanged(address indexed delegator, address indexed fromDelegate, address indexed toDelegate);\\n\\n /**\\n * @dev Emitted when a token transfer or delegate change results in changes to a delegate's number of voting units.\\n */\\n event DelegateVotesChanged(address indexed delegate, uint256 previousVotes, uint256 newVotes);\\n\\n /**\\n * @dev Returns the current amount of votes that `account` has.\\n */\\n function getVotes(address account) external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of votes that `account` had at a specific moment in the past. If the `clock()` is\\n * configured to use block numbers, this will return the value at the end of the corresponding block.\\n */\\n function getPastVotes(address account, uint256 timepoint) external view returns (uint256);\\n\\n /**\\n * @dev Returns the total supply of votes available at a specific moment in the past. If the `clock()` is\\n * configured to use block numbers, this will return the value at the end of the corresponding block.\\n *\\n * NOTE: This value is the sum of all available votes, which is not necessarily the sum of all delegated votes.\\n * Votes that have not been delegated are still part of total supply, even though they would not participate in a\\n * vote.\\n */\\n function getPastTotalSupply(uint256 timepoint) external view returns (uint256);\\n\\n /**\\n * @dev Returns the delegate that `account` has chosen.\\n */\\n function delegates(address account) external view returns (address);\\n\\n /**\\n * @dev Delegates votes from the sender to `delegatee`.\\n */\\n function delegate(address delegatee) external;\\n\\n /**\\n * @dev Delegates votes from signer to `delegatee`.\\n */\\n function delegateBySig(address delegatee, uint256 nonce, uint256 expiry, uint8 v, bytes32 r, bytes32 s) external;\\n}\\n\",\"keccak256\":\"0x5e2b397ae88fd5c68e4f6762eb9f65f65c36702eb57796495f471d024ce70947\",\"license\":\"MIT\"},\"@openzeppelin/contracts/governance/utils/Votes.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (governance/utils/Votes.sol)\\npragma solidity ^0.8.20;\\n\\nimport {IERC5805} from \\\"../../interfaces/IERC5805.sol\\\";\\nimport {Context} from \\\"../../utils/Context.sol\\\";\\nimport {Nonces} from \\\"../../utils/Nonces.sol\\\";\\nimport {EIP712} from \\\"../../utils/cryptography/EIP712.sol\\\";\\nimport {Checkpoints} from \\\"../../utils/structs/Checkpoints.sol\\\";\\nimport {SafeCast} from \\\"../../utils/math/SafeCast.sol\\\";\\nimport {ECDSA} from \\\"../../utils/cryptography/ECDSA.sol\\\";\\nimport {Time} from \\\"../../utils/types/Time.sol\\\";\\n\\n/**\\n * @dev This is a base abstract contract that tracks voting units, which are a measure of voting power that can be\\n * transferred, and provides a system of vote delegation, where an account can delegate its voting units to a sort of\\n * \\\"representative\\\" that will pool delegated voting units from different accounts and can then use it to vote in\\n * decisions. In fact, voting units _must_ be delegated in order to count as actual votes, and an account has to\\n * delegate those votes to itself if it wishes to participate in decisions and does not have a trusted representative.\\n *\\n * This contract is often combined with a token contract such that voting units correspond to token units. For an\\n * example, see {ERC721Votes}.\\n *\\n * The full history of delegate votes is tracked on-chain so that governance protocols can consider votes as distributed\\n * at a particular block number to protect against flash loans and double voting. The opt-in delegate system makes the\\n * cost of this history tracking optional.\\n *\\n * When using this module the derived contract must implement {_getVotingUnits} (for example, make it return\\n * {ERC721-balanceOf}), and can use {_transferVotingUnits} to track a change in the distribution of those units (in the\\n * previous example, it would be included in {ERC721-_update}).\\n */\\nabstract contract Votes is Context, EIP712, Nonces, IERC5805 {\\n using Checkpoints for Checkpoints.Trace208;\\n\\n bytes32 private constant DELEGATION_TYPEHASH =\\n keccak256(\\\"Delegation(address delegatee,uint256 nonce,uint256 expiry)\\\");\\n\\n mapping(address account => address) private _delegatee;\\n\\n mapping(address delegatee => Checkpoints.Trace208) private _delegateCheckpoints;\\n\\n Checkpoints.Trace208 private _totalCheckpoints;\\n\\n /**\\n * @dev The clock was incorrectly modified.\\n */\\n error ERC6372InconsistentClock();\\n\\n /**\\n * @dev Lookup to future votes is not available.\\n */\\n error ERC5805FutureLookup(uint256 timepoint, uint48 clock);\\n\\n /**\\n * @dev Clock used for flagging checkpoints. Can be overridden to implement timestamp based\\n * checkpoints (and voting), in which case {CLOCK_MODE} should be overridden as well to match.\\n */\\n function clock() public view virtual returns (uint48) {\\n return Time.blockNumber();\\n }\\n\\n /**\\n * @dev Machine-readable description of the clock as specified in ERC-6372.\\n */\\n // solhint-disable-next-line func-name-mixedcase\\n function CLOCK_MODE() public view virtual returns (string memory) {\\n // Check that the clock was not modified\\n if (clock() != Time.blockNumber()) {\\n revert ERC6372InconsistentClock();\\n }\\n return \\\"mode=blocknumber&from=default\\\";\\n }\\n\\n /**\\n * @dev Returns the current amount of votes that `account` has.\\n */\\n function getVotes(address account) public view virtual returns (uint256) {\\n return _delegateCheckpoints[account].latest();\\n }\\n\\n /**\\n * @dev Returns the amount of votes that `account` had at a specific moment in the past. If the `clock()` is\\n * configured to use block numbers, this will return the value at the end of the corresponding block.\\n *\\n * Requirements:\\n *\\n * - `timepoint` must be in the past. If operating using block numbers, the block must be already mined.\\n */\\n function getPastVotes(address account, uint256 timepoint) public view virtual returns (uint256) {\\n uint48 currentTimepoint = clock();\\n if (timepoint >= currentTimepoint) {\\n revert ERC5805FutureLookup(timepoint, currentTimepoint);\\n }\\n return _delegateCheckpoints[account].upperLookupRecent(SafeCast.toUint48(timepoint));\\n }\\n\\n /**\\n * @dev Returns the total supply of votes available at a specific moment in the past. If the `clock()` is\\n * configured to use block numbers, this will return the value at the end of the corresponding block.\\n *\\n * NOTE: This value is the sum of all available votes, which is not necessarily the sum of all delegated votes.\\n * Votes that have not been delegated are still part of total supply, even though they would not participate in a\\n * vote.\\n *\\n * Requirements:\\n *\\n * - `timepoint` must be in the past. If operating using block numbers, the block must be already mined.\\n */\\n function getPastTotalSupply(uint256 timepoint) public view virtual returns (uint256) {\\n uint48 currentTimepoint = clock();\\n if (timepoint >= currentTimepoint) {\\n revert ERC5805FutureLookup(timepoint, currentTimepoint);\\n }\\n return _totalCheckpoints.upperLookupRecent(SafeCast.toUint48(timepoint));\\n }\\n\\n /**\\n * @dev Returns the current total supply of votes.\\n */\\n function _getTotalSupply() internal view virtual returns (uint256) {\\n return _totalCheckpoints.latest();\\n }\\n\\n /**\\n * @dev Returns the delegate that `account` has chosen.\\n */\\n function delegates(address account) public view virtual returns (address) {\\n return _delegatee[account];\\n }\\n\\n /**\\n * @dev Delegates votes from the sender to `delegatee`.\\n */\\n function delegate(address delegatee) public virtual {\\n address account = _msgSender();\\n _delegate(account, delegatee);\\n }\\n\\n /**\\n * @dev Delegates votes from signer to `delegatee`.\\n */\\n function delegateBySig(\\n address delegatee,\\n uint256 nonce,\\n uint256 expiry,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) public virtual {\\n if (block.timestamp > expiry) {\\n revert VotesExpiredSignature(expiry);\\n }\\n address signer = ECDSA.recover(\\n _hashTypedDataV4(keccak256(abi.encode(DELEGATION_TYPEHASH, delegatee, nonce, expiry))),\\n v,\\n r,\\n s\\n );\\n _useCheckedNonce(signer, nonce);\\n _delegate(signer, delegatee);\\n }\\n\\n /**\\n * @dev Delegate all of `account`'s voting units to `delegatee`.\\n *\\n * Emits events {IVotes-DelegateChanged} and {IVotes-DelegateVotesChanged}.\\n */\\n function _delegate(address account, address delegatee) internal virtual {\\n address oldDelegate = delegates(account);\\n _delegatee[account] = delegatee;\\n\\n emit DelegateChanged(account, oldDelegate, delegatee);\\n _moveDelegateVotes(oldDelegate, delegatee, _getVotingUnits(account));\\n }\\n\\n /**\\n * @dev Transfers, mints, or burns voting units. To register a mint, `from` should be zero. To register a burn, `to`\\n * should be zero. Total supply of voting units will be adjusted with mints and burns.\\n */\\n function _transferVotingUnits(address from, address to, uint256 amount) internal virtual {\\n if (from == address(0)) {\\n _push(_totalCheckpoints, _add, SafeCast.toUint208(amount));\\n }\\n if (to == address(0)) {\\n _push(_totalCheckpoints, _subtract, SafeCast.toUint208(amount));\\n }\\n _moveDelegateVotes(delegates(from), delegates(to), amount);\\n }\\n\\n /**\\n * @dev Moves delegated votes from one delegate to another.\\n */\\n function _moveDelegateVotes(address from, address to, uint256 amount) internal virtual {\\n if (from != to && amount > 0) {\\n if (from != address(0)) {\\n (uint256 oldValue, uint256 newValue) = _push(\\n _delegateCheckpoints[from],\\n _subtract,\\n SafeCast.toUint208(amount)\\n );\\n emit DelegateVotesChanged(from, oldValue, newValue);\\n }\\n if (to != address(0)) {\\n (uint256 oldValue, uint256 newValue) = _push(\\n _delegateCheckpoints[to],\\n _add,\\n SafeCast.toUint208(amount)\\n );\\n emit DelegateVotesChanged(to, oldValue, newValue);\\n }\\n }\\n }\\n\\n /**\\n * @dev Get number of checkpoints for `account`.\\n */\\n function _numCheckpoints(address account) internal view virtual returns (uint32) {\\n return SafeCast.toUint32(_delegateCheckpoints[account].length());\\n }\\n\\n /**\\n * @dev Get the `pos`-th checkpoint for `account`.\\n */\\n function _checkpoints(\\n address account,\\n uint32 pos\\n ) internal view virtual returns (Checkpoints.Checkpoint208 memory) {\\n return _delegateCheckpoints[account].at(pos);\\n }\\n\\n function _push(\\n Checkpoints.Trace208 storage store,\\n function(uint208, uint208) view returns (uint208) op,\\n uint208 delta\\n ) private returns (uint208 oldValue, uint208 newValue) {\\n return store.push(clock(), op(store.latest(), delta));\\n }\\n\\n function _add(uint208 a, uint208 b) private pure returns (uint208) {\\n return a + b;\\n }\\n\\n function _subtract(uint208 a, uint208 b) private pure returns (uint208) {\\n return a - b;\\n }\\n\\n /**\\n * @dev Must return the voting units held by an account.\\n */\\n function _getVotingUnits(address) internal view virtual returns (uint256);\\n}\\n\",\"keccak256\":\"0x9128a324d265044430e5fa4a6a2853e92d6a62a2a5a69c2fc623f5b7b8cf3f34\",\"license\":\"MIT\"},\"@openzeppelin/contracts/interfaces/IERC165.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC165.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {IERC165} from \\\"../utils/introspection/IERC165.sol\\\";\\n\",\"keccak256\":\"0xde7e9fd9aee8d4f40772f96bb3b58836cbc6dfc0227014a061947f8821ea9724\",\"license\":\"MIT\"},\"@openzeppelin/contracts/interfaces/IERC4906.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (interfaces/IERC4906.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {IERC165} from \\\"./IERC165.sol\\\";\\nimport {IERC721} from \\\"./IERC721.sol\\\";\\n\\n/// @title ERC-721 Metadata Update Extension\\ninterface IERC4906 is IERC165, IERC721 {\\n /// @dev This event emits when the metadata of a token is changed.\\n /// So that the third-party platforms such as NFT market could\\n /// timely update the images and related attributes of the NFT.\\n event MetadataUpdate(uint256 _tokenId);\\n\\n /// @dev This event emits when the metadata of a range of tokens is changed.\\n /// So that the third-party platforms such as NFT market could\\n /// timely update the images and related attributes of the NFTs.\\n event BatchMetadataUpdate(uint256 _fromTokenId, uint256 _toTokenId);\\n}\\n\",\"keccak256\":\"0x1b8691e244f6e11d987459993671db0af33e6a29f7805eac6a9925cc6b601957\",\"license\":\"MIT\"},\"@openzeppelin/contracts/interfaces/IERC5267.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC5267.sol)\\n\\npragma solidity ^0.8.20;\\n\\ninterface IERC5267 {\\n /**\\n * @dev MAY be emitted to signal that the domain could have changed.\\n */\\n event EIP712DomainChanged();\\n\\n /**\\n * @dev returns the fields and values that describe the domain separator used by this contract for EIP-712\\n * signature.\\n */\\n function eip712Domain()\\n external\\n view\\n returns (\\n bytes1 fields,\\n string memory name,\\n string memory version,\\n uint256 chainId,\\n address verifyingContract,\\n bytes32 salt,\\n uint256[] memory extensions\\n );\\n}\\n\",\"keccak256\":\"0x92aa1df62dc3d33f1656d63bede0923e0df0b706ad4137c8b10b0a8fe549fd92\",\"license\":\"MIT\"},\"@openzeppelin/contracts/interfaces/IERC5805.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC5805.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {IVotes} from \\\"../governance/utils/IVotes.sol\\\";\\nimport {IERC6372} from \\\"./IERC6372.sol\\\";\\n\\ninterface IERC5805 is IERC6372, IVotes {}\\n\",\"keccak256\":\"0x4b9b89f91adbb7d3574f85394754cfb08c5b4eafca8a7061e2094a019ab8f818\",\"license\":\"MIT\"},\"@openzeppelin/contracts/interfaces/IERC6372.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC6372.sol)\\n\\npragma solidity ^0.8.20;\\n\\ninterface IERC6372 {\\n /**\\n * @dev Clock used for flagging checkpoints. Can be overridden to implement timestamp based checkpoints (and voting).\\n */\\n function clock() external view returns (uint48);\\n\\n /**\\n * @dev Description of the clock\\n */\\n // solhint-disable-next-line func-name-mixedcase\\n function CLOCK_MODE() external view returns (string memory);\\n}\\n\",\"keccak256\":\"0xeb2857b7dafb7e0d8526dbfe794e6c047df2851c9e6ee91dc4a55f3c34af5d33\",\"license\":\"MIT\"},\"@openzeppelin/contracts/interfaces/IERC721.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC721.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {IERC721} from \\\"../token/ERC721/IERC721.sol\\\";\\n\",\"keccak256\":\"0xc4d7ebf63eb2f6bf3fee1b6c0ee775efa9f31b4843a5511d07eea147e212932d\",\"license\":\"MIT\"},\"@openzeppelin/contracts/interfaces/draft-IERC6093.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (interfaces/draft-IERC6093.sol)\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Standard ERC-20 Errors\\n * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC-20 tokens.\\n */\\ninterface IERC20Errors {\\n /**\\n * @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers.\\n * @param sender Address whose tokens are being transferred.\\n * @param balance Current balance for the interacting account.\\n * @param needed Minimum amount required to perform a transfer.\\n */\\n error ERC20InsufficientBalance(address sender, uint256 balance, uint256 needed);\\n\\n /**\\n * @dev Indicates a failure with the token `sender`. Used in transfers.\\n * @param sender Address whose tokens are being transferred.\\n */\\n error ERC20InvalidSender(address sender);\\n\\n /**\\n * @dev Indicates a failure with the token `receiver`. Used in transfers.\\n * @param receiver Address to which tokens are being transferred.\\n */\\n error ERC20InvalidReceiver(address receiver);\\n\\n /**\\n * @dev Indicates a failure with the `spender`\\u2019s `allowance`. Used in transfers.\\n * @param spender Address that may be allowed to operate on tokens without being their owner.\\n * @param allowance Amount of tokens a `spender` is allowed to operate with.\\n * @param needed Minimum amount required to perform a transfer.\\n */\\n error ERC20InsufficientAllowance(address spender, uint256 allowance, uint256 needed);\\n\\n /**\\n * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.\\n * @param approver Address initiating an approval operation.\\n */\\n error ERC20InvalidApprover(address approver);\\n\\n /**\\n * @dev Indicates a failure with the `spender` to be approved. Used in approvals.\\n * @param spender Address that may be allowed to operate on tokens without being their owner.\\n */\\n error ERC20InvalidSpender(address spender);\\n}\\n\\n/**\\n * @dev Standard ERC-721 Errors\\n * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC-721 tokens.\\n */\\ninterface IERC721Errors {\\n /**\\n * @dev Indicates that an address can't be an owner. For example, `address(0)` is a forbidden owner in ERC-20.\\n * Used in balance queries.\\n * @param owner Address of the current owner of a token.\\n */\\n error ERC721InvalidOwner(address owner);\\n\\n /**\\n * @dev Indicates a `tokenId` whose `owner` is the zero address.\\n * @param tokenId Identifier number of a token.\\n */\\n error ERC721NonexistentToken(uint256 tokenId);\\n\\n /**\\n * @dev Indicates an error related to the ownership over a particular token. Used in transfers.\\n * @param sender Address whose tokens are being transferred.\\n * @param tokenId Identifier number of a token.\\n * @param owner Address of the current owner of a token.\\n */\\n error ERC721IncorrectOwner(address sender, uint256 tokenId, address owner);\\n\\n /**\\n * @dev Indicates a failure with the token `sender`. Used in transfers.\\n * @param sender Address whose tokens are being transferred.\\n */\\n error ERC721InvalidSender(address sender);\\n\\n /**\\n * @dev Indicates a failure with the token `receiver`. Used in transfers.\\n * @param receiver Address to which tokens are being transferred.\\n */\\n error ERC721InvalidReceiver(address receiver);\\n\\n /**\\n * @dev Indicates a failure with the `operator`\\u2019s approval. Used in transfers.\\n * @param operator Address that may be allowed to operate on tokens without being their owner.\\n * @param tokenId Identifier number of a token.\\n */\\n error ERC721InsufficientApproval(address operator, uint256 tokenId);\\n\\n /**\\n * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.\\n * @param approver Address initiating an approval operation.\\n */\\n error ERC721InvalidApprover(address approver);\\n\\n /**\\n * @dev Indicates a failure with the `operator` to be approved. Used in approvals.\\n * @param operator Address that may be allowed to operate on tokens without being their owner.\\n */\\n error ERC721InvalidOperator(address operator);\\n}\\n\\n/**\\n * @dev Standard ERC-1155 Errors\\n * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC-1155 tokens.\\n */\\ninterface IERC1155Errors {\\n /**\\n * @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers.\\n * @param sender Address whose tokens are being transferred.\\n * @param balance Current balance for the interacting account.\\n * @param needed Minimum amount required to perform a transfer.\\n * @param tokenId Identifier number of a token.\\n */\\n error ERC1155InsufficientBalance(address sender, uint256 balance, uint256 needed, uint256 tokenId);\\n\\n /**\\n * @dev Indicates a failure with the token `sender`. Used in transfers.\\n * @param sender Address whose tokens are being transferred.\\n */\\n error ERC1155InvalidSender(address sender);\\n\\n /**\\n * @dev Indicates a failure with the token `receiver`. Used in transfers.\\n * @param receiver Address to which tokens are being transferred.\\n */\\n error ERC1155InvalidReceiver(address receiver);\\n\\n /**\\n * @dev Indicates a failure with the `operator`\\u2019s approval. Used in transfers.\\n * @param operator Address that may be allowed to operate on tokens without being their owner.\\n * @param owner Address of the current owner of a token.\\n */\\n error ERC1155MissingApprovalForAll(address operator, address owner);\\n\\n /**\\n * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.\\n * @param approver Address initiating an approval operation.\\n */\\n error ERC1155InvalidApprover(address approver);\\n\\n /**\\n * @dev Indicates a failure with the `operator` to be approved. Used in approvals.\\n * @param operator Address that may be allowed to operate on tokens without being their owner.\\n */\\n error ERC1155InvalidOperator(address operator);\\n\\n /**\\n * @dev Indicates an array length mismatch between ids and values in a safeBatchTransferFrom operation.\\n * Used in batch transfers.\\n * @param idsLength Length of the array of token identifiers\\n * @param valuesLength Length of the array of token amounts\\n */\\n error ERC1155InvalidArrayLength(uint256 idsLength, uint256 valuesLength);\\n}\\n\",\"keccak256\":\"0x880da465c203cec76b10d72dbd87c80f387df4102274f23eea1f9c9b0918792b\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC721/ERC721.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC721/ERC721.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {IERC721} from \\\"./IERC721.sol\\\";\\nimport {IERC721Metadata} from \\\"./extensions/IERC721Metadata.sol\\\";\\nimport {ERC721Utils} from \\\"./utils/ERC721Utils.sol\\\";\\nimport {Context} from \\\"../../utils/Context.sol\\\";\\nimport {Strings} from \\\"../../utils/Strings.sol\\\";\\nimport {IERC165, ERC165} from \\\"../../utils/introspection/ERC165.sol\\\";\\nimport {IERC721Errors} from \\\"../../interfaces/draft-IERC6093.sol\\\";\\n\\n/**\\n * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC-721] Non-Fungible Token Standard, including\\n * the Metadata extension, but not including the Enumerable extension, which is available separately as\\n * {ERC721Enumerable}.\\n */\\nabstract contract ERC721 is Context, ERC165, IERC721, IERC721Metadata, IERC721Errors {\\n using Strings for uint256;\\n\\n // Token name\\n string private _name;\\n\\n // Token symbol\\n string private _symbol;\\n\\n mapping(uint256 tokenId => address) private _owners;\\n\\n mapping(address owner => uint256) private _balances;\\n\\n mapping(uint256 tokenId => address) private _tokenApprovals;\\n\\n mapping(address owner => mapping(address operator => bool)) private _operatorApprovals;\\n\\n /**\\n * @dev Initializes the contract by setting a `name` and a `symbol` to the token collection.\\n */\\n constructor(string memory name_, string memory symbol_) {\\n _name = name_;\\n _symbol = symbol_;\\n }\\n\\n /**\\n * @dev See {IERC165-supportsInterface}.\\n */\\n function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {\\n return\\n interfaceId == type(IERC721).interfaceId ||\\n interfaceId == type(IERC721Metadata).interfaceId ||\\n super.supportsInterface(interfaceId);\\n }\\n\\n /**\\n * @dev See {IERC721-balanceOf}.\\n */\\n function balanceOf(address owner) public view virtual returns (uint256) {\\n if (owner == address(0)) {\\n revert ERC721InvalidOwner(address(0));\\n }\\n return _balances[owner];\\n }\\n\\n /**\\n * @dev See {IERC721-ownerOf}.\\n */\\n function ownerOf(uint256 tokenId) public view virtual returns (address) {\\n return _requireOwned(tokenId);\\n }\\n\\n /**\\n * @dev See {IERC721Metadata-name}.\\n */\\n function name() public view virtual returns (string memory) {\\n return _name;\\n }\\n\\n /**\\n * @dev See {IERC721Metadata-symbol}.\\n */\\n function symbol() public view virtual returns (string memory) {\\n return _symbol;\\n }\\n\\n /**\\n * @dev See {IERC721Metadata-tokenURI}.\\n */\\n function tokenURI(uint256 tokenId) public view virtual returns (string memory) {\\n _requireOwned(tokenId);\\n\\n string memory baseURI = _baseURI();\\n return bytes(baseURI).length > 0 ? string.concat(baseURI, tokenId.toString()) : \\\"\\\";\\n }\\n\\n /**\\n * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each\\n * token will be the concatenation of the `baseURI` and the `tokenId`. Empty\\n * by default, can be overridden in child contracts.\\n */\\n function _baseURI() internal view virtual returns (string memory) {\\n return \\\"\\\";\\n }\\n\\n /**\\n * @dev See {IERC721-approve}.\\n */\\n function approve(address to, uint256 tokenId) public virtual {\\n _approve(to, tokenId, _msgSender());\\n }\\n\\n /**\\n * @dev See {IERC721-getApproved}.\\n */\\n function getApproved(uint256 tokenId) public view virtual returns (address) {\\n _requireOwned(tokenId);\\n\\n return _getApproved(tokenId);\\n }\\n\\n /**\\n * @dev See {IERC721-setApprovalForAll}.\\n */\\n function setApprovalForAll(address operator, bool approved) public virtual {\\n _setApprovalForAll(_msgSender(), operator, approved);\\n }\\n\\n /**\\n * @dev See {IERC721-isApprovedForAll}.\\n */\\n function isApprovedForAll(address owner, address operator) public view virtual returns (bool) {\\n return _operatorApprovals[owner][operator];\\n }\\n\\n /**\\n * @dev See {IERC721-transferFrom}.\\n */\\n function transferFrom(address from, address to, uint256 tokenId) public virtual {\\n if (to == address(0)) {\\n revert ERC721InvalidReceiver(address(0));\\n }\\n // Setting an \\\"auth\\\" arguments enables the `_isAuthorized` check which verifies that the token exists\\n // (from != 0). Therefore, it is not needed to verify that the return value is not 0 here.\\n address previousOwner = _update(to, tokenId, _msgSender());\\n if (previousOwner != from) {\\n revert ERC721IncorrectOwner(from, tokenId, previousOwner);\\n }\\n }\\n\\n /**\\n * @dev See {IERC721-safeTransferFrom}.\\n */\\n function safeTransferFrom(address from, address to, uint256 tokenId) public {\\n safeTransferFrom(from, to, tokenId, \\\"\\\");\\n }\\n\\n /**\\n * @dev See {IERC721-safeTransferFrom}.\\n */\\n function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory data) public virtual {\\n transferFrom(from, to, tokenId);\\n ERC721Utils.checkOnERC721Received(_msgSender(), from, to, tokenId, data);\\n }\\n\\n /**\\n * @dev Returns the owner of the `tokenId`. Does NOT revert if token doesn't exist\\n *\\n * IMPORTANT: Any overrides to this function that add ownership of tokens not tracked by the\\n * core ERC-721 logic MUST be matched with the use of {_increaseBalance} to keep balances\\n * consistent with ownership. The invariant to preserve is that for any address `a` the value returned by\\n * `balanceOf(a)` must be equal to the number of tokens such that `_ownerOf(tokenId)` is `a`.\\n */\\n function _ownerOf(uint256 tokenId) internal view virtual returns (address) {\\n return _owners[tokenId];\\n }\\n\\n /**\\n * @dev Returns the approved address for `tokenId`. Returns 0 if `tokenId` is not minted.\\n */\\n function _getApproved(uint256 tokenId) internal view virtual returns (address) {\\n return _tokenApprovals[tokenId];\\n }\\n\\n /**\\n * @dev Returns whether `spender` is allowed to manage `owner`'s tokens, or `tokenId` in\\n * particular (ignoring whether it is owned by `owner`).\\n *\\n * WARNING: This function assumes that `owner` is the actual owner of `tokenId` and does not verify this\\n * assumption.\\n */\\n function _isAuthorized(address owner, address spender, uint256 tokenId) internal view virtual returns (bool) {\\n return\\n spender != address(0) &&\\n (owner == spender || isApprovedForAll(owner, spender) || _getApproved(tokenId) == spender);\\n }\\n\\n /**\\n * @dev Checks if `spender` can operate on `tokenId`, assuming the provided `owner` is the actual owner.\\n * Reverts if:\\n * - `spender` does not have approval from `owner` for `tokenId`.\\n * - `spender` does not have approval to manage all of `owner`'s assets.\\n *\\n * WARNING: This function assumes that `owner` is the actual owner of `tokenId` and does not verify this\\n * assumption.\\n */\\n function _checkAuthorized(address owner, address spender, uint256 tokenId) internal view virtual {\\n if (!_isAuthorized(owner, spender, tokenId)) {\\n if (owner == address(0)) {\\n revert ERC721NonexistentToken(tokenId);\\n } else {\\n revert ERC721InsufficientApproval(spender, tokenId);\\n }\\n }\\n }\\n\\n /**\\n * @dev Unsafe write access to the balances, used by extensions that \\\"mint\\\" tokens using an {ownerOf} override.\\n *\\n * NOTE: the value is limited to type(uint128).max. This protect against _balance overflow. It is unrealistic that\\n * a uint256 would ever overflow from increments when these increments are bounded to uint128 values.\\n *\\n * WARNING: Increasing an account's balance using this function tends to be paired with an override of the\\n * {_ownerOf} function to resolve the ownership of the corresponding tokens so that balances and ownership\\n * remain consistent with one another.\\n */\\n function _increaseBalance(address account, uint128 value) internal virtual {\\n unchecked {\\n _balances[account] += value;\\n }\\n }\\n\\n /**\\n * @dev Transfers `tokenId` from its current owner to `to`, or alternatively mints (or burns) if the current owner\\n * (or `to`) is the zero address. Returns the owner of the `tokenId` before the update.\\n *\\n * The `auth` argument is optional. If the value passed is non 0, then this function will check that\\n * `auth` is either the owner of the token, or approved to operate on the token (by the owner).\\n *\\n * Emits a {Transfer} event.\\n *\\n * NOTE: If overriding this function in a way that tracks balances, see also {_increaseBalance}.\\n */\\n function _update(address to, uint256 tokenId, address auth) internal virtual returns (address) {\\n address from = _ownerOf(tokenId);\\n\\n // Perform (optional) operator check\\n if (auth != address(0)) {\\n _checkAuthorized(from, auth, tokenId);\\n }\\n\\n // Execute the update\\n if (from != address(0)) {\\n // Clear approval. No need to re-authorize or emit the Approval event\\n _approve(address(0), tokenId, address(0), false);\\n\\n unchecked {\\n _balances[from] -= 1;\\n }\\n }\\n\\n if (to != address(0)) {\\n unchecked {\\n _balances[to] += 1;\\n }\\n }\\n\\n _owners[tokenId] = to;\\n\\n emit Transfer(from, to, tokenId);\\n\\n return from;\\n }\\n\\n /**\\n * @dev Mints `tokenId` and transfers it to `to`.\\n *\\n * WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible\\n *\\n * Requirements:\\n *\\n * - `tokenId` must not exist.\\n * - `to` cannot be the zero address.\\n *\\n * Emits a {Transfer} event.\\n */\\n function _mint(address to, uint256 tokenId) internal {\\n if (to == address(0)) {\\n revert ERC721InvalidReceiver(address(0));\\n }\\n address previousOwner = _update(to, tokenId, address(0));\\n if (previousOwner != address(0)) {\\n revert ERC721InvalidSender(address(0));\\n }\\n }\\n\\n /**\\n * @dev Mints `tokenId`, transfers it to `to` and checks for `to` acceptance.\\n *\\n * Requirements:\\n *\\n * - `tokenId` must not exist.\\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\\n *\\n * Emits a {Transfer} event.\\n */\\n function _safeMint(address to, uint256 tokenId) internal {\\n _safeMint(to, tokenId, \\\"\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is\\n * forwarded in {IERC721Receiver-onERC721Received} to contract recipients.\\n */\\n function _safeMint(address to, uint256 tokenId, bytes memory data) internal virtual {\\n _mint(to, tokenId);\\n ERC721Utils.checkOnERC721Received(_msgSender(), address(0), to, tokenId, data);\\n }\\n\\n /**\\n * @dev Destroys `tokenId`.\\n * The approval is cleared when the token is burned.\\n * This is an internal function that does not check if the sender is authorized to operate on the token.\\n *\\n * Requirements:\\n *\\n * - `tokenId` must exist.\\n *\\n * Emits a {Transfer} event.\\n */\\n function _burn(uint256 tokenId) internal {\\n address previousOwner = _update(address(0), tokenId, address(0));\\n if (previousOwner == address(0)) {\\n revert ERC721NonexistentToken(tokenId);\\n }\\n }\\n\\n /**\\n * @dev Transfers `tokenId` from `from` to `to`.\\n * As opposed to {transferFrom}, this imposes no restrictions on msg.sender.\\n *\\n * Requirements:\\n *\\n * - `to` cannot be the zero address.\\n * - `tokenId` token must be owned by `from`.\\n *\\n * Emits a {Transfer} event.\\n */\\n function _transfer(address from, address to, uint256 tokenId) internal {\\n if (to == address(0)) {\\n revert ERC721InvalidReceiver(address(0));\\n }\\n address previousOwner = _update(to, tokenId, address(0));\\n if (previousOwner == address(0)) {\\n revert ERC721NonexistentToken(tokenId);\\n } else if (previousOwner != from) {\\n revert ERC721IncorrectOwner(from, tokenId, previousOwner);\\n }\\n }\\n\\n /**\\n * @dev Safely transfers `tokenId` token from `from` to `to`, checking that contract recipients\\n * are aware of the ERC-721 standard to prevent tokens from being forever locked.\\n *\\n * `data` is additional data, it has no specified format and it is sent in call to `to`.\\n *\\n * This internal function is like {safeTransferFrom} in the sense that it invokes\\n * {IERC721Receiver-onERC721Received} on the receiver, and can be used to e.g.\\n * implement alternative mechanisms to perform token transfer, such as signature-based.\\n *\\n * Requirements:\\n *\\n * - `tokenId` token must exist and be owned by `from`.\\n * - `to` cannot be the zero address.\\n * - `from` cannot be the zero address.\\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\\n *\\n * Emits a {Transfer} event.\\n */\\n function _safeTransfer(address from, address to, uint256 tokenId) internal {\\n _safeTransfer(from, to, tokenId, \\\"\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-ERC721-_safeTransfer-address-address-uint256-}[`_safeTransfer`], with an additional `data` parameter which is\\n * forwarded in {IERC721Receiver-onERC721Received} to contract recipients.\\n */\\n function _safeTransfer(address from, address to, uint256 tokenId, bytes memory data) internal virtual {\\n _transfer(from, to, tokenId);\\n ERC721Utils.checkOnERC721Received(_msgSender(), from, to, tokenId, data);\\n }\\n\\n /**\\n * @dev Approve `to` to operate on `tokenId`\\n *\\n * The `auth` argument is optional. If the value passed is non 0, then this function will check that `auth` is\\n * either the owner of the token, or approved to operate on all tokens held by this owner.\\n *\\n * Emits an {Approval} event.\\n *\\n * Overrides to this logic should be done to the variant with an additional `bool emitEvent` argument.\\n */\\n function _approve(address to, uint256 tokenId, address auth) internal {\\n _approve(to, tokenId, auth, true);\\n }\\n\\n /**\\n * @dev Variant of `_approve` with an optional flag to enable or disable the {Approval} event. The event is not\\n * emitted in the context of transfers.\\n */\\n function _approve(address to, uint256 tokenId, address auth, bool emitEvent) internal virtual {\\n // Avoid reading the owner unless necessary\\n if (emitEvent || auth != address(0)) {\\n address owner = _requireOwned(tokenId);\\n\\n // We do not use _isAuthorized because single-token approvals should not be able to call approve\\n if (auth != address(0) && owner != auth && !isApprovedForAll(owner, auth)) {\\n revert ERC721InvalidApprover(auth);\\n }\\n\\n if (emitEvent) {\\n emit Approval(owner, to, tokenId);\\n }\\n }\\n\\n _tokenApprovals[tokenId] = to;\\n }\\n\\n /**\\n * @dev Approve `operator` to operate on all of `owner` tokens\\n *\\n * Requirements:\\n * - operator can't be the address zero.\\n *\\n * Emits an {ApprovalForAll} event.\\n */\\n function _setApprovalForAll(address owner, address operator, bool approved) internal virtual {\\n if (operator == address(0)) {\\n revert ERC721InvalidOperator(operator);\\n }\\n _operatorApprovals[owner][operator] = approved;\\n emit ApprovalForAll(owner, operator, approved);\\n }\\n\\n /**\\n * @dev Reverts if the `tokenId` doesn't have a current owner (it hasn't been minted, or it has been burned).\\n * Returns the owner.\\n *\\n * Overrides to ownership logic should be done to {_ownerOf}.\\n */\\n function _requireOwned(uint256 tokenId) internal view returns (address) {\\n address owner = _ownerOf(tokenId);\\n if (owner == address(0)) {\\n revert ERC721NonexistentToken(tokenId);\\n }\\n return owner;\\n }\\n}\\n\",\"keccak256\":\"0x39ed367e54765186281efcfe83e47cf0ad62cc879f10e191360712507125f29a\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC721/IERC721.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC721/IERC721.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {IERC165} from \\\"../../utils/introspection/IERC165.sol\\\";\\n\\n/**\\n * @dev Required interface of an ERC-721 compliant contract.\\n */\\ninterface IERC721 is IERC165 {\\n /**\\n * @dev Emitted when `tokenId` token is transferred from `from` to `to`.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);\\n\\n /**\\n * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.\\n */\\n event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);\\n\\n /**\\n * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.\\n */\\n event ApprovalForAll(address indexed owner, address indexed operator, bool approved);\\n\\n /**\\n * @dev Returns the number of tokens in ``owner``'s account.\\n */\\n function balanceOf(address owner) external view returns (uint256 balance);\\n\\n /**\\n * @dev Returns the owner of the `tokenId` token.\\n *\\n * Requirements:\\n *\\n * - `tokenId` must exist.\\n */\\n function ownerOf(uint256 tokenId) external view returns (address owner);\\n\\n /**\\n * @dev Safely transfers `tokenId` token from `from` to `to`.\\n *\\n * Requirements:\\n *\\n * - `from` cannot be the zero address.\\n * - `to` cannot be the zero address.\\n * - `tokenId` token must exist and be owned by `from`.\\n * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.\\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon\\n * a safe transfer.\\n *\\n * Emits a {Transfer} event.\\n */\\n function safeTransferFrom(address from, address to, uint256 tokenId, bytes calldata data) external;\\n\\n /**\\n * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients\\n * are aware of the ERC-721 protocol to prevent tokens from being forever locked.\\n *\\n * Requirements:\\n *\\n * - `from` cannot be the zero address.\\n * - `to` cannot be the zero address.\\n * - `tokenId` token must exist and be owned by `from`.\\n * - If the caller is not `from`, it must have been allowed to move this token by either {approve} or\\n * {setApprovalForAll}.\\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon\\n * a safe transfer.\\n *\\n * Emits a {Transfer} event.\\n */\\n function safeTransferFrom(address from, address to, uint256 tokenId) external;\\n\\n /**\\n * @dev Transfers `tokenId` token from `from` to `to`.\\n *\\n * WARNING: Note that the caller is responsible to confirm that the recipient is capable of receiving ERC-721\\n * or else they may be permanently lost. Usage of {safeTransferFrom} prevents loss, though the caller must\\n * understand this adds an external call which potentially creates a reentrancy vulnerability.\\n *\\n * Requirements:\\n *\\n * - `from` cannot be the zero address.\\n * - `to` cannot be the zero address.\\n * - `tokenId` token must be owned by `from`.\\n * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(address from, address to, uint256 tokenId) external;\\n\\n /**\\n * @dev Gives permission to `to` to transfer `tokenId` token to another account.\\n * The approval is cleared when the token is transferred.\\n *\\n * Only a single account can be approved at a time, so approving the zero address clears previous approvals.\\n *\\n * Requirements:\\n *\\n * - The caller must own the token or be an approved operator.\\n * - `tokenId` must exist.\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address to, uint256 tokenId) external;\\n\\n /**\\n * @dev Approve or remove `operator` as an operator for the caller.\\n * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.\\n *\\n * Requirements:\\n *\\n * - The `operator` cannot be the address zero.\\n *\\n * Emits an {ApprovalForAll} event.\\n */\\n function setApprovalForAll(address operator, bool approved) external;\\n\\n /**\\n * @dev Returns the account approved for `tokenId` token.\\n *\\n * Requirements:\\n *\\n * - `tokenId` must exist.\\n */\\n function getApproved(uint256 tokenId) external view returns (address operator);\\n\\n /**\\n * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.\\n *\\n * See {setApprovalForAll}\\n */\\n function isApprovedForAll(address owner, address operator) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x5dc63d1c6a12fe1b17793e1745877b2fcbe1964c3edfd0a482fac21ca8f18261\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC721/IERC721Receiver.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @title ERC-721 token receiver interface\\n * @dev Interface for any contract that wants to support safeTransfers\\n * from ERC-721 asset contracts.\\n */\\ninterface IERC721Receiver {\\n /**\\n * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom}\\n * by `operator` from `from`, this function is called.\\n *\\n * It must return its Solidity selector to confirm the token transfer.\\n * If any other value is returned or the interface is not implemented by the recipient, the transfer will be\\n * reverted.\\n *\\n * The selector can be obtained in Solidity with `IERC721Receiver.onERC721Received.selector`.\\n */\\n function onERC721Received(\\n address operator,\\n address from,\\n uint256 tokenId,\\n bytes calldata data\\n ) external returns (bytes4);\\n}\\n\",\"keccak256\":\"0xb5afb8e8eebc4d1c6404df2f5e1e6d2c3d24fd01e5dfc855314951ecfaae462d\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC721/extensions/ERC721Burnable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC721/extensions/ERC721Burnable.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {ERC721} from \\\"../ERC721.sol\\\";\\nimport {Context} from \\\"../../../utils/Context.sol\\\";\\n\\n/**\\n * @title ERC-721 Burnable Token\\n * @dev ERC-721 Token that can be burned (destroyed).\\n */\\nabstract contract ERC721Burnable is Context, ERC721 {\\n /**\\n * @dev Burns `tokenId`. See {ERC721-_burn}.\\n *\\n * Requirements:\\n *\\n * - The caller must own `tokenId` or be an approved operator.\\n */\\n function burn(uint256 tokenId) public virtual {\\n // Setting an \\\"auth\\\" arguments enables the `_isAuthorized` check which verifies that the token exists\\n // (from != 0). Therefore, it is not needed to verify that the return value is not 0 here.\\n _update(address(0), tokenId, _msgSender());\\n }\\n}\\n\",\"keccak256\":\"0xdee1ff07172e443c6600581fc4f11e7830a6d33e4e551752935b835d52a09404\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC721/extensions/ERC721Enumerable.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {ERC721} from \\\"../ERC721.sol\\\";\\nimport {IERC721Enumerable} from \\\"./IERC721Enumerable.sol\\\";\\nimport {IERC165} from \\\"../../../utils/introspection/ERC165.sol\\\";\\n\\n/**\\n * @dev This implements an optional extension of {ERC721} defined in the ERC that adds enumerability\\n * of all the token ids in the contract as well as all token ids owned by each account.\\n *\\n * CAUTION: {ERC721} extensions that implement custom `balanceOf` logic, such as {ERC721Consecutive},\\n * interfere with enumerability and should not be used together with {ERC721Enumerable}.\\n */\\nabstract contract ERC721Enumerable is ERC721, IERC721Enumerable {\\n mapping(address owner => mapping(uint256 index => uint256)) private _ownedTokens;\\n mapping(uint256 tokenId => uint256) private _ownedTokensIndex;\\n\\n uint256[] private _allTokens;\\n mapping(uint256 tokenId => uint256) private _allTokensIndex;\\n\\n /**\\n * @dev An `owner`'s token query was out of bounds for `index`.\\n *\\n * NOTE: The owner being `address(0)` indicates a global out of bounds index.\\n */\\n error ERC721OutOfBoundsIndex(address owner, uint256 index);\\n\\n /**\\n * @dev Batch mint is not allowed.\\n */\\n error ERC721EnumerableForbiddenBatchMint();\\n\\n /**\\n * @dev See {IERC165-supportsInterface}.\\n */\\n function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165, ERC721) returns (bool) {\\n return interfaceId == type(IERC721Enumerable).interfaceId || super.supportsInterface(interfaceId);\\n }\\n\\n /**\\n * @dev See {IERC721Enumerable-tokenOfOwnerByIndex}.\\n */\\n function tokenOfOwnerByIndex(address owner, uint256 index) public view virtual returns (uint256) {\\n if (index >= balanceOf(owner)) {\\n revert ERC721OutOfBoundsIndex(owner, index);\\n }\\n return _ownedTokens[owner][index];\\n }\\n\\n /**\\n * @dev See {IERC721Enumerable-totalSupply}.\\n */\\n function totalSupply() public view virtual returns (uint256) {\\n return _allTokens.length;\\n }\\n\\n /**\\n * @dev See {IERC721Enumerable-tokenByIndex}.\\n */\\n function tokenByIndex(uint256 index) public view virtual returns (uint256) {\\n if (index >= totalSupply()) {\\n revert ERC721OutOfBoundsIndex(address(0), index);\\n }\\n return _allTokens[index];\\n }\\n\\n /**\\n * @dev See {ERC721-_update}.\\n */\\n function _update(address to, uint256 tokenId, address auth) internal virtual override returns (address) {\\n address previousOwner = super._update(to, tokenId, auth);\\n\\n if (previousOwner == address(0)) {\\n _addTokenToAllTokensEnumeration(tokenId);\\n } else if (previousOwner != to) {\\n _removeTokenFromOwnerEnumeration(previousOwner, tokenId);\\n }\\n if (to == address(0)) {\\n _removeTokenFromAllTokensEnumeration(tokenId);\\n } else if (previousOwner != to) {\\n _addTokenToOwnerEnumeration(to, tokenId);\\n }\\n\\n return previousOwner;\\n }\\n\\n /**\\n * @dev Private function to add a token to this extension's ownership-tracking data structures.\\n * @param to address representing the new owner of the given token ID\\n * @param tokenId uint256 ID of the token to be added to the tokens list of the given address\\n */\\n function _addTokenToOwnerEnumeration(address to, uint256 tokenId) private {\\n uint256 length = balanceOf(to) - 1;\\n _ownedTokens[to][length] = tokenId;\\n _ownedTokensIndex[tokenId] = length;\\n }\\n\\n /**\\n * @dev Private function to add a token to this extension's token tracking data structures.\\n * @param tokenId uint256 ID of the token to be added to the tokens list\\n */\\n function _addTokenToAllTokensEnumeration(uint256 tokenId) private {\\n _allTokensIndex[tokenId] = _allTokens.length;\\n _allTokens.push(tokenId);\\n }\\n\\n /**\\n * @dev Private function to remove a token from this extension's ownership-tracking data structures. Note that\\n * while the token is not assigned a new owner, the `_ownedTokensIndex` mapping is _not_ updated: this allows for\\n * gas optimizations e.g. when performing a transfer operation (avoiding double writes).\\n * This has O(1) time complexity, but alters the order of the _ownedTokens array.\\n * @param from address representing the previous owner of the given token ID\\n * @param tokenId uint256 ID of the token to be removed from the tokens list of the given address\\n */\\n function _removeTokenFromOwnerEnumeration(address from, uint256 tokenId) private {\\n // To prevent a gap in from's tokens array, we store the last token in the index of the token to delete, and\\n // then delete the last slot (swap and pop).\\n\\n uint256 lastTokenIndex = balanceOf(from);\\n uint256 tokenIndex = _ownedTokensIndex[tokenId];\\n\\n mapping(uint256 index => uint256) storage _ownedTokensByOwner = _ownedTokens[from];\\n\\n // When the token to delete is the last token, the swap operation is unnecessary\\n if (tokenIndex != lastTokenIndex) {\\n uint256 lastTokenId = _ownedTokensByOwner[lastTokenIndex];\\n\\n _ownedTokensByOwner[tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token\\n _ownedTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index\\n }\\n\\n // This also deletes the contents at the last position of the array\\n delete _ownedTokensIndex[tokenId];\\n delete _ownedTokensByOwner[lastTokenIndex];\\n }\\n\\n /**\\n * @dev Private function to remove a token from this extension's token tracking data structures.\\n * This has O(1) time complexity, but alters the order of the _allTokens array.\\n * @param tokenId uint256 ID of the token to be removed from the tokens list\\n */\\n function _removeTokenFromAllTokensEnumeration(uint256 tokenId) private {\\n // To prevent a gap in the tokens array, we store the last token in the index of the token to delete, and\\n // then delete the last slot (swap and pop).\\n\\n uint256 lastTokenIndex = _allTokens.length - 1;\\n uint256 tokenIndex = _allTokensIndex[tokenId];\\n\\n // When the token to delete is the last token, the swap operation is unnecessary. However, since this occurs so\\n // rarely (when the last minted token is burnt) that we still do the swap here to avoid the gas cost of adding\\n // an 'if' statement (like in _removeTokenFromOwnerEnumeration)\\n uint256 lastTokenId = _allTokens[lastTokenIndex];\\n\\n _allTokens[tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token\\n _allTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index\\n\\n // This also deletes the contents at the last position of the array\\n delete _allTokensIndex[tokenId];\\n _allTokens.pop();\\n }\\n\\n /**\\n * See {ERC721-_increaseBalance}. We need that to account tokens that were minted in batch\\n */\\n function _increaseBalance(address account, uint128 amount) internal virtual override {\\n if (amount > 0) {\\n revert ERC721EnumerableForbiddenBatchMint();\\n }\\n super._increaseBalance(account, amount);\\n }\\n}\\n\",\"keccak256\":\"0x5191f783af281c75b7de0f1e3e36cdc6ac5cb2358d929584c4953fd02fa2b5eb\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC721/extensions/ERC721URIStorage.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {ERC721} from \\\"../ERC721.sol\\\";\\nimport {Strings} from \\\"../../../utils/Strings.sol\\\";\\nimport {IERC4906} from \\\"../../../interfaces/IERC4906.sol\\\";\\nimport {IERC165} from \\\"../../../interfaces/IERC165.sol\\\";\\n\\n/**\\n * @dev ERC-721 token with storage based token URI management.\\n */\\nabstract contract ERC721URIStorage is IERC4906, ERC721 {\\n using Strings for uint256;\\n\\n // Interface ID as defined in ERC-4906. This does not correspond to a traditional interface ID as ERC-4906 only\\n // defines events and does not include any external function.\\n bytes4 private constant ERC4906_INTERFACE_ID = bytes4(0x49064906);\\n\\n // Optional mapping for token URIs\\n mapping(uint256 tokenId => string) private _tokenURIs;\\n\\n /**\\n * @dev See {IERC165-supportsInterface}\\n */\\n function supportsInterface(bytes4 interfaceId) public view virtual override(ERC721, IERC165) returns (bool) {\\n return interfaceId == ERC4906_INTERFACE_ID || super.supportsInterface(interfaceId);\\n }\\n\\n /**\\n * @dev See {IERC721Metadata-tokenURI}.\\n */\\n function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {\\n _requireOwned(tokenId);\\n\\n string memory _tokenURI = _tokenURIs[tokenId];\\n string memory base = _baseURI();\\n\\n // If there is no base URI, return the token URI.\\n if (bytes(base).length == 0) {\\n return _tokenURI;\\n }\\n // If both are set, concatenate the baseURI and tokenURI (via string.concat).\\n if (bytes(_tokenURI).length > 0) {\\n return string.concat(base, _tokenURI);\\n }\\n\\n return super.tokenURI(tokenId);\\n }\\n\\n /**\\n * @dev Sets `_tokenURI` as the tokenURI of `tokenId`.\\n *\\n * Emits {MetadataUpdate}.\\n */\\n function _setTokenURI(uint256 tokenId, string memory _tokenURI) internal virtual {\\n _tokenURIs[tokenId] = _tokenURI;\\n emit MetadataUpdate(tokenId);\\n }\\n}\\n\",\"keccak256\":\"0xe52813067c6d5838eeb34e1da8beb2514371a7d778266013b04ca3be1dda7100\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC721/extensions/ERC721Votes.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC721/extensions/ERC721Votes.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {ERC721} from \\\"../ERC721.sol\\\";\\nimport {Votes} from \\\"../../../governance/utils/Votes.sol\\\";\\n\\n/**\\n * @dev Extension of ERC-721 to support voting and delegation as implemented by {Votes}, where each individual NFT counts\\n * as 1 vote unit.\\n *\\n * Tokens do not count as votes until they are delegated, because votes must be tracked which incurs an additional cost\\n * on every transfer. Token holders can either delegate to a trusted representative who will decide how to make use of\\n * the votes in governance decisions, or they can delegate to themselves to be their own representative.\\n */\\nabstract contract ERC721Votes is ERC721, Votes {\\n /**\\n * @dev See {ERC721-_update}. Adjusts votes when tokens are transferred.\\n *\\n * Emits a {IVotes-DelegateVotesChanged} event.\\n */\\n function _update(address to, uint256 tokenId, address auth) internal virtual override returns (address) {\\n address previousOwner = super._update(to, tokenId, auth);\\n\\n _transferVotingUnits(previousOwner, to, 1);\\n\\n return previousOwner;\\n }\\n\\n /**\\n * @dev Returns the balance of `account`.\\n *\\n * WARNING: Overriding this function will likely result in incorrect vote tracking.\\n */\\n function _getVotingUnits(address account) internal view virtual override returns (uint256) {\\n return balanceOf(account);\\n }\\n\\n /**\\n * @dev See {ERC721-_increaseBalance}. We need that to account tokens that were minted in batch.\\n */\\n function _increaseBalance(address account, uint128 amount) internal virtual override {\\n super._increaseBalance(account, amount);\\n _transferVotingUnits(address(0), account, amount);\\n }\\n}\\n\",\"keccak256\":\"0x8b245d62f3ce9596d3a52c7b6c738cd95a40fe8dba898e90fcce18bb7a2d8239\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC721/extensions/IERC721Enumerable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC721/extensions/IERC721Enumerable.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {IERC721} from \\\"../IERC721.sol\\\";\\n\\n/**\\n * @title ERC-721 Non-Fungible Token Standard, optional enumeration extension\\n * @dev See https://eips.ethereum.org/EIPS/eip-721\\n */\\ninterface IERC721Enumerable is IERC721 {\\n /**\\n * @dev Returns the total amount of tokens stored by the contract.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns a token ID owned by `owner` at a given `index` of its token list.\\n * Use along with {balanceOf} to enumerate all of ``owner``'s tokens.\\n */\\n function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256);\\n\\n /**\\n * @dev Returns a token ID at a given `index` of all the tokens stored by the contract.\\n * Use along with {totalSupply} to enumerate all tokens.\\n */\\n function tokenByIndex(uint256 index) external view returns (uint256);\\n}\\n\",\"keccak256\":\"0x3d6954a93ac198a2ffa384fa58ccf18e7e235263e051a394328002eff4e073de\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC721/extensions/IERC721Metadata.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {IERC721} from \\\"../IERC721.sol\\\";\\n\\n/**\\n * @title ERC-721 Non-Fungible Token Standard, optional metadata extension\\n * @dev See https://eips.ethereum.org/EIPS/eip-721\\n */\\ninterface IERC721Metadata is IERC721 {\\n /**\\n * @dev Returns the token collection name.\\n */\\n function name() external view returns (string memory);\\n\\n /**\\n * @dev Returns the token collection symbol.\\n */\\n function symbol() external view returns (string memory);\\n\\n /**\\n * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token.\\n */\\n function tokenURI(uint256 tokenId) external view returns (string memory);\\n}\\n\",\"keccak256\":\"0x37d1aaaa5a2908a09e9dcf56a26ddf762ecf295afb5964695937344fc6802ce1\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC721/utils/ERC721Utils.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC721/utils/ERC721Utils.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {IERC721Receiver} from \\\"../IERC721Receiver.sol\\\";\\nimport {IERC721Errors} from \\\"../../../interfaces/draft-IERC6093.sol\\\";\\n\\n/**\\n * @dev Library that provide common ERC-721 utility functions.\\n *\\n * See https://eips.ethereum.org/EIPS/eip-721[ERC-721].\\n *\\n * _Available since v5.1._\\n */\\nlibrary ERC721Utils {\\n /**\\n * @dev Performs an acceptance check for the provided `operator` by calling {IERC721-onERC721Received}\\n * on the `to` address. The `operator` is generally the address that initiated the token transfer (i.e. `msg.sender`).\\n *\\n * The acceptance call is not executed and treated as a no-op if the target address doesn't contain code (i.e. an EOA).\\n * Otherwise, the recipient must implement {IERC721Receiver-onERC721Received} and return the acceptance magic value to accept\\n * the transfer.\\n */\\n function checkOnERC721Received(\\n address operator,\\n address from,\\n address to,\\n uint256 tokenId,\\n bytes memory data\\n ) internal {\\n if (to.code.length > 0) {\\n try IERC721Receiver(to).onERC721Received(operator, from, tokenId, data) returns (bytes4 retval) {\\n if (retval != IERC721Receiver.onERC721Received.selector) {\\n // Token rejected\\n revert IERC721Errors.ERC721InvalidReceiver(to);\\n }\\n } catch (bytes memory reason) {\\n if (reason.length == 0) {\\n // non-IERC721Receiver implementer\\n revert IERC721Errors.ERC721InvalidReceiver(to);\\n } else {\\n assembly (\\\"memory-safe\\\") {\\n revert(add(32, reason), mload(reason))\\n }\\n }\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x40399695922383778f9f540a620bec475a2f8e0f08d41f0005682842e28a9855\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)\\n\\npragma solidity ^0.8.20;\\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\":\"0x493033a8d1b176a037b2cc6a04dad01a5c157722049bbecf632ca876224dd4b2\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Nonces.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/Nonces.sol)\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Provides tracking nonces for addresses. Nonces will only increment.\\n */\\nabstract contract Nonces {\\n /**\\n * @dev The nonce used for an `account` is not the expected current nonce.\\n */\\n error InvalidAccountNonce(address account, uint256 currentNonce);\\n\\n mapping(address account => uint256) private _nonces;\\n\\n /**\\n * @dev Returns the next unused nonce for an address.\\n */\\n function nonces(address owner) public view virtual returns (uint256) {\\n return _nonces[owner];\\n }\\n\\n /**\\n * @dev Consumes a nonce.\\n *\\n * Returns the current value and increments nonce.\\n */\\n function _useNonce(address owner) internal virtual returns (uint256) {\\n // For each account, the nonce has an initial value of 0, can only be incremented by one, and cannot be\\n // decremented or reset. This guarantees that the nonce never overflows.\\n unchecked {\\n // It is important to do x++ and not ++x here.\\n return _nonces[owner]++;\\n }\\n }\\n\\n /**\\n * @dev Same as {_useNonce} but checking that `nonce` is the next valid for `owner`.\\n */\\n function _useCheckedNonce(address owner, uint256 nonce) internal virtual {\\n uint256 current = _useNonce(owner);\\n if (nonce != current) {\\n revert InvalidAccountNonce(owner, current);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x0082767004fca261c332e9ad100868327a863a88ef724e844857128845ab350f\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Panic.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/Panic.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Helper library for emitting standardized panic codes.\\n *\\n * ```solidity\\n * contract Example {\\n * using Panic for uint256;\\n *\\n * // Use any of the declared internal constants\\n * function foo() { Panic.GENERIC.panic(); }\\n *\\n * // Alternatively\\n * function foo() { Panic.panic(Panic.GENERIC); }\\n * }\\n * ```\\n *\\n * Follows the list from https://github.com/ethereum/solidity/blob/v0.8.24/libsolutil/ErrorCodes.h[libsolutil].\\n *\\n * _Available since v5.1._\\n */\\n// slither-disable-next-line unused-state\\nlibrary Panic {\\n /// @dev generic / unspecified error\\n uint256 internal constant GENERIC = 0x00;\\n /// @dev used by the assert() builtin\\n uint256 internal constant ASSERT = 0x01;\\n /// @dev arithmetic underflow or overflow\\n uint256 internal constant UNDER_OVERFLOW = 0x11;\\n /// @dev division or modulo by zero\\n uint256 internal constant DIVISION_BY_ZERO = 0x12;\\n /// @dev enum conversion error\\n uint256 internal constant ENUM_CONVERSION_ERROR = 0x21;\\n /// @dev invalid encoding in storage\\n uint256 internal constant STORAGE_ENCODING_ERROR = 0x22;\\n /// @dev empty array pop\\n uint256 internal constant EMPTY_ARRAY_POP = 0x31;\\n /// @dev array out of bounds access\\n uint256 internal constant ARRAY_OUT_OF_BOUNDS = 0x32;\\n /// @dev resource error (too large allocation or too large array)\\n uint256 internal constant RESOURCE_ERROR = 0x41;\\n /// @dev calling invalid internal function\\n uint256 internal constant INVALID_INTERNAL_FUNCTION = 0x51;\\n\\n /// @dev Reverts with a panic code. Recommended to use with\\n /// the internal constants with predefined codes.\\n function panic(uint256 code) internal pure {\\n assembly (\\\"memory-safe\\\") {\\n mstore(0x00, 0x4e487b71)\\n mstore(0x20, code)\\n revert(0x1c, 0x24)\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf7fe324703a64fc51702311dc51562d5cb1497734f074e4f483bfb6717572d7a\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/ShortStrings.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/ShortStrings.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {StorageSlot} from \\\"./StorageSlot.sol\\\";\\n\\n// | string | 0xAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA |\\n// | length | 0x BB |\\ntype ShortString is bytes32;\\n\\n/**\\n * @dev This library provides functions to convert short memory strings\\n * into a `ShortString` type that can be used as an immutable variable.\\n *\\n * Strings of arbitrary length can be optimized using this library if\\n * they are short enough (up to 31 bytes) by packing them with their\\n * length (1 byte) in a single EVM word (32 bytes). Additionally, a\\n * fallback mechanism can be used for every other case.\\n *\\n * Usage example:\\n *\\n * ```solidity\\n * contract Named {\\n * using ShortStrings for *;\\n *\\n * ShortString private immutable _name;\\n * string private _nameFallback;\\n *\\n * constructor(string memory contractName) {\\n * _name = contractName.toShortStringWithFallback(_nameFallback);\\n * }\\n *\\n * function name() external view returns (string memory) {\\n * return _name.toStringWithFallback(_nameFallback);\\n * }\\n * }\\n * ```\\n */\\nlibrary ShortStrings {\\n // Used as an identifier for strings longer than 31 bytes.\\n bytes32 private constant FALLBACK_SENTINEL = 0x00000000000000000000000000000000000000000000000000000000000000FF;\\n\\n error StringTooLong(string str);\\n error InvalidShortString();\\n\\n /**\\n * @dev Encode a string of at most 31 chars into a `ShortString`.\\n *\\n * This will trigger a `StringTooLong` error is the input string is too long.\\n */\\n function toShortString(string memory str) internal pure returns (ShortString) {\\n bytes memory bstr = bytes(str);\\n if (bstr.length > 31) {\\n revert StringTooLong(str);\\n }\\n return ShortString.wrap(bytes32(uint256(bytes32(bstr)) | bstr.length));\\n }\\n\\n /**\\n * @dev Decode a `ShortString` back to a \\\"normal\\\" string.\\n */\\n function toString(ShortString sstr) internal pure returns (string memory) {\\n uint256 len = byteLength(sstr);\\n // using `new string(len)` would work locally but is not memory safe.\\n string memory str = new string(32);\\n assembly (\\\"memory-safe\\\") {\\n mstore(str, len)\\n mstore(add(str, 0x20), sstr)\\n }\\n return str;\\n }\\n\\n /**\\n * @dev Return the length of a `ShortString`.\\n */\\n function byteLength(ShortString sstr) internal pure returns (uint256) {\\n uint256 result = uint256(ShortString.unwrap(sstr)) & 0xFF;\\n if (result > 31) {\\n revert InvalidShortString();\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Encode a string into a `ShortString`, or write it to storage if it is too long.\\n */\\n function toShortStringWithFallback(string memory value, string storage store) internal returns (ShortString) {\\n if (bytes(value).length < 32) {\\n return toShortString(value);\\n } else {\\n StorageSlot.getStringSlot(store).value = value;\\n return ShortString.wrap(FALLBACK_SENTINEL);\\n }\\n }\\n\\n /**\\n * @dev Decode a string that was encoded to `ShortString` or written to storage using {setWithFallback}.\\n */\\n function toStringWithFallback(ShortString value, string storage store) internal pure returns (string memory) {\\n if (ShortString.unwrap(value) != FALLBACK_SENTINEL) {\\n return toString(value);\\n } else {\\n return store;\\n }\\n }\\n\\n /**\\n * @dev Return the length of a string that was encoded to `ShortString` or written to storage using\\n * {setWithFallback}.\\n *\\n * WARNING: This will return the \\\"byte length\\\" of the string. This may not reflect the actual length in terms of\\n * actual characters as the UTF-8 encoding of a single character can span over multiple bytes.\\n */\\n function byteLengthWithFallback(ShortString value, string storage store) internal view returns (uint256) {\\n if (ShortString.unwrap(value) != FALLBACK_SENTINEL) {\\n return byteLength(value);\\n } else {\\n return bytes(store).length;\\n }\\n }\\n}\\n\",\"keccak256\":\"0x7d94fa0af099a2172eb01f9c8a8a443cbe7e0e43654841563e4e09968efdb549\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/StorageSlot.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/StorageSlot.sol)\\n// This file was procedurally generated from scripts/generate/templates/StorageSlot.js.\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Library for reading and writing primitive types to specific storage slots.\\n *\\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\\n * This library helps with reading and writing to such slots without the need for inline assembly.\\n *\\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\\n *\\n * Example usage to set ERC-1967 implementation slot:\\n * ```solidity\\n * contract ERC1967 {\\n * // Define the slot. Alternatively, use the SlotDerivation library to derive the slot.\\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n *\\n * function _getImplementation() internal view returns (address) {\\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n * }\\n *\\n * function _setImplementation(address newImplementation) internal {\\n * require(newImplementation.code.length > 0);\\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n * }\\n * }\\n * ```\\n *\\n * TIP: Consider using this library along with {SlotDerivation}.\\n */\\nlibrary StorageSlot {\\n struct AddressSlot {\\n address value;\\n }\\n\\n struct BooleanSlot {\\n bool value;\\n }\\n\\n struct Bytes32Slot {\\n bytes32 value;\\n }\\n\\n struct Uint256Slot {\\n uint256 value;\\n }\\n\\n struct Int256Slot {\\n int256 value;\\n }\\n\\n struct StringSlot {\\n string value;\\n }\\n\\n struct BytesSlot {\\n bytes value;\\n }\\n\\n /**\\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\\n */\\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\\n assembly (\\\"memory-safe\\\") {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns a `BooleanSlot` with member `value` located at `slot`.\\n */\\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\\n assembly (\\\"memory-safe\\\") {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns a `Bytes32Slot` with member `value` located at `slot`.\\n */\\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\\n assembly (\\\"memory-safe\\\") {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns a `Uint256Slot` with member `value` located at `slot`.\\n */\\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\\n assembly (\\\"memory-safe\\\") {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns a `Int256Slot` with member `value` located at `slot`.\\n */\\n function getInt256Slot(bytes32 slot) internal pure returns (Int256Slot storage r) {\\n assembly (\\\"memory-safe\\\") {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns a `StringSlot` with member `value` located at `slot`.\\n */\\n function getStringSlot(bytes32 slot) internal pure returns (StringSlot storage r) {\\n assembly (\\\"memory-safe\\\") {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `StringSlot` representation of the string storage pointer `store`.\\n */\\n function getStringSlot(string storage store) internal pure returns (StringSlot storage r) {\\n assembly (\\\"memory-safe\\\") {\\n r.slot := store.slot\\n }\\n }\\n\\n /**\\n * @dev Returns a `BytesSlot` with member `value` located at `slot`.\\n */\\n function getBytesSlot(bytes32 slot) internal pure returns (BytesSlot storage r) {\\n assembly (\\\"memory-safe\\\") {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `BytesSlot` representation of the bytes storage pointer `store`.\\n */\\n function getBytesSlot(bytes storage store) internal pure returns (BytesSlot storage r) {\\n assembly (\\\"memory-safe\\\") {\\n r.slot := store.slot\\n }\\n }\\n}\\n\",\"keccak256\":\"0xcf74f855663ce2ae00ed8352666b7935f6cddea2932fdf2c3ecd30a9b1cd0e97\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Strings.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/Strings.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {Math} from \\\"./math/Math.sol\\\";\\nimport {SignedMath} from \\\"./math/SignedMath.sol\\\";\\n\\n/**\\n * @dev String operations.\\n */\\nlibrary Strings {\\n bytes16 private constant HEX_DIGITS = \\\"0123456789abcdef\\\";\\n uint8 private constant ADDRESS_LENGTH = 20;\\n\\n /**\\n * @dev The `value` string doesn't fit in the specified `length`.\\n */\\n error StringsInsufficientHexLength(uint256 value, uint256 length);\\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 assembly (\\\"memory-safe\\\") {\\n ptr := add(buffer, add(32, length))\\n }\\n while (true) {\\n ptr--;\\n assembly (\\\"memory-safe\\\") {\\n mstore8(ptr, byte(mod(value, 10), HEX_DIGITS))\\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 toStringSigned(int256 value) internal pure returns (string memory) {\\n return string.concat(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 uint256 localValue = value;\\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] = HEX_DIGITS[localValue & 0xf];\\n localValue >>= 4;\\n }\\n if (localValue != 0) {\\n revert StringsInsufficientHexLength(value, length);\\n }\\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\\n * 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 Converts an `address` with fixed length of 20 bytes to its checksummed ASCII `string` hexadecimal\\n * representation, according to EIP-55.\\n */\\n function toChecksumHexString(address addr) internal pure returns (string memory) {\\n bytes memory buffer = bytes(toHexString(addr));\\n\\n // hash the hex part of buffer (skip length + 2 bytes, length 40)\\n uint256 hashValue;\\n assembly (\\\"memory-safe\\\") {\\n hashValue := shr(96, keccak256(add(buffer, 0x22), 40))\\n }\\n\\n for (uint256 i = 41; i > 1; --i) {\\n // possible values for buffer[i] are 48 (0) to 57 (9) and 97 (a) to 102 (f)\\n if (hashValue & 0xf > 7 && uint8(buffer[i]) > 96) {\\n // case shift by xoring with 0x20\\n buffer[i] ^= 0x20;\\n }\\n hashValue >>= 4;\\n }\\n return string(buffer);\\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 bytes(a).length == bytes(b).length && keccak256(bytes(a)) == keccak256(bytes(b));\\n }\\n}\\n\",\"keccak256\":\"0x725209b582291bb83058e3078624b53d15a133f7401c30295e7f3704181d2aed\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/cryptography/ECDSA.sol)\\n\\npragma solidity ^0.8.20;\\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 }\\n\\n /**\\n * @dev The signature derives the `address(0)`.\\n */\\n error ECDSAInvalidSignature();\\n\\n /**\\n * @dev The signature has an invalid length.\\n */\\n error ECDSAInvalidSignatureLength(uint256 length);\\n\\n /**\\n * @dev The signature has an S value that is in the upper half order.\\n */\\n error ECDSAInvalidSignatureS(bytes32 s);\\n\\n /**\\n * @dev Returns the address that signed a hashed message (`hash`) with `signature` or an error. This will not\\n * return address(0) without also returning an error description. Errors are documented using an enum (error type)\\n * and a bytes32 providing additional information about the error.\\n *\\n * If no error is returned, then the address can be used for verification purposes.\\n *\\n * The `ecrecover` EVM precompile 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 {MessageHashUtils-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 function tryRecover(\\n bytes32 hash,\\n bytes memory signature\\n ) internal pure returns (address recovered, RecoverError err, bytes32 errArg) {\\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 assembly (\\\"memory-safe\\\") {\\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, bytes32(signature.length));\\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 precompile 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 {MessageHashUtils-toEthSignedMessageHash} on it.\\n */\\n function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {\\n (address recovered, RecoverError error, bytes32 errorArg) = tryRecover(hash, signature);\\n _throwError(error, errorArg);\\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[ERC-2098 short signatures]\\n */\\n function tryRecover(\\n bytes32 hash,\\n bytes32 r,\\n bytes32 vs\\n ) internal pure returns (address recovered, RecoverError err, bytes32 errArg) {\\n unchecked {\\n bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff);\\n // We do not check for an overflow here since the shift operation results in 0 or 1.\\n uint8 v = uint8((uint256(vs) >> 255) + 27);\\n return tryRecover(hash, v, r, s);\\n }\\n }\\n\\n /**\\n * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately.\\n */\\n function recover(bytes32 hash, bytes32 r, bytes32 vs) internal pure returns (address) {\\n (address recovered, RecoverError error, bytes32 errorArg) = tryRecover(hash, r, vs);\\n _throwError(error, errorArg);\\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 function tryRecover(\\n bytes32 hash,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) internal pure returns (address recovered, RecoverError err, bytes32 errArg) {\\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, s);\\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, bytes32(0));\\n }\\n\\n return (signer, RecoverError.NoError, bytes32(0));\\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, bytes32 errorArg) = tryRecover(hash, v, r, s);\\n _throwError(error, errorArg);\\n return recovered;\\n }\\n\\n /**\\n * @dev Optionally reverts with the corresponding custom error according to the `error` argument provided.\\n */\\n function _throwError(RecoverError error, bytes32 errorArg) private pure {\\n if (error == RecoverError.NoError) {\\n return; // no error: do nothing\\n } else if (error == RecoverError.InvalidSignature) {\\n revert ECDSAInvalidSignature();\\n } else if (error == RecoverError.InvalidSignatureLength) {\\n revert ECDSAInvalidSignatureLength(uint256(errorArg));\\n } else if (error == RecoverError.InvalidSignatureS) {\\n revert ECDSAInvalidSignatureS(errorArg);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x69f54c02b7d81d505910ec198c11ed4c6a728418a868b906b4a0cf29946fda84\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/cryptography/EIP712.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/cryptography/EIP712.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {MessageHashUtils} from \\\"./MessageHashUtils.sol\\\";\\nimport {ShortStrings, ShortString} from \\\"../ShortStrings.sol\\\";\\nimport {IERC5267} from \\\"../../interfaces/IERC5267.sol\\\";\\n\\n/**\\n * @dev https://eips.ethereum.org/EIPS/eip-712[EIP-712] is a standard for hashing and signing of typed structured data.\\n *\\n * The encoding scheme specified in the EIP requires a domain separator and a hash of the typed structured data, whose\\n * encoding is very generic and therefore its implementation in Solidity is not feasible, thus this contract\\n * does not implement the encoding itself. Protocols need to implement the type-specific encoding they need in order to\\n * produce the hash of their typed data using a combination of `abi.encode` and `keccak256`.\\n *\\n * This contract implements the EIP-712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding\\n * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA\\n * ({_hashTypedDataV4}).\\n *\\n * The implementation of the domain separator was designed to be as efficient as possible while still properly updating\\n * the chain id to protect against replay attacks on an eventual fork of the chain.\\n *\\n * NOTE: This contract implements the version of the encoding known as \\\"v4\\\", as implemented by the JSON RPC method\\n * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask].\\n *\\n * NOTE: In the upgradeable version of this contract, the cached values will correspond to the address, and the domain\\n * separator of the implementation contract. This will cause the {_domainSeparatorV4} function to always rebuild the\\n * separator from the immutable values, which is cheaper than accessing a cached version in cold storage.\\n *\\n * @custom:oz-upgrades-unsafe-allow state-variable-immutable\\n */\\nabstract contract EIP712 is IERC5267 {\\n using ShortStrings for *;\\n\\n bytes32 private constant TYPE_HASH =\\n keccak256(\\\"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)\\\");\\n\\n // Cache the domain separator as an immutable value, but also store the chain id that it corresponds to, in order to\\n // invalidate the cached domain separator if the chain id changes.\\n bytes32 private immutable _cachedDomainSeparator;\\n uint256 private immutable _cachedChainId;\\n address private immutable _cachedThis;\\n\\n bytes32 private immutable _hashedName;\\n bytes32 private immutable _hashedVersion;\\n\\n ShortString private immutable _name;\\n ShortString private immutable _version;\\n string private _nameFallback;\\n string private _versionFallback;\\n\\n /**\\n * @dev Initializes the domain separator and parameter caches.\\n *\\n * The meaning of `name` and `version` is specified in\\n * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP-712]:\\n *\\n * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol.\\n * - `version`: the current major version of the signing domain.\\n *\\n * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart\\n * contract upgrade].\\n */\\n constructor(string memory name, string memory version) {\\n _name = name.toShortStringWithFallback(_nameFallback);\\n _version = version.toShortStringWithFallback(_versionFallback);\\n _hashedName = keccak256(bytes(name));\\n _hashedVersion = keccak256(bytes(version));\\n\\n _cachedChainId = block.chainid;\\n _cachedDomainSeparator = _buildDomainSeparator();\\n _cachedThis = address(this);\\n }\\n\\n /**\\n * @dev Returns the domain separator for the current chain.\\n */\\n function _domainSeparatorV4() internal view returns (bytes32) {\\n if (address(this) == _cachedThis && block.chainid == _cachedChainId) {\\n return _cachedDomainSeparator;\\n } else {\\n return _buildDomainSeparator();\\n }\\n }\\n\\n function _buildDomainSeparator() private view returns (bytes32) {\\n return keccak256(abi.encode(TYPE_HASH, _hashedName, _hashedVersion, block.chainid, address(this)));\\n }\\n\\n /**\\n * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this\\n * function returns the hash of the fully encoded EIP712 message for this domain.\\n *\\n * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example:\\n *\\n * ```solidity\\n * bytes32 digest = _hashTypedDataV4(keccak256(abi.encode(\\n * keccak256(\\\"Mail(address to,string contents)\\\"),\\n * mailTo,\\n * keccak256(bytes(mailContents))\\n * )));\\n * address signer = ECDSA.recover(digest, signature);\\n * ```\\n */\\n function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) {\\n return MessageHashUtils.toTypedDataHash(_domainSeparatorV4(), structHash);\\n }\\n\\n /**\\n * @dev See {IERC-5267}.\\n */\\n function eip712Domain()\\n public\\n view\\n virtual\\n returns (\\n bytes1 fields,\\n string memory name,\\n string memory version,\\n uint256 chainId,\\n address verifyingContract,\\n bytes32 salt,\\n uint256[] memory extensions\\n )\\n {\\n return (\\n hex\\\"0f\\\", // 01111\\n _EIP712Name(),\\n _EIP712Version(),\\n block.chainid,\\n address(this),\\n bytes32(0),\\n new uint256[](0)\\n );\\n }\\n\\n /**\\n * @dev The name parameter for the EIP712 domain.\\n *\\n * NOTE: By default this function reads _name which is an immutable value.\\n * It only reads from storage if necessary (in case the value is too large to fit in a ShortString).\\n */\\n // solhint-disable-next-line func-name-mixedcase\\n function _EIP712Name() internal view returns (string memory) {\\n return _name.toStringWithFallback(_nameFallback);\\n }\\n\\n /**\\n * @dev The version parameter for the EIP712 domain.\\n *\\n * NOTE: By default this function reads _version which is an immutable value.\\n * It only reads from storage if necessary (in case the value is too large to fit in a ShortString).\\n */\\n // solhint-disable-next-line func-name-mixedcase\\n function _EIP712Version() internal view returns (string memory) {\\n return _version.toStringWithFallback(_versionFallback);\\n }\\n}\\n\",\"keccak256\":\"0x10eb97d047f8d84fe263a02bb4a656ac6674f6679d74532cc37546289e073a9d\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/cryptography/MessageHashUtils.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/cryptography/MessageHashUtils.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {Strings} from \\\"../Strings.sol\\\";\\n\\n/**\\n * @dev Signature message hash utilities for producing digests to be consumed by {ECDSA} recovery or signing.\\n *\\n * The library provides methods for generating a hash of a message that conforms to the\\n * https://eips.ethereum.org/EIPS/eip-191[ERC-191] and https://eips.ethereum.org/EIPS/eip-712[EIP 712]\\n * specifications.\\n */\\nlibrary MessageHashUtils {\\n /**\\n * @dev Returns the keccak256 digest of an ERC-191 signed data with version\\n * `0x45` (`personal_sign` messages).\\n *\\n * The digest is calculated by prefixing a bytes32 `messageHash` with\\n * `\\\"\\\\x19Ethereum Signed Message:\\\\n32\\\"` and hashing the result. It corresponds with the\\n * hash signed when using the https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] JSON-RPC method.\\n *\\n * NOTE: The `messageHash` parameter is intended to be the result of hashing a raw message with\\n * keccak256, although any bytes32 value can be safely used because the final digest will\\n * be re-hashed.\\n *\\n * See {ECDSA-recover}.\\n */\\n function toEthSignedMessageHash(bytes32 messageHash) internal pure returns (bytes32 digest) {\\n assembly (\\\"memory-safe\\\") {\\n mstore(0x00, \\\"\\\\x19Ethereum Signed Message:\\\\n32\\\") // 32 is the bytes-length of messageHash\\n mstore(0x1c, messageHash) // 0x1c (28) is the length of the prefix\\n digest := keccak256(0x00, 0x3c) // 0x3c is the length of the prefix (0x1c) + messageHash (0x20)\\n }\\n }\\n\\n /**\\n * @dev Returns the keccak256 digest of an ERC-191 signed data with version\\n * `0x45` (`personal_sign` messages).\\n *\\n * The digest is calculated by prefixing an arbitrary `message` with\\n * `\\\"\\\\x19Ethereum Signed Message:\\\\n\\\" + len(message)` and hashing the result. It corresponds with the\\n * hash signed when using the https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] JSON-RPC method.\\n *\\n * See {ECDSA-recover}.\\n */\\n function toEthSignedMessageHash(bytes memory message) internal pure returns (bytes32) {\\n return\\n keccak256(bytes.concat(\\\"\\\\x19Ethereum Signed Message:\\\\n\\\", bytes(Strings.toString(message.length)), message));\\n }\\n\\n /**\\n * @dev Returns the keccak256 digest of an ERC-191 signed data with version\\n * `0x00` (data with intended validator).\\n *\\n * The digest is calculated by prefixing an arbitrary `data` with `\\\"\\\\x19\\\\x00\\\"` and the intended\\n * `validator` address. Then hashing the result.\\n *\\n * See {ECDSA-recover}.\\n */\\n function toDataWithIntendedValidatorHash(address validator, bytes memory data) internal pure returns (bytes32) {\\n return keccak256(abi.encodePacked(hex\\\"19_00\\\", validator, data));\\n }\\n\\n /**\\n * @dev Returns the keccak256 digest of an EIP-712 typed data (ERC-191 version `0x01`).\\n *\\n * The digest is calculated from a `domainSeparator` and a `structHash`, by prefixing them with\\n * `\\\\x19\\\\x01` and hashing the result. It corresponds to the hash signed by the\\n * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`] JSON-RPC method as part of EIP-712.\\n *\\n * See {ECDSA-recover}.\\n */\\n function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32 digest) {\\n assembly (\\\"memory-safe\\\") {\\n let ptr := mload(0x40)\\n mstore(ptr, hex\\\"19_01\\\")\\n mstore(add(ptr, 0x02), domainSeparator)\\n mstore(add(ptr, 0x22), structHash)\\n digest := keccak256(ptr, 0x42)\\n }\\n }\\n}\\n\",\"keccak256\":\"0x4515543bc4c78561f6bea83ecfdfc3dead55bd59858287d682045b11de1ae575\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/introspection/ERC165.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/introspection/ERC165.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {IERC165} from \\\"./IERC165.sol\\\";\\n\\n/**\\n * @dev Implementation of the {IERC165} interface.\\n *\\n * Contracts that want to implement ERC-165 should inherit from this contract and override {supportsInterface} to check\\n * for the additional interface id that will be supported. For example:\\n *\\n * ```solidity\\n * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\\n * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);\\n * }\\n * ```\\n */\\nabstract contract ERC165 is IERC165 {\\n /**\\n * @dev See {IERC165-supportsInterface}.\\n */\\n function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) {\\n return interfaceId == type(IERC165).interfaceId;\\n }\\n}\\n\",\"keccak256\":\"0xddce8e17e3d3f9ed818b4f4c4478a8262aab8b11ed322f1bf5ed705bb4bd97fa\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/introspection/IERC165.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/introspection/IERC165.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Interface of the ERC-165 standard, as defined in the\\n * https://eips.ethereum.org/EIPS/eip-165[ERC].\\n *\\n * Implementers can declare support of contract interfaces, which can then be\\n * queried by others ({ERC165Checker}).\\n *\\n * For an implementation, see {ERC165}.\\n */\\ninterface IERC165 {\\n /**\\n * @dev Returns true if this contract implements the interface defined by\\n * `interfaceId`. See the corresponding\\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[ERC section]\\n * to learn more about how these ids are created.\\n *\\n * This function call must use less than 30 000 gas.\\n */\\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x79796192ec90263f21b464d5bc90b777a525971d3de8232be80d9c4f9fb353b8\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/math/Math.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/math/Math.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {Panic} from \\\"../Panic.sol\\\";\\nimport {SafeCast} from \\\"./SafeCast.sol\\\";\\n\\n/**\\n * @dev Standard math utilities missing in the Solidity language.\\n */\\nlibrary Math {\\n enum Rounding {\\n Floor, // Toward negative infinity\\n Ceil, // Toward positive infinity\\n Trunc, // Toward zero\\n Expand // Away from zero\\n }\\n\\n /**\\n * @dev Returns the addition of two unsigned integers, with an success flag (no overflow).\\n */\\n function tryAdd(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\\n unchecked {\\n uint256 c = a + b;\\n if (c < a) return (false, 0);\\n return (true, c);\\n }\\n }\\n\\n /**\\n * @dev Returns the subtraction of two unsigned integers, with an success flag (no overflow).\\n */\\n function trySub(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\\n unchecked {\\n if (b > a) return (false, 0);\\n return (true, a - b);\\n }\\n }\\n\\n /**\\n * @dev Returns the multiplication of two unsigned integers, with an success flag (no overflow).\\n */\\n function tryMul(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\\n unchecked {\\n // Gas optimization: this is cheaper than requiring 'a' not being zero, but the\\n // benefit is lost if 'b' is also tested.\\n // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522\\n if (a == 0) return (true, 0);\\n uint256 c = a * b;\\n if (c / a != b) return (false, 0);\\n return (true, c);\\n }\\n }\\n\\n /**\\n * @dev Returns the division of two unsigned integers, with a success flag (no division by zero).\\n */\\n function tryDiv(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\\n unchecked {\\n if (b == 0) return (false, 0);\\n return (true, a / b);\\n }\\n }\\n\\n /**\\n * @dev Returns the remainder of dividing two unsigned integers, with a success flag (no division by zero).\\n */\\n function tryMod(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\\n unchecked {\\n if (b == 0) return (false, 0);\\n return (true, a % b);\\n }\\n }\\n\\n /**\\n * @dev Branchless ternary evaluation for `a ? b : c`. Gas costs are constant.\\n *\\n * IMPORTANT: This function may reduce bytecode size and consume less gas when used standalone.\\n * However, the compiler may optimize Solidity ternary operations (i.e. `a ? b : c`) to only compute\\n * one branch when needed, making this function more expensive.\\n */\\n function ternary(bool condition, uint256 a, uint256 b) internal pure returns (uint256) {\\n unchecked {\\n // branchless ternary works because:\\n // b ^ (a ^ b) == a\\n // b ^ 0 == b\\n return b ^ ((a ^ b) * SafeCast.toUint(condition));\\n }\\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 ternary(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 ternary(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 towards infinity instead\\n * of rounding towards zero.\\n */\\n function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {\\n if (b == 0) {\\n // Guarantee the same behavior as in a regular Solidity division.\\n Panic.panic(Panic.DIVISION_BY_ZERO);\\n }\\n\\n // The following calculation ensures accurate ceiling division without overflow.\\n // Since a is non-zero, (a - 1) / b will not overflow.\\n // The largest possible result occurs when (a - 1) / b is type(uint256).max,\\n // but the largest value we can obtain is type(uint256).max - 1, which happens\\n // when a = type(uint256).max and b = 1.\\n unchecked {\\n return SafeCast.toUint(a > 0) * ((a - 1) / b + 1);\\n }\\n }\\n\\n /**\\n * @dev Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or\\n * denominator == 0.\\n *\\n * Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv) with further edits by\\n * 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\\u00b2\\u2075\\u2076 and mod 2\\u00b2\\u2075\\u2076 - 1, then use\\n // the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256\\n // variables such that product = prod1 * 2\\u00b2\\u2075\\u2076 + prod0.\\n uint256 prod0 = x * y; // 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 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\\u00b2\\u2075\\u2076. Also prevents denominator == 0.\\n if (denominator <= prod1) {\\n Panic.panic(ternary(denominator == 0, Panic.DIVISION_BY_ZERO, Panic.UNDER_OVERFLOW));\\n }\\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.\\n // Always >= 1. See https://cs.stackexchange.com/q/138556/92363.\\n\\n uint256 twos = denominator & (0 - denominator);\\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\\u00b2\\u2075\\u2076 / 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\\u00b2\\u2075\\u2076. Now that denominator is an odd number, it has an inverse modulo 2\\u00b2\\u2075\\u2076 such\\n // that denominator * inv \\u2261 1 mod 2\\u00b2\\u2075\\u2076. Compute the inverse by starting with a seed that is correct for\\n // four bits. That is, denominator * inv \\u2261 1 mod 2\\u2074.\\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\\n // works in modular arithmetic, doubling the correct bits in each step.\\n inverse *= 2 - denominator * inverse; // inverse mod 2\\u2078\\n inverse *= 2 - denominator * inverse; // inverse mod 2\\u00b9\\u2076\\n inverse *= 2 - denominator * inverse; // inverse mod 2\\u00b3\\u00b2\\n inverse *= 2 - denominator * inverse; // inverse mod 2\\u2076\\u2074\\n inverse *= 2 - denominator * inverse; // inverse mod 2\\u00b9\\u00b2\\u2078\\n inverse *= 2 - denominator * inverse; // inverse mod 2\\u00b2\\u2075\\u2076\\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\\u00b2\\u2075\\u2076. Since the preconditions guarantee that the outcome is\\n // less than 2\\u00b2\\u2075\\u2076, 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 * @dev 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 return mulDiv(x, y, denominator) + SafeCast.toUint(unsignedRoundsUp(rounding) && mulmod(x, y, denominator) > 0);\\n }\\n\\n /**\\n * @dev Calculate the modular multiplicative inverse of a number in Z/nZ.\\n *\\n * If n is a prime, then Z/nZ is a field. In that case all elements are inversible, except 0.\\n * If n is not a prime, then Z/nZ is not a field, and some elements might not be inversible.\\n *\\n * If the input value is not inversible, 0 is returned.\\n *\\n * NOTE: If you know for sure that n is (big) a prime, it may be cheaper to use Fermat's little theorem and get the\\n * inverse using `Math.modExp(a, n - 2, n)`. See {invModPrime}.\\n */\\n function invMod(uint256 a, uint256 n) internal pure returns (uint256) {\\n unchecked {\\n if (n == 0) return 0;\\n\\n // The inverse modulo is calculated using the Extended Euclidean Algorithm (iterative version)\\n // Used to compute integers x and y such that: ax + ny = gcd(a, n).\\n // When the gcd is 1, then the inverse of a modulo n exists and it's x.\\n // ax + ny = 1\\n // ax = 1 + (-y)n\\n // ax \\u2261 1 (mod n) # x is the inverse of a modulo n\\n\\n // If the remainder is 0 the gcd is n right away.\\n uint256 remainder = a % n;\\n uint256 gcd = n;\\n\\n // Therefore the initial coefficients are:\\n // ax + ny = gcd(a, n) = n\\n // 0a + 1n = n\\n int256 x = 0;\\n int256 y = 1;\\n\\n while (remainder != 0) {\\n uint256 quotient = gcd / remainder;\\n\\n (gcd, remainder) = (\\n // The old remainder is the next gcd to try.\\n remainder,\\n // Compute the next remainder.\\n // Can't overflow given that (a % gcd) * (gcd // (a % gcd)) <= gcd\\n // where gcd is at most n (capped to type(uint256).max)\\n gcd - remainder * quotient\\n );\\n\\n (x, y) = (\\n // Increment the coefficient of a.\\n y,\\n // Decrement the coefficient of n.\\n // Can overflow, but the result is casted to uint256 so that the\\n // next value of y is \\\"wrapped around\\\" to a value between 0 and n - 1.\\n x - y * int256(quotient)\\n );\\n }\\n\\n if (gcd != 1) return 0; // No inverse exists.\\n return ternary(x < 0, n - uint256(-x), uint256(x)); // Wrap the result if it's negative.\\n }\\n }\\n\\n /**\\n * @dev Variant of {invMod}. More efficient, but only works if `p` is known to be a prime greater than `2`.\\n *\\n * From https://en.wikipedia.org/wiki/Fermat%27s_little_theorem[Fermat's little theorem], we know that if p is\\n * prime, then `a**(p-1) \\u2261 1 mod p`. As a consequence, we have `a * a**(p-2) \\u2261 1 mod p`, which means that\\n * `a**(p-2)` is the modular multiplicative inverse of a in Fp.\\n *\\n * NOTE: this function does NOT check that `p` is a prime greater than `2`.\\n */\\n function invModPrime(uint256 a, uint256 p) internal view returns (uint256) {\\n unchecked {\\n return Math.modExp(a, p - 2, p);\\n }\\n }\\n\\n /**\\n * @dev Returns the modular exponentiation of the specified base, exponent and modulus (b ** e % m)\\n *\\n * Requirements:\\n * - modulus can't be zero\\n * - underlying staticcall to precompile must succeed\\n *\\n * IMPORTANT: The result is only valid if the underlying call succeeds. When using this function, make\\n * sure the chain you're using it on supports the precompiled contract for modular exponentiation\\n * at address 0x05 as specified in https://eips.ethereum.org/EIPS/eip-198[EIP-198]. Otherwise,\\n * the underlying function will succeed given the lack of a revert, but the result may be incorrectly\\n * interpreted as 0.\\n */\\n function modExp(uint256 b, uint256 e, uint256 m) internal view returns (uint256) {\\n (bool success, uint256 result) = tryModExp(b, e, m);\\n if (!success) {\\n Panic.panic(Panic.DIVISION_BY_ZERO);\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Returns the modular exponentiation of the specified base, exponent and modulus (b ** e % m).\\n * It includes a success flag indicating if the operation succeeded. Operation will be marked as failed if trying\\n * to operate modulo 0 or if the underlying precompile reverted.\\n *\\n * IMPORTANT: The result is only valid if the success flag is true. When using this function, make sure the chain\\n * you're using it on supports the precompiled contract for modular exponentiation at address 0x05 as specified in\\n * https://eips.ethereum.org/EIPS/eip-198[EIP-198]. Otherwise, the underlying function will succeed given the lack\\n * of a revert, but the result may be incorrectly interpreted as 0.\\n */\\n function tryModExp(uint256 b, uint256 e, uint256 m) internal view returns (bool success, uint256 result) {\\n if (m == 0) return (false, 0);\\n assembly (\\\"memory-safe\\\") {\\n let ptr := mload(0x40)\\n // | Offset | Content | Content (Hex) |\\n // |-----------|------------|--------------------------------------------------------------------|\\n // | 0x00:0x1f | size of b | 0x0000000000000000000000000000000000000000000000000000000000000020 |\\n // | 0x20:0x3f | size of e | 0x0000000000000000000000000000000000000000000000000000000000000020 |\\n // | 0x40:0x5f | size of m | 0x0000000000000000000000000000000000000000000000000000000000000020 |\\n // | 0x60:0x7f | value of b | 0x<.............................................................b> |\\n // | 0x80:0x9f | value of e | 0x<.............................................................e> |\\n // | 0xa0:0xbf | value of m | 0x<.............................................................m> |\\n mstore(ptr, 0x20)\\n mstore(add(ptr, 0x20), 0x20)\\n mstore(add(ptr, 0x40), 0x20)\\n mstore(add(ptr, 0x60), b)\\n mstore(add(ptr, 0x80), e)\\n mstore(add(ptr, 0xa0), m)\\n\\n // Given the result < m, it's guaranteed to fit in 32 bytes,\\n // so we can use the memory scratch space located at offset 0.\\n success := staticcall(gas(), 0x05, ptr, 0xc0, 0x00, 0x20)\\n result := mload(0x00)\\n }\\n }\\n\\n /**\\n * @dev Variant of {modExp} that supports inputs of arbitrary length.\\n */\\n function modExp(bytes memory b, bytes memory e, bytes memory m) internal view returns (bytes memory) {\\n (bool success, bytes memory result) = tryModExp(b, e, m);\\n if (!success) {\\n Panic.panic(Panic.DIVISION_BY_ZERO);\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Variant of {tryModExp} that supports inputs of arbitrary length.\\n */\\n function tryModExp(\\n bytes memory b,\\n bytes memory e,\\n bytes memory m\\n ) internal view returns (bool success, bytes memory result) {\\n if (_zeroBytes(m)) return (false, new bytes(0));\\n\\n uint256 mLen = m.length;\\n\\n // Encode call args in result and move the free memory pointer\\n result = abi.encodePacked(b.length, e.length, mLen, b, e, m);\\n\\n assembly (\\\"memory-safe\\\") {\\n let dataPtr := add(result, 0x20)\\n // Write result on top of args to avoid allocating extra memory.\\n success := staticcall(gas(), 0x05, dataPtr, mload(result), dataPtr, mLen)\\n // Overwrite the length.\\n // result.length > returndatasize() is guaranteed because returndatasize() == m.length\\n mstore(result, mLen)\\n // Set the memory pointer after the returned data.\\n mstore(0x40, add(dataPtr, mLen))\\n }\\n }\\n\\n /**\\n * @dev Returns whether the provided byte array is zero.\\n */\\n function _zeroBytes(bytes memory byteArray) private pure returns (bool) {\\n for (uint256 i = 0; i < byteArray.length; ++i) {\\n if (byteArray[i] != 0) {\\n return false;\\n }\\n }\\n return true;\\n }\\n\\n /**\\n * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded\\n * towards zero.\\n *\\n * This method is based on Newton's method for computing square roots; the algorithm is restricted to only\\n * using integer operations.\\n */\\n function sqrt(uint256 a) internal pure returns (uint256) {\\n unchecked {\\n // Take care of easy edge cases when a == 0 or a == 1\\n if (a <= 1) {\\n return a;\\n }\\n\\n // In this function, we use Newton's method to get a root of `f(x) := x\\u00b2 - a`. It involves building a\\n // sequence x_n that converges toward sqrt(a). For each iteration x_n, we also define the error between\\n // the current value as `\\u03b5_n = | x_n - sqrt(a) |`.\\n //\\n // For our first estimation, we consider `e` the smallest power of 2 which is bigger than the square root\\n // of the target. (i.e. `2**(e-1) \\u2264 sqrt(a) < 2**e`). We know that `e \\u2264 128` because `(2\\u00b9\\u00b2\\u2078)\\u00b2 = 2\\u00b2\\u2075\\u2076` is\\n // bigger than any uint256.\\n //\\n // By noticing that\\n // `2**(e-1) \\u2264 sqrt(a) < 2**e \\u2192 (2**(e-1))\\u00b2 \\u2264 a < (2**e)\\u00b2 \\u2192 2**(2*e-2) \\u2264 a < 2**(2*e)`\\n // we can deduce that `e - 1` is `log2(a) / 2`. We can thus compute `x_n = 2**(e-1)` using a method similar\\n // to the msb function.\\n uint256 aa = a;\\n uint256 xn = 1;\\n\\n if (aa >= (1 << 128)) {\\n aa >>= 128;\\n xn <<= 64;\\n }\\n if (aa >= (1 << 64)) {\\n aa >>= 64;\\n xn <<= 32;\\n }\\n if (aa >= (1 << 32)) {\\n aa >>= 32;\\n xn <<= 16;\\n }\\n if (aa >= (1 << 16)) {\\n aa >>= 16;\\n xn <<= 8;\\n }\\n if (aa >= (1 << 8)) {\\n aa >>= 8;\\n xn <<= 4;\\n }\\n if (aa >= (1 << 4)) {\\n aa >>= 4;\\n xn <<= 2;\\n }\\n if (aa >= (1 << 2)) {\\n xn <<= 1;\\n }\\n\\n // We now have x_n such that `x_n = 2**(e-1) \\u2264 sqrt(a) < 2**e = 2 * x_n`. This implies \\u03b5_n \\u2264 2**(e-1).\\n //\\n // We can refine our estimation by noticing that the middle of that interval minimizes the error.\\n // If we move x_n to equal 2**(e-1) + 2**(e-2), then we reduce the error to \\u03b5_n \\u2264 2**(e-2).\\n // This is going to be our x_0 (and \\u03b5_0)\\n xn = (3 * xn) >> 1; // \\u03b5_0 := | x_0 - sqrt(a) | \\u2264 2**(e-2)\\n\\n // From here, Newton's method give us:\\n // x_{n+1} = (x_n + a / x_n) / 2\\n //\\n // One should note that:\\n // x_{n+1}\\u00b2 - a = ((x_n + a / x_n) / 2)\\u00b2 - a\\n // = ((x_n\\u00b2 + a) / (2 * x_n))\\u00b2 - a\\n // = (x_n\\u2074 + 2 * a * x_n\\u00b2 + a\\u00b2) / (4 * x_n\\u00b2) - a\\n // = (x_n\\u2074 + 2 * a * x_n\\u00b2 + a\\u00b2 - 4 * a * x_n\\u00b2) / (4 * x_n\\u00b2)\\n // = (x_n\\u2074 - 2 * a * x_n\\u00b2 + a\\u00b2) / (4 * x_n\\u00b2)\\n // = (x_n\\u00b2 - a)\\u00b2 / (2 * x_n)\\u00b2\\n // = ((x_n\\u00b2 - a) / (2 * x_n))\\u00b2\\n // \\u2265 0\\n // Which proves that for all n \\u2265 1, sqrt(a) \\u2264 x_n\\n //\\n // This gives us the proof of quadratic convergence of the sequence:\\n // \\u03b5_{n+1} = | x_{n+1} - sqrt(a) |\\n // = | (x_n + a / x_n) / 2 - sqrt(a) |\\n // = | (x_n\\u00b2 + a - 2*x_n*sqrt(a)) / (2 * x_n) |\\n // = | (x_n - sqrt(a))\\u00b2 / (2 * x_n) |\\n // = | \\u03b5_n\\u00b2 / (2 * x_n) |\\n // = \\u03b5_n\\u00b2 / | (2 * x_n) |\\n //\\n // For the first iteration, we have a special case where x_0 is known:\\n // \\u03b5_1 = \\u03b5_0\\u00b2 / | (2 * x_0) |\\n // \\u2264 (2**(e-2))\\u00b2 / (2 * (2**(e-1) + 2**(e-2)))\\n // \\u2264 2**(2*e-4) / (3 * 2**(e-1))\\n // \\u2264 2**(e-3) / 3\\n // \\u2264 2**(e-3-log2(3))\\n // \\u2264 2**(e-4.5)\\n //\\n // For the following iterations, we use the fact that, 2**(e-1) \\u2264 sqrt(a) \\u2264 x_n:\\n // \\u03b5_{n+1} = \\u03b5_n\\u00b2 / | (2 * x_n) |\\n // \\u2264 (2**(e-k))\\u00b2 / (2 * 2**(e-1))\\n // \\u2264 2**(2*e-2*k) / 2**e\\n // \\u2264 2**(e-2*k)\\n xn = (xn + a / xn) >> 1; // \\u03b5_1 := | x_1 - sqrt(a) | \\u2264 2**(e-4.5) -- special case, see above\\n xn = (xn + a / xn) >> 1; // \\u03b5_2 := | x_2 - sqrt(a) | \\u2264 2**(e-9) -- general case with k = 4.5\\n xn = (xn + a / xn) >> 1; // \\u03b5_3 := | x_3 - sqrt(a) | \\u2264 2**(e-18) -- general case with k = 9\\n xn = (xn + a / xn) >> 1; // \\u03b5_4 := | x_4 - sqrt(a) | \\u2264 2**(e-36) -- general case with k = 18\\n xn = (xn + a / xn) >> 1; // \\u03b5_5 := | x_5 - sqrt(a) | \\u2264 2**(e-72) -- general case with k = 36\\n xn = (xn + a / xn) >> 1; // \\u03b5_6 := | x_6 - sqrt(a) | \\u2264 2**(e-144) -- general case with k = 72\\n\\n // Because e \\u2264 128 (as discussed during the first estimation phase), we know have reached a precision\\n // \\u03b5_6 \\u2264 2**(e-144) < 1. Given we're operating on integers, then we can ensure that xn is now either\\n // sqrt(a) or sqrt(a) + 1.\\n return xn - SafeCast.toUint(xn > a / xn);\\n }\\n }\\n\\n /**\\n * @dev 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 + SafeCast.toUint(unsignedRoundsUp(rounding) && result * result < a);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 2 of a positive value rounded towards zero.\\n * Returns 0 if given 0.\\n */\\n function log2(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n uint256 exp;\\n unchecked {\\n exp = 128 * SafeCast.toUint(value > (1 << 128) - 1);\\n value >>= exp;\\n result += exp;\\n\\n exp = 64 * SafeCast.toUint(value > (1 << 64) - 1);\\n value >>= exp;\\n result += exp;\\n\\n exp = 32 * SafeCast.toUint(value > (1 << 32) - 1);\\n value >>= exp;\\n result += exp;\\n\\n exp = 16 * SafeCast.toUint(value > (1 << 16) - 1);\\n value >>= exp;\\n result += exp;\\n\\n exp = 8 * SafeCast.toUint(value > (1 << 8) - 1);\\n value >>= exp;\\n result += exp;\\n\\n exp = 4 * SafeCast.toUint(value > (1 << 4) - 1);\\n value >>= exp;\\n result += exp;\\n\\n exp = 2 * SafeCast.toUint(value > (1 << 2) - 1);\\n value >>= exp;\\n result += exp;\\n\\n result += SafeCast.toUint(value > 1);\\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 + SafeCast.toUint(unsignedRoundsUp(rounding) && 1 << result < value);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 10 of a positive value rounded towards zero.\\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 + SafeCast.toUint(unsignedRoundsUp(rounding) && 10 ** result < value);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 256 of a positive value rounded towards zero.\\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 uint256 isGt;\\n unchecked {\\n isGt = SafeCast.toUint(value > (1 << 128) - 1);\\n value >>= isGt * 128;\\n result += isGt * 16;\\n\\n isGt = SafeCast.toUint(value > (1 << 64) - 1);\\n value >>= isGt * 64;\\n result += isGt * 8;\\n\\n isGt = SafeCast.toUint(value > (1 << 32) - 1);\\n value >>= isGt * 32;\\n result += isGt * 4;\\n\\n isGt = SafeCast.toUint(value > (1 << 16) - 1);\\n value >>= isGt * 16;\\n result += isGt * 2;\\n\\n result += SafeCast.toUint(value > (1 << 8) - 1);\\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 + SafeCast.toUint(unsignedRoundsUp(rounding) && 1 << (result << 3) < value);\\n }\\n }\\n\\n /**\\n * @dev Returns whether a provided rounding mode is considered rounding up for unsigned integers.\\n */\\n function unsignedRoundsUp(Rounding rounding) internal pure returns (bool) {\\n return uint8(rounding) % 2 == 1;\\n }\\n}\\n\",\"keccak256\":\"0xa00be322d7db5786750ce0ac7e2f5b633ac30a5ed5fa1ced1e74acfc19acecea\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/math/SafeCast.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/math/SafeCast.sol)\\n// This file was procedurally generated from scripts/generate/templates/SafeCast.js.\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Wrappers over Solidity's uintXX/intXX/bool casting operators with added overflow\\n * checks.\\n *\\n * Downcasting from uint256/int256 in Solidity does not revert on overflow. This can\\n * easily result in undesired exploitation or bugs, since developers usually\\n * assume that overflows raise errors. `SafeCast` restores this intuition by\\n * reverting the transaction when such an operation overflows.\\n *\\n * Using this library instead of the unchecked operations eliminates an entire\\n * class of bugs, so it's recommended to use it always.\\n */\\nlibrary SafeCast {\\n /**\\n * @dev Value doesn't fit in an uint of `bits` size.\\n */\\n error SafeCastOverflowedUintDowncast(uint8 bits, uint256 value);\\n\\n /**\\n * @dev An int value doesn't fit in an uint of `bits` size.\\n */\\n error SafeCastOverflowedIntToUint(int256 value);\\n\\n /**\\n * @dev Value doesn't fit in an int of `bits` size.\\n */\\n error SafeCastOverflowedIntDowncast(uint8 bits, int256 value);\\n\\n /**\\n * @dev An uint value doesn't fit in an int of `bits` size.\\n */\\n error SafeCastOverflowedUintToInt(uint256 value);\\n\\n /**\\n * @dev Returns the downcasted uint248 from uint256, reverting on\\n * overflow (when the input is greater than largest uint248).\\n *\\n * Counterpart to Solidity's `uint248` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 248 bits\\n */\\n function toUint248(uint256 value) internal pure returns (uint248) {\\n if (value > type(uint248).max) {\\n revert SafeCastOverflowedUintDowncast(248, value);\\n }\\n return uint248(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint240 from uint256, reverting on\\n * overflow (when the input is greater than largest uint240).\\n *\\n * Counterpart to Solidity's `uint240` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 240 bits\\n */\\n function toUint240(uint256 value) internal pure returns (uint240) {\\n if (value > type(uint240).max) {\\n revert SafeCastOverflowedUintDowncast(240, value);\\n }\\n return uint240(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint232 from uint256, reverting on\\n * overflow (when the input is greater than largest uint232).\\n *\\n * Counterpart to Solidity's `uint232` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 232 bits\\n */\\n function toUint232(uint256 value) internal pure returns (uint232) {\\n if (value > type(uint232).max) {\\n revert SafeCastOverflowedUintDowncast(232, value);\\n }\\n return uint232(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint224 from uint256, reverting on\\n * overflow (when the input is greater than largest uint224).\\n *\\n * Counterpart to Solidity's `uint224` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 224 bits\\n */\\n function toUint224(uint256 value) internal pure returns (uint224) {\\n if (value > type(uint224).max) {\\n revert SafeCastOverflowedUintDowncast(224, value);\\n }\\n return uint224(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint216 from uint256, reverting on\\n * overflow (when the input is greater than largest uint216).\\n *\\n * Counterpart to Solidity's `uint216` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 216 bits\\n */\\n function toUint216(uint256 value) internal pure returns (uint216) {\\n if (value > type(uint216).max) {\\n revert SafeCastOverflowedUintDowncast(216, value);\\n }\\n return uint216(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint208 from uint256, reverting on\\n * overflow (when the input is greater than largest uint208).\\n *\\n * Counterpart to Solidity's `uint208` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 208 bits\\n */\\n function toUint208(uint256 value) internal pure returns (uint208) {\\n if (value > type(uint208).max) {\\n revert SafeCastOverflowedUintDowncast(208, value);\\n }\\n return uint208(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint200 from uint256, reverting on\\n * overflow (when the input is greater than largest uint200).\\n *\\n * Counterpart to Solidity's `uint200` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 200 bits\\n */\\n function toUint200(uint256 value) internal pure returns (uint200) {\\n if (value > type(uint200).max) {\\n revert SafeCastOverflowedUintDowncast(200, value);\\n }\\n return uint200(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint192 from uint256, reverting on\\n * overflow (when the input is greater than largest uint192).\\n *\\n * Counterpart to Solidity's `uint192` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 192 bits\\n */\\n function toUint192(uint256 value) internal pure returns (uint192) {\\n if (value > type(uint192).max) {\\n revert SafeCastOverflowedUintDowncast(192, value);\\n }\\n return uint192(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint184 from uint256, reverting on\\n * overflow (when the input is greater than largest uint184).\\n *\\n * Counterpart to Solidity's `uint184` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 184 bits\\n */\\n function toUint184(uint256 value) internal pure returns (uint184) {\\n if (value > type(uint184).max) {\\n revert SafeCastOverflowedUintDowncast(184, value);\\n }\\n return uint184(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint176 from uint256, reverting on\\n * overflow (when the input is greater than largest uint176).\\n *\\n * Counterpart to Solidity's `uint176` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 176 bits\\n */\\n function toUint176(uint256 value) internal pure returns (uint176) {\\n if (value > type(uint176).max) {\\n revert SafeCastOverflowedUintDowncast(176, value);\\n }\\n return uint176(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint168 from uint256, reverting on\\n * overflow (when the input is greater than largest uint168).\\n *\\n * Counterpart to Solidity's `uint168` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 168 bits\\n */\\n function toUint168(uint256 value) internal pure returns (uint168) {\\n if (value > type(uint168).max) {\\n revert SafeCastOverflowedUintDowncast(168, value);\\n }\\n return uint168(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint160 from uint256, reverting on\\n * overflow (when the input is greater than largest uint160).\\n *\\n * Counterpart to Solidity's `uint160` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 160 bits\\n */\\n function toUint160(uint256 value) internal pure returns (uint160) {\\n if (value > type(uint160).max) {\\n revert SafeCastOverflowedUintDowncast(160, value);\\n }\\n return uint160(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint152 from uint256, reverting on\\n * overflow (when the input is greater than largest uint152).\\n *\\n * Counterpart to Solidity's `uint152` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 152 bits\\n */\\n function toUint152(uint256 value) internal pure returns (uint152) {\\n if (value > type(uint152).max) {\\n revert SafeCastOverflowedUintDowncast(152, value);\\n }\\n return uint152(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint144 from uint256, reverting on\\n * overflow (when the input is greater than largest uint144).\\n *\\n * Counterpart to Solidity's `uint144` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 144 bits\\n */\\n function toUint144(uint256 value) internal pure returns (uint144) {\\n if (value > type(uint144).max) {\\n revert SafeCastOverflowedUintDowncast(144, value);\\n }\\n return uint144(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint136 from uint256, reverting on\\n * overflow (when the input is greater than largest uint136).\\n *\\n * Counterpart to Solidity's `uint136` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 136 bits\\n */\\n function toUint136(uint256 value) internal pure returns (uint136) {\\n if (value > type(uint136).max) {\\n revert SafeCastOverflowedUintDowncast(136, value);\\n }\\n return uint136(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint128 from uint256, reverting on\\n * overflow (when the input is greater than largest uint128).\\n *\\n * Counterpart to Solidity's `uint128` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 128 bits\\n */\\n function toUint128(uint256 value) internal pure returns (uint128) {\\n if (value > type(uint128).max) {\\n revert SafeCastOverflowedUintDowncast(128, value);\\n }\\n return uint128(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint120 from uint256, reverting on\\n * overflow (when the input is greater than largest uint120).\\n *\\n * Counterpart to Solidity's `uint120` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 120 bits\\n */\\n function toUint120(uint256 value) internal pure returns (uint120) {\\n if (value > type(uint120).max) {\\n revert SafeCastOverflowedUintDowncast(120, value);\\n }\\n return uint120(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint112 from uint256, reverting on\\n * overflow (when the input is greater than largest uint112).\\n *\\n * Counterpart to Solidity's `uint112` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 112 bits\\n */\\n function toUint112(uint256 value) internal pure returns (uint112) {\\n if (value > type(uint112).max) {\\n revert SafeCastOverflowedUintDowncast(112, value);\\n }\\n return uint112(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint104 from uint256, reverting on\\n * overflow (when the input is greater than largest uint104).\\n *\\n * Counterpart to Solidity's `uint104` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 104 bits\\n */\\n function toUint104(uint256 value) internal pure returns (uint104) {\\n if (value > type(uint104).max) {\\n revert SafeCastOverflowedUintDowncast(104, value);\\n }\\n return uint104(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint96 from uint256, reverting on\\n * overflow (when the input is greater than largest uint96).\\n *\\n * Counterpart to Solidity's `uint96` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 96 bits\\n */\\n function toUint96(uint256 value) internal pure returns (uint96) {\\n if (value > type(uint96).max) {\\n revert SafeCastOverflowedUintDowncast(96, value);\\n }\\n return uint96(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint88 from uint256, reverting on\\n * overflow (when the input is greater than largest uint88).\\n *\\n * Counterpart to Solidity's `uint88` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 88 bits\\n */\\n function toUint88(uint256 value) internal pure returns (uint88) {\\n if (value > type(uint88).max) {\\n revert SafeCastOverflowedUintDowncast(88, value);\\n }\\n return uint88(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint80 from uint256, reverting on\\n * overflow (when the input is greater than largest uint80).\\n *\\n * Counterpart to Solidity's `uint80` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 80 bits\\n */\\n function toUint80(uint256 value) internal pure returns (uint80) {\\n if (value > type(uint80).max) {\\n revert SafeCastOverflowedUintDowncast(80, value);\\n }\\n return uint80(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint72 from uint256, reverting on\\n * overflow (when the input is greater than largest uint72).\\n *\\n * Counterpart to Solidity's `uint72` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 72 bits\\n */\\n function toUint72(uint256 value) internal pure returns (uint72) {\\n if (value > type(uint72).max) {\\n revert SafeCastOverflowedUintDowncast(72, value);\\n }\\n return uint72(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint64 from uint256, reverting on\\n * overflow (when the input is greater than largest uint64).\\n *\\n * Counterpart to Solidity's `uint64` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 64 bits\\n */\\n function toUint64(uint256 value) internal pure returns (uint64) {\\n if (value > type(uint64).max) {\\n revert SafeCastOverflowedUintDowncast(64, value);\\n }\\n return uint64(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint56 from uint256, reverting on\\n * overflow (when the input is greater than largest uint56).\\n *\\n * Counterpart to Solidity's `uint56` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 56 bits\\n */\\n function toUint56(uint256 value) internal pure returns (uint56) {\\n if (value > type(uint56).max) {\\n revert SafeCastOverflowedUintDowncast(56, value);\\n }\\n return uint56(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint48 from uint256, reverting on\\n * overflow (when the input is greater than largest uint48).\\n *\\n * Counterpart to Solidity's `uint48` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 48 bits\\n */\\n function toUint48(uint256 value) internal pure returns (uint48) {\\n if (value > type(uint48).max) {\\n revert SafeCastOverflowedUintDowncast(48, value);\\n }\\n return uint48(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint40 from uint256, reverting on\\n * overflow (when the input is greater than largest uint40).\\n *\\n * Counterpart to Solidity's `uint40` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 40 bits\\n */\\n function toUint40(uint256 value) internal pure returns (uint40) {\\n if (value > type(uint40).max) {\\n revert SafeCastOverflowedUintDowncast(40, value);\\n }\\n return uint40(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint32 from uint256, reverting on\\n * overflow (when the input is greater than largest uint32).\\n *\\n * Counterpart to Solidity's `uint32` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 32 bits\\n */\\n function toUint32(uint256 value) internal pure returns (uint32) {\\n if (value > type(uint32).max) {\\n revert SafeCastOverflowedUintDowncast(32, value);\\n }\\n return uint32(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint24 from uint256, reverting on\\n * overflow (when the input is greater than largest uint24).\\n *\\n * Counterpart to Solidity's `uint24` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 24 bits\\n */\\n function toUint24(uint256 value) internal pure returns (uint24) {\\n if (value > type(uint24).max) {\\n revert SafeCastOverflowedUintDowncast(24, value);\\n }\\n return uint24(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint16 from uint256, reverting on\\n * overflow (when the input is greater than largest uint16).\\n *\\n * Counterpart to Solidity's `uint16` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 16 bits\\n */\\n function toUint16(uint256 value) internal pure returns (uint16) {\\n if (value > type(uint16).max) {\\n revert SafeCastOverflowedUintDowncast(16, value);\\n }\\n return uint16(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint8 from uint256, reverting on\\n * overflow (when the input is greater than largest uint8).\\n *\\n * Counterpart to Solidity's `uint8` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 8 bits\\n */\\n function toUint8(uint256 value) internal pure returns (uint8) {\\n if (value > type(uint8).max) {\\n revert SafeCastOverflowedUintDowncast(8, value);\\n }\\n return uint8(value);\\n }\\n\\n /**\\n * @dev Converts a signed int256 into an unsigned uint256.\\n *\\n * Requirements:\\n *\\n * - input must be greater than or equal to 0.\\n */\\n function toUint256(int256 value) internal pure returns (uint256) {\\n if (value < 0) {\\n revert SafeCastOverflowedIntToUint(value);\\n }\\n return uint256(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted int248 from int256, reverting on\\n * overflow (when the input is less than smallest int248 or\\n * greater than largest int248).\\n *\\n * Counterpart to Solidity's `int248` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 248 bits\\n */\\n function toInt248(int256 value) internal pure returns (int248 downcasted) {\\n downcasted = int248(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(248, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int240 from int256, reverting on\\n * overflow (when the input is less than smallest int240 or\\n * greater than largest int240).\\n *\\n * Counterpart to Solidity's `int240` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 240 bits\\n */\\n function toInt240(int256 value) internal pure returns (int240 downcasted) {\\n downcasted = int240(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(240, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int232 from int256, reverting on\\n * overflow (when the input is less than smallest int232 or\\n * greater than largest int232).\\n *\\n * Counterpart to Solidity's `int232` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 232 bits\\n */\\n function toInt232(int256 value) internal pure returns (int232 downcasted) {\\n downcasted = int232(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(232, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int224 from int256, reverting on\\n * overflow (when the input is less than smallest int224 or\\n * greater than largest int224).\\n *\\n * Counterpart to Solidity's `int224` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 224 bits\\n */\\n function toInt224(int256 value) internal pure returns (int224 downcasted) {\\n downcasted = int224(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(224, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int216 from int256, reverting on\\n * overflow (when the input is less than smallest int216 or\\n * greater than largest int216).\\n *\\n * Counterpart to Solidity's `int216` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 216 bits\\n */\\n function toInt216(int256 value) internal pure returns (int216 downcasted) {\\n downcasted = int216(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(216, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int208 from int256, reverting on\\n * overflow (when the input is less than smallest int208 or\\n * greater than largest int208).\\n *\\n * Counterpart to Solidity's `int208` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 208 bits\\n */\\n function toInt208(int256 value) internal pure returns (int208 downcasted) {\\n downcasted = int208(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(208, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int200 from int256, reverting on\\n * overflow (when the input is less than smallest int200 or\\n * greater than largest int200).\\n *\\n * Counterpart to Solidity's `int200` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 200 bits\\n */\\n function toInt200(int256 value) internal pure returns (int200 downcasted) {\\n downcasted = int200(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(200, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int192 from int256, reverting on\\n * overflow (when the input is less than smallest int192 or\\n * greater than largest int192).\\n *\\n * Counterpart to Solidity's `int192` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 192 bits\\n */\\n function toInt192(int256 value) internal pure returns (int192 downcasted) {\\n downcasted = int192(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(192, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int184 from int256, reverting on\\n * overflow (when the input is less than smallest int184 or\\n * greater than largest int184).\\n *\\n * Counterpart to Solidity's `int184` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 184 bits\\n */\\n function toInt184(int256 value) internal pure returns (int184 downcasted) {\\n downcasted = int184(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(184, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int176 from int256, reverting on\\n * overflow (when the input is less than smallest int176 or\\n * greater than largest int176).\\n *\\n * Counterpart to Solidity's `int176` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 176 bits\\n */\\n function toInt176(int256 value) internal pure returns (int176 downcasted) {\\n downcasted = int176(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(176, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int168 from int256, reverting on\\n * overflow (when the input is less than smallest int168 or\\n * greater than largest int168).\\n *\\n * Counterpart to Solidity's `int168` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 168 bits\\n */\\n function toInt168(int256 value) internal pure returns (int168 downcasted) {\\n downcasted = int168(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(168, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int160 from int256, reverting on\\n * overflow (when the input is less than smallest int160 or\\n * greater than largest int160).\\n *\\n * Counterpart to Solidity's `int160` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 160 bits\\n */\\n function toInt160(int256 value) internal pure returns (int160 downcasted) {\\n downcasted = int160(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(160, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int152 from int256, reverting on\\n * overflow (when the input is less than smallest int152 or\\n * greater than largest int152).\\n *\\n * Counterpart to Solidity's `int152` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 152 bits\\n */\\n function toInt152(int256 value) internal pure returns (int152 downcasted) {\\n downcasted = int152(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(152, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int144 from int256, reverting on\\n * overflow (when the input is less than smallest int144 or\\n * greater than largest int144).\\n *\\n * Counterpart to Solidity's `int144` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 144 bits\\n */\\n function toInt144(int256 value) internal pure returns (int144 downcasted) {\\n downcasted = int144(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(144, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int136 from int256, reverting on\\n * overflow (when the input is less than smallest int136 or\\n * greater than largest int136).\\n *\\n * Counterpart to Solidity's `int136` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 136 bits\\n */\\n function toInt136(int256 value) internal pure returns (int136 downcasted) {\\n downcasted = int136(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(136, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int128 from int256, reverting on\\n * overflow (when the input is less than smallest int128 or\\n * greater than largest int128).\\n *\\n * Counterpart to Solidity's `int128` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 128 bits\\n */\\n function toInt128(int256 value) internal pure returns (int128 downcasted) {\\n downcasted = int128(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(128, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int120 from int256, reverting on\\n * overflow (when the input is less than smallest int120 or\\n * greater than largest int120).\\n *\\n * Counterpart to Solidity's `int120` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 120 bits\\n */\\n function toInt120(int256 value) internal pure returns (int120 downcasted) {\\n downcasted = int120(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(120, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int112 from int256, reverting on\\n * overflow (when the input is less than smallest int112 or\\n * greater than largest int112).\\n *\\n * Counterpart to Solidity's `int112` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 112 bits\\n */\\n function toInt112(int256 value) internal pure returns (int112 downcasted) {\\n downcasted = int112(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(112, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int104 from int256, reverting on\\n * overflow (when the input is less than smallest int104 or\\n * greater than largest int104).\\n *\\n * Counterpart to Solidity's `int104` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 104 bits\\n */\\n function toInt104(int256 value) internal pure returns (int104 downcasted) {\\n downcasted = int104(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(104, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int96 from int256, reverting on\\n * overflow (when the input is less than smallest int96 or\\n * greater than largest int96).\\n *\\n * Counterpart to Solidity's `int96` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 96 bits\\n */\\n function toInt96(int256 value) internal pure returns (int96 downcasted) {\\n downcasted = int96(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(96, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int88 from int256, reverting on\\n * overflow (when the input is less than smallest int88 or\\n * greater than largest int88).\\n *\\n * Counterpart to Solidity's `int88` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 88 bits\\n */\\n function toInt88(int256 value) internal pure returns (int88 downcasted) {\\n downcasted = int88(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(88, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int80 from int256, reverting on\\n * overflow (when the input is less than smallest int80 or\\n * greater than largest int80).\\n *\\n * Counterpart to Solidity's `int80` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 80 bits\\n */\\n function toInt80(int256 value) internal pure returns (int80 downcasted) {\\n downcasted = int80(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(80, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int72 from int256, reverting on\\n * overflow (when the input is less than smallest int72 or\\n * greater than largest int72).\\n *\\n * Counterpart to Solidity's `int72` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 72 bits\\n */\\n function toInt72(int256 value) internal pure returns (int72 downcasted) {\\n downcasted = int72(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(72, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int64 from int256, reverting on\\n * overflow (when the input is less than smallest int64 or\\n * greater than largest int64).\\n *\\n * Counterpart to Solidity's `int64` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 64 bits\\n */\\n function toInt64(int256 value) internal pure returns (int64 downcasted) {\\n downcasted = int64(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(64, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int56 from int256, reverting on\\n * overflow (when the input is less than smallest int56 or\\n * greater than largest int56).\\n *\\n * Counterpart to Solidity's `int56` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 56 bits\\n */\\n function toInt56(int256 value) internal pure returns (int56 downcasted) {\\n downcasted = int56(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(56, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int48 from int256, reverting on\\n * overflow (when the input is less than smallest int48 or\\n * greater than largest int48).\\n *\\n * Counterpart to Solidity's `int48` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 48 bits\\n */\\n function toInt48(int256 value) internal pure returns (int48 downcasted) {\\n downcasted = int48(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(48, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int40 from int256, reverting on\\n * overflow (when the input is less than smallest int40 or\\n * greater than largest int40).\\n *\\n * Counterpart to Solidity's `int40` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 40 bits\\n */\\n function toInt40(int256 value) internal pure returns (int40 downcasted) {\\n downcasted = int40(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(40, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int32 from int256, reverting on\\n * overflow (when the input is less than smallest int32 or\\n * greater than largest int32).\\n *\\n * Counterpart to Solidity's `int32` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 32 bits\\n */\\n function toInt32(int256 value) internal pure returns (int32 downcasted) {\\n downcasted = int32(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(32, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int24 from int256, reverting on\\n * overflow (when the input is less than smallest int24 or\\n * greater than largest int24).\\n *\\n * Counterpart to Solidity's `int24` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 24 bits\\n */\\n function toInt24(int256 value) internal pure returns (int24 downcasted) {\\n downcasted = int24(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(24, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int16 from int256, reverting on\\n * overflow (when the input is less than smallest int16 or\\n * greater than largest int16).\\n *\\n * Counterpart to Solidity's `int16` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 16 bits\\n */\\n function toInt16(int256 value) internal pure returns (int16 downcasted) {\\n downcasted = int16(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(16, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int8 from int256, reverting on\\n * overflow (when the input is less than smallest int8 or\\n * greater than largest int8).\\n *\\n * Counterpart to Solidity's `int8` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 8 bits\\n */\\n function toInt8(int256 value) internal pure returns (int8 downcasted) {\\n downcasted = int8(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(8, value);\\n }\\n }\\n\\n /**\\n * @dev Converts an unsigned uint256 into a signed int256.\\n *\\n * Requirements:\\n *\\n * - input must be less than or equal to maxInt256.\\n */\\n function toInt256(uint256 value) internal pure returns (int256) {\\n // Note: Unsafe cast below is okay because `type(int256).max` is guaranteed to be positive\\n if (value > uint256(type(int256).max)) {\\n revert SafeCastOverflowedUintToInt(value);\\n }\\n return int256(value);\\n }\\n\\n /**\\n * @dev Cast a boolean (false or true) to a uint256 (0 or 1) with no jump.\\n */\\n function toUint(bool b) internal pure returns (uint256 u) {\\n assembly (\\\"memory-safe\\\") {\\n u := iszero(iszero(b))\\n }\\n }\\n}\\n\",\"keccak256\":\"0x195533c86d0ef72bcc06456a4f66a9b941f38eb403739b00f21fd7c1abd1ae54\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/math/SignedMath.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/math/SignedMath.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {SafeCast} from \\\"./SafeCast.sol\\\";\\n\\n/**\\n * @dev Standard signed math utilities missing in the Solidity language.\\n */\\nlibrary SignedMath {\\n /**\\n * @dev Branchless ternary evaluation for `a ? b : c`. Gas costs are constant.\\n *\\n * IMPORTANT: This function may reduce bytecode size and consume less gas when used standalone.\\n * However, the compiler may optimize Solidity ternary operations (i.e. `a ? b : c`) to only compute\\n * one branch when needed, making this function more expensive.\\n */\\n function ternary(bool condition, int256 a, int256 b) internal pure returns (int256) {\\n unchecked {\\n // branchless ternary works because:\\n // b ^ (a ^ b) == a\\n // b ^ 0 == b\\n return b ^ ((a ^ b) * int256(SafeCast.toUint(condition)));\\n }\\n }\\n\\n /**\\n * @dev Returns the largest of two signed numbers.\\n */\\n function max(int256 a, int256 b) internal pure returns (int256) {\\n return ternary(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 ternary(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 // Formula from the \\\"Bit Twiddling Hacks\\\" by Sean Eron Anderson.\\n // Since `n` is a signed integer, the generated bytecode will use the SAR opcode to perform the right shift,\\n // taking advantage of the most significant (or \\\"sign\\\" bit) in two's complement representation.\\n // This opcode adds new most significant bits set to the value of the previous most significant bit. As a result,\\n // the mask will either be `bytes32(0)` (if n is positive) or `~bytes32(0)` (if n is negative).\\n int256 mask = n >> 255;\\n\\n // A `bytes32(0)` mask leaves the input unchanged, while a `~bytes32(0)` mask complements it.\\n return uint256((n + mask) ^ mask);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xb1970fac7b64e6c09611e6691791e848d5e3fe410fa5899e7df2e0afd77a99e3\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/structs/Checkpoints.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/structs/Checkpoints.sol)\\n// This file was procedurally generated from scripts/generate/templates/Checkpoints.js.\\n\\npragma solidity ^0.8.20;\\n\\nimport {Math} from \\\"../math/Math.sol\\\";\\n\\n/**\\n * @dev This library defines the `Trace*` struct, for checkpointing values as they change at different points in\\n * time, and later looking up past values by block number. See {Votes} as an example.\\n *\\n * To create a history of checkpoints define a variable type `Checkpoints.Trace*` in your contract, and store a new\\n * checkpoint for the current transaction block using the {push} function.\\n */\\nlibrary Checkpoints {\\n /**\\n * @dev A value was attempted to be inserted on a past checkpoint.\\n */\\n error CheckpointUnorderedInsertion();\\n\\n struct Trace224 {\\n Checkpoint224[] _checkpoints;\\n }\\n\\n struct Checkpoint224 {\\n uint32 _key;\\n uint224 _value;\\n }\\n\\n /**\\n * @dev Pushes a (`key`, `value`) pair into a Trace224 so that it is stored as the checkpoint.\\n *\\n * Returns previous value and new value.\\n *\\n * IMPORTANT: Never accept `key` as a user input, since an arbitrary `type(uint32).max` key set will disable the\\n * library.\\n */\\n function push(\\n Trace224 storage self,\\n uint32 key,\\n uint224 value\\n ) internal returns (uint224 oldValue, uint224 newValue) {\\n return _insert(self._checkpoints, key, value);\\n }\\n\\n /**\\n * @dev Returns the value in the first (oldest) checkpoint with key greater or equal than the search key, or zero if\\n * there is none.\\n */\\n function lowerLookup(Trace224 storage self, uint32 key) internal view returns (uint224) {\\n uint256 len = self._checkpoints.length;\\n uint256 pos = _lowerBinaryLookup(self._checkpoints, key, 0, len);\\n return pos == len ? 0 : _unsafeAccess(self._checkpoints, pos)._value;\\n }\\n\\n /**\\n * @dev Returns the value in the last (most recent) checkpoint with key lower or equal than the search key, or zero\\n * if there is none.\\n */\\n function upperLookup(Trace224 storage self, uint32 key) internal view returns (uint224) {\\n uint256 len = self._checkpoints.length;\\n uint256 pos = _upperBinaryLookup(self._checkpoints, key, 0, len);\\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\\n }\\n\\n /**\\n * @dev Returns the value in the last (most recent) checkpoint with key lower or equal than the search key, or zero\\n * if there is none.\\n *\\n * NOTE: This is a variant of {upperLookup} that is optimised to find \\\"recent\\\" checkpoint (checkpoints with high\\n * keys).\\n */\\n function upperLookupRecent(Trace224 storage self, uint32 key) internal view returns (uint224) {\\n uint256 len = self._checkpoints.length;\\n\\n uint256 low = 0;\\n uint256 high = len;\\n\\n if (len > 5) {\\n uint256 mid = len - Math.sqrt(len);\\n if (key < _unsafeAccess(self._checkpoints, mid)._key) {\\n high = mid;\\n } else {\\n low = mid + 1;\\n }\\n }\\n\\n uint256 pos = _upperBinaryLookup(self._checkpoints, key, low, high);\\n\\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\\n }\\n\\n /**\\n * @dev Returns the value in the most recent checkpoint, or zero if there are no checkpoints.\\n */\\n function latest(Trace224 storage self) internal view returns (uint224) {\\n uint256 pos = self._checkpoints.length;\\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\\n }\\n\\n /**\\n * @dev Returns whether there is a checkpoint in the structure (i.e. it is not empty), and if so the key and value\\n * in the most recent checkpoint.\\n */\\n function latestCheckpoint(Trace224 storage self) internal view returns (bool exists, uint32 _key, uint224 _value) {\\n uint256 pos = self._checkpoints.length;\\n if (pos == 0) {\\n return (false, 0, 0);\\n } else {\\n Checkpoint224 storage ckpt = _unsafeAccess(self._checkpoints, pos - 1);\\n return (true, ckpt._key, ckpt._value);\\n }\\n }\\n\\n /**\\n * @dev Returns the number of checkpoint.\\n */\\n function length(Trace224 storage self) internal view returns (uint256) {\\n return self._checkpoints.length;\\n }\\n\\n /**\\n * @dev Returns checkpoint at given position.\\n */\\n function at(Trace224 storage self, uint32 pos) internal view returns (Checkpoint224 memory) {\\n return self._checkpoints[pos];\\n }\\n\\n /**\\n * @dev Pushes a (`key`, `value`) pair into an ordered list of checkpoints, either by inserting a new checkpoint,\\n * or by updating the last one.\\n */\\n function _insert(\\n Checkpoint224[] storage self,\\n uint32 key,\\n uint224 value\\n ) private returns (uint224 oldValue, uint224 newValue) {\\n uint256 pos = self.length;\\n\\n if (pos > 0) {\\n Checkpoint224 storage last = _unsafeAccess(self, pos - 1);\\n uint32 lastKey = last._key;\\n uint224 lastValue = last._value;\\n\\n // Checkpoint keys must be non-decreasing.\\n if (lastKey > key) {\\n revert CheckpointUnorderedInsertion();\\n }\\n\\n // Update or push new checkpoint\\n if (lastKey == key) {\\n last._value = value;\\n } else {\\n self.push(Checkpoint224({_key: key, _value: value}));\\n }\\n return (lastValue, value);\\n } else {\\n self.push(Checkpoint224({_key: key, _value: value}));\\n return (0, value);\\n }\\n }\\n\\n /**\\n * @dev Return the index of the first (oldest) checkpoint with key strictly bigger than the search key, or `high`\\n * if there is none. `low` and `high` define a section where to do the search, with inclusive `low` and exclusive\\n * `high`.\\n *\\n * WARNING: `high` should not be greater than the array's length.\\n */\\n function _upperBinaryLookup(\\n Checkpoint224[] storage self,\\n uint32 key,\\n uint256 low,\\n uint256 high\\n ) private view returns (uint256) {\\n while (low < high) {\\n uint256 mid = Math.average(low, high);\\n if (_unsafeAccess(self, mid)._key > key) {\\n high = mid;\\n } else {\\n low = mid + 1;\\n }\\n }\\n return high;\\n }\\n\\n /**\\n * @dev Return the index of the first (oldest) checkpoint with key greater or equal than the search key, or `high`\\n * if there is none. `low` and `high` define a section where to do the search, with inclusive `low` and exclusive\\n * `high`.\\n *\\n * WARNING: `high` should not be greater than the array's length.\\n */\\n function _lowerBinaryLookup(\\n Checkpoint224[] storage self,\\n uint32 key,\\n uint256 low,\\n uint256 high\\n ) private view returns (uint256) {\\n while (low < high) {\\n uint256 mid = Math.average(low, high);\\n if (_unsafeAccess(self, mid)._key < key) {\\n low = mid + 1;\\n } else {\\n high = mid;\\n }\\n }\\n return high;\\n }\\n\\n /**\\n * @dev Access an element of the array without performing bounds check. The position is assumed to be within bounds.\\n */\\n function _unsafeAccess(\\n Checkpoint224[] storage self,\\n uint256 pos\\n ) private pure returns (Checkpoint224 storage result) {\\n assembly {\\n mstore(0, self.slot)\\n result.slot := add(keccak256(0, 0x20), pos)\\n }\\n }\\n\\n struct Trace208 {\\n Checkpoint208[] _checkpoints;\\n }\\n\\n struct Checkpoint208 {\\n uint48 _key;\\n uint208 _value;\\n }\\n\\n /**\\n * @dev Pushes a (`key`, `value`) pair into a Trace208 so that it is stored as the checkpoint.\\n *\\n * Returns previous value and new value.\\n *\\n * IMPORTANT: Never accept `key` as a user input, since an arbitrary `type(uint48).max` key set will disable the\\n * library.\\n */\\n function push(\\n Trace208 storage self,\\n uint48 key,\\n uint208 value\\n ) internal returns (uint208 oldValue, uint208 newValue) {\\n return _insert(self._checkpoints, key, value);\\n }\\n\\n /**\\n * @dev Returns the value in the first (oldest) checkpoint with key greater or equal than the search key, or zero if\\n * there is none.\\n */\\n function lowerLookup(Trace208 storage self, uint48 key) internal view returns (uint208) {\\n uint256 len = self._checkpoints.length;\\n uint256 pos = _lowerBinaryLookup(self._checkpoints, key, 0, len);\\n return pos == len ? 0 : _unsafeAccess(self._checkpoints, pos)._value;\\n }\\n\\n /**\\n * @dev Returns the value in the last (most recent) checkpoint with key lower or equal than the search key, or zero\\n * if there is none.\\n */\\n function upperLookup(Trace208 storage self, uint48 key) internal view returns (uint208) {\\n uint256 len = self._checkpoints.length;\\n uint256 pos = _upperBinaryLookup(self._checkpoints, key, 0, len);\\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\\n }\\n\\n /**\\n * @dev Returns the value in the last (most recent) checkpoint with key lower or equal than the search key, or zero\\n * if there is none.\\n *\\n * NOTE: This is a variant of {upperLookup} that is optimised to find \\\"recent\\\" checkpoint (checkpoints with high\\n * keys).\\n */\\n function upperLookupRecent(Trace208 storage self, uint48 key) internal view returns (uint208) {\\n uint256 len = self._checkpoints.length;\\n\\n uint256 low = 0;\\n uint256 high = len;\\n\\n if (len > 5) {\\n uint256 mid = len - Math.sqrt(len);\\n if (key < _unsafeAccess(self._checkpoints, mid)._key) {\\n high = mid;\\n } else {\\n low = mid + 1;\\n }\\n }\\n\\n uint256 pos = _upperBinaryLookup(self._checkpoints, key, low, high);\\n\\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\\n }\\n\\n /**\\n * @dev Returns the value in the most recent checkpoint, or zero if there are no checkpoints.\\n */\\n function latest(Trace208 storage self) internal view returns (uint208) {\\n uint256 pos = self._checkpoints.length;\\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\\n }\\n\\n /**\\n * @dev Returns whether there is a checkpoint in the structure (i.e. it is not empty), and if so the key and value\\n * in the most recent checkpoint.\\n */\\n function latestCheckpoint(Trace208 storage self) internal view returns (bool exists, uint48 _key, uint208 _value) {\\n uint256 pos = self._checkpoints.length;\\n if (pos == 0) {\\n return (false, 0, 0);\\n } else {\\n Checkpoint208 storage ckpt = _unsafeAccess(self._checkpoints, pos - 1);\\n return (true, ckpt._key, ckpt._value);\\n }\\n }\\n\\n /**\\n * @dev Returns the number of checkpoint.\\n */\\n function length(Trace208 storage self) internal view returns (uint256) {\\n return self._checkpoints.length;\\n }\\n\\n /**\\n * @dev Returns checkpoint at given position.\\n */\\n function at(Trace208 storage self, uint32 pos) internal view returns (Checkpoint208 memory) {\\n return self._checkpoints[pos];\\n }\\n\\n /**\\n * @dev Pushes a (`key`, `value`) pair into an ordered list of checkpoints, either by inserting a new checkpoint,\\n * or by updating the last one.\\n */\\n function _insert(\\n Checkpoint208[] storage self,\\n uint48 key,\\n uint208 value\\n ) private returns (uint208 oldValue, uint208 newValue) {\\n uint256 pos = self.length;\\n\\n if (pos > 0) {\\n Checkpoint208 storage last = _unsafeAccess(self, pos - 1);\\n uint48 lastKey = last._key;\\n uint208 lastValue = last._value;\\n\\n // Checkpoint keys must be non-decreasing.\\n if (lastKey > key) {\\n revert CheckpointUnorderedInsertion();\\n }\\n\\n // Update or push new checkpoint\\n if (lastKey == key) {\\n last._value = value;\\n } else {\\n self.push(Checkpoint208({_key: key, _value: value}));\\n }\\n return (lastValue, value);\\n } else {\\n self.push(Checkpoint208({_key: key, _value: value}));\\n return (0, value);\\n }\\n }\\n\\n /**\\n * @dev Return the index of the first (oldest) checkpoint with key strictly bigger than the search key, or `high`\\n * if there is none. `low` and `high` define a section where to do the search, with inclusive `low` and exclusive\\n * `high`.\\n *\\n * WARNING: `high` should not be greater than the array's length.\\n */\\n function _upperBinaryLookup(\\n Checkpoint208[] storage self,\\n uint48 key,\\n uint256 low,\\n uint256 high\\n ) private view returns (uint256) {\\n while (low < high) {\\n uint256 mid = Math.average(low, high);\\n if (_unsafeAccess(self, mid)._key > key) {\\n high = mid;\\n } else {\\n low = mid + 1;\\n }\\n }\\n return high;\\n }\\n\\n /**\\n * @dev Return the index of the first (oldest) checkpoint with key greater or equal than the search key, or `high`\\n * if there is none. `low` and `high` define a section where to do the search, with inclusive `low` and exclusive\\n * `high`.\\n *\\n * WARNING: `high` should not be greater than the array's length.\\n */\\n function _lowerBinaryLookup(\\n Checkpoint208[] storage self,\\n uint48 key,\\n uint256 low,\\n uint256 high\\n ) private view returns (uint256) {\\n while (low < high) {\\n uint256 mid = Math.average(low, high);\\n if (_unsafeAccess(self, mid)._key < key) {\\n low = mid + 1;\\n } else {\\n high = mid;\\n }\\n }\\n return high;\\n }\\n\\n /**\\n * @dev Access an element of the array without performing bounds check. The position is assumed to be within bounds.\\n */\\n function _unsafeAccess(\\n Checkpoint208[] storage self,\\n uint256 pos\\n ) private pure returns (Checkpoint208 storage result) {\\n assembly {\\n mstore(0, self.slot)\\n result.slot := add(keccak256(0, 0x20), pos)\\n }\\n }\\n\\n struct Trace160 {\\n Checkpoint160[] _checkpoints;\\n }\\n\\n struct Checkpoint160 {\\n uint96 _key;\\n uint160 _value;\\n }\\n\\n /**\\n * @dev Pushes a (`key`, `value`) pair into a Trace160 so that it is stored as the checkpoint.\\n *\\n * Returns previous value and new value.\\n *\\n * IMPORTANT: Never accept `key` as a user input, since an arbitrary `type(uint96).max` key set will disable the\\n * library.\\n */\\n function push(\\n Trace160 storage self,\\n uint96 key,\\n uint160 value\\n ) internal returns (uint160 oldValue, uint160 newValue) {\\n return _insert(self._checkpoints, key, value);\\n }\\n\\n /**\\n * @dev Returns the value in the first (oldest) checkpoint with key greater or equal than the search key, or zero if\\n * there is none.\\n */\\n function lowerLookup(Trace160 storage self, uint96 key) internal view returns (uint160) {\\n uint256 len = self._checkpoints.length;\\n uint256 pos = _lowerBinaryLookup(self._checkpoints, key, 0, len);\\n return pos == len ? 0 : _unsafeAccess(self._checkpoints, pos)._value;\\n }\\n\\n /**\\n * @dev Returns the value in the last (most recent) checkpoint with key lower or equal than the search key, or zero\\n * if there is none.\\n */\\n function upperLookup(Trace160 storage self, uint96 key) internal view returns (uint160) {\\n uint256 len = self._checkpoints.length;\\n uint256 pos = _upperBinaryLookup(self._checkpoints, key, 0, len);\\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\\n }\\n\\n /**\\n * @dev Returns the value in the last (most recent) checkpoint with key lower or equal than the search key, or zero\\n * if there is none.\\n *\\n * NOTE: This is a variant of {upperLookup} that is optimised to find \\\"recent\\\" checkpoint (checkpoints with high\\n * keys).\\n */\\n function upperLookupRecent(Trace160 storage self, uint96 key) internal view returns (uint160) {\\n uint256 len = self._checkpoints.length;\\n\\n uint256 low = 0;\\n uint256 high = len;\\n\\n if (len > 5) {\\n uint256 mid = len - Math.sqrt(len);\\n if (key < _unsafeAccess(self._checkpoints, mid)._key) {\\n high = mid;\\n } else {\\n low = mid + 1;\\n }\\n }\\n\\n uint256 pos = _upperBinaryLookup(self._checkpoints, key, low, high);\\n\\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\\n }\\n\\n /**\\n * @dev Returns the value in the most recent checkpoint, or zero if there are no checkpoints.\\n */\\n function latest(Trace160 storage self) internal view returns (uint160) {\\n uint256 pos = self._checkpoints.length;\\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\\n }\\n\\n /**\\n * @dev Returns whether there is a checkpoint in the structure (i.e. it is not empty), and if so the key and value\\n * in the most recent checkpoint.\\n */\\n function latestCheckpoint(Trace160 storage self) internal view returns (bool exists, uint96 _key, uint160 _value) {\\n uint256 pos = self._checkpoints.length;\\n if (pos == 0) {\\n return (false, 0, 0);\\n } else {\\n Checkpoint160 storage ckpt = _unsafeAccess(self._checkpoints, pos - 1);\\n return (true, ckpt._key, ckpt._value);\\n }\\n }\\n\\n /**\\n * @dev Returns the number of checkpoint.\\n */\\n function length(Trace160 storage self) internal view returns (uint256) {\\n return self._checkpoints.length;\\n }\\n\\n /**\\n * @dev Returns checkpoint at given position.\\n */\\n function at(Trace160 storage self, uint32 pos) internal view returns (Checkpoint160 memory) {\\n return self._checkpoints[pos];\\n }\\n\\n /**\\n * @dev Pushes a (`key`, `value`) pair into an ordered list of checkpoints, either by inserting a new checkpoint,\\n * or by updating the last one.\\n */\\n function _insert(\\n Checkpoint160[] storage self,\\n uint96 key,\\n uint160 value\\n ) private returns (uint160 oldValue, uint160 newValue) {\\n uint256 pos = self.length;\\n\\n if (pos > 0) {\\n Checkpoint160 storage last = _unsafeAccess(self, pos - 1);\\n uint96 lastKey = last._key;\\n uint160 lastValue = last._value;\\n\\n // Checkpoint keys must be non-decreasing.\\n if (lastKey > key) {\\n revert CheckpointUnorderedInsertion();\\n }\\n\\n // Update or push new checkpoint\\n if (lastKey == key) {\\n last._value = value;\\n } else {\\n self.push(Checkpoint160({_key: key, _value: value}));\\n }\\n return (lastValue, value);\\n } else {\\n self.push(Checkpoint160({_key: key, _value: value}));\\n return (0, value);\\n }\\n }\\n\\n /**\\n * @dev Return the index of the first (oldest) checkpoint with key strictly bigger than the search key, or `high`\\n * if there is none. `low` and `high` define a section where to do the search, with inclusive `low` and exclusive\\n * `high`.\\n *\\n * WARNING: `high` should not be greater than the array's length.\\n */\\n function _upperBinaryLookup(\\n Checkpoint160[] storage self,\\n uint96 key,\\n uint256 low,\\n uint256 high\\n ) private view returns (uint256) {\\n while (low < high) {\\n uint256 mid = Math.average(low, high);\\n if (_unsafeAccess(self, mid)._key > key) {\\n high = mid;\\n } else {\\n low = mid + 1;\\n }\\n }\\n return high;\\n }\\n\\n /**\\n * @dev Return the index of the first (oldest) checkpoint with key greater or equal than the search key, or `high`\\n * if there is none. `low` and `high` define a section where to do the search, with inclusive `low` and exclusive\\n * `high`.\\n *\\n * WARNING: `high` should not be greater than the array's length.\\n */\\n function _lowerBinaryLookup(\\n Checkpoint160[] storage self,\\n uint96 key,\\n uint256 low,\\n uint256 high\\n ) private view returns (uint256) {\\n while (low < high) {\\n uint256 mid = Math.average(low, high);\\n if (_unsafeAccess(self, mid)._key < key) {\\n low = mid + 1;\\n } else {\\n high = mid;\\n }\\n }\\n return high;\\n }\\n\\n /**\\n * @dev Access an element of the array without performing bounds check. The position is assumed to be within bounds.\\n */\\n function _unsafeAccess(\\n Checkpoint160[] storage self,\\n uint256 pos\\n ) private pure returns (Checkpoint160 storage result) {\\n assembly {\\n mstore(0, self.slot)\\n result.slot := add(keccak256(0, 0x20), pos)\\n }\\n }\\n}\\n\",\"keccak256\":\"0x66364cd3247ea71cdb58f080f5d5ed6732433a8001413139661841535494692f\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/types/Time.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/types/Time.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {Math} from \\\"../math/Math.sol\\\";\\nimport {SafeCast} from \\\"../math/SafeCast.sol\\\";\\n\\n/**\\n * @dev This library provides helpers for manipulating time-related objects.\\n *\\n * It uses the following types:\\n * - `uint48` for timepoints\\n * - `uint32` for durations\\n *\\n * While the library doesn't provide specific types for timepoints and duration, it does provide:\\n * - a `Delay` type to represent duration that can be programmed to change value automatically at a given point\\n * - additional helper functions\\n */\\nlibrary Time {\\n using Time for *;\\n\\n /**\\n * @dev Get the block timestamp as a Timepoint.\\n */\\n function timestamp() internal view returns (uint48) {\\n return SafeCast.toUint48(block.timestamp);\\n }\\n\\n /**\\n * @dev Get the block number as a Timepoint.\\n */\\n function blockNumber() internal view returns (uint48) {\\n return SafeCast.toUint48(block.number);\\n }\\n\\n // ==================================================== Delay =====================================================\\n /**\\n * @dev A `Delay` is a uint32 duration that can be programmed to change value automatically at a given point in the\\n * future. The \\\"effect\\\" timepoint describes when the transitions happens from the \\\"old\\\" value to the \\\"new\\\" value.\\n * This allows updating the delay applied to some operation while keeping some guarantees.\\n *\\n * In particular, the {update} function guarantees that if the delay is reduced, the old delay still applies for\\n * some time. For example if the delay is currently 7 days to do an upgrade, the admin should not be able to set\\n * the delay to 0 and upgrade immediately. If the admin wants to reduce the delay, the old delay (7 days) should\\n * still apply for some time.\\n *\\n *\\n * The `Delay` type is 112 bits long, and packs the following:\\n *\\n * ```\\n * | [uint48]: effect date (timepoint)\\n * | | [uint32]: value before (duration)\\n * \\u2193 \\u2193 \\u2193 [uint32]: value after (duration)\\n * 0xAAAAAAAAAAAABBBBBBBBCCCCCCCC\\n * ```\\n *\\n * NOTE: The {get} and {withUpdate} functions operate using timestamps. Block number based delays are not currently\\n * supported.\\n */\\n type Delay is uint112;\\n\\n /**\\n * @dev Wrap a duration into a Delay to add the one-step \\\"update in the future\\\" feature\\n */\\n function toDelay(uint32 duration) internal pure returns (Delay) {\\n return Delay.wrap(duration);\\n }\\n\\n /**\\n * @dev Get the value at a given timepoint plus the pending value and effect timepoint if there is a scheduled\\n * change after this timepoint. If the effect timepoint is 0, then the pending value should not be considered.\\n */\\n function _getFullAt(\\n Delay self,\\n uint48 timepoint\\n ) private pure returns (uint32 valueBefore, uint32 valueAfter, uint48 effect) {\\n (valueBefore, valueAfter, effect) = self.unpack();\\n return effect <= timepoint ? (valueAfter, 0, 0) : (valueBefore, valueAfter, effect);\\n }\\n\\n /**\\n * @dev Get the current value plus the pending value and effect timepoint if there is a scheduled change. If the\\n * effect timepoint is 0, then the pending value should not be considered.\\n */\\n function getFull(Delay self) internal view returns (uint32 valueBefore, uint32 valueAfter, uint48 effect) {\\n return _getFullAt(self, timestamp());\\n }\\n\\n /**\\n * @dev Get the current value.\\n */\\n function get(Delay self) internal view returns (uint32) {\\n (uint32 delay, , ) = self.getFull();\\n return delay;\\n }\\n\\n /**\\n * @dev Update a Delay object so that it takes a new duration after a timepoint that is automatically computed to\\n * enforce the old delay at the moment of the update. Returns the updated Delay object and the timestamp when the\\n * new delay becomes effective.\\n */\\n function withUpdate(\\n Delay self,\\n uint32 newValue,\\n uint32 minSetback\\n ) internal view returns (Delay updatedDelay, uint48 effect) {\\n uint32 value = self.get();\\n uint32 setback = uint32(Math.max(minSetback, value > newValue ? value - newValue : 0));\\n effect = timestamp() + setback;\\n return (pack(value, newValue, effect), effect);\\n }\\n\\n /**\\n * @dev Split a delay into its components: valueBefore, valueAfter and effect (transition timepoint).\\n */\\n function unpack(Delay self) internal pure returns (uint32 valueBefore, uint32 valueAfter, uint48 effect) {\\n uint112 raw = Delay.unwrap(self);\\n\\n valueAfter = uint32(raw);\\n valueBefore = uint32(raw >> 32);\\n effect = uint48(raw >> 64);\\n\\n return (valueBefore, valueAfter, effect);\\n }\\n\\n /**\\n * @dev pack the components into a Delay object.\\n */\\n function pack(uint32 valueBefore, uint32 valueAfter, uint48 effect) internal pure returns (Delay) {\\n return Delay.wrap((uint112(effect) << 64) | (uint112(valueBefore) << 32) | uint112(valueAfter));\\n }\\n}\\n\",\"keccak256\":\"0x36776530f012618bc7526ceb28e77b85e582cb12d9b9466a71d4bd6bf952e4cc\",\"license\":\"MIT\"},\"contracts/variants/crosschain/NFT.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity ^0.8.20;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC721/ERC721.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC721/extensions/ERC721Burnable.sol\\\";\\nimport \\\"@openzeppelin/contracts/access/Ownable.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/cryptography/EIP712.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC721/extensions/ERC721Votes.sol\\\";\\nimport \\\"./ProofHandler.sol\\\";\\n\\n/**\\n * @title Cross-chain Membership NFT Contract\\n * @author Web3 Hackers Collective\\n * @notice Non-transferable NFT implementation for DAO membership with cross-chain capabilities\\n * @dev Uses ProofHandler library for cross-chain proof management\\n * @custom:security-contact julien@strat.cc\\n */\\ncontract NFT is\\n ERC721,\\n ERC721Enumerable,\\n ERC721URIStorage,\\n ERC721Burnable,\\n Ownable,\\n EIP712,\\n ERC721Votes\\n{\\n using ProofHandler for ProofHandler.ProofStorage;\\n\\n /// @notice Chain ID where contract was originally deployed\\n uint256 public immutable home;\\n\\n /// @notice Next token ID to be minted\\n uint256 private _nextTokenId;\\n\\n /// @notice Storage for proof handling\\n ProofHandler.ProofStorage private _proofStorage;\\n\\n /// @notice Types of operations that can be synchronized across chains\\n enum OperationType {\\n MINT,\\n BURN,\\n SET_METADATA\\n }\\n\\n /// @notice Emitted when a membership is claimed\\n /// @param tokenId The ID of the claimed token\\n /// @param member The address receiving the membership\\n /// @param nonce Operation sequence number\\n event MembershipClaimed(uint256 indexed tokenId, address indexed member, uint256 nonce);\\n\\n /// @notice Emitted when a membership is revoked\\n /// @param tokenId The ID of the revoked token\\n /// @param member The address losing membership\\n /// @param nonce Operation sequence number\\n event MembershipRevoked(uint256 indexed tokenId, address indexed member, uint256 nonce);\\n\\n /// @notice Emitted when metadata is updated\\n /// @param tokenId The ID of the updated token\\n /// @param newUri The new metadata URI\\n /// @param nonce Operation sequence number\\n event MetadataUpdated(uint256 indexed tokenId, string newUri, uint256 nonce);\\n\\n /// @notice Restricts functions to home chain\\n modifier onlyHomeChain() {\\n require(block.chainid == home, \\\"Operation only allowed on home chain\\\");\\n _;\\n }\\n\\n /**\\n * @notice Initializes the NFT contract\\n * @param _home Chain ID where contract is considered home\\n * @param initialOwner Initial contract owner\\n * @param _firstMembers Array of initial member addresses\\n * @param _uri Initial token URI\\n * @param _name Token collection name\\n * @param _symbol Token collection symbol\\n */\\n constructor(\\n uint256 _home,\\n address initialOwner,\\n address[] memory _firstMembers,\\n string memory _uri,\\n string memory _name,\\n string memory _symbol\\n ) ERC721(_name, _symbol) Ownable(initialOwner) EIP712(_name, \\\"1\\\") {\\n home = _home;\\n for (uint i; i < _firstMembers.length; i++) {\\n _govMint(_firstMembers[i], _uri);\\n }\\n }\\n\\n /**\\n * @notice Adds a new member on home chain\\n * @dev Only callable by owner (governance) on home chain\\n * @param to Address to mint token to\\n * @param uri Token metadata URI\\n */\\n function safeMint(address to, string memory uri) public onlyOwner onlyHomeChain {\\n uint256 nonce = _proofStorage.incrementNonce(uint8(OperationType.MINT));\\n _govMint(to, uri);\\n emit MembershipClaimed(_nextTokenId - 1, to, nonce);\\n }\\n\\n /**\\n * @notice Burns token on home chain\\n * @dev Only callable by owner (governance) on home chain\\n * @param tokenId ID of token to burn\\n */\\n function govBurn(uint256 tokenId) public onlyOwner onlyHomeChain {\\n uint256 nonce = _proofStorage.incrementNonce(uint8(OperationType.BURN));\\n address owner = ownerOf(tokenId);\\n _burn(tokenId);\\n emit MembershipRevoked(tokenId, owner, nonce);\\n }\\n\\n /**\\n * @notice Updates token metadata on home chain\\n * @dev Only callable by owner (governance) on home chain\\n * @param tokenId ID of token to update\\n * @param uri New metadata URI\\n */\\n function setMetadata(uint256 tokenId, string memory uri) public onlyOwner onlyHomeChain {\\n uint256 nonce = _proofStorage.incrementNonce(uint8(OperationType.SET_METADATA));\\n _setTokenURI(tokenId, uri);\\n emit MetadataUpdated(tokenId, uri, nonce);\\n }\\n\\n /**\\n * @notice Generates proof for NFT operations\\n * @param operationType Type of operation\\n * @param params Operation parameters\\n * @return Encoded proof data\\n */\\n function generateOperationProof(\\n uint8 operationType,\\n bytes memory params\\n ) external view returns (bytes memory) {\\n require(block.chainid == home, \\\"Proofs only generated on home chain\\\");\\n uint256 nextNonce = _proofStorage.getNextNonce(operationType);\\n return ProofHandler.generateProof(address(this), operationType, params, nextNonce);\\n }\\n\\n /**\\n * @notice Claims an NFT operation on a foreign chain\\n * @param proof Proof generated by home chain\\n */\\n function claimOperation(bytes memory proof) external {\\n (uint8 operationType, bytes memory params, uint256 nonce) = ProofHandler\\n .verifyAndClaimProof(proof, address(this), _proofStorage);\\n\\n if (operationType == uint8(OperationType.MINT)) {\\n (address to, string memory uri) = abi.decode(params, (address, string));\\n _govMint(to, uri);\\n emit MembershipClaimed(_nextTokenId - 1, to, nonce);\\n } else if (operationType == uint8(OperationType.BURN)) {\\n uint256 tokenId = abi.decode(params, (uint256));\\n address owner = ownerOf(tokenId);\\n _burn(tokenId);\\n emit MembershipRevoked(tokenId, owner, nonce);\\n } else if (operationType == uint8(OperationType.SET_METADATA)) {\\n (uint256 tokenId, string memory uri) = abi.decode(params, (uint256, string));\\n _setTokenURI(tokenId, uri);\\n emit MetadataUpdated(tokenId, uri, nonce);\\n }\\n }\\n\\n /**\\n * @notice Internal function for minting without proof verification\\n * @param to Address to receive token\\n * @param uri Token metadata URI\\n */\\n function _govMint(address to, string memory uri) internal {\\n uint256 tokenId = _nextTokenId++;\\n _safeMint(to, tokenId);\\n _setTokenURI(tokenId, uri);\\n }\\n\\n // Required overrides\\n\\n function _update(\\n address to,\\n uint256 tokenId,\\n address auth\\n ) internal override(ERC721, ERC721Enumerable, ERC721Votes) returns (address) {\\n require(auth == address(0) || to == address(0), \\\"NFT is not transferable\\\");\\n return super._update(to, tokenId, auth);\\n }\\n\\n function _increaseBalance(\\n address account,\\n uint128 value\\n ) internal override(ERC721, ERC721Enumerable, ERC721Votes) {\\n super._increaseBalance(account, value);\\n }\\n\\n function tokenURI(\\n uint256 tokenId\\n ) public view override(ERC721, ERC721URIStorage) returns (string memory) {\\n return super.tokenURI(tokenId);\\n }\\n\\n function supportsInterface(\\n bytes4 interfaceId\\n ) public view override(ERC721, ERC721Enumerable, ERC721URIStorage) returns (bool) {\\n return super.supportsInterface(interfaceId);\\n }\\n\\n function clock() public view override returns (uint48) {\\n return uint48(block.timestamp);\\n }\\n\\n function CLOCK_MODE() public pure override returns (string memory) {\\n return \\\"mode=timestamp\\\";\\n }\\n}\\n\",\"keccak256\":\"0xb95201b1f50faa8e4e791b37460dfdf54d2fde419b85e14a6cfad4e410438296\",\"license\":\"GPL-3.0\"},\"contracts/variants/crosschain/ProofHandler.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity ^0.8.20;\\n\\n/**\\n * @title Proof Handler Library\\n * @author Web3 Hackers Collective\\n * @notice Library for standardized cross-chain proof generation and verification\\n * @dev Handles proof generation, verification, and tracking for cross-chain operations\\n * @custom:security-contact julien@strat.cc\\n */\\nlibrary ProofHandler {\\n /// @notice Tracks which proofs have been applied on each chain\\n struct ProofStorage {\\n mapping(bytes32 => bool) updateAppliedOnChain;\\n mapping(uint8 => uint256) currentNonce;\\n }\\n\\n /// @dev Emitted when a proof is claimed\\n event ProofClaimed(uint8 indexed operationType, bytes params, uint256 nonce);\\n\\n /**\\n * @notice Generates a proof for cross-chain operations\\n * @param contractAddress Address of contract generating the proof\\n * @param operationType Type of operation being performed\\n * @param params Operation parameters\\n * @param nonce Current nonce for this operation type\\n * @return proof Encoded proof data\\n */\\n function generateProof(\\n address contractAddress,\\n uint8 operationType,\\n bytes memory params,\\n uint256 nonce\\n ) public pure returns (bytes memory proof) {\\n bytes32 message = keccak256(\\n abi.encodePacked(contractAddress, operationType, params, nonce)\\n );\\n bytes32 digest = keccak256(abi.encodePacked(\\\"\\\\x19Ethereum Signed Message:\\\\n32\\\", message));\\n\\n return abi.encode(operationType, params, nonce, digest);\\n }\\n\\n /**\\n * @notice Verifies and claims a proof\\n * @param proof Proof to verify and claim\\n * @param contractAddress Address of contract claiming the proof\\n * @param storage_ Proof storage struct\\n * @return operationType The type of operation being performed\\n * @return params The operation parameters\\n * @return nonce The operation sequence number\\n */\\n function verifyAndClaimProof(\\n bytes memory proof,\\n address contractAddress,\\n ProofStorage storage storage_\\n ) public returns (uint8 operationType, bytes memory params, uint256 nonce) {\\n bytes32 digest;\\n (operationType, params, nonce, digest) = abi.decode(\\n proof,\\n (uint8, bytes, uint256, bytes32)\\n );\\n\\n bytes32 proofHash = keccak256(proof);\\n require(!storage_.updateAppliedOnChain[proofHash], \\\"Proof already claimed\\\");\\n require(nonce == storage_.currentNonce[operationType] + 1, \\\"Invalid nonce\\\");\\n\\n bytes32 message = keccak256(\\n abi.encodePacked(contractAddress, operationType, params, nonce)\\n );\\n bytes32 expectedDigest = keccak256(\\n abi.encodePacked(\\\"\\\\x19Ethereum Signed Message:\\\\n32\\\", message)\\n );\\n require(digest == expectedDigest, \\\"Invalid proof\\\");\\n\\n storage_.updateAppliedOnChain[proofHash] = true;\\n storage_.currentNonce[operationType] = nonce;\\n\\n emit ProofClaimed(operationType, params, nonce);\\n\\n return (operationType, params, nonce);\\n }\\n\\n /**\\n * @notice Gets the next nonce for an operation type\\n * @param storage_ Proof storage struct\\n * @param operationType Type of operation\\n * @return nonce Next nonce value\\n */\\n function getNextNonce(\\n ProofStorage storage storage_,\\n uint8 operationType\\n ) public view returns (uint256 nonce) {\\n return storage_.currentNonce[operationType] + 1;\\n }\\n\\n /**\\n * @notice Increments the nonce for an operation type\\n * @param storage_ Proof storage struct\\n * @param operationType Type of operation\\n * @return nonce New nonce value\\n */\\n function incrementNonce(\\n ProofStorage storage storage_,\\n uint8 operationType\\n ) public returns (uint256 nonce) {\\n storage_.currentNonce[operationType]++;\\n return storage_.currentNonce[operationType];\\n }\\n}\\n\",\"keccak256\":\"0x3719e47c508f29977d48842c5c1d27cce7cb289cbb592526f170f98135ff41a7\",\"license\":\"GPL-3.0\"}},\"version\":1}", - "bytecode": "0x6101806040523480156200001257600080fd5b5060405162004aa138038062004aa1833981016040819052620000359162001194565b6040805180820190915260018152603160f81b602082015282908682846000620000608382620012ef565b5060016200006f8282620012ef565b5050506001600160a01b038116620000a257604051631e4fbdf760e01b8152600060048201526024015b60405180910390fd5b620000ad81620001c6565b50620000bb82600c62000218565b61012052620000cc81600d62000218565b61014052815160208084019190912060e052815190820120610100524660a0526200015a60e05161010051604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f60208201529081019290925260608201524660808201523060a082015260009060c00160405160208183030381529060405280519060200120905090565b60805250503060c05261016086905260005b8451811015620001b957620001a48582815181106200018f576200018f620013bb565b6020026020010151856200025160201b60201c565b80620001b081620013e7565b9150506200016c565b505050505050506200154f565b600b80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60006020835110156200023857620002308362000287565b90506200024b565b81620002458482620012ef565b5060ff90505b92915050565b60128054600091826200026483620013e7565b909155509050620002768382620002ca565b620002828183620002f0565b505050565b600080829050601f81511115620002b5578260405163305a27a960e01b815260040162000099919062001431565b8051620002c28262001446565b179392505050565b620002ec8282604051806020016040528060008152506200034260201b60201c565b5050565b6000828152600a602052604090206200030a8282620012ef565b506040518281527ff8e1a15aba9398e019f0b49df1a4fde98ee17ae345cb5f6b5e2c27f5033e8ce79060200160405180910390a15050565b6200034e83836200035e565b62000282336000858585620003c8565b6001600160a01b0382166200038a57604051633250574960e11b81526000600482015260240162000099565b60006200039983838362000500565b90506001600160a01b0381161562000282576040516339e3563760e11b81526000600482015260240162000099565b6001600160a01b0383163b15620004f957604051630a85bd0160e11b81526001600160a01b0384169063150b7a02906200040d9088908890879087906004016200146b565b6020604051808303816000875af19250505080156200044b575060408051601f3d908101601f191682019092526200044891810190620014aa565b60015b620004b9573d8080156200047c576040519150601f19603f3d011682016040523d82523d6000602084013e62000481565b606091505b508051600003620004b157604051633250574960e11b81526001600160a01b038516600482015260240162000099565b805181602001fd5b6001600160e01b03198116630a85bd0160e11b14620004f757604051633250574960e11b81526001600160a01b038516600482015260240162000099565b505b5050505050565b60006001600160a01b03821615806200052057506001600160a01b038416155b6200056e5760405162461bcd60e51b815260206004820152601760248201527f4e4654206973206e6f74207472616e7366657261626c65000000000000000000604482015260640162000099565b6200057b84848462000583565b949350505050565b60008062000593858585620005a3565b90506200057b818660016200067f565b600080620005b385858562000717565b90506001600160a01b03811662000613576200060d84600880546000838152600960205260408120829055600182018355919091527ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee30155565b62000639565b846001600160a01b0316816001600160a01b031614620006395762000639818562000816565b6001600160a01b038516620006595762000653846200089a565b6200057b565b846001600160a01b0316816001600160a01b0316146200057b576200057b858562000954565b6001600160a01b038316620006b457620006b1601162001195620009a860201b17620006ab84620009bd565b620009f7565b50505b6001600160a01b038216620006e357620006e06011620011a862000a2b60201b17620006ab84620009bd565b50505b6001600160a01b038381166000908152600f6020526040808220548584168352912054620002829291821691168362000a39565b6000828152600260205260408120546001600160a01b039081169083161562000747576200074781848662000ba0565b6001600160a01b03811615620007875762000766600085818062000c0a565b6001600160a01b038116600090815260036020526040902080546000190190555b6001600160a01b03851615620007b7576001600160a01b0385166000908152600360205260409020805460010190555b60008481526002602052604080822080546001600160a01b0319166001600160a01b0389811691821790925591518793918516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4949350505050565b6000620008238362000d38565b6000838152600760209081526040808320546001600160a01b03881684526006909252909120919250908183146200087b57600083815260208281526040808320548584528184208190558352600790915290208290555b6000938452600760209081526040808620869055938552525081205550565b600854600090620008ae90600190620014d6565b60008381526009602052604081205460088054939450909284908110620008d957620008d9620013bb565b906000526020600020015490508060088381548110620008fd57620008fd620013bb565b6000918252602080832090910192909255828152600990915260408082208490558582528120556008805480620009385762000938620014ec565b6001900381819060005260206000200160009055905550505050565b60006001620009638462000d38565b6200096f9190620014d6565b6001600160a01b039093166000908152600660209081526040808320868452825280832085905593825260079052919091209190915550565b6000620009b6828462001502565b9392505050565b60006001600160d01b03821115620009f3576040516306dfcc6560e41b815260d060048201526024810183905260440162000099565b5090565b60008062000a1e4262000a1562000a0e8862000d82565b868860201c565b87919062000dd1565b915091505b935093915050565b6000620009b682846200152c565b816001600160a01b0316836001600160a01b03161415801562000a5c5750600081115b1562000282576001600160a01b0383161562000aff576001600160a01b03831660009081526010602090815260408220829162000aaa919062000a2b901b620011a817620006ab86620009bd565b6001600160d01b031691506001600160d01b03169150846001600160a01b031660008051602062004a81833981519152838360405162000af4929190918252602082015260400190565b60405180910390a250505b6001600160a01b0382161562000282576001600160a01b03821660009081526010602090815260408220829162000b479190620009a8901b6200119517620006ab86620009bd565b6001600160d01b031691506001600160d01b03169150836001600160a01b031660008051602062004a81833981519152838360405162000b91929190918252602082015260400190565b60405180910390a25050505050565b62000bad83838362000de1565b62000282576001600160a01b03831662000bde57604051637e27328960e01b81526004810182905260240162000099565b60405163177e802f60e01b81526001600160a01b03831660048201526024810182905260440162000099565b808062000c1f57506001600160a01b03821615155b1562000d0857600062000c328462000e67565b90506001600160a01b0383161580159062000c5f5750826001600160a01b0316816001600160a01b031614155b801562000c9257506001600160a01b0380821660009081526005602090815260408083209387168352929052205460ff16155b1562000cbd5760405163a9fbf51f60e01b81526001600160a01b038416600482015260240162000099565b811562000d065783856001600160a01b0316826001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45b505b5050600090815260046020526040902080546001600160a01b0319166001600160a01b0392909216919091179055565b60006001600160a01b03821662000d66576040516322718ad960e21b81526000600482015260240162000099565b506001600160a01b031660009081526003602052604090205490565b8054600090801562000dc85762000dae8362000da0600184620014d6565b600091825260209091200190565b54660100000000000090046001600160d01b0316620009b6565b60009392505050565b60008062000a1e85858562000ea2565b60006001600160a01b038316158015906200057b5750826001600160a01b0316846001600160a01b0316148062000e3d57506001600160a01b0380851660009081526005602090815260408083209387168352929052205460ff165b806200057b5750506000908152600460205260409020546001600160a01b03908116911614919050565b6000818152600260205260408120546001600160a01b0316806200024b57604051637e27328960e01b81526004810184905260240162000099565b82546000908190801562000fac57600062000ec48762000da0600185620014d6565b805490915065ffffffffffff80821691660100000000000090046001600160d01b031690881682111562000f0b57604051632520601d60e01b815260040160405180910390fd5b8765ffffffffffff168265ffffffffffff160362000f4957825465ffffffffffff1666010000000000006001600160d01b0389160217835562000f9d565b6040805180820190915265ffffffffffff808a1682526001600160d01b03808a1660208085019182528d54600181018f5560008f815291909120945191519092166601000000000000029216919091179101555b945085935062000a2392505050565b50506040805180820190915265ffffffffffff80851682526001600160d01b0380851660208085019182528854600181018a5560008a815291822095519251909316660100000000000002919093161792019190915590508162000a23565b80516001600160a01b03811681146200102357600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b038111828210171562001069576200106962001028565b604052919050565b600082601f8301126200108357600080fd5b815160206001600160401b03821115620010a157620010a162001028565b8160051b620010b28282016200103e565b9283528481018201928281019087851115620010cd57600080fd5b83870192505b84831015620010f757620010e7836200100b565b82529183019190830190620010d3565b979650505050505050565b60005b838110156200111f57818101518382015260200162001105565b50506000910152565b600082601f8301126200113a57600080fd5b81516001600160401b0381111562001156576200115662001028565b6200116b601f8201601f19166020016200103e565b8181528460208386010111156200118157600080fd5b6200057b82602083016020870162001102565b60008060008060008060c08789031215620011ae57600080fd5b86519550620011c0602088016200100b565b60408801519095506001600160401b0380821115620011de57600080fd5b620011ec8a838b0162001071565b955060608901519150808211156200120357600080fd5b620012118a838b0162001128565b945060808901519150808211156200122857600080fd5b620012368a838b0162001128565b935060a08901519150808211156200124d57600080fd5b506200125c89828a0162001128565b9150509295509295509295565b600181811c908216806200127e57607f821691505b6020821081036200129f57634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200028257600081815260208120601f850160051c81016020861015620012ce5750805b601f850160051c820191505b81811015620004f757828155600101620012da565b81516001600160401b038111156200130b576200130b62001028565b62001323816200131c845462001269565b84620012a5565b602080601f8311600181146200135b5760008415620013425750858301515b600019600386901b1c1916600185901b178555620004f7565b600085815260208120601f198616915b828110156200138c578886015182559484019460019091019084016200136b565b5085821015620013ab5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060018201620013fc57620013fc620013d1565b5060010190565b600081518084526200141d81602086016020860162001102565b601f01601f19169290920160200192915050565b602081526000620009b6602083018462001403565b805160208083015191908110156200129f5760001960209190910360031b1b16919050565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090620014a09083018462001403565b9695505050505050565b600060208284031215620014bd57600080fd5b81516001600160e01b031981168114620009b657600080fd5b818103818111156200024b576200024b620013d1565b634e487b7160e01b600052603160045260246000fd5b6001600160d01b03818116838216019080821115620015255762001525620013d1565b5092915050565b6001600160d01b03828116828216039080821115620015255762001525620013d1565b60805160a05160c05160e051610100516101205161014051610160516134b0620015d1600039600081816104a3015281816106bf015281816108e701528181610ad00152611019015260006115620152600061153001526000611f5201526000611f2a01526000611e8501526000611eaf01526000611ed901526134b06000f3fe608060405234801561001057600080fd5b506004361061021c5760003560e01c806370a08231116101255780639ab24eb0116100ad578063c3cda5201161007c578063c3cda520146104eb578063c87b56dd146104fe578063d204c45e14610511578063e985e9c514610524578063f2fde38b1461053757600080fd5b80639ab24eb01461048b5780639fa92f9d1461049e578063a22cb465146104c5578063b88d4fde146104d857600080fd5b806384b0196e116100f457806384b0196e1461042e5780638da5cb5b146104495780638e539e8c1461045a57806391ddadf41461046d57806395d89b411461048357600080fd5b806370a08231146103d7578063715018a6146103ea5780637ecebe00146103f257806381b620861461041b57600080fd5b806342842e0e116101a85780634f6ccce7116101775780634f6ccce71461035f578063587cde1e14610372578063593aa2831461039e5780635c19a95c146103b15780636352211e146103c457600080fd5b806342842e0e146102fc57806342966c681461030f578063482ffa5e146103225780634bf5d7e91461033557600080fd5b806318160ddd116101ef57806318160ddd1461029e57806323b872dd146102b057806326926d46146102c35780632f745c59146102d65780633a46b1a8146102e957600080fd5b806301ffc9a71461022157806306fdde0314610249578063081812fc1461025e578063095ea7b314610289575b600080fd5b61023461022f366004612aba565b61054a565b60405190151581526020015b60405180910390f35b61025161055b565b6040516102409190612b27565b61027161026c366004612b3a565b6105ed565b6040516001600160a01b039091168152602001610240565b61029c610297366004612b68565b610616565b005b6008545b604051908152602001610240565b61029c6102be366004612b94565b610625565b61029c6102d1366004612b3a565b6106b5565b6102a26102e4366004612b68565b6107db565b6102a26102f7366004612b68565b610840565b61029c61030a366004612b94565b6108b7565b61029c61031d366004612b3a565b6108d7565b610251610330366004612ca9565b6108e3565b60408051808201909152600e81526d06d6f64653d74696d657374616d760941b6020820152610251565b6102a261036d366004612b3a565b610a6d565b610271610380366004612cf9565b6001600160a01b039081166000908152600f60205260409020541690565b61029c6103ac366004612d16565b610ac6565b61029c6103bf366004612cf9565b610bd6565b6102716103d2366004612b3a565b610be1565b6102a26103e5366004612cf9565b610bec565b61029c610c34565b6102a2610400366004612cf9565b6001600160a01b03166000908152600e602052604090205490565b61029c610429366004612d47565b610c48565b610436610e3f565b6040516102409796959493929190612d7c565b600b546001600160a01b0316610271565b6102a2610468366004612b3a565b610e85565b60405165ffffffffffff42168152602001610240565b610251610ee5565b6102a2610499366004612cf9565b610ef4565b6102a27f000000000000000000000000000000000000000000000000000000000000000081565b61029c6104d3366004612e12565b610f24565b61029c6104e6366004612e50565b610f2f565b61029c6104f9366004612ebc565b610f47565b61025161050c366004612b3a565b611004565b61029c61051f366004612f18565b61100f565b610234610532366004612f36565b611129565b61029c610545366004612cf9565b611157565b6000610555826111b4565b92915050565b60606000805461056a90612f64565b80601f016020809104026020016040519081016040528092919081815260200182805461059690612f64565b80156105e35780601f106105b8576101008083540402835291602001916105e3565b820191906000526020600020905b8154815290600101906020018083116105c657829003601f168201915b5050505050905090565b60006105f8826111d9565b506000828152600460205260409020546001600160a01b0316610555565b610621828233611212565b5050565b6001600160a01b03821661065457604051633250574960e11b8152600060048201526024015b60405180910390fd5b600061066183833361121f565b9050836001600160a01b0316816001600160a01b0316146106af576040516364283d7b60e01b81526001600160a01b038086166004830152602482018490528216604482015260640161064b565b50505050565b6106bd611295565b7f000000000000000000000000000000000000000000000000000000000000000046146106fc5760405162461bcd60e51b815260040161064b90612f9e565b604051633b0d4dd760e01b81526013600482015260016024820152600090730152ee45780385dACCCCB128D816031CfFe5F36B90633b0d4dd790604401602060405180830381865af4158015610756573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061077a9190612ff8565b9050600061078783610be1565b9050610792836112c2565b806001600160a01b0316837f81c00ee14a307a39bcddd8f17801cf3101f1c49c8dea9ee90ec0c04a61b5a007846040516107ce91815260200190565b60405180910390a3505050565b60006107e683610bec565b82106108175760405163295f44f760e21b81526001600160a01b03841660048201526024810183905260440161064b565b506001600160a01b03919091166000908152600660209081526040808320938352929052205490565b60004265ffffffffffff8116831061087c57604051637669fc0f60e11b81526004810184905265ffffffffffff8216602482015260440161064b565b6108a6610888846112fd565b6001600160a01b038616600090815260106020526040902090611334565b6001600160d01b0316949350505050565b6108d283838360405180602001604052806000815250610f2f565b505050565b6106216000823361121f565b60607f000000000000000000000000000000000000000000000000000000000000000046146109605760405162461bcd60e51b815260206004820152602360248201527f50726f6f6673206f6e6c792067656e657261746564206f6e20686f6d6520636860448201526230b4b760e91b606482015260840161064b565b604051630564edeb60e31b81526013600482015260ff84166024820152600090730152ee45780385dACCCCB128D816031CfFe5F36B90632b276f5890604401602060405180830381865af41580156109bc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109e09190612ff8565b604051637352178160e01b8152909150730152ee45780385dACCCCB128D816031CfFe5F36B90637352178190610a20903090889088908790600401613011565b600060405180830381865af4158015610a3d573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610a659190810190613094565b949350505050565b6000610a7860085490565b8210610aa15760405163295f44f760e21b8152600060048201526024810183905260440161064b565b60088281548110610ab457610ab46130c9565b90600052602060002001549050919050565b610ace611295565b7f00000000000000000000000000000000000000000000000000000000000000004614610b0d5760405162461bcd60e51b815260040161064b90612f9e565b604051633b0d4dd760e01b81526013600482015260026024820152600090730152ee45780385dACCCCB128D816031CfFe5F36B90633b0d4dd790604401602060405180830381865af4158015610b67573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b8b9190612ff8565b9050610b9783836113ea565b827faef83f88d7b64742932e336e35ec4ebdbf35e2824c4cc154007911e95b72367e8383604051610bc99291906130df565b60405180910390a2505050565b33610621818361143a565b6000610555826111d9565b60006001600160a01b038216610c18576040516322718ad960e21b81526000600482015260240161064b565b506001600160a01b031660009081526003602052604090205490565b610c3c611295565b610c4660006114ac565b565b6000806000730152ee45780385dACCCCB128D816031CfFe5F36B63c0af6591853060136040518463ffffffff1660e01b8152600401610c8993929190613101565b600060405180830381865af4158015610ca6573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610cce919081019061312f565b9194509250905060ff8316610d565760008083806020019051810190610cf49190613189565b91509150610d0282826114fe565b816001600160a01b03166001601254610d1b91906131e6565b6040518581527f22ef8ac73166382773e470f8f887ac4c54dcf377f397431fe0ac6f60261fabaf906020015b60405180910390a350506106af565b60001960ff841601610dcc57600082806020019051810190610d789190612ff8565b90506000610d8582610be1565b9050610d90826112c2565b806001600160a01b0316827f81c00ee14a307a39bcddd8f17801cf3101f1c49c8dea9ee90ec0c04a61b5a00785604051610d4791815260200190565b60011960ff8416016106af5760008083806020019051810190610def91906131f9565b91509150610dfd82826113ea565b817faef83f88d7b64742932e336e35ec4ebdbf35e2824c4cc154007911e95b72367e8285604051610e2f9291906130df565b60405180910390a2505050505050565b600060608060008060006060610e53611529565b610e5b61155b565b60408051600080825260208201909252600f60f81b9b939a50919850469750309650945092509050565b60004265ffffffffffff81168310610ec157604051637669fc0f60e11b81526004810184905265ffffffffffff8216602482015260440161064b565b610ed5610ecd846112fd565b601190611334565b6001600160d01b03169392505050565b60606001805461056a90612f64565b6001600160a01b0381166000908152601060205260408120610f1590611588565b6001600160d01b031692915050565b6106213383836115c1565b610f3a848484610625565b6106af3385858585611658565b83421115610f6b57604051632341d78760e11b81526004810185905260240161064b565b604080517fe48329057bfd03d55e49b547132e39cffd9c1820ad7b9d4c5307691425d15adf60208201526001600160a01b038816918101919091526060810186905260808101859052600090610fe590610fdd9060a00160405160208183030381529060405280519060200120611783565b8585856117b0565b9050610ff181876117de565b610ffb818861143a565b50505050505050565b606061055582611831565b611017611295565b7f000000000000000000000000000000000000000000000000000000000000000046146110565760405162461bcd60e51b815260040161064b90612f9e565b604051633b0d4dd760e01b81526013600482015260006024820181905290730152ee45780385dACCCCB128D816031CfFe5F36B90633b0d4dd790604401602060405180830381865af41580156110b0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110d49190612ff8565b90506110e083836114fe565b826001600160a01b031660016012546110f991906131e6565b6040518381527f22ef8ac73166382773e470f8f887ac4c54dcf377f397431fe0ac6f60261fabaf906020016107ce565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205460ff1690565b61115f611295565b6001600160a01b03811661118957604051631e4fbdf760e01b81526000600482015260240161064b565b611192816114ac565b50565b60006111a1828461322a565b9392505050565b60006111a18284613251565b60006001600160e01b03198216632483248360e11b148061055557506105558261193a565b6000818152600260205260408120546001600160a01b03168061055557604051637e27328960e01b81526004810184905260240161064b565b6108d2838383600161195f565b60006001600160a01b038216158061123e57506001600160a01b038416155b61128a5760405162461bcd60e51b815260206004820152601760248201527f4e4654206973206e6f74207472616e7366657261626c65000000000000000000604482015260640161064b565b610a65848484611a65565b600b546001600160a01b03163314610c465760405163118cdaa760e01b815233600482015260240161064b565b60006112d1600083600061121f565b90506001600160a01b03811661062157604051637e27328960e01b81526004810183905260240161064b565b600065ffffffffffff821115611330576040516306dfcc6560e41b8152603060048201526024810183905260440161064b565b5090565b81546000908181600581111561139357600061134f84611a81565b61135990856131e6565b60008881526020902090915081015465ffffffffffff908116908716101561138357809150611391565b61138e816001613271565b92505b505b60006113a187878585611bda565b905080156113dc576113c6876113b86001846131e6565b600091825260209091200190565b54600160301b90046001600160d01b03166113df565b60005b979650505050505050565b6000828152600a6020526040902061140282826132ca565b506040518281527ff8e1a15aba9398e019f0b49df1a4fde98ee17ae345cb5f6b5e2c27f5033e8ce79060200160405180910390a15050565b6001600160a01b038281166000818152600f602052604080822080548686166001600160a01b0319821681179092559151919094169392849290917f3134e8a2e6d97e929a7e54011ea5485d7d196dd5f0ba4d4ef95803e8e3fc257f9190a46108d281836114a786611c3c565b611c47565b600b80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b601280546000918261150f8361338a565b91905055905061151f8382611db3565b6108d281836113ea565b60606115567f0000000000000000000000000000000000000000000000000000000000000000600c611dcd565b905090565b60606115567f0000000000000000000000000000000000000000000000000000000000000000600d611dcd565b805460009080156115b8576115a2836113b86001846131e6565b54600160301b90046001600160d01b03166111a1565b60009392505050565b6001600160a01b0382166115f357604051630b61174360e31b81526001600160a01b038316600482015260240161064b565b6001600160a01b03838116600081815260056020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3191016107ce565b6001600160a01b0383163b1561177c57604051630a85bd0160e11b81526001600160a01b0384169063150b7a029061169a9088908890879087906004016133a3565b6020604051808303816000875af19250505080156116d5575060408051601f3d908101601f191682019092526116d2918101906133e0565b60015b61173e573d808015611703576040519150601f19603f3d011682016040523d82523d6000602084013e611708565b606091505b50805160000361173657604051633250574960e11b81526001600160a01b038516600482015260240161064b565b805181602001fd5b6001600160e01b03198116630a85bd0160e11b1461177a57604051633250574960e11b81526001600160a01b038516600482015260240161064b565b505b5050505050565b6000610555611790611e78565b8360405161190160f01b8152600281019290925260228201526042902090565b6000806000806117c288888888611fa3565b9250925092506117d28282612072565b50909695505050505050565b6001600160a01b0382166000908152600e602052604090208054600181019091558181146108d2576040516301d4b62360e61b81526001600160a01b03841660048201526024810182905260440161064b565b606061183c826111d9565b506000828152600a60205260408120805461185690612f64565b80601f016020809104026020016040519081016040528092919081815260200182805461188290612f64565b80156118cf5780601f106118a4576101008083540402835291602001916118cf565b820191906000526020600020905b8154815290600101906020018083116118b257829003601f168201915b5050505050905060006118ed60408051602081019091526000815290565b905080516000036118ff575092915050565b8151156119315780826040516020016119199291906133fd565b60405160208183030381529060405292505050919050565b610a658461212b565b60006001600160e01b0319821663780e9d6360e01b148061055557506105558261219f565b808061197357506001600160a01b03821615155b15611a35576000611983846111d9565b90506001600160a01b038316158015906119af5750826001600160a01b0316816001600160a01b031614155b80156119c257506119c08184611129565b155b156119eb5760405163a9fbf51f60e01b81526001600160a01b038416600482015260240161064b565b8115611a335783856001600160a01b0316826001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45b505b5050600090815260046020526040902080546001600160a01b0319166001600160a01b0392909216919091179055565b600080611a738585856121ef565b9050610a65818660016122bc565b600060018211611a8f575090565b816001600160801b8210611aa85760809190911c9060401b5b680100000000000000008210611ac35760409190911c9060201b5b6401000000008210611ada5760209190911c9060101b5b620100008210611aef5760109190911c9060081b5b6101008210611b035760089190911c9060041b5b60108210611b165760049190911c9060021b5b60048210611b225760011b5b600302600190811c90818581611b3a57611b3a61342c565b048201901c90506001818581611b5257611b5261342c565b048201901c90506001818581611b6a57611b6a61342c565b048201901c90506001818581611b8257611b8261342c565b048201901c90506001818581611b9a57611b9a61342c565b048201901c90506001818581611bb257611bb261342c565b048201901c9050611bd1818581611bcb57611bcb61342c565b04821190565b90039392505050565b60005b81831015611c34576000611bf18484612332565b60008781526020902090915065ffffffffffff86169082015465ffffffffffff161115611c2057809250611c2e565b611c2b816001613271565b93505b50611bdd565b509392505050565b600061055582610bec565b816001600160a01b0316836001600160a01b031614158015611c695750600081115b156108d2576001600160a01b03831615611d11576001600160a01b03831660009081526010602052604081208190611cac906111a8611ca78661234d565b612381565b6001600160d01b031691506001600160d01b03169150846001600160a01b03167fdec2bacdd2f05b59de34da9b523dff8be42e5e38e818c82fdb0bae774387a7248383604051611d06929190918252602082015260400190565b60405180910390a250505b6001600160a01b038216156108d2576001600160a01b03821660009081526010602052604081208190611d4a90611195611ca78661234d565b6001600160d01b031691506001600160d01b03169150836001600160a01b03167fdec2bacdd2f05b59de34da9b523dff8be42e5e38e818c82fdb0bae774387a7248383604051611da4929190918252602082015260400190565b60405180910390a25050505050565b6106218282604051806020016040528060008152506123b3565b606060ff8314611de757611de0836123cb565b9050610555565b818054611df390612f64565b80601f0160208091040260200160405190810160405280929190818152602001828054611e1f90612f64565b8015611e6c5780601f10611e4157610100808354040283529160200191611e6c565b820191906000526020600020905b815481529060010190602001808311611e4f57829003601f168201915b50505050509050610555565b6000306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016148015611ed157507f000000000000000000000000000000000000000000000000000000000000000046145b15611efb57507f000000000000000000000000000000000000000000000000000000000000000090565b611556604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f60208201527f0000000000000000000000000000000000000000000000000000000000000000918101919091527f000000000000000000000000000000000000000000000000000000000000000060608201524660808201523060a082015260009060c00160405160208183030381529060405280519060200120905090565b600080807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0841115611fde5750600091506003905082612068565b604080516000808252602082018084528a905260ff891692820192909252606081018790526080810186905260019060a0016020604051602081039080840390855afa158015612032573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b03811661205e57506000925060019150829050612068565b9250600091508190505b9450945094915050565b600082600381111561208657612086612fe2565b0361208f575050565b60018260038111156120a3576120a3612fe2565b036120c15760405163f645eedf60e01b815260040160405180910390fd5b60028260038111156120d5576120d5612fe2565b036120f65760405163fce698f760e01b81526004810182905260240161064b565b600382600381111561210a5761210a612fe2565b03610621576040516335e2f38360e21b81526004810182905260240161064b565b6060612136826111d9565b50600061214e60408051602081019091526000815290565b9050600081511161216e57604051806020016040528060008152506111a1565b806121788461240a565b6040516020016121899291906133fd565b6040516020818303038152906040529392505050565b60006001600160e01b031982166380ac58cd60e01b14806121d057506001600160e01b03198216635b5e139f60e01b145b8061055557506301ffc9a760e01b6001600160e01b0319831614610555565b6000806121fd85858561249d565b90506001600160a01b03811661225a5761225584600880546000838152600960205260408120829055600182018355919091527ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee30155565b61227d565b846001600160a01b0316816001600160a01b03161461227d5761227d8185612596565b6001600160a01b0385166122995761229484612617565b610a65565b846001600160a01b0316816001600160a01b031614610a6557610a6585856126c6565b6001600160a01b0383166122de576122db6011611195611ca78461234d565b50505b6001600160a01b038216612300576122fd60116111a8611ca78461234d565b50505b6001600160a01b038381166000908152600f60205260408082205485841683529120546108d292918216911683611c47565b60006123416002848418613442565b6111a190848416613271565b60006001600160d01b03821115611330576040516306dfcc6560e41b815260d060048201526024810183905260440161064b565b6000806123a64261239e61239488611588565b868863ffffffff16565b879190612716565b915091505b935093915050565b6123bd8383612724565b6108d2336000858585611658565b606060006123d883612789565b604080516020808252818301909252919250600091906020820181803683375050509182525060208101929092525090565b60606000612417836127b1565b600101905060008167ffffffffffffffff81111561243757612437612be4565b6040519080825280601f01601f191660200182016040528015612461576020820181803683370190505b5090508181016020015b600019016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a850494508461246b57509392505050565b6000828152600260205260408120546001600160a01b03908116908316156124ca576124ca818486612889565b6001600160a01b03811615612508576124e760008560008061195f565b6001600160a01b038116600090815260036020526040902080546000190190555b6001600160a01b03851615612537576001600160a01b0385166000908152600360205260409020805460010190555b60008481526002602052604080822080546001600160a01b0319166001600160a01b0389811691821790925591518793918516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4949350505050565b60006125a183610bec565b6000838152600760209081526040808320546001600160a01b03881684526006909252909120919250908183146125f857600083815260208281526040808320548584528184208190558352600790915290208290555b6000938452600760209081526040808620869055938552525081205550565b600854600090612629906001906131e6565b60008381526009602052604081205460088054939450909284908110612651576126516130c9565b906000526020600020015490508060088381548110612672576126726130c9565b60009182526020808320909101929092558281526009909152604080822084905585825281205560088054806126aa576126aa613464565b6001900381819060005260206000200160009055905550505050565b600060016126d384610bec565b6126dd91906131e6565b6001600160a01b039093166000908152600660209081526040808320868452825280832085905593825260079052919091209190915550565b6000806123a68585856128ed565b6001600160a01b03821661274e57604051633250574960e11b81526000600482015260240161064b565b600061275c8383600061121f565b90506001600160a01b038116156108d2576040516339e3563760e11b81526000600482015260240161064b565b600060ff8216601f81111561055557604051632cd44ac360e21b815260040160405180910390fd5b60008072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b83106127f05772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6d04ee2d6d415b85acef8100000000831061281c576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc10000831061283a57662386f26fc10000830492506010015b6305f5e1008310612852576305f5e100830492506008015b612710831061286657612710830492506004015b60648310612878576064830492506002015b600a83106105555760010192915050565b612894838383612a41565b6108d2576001600160a01b0383166128c257604051637e27328960e01b81526004810182905260240161064b565b60405163177e802f60e01b81526001600160a01b03831660048201526024810182905260440161064b565b8254600090819080156129e657600061290b876113b86001856131e6565b805490915065ffffffffffff80821691600160301b90046001600160d01b031690881682111561294e57604051632520601d60e01b815260040160405180910390fd5b8765ffffffffffff168265ffffffffffff160361298757825465ffffffffffff16600160301b6001600160d01b038916021783556129d8565b6040805180820190915265ffffffffffff808a1682526001600160d01b03808a1660208085019182528d54600181018f5560008f81529190912094519151909216600160301b029216919091179101555b94508593506123ab92505050565b50506040805180820190915265ffffffffffff80851682526001600160d01b0380851660208085019182528854600181018a5560008a815291822095519251909316600160301b0291909316179201919091559050816123ab565b60006001600160a01b03831615801590610a655750826001600160a01b0316846001600160a01b03161480612a7b5750612a7b8484611129565b80610a655750506000908152600460205260409020546001600160a01b03908116911614919050565b6001600160e01b03198116811461119257600080fd5b600060208284031215612acc57600080fd5b81356111a181612aa4565b60005b83811015612af2578181015183820152602001612ada565b50506000910152565b60008151808452612b13816020860160208601612ad7565b601f01601f19169290920160200192915050565b6020815260006111a16020830184612afb565b600060208284031215612b4c57600080fd5b5035919050565b6001600160a01b038116811461119257600080fd5b60008060408385031215612b7b57600080fd5b8235612b8681612b53565b946020939093013593505050565b600080600060608486031215612ba957600080fd5b8335612bb481612b53565b92506020840135612bc481612b53565b929592945050506040919091013590565b60ff8116811461119257600080fd5b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715612c2357612c23612be4565b604052919050565b600067ffffffffffffffff821115612c4557612c45612be4565b50601f01601f191660200190565b600082601f830112612c6457600080fd5b8135612c77612c7282612c2b565b612bfa565b818152846020838601011115612c8c57600080fd5b816020850160208301376000918101602001919091529392505050565b60008060408385031215612cbc57600080fd5b8235612cc781612bd5565b9150602083013567ffffffffffffffff811115612ce357600080fd5b612cef85828601612c53565b9150509250929050565b600060208284031215612d0b57600080fd5b81356111a181612b53565b60008060408385031215612d2957600080fd5b82359150602083013567ffffffffffffffff811115612ce357600080fd5b600060208284031215612d5957600080fd5b813567ffffffffffffffff811115612d7057600080fd5b610a6584828501612c53565b60ff60f81b881681526000602060e081840152612d9c60e084018a612afb565b8381036040850152612dae818a612afb565b606085018990526001600160a01b038816608086015260a0850187905284810360c0860152855180825283870192509083019060005b81811015612e0057835183529284019291840191600101612de4565b50909c9b505050505050505050505050565b60008060408385031215612e2557600080fd5b8235612e3081612b53565b915060208301358015158114612e4557600080fd5b809150509250929050565b60008060008060808587031215612e6657600080fd5b8435612e7181612b53565b93506020850135612e8181612b53565b925060408501359150606085013567ffffffffffffffff811115612ea457600080fd5b612eb087828801612c53565b91505092959194509250565b60008060008060008060c08789031215612ed557600080fd5b8635612ee081612b53565b955060208701359450604087013593506060870135612efe81612bd5565b9598949750929560808101359460a0909101359350915050565b60008060408385031215612f2b57600080fd5b8235612cc781612b53565b60008060408385031215612f4957600080fd5b8235612f5481612b53565b91506020830135612e4581612b53565b600181811c90821680612f7857607f821691505b602082108103612f9857634e487b7160e01b600052602260045260246000fd5b50919050565b60208082526024908201527f4f7065726174696f6e206f6e6c7920616c6c6f776564206f6e20686f6d6520636040820152633430b4b760e11b606082015260800190565b634e487b7160e01b600052602160045260246000fd5b60006020828403121561300a57600080fd5b5051919050565b6001600160a01b038516815260ff8416602082015260806040820181905260009061303e90830185612afb565b905082606083015295945050505050565b600082601f83011261306057600080fd5b815161306e612c7282612c2b565b81815284602083860101111561308357600080fd5b610a65826020830160208701612ad7565b6000602082840312156130a657600080fd5b815167ffffffffffffffff8111156130bd57600080fd5b610a658482850161304f565b634e487b7160e01b600052603260045260246000fd5b6040815260006130f26040830185612afb565b90508260208301529392505050565b6060815260006131146060830186612afb565b6001600160a01b039490941660208301525060400152919050565b60008060006060848603121561314457600080fd5b835161314f81612bd5565b602085015190935067ffffffffffffffff81111561316c57600080fd5b6131788682870161304f565b925050604084015190509250925092565b6000806040838503121561319c57600080fd5b82516131a781612b53565b602084015190925067ffffffffffffffff8111156131c457600080fd5b612cef8582860161304f565b634e487b7160e01b600052601160045260246000fd5b81810381811115610555576105556131d0565b6000806040838503121561320c57600080fd5b82519150602083015167ffffffffffffffff8111156131c457600080fd5b6001600160d01b0381811683821601908082111561324a5761324a6131d0565b5092915050565b6001600160d01b0382811682821603908082111561324a5761324a6131d0565b80820180821115610555576105556131d0565b601f8211156108d257600081815260208120601f850160051c810160208610156132ab5750805b601f850160051c820191505b8181101561177a578281556001016132b7565b815167ffffffffffffffff8111156132e4576132e4612be4565b6132f8816132f28454612f64565b84613284565b602080601f83116001811461332d57600084156133155750858301515b600019600386901b1c1916600185901b17855561177a565b600085815260208120601f198616915b8281101561335c5788860151825594840194600190910190840161333d565b508582101561337a5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60006001820161339c5761339c6131d0565b5060010190565b6001600160a01b03858116825284166020820152604081018390526080606082018190526000906133d690830184612afb565b9695505050505050565b6000602082840312156133f257600080fd5b81516111a181612aa4565b6000835161340f818460208801612ad7565b835190830190613423818360208801612ad7565b01949350505050565b634e487b7160e01b600052601260045260246000fd5b60008261345f57634e487b7160e01b600052601260045260246000fd5b500490565b634e487b7160e01b600052603160045260246000fdfea2646970667358221220475c666cec4a3d76929fe66f5295dec6d6b51ca7f07599a948d05aff52993ba064736f6c63430008140033dec2bacdd2f05b59de34da9b523dff8be42e5e38e818c82fdb0bae774387a724", - "deployedBytecode": "0x608060405234801561001057600080fd5b506004361061021c5760003560e01c806370a08231116101255780639ab24eb0116100ad578063c3cda5201161007c578063c3cda520146104eb578063c87b56dd146104fe578063d204c45e14610511578063e985e9c514610524578063f2fde38b1461053757600080fd5b80639ab24eb01461048b5780639fa92f9d1461049e578063a22cb465146104c5578063b88d4fde146104d857600080fd5b806384b0196e116100f457806384b0196e1461042e5780638da5cb5b146104495780638e539e8c1461045a57806391ddadf41461046d57806395d89b411461048357600080fd5b806370a08231146103d7578063715018a6146103ea5780637ecebe00146103f257806381b620861461041b57600080fd5b806342842e0e116101a85780634f6ccce7116101775780634f6ccce71461035f578063587cde1e14610372578063593aa2831461039e5780635c19a95c146103b15780636352211e146103c457600080fd5b806342842e0e146102fc57806342966c681461030f578063482ffa5e146103225780634bf5d7e91461033557600080fd5b806318160ddd116101ef57806318160ddd1461029e57806323b872dd146102b057806326926d46146102c35780632f745c59146102d65780633a46b1a8146102e957600080fd5b806301ffc9a71461022157806306fdde0314610249578063081812fc1461025e578063095ea7b314610289575b600080fd5b61023461022f366004612aba565b61054a565b60405190151581526020015b60405180910390f35b61025161055b565b6040516102409190612b27565b61027161026c366004612b3a565b6105ed565b6040516001600160a01b039091168152602001610240565b61029c610297366004612b68565b610616565b005b6008545b604051908152602001610240565b61029c6102be366004612b94565b610625565b61029c6102d1366004612b3a565b6106b5565b6102a26102e4366004612b68565b6107db565b6102a26102f7366004612b68565b610840565b61029c61030a366004612b94565b6108b7565b61029c61031d366004612b3a565b6108d7565b610251610330366004612ca9565b6108e3565b60408051808201909152600e81526d06d6f64653d74696d657374616d760941b6020820152610251565b6102a261036d366004612b3a565b610a6d565b610271610380366004612cf9565b6001600160a01b039081166000908152600f60205260409020541690565b61029c6103ac366004612d16565b610ac6565b61029c6103bf366004612cf9565b610bd6565b6102716103d2366004612b3a565b610be1565b6102a26103e5366004612cf9565b610bec565b61029c610c34565b6102a2610400366004612cf9565b6001600160a01b03166000908152600e602052604090205490565b61029c610429366004612d47565b610c48565b610436610e3f565b6040516102409796959493929190612d7c565b600b546001600160a01b0316610271565b6102a2610468366004612b3a565b610e85565b60405165ffffffffffff42168152602001610240565b610251610ee5565b6102a2610499366004612cf9565b610ef4565b6102a27f000000000000000000000000000000000000000000000000000000000000000081565b61029c6104d3366004612e12565b610f24565b61029c6104e6366004612e50565b610f2f565b61029c6104f9366004612ebc565b610f47565b61025161050c366004612b3a565b611004565b61029c61051f366004612f18565b61100f565b610234610532366004612f36565b611129565b61029c610545366004612cf9565b611157565b6000610555826111b4565b92915050565b60606000805461056a90612f64565b80601f016020809104026020016040519081016040528092919081815260200182805461059690612f64565b80156105e35780601f106105b8576101008083540402835291602001916105e3565b820191906000526020600020905b8154815290600101906020018083116105c657829003601f168201915b5050505050905090565b60006105f8826111d9565b506000828152600460205260409020546001600160a01b0316610555565b610621828233611212565b5050565b6001600160a01b03821661065457604051633250574960e11b8152600060048201526024015b60405180910390fd5b600061066183833361121f565b9050836001600160a01b0316816001600160a01b0316146106af576040516364283d7b60e01b81526001600160a01b038086166004830152602482018490528216604482015260640161064b565b50505050565b6106bd611295565b7f000000000000000000000000000000000000000000000000000000000000000046146106fc5760405162461bcd60e51b815260040161064b90612f9e565b604051633b0d4dd760e01b8152601360048201526001602482015260009073__$b1c1335e68417b4234016f4aa58fdfac77$__90633b0d4dd790604401602060405180830381865af4158015610756573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061077a9190612ff8565b9050600061078783610be1565b9050610792836112c2565b806001600160a01b0316837f81c00ee14a307a39bcddd8f17801cf3101f1c49c8dea9ee90ec0c04a61b5a007846040516107ce91815260200190565b60405180910390a3505050565b60006107e683610bec565b82106108175760405163295f44f760e21b81526001600160a01b03841660048201526024810183905260440161064b565b506001600160a01b03919091166000908152600660209081526040808320938352929052205490565b60004265ffffffffffff8116831061087c57604051637669fc0f60e11b81526004810184905265ffffffffffff8216602482015260440161064b565b6108a6610888846112fd565b6001600160a01b038616600090815260106020526040902090611334565b6001600160d01b0316949350505050565b6108d283838360405180602001604052806000815250610f2f565b505050565b6106216000823361121f565b60607f000000000000000000000000000000000000000000000000000000000000000046146109605760405162461bcd60e51b815260206004820152602360248201527f50726f6f6673206f6e6c792067656e657261746564206f6e20686f6d6520636860448201526230b4b760e91b606482015260840161064b565b604051630564edeb60e31b81526013600482015260ff8416602482015260009073__$b1c1335e68417b4234016f4aa58fdfac77$__90632b276f5890604401602060405180830381865af41580156109bc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109e09190612ff8565b604051637352178160e01b815290915073__$b1c1335e68417b4234016f4aa58fdfac77$__90637352178190610a20903090889088908790600401613011565b600060405180830381865af4158015610a3d573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610a659190810190613094565b949350505050565b6000610a7860085490565b8210610aa15760405163295f44f760e21b8152600060048201526024810183905260440161064b565b60088281548110610ab457610ab46130c9565b90600052602060002001549050919050565b610ace611295565b7f00000000000000000000000000000000000000000000000000000000000000004614610b0d5760405162461bcd60e51b815260040161064b90612f9e565b604051633b0d4dd760e01b8152601360048201526002602482015260009073__$b1c1335e68417b4234016f4aa58fdfac77$__90633b0d4dd790604401602060405180830381865af4158015610b67573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b8b9190612ff8565b9050610b9783836113ea565b827faef83f88d7b64742932e336e35ec4ebdbf35e2824c4cc154007911e95b72367e8383604051610bc99291906130df565b60405180910390a2505050565b33610621818361143a565b6000610555826111d9565b60006001600160a01b038216610c18576040516322718ad960e21b81526000600482015260240161064b565b506001600160a01b031660009081526003602052604090205490565b610c3c611295565b610c4660006114ac565b565b600080600073__$b1c1335e68417b4234016f4aa58fdfac77$__63c0af6591853060136040518463ffffffff1660e01b8152600401610c8993929190613101565b600060405180830381865af4158015610ca6573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610cce919081019061312f565b9194509250905060ff8316610d565760008083806020019051810190610cf49190613189565b91509150610d0282826114fe565b816001600160a01b03166001601254610d1b91906131e6565b6040518581527f22ef8ac73166382773e470f8f887ac4c54dcf377f397431fe0ac6f60261fabaf906020015b60405180910390a350506106af565b60001960ff841601610dcc57600082806020019051810190610d789190612ff8565b90506000610d8582610be1565b9050610d90826112c2565b806001600160a01b0316827f81c00ee14a307a39bcddd8f17801cf3101f1c49c8dea9ee90ec0c04a61b5a00785604051610d4791815260200190565b60011960ff8416016106af5760008083806020019051810190610def91906131f9565b91509150610dfd82826113ea565b817faef83f88d7b64742932e336e35ec4ebdbf35e2824c4cc154007911e95b72367e8285604051610e2f9291906130df565b60405180910390a2505050505050565b600060608060008060006060610e53611529565b610e5b61155b565b60408051600080825260208201909252600f60f81b9b939a50919850469750309650945092509050565b60004265ffffffffffff81168310610ec157604051637669fc0f60e11b81526004810184905265ffffffffffff8216602482015260440161064b565b610ed5610ecd846112fd565b601190611334565b6001600160d01b03169392505050565b60606001805461056a90612f64565b6001600160a01b0381166000908152601060205260408120610f1590611588565b6001600160d01b031692915050565b6106213383836115c1565b610f3a848484610625565b6106af3385858585611658565b83421115610f6b57604051632341d78760e11b81526004810185905260240161064b565b604080517fe48329057bfd03d55e49b547132e39cffd9c1820ad7b9d4c5307691425d15adf60208201526001600160a01b038816918101919091526060810186905260808101859052600090610fe590610fdd9060a00160405160208183030381529060405280519060200120611783565b8585856117b0565b9050610ff181876117de565b610ffb818861143a565b50505050505050565b606061055582611831565b611017611295565b7f000000000000000000000000000000000000000000000000000000000000000046146110565760405162461bcd60e51b815260040161064b90612f9e565b604051633b0d4dd760e01b8152601360048201526000602482018190529073__$b1c1335e68417b4234016f4aa58fdfac77$__90633b0d4dd790604401602060405180830381865af41580156110b0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110d49190612ff8565b90506110e083836114fe565b826001600160a01b031660016012546110f991906131e6565b6040518381527f22ef8ac73166382773e470f8f887ac4c54dcf377f397431fe0ac6f60261fabaf906020016107ce565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205460ff1690565b61115f611295565b6001600160a01b03811661118957604051631e4fbdf760e01b81526000600482015260240161064b565b611192816114ac565b50565b60006111a1828461322a565b9392505050565b60006111a18284613251565b60006001600160e01b03198216632483248360e11b148061055557506105558261193a565b6000818152600260205260408120546001600160a01b03168061055557604051637e27328960e01b81526004810184905260240161064b565b6108d2838383600161195f565b60006001600160a01b038216158061123e57506001600160a01b038416155b61128a5760405162461bcd60e51b815260206004820152601760248201527f4e4654206973206e6f74207472616e7366657261626c65000000000000000000604482015260640161064b565b610a65848484611a65565b600b546001600160a01b03163314610c465760405163118cdaa760e01b815233600482015260240161064b565b60006112d1600083600061121f565b90506001600160a01b03811661062157604051637e27328960e01b81526004810183905260240161064b565b600065ffffffffffff821115611330576040516306dfcc6560e41b8152603060048201526024810183905260440161064b565b5090565b81546000908181600581111561139357600061134f84611a81565b61135990856131e6565b60008881526020902090915081015465ffffffffffff908116908716101561138357809150611391565b61138e816001613271565b92505b505b60006113a187878585611bda565b905080156113dc576113c6876113b86001846131e6565b600091825260209091200190565b54600160301b90046001600160d01b03166113df565b60005b979650505050505050565b6000828152600a6020526040902061140282826132ca565b506040518281527ff8e1a15aba9398e019f0b49df1a4fde98ee17ae345cb5f6b5e2c27f5033e8ce79060200160405180910390a15050565b6001600160a01b038281166000818152600f602052604080822080548686166001600160a01b0319821681179092559151919094169392849290917f3134e8a2e6d97e929a7e54011ea5485d7d196dd5f0ba4d4ef95803e8e3fc257f9190a46108d281836114a786611c3c565b611c47565b600b80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b601280546000918261150f8361338a565b91905055905061151f8382611db3565b6108d281836113ea565b60606115567f0000000000000000000000000000000000000000000000000000000000000000600c611dcd565b905090565b60606115567f0000000000000000000000000000000000000000000000000000000000000000600d611dcd565b805460009080156115b8576115a2836113b86001846131e6565b54600160301b90046001600160d01b03166111a1565b60009392505050565b6001600160a01b0382166115f357604051630b61174360e31b81526001600160a01b038316600482015260240161064b565b6001600160a01b03838116600081815260056020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3191016107ce565b6001600160a01b0383163b1561177c57604051630a85bd0160e11b81526001600160a01b0384169063150b7a029061169a9088908890879087906004016133a3565b6020604051808303816000875af19250505080156116d5575060408051601f3d908101601f191682019092526116d2918101906133e0565b60015b61173e573d808015611703576040519150601f19603f3d011682016040523d82523d6000602084013e611708565b606091505b50805160000361173657604051633250574960e11b81526001600160a01b038516600482015260240161064b565b805181602001fd5b6001600160e01b03198116630a85bd0160e11b1461177a57604051633250574960e11b81526001600160a01b038516600482015260240161064b565b505b5050505050565b6000610555611790611e78565b8360405161190160f01b8152600281019290925260228201526042902090565b6000806000806117c288888888611fa3565b9250925092506117d28282612072565b50909695505050505050565b6001600160a01b0382166000908152600e602052604090208054600181019091558181146108d2576040516301d4b62360e61b81526001600160a01b03841660048201526024810182905260440161064b565b606061183c826111d9565b506000828152600a60205260408120805461185690612f64565b80601f016020809104026020016040519081016040528092919081815260200182805461188290612f64565b80156118cf5780601f106118a4576101008083540402835291602001916118cf565b820191906000526020600020905b8154815290600101906020018083116118b257829003601f168201915b5050505050905060006118ed60408051602081019091526000815290565b905080516000036118ff575092915050565b8151156119315780826040516020016119199291906133fd565b60405160208183030381529060405292505050919050565b610a658461212b565b60006001600160e01b0319821663780e9d6360e01b148061055557506105558261219f565b808061197357506001600160a01b03821615155b15611a35576000611983846111d9565b90506001600160a01b038316158015906119af5750826001600160a01b0316816001600160a01b031614155b80156119c257506119c08184611129565b155b156119eb5760405163a9fbf51f60e01b81526001600160a01b038416600482015260240161064b565b8115611a335783856001600160a01b0316826001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45b505b5050600090815260046020526040902080546001600160a01b0319166001600160a01b0392909216919091179055565b600080611a738585856121ef565b9050610a65818660016122bc565b600060018211611a8f575090565b816001600160801b8210611aa85760809190911c9060401b5b680100000000000000008210611ac35760409190911c9060201b5b6401000000008210611ada5760209190911c9060101b5b620100008210611aef5760109190911c9060081b5b6101008210611b035760089190911c9060041b5b60108210611b165760049190911c9060021b5b60048210611b225760011b5b600302600190811c90818581611b3a57611b3a61342c565b048201901c90506001818581611b5257611b5261342c565b048201901c90506001818581611b6a57611b6a61342c565b048201901c90506001818581611b8257611b8261342c565b048201901c90506001818581611b9a57611b9a61342c565b048201901c90506001818581611bb257611bb261342c565b048201901c9050611bd1818581611bcb57611bcb61342c565b04821190565b90039392505050565b60005b81831015611c34576000611bf18484612332565b60008781526020902090915065ffffffffffff86169082015465ffffffffffff161115611c2057809250611c2e565b611c2b816001613271565b93505b50611bdd565b509392505050565b600061055582610bec565b816001600160a01b0316836001600160a01b031614158015611c695750600081115b156108d2576001600160a01b03831615611d11576001600160a01b03831660009081526010602052604081208190611cac906111a8611ca78661234d565b612381565b6001600160d01b031691506001600160d01b03169150846001600160a01b03167fdec2bacdd2f05b59de34da9b523dff8be42e5e38e818c82fdb0bae774387a7248383604051611d06929190918252602082015260400190565b60405180910390a250505b6001600160a01b038216156108d2576001600160a01b03821660009081526010602052604081208190611d4a90611195611ca78661234d565b6001600160d01b031691506001600160d01b03169150836001600160a01b03167fdec2bacdd2f05b59de34da9b523dff8be42e5e38e818c82fdb0bae774387a7248383604051611da4929190918252602082015260400190565b60405180910390a25050505050565b6106218282604051806020016040528060008152506123b3565b606060ff8314611de757611de0836123cb565b9050610555565b818054611df390612f64565b80601f0160208091040260200160405190810160405280929190818152602001828054611e1f90612f64565b8015611e6c5780601f10611e4157610100808354040283529160200191611e6c565b820191906000526020600020905b815481529060010190602001808311611e4f57829003601f168201915b50505050509050610555565b6000306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016148015611ed157507f000000000000000000000000000000000000000000000000000000000000000046145b15611efb57507f000000000000000000000000000000000000000000000000000000000000000090565b611556604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f60208201527f0000000000000000000000000000000000000000000000000000000000000000918101919091527f000000000000000000000000000000000000000000000000000000000000000060608201524660808201523060a082015260009060c00160405160208183030381529060405280519060200120905090565b600080807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0841115611fde5750600091506003905082612068565b604080516000808252602082018084528a905260ff891692820192909252606081018790526080810186905260019060a0016020604051602081039080840390855afa158015612032573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b03811661205e57506000925060019150829050612068565b9250600091508190505b9450945094915050565b600082600381111561208657612086612fe2565b0361208f575050565b60018260038111156120a3576120a3612fe2565b036120c15760405163f645eedf60e01b815260040160405180910390fd5b60028260038111156120d5576120d5612fe2565b036120f65760405163fce698f760e01b81526004810182905260240161064b565b600382600381111561210a5761210a612fe2565b03610621576040516335e2f38360e21b81526004810182905260240161064b565b6060612136826111d9565b50600061214e60408051602081019091526000815290565b9050600081511161216e57604051806020016040528060008152506111a1565b806121788461240a565b6040516020016121899291906133fd565b6040516020818303038152906040529392505050565b60006001600160e01b031982166380ac58cd60e01b14806121d057506001600160e01b03198216635b5e139f60e01b145b8061055557506301ffc9a760e01b6001600160e01b0319831614610555565b6000806121fd85858561249d565b90506001600160a01b03811661225a5761225584600880546000838152600960205260408120829055600182018355919091527ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee30155565b61227d565b846001600160a01b0316816001600160a01b03161461227d5761227d8185612596565b6001600160a01b0385166122995761229484612617565b610a65565b846001600160a01b0316816001600160a01b031614610a6557610a6585856126c6565b6001600160a01b0383166122de576122db6011611195611ca78461234d565b50505b6001600160a01b038216612300576122fd60116111a8611ca78461234d565b50505b6001600160a01b038381166000908152600f60205260408082205485841683529120546108d292918216911683611c47565b60006123416002848418613442565b6111a190848416613271565b60006001600160d01b03821115611330576040516306dfcc6560e41b815260d060048201526024810183905260440161064b565b6000806123a64261239e61239488611588565b868863ffffffff16565b879190612716565b915091505b935093915050565b6123bd8383612724565b6108d2336000858585611658565b606060006123d883612789565b604080516020808252818301909252919250600091906020820181803683375050509182525060208101929092525090565b60606000612417836127b1565b600101905060008167ffffffffffffffff81111561243757612437612be4565b6040519080825280601f01601f191660200182016040528015612461576020820181803683370190505b5090508181016020015b600019016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a850494508461246b57509392505050565b6000828152600260205260408120546001600160a01b03908116908316156124ca576124ca818486612889565b6001600160a01b03811615612508576124e760008560008061195f565b6001600160a01b038116600090815260036020526040902080546000190190555b6001600160a01b03851615612537576001600160a01b0385166000908152600360205260409020805460010190555b60008481526002602052604080822080546001600160a01b0319166001600160a01b0389811691821790925591518793918516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4949350505050565b60006125a183610bec565b6000838152600760209081526040808320546001600160a01b03881684526006909252909120919250908183146125f857600083815260208281526040808320548584528184208190558352600790915290208290555b6000938452600760209081526040808620869055938552525081205550565b600854600090612629906001906131e6565b60008381526009602052604081205460088054939450909284908110612651576126516130c9565b906000526020600020015490508060088381548110612672576126726130c9565b60009182526020808320909101929092558281526009909152604080822084905585825281205560088054806126aa576126aa613464565b6001900381819060005260206000200160009055905550505050565b600060016126d384610bec565b6126dd91906131e6565b6001600160a01b039093166000908152600660209081526040808320868452825280832085905593825260079052919091209190915550565b6000806123a68585856128ed565b6001600160a01b03821661274e57604051633250574960e11b81526000600482015260240161064b565b600061275c8383600061121f565b90506001600160a01b038116156108d2576040516339e3563760e11b81526000600482015260240161064b565b600060ff8216601f81111561055557604051632cd44ac360e21b815260040160405180910390fd5b60008072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b83106127f05772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6d04ee2d6d415b85acef8100000000831061281c576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc10000831061283a57662386f26fc10000830492506010015b6305f5e1008310612852576305f5e100830492506008015b612710831061286657612710830492506004015b60648310612878576064830492506002015b600a83106105555760010192915050565b612894838383612a41565b6108d2576001600160a01b0383166128c257604051637e27328960e01b81526004810182905260240161064b565b60405163177e802f60e01b81526001600160a01b03831660048201526024810182905260440161064b565b8254600090819080156129e657600061290b876113b86001856131e6565b805490915065ffffffffffff80821691600160301b90046001600160d01b031690881682111561294e57604051632520601d60e01b815260040160405180910390fd5b8765ffffffffffff168265ffffffffffff160361298757825465ffffffffffff16600160301b6001600160d01b038916021783556129d8565b6040805180820190915265ffffffffffff808a1682526001600160d01b03808a1660208085019182528d54600181018f5560008f81529190912094519151909216600160301b029216919091179101555b94508593506123ab92505050565b50506040805180820190915265ffffffffffff80851682526001600160d01b0380851660208085019182528854600181018a5560008a815291822095519251909316600160301b0291909316179201919091559050816123ab565b60006001600160a01b03831615801590610a655750826001600160a01b0316846001600160a01b03161480612a7b5750612a7b8484611129565b80610a655750506000908152600460205260409020546001600160a01b03908116911614919050565b6001600160e01b03198116811461119257600080fd5b600060208284031215612acc57600080fd5b81356111a181612aa4565b60005b83811015612af2578181015183820152602001612ada565b50506000910152565b60008151808452612b13816020860160208601612ad7565b601f01601f19169290920160200192915050565b6020815260006111a16020830184612afb565b600060208284031215612b4c57600080fd5b5035919050565b6001600160a01b038116811461119257600080fd5b60008060408385031215612b7b57600080fd5b8235612b8681612b53565b946020939093013593505050565b600080600060608486031215612ba957600080fd5b8335612bb481612b53565b92506020840135612bc481612b53565b929592945050506040919091013590565b60ff8116811461119257600080fd5b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715612c2357612c23612be4565b604052919050565b600067ffffffffffffffff821115612c4557612c45612be4565b50601f01601f191660200190565b600082601f830112612c6457600080fd5b8135612c77612c7282612c2b565b612bfa565b818152846020838601011115612c8c57600080fd5b816020850160208301376000918101602001919091529392505050565b60008060408385031215612cbc57600080fd5b8235612cc781612bd5565b9150602083013567ffffffffffffffff811115612ce357600080fd5b612cef85828601612c53565b9150509250929050565b600060208284031215612d0b57600080fd5b81356111a181612b53565b60008060408385031215612d2957600080fd5b82359150602083013567ffffffffffffffff811115612ce357600080fd5b600060208284031215612d5957600080fd5b813567ffffffffffffffff811115612d7057600080fd5b610a6584828501612c53565b60ff60f81b881681526000602060e081840152612d9c60e084018a612afb565b8381036040850152612dae818a612afb565b606085018990526001600160a01b038816608086015260a0850187905284810360c0860152855180825283870192509083019060005b81811015612e0057835183529284019291840191600101612de4565b50909c9b505050505050505050505050565b60008060408385031215612e2557600080fd5b8235612e3081612b53565b915060208301358015158114612e4557600080fd5b809150509250929050565b60008060008060808587031215612e6657600080fd5b8435612e7181612b53565b93506020850135612e8181612b53565b925060408501359150606085013567ffffffffffffffff811115612ea457600080fd5b612eb087828801612c53565b91505092959194509250565b60008060008060008060c08789031215612ed557600080fd5b8635612ee081612b53565b955060208701359450604087013593506060870135612efe81612bd5565b9598949750929560808101359460a0909101359350915050565b60008060408385031215612f2b57600080fd5b8235612cc781612b53565b60008060408385031215612f4957600080fd5b8235612f5481612b53565b91506020830135612e4581612b53565b600181811c90821680612f7857607f821691505b602082108103612f9857634e487b7160e01b600052602260045260246000fd5b50919050565b60208082526024908201527f4f7065726174696f6e206f6e6c7920616c6c6f776564206f6e20686f6d6520636040820152633430b4b760e11b606082015260800190565b634e487b7160e01b600052602160045260246000fd5b60006020828403121561300a57600080fd5b5051919050565b6001600160a01b038516815260ff8416602082015260806040820181905260009061303e90830185612afb565b905082606083015295945050505050565b600082601f83011261306057600080fd5b815161306e612c7282612c2b565b81815284602083860101111561308357600080fd5b610a65826020830160208701612ad7565b6000602082840312156130a657600080fd5b815167ffffffffffffffff8111156130bd57600080fd5b610a658482850161304f565b634e487b7160e01b600052603260045260246000fd5b6040815260006130f26040830185612afb565b90508260208301529392505050565b6060815260006131146060830186612afb565b6001600160a01b039490941660208301525060400152919050565b60008060006060848603121561314457600080fd5b835161314f81612bd5565b602085015190935067ffffffffffffffff81111561316c57600080fd5b6131788682870161304f565b925050604084015190509250925092565b6000806040838503121561319c57600080fd5b82516131a781612b53565b602084015190925067ffffffffffffffff8111156131c457600080fd5b612cef8582860161304f565b634e487b7160e01b600052601160045260246000fd5b81810381811115610555576105556131d0565b6000806040838503121561320c57600080fd5b82519150602083015167ffffffffffffffff8111156131c457600080fd5b6001600160d01b0381811683821601908082111561324a5761324a6131d0565b5092915050565b6001600160d01b0382811682821603908082111561324a5761324a6131d0565b80820180821115610555576105556131d0565b601f8211156108d257600081815260208120601f850160051c810160208610156132ab5750805b601f850160051c820191505b8181101561177a578281556001016132b7565b815167ffffffffffffffff8111156132e4576132e4612be4565b6132f8816132f28454612f64565b84613284565b602080601f83116001811461332d57600084156133155750858301515b600019600386901b1c1916600185901b17855561177a565b600085815260208120601f198616915b8281101561335c5788860151825594840194600190910190840161333d565b508582101561337a5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60006001820161339c5761339c6131d0565b5060010190565b6001600160a01b03858116825284166020820152604081018390526080606082018190526000906133d690830184612afb565b9695505050505050565b6000602082840312156133f257600080fd5b81516111a181612aa4565b6000835161340f818460208801612ad7565b835190830190613423818360208801612ad7565b01949350505050565b634e487b7160e01b600052601260045260246000fd5b60008261345f57634e487b7160e01b600052601260045260246000fd5b500490565b634e487b7160e01b600052603160045260246000fdfea2646970667358221220475c666cec4a3d76929fe66f5295dec6d6b51ca7f07599a948d05aff52993ba064736f6c63430008140033", + "solcInputHash": "c27a34cff02617821c386fb97b476bc1", + "metadata": "{\"compiler\":{\"version\":\"0.8.20+commit.a1b79de6\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_home\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"initialOwner\",\"type\":\"address\"},{\"internalType\":\"address[]\",\"name\":\"_firstMembers\",\"type\":\"address[]\"},{\"internalType\":\"string\",\"name\":\"_uri\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"_name\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"_symbol\",\"type\":\"string\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"CheckpointUnorderedInsertion\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ECDSAInvalidSignature\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"length\",\"type\":\"uint256\"}],\"name\":\"ECDSAInvalidSignatureLength\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"name\":\"ECDSAInvalidSignatureS\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"timepoint\",\"type\":\"uint256\"},{\"internalType\":\"uint48\",\"name\":\"clock\",\"type\":\"uint48\"}],\"name\":\"ERC5805FutureLookup\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ERC6372InconsistentClock\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ERC721EnumerableForbiddenBatchMint\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"ERC721IncorrectOwner\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"ERC721InsufficientApproval\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"approver\",\"type\":\"address\"}],\"name\":\"ERC721InvalidApprover\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"}],\"name\":\"ERC721InvalidOperator\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"ERC721InvalidOwner\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"receiver\",\"type\":\"address\"}],\"name\":\"ERC721InvalidReceiver\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"ERC721InvalidSender\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"ERC721NonexistentToken\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"index\",\"type\":\"uint256\"}],\"name\":\"ERC721OutOfBoundsIndex\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"currentNonce\",\"type\":\"uint256\"}],\"name\":\"InvalidAccountNonce\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidShortString\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"OwnableInvalidOwner\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"OwnableUnauthorizedAccount\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint8\",\"name\":\"bits\",\"type\":\"uint8\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"SafeCastOverflowedUintDowncast\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"str\",\"type\":\"string\"}],\"name\":\"StringTooLong\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expiry\",\"type\":\"uint256\"}],\"name\":\"VotesExpiredSignature\",\"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\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_fromTokenId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_toTokenId\",\"type\":\"uint256\"}],\"name\":\"BatchMetadataUpdate\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"delegator\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"fromDelegate\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"toDelegate\",\"type\":\"address\"}],\"name\":\"DelegateChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"delegate\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"previousVotes\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newVotes\",\"type\":\"uint256\"}],\"name\":\"DelegateVotesChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"delegator\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"delegatee\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"}],\"name\":\"DelegationSynced\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[],\"name\":\"EIP712DomainChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"member\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"}],\"name\":\"MembershipClaimed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"member\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"}],\"name\":\"MembershipRevoked\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_tokenId\",\"type\":\"uint256\"}],\"name\":\"MetadataUpdate\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"newUri\",\"type\":\"string\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"}],\"name\":\"MetadataUpdated\",\"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\":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\":\"CLOCK_MODE\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"pure\",\"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\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"burn\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"proof\",\"type\":\"bytes\"}],\"name\":\"claimDelegation\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"proof\",\"type\":\"bytes\"}],\"name\":\"claimOperation\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"clock\",\"outputs\":[{\"internalType\":\"uint48\",\"name\":\"\",\"type\":\"uint48\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"delegatee\",\"type\":\"address\"}],\"name\":\"delegate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"delegatee\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expiry\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"name\":\"delegateBySig\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"delegates\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"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\":[{\"internalType\":\"address\",\"name\":\"delegator\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"delegatee\",\"type\":\"address\"}],\"name\":\"generateDelegationProof\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint8\",\"name\":\"operationType\",\"type\":\"uint8\"},{\"internalType\":\"bytes\",\"name\":\"params\",\"type\":\"bytes\"}],\"name\":\"generateOperationProof\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"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\":\"uint256\",\"name\":\"timepoint\",\"type\":\"uint256\"}],\"name\":\"getPastTotalSupply\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"timepoint\",\"type\":\"uint256\"}],\"name\":\"getPastVotes\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"getVotes\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"}],\"name\":\"govBurn\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"home\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"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\":[],\"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\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"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\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"uri\",\"type\":\"string\"}],\"name\":\"safeMint\",\"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\":[{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"approved\",\"type\":\"bool\"}],\"name\":\"setApprovalForAll\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"tokenId\",\"type\":\"uint256\"},{\"internalType\":\"string\",\"name\":\"uri\",\"type\":\"string\"}],\"name\":\"setMetadata\",\"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\":\"index\",\"type\":\"uint256\"}],\"name\":\"tokenByIndex\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"index\",\"type\":\"uint256\"}],\"name\":\"tokenOfOwnerByIndex\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"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\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"author\":\"Web3 Hackers Collective\",\"custom:security-contact\":\"julien@strat.cc\",\"details\":\"Extends OpenZeppelin's NFT standards with cross-chain operation support and delegation\",\"errors\":{\"CheckpointUnorderedInsertion()\":[{\"details\":\"A value was attempted to be inserted on a past checkpoint.\"}],\"ECDSAInvalidSignature()\":[{\"details\":\"The signature derives the `address(0)`.\"}],\"ECDSAInvalidSignatureLength(uint256)\":[{\"details\":\"The signature has an invalid length.\"}],\"ECDSAInvalidSignatureS(bytes32)\":[{\"details\":\"The signature has an S value that is in the upper half order.\"}],\"ERC5805FutureLookup(uint256,uint48)\":[{\"details\":\"Lookup to future votes is not available.\"}],\"ERC6372InconsistentClock()\":[{\"details\":\"The clock was incorrectly modified.\"}],\"ERC721EnumerableForbiddenBatchMint()\":[{\"details\":\"Batch mint is not allowed.\"}],\"ERC721IncorrectOwner(address,uint256,address)\":[{\"details\":\"Indicates an error related to the ownership over a particular token. Used in transfers.\",\"params\":{\"owner\":\"Address of the current owner of a token.\",\"sender\":\"Address whose tokens are being transferred.\",\"tokenId\":\"Identifier number of a token.\"}}],\"ERC721InsufficientApproval(address,uint256)\":[{\"details\":\"Indicates a failure with the `operator`\\u2019s approval. Used in transfers.\",\"params\":{\"operator\":\"Address that may be allowed to operate on tokens without being their owner.\",\"tokenId\":\"Identifier number of a token.\"}}],\"ERC721InvalidApprover(address)\":[{\"details\":\"Indicates a failure with the `approver` of a token to be approved. Used in approvals.\",\"params\":{\"approver\":\"Address initiating an approval operation.\"}}],\"ERC721InvalidOperator(address)\":[{\"details\":\"Indicates a failure with the `operator` to be approved. Used in approvals.\",\"params\":{\"operator\":\"Address that may be allowed to operate on tokens without being their owner.\"}}],\"ERC721InvalidOwner(address)\":[{\"details\":\"Indicates that an address can't be an owner. For example, `address(0)` is a forbidden owner in ERC-20. Used in balance queries.\",\"params\":{\"owner\":\"Address of the current owner of a token.\"}}],\"ERC721InvalidReceiver(address)\":[{\"details\":\"Indicates a failure with the token `receiver`. Used in transfers.\",\"params\":{\"receiver\":\"Address to which tokens are being transferred.\"}}],\"ERC721InvalidSender(address)\":[{\"details\":\"Indicates a failure with the token `sender`. Used in transfers.\",\"params\":{\"sender\":\"Address whose tokens are being transferred.\"}}],\"ERC721NonexistentToken(uint256)\":[{\"details\":\"Indicates a `tokenId` whose `owner` is the zero address.\",\"params\":{\"tokenId\":\"Identifier number of a token.\"}}],\"ERC721OutOfBoundsIndex(address,uint256)\":[{\"details\":\"An `owner`'s token query was out of bounds for `index`. NOTE: The owner being `address(0)` indicates a global out of bounds index.\"}],\"InvalidAccountNonce(address,uint256)\":[{\"details\":\"The nonce used for an `account` is not the expected current nonce.\"}],\"OwnableInvalidOwner(address)\":[{\"details\":\"The owner is not a valid owner account. (eg. `address(0)`)\"}],\"OwnableUnauthorizedAccount(address)\":[{\"details\":\"The caller account is not authorized to perform an operation.\"}],\"SafeCastOverflowedUintDowncast(uint8,uint256)\":[{\"details\":\"Value doesn't fit in an uint of `bits` size.\"}],\"VotesExpiredSignature(uint256)\":[{\"details\":\"The signature used has expired.\"}]},\"events\":{\"Approval(address,address,uint256)\":{\"details\":\"Emitted when `owner` enables `approved` to manage the `tokenId` token.\"},\"ApprovalForAll(address,address,bool)\":{\"details\":\"Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.\"},\"BatchMetadataUpdate(uint256,uint256)\":{\"details\":\"This event emits when the metadata of a range of tokens is changed. So that the third-party platforms such as NFT market could timely update the images and related attributes of the NFTs.\"},\"DelegateChanged(address,address,address)\":{\"details\":\"Emitted when an account changes their delegate.\"},\"DelegateVotesChanged(address,uint256,uint256)\":{\"details\":\"Emitted when a token transfer or delegate change results in changes to a delegate's number of voting units.\"},\"DelegationSynced(address,address,uint256)\":{\"params\":{\"delegatee\":\"The address receiving the delegation\",\"delegator\":\"The address delegating their voting power\",\"nonce\":\"Operation sequence number\"}},\"EIP712DomainChanged()\":{\"details\":\"MAY be emitted to signal that the domain could have changed.\"},\"MembershipClaimed(uint256,address,uint256)\":{\"params\":{\"member\":\"The address receiving the membership\",\"nonce\":\"Operation sequence number\",\"tokenId\":\"The ID of the claimed token\"}},\"MembershipRevoked(uint256,address,uint256)\":{\"params\":{\"member\":\"The address losing membership\",\"nonce\":\"Operation sequence number\",\"tokenId\":\"The ID of the revoked token\"}},\"MetadataUpdate(uint256)\":{\"details\":\"This event emits when the metadata of a token is changed. So that the third-party platforms such as NFT market could timely update the images and related attributes of the NFT.\"},\"MetadataUpdated(uint256,string,uint256)\":{\"params\":{\"newUri\":\"The new metadata URI\",\"nonce\":\"Operation sequence number\",\"tokenId\":\"The ID of the updated token\"}},\"Transfer(address,address,uint256)\":{\"details\":\"Emitted when `tokenId` token is transferred from `from` to `to`.\"}},\"kind\":\"dev\",\"methods\":{\"CLOCK_MODE()\":{\"returns\":{\"_0\":\"String indicating timestamp-based voting\"}},\"approve(address,uint256)\":{\"details\":\"See {IERC721-approve}.\"},\"balanceOf(address)\":{\"details\":\"See {IERC721-balanceOf}.\"},\"burn(uint256)\":{\"details\":\"Burns `tokenId`. See {ERC721-_burn}. Requirements: - The caller must own `tokenId` or be an approved operator.\"},\"claimDelegation(bytes)\":{\"params\":{\"proof\":\"Proof generated by home chain\"}},\"claimOperation(bytes)\":{\"params\":{\"proof\":\"Proof generated by home chain\"}},\"clock()\":{\"details\":\"Used for voting snapshots\",\"returns\":{\"_0\":\"Current block timestamp\"}},\"constructor\":{\"params\":{\"_firstMembers\":\"Array of initial member addresses\",\"_home\":\"Chain ID where contract is considered home\",\"_name\":\"Token collection name\",\"_symbol\":\"Token collection symbol\",\"_uri\":\"Initial token URI\",\"initialOwner\":\"Initial contract owner\"}},\"delegate(address)\":{\"details\":\"Overrides ERC721Votes delegate function to add cross-chain functionality\",\"params\":{\"delegatee\":\"Address to delegate voting power to\"}},\"delegateBySig(address,uint256,uint256,uint8,bytes32,bytes32)\":{\"details\":\"Delegates votes from signer to `delegatee`.\"},\"delegates(address)\":{\"details\":\"Returns the delegate that `account` has chosen.\"},\"eip712Domain()\":{\"details\":\"See {IERC-5267}.\"},\"generateDelegationProof(address,address)\":{\"details\":\"Only callable on home chain\",\"params\":{\"delegatee\":\"Address receiving delegation\",\"delegator\":\"Address delegating voting power\"},\"returns\":{\"_0\":\"Encoded proof data\"}},\"generateOperationProof(uint8,bytes)\":{\"details\":\"Only callable on home chain\",\"params\":{\"operationType\":\"Type of operation\",\"params\":\"Operation parameters\"},\"returns\":{\"_0\":\"Encoded proof data\"}},\"getApproved(uint256)\":{\"details\":\"See {IERC721-getApproved}.\"},\"getPastTotalSupply(uint256)\":{\"details\":\"Returns the total supply of votes available at a specific moment in the past. If the `clock()` is configured to use block numbers, this will return the value at the end of the corresponding block. NOTE: This value is the sum of all available votes, which is not necessarily the sum of all delegated votes. Votes that have not been delegated are still part of total supply, even though they would not participate in a vote. Requirements: - `timepoint` must be in the past. If operating using block numbers, the block must be already mined.\"},\"getPastVotes(address,uint256)\":{\"details\":\"Returns the amount of votes that `account` had at a specific moment in the past. If the `clock()` is configured to use block numbers, this will return the value at the end of the corresponding block. Requirements: - `timepoint` must be in the past. If operating using block numbers, the block must be already mined.\"},\"getVotes(address)\":{\"details\":\"Returns the current amount of votes that `account` has.\"},\"govBurn(uint256)\":{\"details\":\"Only callable by owner (governance) on home chain\",\"params\":{\"tokenId\":\"ID of token to burn\"}},\"isApprovedForAll(address,address)\":{\"details\":\"See {IERC721-isApprovedForAll}.\"},\"name()\":{\"details\":\"See {IERC721Metadata-name}.\"},\"nonces(address)\":{\"details\":\"Returns the next unused nonce for an address.\"},\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"ownerOf(uint256)\":{\"details\":\"See {IERC721-ownerOf}.\"},\"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.\"},\"safeMint(address,string)\":{\"details\":\"Only callable by owner (governance) on home chain\",\"params\":{\"to\":\"Address to mint token to\",\"uri\":\"Token metadata URI\"}},\"safeTransferFrom(address,address,uint256)\":{\"details\":\"See {IERC721-safeTransferFrom}.\"},\"safeTransferFrom(address,address,uint256,bytes)\":{\"details\":\"See {IERC721-safeTransferFrom}.\"},\"setApprovalForAll(address,bool)\":{\"details\":\"See {IERC721-setApprovalForAll}.\"},\"setMetadata(uint256,string)\":{\"details\":\"Only callable by owner (governance) on home chain\",\"params\":{\"tokenId\":\"ID of token to update\",\"uri\":\"New metadata URI\"}},\"supportsInterface(bytes4)\":{\"params\":{\"interfaceId\":\"Interface identifier to check\"},\"returns\":{\"_0\":\"bool True if interface is supported\"}},\"symbol()\":{\"details\":\"See {IERC721Metadata-symbol}.\"},\"tokenByIndex(uint256)\":{\"details\":\"See {IERC721Enumerable-tokenByIndex}.\"},\"tokenOfOwnerByIndex(address,uint256)\":{\"details\":\"See {IERC721Enumerable-tokenOfOwnerByIndex}.\"},\"tokenURI(uint256)\":{\"params\":{\"tokenId\":\"Token ID to query\"},\"returns\":{\"_0\":\"URI string\"}},\"totalSupply()\":{\"details\":\"See {IERC721Enumerable-totalSupply}.\"},\"transferFrom(address,address,uint256)\":{\"details\":\"See {IERC721-transferFrom}.\"},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.\"}},\"title\":\"Cross-chain Membership NFT Contract\",\"version\":1},\"userdoc\":{\"events\":{\"DelegationSynced(address,address,uint256)\":{\"notice\":\"Emitted when delegation is synchronized across chains\"},\"MembershipClaimed(uint256,address,uint256)\":{\"notice\":\"Emitted when a membership is claimed\"},\"MembershipRevoked(uint256,address,uint256)\":{\"notice\":\"Emitted when a membership is revoked\"},\"MetadataUpdated(uint256,string,uint256)\":{\"notice\":\"Emitted when metadata is updated\"}},\"kind\":\"user\",\"methods\":{\"CLOCK_MODE()\":{\"notice\":\"Gets clock mode description\"},\"claimDelegation(bytes)\":{\"notice\":\"Claims a delegation operation on a foreign chain\"},\"claimOperation(bytes)\":{\"notice\":\"Claims an NFT operation on a foreign chain\"},\"clock()\":{\"notice\":\"Gets current timestamp\"},\"constructor\":{\"notice\":\"Initializes the NFT contract\"},\"delegate(address)\":{\"notice\":\"Delegates voting power to another address on home chain\"},\"generateDelegationProof(address,address)\":{\"notice\":\"Generates proof for delegation\"},\"generateOperationProof(uint8,bytes)\":{\"notice\":\"Generates proof for NFT operations\"},\"govBurn(uint256)\":{\"notice\":\"Burns token on home chain\"},\"home()\":{\"notice\":\"Chain ID where contract was originally deployed\"},\"safeMint(address,string)\":{\"notice\":\"Adds a new member on home chain\"},\"setMetadata(uint256,string)\":{\"notice\":\"Updates token metadata on home chain\"},\"supportsInterface(bytes4)\":{\"notice\":\"Checks interface support\"},\"tokenURI(uint256)\":{\"notice\":\"Gets token URI\"}},\"notice\":\"Non-transferable NFT implementation for DAO membership with cross-chain capabilities\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/variants/crosschain/NFT.sol\":\"NFT\"},\"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 v5.0.0) (access/Ownable.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {Context} from \\\"../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 * The initial owner is set to the address provided by the deployer. This can\\n * 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 /**\\n * @dev The caller account is not authorized to perform an operation.\\n */\\n error OwnableUnauthorizedAccount(address account);\\n\\n /**\\n * @dev The owner is not a valid owner account. (eg. `address(0)`)\\n */\\n error OwnableInvalidOwner(address owner);\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the address provided by the deployer as the initial owner.\\n */\\n constructor(address initialOwner) {\\n if (initialOwner == address(0)) {\\n revert OwnableInvalidOwner(address(0));\\n }\\n _transferOwnership(initialOwner);\\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 if (owner() != _msgSender()) {\\n revert OwnableUnauthorizedAccount(_msgSender());\\n }\\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 if (newOwner == address(0)) {\\n revert OwnableInvalidOwner(address(0));\\n }\\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\":\"0xff6d0bb2e285473e5311d9d3caacb525ae3538a80758c10649a4d61029b017bb\",\"license\":\"MIT\"},\"@openzeppelin/contracts/governance/utils/IVotes.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (governance/utils/IVotes.sol)\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Common interface for {ERC20Votes}, {ERC721Votes}, and other {Votes}-enabled contracts.\\n */\\ninterface IVotes {\\n /**\\n * @dev The signature used has expired.\\n */\\n error VotesExpiredSignature(uint256 expiry);\\n\\n /**\\n * @dev Emitted when an account changes their delegate.\\n */\\n event DelegateChanged(address indexed delegator, address indexed fromDelegate, address indexed toDelegate);\\n\\n /**\\n * @dev Emitted when a token transfer or delegate change results in changes to a delegate's number of voting units.\\n */\\n event DelegateVotesChanged(address indexed delegate, uint256 previousVotes, uint256 newVotes);\\n\\n /**\\n * @dev Returns the current amount of votes that `account` has.\\n */\\n function getVotes(address account) external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of votes that `account` had at a specific moment in the past. If the `clock()` is\\n * configured to use block numbers, this will return the value at the end of the corresponding block.\\n */\\n function getPastVotes(address account, uint256 timepoint) external view returns (uint256);\\n\\n /**\\n * @dev Returns the total supply of votes available at a specific moment in the past. If the `clock()` is\\n * configured to use block numbers, this will return the value at the end of the corresponding block.\\n *\\n * NOTE: This value is the sum of all available votes, which is not necessarily the sum of all delegated votes.\\n * Votes that have not been delegated are still part of total supply, even though they would not participate in a\\n * vote.\\n */\\n function getPastTotalSupply(uint256 timepoint) external view returns (uint256);\\n\\n /**\\n * @dev Returns the delegate that `account` has chosen.\\n */\\n function delegates(address account) external view returns (address);\\n\\n /**\\n * @dev Delegates votes from the sender to `delegatee`.\\n */\\n function delegate(address delegatee) external;\\n\\n /**\\n * @dev Delegates votes from signer to `delegatee`.\\n */\\n function delegateBySig(address delegatee, uint256 nonce, uint256 expiry, uint8 v, bytes32 r, bytes32 s) external;\\n}\\n\",\"keccak256\":\"0x5e2b397ae88fd5c68e4f6762eb9f65f65c36702eb57796495f471d024ce70947\",\"license\":\"MIT\"},\"@openzeppelin/contracts/governance/utils/Votes.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (governance/utils/Votes.sol)\\npragma solidity ^0.8.20;\\n\\nimport {IERC5805} from \\\"../../interfaces/IERC5805.sol\\\";\\nimport {Context} from \\\"../../utils/Context.sol\\\";\\nimport {Nonces} from \\\"../../utils/Nonces.sol\\\";\\nimport {EIP712} from \\\"../../utils/cryptography/EIP712.sol\\\";\\nimport {Checkpoints} from \\\"../../utils/structs/Checkpoints.sol\\\";\\nimport {SafeCast} from \\\"../../utils/math/SafeCast.sol\\\";\\nimport {ECDSA} from \\\"../../utils/cryptography/ECDSA.sol\\\";\\nimport {Time} from \\\"../../utils/types/Time.sol\\\";\\n\\n/**\\n * @dev This is a base abstract contract that tracks voting units, which are a measure of voting power that can be\\n * transferred, and provides a system of vote delegation, where an account can delegate its voting units to a sort of\\n * \\\"representative\\\" that will pool delegated voting units from different accounts and can then use it to vote in\\n * decisions. In fact, voting units _must_ be delegated in order to count as actual votes, and an account has to\\n * delegate those votes to itself if it wishes to participate in decisions and does not have a trusted representative.\\n *\\n * This contract is often combined with a token contract such that voting units correspond to token units. For an\\n * example, see {ERC721Votes}.\\n *\\n * The full history of delegate votes is tracked on-chain so that governance protocols can consider votes as distributed\\n * at a particular block number to protect against flash loans and double voting. The opt-in delegate system makes the\\n * cost of this history tracking optional.\\n *\\n * When using this module the derived contract must implement {_getVotingUnits} (for example, make it return\\n * {ERC721-balanceOf}), and can use {_transferVotingUnits} to track a change in the distribution of those units (in the\\n * previous example, it would be included in {ERC721-_update}).\\n */\\nabstract contract Votes is Context, EIP712, Nonces, IERC5805 {\\n using Checkpoints for Checkpoints.Trace208;\\n\\n bytes32 private constant DELEGATION_TYPEHASH =\\n keccak256(\\\"Delegation(address delegatee,uint256 nonce,uint256 expiry)\\\");\\n\\n mapping(address account => address) private _delegatee;\\n\\n mapping(address delegatee => Checkpoints.Trace208) private _delegateCheckpoints;\\n\\n Checkpoints.Trace208 private _totalCheckpoints;\\n\\n /**\\n * @dev The clock was incorrectly modified.\\n */\\n error ERC6372InconsistentClock();\\n\\n /**\\n * @dev Lookup to future votes is not available.\\n */\\n error ERC5805FutureLookup(uint256 timepoint, uint48 clock);\\n\\n /**\\n * @dev Clock used for flagging checkpoints. Can be overridden to implement timestamp based\\n * checkpoints (and voting), in which case {CLOCK_MODE} should be overridden as well to match.\\n */\\n function clock() public view virtual returns (uint48) {\\n return Time.blockNumber();\\n }\\n\\n /**\\n * @dev Machine-readable description of the clock as specified in ERC-6372.\\n */\\n // solhint-disable-next-line func-name-mixedcase\\n function CLOCK_MODE() public view virtual returns (string memory) {\\n // Check that the clock was not modified\\n if (clock() != Time.blockNumber()) {\\n revert ERC6372InconsistentClock();\\n }\\n return \\\"mode=blocknumber&from=default\\\";\\n }\\n\\n /**\\n * @dev Returns the current amount of votes that `account` has.\\n */\\n function getVotes(address account) public view virtual returns (uint256) {\\n return _delegateCheckpoints[account].latest();\\n }\\n\\n /**\\n * @dev Returns the amount of votes that `account` had at a specific moment in the past. If the `clock()` is\\n * configured to use block numbers, this will return the value at the end of the corresponding block.\\n *\\n * Requirements:\\n *\\n * - `timepoint` must be in the past. If operating using block numbers, the block must be already mined.\\n */\\n function getPastVotes(address account, uint256 timepoint) public view virtual returns (uint256) {\\n uint48 currentTimepoint = clock();\\n if (timepoint >= currentTimepoint) {\\n revert ERC5805FutureLookup(timepoint, currentTimepoint);\\n }\\n return _delegateCheckpoints[account].upperLookupRecent(SafeCast.toUint48(timepoint));\\n }\\n\\n /**\\n * @dev Returns the total supply of votes available at a specific moment in the past. If the `clock()` is\\n * configured to use block numbers, this will return the value at the end of the corresponding block.\\n *\\n * NOTE: This value is the sum of all available votes, which is not necessarily the sum of all delegated votes.\\n * Votes that have not been delegated are still part of total supply, even though they would not participate in a\\n * vote.\\n *\\n * Requirements:\\n *\\n * - `timepoint` must be in the past. If operating using block numbers, the block must be already mined.\\n */\\n function getPastTotalSupply(uint256 timepoint) public view virtual returns (uint256) {\\n uint48 currentTimepoint = clock();\\n if (timepoint >= currentTimepoint) {\\n revert ERC5805FutureLookup(timepoint, currentTimepoint);\\n }\\n return _totalCheckpoints.upperLookupRecent(SafeCast.toUint48(timepoint));\\n }\\n\\n /**\\n * @dev Returns the current total supply of votes.\\n */\\n function _getTotalSupply() internal view virtual returns (uint256) {\\n return _totalCheckpoints.latest();\\n }\\n\\n /**\\n * @dev Returns the delegate that `account` has chosen.\\n */\\n function delegates(address account) public view virtual returns (address) {\\n return _delegatee[account];\\n }\\n\\n /**\\n * @dev Delegates votes from the sender to `delegatee`.\\n */\\n function delegate(address delegatee) public virtual {\\n address account = _msgSender();\\n _delegate(account, delegatee);\\n }\\n\\n /**\\n * @dev Delegates votes from signer to `delegatee`.\\n */\\n function delegateBySig(\\n address delegatee,\\n uint256 nonce,\\n uint256 expiry,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) public virtual {\\n if (block.timestamp > expiry) {\\n revert VotesExpiredSignature(expiry);\\n }\\n address signer = ECDSA.recover(\\n _hashTypedDataV4(keccak256(abi.encode(DELEGATION_TYPEHASH, delegatee, nonce, expiry))),\\n v,\\n r,\\n s\\n );\\n _useCheckedNonce(signer, nonce);\\n _delegate(signer, delegatee);\\n }\\n\\n /**\\n * @dev Delegate all of `account`'s voting units to `delegatee`.\\n *\\n * Emits events {IVotes-DelegateChanged} and {IVotes-DelegateVotesChanged}.\\n */\\n function _delegate(address account, address delegatee) internal virtual {\\n address oldDelegate = delegates(account);\\n _delegatee[account] = delegatee;\\n\\n emit DelegateChanged(account, oldDelegate, delegatee);\\n _moveDelegateVotes(oldDelegate, delegatee, _getVotingUnits(account));\\n }\\n\\n /**\\n * @dev Transfers, mints, or burns voting units. To register a mint, `from` should be zero. To register a burn, `to`\\n * should be zero. Total supply of voting units will be adjusted with mints and burns.\\n */\\n function _transferVotingUnits(address from, address to, uint256 amount) internal virtual {\\n if (from == address(0)) {\\n _push(_totalCheckpoints, _add, SafeCast.toUint208(amount));\\n }\\n if (to == address(0)) {\\n _push(_totalCheckpoints, _subtract, SafeCast.toUint208(amount));\\n }\\n _moveDelegateVotes(delegates(from), delegates(to), amount);\\n }\\n\\n /**\\n * @dev Moves delegated votes from one delegate to another.\\n */\\n function _moveDelegateVotes(address from, address to, uint256 amount) internal virtual {\\n if (from != to && amount > 0) {\\n if (from != address(0)) {\\n (uint256 oldValue, uint256 newValue) = _push(\\n _delegateCheckpoints[from],\\n _subtract,\\n SafeCast.toUint208(amount)\\n );\\n emit DelegateVotesChanged(from, oldValue, newValue);\\n }\\n if (to != address(0)) {\\n (uint256 oldValue, uint256 newValue) = _push(\\n _delegateCheckpoints[to],\\n _add,\\n SafeCast.toUint208(amount)\\n );\\n emit DelegateVotesChanged(to, oldValue, newValue);\\n }\\n }\\n }\\n\\n /**\\n * @dev Get number of checkpoints for `account`.\\n */\\n function _numCheckpoints(address account) internal view virtual returns (uint32) {\\n return SafeCast.toUint32(_delegateCheckpoints[account].length());\\n }\\n\\n /**\\n * @dev Get the `pos`-th checkpoint for `account`.\\n */\\n function _checkpoints(\\n address account,\\n uint32 pos\\n ) internal view virtual returns (Checkpoints.Checkpoint208 memory) {\\n return _delegateCheckpoints[account].at(pos);\\n }\\n\\n function _push(\\n Checkpoints.Trace208 storage store,\\n function(uint208, uint208) view returns (uint208) op,\\n uint208 delta\\n ) private returns (uint208 oldValue, uint208 newValue) {\\n return store.push(clock(), op(store.latest(), delta));\\n }\\n\\n function _add(uint208 a, uint208 b) private pure returns (uint208) {\\n return a + b;\\n }\\n\\n function _subtract(uint208 a, uint208 b) private pure returns (uint208) {\\n return a - b;\\n }\\n\\n /**\\n * @dev Must return the voting units held by an account.\\n */\\n function _getVotingUnits(address) internal view virtual returns (uint256);\\n}\\n\",\"keccak256\":\"0x9128a324d265044430e5fa4a6a2853e92d6a62a2a5a69c2fc623f5b7b8cf3f34\",\"license\":\"MIT\"},\"@openzeppelin/contracts/interfaces/IERC165.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC165.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {IERC165} from \\\"../utils/introspection/IERC165.sol\\\";\\n\",\"keccak256\":\"0xde7e9fd9aee8d4f40772f96bb3b58836cbc6dfc0227014a061947f8821ea9724\",\"license\":\"MIT\"},\"@openzeppelin/contracts/interfaces/IERC4906.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (interfaces/IERC4906.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {IERC165} from \\\"./IERC165.sol\\\";\\nimport {IERC721} from \\\"./IERC721.sol\\\";\\n\\n/// @title ERC-721 Metadata Update Extension\\ninterface IERC4906 is IERC165, IERC721 {\\n /// @dev This event emits when the metadata of a token is changed.\\n /// So that the third-party platforms such as NFT market could\\n /// timely update the images and related attributes of the NFT.\\n event MetadataUpdate(uint256 _tokenId);\\n\\n /// @dev This event emits when the metadata of a range of tokens is changed.\\n /// So that the third-party platforms such as NFT market could\\n /// timely update the images and related attributes of the NFTs.\\n event BatchMetadataUpdate(uint256 _fromTokenId, uint256 _toTokenId);\\n}\\n\",\"keccak256\":\"0x1b8691e244f6e11d987459993671db0af33e6a29f7805eac6a9925cc6b601957\",\"license\":\"MIT\"},\"@openzeppelin/contracts/interfaces/IERC5267.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC5267.sol)\\n\\npragma solidity ^0.8.20;\\n\\ninterface IERC5267 {\\n /**\\n * @dev MAY be emitted to signal that the domain could have changed.\\n */\\n event EIP712DomainChanged();\\n\\n /**\\n * @dev returns the fields and values that describe the domain separator used by this contract for EIP-712\\n * signature.\\n */\\n function eip712Domain()\\n external\\n view\\n returns (\\n bytes1 fields,\\n string memory name,\\n string memory version,\\n uint256 chainId,\\n address verifyingContract,\\n bytes32 salt,\\n uint256[] memory extensions\\n );\\n}\\n\",\"keccak256\":\"0x92aa1df62dc3d33f1656d63bede0923e0df0b706ad4137c8b10b0a8fe549fd92\",\"license\":\"MIT\"},\"@openzeppelin/contracts/interfaces/IERC5805.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC5805.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {IVotes} from \\\"../governance/utils/IVotes.sol\\\";\\nimport {IERC6372} from \\\"./IERC6372.sol\\\";\\n\\ninterface IERC5805 is IERC6372, IVotes {}\\n\",\"keccak256\":\"0x4b9b89f91adbb7d3574f85394754cfb08c5b4eafca8a7061e2094a019ab8f818\",\"license\":\"MIT\"},\"@openzeppelin/contracts/interfaces/IERC6372.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC6372.sol)\\n\\npragma solidity ^0.8.20;\\n\\ninterface IERC6372 {\\n /**\\n * @dev Clock used for flagging checkpoints. Can be overridden to implement timestamp based checkpoints (and voting).\\n */\\n function clock() external view returns (uint48);\\n\\n /**\\n * @dev Description of the clock\\n */\\n // solhint-disable-next-line func-name-mixedcase\\n function CLOCK_MODE() external view returns (string memory);\\n}\\n\",\"keccak256\":\"0xeb2857b7dafb7e0d8526dbfe794e6c047df2851c9e6ee91dc4a55f3c34af5d33\",\"license\":\"MIT\"},\"@openzeppelin/contracts/interfaces/IERC721.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC721.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {IERC721} from \\\"../token/ERC721/IERC721.sol\\\";\\n\",\"keccak256\":\"0xc4d7ebf63eb2f6bf3fee1b6c0ee775efa9f31b4843a5511d07eea147e212932d\",\"license\":\"MIT\"},\"@openzeppelin/contracts/interfaces/draft-IERC6093.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (interfaces/draft-IERC6093.sol)\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Standard ERC-20 Errors\\n * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC-20 tokens.\\n */\\ninterface IERC20Errors {\\n /**\\n * @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers.\\n * @param sender Address whose tokens are being transferred.\\n * @param balance Current balance for the interacting account.\\n * @param needed Minimum amount required to perform a transfer.\\n */\\n error ERC20InsufficientBalance(address sender, uint256 balance, uint256 needed);\\n\\n /**\\n * @dev Indicates a failure with the token `sender`. Used in transfers.\\n * @param sender Address whose tokens are being transferred.\\n */\\n error ERC20InvalidSender(address sender);\\n\\n /**\\n * @dev Indicates a failure with the token `receiver`. Used in transfers.\\n * @param receiver Address to which tokens are being transferred.\\n */\\n error ERC20InvalidReceiver(address receiver);\\n\\n /**\\n * @dev Indicates a failure with the `spender`\\u2019s `allowance`. Used in transfers.\\n * @param spender Address that may be allowed to operate on tokens without being their owner.\\n * @param allowance Amount of tokens a `spender` is allowed to operate with.\\n * @param needed Minimum amount required to perform a transfer.\\n */\\n error ERC20InsufficientAllowance(address spender, uint256 allowance, uint256 needed);\\n\\n /**\\n * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.\\n * @param approver Address initiating an approval operation.\\n */\\n error ERC20InvalidApprover(address approver);\\n\\n /**\\n * @dev Indicates a failure with the `spender` to be approved. Used in approvals.\\n * @param spender Address that may be allowed to operate on tokens without being their owner.\\n */\\n error ERC20InvalidSpender(address spender);\\n}\\n\\n/**\\n * @dev Standard ERC-721 Errors\\n * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC-721 tokens.\\n */\\ninterface IERC721Errors {\\n /**\\n * @dev Indicates that an address can't be an owner. For example, `address(0)` is a forbidden owner in ERC-20.\\n * Used in balance queries.\\n * @param owner Address of the current owner of a token.\\n */\\n error ERC721InvalidOwner(address owner);\\n\\n /**\\n * @dev Indicates a `tokenId` whose `owner` is the zero address.\\n * @param tokenId Identifier number of a token.\\n */\\n error ERC721NonexistentToken(uint256 tokenId);\\n\\n /**\\n * @dev Indicates an error related to the ownership over a particular token. Used in transfers.\\n * @param sender Address whose tokens are being transferred.\\n * @param tokenId Identifier number of a token.\\n * @param owner Address of the current owner of a token.\\n */\\n error ERC721IncorrectOwner(address sender, uint256 tokenId, address owner);\\n\\n /**\\n * @dev Indicates a failure with the token `sender`. Used in transfers.\\n * @param sender Address whose tokens are being transferred.\\n */\\n error ERC721InvalidSender(address sender);\\n\\n /**\\n * @dev Indicates a failure with the token `receiver`. Used in transfers.\\n * @param receiver Address to which tokens are being transferred.\\n */\\n error ERC721InvalidReceiver(address receiver);\\n\\n /**\\n * @dev Indicates a failure with the `operator`\\u2019s approval. Used in transfers.\\n * @param operator Address that may be allowed to operate on tokens without being their owner.\\n * @param tokenId Identifier number of a token.\\n */\\n error ERC721InsufficientApproval(address operator, uint256 tokenId);\\n\\n /**\\n * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.\\n * @param approver Address initiating an approval operation.\\n */\\n error ERC721InvalidApprover(address approver);\\n\\n /**\\n * @dev Indicates a failure with the `operator` to be approved. Used in approvals.\\n * @param operator Address that may be allowed to operate on tokens without being their owner.\\n */\\n error ERC721InvalidOperator(address operator);\\n}\\n\\n/**\\n * @dev Standard ERC-1155 Errors\\n * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC-1155 tokens.\\n */\\ninterface IERC1155Errors {\\n /**\\n * @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers.\\n * @param sender Address whose tokens are being transferred.\\n * @param balance Current balance for the interacting account.\\n * @param needed Minimum amount required to perform a transfer.\\n * @param tokenId Identifier number of a token.\\n */\\n error ERC1155InsufficientBalance(address sender, uint256 balance, uint256 needed, uint256 tokenId);\\n\\n /**\\n * @dev Indicates a failure with the token `sender`. Used in transfers.\\n * @param sender Address whose tokens are being transferred.\\n */\\n error ERC1155InvalidSender(address sender);\\n\\n /**\\n * @dev Indicates a failure with the token `receiver`. Used in transfers.\\n * @param receiver Address to which tokens are being transferred.\\n */\\n error ERC1155InvalidReceiver(address receiver);\\n\\n /**\\n * @dev Indicates a failure with the `operator`\\u2019s approval. Used in transfers.\\n * @param operator Address that may be allowed to operate on tokens without being their owner.\\n * @param owner Address of the current owner of a token.\\n */\\n error ERC1155MissingApprovalForAll(address operator, address owner);\\n\\n /**\\n * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.\\n * @param approver Address initiating an approval operation.\\n */\\n error ERC1155InvalidApprover(address approver);\\n\\n /**\\n * @dev Indicates a failure with the `operator` to be approved. Used in approvals.\\n * @param operator Address that may be allowed to operate on tokens without being their owner.\\n */\\n error ERC1155InvalidOperator(address operator);\\n\\n /**\\n * @dev Indicates an array length mismatch between ids and values in a safeBatchTransferFrom operation.\\n * Used in batch transfers.\\n * @param idsLength Length of the array of token identifiers\\n * @param valuesLength Length of the array of token amounts\\n */\\n error ERC1155InvalidArrayLength(uint256 idsLength, uint256 valuesLength);\\n}\\n\",\"keccak256\":\"0x880da465c203cec76b10d72dbd87c80f387df4102274f23eea1f9c9b0918792b\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC721/ERC721.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC721/ERC721.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {IERC721} from \\\"./IERC721.sol\\\";\\nimport {IERC721Metadata} from \\\"./extensions/IERC721Metadata.sol\\\";\\nimport {ERC721Utils} from \\\"./utils/ERC721Utils.sol\\\";\\nimport {Context} from \\\"../../utils/Context.sol\\\";\\nimport {Strings} from \\\"../../utils/Strings.sol\\\";\\nimport {IERC165, ERC165} from \\\"../../utils/introspection/ERC165.sol\\\";\\nimport {IERC721Errors} from \\\"../../interfaces/draft-IERC6093.sol\\\";\\n\\n/**\\n * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC-721] Non-Fungible Token Standard, including\\n * the Metadata extension, but not including the Enumerable extension, which is available separately as\\n * {ERC721Enumerable}.\\n */\\nabstract contract ERC721 is Context, ERC165, IERC721, IERC721Metadata, IERC721Errors {\\n using Strings for uint256;\\n\\n // Token name\\n string private _name;\\n\\n // Token symbol\\n string private _symbol;\\n\\n mapping(uint256 tokenId => address) private _owners;\\n\\n mapping(address owner => uint256) private _balances;\\n\\n mapping(uint256 tokenId => address) private _tokenApprovals;\\n\\n mapping(address owner => mapping(address operator => bool)) private _operatorApprovals;\\n\\n /**\\n * @dev Initializes the contract by setting a `name` and a `symbol` to the token collection.\\n */\\n constructor(string memory name_, string memory symbol_) {\\n _name = name_;\\n _symbol = symbol_;\\n }\\n\\n /**\\n * @dev See {IERC165-supportsInterface}.\\n */\\n function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {\\n return\\n interfaceId == type(IERC721).interfaceId ||\\n interfaceId == type(IERC721Metadata).interfaceId ||\\n super.supportsInterface(interfaceId);\\n }\\n\\n /**\\n * @dev See {IERC721-balanceOf}.\\n */\\n function balanceOf(address owner) public view virtual returns (uint256) {\\n if (owner == address(0)) {\\n revert ERC721InvalidOwner(address(0));\\n }\\n return _balances[owner];\\n }\\n\\n /**\\n * @dev See {IERC721-ownerOf}.\\n */\\n function ownerOf(uint256 tokenId) public view virtual returns (address) {\\n return _requireOwned(tokenId);\\n }\\n\\n /**\\n * @dev See {IERC721Metadata-name}.\\n */\\n function name() public view virtual returns (string memory) {\\n return _name;\\n }\\n\\n /**\\n * @dev See {IERC721Metadata-symbol}.\\n */\\n function symbol() public view virtual returns (string memory) {\\n return _symbol;\\n }\\n\\n /**\\n * @dev See {IERC721Metadata-tokenURI}.\\n */\\n function tokenURI(uint256 tokenId) public view virtual returns (string memory) {\\n _requireOwned(tokenId);\\n\\n string memory baseURI = _baseURI();\\n return bytes(baseURI).length > 0 ? string.concat(baseURI, tokenId.toString()) : \\\"\\\";\\n }\\n\\n /**\\n * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each\\n * token will be the concatenation of the `baseURI` and the `tokenId`. Empty\\n * by default, can be overridden in child contracts.\\n */\\n function _baseURI() internal view virtual returns (string memory) {\\n return \\\"\\\";\\n }\\n\\n /**\\n * @dev See {IERC721-approve}.\\n */\\n function approve(address to, uint256 tokenId) public virtual {\\n _approve(to, tokenId, _msgSender());\\n }\\n\\n /**\\n * @dev See {IERC721-getApproved}.\\n */\\n function getApproved(uint256 tokenId) public view virtual returns (address) {\\n _requireOwned(tokenId);\\n\\n return _getApproved(tokenId);\\n }\\n\\n /**\\n * @dev See {IERC721-setApprovalForAll}.\\n */\\n function setApprovalForAll(address operator, bool approved) public virtual {\\n _setApprovalForAll(_msgSender(), operator, approved);\\n }\\n\\n /**\\n * @dev See {IERC721-isApprovedForAll}.\\n */\\n function isApprovedForAll(address owner, address operator) public view virtual returns (bool) {\\n return _operatorApprovals[owner][operator];\\n }\\n\\n /**\\n * @dev See {IERC721-transferFrom}.\\n */\\n function transferFrom(address from, address to, uint256 tokenId) public virtual {\\n if (to == address(0)) {\\n revert ERC721InvalidReceiver(address(0));\\n }\\n // Setting an \\\"auth\\\" arguments enables the `_isAuthorized` check which verifies that the token exists\\n // (from != 0). Therefore, it is not needed to verify that the return value is not 0 here.\\n address previousOwner = _update(to, tokenId, _msgSender());\\n if (previousOwner != from) {\\n revert ERC721IncorrectOwner(from, tokenId, previousOwner);\\n }\\n }\\n\\n /**\\n * @dev See {IERC721-safeTransferFrom}.\\n */\\n function safeTransferFrom(address from, address to, uint256 tokenId) public {\\n safeTransferFrom(from, to, tokenId, \\\"\\\");\\n }\\n\\n /**\\n * @dev See {IERC721-safeTransferFrom}.\\n */\\n function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory data) public virtual {\\n transferFrom(from, to, tokenId);\\n ERC721Utils.checkOnERC721Received(_msgSender(), from, to, tokenId, data);\\n }\\n\\n /**\\n * @dev Returns the owner of the `tokenId`. Does NOT revert if token doesn't exist\\n *\\n * IMPORTANT: Any overrides to this function that add ownership of tokens not tracked by the\\n * core ERC-721 logic MUST be matched with the use of {_increaseBalance} to keep balances\\n * consistent with ownership. The invariant to preserve is that for any address `a` the value returned by\\n * `balanceOf(a)` must be equal to the number of tokens such that `_ownerOf(tokenId)` is `a`.\\n */\\n function _ownerOf(uint256 tokenId) internal view virtual returns (address) {\\n return _owners[tokenId];\\n }\\n\\n /**\\n * @dev Returns the approved address for `tokenId`. Returns 0 if `tokenId` is not minted.\\n */\\n function _getApproved(uint256 tokenId) internal view virtual returns (address) {\\n return _tokenApprovals[tokenId];\\n }\\n\\n /**\\n * @dev Returns whether `spender` is allowed to manage `owner`'s tokens, or `tokenId` in\\n * particular (ignoring whether it is owned by `owner`).\\n *\\n * WARNING: This function assumes that `owner` is the actual owner of `tokenId` and does not verify this\\n * assumption.\\n */\\n function _isAuthorized(address owner, address spender, uint256 tokenId) internal view virtual returns (bool) {\\n return\\n spender != address(0) &&\\n (owner == spender || isApprovedForAll(owner, spender) || _getApproved(tokenId) == spender);\\n }\\n\\n /**\\n * @dev Checks if `spender` can operate on `tokenId`, assuming the provided `owner` is the actual owner.\\n * Reverts if:\\n * - `spender` does not have approval from `owner` for `tokenId`.\\n * - `spender` does not have approval to manage all of `owner`'s assets.\\n *\\n * WARNING: This function assumes that `owner` is the actual owner of `tokenId` and does not verify this\\n * assumption.\\n */\\n function _checkAuthorized(address owner, address spender, uint256 tokenId) internal view virtual {\\n if (!_isAuthorized(owner, spender, tokenId)) {\\n if (owner == address(0)) {\\n revert ERC721NonexistentToken(tokenId);\\n } else {\\n revert ERC721InsufficientApproval(spender, tokenId);\\n }\\n }\\n }\\n\\n /**\\n * @dev Unsafe write access to the balances, used by extensions that \\\"mint\\\" tokens using an {ownerOf} override.\\n *\\n * NOTE: the value is limited to type(uint128).max. This protect against _balance overflow. It is unrealistic that\\n * a uint256 would ever overflow from increments when these increments are bounded to uint128 values.\\n *\\n * WARNING: Increasing an account's balance using this function tends to be paired with an override of the\\n * {_ownerOf} function to resolve the ownership of the corresponding tokens so that balances and ownership\\n * remain consistent with one another.\\n */\\n function _increaseBalance(address account, uint128 value) internal virtual {\\n unchecked {\\n _balances[account] += value;\\n }\\n }\\n\\n /**\\n * @dev Transfers `tokenId` from its current owner to `to`, or alternatively mints (or burns) if the current owner\\n * (or `to`) is the zero address. Returns the owner of the `tokenId` before the update.\\n *\\n * The `auth` argument is optional. If the value passed is non 0, then this function will check that\\n * `auth` is either the owner of the token, or approved to operate on the token (by the owner).\\n *\\n * Emits a {Transfer} event.\\n *\\n * NOTE: If overriding this function in a way that tracks balances, see also {_increaseBalance}.\\n */\\n function _update(address to, uint256 tokenId, address auth) internal virtual returns (address) {\\n address from = _ownerOf(tokenId);\\n\\n // Perform (optional) operator check\\n if (auth != address(0)) {\\n _checkAuthorized(from, auth, tokenId);\\n }\\n\\n // Execute the update\\n if (from != address(0)) {\\n // Clear approval. No need to re-authorize or emit the Approval event\\n _approve(address(0), tokenId, address(0), false);\\n\\n unchecked {\\n _balances[from] -= 1;\\n }\\n }\\n\\n if (to != address(0)) {\\n unchecked {\\n _balances[to] += 1;\\n }\\n }\\n\\n _owners[tokenId] = to;\\n\\n emit Transfer(from, to, tokenId);\\n\\n return from;\\n }\\n\\n /**\\n * @dev Mints `tokenId` and transfers it to `to`.\\n *\\n * WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible\\n *\\n * Requirements:\\n *\\n * - `tokenId` must not exist.\\n * - `to` cannot be the zero address.\\n *\\n * Emits a {Transfer} event.\\n */\\n function _mint(address to, uint256 tokenId) internal {\\n if (to == address(0)) {\\n revert ERC721InvalidReceiver(address(0));\\n }\\n address previousOwner = _update(to, tokenId, address(0));\\n if (previousOwner != address(0)) {\\n revert ERC721InvalidSender(address(0));\\n }\\n }\\n\\n /**\\n * @dev Mints `tokenId`, transfers it to `to` and checks for `to` acceptance.\\n *\\n * Requirements:\\n *\\n * - `tokenId` must not exist.\\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\\n *\\n * Emits a {Transfer} event.\\n */\\n function _safeMint(address to, uint256 tokenId) internal {\\n _safeMint(to, tokenId, \\\"\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is\\n * forwarded in {IERC721Receiver-onERC721Received} to contract recipients.\\n */\\n function _safeMint(address to, uint256 tokenId, bytes memory data) internal virtual {\\n _mint(to, tokenId);\\n ERC721Utils.checkOnERC721Received(_msgSender(), address(0), to, tokenId, data);\\n }\\n\\n /**\\n * @dev Destroys `tokenId`.\\n * The approval is cleared when the token is burned.\\n * This is an internal function that does not check if the sender is authorized to operate on the token.\\n *\\n * Requirements:\\n *\\n * - `tokenId` must exist.\\n *\\n * Emits a {Transfer} event.\\n */\\n function _burn(uint256 tokenId) internal {\\n address previousOwner = _update(address(0), tokenId, address(0));\\n if (previousOwner == address(0)) {\\n revert ERC721NonexistentToken(tokenId);\\n }\\n }\\n\\n /**\\n * @dev Transfers `tokenId` from `from` to `to`.\\n * As opposed to {transferFrom}, this imposes no restrictions on msg.sender.\\n *\\n * Requirements:\\n *\\n * - `to` cannot be the zero address.\\n * - `tokenId` token must be owned by `from`.\\n *\\n * Emits a {Transfer} event.\\n */\\n function _transfer(address from, address to, uint256 tokenId) internal {\\n if (to == address(0)) {\\n revert ERC721InvalidReceiver(address(0));\\n }\\n address previousOwner = _update(to, tokenId, address(0));\\n if (previousOwner == address(0)) {\\n revert ERC721NonexistentToken(tokenId);\\n } else if (previousOwner != from) {\\n revert ERC721IncorrectOwner(from, tokenId, previousOwner);\\n }\\n }\\n\\n /**\\n * @dev Safely transfers `tokenId` token from `from` to `to`, checking that contract recipients\\n * are aware of the ERC-721 standard to prevent tokens from being forever locked.\\n *\\n * `data` is additional data, it has no specified format and it is sent in call to `to`.\\n *\\n * This internal function is like {safeTransferFrom} in the sense that it invokes\\n * {IERC721Receiver-onERC721Received} on the receiver, and can be used to e.g.\\n * implement alternative mechanisms to perform token transfer, such as signature-based.\\n *\\n * Requirements:\\n *\\n * - `tokenId` token must exist and be owned by `from`.\\n * - `to` cannot be the zero address.\\n * - `from` cannot be the zero address.\\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\\n *\\n * Emits a {Transfer} event.\\n */\\n function _safeTransfer(address from, address to, uint256 tokenId) internal {\\n _safeTransfer(from, to, tokenId, \\\"\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-ERC721-_safeTransfer-address-address-uint256-}[`_safeTransfer`], with an additional `data` parameter which is\\n * forwarded in {IERC721Receiver-onERC721Received} to contract recipients.\\n */\\n function _safeTransfer(address from, address to, uint256 tokenId, bytes memory data) internal virtual {\\n _transfer(from, to, tokenId);\\n ERC721Utils.checkOnERC721Received(_msgSender(), from, to, tokenId, data);\\n }\\n\\n /**\\n * @dev Approve `to` to operate on `tokenId`\\n *\\n * The `auth` argument is optional. If the value passed is non 0, then this function will check that `auth` is\\n * either the owner of the token, or approved to operate on all tokens held by this owner.\\n *\\n * Emits an {Approval} event.\\n *\\n * Overrides to this logic should be done to the variant with an additional `bool emitEvent` argument.\\n */\\n function _approve(address to, uint256 tokenId, address auth) internal {\\n _approve(to, tokenId, auth, true);\\n }\\n\\n /**\\n * @dev Variant of `_approve` with an optional flag to enable or disable the {Approval} event. The event is not\\n * emitted in the context of transfers.\\n */\\n function _approve(address to, uint256 tokenId, address auth, bool emitEvent) internal virtual {\\n // Avoid reading the owner unless necessary\\n if (emitEvent || auth != address(0)) {\\n address owner = _requireOwned(tokenId);\\n\\n // We do not use _isAuthorized because single-token approvals should not be able to call approve\\n if (auth != address(0) && owner != auth && !isApprovedForAll(owner, auth)) {\\n revert ERC721InvalidApprover(auth);\\n }\\n\\n if (emitEvent) {\\n emit Approval(owner, to, tokenId);\\n }\\n }\\n\\n _tokenApprovals[tokenId] = to;\\n }\\n\\n /**\\n * @dev Approve `operator` to operate on all of `owner` tokens\\n *\\n * Requirements:\\n * - operator can't be the address zero.\\n *\\n * Emits an {ApprovalForAll} event.\\n */\\n function _setApprovalForAll(address owner, address operator, bool approved) internal virtual {\\n if (operator == address(0)) {\\n revert ERC721InvalidOperator(operator);\\n }\\n _operatorApprovals[owner][operator] = approved;\\n emit ApprovalForAll(owner, operator, approved);\\n }\\n\\n /**\\n * @dev Reverts if the `tokenId` doesn't have a current owner (it hasn't been minted, or it has been burned).\\n * Returns the owner.\\n *\\n * Overrides to ownership logic should be done to {_ownerOf}.\\n */\\n function _requireOwned(uint256 tokenId) internal view returns (address) {\\n address owner = _ownerOf(tokenId);\\n if (owner == address(0)) {\\n revert ERC721NonexistentToken(tokenId);\\n }\\n return owner;\\n }\\n}\\n\",\"keccak256\":\"0x39ed367e54765186281efcfe83e47cf0ad62cc879f10e191360712507125f29a\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC721/IERC721.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC721/IERC721.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {IERC165} from \\\"../../utils/introspection/IERC165.sol\\\";\\n\\n/**\\n * @dev Required interface of an ERC-721 compliant contract.\\n */\\ninterface IERC721 is IERC165 {\\n /**\\n * @dev Emitted when `tokenId` token is transferred from `from` to `to`.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);\\n\\n /**\\n * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.\\n */\\n event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);\\n\\n /**\\n * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.\\n */\\n event ApprovalForAll(address indexed owner, address indexed operator, bool approved);\\n\\n /**\\n * @dev Returns the number of tokens in ``owner``'s account.\\n */\\n function balanceOf(address owner) external view returns (uint256 balance);\\n\\n /**\\n * @dev Returns the owner of the `tokenId` token.\\n *\\n * Requirements:\\n *\\n * - `tokenId` must exist.\\n */\\n function ownerOf(uint256 tokenId) external view returns (address owner);\\n\\n /**\\n * @dev Safely transfers `tokenId` token from `from` to `to`.\\n *\\n * Requirements:\\n *\\n * - `from` cannot be the zero address.\\n * - `to` cannot be the zero address.\\n * - `tokenId` token must exist and be owned by `from`.\\n * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.\\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon\\n * a safe transfer.\\n *\\n * Emits a {Transfer} event.\\n */\\n function safeTransferFrom(address from, address to, uint256 tokenId, bytes calldata data) external;\\n\\n /**\\n * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients\\n * are aware of the ERC-721 protocol to prevent tokens from being forever locked.\\n *\\n * Requirements:\\n *\\n * - `from` cannot be the zero address.\\n * - `to` cannot be the zero address.\\n * - `tokenId` token must exist and be owned by `from`.\\n * - If the caller is not `from`, it must have been allowed to move this token by either {approve} or\\n * {setApprovalForAll}.\\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon\\n * a safe transfer.\\n *\\n * Emits a {Transfer} event.\\n */\\n function safeTransferFrom(address from, address to, uint256 tokenId) external;\\n\\n /**\\n * @dev Transfers `tokenId` token from `from` to `to`.\\n *\\n * WARNING: Note that the caller is responsible to confirm that the recipient is capable of receiving ERC-721\\n * or else they may be permanently lost. Usage of {safeTransferFrom} prevents loss, though the caller must\\n * understand this adds an external call which potentially creates a reentrancy vulnerability.\\n *\\n * Requirements:\\n *\\n * - `from` cannot be the zero address.\\n * - `to` cannot be the zero address.\\n * - `tokenId` token must be owned by `from`.\\n * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(address from, address to, uint256 tokenId) external;\\n\\n /**\\n * @dev Gives permission to `to` to transfer `tokenId` token to another account.\\n * The approval is cleared when the token is transferred.\\n *\\n * Only a single account can be approved at a time, so approving the zero address clears previous approvals.\\n *\\n * Requirements:\\n *\\n * - The caller must own the token or be an approved operator.\\n * - `tokenId` must exist.\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address to, uint256 tokenId) external;\\n\\n /**\\n * @dev Approve or remove `operator` as an operator for the caller.\\n * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.\\n *\\n * Requirements:\\n *\\n * - The `operator` cannot be the address zero.\\n *\\n * Emits an {ApprovalForAll} event.\\n */\\n function setApprovalForAll(address operator, bool approved) external;\\n\\n /**\\n * @dev Returns the account approved for `tokenId` token.\\n *\\n * Requirements:\\n *\\n * - `tokenId` must exist.\\n */\\n function getApproved(uint256 tokenId) external view returns (address operator);\\n\\n /**\\n * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.\\n *\\n * See {setApprovalForAll}\\n */\\n function isApprovedForAll(address owner, address operator) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x5dc63d1c6a12fe1b17793e1745877b2fcbe1964c3edfd0a482fac21ca8f18261\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC721/IERC721Receiver.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @title ERC-721 token receiver interface\\n * @dev Interface for any contract that wants to support safeTransfers\\n * from ERC-721 asset contracts.\\n */\\ninterface IERC721Receiver {\\n /**\\n * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom}\\n * by `operator` from `from`, this function is called.\\n *\\n * It must return its Solidity selector to confirm the token transfer.\\n * If any other value is returned or the interface is not implemented by the recipient, the transfer will be\\n * reverted.\\n *\\n * The selector can be obtained in Solidity with `IERC721Receiver.onERC721Received.selector`.\\n */\\n function onERC721Received(\\n address operator,\\n address from,\\n uint256 tokenId,\\n bytes calldata data\\n ) external returns (bytes4);\\n}\\n\",\"keccak256\":\"0xb5afb8e8eebc4d1c6404df2f5e1e6d2c3d24fd01e5dfc855314951ecfaae462d\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC721/extensions/ERC721Burnable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC721/extensions/ERC721Burnable.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {ERC721} from \\\"../ERC721.sol\\\";\\nimport {Context} from \\\"../../../utils/Context.sol\\\";\\n\\n/**\\n * @title ERC-721 Burnable Token\\n * @dev ERC-721 Token that can be burned (destroyed).\\n */\\nabstract contract ERC721Burnable is Context, ERC721 {\\n /**\\n * @dev Burns `tokenId`. See {ERC721-_burn}.\\n *\\n * Requirements:\\n *\\n * - The caller must own `tokenId` or be an approved operator.\\n */\\n function burn(uint256 tokenId) public virtual {\\n // Setting an \\\"auth\\\" arguments enables the `_isAuthorized` check which verifies that the token exists\\n // (from != 0). Therefore, it is not needed to verify that the return value is not 0 here.\\n _update(address(0), tokenId, _msgSender());\\n }\\n}\\n\",\"keccak256\":\"0xdee1ff07172e443c6600581fc4f11e7830a6d33e4e551752935b835d52a09404\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC721/extensions/ERC721Enumerable.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {ERC721} from \\\"../ERC721.sol\\\";\\nimport {IERC721Enumerable} from \\\"./IERC721Enumerable.sol\\\";\\nimport {IERC165} from \\\"../../../utils/introspection/ERC165.sol\\\";\\n\\n/**\\n * @dev This implements an optional extension of {ERC721} defined in the ERC that adds enumerability\\n * of all the token ids in the contract as well as all token ids owned by each account.\\n *\\n * CAUTION: {ERC721} extensions that implement custom `balanceOf` logic, such as {ERC721Consecutive},\\n * interfere with enumerability and should not be used together with {ERC721Enumerable}.\\n */\\nabstract contract ERC721Enumerable is ERC721, IERC721Enumerable {\\n mapping(address owner => mapping(uint256 index => uint256)) private _ownedTokens;\\n mapping(uint256 tokenId => uint256) private _ownedTokensIndex;\\n\\n uint256[] private _allTokens;\\n mapping(uint256 tokenId => uint256) private _allTokensIndex;\\n\\n /**\\n * @dev An `owner`'s token query was out of bounds for `index`.\\n *\\n * NOTE: The owner being `address(0)` indicates a global out of bounds index.\\n */\\n error ERC721OutOfBoundsIndex(address owner, uint256 index);\\n\\n /**\\n * @dev Batch mint is not allowed.\\n */\\n error ERC721EnumerableForbiddenBatchMint();\\n\\n /**\\n * @dev See {IERC165-supportsInterface}.\\n */\\n function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165, ERC721) returns (bool) {\\n return interfaceId == type(IERC721Enumerable).interfaceId || super.supportsInterface(interfaceId);\\n }\\n\\n /**\\n * @dev See {IERC721Enumerable-tokenOfOwnerByIndex}.\\n */\\n function tokenOfOwnerByIndex(address owner, uint256 index) public view virtual returns (uint256) {\\n if (index >= balanceOf(owner)) {\\n revert ERC721OutOfBoundsIndex(owner, index);\\n }\\n return _ownedTokens[owner][index];\\n }\\n\\n /**\\n * @dev See {IERC721Enumerable-totalSupply}.\\n */\\n function totalSupply() public view virtual returns (uint256) {\\n return _allTokens.length;\\n }\\n\\n /**\\n * @dev See {IERC721Enumerable-tokenByIndex}.\\n */\\n function tokenByIndex(uint256 index) public view virtual returns (uint256) {\\n if (index >= totalSupply()) {\\n revert ERC721OutOfBoundsIndex(address(0), index);\\n }\\n return _allTokens[index];\\n }\\n\\n /**\\n * @dev See {ERC721-_update}.\\n */\\n function _update(address to, uint256 tokenId, address auth) internal virtual override returns (address) {\\n address previousOwner = super._update(to, tokenId, auth);\\n\\n if (previousOwner == address(0)) {\\n _addTokenToAllTokensEnumeration(tokenId);\\n } else if (previousOwner != to) {\\n _removeTokenFromOwnerEnumeration(previousOwner, tokenId);\\n }\\n if (to == address(0)) {\\n _removeTokenFromAllTokensEnumeration(tokenId);\\n } else if (previousOwner != to) {\\n _addTokenToOwnerEnumeration(to, tokenId);\\n }\\n\\n return previousOwner;\\n }\\n\\n /**\\n * @dev Private function to add a token to this extension's ownership-tracking data structures.\\n * @param to address representing the new owner of the given token ID\\n * @param tokenId uint256 ID of the token to be added to the tokens list of the given address\\n */\\n function _addTokenToOwnerEnumeration(address to, uint256 tokenId) private {\\n uint256 length = balanceOf(to) - 1;\\n _ownedTokens[to][length] = tokenId;\\n _ownedTokensIndex[tokenId] = length;\\n }\\n\\n /**\\n * @dev Private function to add a token to this extension's token tracking data structures.\\n * @param tokenId uint256 ID of the token to be added to the tokens list\\n */\\n function _addTokenToAllTokensEnumeration(uint256 tokenId) private {\\n _allTokensIndex[tokenId] = _allTokens.length;\\n _allTokens.push(tokenId);\\n }\\n\\n /**\\n * @dev Private function to remove a token from this extension's ownership-tracking data structures. Note that\\n * while the token is not assigned a new owner, the `_ownedTokensIndex` mapping is _not_ updated: this allows for\\n * gas optimizations e.g. when performing a transfer operation (avoiding double writes).\\n * This has O(1) time complexity, but alters the order of the _ownedTokens array.\\n * @param from address representing the previous owner of the given token ID\\n * @param tokenId uint256 ID of the token to be removed from the tokens list of the given address\\n */\\n function _removeTokenFromOwnerEnumeration(address from, uint256 tokenId) private {\\n // To prevent a gap in from's tokens array, we store the last token in the index of the token to delete, and\\n // then delete the last slot (swap and pop).\\n\\n uint256 lastTokenIndex = balanceOf(from);\\n uint256 tokenIndex = _ownedTokensIndex[tokenId];\\n\\n mapping(uint256 index => uint256) storage _ownedTokensByOwner = _ownedTokens[from];\\n\\n // When the token to delete is the last token, the swap operation is unnecessary\\n if (tokenIndex != lastTokenIndex) {\\n uint256 lastTokenId = _ownedTokensByOwner[lastTokenIndex];\\n\\n _ownedTokensByOwner[tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token\\n _ownedTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index\\n }\\n\\n // This also deletes the contents at the last position of the array\\n delete _ownedTokensIndex[tokenId];\\n delete _ownedTokensByOwner[lastTokenIndex];\\n }\\n\\n /**\\n * @dev Private function to remove a token from this extension's token tracking data structures.\\n * This has O(1) time complexity, but alters the order of the _allTokens array.\\n * @param tokenId uint256 ID of the token to be removed from the tokens list\\n */\\n function _removeTokenFromAllTokensEnumeration(uint256 tokenId) private {\\n // To prevent a gap in the tokens array, we store the last token in the index of the token to delete, and\\n // then delete the last slot (swap and pop).\\n\\n uint256 lastTokenIndex = _allTokens.length - 1;\\n uint256 tokenIndex = _allTokensIndex[tokenId];\\n\\n // When the token to delete is the last token, the swap operation is unnecessary. However, since this occurs so\\n // rarely (when the last minted token is burnt) that we still do the swap here to avoid the gas cost of adding\\n // an 'if' statement (like in _removeTokenFromOwnerEnumeration)\\n uint256 lastTokenId = _allTokens[lastTokenIndex];\\n\\n _allTokens[tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token\\n _allTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index\\n\\n // This also deletes the contents at the last position of the array\\n delete _allTokensIndex[tokenId];\\n _allTokens.pop();\\n }\\n\\n /**\\n * See {ERC721-_increaseBalance}. We need that to account tokens that were minted in batch\\n */\\n function _increaseBalance(address account, uint128 amount) internal virtual override {\\n if (amount > 0) {\\n revert ERC721EnumerableForbiddenBatchMint();\\n }\\n super._increaseBalance(account, amount);\\n }\\n}\\n\",\"keccak256\":\"0x5191f783af281c75b7de0f1e3e36cdc6ac5cb2358d929584c4953fd02fa2b5eb\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC721/extensions/ERC721URIStorage.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {ERC721} from \\\"../ERC721.sol\\\";\\nimport {Strings} from \\\"../../../utils/Strings.sol\\\";\\nimport {IERC4906} from \\\"../../../interfaces/IERC4906.sol\\\";\\nimport {IERC165} from \\\"../../../interfaces/IERC165.sol\\\";\\n\\n/**\\n * @dev ERC-721 token with storage based token URI management.\\n */\\nabstract contract ERC721URIStorage is IERC4906, ERC721 {\\n using Strings for uint256;\\n\\n // Interface ID as defined in ERC-4906. This does not correspond to a traditional interface ID as ERC-4906 only\\n // defines events and does not include any external function.\\n bytes4 private constant ERC4906_INTERFACE_ID = bytes4(0x49064906);\\n\\n // Optional mapping for token URIs\\n mapping(uint256 tokenId => string) private _tokenURIs;\\n\\n /**\\n * @dev See {IERC165-supportsInterface}\\n */\\n function supportsInterface(bytes4 interfaceId) public view virtual override(ERC721, IERC165) returns (bool) {\\n return interfaceId == ERC4906_INTERFACE_ID || super.supportsInterface(interfaceId);\\n }\\n\\n /**\\n * @dev See {IERC721Metadata-tokenURI}.\\n */\\n function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {\\n _requireOwned(tokenId);\\n\\n string memory _tokenURI = _tokenURIs[tokenId];\\n string memory base = _baseURI();\\n\\n // If there is no base URI, return the token URI.\\n if (bytes(base).length == 0) {\\n return _tokenURI;\\n }\\n // If both are set, concatenate the baseURI and tokenURI (via string.concat).\\n if (bytes(_tokenURI).length > 0) {\\n return string.concat(base, _tokenURI);\\n }\\n\\n return super.tokenURI(tokenId);\\n }\\n\\n /**\\n * @dev Sets `_tokenURI` as the tokenURI of `tokenId`.\\n *\\n * Emits {MetadataUpdate}.\\n */\\n function _setTokenURI(uint256 tokenId, string memory _tokenURI) internal virtual {\\n _tokenURIs[tokenId] = _tokenURI;\\n emit MetadataUpdate(tokenId);\\n }\\n}\\n\",\"keccak256\":\"0xe52813067c6d5838eeb34e1da8beb2514371a7d778266013b04ca3be1dda7100\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC721/extensions/ERC721Votes.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC721/extensions/ERC721Votes.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {ERC721} from \\\"../ERC721.sol\\\";\\nimport {Votes} from \\\"../../../governance/utils/Votes.sol\\\";\\n\\n/**\\n * @dev Extension of ERC-721 to support voting and delegation as implemented by {Votes}, where each individual NFT counts\\n * as 1 vote unit.\\n *\\n * Tokens do not count as votes until they are delegated, because votes must be tracked which incurs an additional cost\\n * on every transfer. Token holders can either delegate to a trusted representative who will decide how to make use of\\n * the votes in governance decisions, or they can delegate to themselves to be their own representative.\\n */\\nabstract contract ERC721Votes is ERC721, Votes {\\n /**\\n * @dev See {ERC721-_update}. Adjusts votes when tokens are transferred.\\n *\\n * Emits a {IVotes-DelegateVotesChanged} event.\\n */\\n function _update(address to, uint256 tokenId, address auth) internal virtual override returns (address) {\\n address previousOwner = super._update(to, tokenId, auth);\\n\\n _transferVotingUnits(previousOwner, to, 1);\\n\\n return previousOwner;\\n }\\n\\n /**\\n * @dev Returns the balance of `account`.\\n *\\n * WARNING: Overriding this function will likely result in incorrect vote tracking.\\n */\\n function _getVotingUnits(address account) internal view virtual override returns (uint256) {\\n return balanceOf(account);\\n }\\n\\n /**\\n * @dev See {ERC721-_increaseBalance}. We need that to account tokens that were minted in batch.\\n */\\n function _increaseBalance(address account, uint128 amount) internal virtual override {\\n super._increaseBalance(account, amount);\\n _transferVotingUnits(address(0), account, amount);\\n }\\n}\\n\",\"keccak256\":\"0x8b245d62f3ce9596d3a52c7b6c738cd95a40fe8dba898e90fcce18bb7a2d8239\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC721/extensions/IERC721Enumerable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC721/extensions/IERC721Enumerable.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {IERC721} from \\\"../IERC721.sol\\\";\\n\\n/**\\n * @title ERC-721 Non-Fungible Token Standard, optional enumeration extension\\n * @dev See https://eips.ethereum.org/EIPS/eip-721\\n */\\ninterface IERC721Enumerable is IERC721 {\\n /**\\n * @dev Returns the total amount of tokens stored by the contract.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns a token ID owned by `owner` at a given `index` of its token list.\\n * Use along with {balanceOf} to enumerate all of ``owner``'s tokens.\\n */\\n function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256);\\n\\n /**\\n * @dev Returns a token ID at a given `index` of all the tokens stored by the contract.\\n * Use along with {totalSupply} to enumerate all tokens.\\n */\\n function tokenByIndex(uint256 index) external view returns (uint256);\\n}\\n\",\"keccak256\":\"0x3d6954a93ac198a2ffa384fa58ccf18e7e235263e051a394328002eff4e073de\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC721/extensions/IERC721Metadata.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {IERC721} from \\\"../IERC721.sol\\\";\\n\\n/**\\n * @title ERC-721 Non-Fungible Token Standard, optional metadata extension\\n * @dev See https://eips.ethereum.org/EIPS/eip-721\\n */\\ninterface IERC721Metadata is IERC721 {\\n /**\\n * @dev Returns the token collection name.\\n */\\n function name() external view returns (string memory);\\n\\n /**\\n * @dev Returns the token collection symbol.\\n */\\n function symbol() external view returns (string memory);\\n\\n /**\\n * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token.\\n */\\n function tokenURI(uint256 tokenId) external view returns (string memory);\\n}\\n\",\"keccak256\":\"0x37d1aaaa5a2908a09e9dcf56a26ddf762ecf295afb5964695937344fc6802ce1\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC721/utils/ERC721Utils.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC721/utils/ERC721Utils.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {IERC721Receiver} from \\\"../IERC721Receiver.sol\\\";\\nimport {IERC721Errors} from \\\"../../../interfaces/draft-IERC6093.sol\\\";\\n\\n/**\\n * @dev Library that provide common ERC-721 utility functions.\\n *\\n * See https://eips.ethereum.org/EIPS/eip-721[ERC-721].\\n *\\n * _Available since v5.1._\\n */\\nlibrary ERC721Utils {\\n /**\\n * @dev Performs an acceptance check for the provided `operator` by calling {IERC721-onERC721Received}\\n * on the `to` address. The `operator` is generally the address that initiated the token transfer (i.e. `msg.sender`).\\n *\\n * The acceptance call is not executed and treated as a no-op if the target address doesn't contain code (i.e. an EOA).\\n * Otherwise, the recipient must implement {IERC721Receiver-onERC721Received} and return the acceptance magic value to accept\\n * the transfer.\\n */\\n function checkOnERC721Received(\\n address operator,\\n address from,\\n address to,\\n uint256 tokenId,\\n bytes memory data\\n ) internal {\\n if (to.code.length > 0) {\\n try IERC721Receiver(to).onERC721Received(operator, from, tokenId, data) returns (bytes4 retval) {\\n if (retval != IERC721Receiver.onERC721Received.selector) {\\n // Token rejected\\n revert IERC721Errors.ERC721InvalidReceiver(to);\\n }\\n } catch (bytes memory reason) {\\n if (reason.length == 0) {\\n // non-IERC721Receiver implementer\\n revert IERC721Errors.ERC721InvalidReceiver(to);\\n } else {\\n assembly (\\\"memory-safe\\\") {\\n revert(add(32, reason), mload(reason))\\n }\\n }\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x40399695922383778f9f540a620bec475a2f8e0f08d41f0005682842e28a9855\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)\\n\\npragma solidity ^0.8.20;\\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\":\"0x493033a8d1b176a037b2cc6a04dad01a5c157722049bbecf632ca876224dd4b2\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Nonces.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/Nonces.sol)\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Provides tracking nonces for addresses. Nonces will only increment.\\n */\\nabstract contract Nonces {\\n /**\\n * @dev The nonce used for an `account` is not the expected current nonce.\\n */\\n error InvalidAccountNonce(address account, uint256 currentNonce);\\n\\n mapping(address account => uint256) private _nonces;\\n\\n /**\\n * @dev Returns the next unused nonce for an address.\\n */\\n function nonces(address owner) public view virtual returns (uint256) {\\n return _nonces[owner];\\n }\\n\\n /**\\n * @dev Consumes a nonce.\\n *\\n * Returns the current value and increments nonce.\\n */\\n function _useNonce(address owner) internal virtual returns (uint256) {\\n // For each account, the nonce has an initial value of 0, can only be incremented by one, and cannot be\\n // decremented or reset. This guarantees that the nonce never overflows.\\n unchecked {\\n // It is important to do x++ and not ++x here.\\n return _nonces[owner]++;\\n }\\n }\\n\\n /**\\n * @dev Same as {_useNonce} but checking that `nonce` is the next valid for `owner`.\\n */\\n function _useCheckedNonce(address owner, uint256 nonce) internal virtual {\\n uint256 current = _useNonce(owner);\\n if (nonce != current) {\\n revert InvalidAccountNonce(owner, current);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x0082767004fca261c332e9ad100868327a863a88ef724e844857128845ab350f\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Panic.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/Panic.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Helper library for emitting standardized panic codes.\\n *\\n * ```solidity\\n * contract Example {\\n * using Panic for uint256;\\n *\\n * // Use any of the declared internal constants\\n * function foo() { Panic.GENERIC.panic(); }\\n *\\n * // Alternatively\\n * function foo() { Panic.panic(Panic.GENERIC); }\\n * }\\n * ```\\n *\\n * Follows the list from https://github.com/ethereum/solidity/blob/v0.8.24/libsolutil/ErrorCodes.h[libsolutil].\\n *\\n * _Available since v5.1._\\n */\\n// slither-disable-next-line unused-state\\nlibrary Panic {\\n /// @dev generic / unspecified error\\n uint256 internal constant GENERIC = 0x00;\\n /// @dev used by the assert() builtin\\n uint256 internal constant ASSERT = 0x01;\\n /// @dev arithmetic underflow or overflow\\n uint256 internal constant UNDER_OVERFLOW = 0x11;\\n /// @dev division or modulo by zero\\n uint256 internal constant DIVISION_BY_ZERO = 0x12;\\n /// @dev enum conversion error\\n uint256 internal constant ENUM_CONVERSION_ERROR = 0x21;\\n /// @dev invalid encoding in storage\\n uint256 internal constant STORAGE_ENCODING_ERROR = 0x22;\\n /// @dev empty array pop\\n uint256 internal constant EMPTY_ARRAY_POP = 0x31;\\n /// @dev array out of bounds access\\n uint256 internal constant ARRAY_OUT_OF_BOUNDS = 0x32;\\n /// @dev resource error (too large allocation or too large array)\\n uint256 internal constant RESOURCE_ERROR = 0x41;\\n /// @dev calling invalid internal function\\n uint256 internal constant INVALID_INTERNAL_FUNCTION = 0x51;\\n\\n /// @dev Reverts with a panic code. Recommended to use with\\n /// the internal constants with predefined codes.\\n function panic(uint256 code) internal pure {\\n assembly (\\\"memory-safe\\\") {\\n mstore(0x00, 0x4e487b71)\\n mstore(0x20, code)\\n revert(0x1c, 0x24)\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf7fe324703a64fc51702311dc51562d5cb1497734f074e4f483bfb6717572d7a\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/ShortStrings.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/ShortStrings.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {StorageSlot} from \\\"./StorageSlot.sol\\\";\\n\\n// | string | 0xAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA |\\n// | length | 0x BB |\\ntype ShortString is bytes32;\\n\\n/**\\n * @dev This library provides functions to convert short memory strings\\n * into a `ShortString` type that can be used as an immutable variable.\\n *\\n * Strings of arbitrary length can be optimized using this library if\\n * they are short enough (up to 31 bytes) by packing them with their\\n * length (1 byte) in a single EVM word (32 bytes). Additionally, a\\n * fallback mechanism can be used for every other case.\\n *\\n * Usage example:\\n *\\n * ```solidity\\n * contract Named {\\n * using ShortStrings for *;\\n *\\n * ShortString private immutable _name;\\n * string private _nameFallback;\\n *\\n * constructor(string memory contractName) {\\n * _name = contractName.toShortStringWithFallback(_nameFallback);\\n * }\\n *\\n * function name() external view returns (string memory) {\\n * return _name.toStringWithFallback(_nameFallback);\\n * }\\n * }\\n * ```\\n */\\nlibrary ShortStrings {\\n // Used as an identifier for strings longer than 31 bytes.\\n bytes32 private constant FALLBACK_SENTINEL = 0x00000000000000000000000000000000000000000000000000000000000000FF;\\n\\n error StringTooLong(string str);\\n error InvalidShortString();\\n\\n /**\\n * @dev Encode a string of at most 31 chars into a `ShortString`.\\n *\\n * This will trigger a `StringTooLong` error is the input string is too long.\\n */\\n function toShortString(string memory str) internal pure returns (ShortString) {\\n bytes memory bstr = bytes(str);\\n if (bstr.length > 31) {\\n revert StringTooLong(str);\\n }\\n return ShortString.wrap(bytes32(uint256(bytes32(bstr)) | bstr.length));\\n }\\n\\n /**\\n * @dev Decode a `ShortString` back to a \\\"normal\\\" string.\\n */\\n function toString(ShortString sstr) internal pure returns (string memory) {\\n uint256 len = byteLength(sstr);\\n // using `new string(len)` would work locally but is not memory safe.\\n string memory str = new string(32);\\n assembly (\\\"memory-safe\\\") {\\n mstore(str, len)\\n mstore(add(str, 0x20), sstr)\\n }\\n return str;\\n }\\n\\n /**\\n * @dev Return the length of a `ShortString`.\\n */\\n function byteLength(ShortString sstr) internal pure returns (uint256) {\\n uint256 result = uint256(ShortString.unwrap(sstr)) & 0xFF;\\n if (result > 31) {\\n revert InvalidShortString();\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Encode a string into a `ShortString`, or write it to storage if it is too long.\\n */\\n function toShortStringWithFallback(string memory value, string storage store) internal returns (ShortString) {\\n if (bytes(value).length < 32) {\\n return toShortString(value);\\n } else {\\n StorageSlot.getStringSlot(store).value = value;\\n return ShortString.wrap(FALLBACK_SENTINEL);\\n }\\n }\\n\\n /**\\n * @dev Decode a string that was encoded to `ShortString` or written to storage using {setWithFallback}.\\n */\\n function toStringWithFallback(ShortString value, string storage store) internal pure returns (string memory) {\\n if (ShortString.unwrap(value) != FALLBACK_SENTINEL) {\\n return toString(value);\\n } else {\\n return store;\\n }\\n }\\n\\n /**\\n * @dev Return the length of a string that was encoded to `ShortString` or written to storage using\\n * {setWithFallback}.\\n *\\n * WARNING: This will return the \\\"byte length\\\" of the string. This may not reflect the actual length in terms of\\n * actual characters as the UTF-8 encoding of a single character can span over multiple bytes.\\n */\\n function byteLengthWithFallback(ShortString value, string storage store) internal view returns (uint256) {\\n if (ShortString.unwrap(value) != FALLBACK_SENTINEL) {\\n return byteLength(value);\\n } else {\\n return bytes(store).length;\\n }\\n }\\n}\\n\",\"keccak256\":\"0x7d94fa0af099a2172eb01f9c8a8a443cbe7e0e43654841563e4e09968efdb549\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/StorageSlot.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/StorageSlot.sol)\\n// This file was procedurally generated from scripts/generate/templates/StorageSlot.js.\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Library for reading and writing primitive types to specific storage slots.\\n *\\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\\n * This library helps with reading and writing to such slots without the need for inline assembly.\\n *\\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\\n *\\n * Example usage to set ERC-1967 implementation slot:\\n * ```solidity\\n * contract ERC1967 {\\n * // Define the slot. Alternatively, use the SlotDerivation library to derive the slot.\\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n *\\n * function _getImplementation() internal view returns (address) {\\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n * }\\n *\\n * function _setImplementation(address newImplementation) internal {\\n * require(newImplementation.code.length > 0);\\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n * }\\n * }\\n * ```\\n *\\n * TIP: Consider using this library along with {SlotDerivation}.\\n */\\nlibrary StorageSlot {\\n struct AddressSlot {\\n address value;\\n }\\n\\n struct BooleanSlot {\\n bool value;\\n }\\n\\n struct Bytes32Slot {\\n bytes32 value;\\n }\\n\\n struct Uint256Slot {\\n uint256 value;\\n }\\n\\n struct Int256Slot {\\n int256 value;\\n }\\n\\n struct StringSlot {\\n string value;\\n }\\n\\n struct BytesSlot {\\n bytes value;\\n }\\n\\n /**\\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\\n */\\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\\n assembly (\\\"memory-safe\\\") {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns a `BooleanSlot` with member `value` located at `slot`.\\n */\\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\\n assembly (\\\"memory-safe\\\") {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns a `Bytes32Slot` with member `value` located at `slot`.\\n */\\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\\n assembly (\\\"memory-safe\\\") {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns a `Uint256Slot` with member `value` located at `slot`.\\n */\\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\\n assembly (\\\"memory-safe\\\") {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns a `Int256Slot` with member `value` located at `slot`.\\n */\\n function getInt256Slot(bytes32 slot) internal pure returns (Int256Slot storage r) {\\n assembly (\\\"memory-safe\\\") {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns a `StringSlot` with member `value` located at `slot`.\\n */\\n function getStringSlot(bytes32 slot) internal pure returns (StringSlot storage r) {\\n assembly (\\\"memory-safe\\\") {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `StringSlot` representation of the string storage pointer `store`.\\n */\\n function getStringSlot(string storage store) internal pure returns (StringSlot storage r) {\\n assembly (\\\"memory-safe\\\") {\\n r.slot := store.slot\\n }\\n }\\n\\n /**\\n * @dev Returns a `BytesSlot` with member `value` located at `slot`.\\n */\\n function getBytesSlot(bytes32 slot) internal pure returns (BytesSlot storage r) {\\n assembly (\\\"memory-safe\\\") {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `BytesSlot` representation of the bytes storage pointer `store`.\\n */\\n function getBytesSlot(bytes storage store) internal pure returns (BytesSlot storage r) {\\n assembly (\\\"memory-safe\\\") {\\n r.slot := store.slot\\n }\\n }\\n}\\n\",\"keccak256\":\"0xcf74f855663ce2ae00ed8352666b7935f6cddea2932fdf2c3ecd30a9b1cd0e97\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Strings.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/Strings.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {Math} from \\\"./math/Math.sol\\\";\\nimport {SignedMath} from \\\"./math/SignedMath.sol\\\";\\n\\n/**\\n * @dev String operations.\\n */\\nlibrary Strings {\\n bytes16 private constant HEX_DIGITS = \\\"0123456789abcdef\\\";\\n uint8 private constant ADDRESS_LENGTH = 20;\\n\\n /**\\n * @dev The `value` string doesn't fit in the specified `length`.\\n */\\n error StringsInsufficientHexLength(uint256 value, uint256 length);\\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 assembly (\\\"memory-safe\\\") {\\n ptr := add(buffer, add(32, length))\\n }\\n while (true) {\\n ptr--;\\n assembly (\\\"memory-safe\\\") {\\n mstore8(ptr, byte(mod(value, 10), HEX_DIGITS))\\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 toStringSigned(int256 value) internal pure returns (string memory) {\\n return string.concat(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 uint256 localValue = value;\\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] = HEX_DIGITS[localValue & 0xf];\\n localValue >>= 4;\\n }\\n if (localValue != 0) {\\n revert StringsInsufficientHexLength(value, length);\\n }\\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\\n * 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 Converts an `address` with fixed length of 20 bytes to its checksummed ASCII `string` hexadecimal\\n * representation, according to EIP-55.\\n */\\n function toChecksumHexString(address addr) internal pure returns (string memory) {\\n bytes memory buffer = bytes(toHexString(addr));\\n\\n // hash the hex part of buffer (skip length + 2 bytes, length 40)\\n uint256 hashValue;\\n assembly (\\\"memory-safe\\\") {\\n hashValue := shr(96, keccak256(add(buffer, 0x22), 40))\\n }\\n\\n for (uint256 i = 41; i > 1; --i) {\\n // possible values for buffer[i] are 48 (0) to 57 (9) and 97 (a) to 102 (f)\\n if (hashValue & 0xf > 7 && uint8(buffer[i]) > 96) {\\n // case shift by xoring with 0x20\\n buffer[i] ^= 0x20;\\n }\\n hashValue >>= 4;\\n }\\n return string(buffer);\\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 bytes(a).length == bytes(b).length && keccak256(bytes(a)) == keccak256(bytes(b));\\n }\\n}\\n\",\"keccak256\":\"0x725209b582291bb83058e3078624b53d15a133f7401c30295e7f3704181d2aed\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/cryptography/ECDSA.sol)\\n\\npragma solidity ^0.8.20;\\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 }\\n\\n /**\\n * @dev The signature derives the `address(0)`.\\n */\\n error ECDSAInvalidSignature();\\n\\n /**\\n * @dev The signature has an invalid length.\\n */\\n error ECDSAInvalidSignatureLength(uint256 length);\\n\\n /**\\n * @dev The signature has an S value that is in the upper half order.\\n */\\n error ECDSAInvalidSignatureS(bytes32 s);\\n\\n /**\\n * @dev Returns the address that signed a hashed message (`hash`) with `signature` or an error. This will not\\n * return address(0) without also returning an error description. Errors are documented using an enum (error type)\\n * and a bytes32 providing additional information about the error.\\n *\\n * If no error is returned, then the address can be used for verification purposes.\\n *\\n * The `ecrecover` EVM precompile 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 {MessageHashUtils-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 function tryRecover(\\n bytes32 hash,\\n bytes memory signature\\n ) internal pure returns (address recovered, RecoverError err, bytes32 errArg) {\\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 assembly (\\\"memory-safe\\\") {\\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, bytes32(signature.length));\\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 precompile 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 {MessageHashUtils-toEthSignedMessageHash} on it.\\n */\\n function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {\\n (address recovered, RecoverError error, bytes32 errorArg) = tryRecover(hash, signature);\\n _throwError(error, errorArg);\\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[ERC-2098 short signatures]\\n */\\n function tryRecover(\\n bytes32 hash,\\n bytes32 r,\\n bytes32 vs\\n ) internal pure returns (address recovered, RecoverError err, bytes32 errArg) {\\n unchecked {\\n bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff);\\n // We do not check for an overflow here since the shift operation results in 0 or 1.\\n uint8 v = uint8((uint256(vs) >> 255) + 27);\\n return tryRecover(hash, v, r, s);\\n }\\n }\\n\\n /**\\n * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately.\\n */\\n function recover(bytes32 hash, bytes32 r, bytes32 vs) internal pure returns (address) {\\n (address recovered, RecoverError error, bytes32 errorArg) = tryRecover(hash, r, vs);\\n _throwError(error, errorArg);\\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 function tryRecover(\\n bytes32 hash,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) internal pure returns (address recovered, RecoverError err, bytes32 errArg) {\\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, s);\\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, bytes32(0));\\n }\\n\\n return (signer, RecoverError.NoError, bytes32(0));\\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, bytes32 errorArg) = tryRecover(hash, v, r, s);\\n _throwError(error, errorArg);\\n return recovered;\\n }\\n\\n /**\\n * @dev Optionally reverts with the corresponding custom error according to the `error` argument provided.\\n */\\n function _throwError(RecoverError error, bytes32 errorArg) private pure {\\n if (error == RecoverError.NoError) {\\n return; // no error: do nothing\\n } else if (error == RecoverError.InvalidSignature) {\\n revert ECDSAInvalidSignature();\\n } else if (error == RecoverError.InvalidSignatureLength) {\\n revert ECDSAInvalidSignatureLength(uint256(errorArg));\\n } else if (error == RecoverError.InvalidSignatureS) {\\n revert ECDSAInvalidSignatureS(errorArg);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x69f54c02b7d81d505910ec198c11ed4c6a728418a868b906b4a0cf29946fda84\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/cryptography/EIP712.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/cryptography/EIP712.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {MessageHashUtils} from \\\"./MessageHashUtils.sol\\\";\\nimport {ShortStrings, ShortString} from \\\"../ShortStrings.sol\\\";\\nimport {IERC5267} from \\\"../../interfaces/IERC5267.sol\\\";\\n\\n/**\\n * @dev https://eips.ethereum.org/EIPS/eip-712[EIP-712] is a standard for hashing and signing of typed structured data.\\n *\\n * The encoding scheme specified in the EIP requires a domain separator and a hash of the typed structured data, whose\\n * encoding is very generic and therefore its implementation in Solidity is not feasible, thus this contract\\n * does not implement the encoding itself. Protocols need to implement the type-specific encoding they need in order to\\n * produce the hash of their typed data using a combination of `abi.encode` and `keccak256`.\\n *\\n * This contract implements the EIP-712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding\\n * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA\\n * ({_hashTypedDataV4}).\\n *\\n * The implementation of the domain separator was designed to be as efficient as possible while still properly updating\\n * the chain id to protect against replay attacks on an eventual fork of the chain.\\n *\\n * NOTE: This contract implements the version of the encoding known as \\\"v4\\\", as implemented by the JSON RPC method\\n * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask].\\n *\\n * NOTE: In the upgradeable version of this contract, the cached values will correspond to the address, and the domain\\n * separator of the implementation contract. This will cause the {_domainSeparatorV4} function to always rebuild the\\n * separator from the immutable values, which is cheaper than accessing a cached version in cold storage.\\n *\\n * @custom:oz-upgrades-unsafe-allow state-variable-immutable\\n */\\nabstract contract EIP712 is IERC5267 {\\n using ShortStrings for *;\\n\\n bytes32 private constant TYPE_HASH =\\n keccak256(\\\"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)\\\");\\n\\n // Cache the domain separator as an immutable value, but also store the chain id that it corresponds to, in order to\\n // invalidate the cached domain separator if the chain id changes.\\n bytes32 private immutable _cachedDomainSeparator;\\n uint256 private immutable _cachedChainId;\\n address private immutable _cachedThis;\\n\\n bytes32 private immutable _hashedName;\\n bytes32 private immutable _hashedVersion;\\n\\n ShortString private immutable _name;\\n ShortString private immutable _version;\\n string private _nameFallback;\\n string private _versionFallback;\\n\\n /**\\n * @dev Initializes the domain separator and parameter caches.\\n *\\n * The meaning of `name` and `version` is specified in\\n * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP-712]:\\n *\\n * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol.\\n * - `version`: the current major version of the signing domain.\\n *\\n * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart\\n * contract upgrade].\\n */\\n constructor(string memory name, string memory version) {\\n _name = name.toShortStringWithFallback(_nameFallback);\\n _version = version.toShortStringWithFallback(_versionFallback);\\n _hashedName = keccak256(bytes(name));\\n _hashedVersion = keccak256(bytes(version));\\n\\n _cachedChainId = block.chainid;\\n _cachedDomainSeparator = _buildDomainSeparator();\\n _cachedThis = address(this);\\n }\\n\\n /**\\n * @dev Returns the domain separator for the current chain.\\n */\\n function _domainSeparatorV4() internal view returns (bytes32) {\\n if (address(this) == _cachedThis && block.chainid == _cachedChainId) {\\n return _cachedDomainSeparator;\\n } else {\\n return _buildDomainSeparator();\\n }\\n }\\n\\n function _buildDomainSeparator() private view returns (bytes32) {\\n return keccak256(abi.encode(TYPE_HASH, _hashedName, _hashedVersion, block.chainid, address(this)));\\n }\\n\\n /**\\n * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this\\n * function returns the hash of the fully encoded EIP712 message for this domain.\\n *\\n * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example:\\n *\\n * ```solidity\\n * bytes32 digest = _hashTypedDataV4(keccak256(abi.encode(\\n * keccak256(\\\"Mail(address to,string contents)\\\"),\\n * mailTo,\\n * keccak256(bytes(mailContents))\\n * )));\\n * address signer = ECDSA.recover(digest, signature);\\n * ```\\n */\\n function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) {\\n return MessageHashUtils.toTypedDataHash(_domainSeparatorV4(), structHash);\\n }\\n\\n /**\\n * @dev See {IERC-5267}.\\n */\\n function eip712Domain()\\n public\\n view\\n virtual\\n returns (\\n bytes1 fields,\\n string memory name,\\n string memory version,\\n uint256 chainId,\\n address verifyingContract,\\n bytes32 salt,\\n uint256[] memory extensions\\n )\\n {\\n return (\\n hex\\\"0f\\\", // 01111\\n _EIP712Name(),\\n _EIP712Version(),\\n block.chainid,\\n address(this),\\n bytes32(0),\\n new uint256[](0)\\n );\\n }\\n\\n /**\\n * @dev The name parameter for the EIP712 domain.\\n *\\n * NOTE: By default this function reads _name which is an immutable value.\\n * It only reads from storage if necessary (in case the value is too large to fit in a ShortString).\\n */\\n // solhint-disable-next-line func-name-mixedcase\\n function _EIP712Name() internal view returns (string memory) {\\n return _name.toStringWithFallback(_nameFallback);\\n }\\n\\n /**\\n * @dev The version parameter for the EIP712 domain.\\n *\\n * NOTE: By default this function reads _version which is an immutable value.\\n * It only reads from storage if necessary (in case the value is too large to fit in a ShortString).\\n */\\n // solhint-disable-next-line func-name-mixedcase\\n function _EIP712Version() internal view returns (string memory) {\\n return _version.toStringWithFallback(_versionFallback);\\n }\\n}\\n\",\"keccak256\":\"0x10eb97d047f8d84fe263a02bb4a656ac6674f6679d74532cc37546289e073a9d\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/cryptography/MessageHashUtils.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/cryptography/MessageHashUtils.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {Strings} from \\\"../Strings.sol\\\";\\n\\n/**\\n * @dev Signature message hash utilities for producing digests to be consumed by {ECDSA} recovery or signing.\\n *\\n * The library provides methods for generating a hash of a message that conforms to the\\n * https://eips.ethereum.org/EIPS/eip-191[ERC-191] and https://eips.ethereum.org/EIPS/eip-712[EIP 712]\\n * specifications.\\n */\\nlibrary MessageHashUtils {\\n /**\\n * @dev Returns the keccak256 digest of an ERC-191 signed data with version\\n * `0x45` (`personal_sign` messages).\\n *\\n * The digest is calculated by prefixing a bytes32 `messageHash` with\\n * `\\\"\\\\x19Ethereum Signed Message:\\\\n32\\\"` and hashing the result. It corresponds with the\\n * hash signed when using the https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] JSON-RPC method.\\n *\\n * NOTE: The `messageHash` parameter is intended to be the result of hashing a raw message with\\n * keccak256, although any bytes32 value can be safely used because the final digest will\\n * be re-hashed.\\n *\\n * See {ECDSA-recover}.\\n */\\n function toEthSignedMessageHash(bytes32 messageHash) internal pure returns (bytes32 digest) {\\n assembly (\\\"memory-safe\\\") {\\n mstore(0x00, \\\"\\\\x19Ethereum Signed Message:\\\\n32\\\") // 32 is the bytes-length of messageHash\\n mstore(0x1c, messageHash) // 0x1c (28) is the length of the prefix\\n digest := keccak256(0x00, 0x3c) // 0x3c is the length of the prefix (0x1c) + messageHash (0x20)\\n }\\n }\\n\\n /**\\n * @dev Returns the keccak256 digest of an ERC-191 signed data with version\\n * `0x45` (`personal_sign` messages).\\n *\\n * The digest is calculated by prefixing an arbitrary `message` with\\n * `\\\"\\\\x19Ethereum Signed Message:\\\\n\\\" + len(message)` and hashing the result. It corresponds with the\\n * hash signed when using the https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] JSON-RPC method.\\n *\\n * See {ECDSA-recover}.\\n */\\n function toEthSignedMessageHash(bytes memory message) internal pure returns (bytes32) {\\n return\\n keccak256(bytes.concat(\\\"\\\\x19Ethereum Signed Message:\\\\n\\\", bytes(Strings.toString(message.length)), message));\\n }\\n\\n /**\\n * @dev Returns the keccak256 digest of an ERC-191 signed data with version\\n * `0x00` (data with intended validator).\\n *\\n * The digest is calculated by prefixing an arbitrary `data` with `\\\"\\\\x19\\\\x00\\\"` and the intended\\n * `validator` address. Then hashing the result.\\n *\\n * See {ECDSA-recover}.\\n */\\n function toDataWithIntendedValidatorHash(address validator, bytes memory data) internal pure returns (bytes32) {\\n return keccak256(abi.encodePacked(hex\\\"19_00\\\", validator, data));\\n }\\n\\n /**\\n * @dev Returns the keccak256 digest of an EIP-712 typed data (ERC-191 version `0x01`).\\n *\\n * The digest is calculated from a `domainSeparator` and a `structHash`, by prefixing them with\\n * `\\\\x19\\\\x01` and hashing the result. It corresponds to the hash signed by the\\n * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`] JSON-RPC method as part of EIP-712.\\n *\\n * See {ECDSA-recover}.\\n */\\n function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32 digest) {\\n assembly (\\\"memory-safe\\\") {\\n let ptr := mload(0x40)\\n mstore(ptr, hex\\\"19_01\\\")\\n mstore(add(ptr, 0x02), domainSeparator)\\n mstore(add(ptr, 0x22), structHash)\\n digest := keccak256(ptr, 0x42)\\n }\\n }\\n}\\n\",\"keccak256\":\"0x4515543bc4c78561f6bea83ecfdfc3dead55bd59858287d682045b11de1ae575\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/introspection/ERC165.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/introspection/ERC165.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {IERC165} from \\\"./IERC165.sol\\\";\\n\\n/**\\n * @dev Implementation of the {IERC165} interface.\\n *\\n * Contracts that want to implement ERC-165 should inherit from this contract and override {supportsInterface} to check\\n * for the additional interface id that will be supported. For example:\\n *\\n * ```solidity\\n * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\\n * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);\\n * }\\n * ```\\n */\\nabstract contract ERC165 is IERC165 {\\n /**\\n * @dev See {IERC165-supportsInterface}.\\n */\\n function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) {\\n return interfaceId == type(IERC165).interfaceId;\\n }\\n}\\n\",\"keccak256\":\"0xddce8e17e3d3f9ed818b4f4c4478a8262aab8b11ed322f1bf5ed705bb4bd97fa\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/introspection/IERC165.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/introspection/IERC165.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Interface of the ERC-165 standard, as defined in the\\n * https://eips.ethereum.org/EIPS/eip-165[ERC].\\n *\\n * Implementers can declare support of contract interfaces, which can then be\\n * queried by others ({ERC165Checker}).\\n *\\n * For an implementation, see {ERC165}.\\n */\\ninterface IERC165 {\\n /**\\n * @dev Returns true if this contract implements the interface defined by\\n * `interfaceId`. See the corresponding\\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[ERC section]\\n * to learn more about how these ids are created.\\n *\\n * This function call must use less than 30 000 gas.\\n */\\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x79796192ec90263f21b464d5bc90b777a525971d3de8232be80d9c4f9fb353b8\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/math/Math.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/math/Math.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {Panic} from \\\"../Panic.sol\\\";\\nimport {SafeCast} from \\\"./SafeCast.sol\\\";\\n\\n/**\\n * @dev Standard math utilities missing in the Solidity language.\\n */\\nlibrary Math {\\n enum Rounding {\\n Floor, // Toward negative infinity\\n Ceil, // Toward positive infinity\\n Trunc, // Toward zero\\n Expand // Away from zero\\n }\\n\\n /**\\n * @dev Returns the addition of two unsigned integers, with an success flag (no overflow).\\n */\\n function tryAdd(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\\n unchecked {\\n uint256 c = a + b;\\n if (c < a) return (false, 0);\\n return (true, c);\\n }\\n }\\n\\n /**\\n * @dev Returns the subtraction of two unsigned integers, with an success flag (no overflow).\\n */\\n function trySub(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\\n unchecked {\\n if (b > a) return (false, 0);\\n return (true, a - b);\\n }\\n }\\n\\n /**\\n * @dev Returns the multiplication of two unsigned integers, with an success flag (no overflow).\\n */\\n function tryMul(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\\n unchecked {\\n // Gas optimization: this is cheaper than requiring 'a' not being zero, but the\\n // benefit is lost if 'b' is also tested.\\n // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522\\n if (a == 0) return (true, 0);\\n uint256 c = a * b;\\n if (c / a != b) return (false, 0);\\n return (true, c);\\n }\\n }\\n\\n /**\\n * @dev Returns the division of two unsigned integers, with a success flag (no division by zero).\\n */\\n function tryDiv(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\\n unchecked {\\n if (b == 0) return (false, 0);\\n return (true, a / b);\\n }\\n }\\n\\n /**\\n * @dev Returns the remainder of dividing two unsigned integers, with a success flag (no division by zero).\\n */\\n function tryMod(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\\n unchecked {\\n if (b == 0) return (false, 0);\\n return (true, a % b);\\n }\\n }\\n\\n /**\\n * @dev Branchless ternary evaluation for `a ? b : c`. Gas costs are constant.\\n *\\n * IMPORTANT: This function may reduce bytecode size and consume less gas when used standalone.\\n * However, the compiler may optimize Solidity ternary operations (i.e. `a ? b : c`) to only compute\\n * one branch when needed, making this function more expensive.\\n */\\n function ternary(bool condition, uint256 a, uint256 b) internal pure returns (uint256) {\\n unchecked {\\n // branchless ternary works because:\\n // b ^ (a ^ b) == a\\n // b ^ 0 == b\\n return b ^ ((a ^ b) * SafeCast.toUint(condition));\\n }\\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 ternary(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 ternary(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 towards infinity instead\\n * of rounding towards zero.\\n */\\n function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {\\n if (b == 0) {\\n // Guarantee the same behavior as in a regular Solidity division.\\n Panic.panic(Panic.DIVISION_BY_ZERO);\\n }\\n\\n // The following calculation ensures accurate ceiling division without overflow.\\n // Since a is non-zero, (a - 1) / b will not overflow.\\n // The largest possible result occurs when (a - 1) / b is type(uint256).max,\\n // but the largest value we can obtain is type(uint256).max - 1, which happens\\n // when a = type(uint256).max and b = 1.\\n unchecked {\\n return SafeCast.toUint(a > 0) * ((a - 1) / b + 1);\\n }\\n }\\n\\n /**\\n * @dev Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or\\n * denominator == 0.\\n *\\n * Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv) with further edits by\\n * 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\\u00b2\\u2075\\u2076 and mod 2\\u00b2\\u2075\\u2076 - 1, then use\\n // the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256\\n // variables such that product = prod1 * 2\\u00b2\\u2075\\u2076 + prod0.\\n uint256 prod0 = x * y; // 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 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\\u00b2\\u2075\\u2076. Also prevents denominator == 0.\\n if (denominator <= prod1) {\\n Panic.panic(ternary(denominator == 0, Panic.DIVISION_BY_ZERO, Panic.UNDER_OVERFLOW));\\n }\\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.\\n // Always >= 1. See https://cs.stackexchange.com/q/138556/92363.\\n\\n uint256 twos = denominator & (0 - denominator);\\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\\u00b2\\u2075\\u2076 / 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\\u00b2\\u2075\\u2076. Now that denominator is an odd number, it has an inverse modulo 2\\u00b2\\u2075\\u2076 such\\n // that denominator * inv \\u2261 1 mod 2\\u00b2\\u2075\\u2076. Compute the inverse by starting with a seed that is correct for\\n // four bits. That is, denominator * inv \\u2261 1 mod 2\\u2074.\\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\\n // works in modular arithmetic, doubling the correct bits in each step.\\n inverse *= 2 - denominator * inverse; // inverse mod 2\\u2078\\n inverse *= 2 - denominator * inverse; // inverse mod 2\\u00b9\\u2076\\n inverse *= 2 - denominator * inverse; // inverse mod 2\\u00b3\\u00b2\\n inverse *= 2 - denominator * inverse; // inverse mod 2\\u2076\\u2074\\n inverse *= 2 - denominator * inverse; // inverse mod 2\\u00b9\\u00b2\\u2078\\n inverse *= 2 - denominator * inverse; // inverse mod 2\\u00b2\\u2075\\u2076\\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\\u00b2\\u2075\\u2076. Since the preconditions guarantee that the outcome is\\n // less than 2\\u00b2\\u2075\\u2076, 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 * @dev 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 return mulDiv(x, y, denominator) + SafeCast.toUint(unsignedRoundsUp(rounding) && mulmod(x, y, denominator) > 0);\\n }\\n\\n /**\\n * @dev Calculate the modular multiplicative inverse of a number in Z/nZ.\\n *\\n * If n is a prime, then Z/nZ is a field. In that case all elements are inversible, except 0.\\n * If n is not a prime, then Z/nZ is not a field, and some elements might not be inversible.\\n *\\n * If the input value is not inversible, 0 is returned.\\n *\\n * NOTE: If you know for sure that n is (big) a prime, it may be cheaper to use Fermat's little theorem and get the\\n * inverse using `Math.modExp(a, n - 2, n)`. See {invModPrime}.\\n */\\n function invMod(uint256 a, uint256 n) internal pure returns (uint256) {\\n unchecked {\\n if (n == 0) return 0;\\n\\n // The inverse modulo is calculated using the Extended Euclidean Algorithm (iterative version)\\n // Used to compute integers x and y such that: ax + ny = gcd(a, n).\\n // When the gcd is 1, then the inverse of a modulo n exists and it's x.\\n // ax + ny = 1\\n // ax = 1 + (-y)n\\n // ax \\u2261 1 (mod n) # x is the inverse of a modulo n\\n\\n // If the remainder is 0 the gcd is n right away.\\n uint256 remainder = a % n;\\n uint256 gcd = n;\\n\\n // Therefore the initial coefficients are:\\n // ax + ny = gcd(a, n) = n\\n // 0a + 1n = n\\n int256 x = 0;\\n int256 y = 1;\\n\\n while (remainder != 0) {\\n uint256 quotient = gcd / remainder;\\n\\n (gcd, remainder) = (\\n // The old remainder is the next gcd to try.\\n remainder,\\n // Compute the next remainder.\\n // Can't overflow given that (a % gcd) * (gcd // (a % gcd)) <= gcd\\n // where gcd is at most n (capped to type(uint256).max)\\n gcd - remainder * quotient\\n );\\n\\n (x, y) = (\\n // Increment the coefficient of a.\\n y,\\n // Decrement the coefficient of n.\\n // Can overflow, but the result is casted to uint256 so that the\\n // next value of y is \\\"wrapped around\\\" to a value between 0 and n - 1.\\n x - y * int256(quotient)\\n );\\n }\\n\\n if (gcd != 1) return 0; // No inverse exists.\\n return ternary(x < 0, n - uint256(-x), uint256(x)); // Wrap the result if it's negative.\\n }\\n }\\n\\n /**\\n * @dev Variant of {invMod}. More efficient, but only works if `p` is known to be a prime greater than `2`.\\n *\\n * From https://en.wikipedia.org/wiki/Fermat%27s_little_theorem[Fermat's little theorem], we know that if p is\\n * prime, then `a**(p-1) \\u2261 1 mod p`. As a consequence, we have `a * a**(p-2) \\u2261 1 mod p`, which means that\\n * `a**(p-2)` is the modular multiplicative inverse of a in Fp.\\n *\\n * NOTE: this function does NOT check that `p` is a prime greater than `2`.\\n */\\n function invModPrime(uint256 a, uint256 p) internal view returns (uint256) {\\n unchecked {\\n return Math.modExp(a, p - 2, p);\\n }\\n }\\n\\n /**\\n * @dev Returns the modular exponentiation of the specified base, exponent and modulus (b ** e % m)\\n *\\n * Requirements:\\n * - modulus can't be zero\\n * - underlying staticcall to precompile must succeed\\n *\\n * IMPORTANT: The result is only valid if the underlying call succeeds. When using this function, make\\n * sure the chain you're using it on supports the precompiled contract for modular exponentiation\\n * at address 0x05 as specified in https://eips.ethereum.org/EIPS/eip-198[EIP-198]. Otherwise,\\n * the underlying function will succeed given the lack of a revert, but the result may be incorrectly\\n * interpreted as 0.\\n */\\n function modExp(uint256 b, uint256 e, uint256 m) internal view returns (uint256) {\\n (bool success, uint256 result) = tryModExp(b, e, m);\\n if (!success) {\\n Panic.panic(Panic.DIVISION_BY_ZERO);\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Returns the modular exponentiation of the specified base, exponent and modulus (b ** e % m).\\n * It includes a success flag indicating if the operation succeeded. Operation will be marked as failed if trying\\n * to operate modulo 0 or if the underlying precompile reverted.\\n *\\n * IMPORTANT: The result is only valid if the success flag is true. When using this function, make sure the chain\\n * you're using it on supports the precompiled contract for modular exponentiation at address 0x05 as specified in\\n * https://eips.ethereum.org/EIPS/eip-198[EIP-198]. Otherwise, the underlying function will succeed given the lack\\n * of a revert, but the result may be incorrectly interpreted as 0.\\n */\\n function tryModExp(uint256 b, uint256 e, uint256 m) internal view returns (bool success, uint256 result) {\\n if (m == 0) return (false, 0);\\n assembly (\\\"memory-safe\\\") {\\n let ptr := mload(0x40)\\n // | Offset | Content | Content (Hex) |\\n // |-----------|------------|--------------------------------------------------------------------|\\n // | 0x00:0x1f | size of b | 0x0000000000000000000000000000000000000000000000000000000000000020 |\\n // | 0x20:0x3f | size of e | 0x0000000000000000000000000000000000000000000000000000000000000020 |\\n // | 0x40:0x5f | size of m | 0x0000000000000000000000000000000000000000000000000000000000000020 |\\n // | 0x60:0x7f | value of b | 0x<.............................................................b> |\\n // | 0x80:0x9f | value of e | 0x<.............................................................e> |\\n // | 0xa0:0xbf | value of m | 0x<.............................................................m> |\\n mstore(ptr, 0x20)\\n mstore(add(ptr, 0x20), 0x20)\\n mstore(add(ptr, 0x40), 0x20)\\n mstore(add(ptr, 0x60), b)\\n mstore(add(ptr, 0x80), e)\\n mstore(add(ptr, 0xa0), m)\\n\\n // Given the result < m, it's guaranteed to fit in 32 bytes,\\n // so we can use the memory scratch space located at offset 0.\\n success := staticcall(gas(), 0x05, ptr, 0xc0, 0x00, 0x20)\\n result := mload(0x00)\\n }\\n }\\n\\n /**\\n * @dev Variant of {modExp} that supports inputs of arbitrary length.\\n */\\n function modExp(bytes memory b, bytes memory e, bytes memory m) internal view returns (bytes memory) {\\n (bool success, bytes memory result) = tryModExp(b, e, m);\\n if (!success) {\\n Panic.panic(Panic.DIVISION_BY_ZERO);\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Variant of {tryModExp} that supports inputs of arbitrary length.\\n */\\n function tryModExp(\\n bytes memory b,\\n bytes memory e,\\n bytes memory m\\n ) internal view returns (bool success, bytes memory result) {\\n if (_zeroBytes(m)) return (false, new bytes(0));\\n\\n uint256 mLen = m.length;\\n\\n // Encode call args in result and move the free memory pointer\\n result = abi.encodePacked(b.length, e.length, mLen, b, e, m);\\n\\n assembly (\\\"memory-safe\\\") {\\n let dataPtr := add(result, 0x20)\\n // Write result on top of args to avoid allocating extra memory.\\n success := staticcall(gas(), 0x05, dataPtr, mload(result), dataPtr, mLen)\\n // Overwrite the length.\\n // result.length > returndatasize() is guaranteed because returndatasize() == m.length\\n mstore(result, mLen)\\n // Set the memory pointer after the returned data.\\n mstore(0x40, add(dataPtr, mLen))\\n }\\n }\\n\\n /**\\n * @dev Returns whether the provided byte array is zero.\\n */\\n function _zeroBytes(bytes memory byteArray) private pure returns (bool) {\\n for (uint256 i = 0; i < byteArray.length; ++i) {\\n if (byteArray[i] != 0) {\\n return false;\\n }\\n }\\n return true;\\n }\\n\\n /**\\n * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded\\n * towards zero.\\n *\\n * This method is based on Newton's method for computing square roots; the algorithm is restricted to only\\n * using integer operations.\\n */\\n function sqrt(uint256 a) internal pure returns (uint256) {\\n unchecked {\\n // Take care of easy edge cases when a == 0 or a == 1\\n if (a <= 1) {\\n return a;\\n }\\n\\n // In this function, we use Newton's method to get a root of `f(x) := x\\u00b2 - a`. It involves building a\\n // sequence x_n that converges toward sqrt(a). For each iteration x_n, we also define the error between\\n // the current value as `\\u03b5_n = | x_n - sqrt(a) |`.\\n //\\n // For our first estimation, we consider `e` the smallest power of 2 which is bigger than the square root\\n // of the target. (i.e. `2**(e-1) \\u2264 sqrt(a) < 2**e`). We know that `e \\u2264 128` because `(2\\u00b9\\u00b2\\u2078)\\u00b2 = 2\\u00b2\\u2075\\u2076` is\\n // bigger than any uint256.\\n //\\n // By noticing that\\n // `2**(e-1) \\u2264 sqrt(a) < 2**e \\u2192 (2**(e-1))\\u00b2 \\u2264 a < (2**e)\\u00b2 \\u2192 2**(2*e-2) \\u2264 a < 2**(2*e)`\\n // we can deduce that `e - 1` is `log2(a) / 2`. We can thus compute `x_n = 2**(e-1)` using a method similar\\n // to the msb function.\\n uint256 aa = a;\\n uint256 xn = 1;\\n\\n if (aa >= (1 << 128)) {\\n aa >>= 128;\\n xn <<= 64;\\n }\\n if (aa >= (1 << 64)) {\\n aa >>= 64;\\n xn <<= 32;\\n }\\n if (aa >= (1 << 32)) {\\n aa >>= 32;\\n xn <<= 16;\\n }\\n if (aa >= (1 << 16)) {\\n aa >>= 16;\\n xn <<= 8;\\n }\\n if (aa >= (1 << 8)) {\\n aa >>= 8;\\n xn <<= 4;\\n }\\n if (aa >= (1 << 4)) {\\n aa >>= 4;\\n xn <<= 2;\\n }\\n if (aa >= (1 << 2)) {\\n xn <<= 1;\\n }\\n\\n // We now have x_n such that `x_n = 2**(e-1) \\u2264 sqrt(a) < 2**e = 2 * x_n`. This implies \\u03b5_n \\u2264 2**(e-1).\\n //\\n // We can refine our estimation by noticing that the middle of that interval minimizes the error.\\n // If we move x_n to equal 2**(e-1) + 2**(e-2), then we reduce the error to \\u03b5_n \\u2264 2**(e-2).\\n // This is going to be our x_0 (and \\u03b5_0)\\n xn = (3 * xn) >> 1; // \\u03b5_0 := | x_0 - sqrt(a) | \\u2264 2**(e-2)\\n\\n // From here, Newton's method give us:\\n // x_{n+1} = (x_n + a / x_n) / 2\\n //\\n // One should note that:\\n // x_{n+1}\\u00b2 - a = ((x_n + a / x_n) / 2)\\u00b2 - a\\n // = ((x_n\\u00b2 + a) / (2 * x_n))\\u00b2 - a\\n // = (x_n\\u2074 + 2 * a * x_n\\u00b2 + a\\u00b2) / (4 * x_n\\u00b2) - a\\n // = (x_n\\u2074 + 2 * a * x_n\\u00b2 + a\\u00b2 - 4 * a * x_n\\u00b2) / (4 * x_n\\u00b2)\\n // = (x_n\\u2074 - 2 * a * x_n\\u00b2 + a\\u00b2) / (4 * x_n\\u00b2)\\n // = (x_n\\u00b2 - a)\\u00b2 / (2 * x_n)\\u00b2\\n // = ((x_n\\u00b2 - a) / (2 * x_n))\\u00b2\\n // \\u2265 0\\n // Which proves that for all n \\u2265 1, sqrt(a) \\u2264 x_n\\n //\\n // This gives us the proof of quadratic convergence of the sequence:\\n // \\u03b5_{n+1} = | x_{n+1} - sqrt(a) |\\n // = | (x_n + a / x_n) / 2 - sqrt(a) |\\n // = | (x_n\\u00b2 + a - 2*x_n*sqrt(a)) / (2 * x_n) |\\n // = | (x_n - sqrt(a))\\u00b2 / (2 * x_n) |\\n // = | \\u03b5_n\\u00b2 / (2 * x_n) |\\n // = \\u03b5_n\\u00b2 / | (2 * x_n) |\\n //\\n // For the first iteration, we have a special case where x_0 is known:\\n // \\u03b5_1 = \\u03b5_0\\u00b2 / | (2 * x_0) |\\n // \\u2264 (2**(e-2))\\u00b2 / (2 * (2**(e-1) + 2**(e-2)))\\n // \\u2264 2**(2*e-4) / (3 * 2**(e-1))\\n // \\u2264 2**(e-3) / 3\\n // \\u2264 2**(e-3-log2(3))\\n // \\u2264 2**(e-4.5)\\n //\\n // For the following iterations, we use the fact that, 2**(e-1) \\u2264 sqrt(a) \\u2264 x_n:\\n // \\u03b5_{n+1} = \\u03b5_n\\u00b2 / | (2 * x_n) |\\n // \\u2264 (2**(e-k))\\u00b2 / (2 * 2**(e-1))\\n // \\u2264 2**(2*e-2*k) / 2**e\\n // \\u2264 2**(e-2*k)\\n xn = (xn + a / xn) >> 1; // \\u03b5_1 := | x_1 - sqrt(a) | \\u2264 2**(e-4.5) -- special case, see above\\n xn = (xn + a / xn) >> 1; // \\u03b5_2 := | x_2 - sqrt(a) | \\u2264 2**(e-9) -- general case with k = 4.5\\n xn = (xn + a / xn) >> 1; // \\u03b5_3 := | x_3 - sqrt(a) | \\u2264 2**(e-18) -- general case with k = 9\\n xn = (xn + a / xn) >> 1; // \\u03b5_4 := | x_4 - sqrt(a) | \\u2264 2**(e-36) -- general case with k = 18\\n xn = (xn + a / xn) >> 1; // \\u03b5_5 := | x_5 - sqrt(a) | \\u2264 2**(e-72) -- general case with k = 36\\n xn = (xn + a / xn) >> 1; // \\u03b5_6 := | x_6 - sqrt(a) | \\u2264 2**(e-144) -- general case with k = 72\\n\\n // Because e \\u2264 128 (as discussed during the first estimation phase), we know have reached a precision\\n // \\u03b5_6 \\u2264 2**(e-144) < 1. Given we're operating on integers, then we can ensure that xn is now either\\n // sqrt(a) or sqrt(a) + 1.\\n return xn - SafeCast.toUint(xn > a / xn);\\n }\\n }\\n\\n /**\\n * @dev 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 + SafeCast.toUint(unsignedRoundsUp(rounding) && result * result < a);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 2 of a positive value rounded towards zero.\\n * Returns 0 if given 0.\\n */\\n function log2(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n uint256 exp;\\n unchecked {\\n exp = 128 * SafeCast.toUint(value > (1 << 128) - 1);\\n value >>= exp;\\n result += exp;\\n\\n exp = 64 * SafeCast.toUint(value > (1 << 64) - 1);\\n value >>= exp;\\n result += exp;\\n\\n exp = 32 * SafeCast.toUint(value > (1 << 32) - 1);\\n value >>= exp;\\n result += exp;\\n\\n exp = 16 * SafeCast.toUint(value > (1 << 16) - 1);\\n value >>= exp;\\n result += exp;\\n\\n exp = 8 * SafeCast.toUint(value > (1 << 8) - 1);\\n value >>= exp;\\n result += exp;\\n\\n exp = 4 * SafeCast.toUint(value > (1 << 4) - 1);\\n value >>= exp;\\n result += exp;\\n\\n exp = 2 * SafeCast.toUint(value > (1 << 2) - 1);\\n value >>= exp;\\n result += exp;\\n\\n result += SafeCast.toUint(value > 1);\\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 + SafeCast.toUint(unsignedRoundsUp(rounding) && 1 << result < value);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 10 of a positive value rounded towards zero.\\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 + SafeCast.toUint(unsignedRoundsUp(rounding) && 10 ** result < value);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 256 of a positive value rounded towards zero.\\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 uint256 isGt;\\n unchecked {\\n isGt = SafeCast.toUint(value > (1 << 128) - 1);\\n value >>= isGt * 128;\\n result += isGt * 16;\\n\\n isGt = SafeCast.toUint(value > (1 << 64) - 1);\\n value >>= isGt * 64;\\n result += isGt * 8;\\n\\n isGt = SafeCast.toUint(value > (1 << 32) - 1);\\n value >>= isGt * 32;\\n result += isGt * 4;\\n\\n isGt = SafeCast.toUint(value > (1 << 16) - 1);\\n value >>= isGt * 16;\\n result += isGt * 2;\\n\\n result += SafeCast.toUint(value > (1 << 8) - 1);\\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 + SafeCast.toUint(unsignedRoundsUp(rounding) && 1 << (result << 3) < value);\\n }\\n }\\n\\n /**\\n * @dev Returns whether a provided rounding mode is considered rounding up for unsigned integers.\\n */\\n function unsignedRoundsUp(Rounding rounding) internal pure returns (bool) {\\n return uint8(rounding) % 2 == 1;\\n }\\n}\\n\",\"keccak256\":\"0xa00be322d7db5786750ce0ac7e2f5b633ac30a5ed5fa1ced1e74acfc19acecea\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/math/SafeCast.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/math/SafeCast.sol)\\n// This file was procedurally generated from scripts/generate/templates/SafeCast.js.\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Wrappers over Solidity's uintXX/intXX/bool casting operators with added overflow\\n * checks.\\n *\\n * Downcasting from uint256/int256 in Solidity does not revert on overflow. This can\\n * easily result in undesired exploitation or bugs, since developers usually\\n * assume that overflows raise errors. `SafeCast` restores this intuition by\\n * reverting the transaction when such an operation overflows.\\n *\\n * Using this library instead of the unchecked operations eliminates an entire\\n * class of bugs, so it's recommended to use it always.\\n */\\nlibrary SafeCast {\\n /**\\n * @dev Value doesn't fit in an uint of `bits` size.\\n */\\n error SafeCastOverflowedUintDowncast(uint8 bits, uint256 value);\\n\\n /**\\n * @dev An int value doesn't fit in an uint of `bits` size.\\n */\\n error SafeCastOverflowedIntToUint(int256 value);\\n\\n /**\\n * @dev Value doesn't fit in an int of `bits` size.\\n */\\n error SafeCastOverflowedIntDowncast(uint8 bits, int256 value);\\n\\n /**\\n * @dev An uint value doesn't fit in an int of `bits` size.\\n */\\n error SafeCastOverflowedUintToInt(uint256 value);\\n\\n /**\\n * @dev Returns the downcasted uint248 from uint256, reverting on\\n * overflow (when the input is greater than largest uint248).\\n *\\n * Counterpart to Solidity's `uint248` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 248 bits\\n */\\n function toUint248(uint256 value) internal pure returns (uint248) {\\n if (value > type(uint248).max) {\\n revert SafeCastOverflowedUintDowncast(248, value);\\n }\\n return uint248(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint240 from uint256, reverting on\\n * overflow (when the input is greater than largest uint240).\\n *\\n * Counterpart to Solidity's `uint240` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 240 bits\\n */\\n function toUint240(uint256 value) internal pure returns (uint240) {\\n if (value > type(uint240).max) {\\n revert SafeCastOverflowedUintDowncast(240, value);\\n }\\n return uint240(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint232 from uint256, reverting on\\n * overflow (when the input is greater than largest uint232).\\n *\\n * Counterpart to Solidity's `uint232` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 232 bits\\n */\\n function toUint232(uint256 value) internal pure returns (uint232) {\\n if (value > type(uint232).max) {\\n revert SafeCastOverflowedUintDowncast(232, value);\\n }\\n return uint232(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint224 from uint256, reverting on\\n * overflow (when the input is greater than largest uint224).\\n *\\n * Counterpart to Solidity's `uint224` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 224 bits\\n */\\n function toUint224(uint256 value) internal pure returns (uint224) {\\n if (value > type(uint224).max) {\\n revert SafeCastOverflowedUintDowncast(224, value);\\n }\\n return uint224(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint216 from uint256, reverting on\\n * overflow (when the input is greater than largest uint216).\\n *\\n * Counterpart to Solidity's `uint216` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 216 bits\\n */\\n function toUint216(uint256 value) internal pure returns (uint216) {\\n if (value > type(uint216).max) {\\n revert SafeCastOverflowedUintDowncast(216, value);\\n }\\n return uint216(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint208 from uint256, reverting on\\n * overflow (when the input is greater than largest uint208).\\n *\\n * Counterpart to Solidity's `uint208` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 208 bits\\n */\\n function toUint208(uint256 value) internal pure returns (uint208) {\\n if (value > type(uint208).max) {\\n revert SafeCastOverflowedUintDowncast(208, value);\\n }\\n return uint208(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint200 from uint256, reverting on\\n * overflow (when the input is greater than largest uint200).\\n *\\n * Counterpart to Solidity's `uint200` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 200 bits\\n */\\n function toUint200(uint256 value) internal pure returns (uint200) {\\n if (value > type(uint200).max) {\\n revert SafeCastOverflowedUintDowncast(200, value);\\n }\\n return uint200(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint192 from uint256, reverting on\\n * overflow (when the input is greater than largest uint192).\\n *\\n * Counterpart to Solidity's `uint192` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 192 bits\\n */\\n function toUint192(uint256 value) internal pure returns (uint192) {\\n if (value > type(uint192).max) {\\n revert SafeCastOverflowedUintDowncast(192, value);\\n }\\n return uint192(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint184 from uint256, reverting on\\n * overflow (when the input is greater than largest uint184).\\n *\\n * Counterpart to Solidity's `uint184` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 184 bits\\n */\\n function toUint184(uint256 value) internal pure returns (uint184) {\\n if (value > type(uint184).max) {\\n revert SafeCastOverflowedUintDowncast(184, value);\\n }\\n return uint184(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint176 from uint256, reverting on\\n * overflow (when the input is greater than largest uint176).\\n *\\n * Counterpart to Solidity's `uint176` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 176 bits\\n */\\n function toUint176(uint256 value) internal pure returns (uint176) {\\n if (value > type(uint176).max) {\\n revert SafeCastOverflowedUintDowncast(176, value);\\n }\\n return uint176(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint168 from uint256, reverting on\\n * overflow (when the input is greater than largest uint168).\\n *\\n * Counterpart to Solidity's `uint168` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 168 bits\\n */\\n function toUint168(uint256 value) internal pure returns (uint168) {\\n if (value > type(uint168).max) {\\n revert SafeCastOverflowedUintDowncast(168, value);\\n }\\n return uint168(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint160 from uint256, reverting on\\n * overflow (when the input is greater than largest uint160).\\n *\\n * Counterpart to Solidity's `uint160` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 160 bits\\n */\\n function toUint160(uint256 value) internal pure returns (uint160) {\\n if (value > type(uint160).max) {\\n revert SafeCastOverflowedUintDowncast(160, value);\\n }\\n return uint160(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint152 from uint256, reverting on\\n * overflow (when the input is greater than largest uint152).\\n *\\n * Counterpart to Solidity's `uint152` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 152 bits\\n */\\n function toUint152(uint256 value) internal pure returns (uint152) {\\n if (value > type(uint152).max) {\\n revert SafeCastOverflowedUintDowncast(152, value);\\n }\\n return uint152(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint144 from uint256, reverting on\\n * overflow (when the input is greater than largest uint144).\\n *\\n * Counterpart to Solidity's `uint144` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 144 bits\\n */\\n function toUint144(uint256 value) internal pure returns (uint144) {\\n if (value > type(uint144).max) {\\n revert SafeCastOverflowedUintDowncast(144, value);\\n }\\n return uint144(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint136 from uint256, reverting on\\n * overflow (when the input is greater than largest uint136).\\n *\\n * Counterpart to Solidity's `uint136` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 136 bits\\n */\\n function toUint136(uint256 value) internal pure returns (uint136) {\\n if (value > type(uint136).max) {\\n revert SafeCastOverflowedUintDowncast(136, value);\\n }\\n return uint136(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint128 from uint256, reverting on\\n * overflow (when the input is greater than largest uint128).\\n *\\n * Counterpart to Solidity's `uint128` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 128 bits\\n */\\n function toUint128(uint256 value) internal pure returns (uint128) {\\n if (value > type(uint128).max) {\\n revert SafeCastOverflowedUintDowncast(128, value);\\n }\\n return uint128(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint120 from uint256, reverting on\\n * overflow (when the input is greater than largest uint120).\\n *\\n * Counterpart to Solidity's `uint120` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 120 bits\\n */\\n function toUint120(uint256 value) internal pure returns (uint120) {\\n if (value > type(uint120).max) {\\n revert SafeCastOverflowedUintDowncast(120, value);\\n }\\n return uint120(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint112 from uint256, reverting on\\n * overflow (when the input is greater than largest uint112).\\n *\\n * Counterpart to Solidity's `uint112` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 112 bits\\n */\\n function toUint112(uint256 value) internal pure returns (uint112) {\\n if (value > type(uint112).max) {\\n revert SafeCastOverflowedUintDowncast(112, value);\\n }\\n return uint112(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint104 from uint256, reverting on\\n * overflow (when the input is greater than largest uint104).\\n *\\n * Counterpart to Solidity's `uint104` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 104 bits\\n */\\n function toUint104(uint256 value) internal pure returns (uint104) {\\n if (value > type(uint104).max) {\\n revert SafeCastOverflowedUintDowncast(104, value);\\n }\\n return uint104(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint96 from uint256, reverting on\\n * overflow (when the input is greater than largest uint96).\\n *\\n * Counterpart to Solidity's `uint96` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 96 bits\\n */\\n function toUint96(uint256 value) internal pure returns (uint96) {\\n if (value > type(uint96).max) {\\n revert SafeCastOverflowedUintDowncast(96, value);\\n }\\n return uint96(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint88 from uint256, reverting on\\n * overflow (when the input is greater than largest uint88).\\n *\\n * Counterpart to Solidity's `uint88` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 88 bits\\n */\\n function toUint88(uint256 value) internal pure returns (uint88) {\\n if (value > type(uint88).max) {\\n revert SafeCastOverflowedUintDowncast(88, value);\\n }\\n return uint88(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint80 from uint256, reverting on\\n * overflow (when the input is greater than largest uint80).\\n *\\n * Counterpart to Solidity's `uint80` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 80 bits\\n */\\n function toUint80(uint256 value) internal pure returns (uint80) {\\n if (value > type(uint80).max) {\\n revert SafeCastOverflowedUintDowncast(80, value);\\n }\\n return uint80(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint72 from uint256, reverting on\\n * overflow (when the input is greater than largest uint72).\\n *\\n * Counterpart to Solidity's `uint72` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 72 bits\\n */\\n function toUint72(uint256 value) internal pure returns (uint72) {\\n if (value > type(uint72).max) {\\n revert SafeCastOverflowedUintDowncast(72, value);\\n }\\n return uint72(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint64 from uint256, reverting on\\n * overflow (when the input is greater than largest uint64).\\n *\\n * Counterpart to Solidity's `uint64` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 64 bits\\n */\\n function toUint64(uint256 value) internal pure returns (uint64) {\\n if (value > type(uint64).max) {\\n revert SafeCastOverflowedUintDowncast(64, value);\\n }\\n return uint64(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint56 from uint256, reverting on\\n * overflow (when the input is greater than largest uint56).\\n *\\n * Counterpart to Solidity's `uint56` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 56 bits\\n */\\n function toUint56(uint256 value) internal pure returns (uint56) {\\n if (value > type(uint56).max) {\\n revert SafeCastOverflowedUintDowncast(56, value);\\n }\\n return uint56(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint48 from uint256, reverting on\\n * overflow (when the input is greater than largest uint48).\\n *\\n * Counterpart to Solidity's `uint48` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 48 bits\\n */\\n function toUint48(uint256 value) internal pure returns (uint48) {\\n if (value > type(uint48).max) {\\n revert SafeCastOverflowedUintDowncast(48, value);\\n }\\n return uint48(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint40 from uint256, reverting on\\n * overflow (when the input is greater than largest uint40).\\n *\\n * Counterpart to Solidity's `uint40` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 40 bits\\n */\\n function toUint40(uint256 value) internal pure returns (uint40) {\\n if (value > type(uint40).max) {\\n revert SafeCastOverflowedUintDowncast(40, value);\\n }\\n return uint40(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint32 from uint256, reverting on\\n * overflow (when the input is greater than largest uint32).\\n *\\n * Counterpart to Solidity's `uint32` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 32 bits\\n */\\n function toUint32(uint256 value) internal pure returns (uint32) {\\n if (value > type(uint32).max) {\\n revert SafeCastOverflowedUintDowncast(32, value);\\n }\\n return uint32(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint24 from uint256, reverting on\\n * overflow (when the input is greater than largest uint24).\\n *\\n * Counterpart to Solidity's `uint24` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 24 bits\\n */\\n function toUint24(uint256 value) internal pure returns (uint24) {\\n if (value > type(uint24).max) {\\n revert SafeCastOverflowedUintDowncast(24, value);\\n }\\n return uint24(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint16 from uint256, reverting on\\n * overflow (when the input is greater than largest uint16).\\n *\\n * Counterpart to Solidity's `uint16` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 16 bits\\n */\\n function toUint16(uint256 value) internal pure returns (uint16) {\\n if (value > type(uint16).max) {\\n revert SafeCastOverflowedUintDowncast(16, value);\\n }\\n return uint16(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted uint8 from uint256, reverting on\\n * overflow (when the input is greater than largest uint8).\\n *\\n * Counterpart to Solidity's `uint8` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 8 bits\\n */\\n function toUint8(uint256 value) internal pure returns (uint8) {\\n if (value > type(uint8).max) {\\n revert SafeCastOverflowedUintDowncast(8, value);\\n }\\n return uint8(value);\\n }\\n\\n /**\\n * @dev Converts a signed int256 into an unsigned uint256.\\n *\\n * Requirements:\\n *\\n * - input must be greater than or equal to 0.\\n */\\n function toUint256(int256 value) internal pure returns (uint256) {\\n if (value < 0) {\\n revert SafeCastOverflowedIntToUint(value);\\n }\\n return uint256(value);\\n }\\n\\n /**\\n * @dev Returns the downcasted int248 from int256, reverting on\\n * overflow (when the input is less than smallest int248 or\\n * greater than largest int248).\\n *\\n * Counterpart to Solidity's `int248` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 248 bits\\n */\\n function toInt248(int256 value) internal pure returns (int248 downcasted) {\\n downcasted = int248(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(248, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int240 from int256, reverting on\\n * overflow (when the input is less than smallest int240 or\\n * greater than largest int240).\\n *\\n * Counterpart to Solidity's `int240` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 240 bits\\n */\\n function toInt240(int256 value) internal pure returns (int240 downcasted) {\\n downcasted = int240(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(240, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int232 from int256, reverting on\\n * overflow (when the input is less than smallest int232 or\\n * greater than largest int232).\\n *\\n * Counterpart to Solidity's `int232` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 232 bits\\n */\\n function toInt232(int256 value) internal pure returns (int232 downcasted) {\\n downcasted = int232(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(232, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int224 from int256, reverting on\\n * overflow (when the input is less than smallest int224 or\\n * greater than largest int224).\\n *\\n * Counterpart to Solidity's `int224` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 224 bits\\n */\\n function toInt224(int256 value) internal pure returns (int224 downcasted) {\\n downcasted = int224(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(224, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int216 from int256, reverting on\\n * overflow (when the input is less than smallest int216 or\\n * greater than largest int216).\\n *\\n * Counterpart to Solidity's `int216` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 216 bits\\n */\\n function toInt216(int256 value) internal pure returns (int216 downcasted) {\\n downcasted = int216(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(216, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int208 from int256, reverting on\\n * overflow (when the input is less than smallest int208 or\\n * greater than largest int208).\\n *\\n * Counterpart to Solidity's `int208` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 208 bits\\n */\\n function toInt208(int256 value) internal pure returns (int208 downcasted) {\\n downcasted = int208(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(208, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int200 from int256, reverting on\\n * overflow (when the input is less than smallest int200 or\\n * greater than largest int200).\\n *\\n * Counterpart to Solidity's `int200` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 200 bits\\n */\\n function toInt200(int256 value) internal pure returns (int200 downcasted) {\\n downcasted = int200(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(200, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int192 from int256, reverting on\\n * overflow (when the input is less than smallest int192 or\\n * greater than largest int192).\\n *\\n * Counterpart to Solidity's `int192` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 192 bits\\n */\\n function toInt192(int256 value) internal pure returns (int192 downcasted) {\\n downcasted = int192(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(192, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int184 from int256, reverting on\\n * overflow (when the input is less than smallest int184 or\\n * greater than largest int184).\\n *\\n * Counterpart to Solidity's `int184` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 184 bits\\n */\\n function toInt184(int256 value) internal pure returns (int184 downcasted) {\\n downcasted = int184(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(184, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int176 from int256, reverting on\\n * overflow (when the input is less than smallest int176 or\\n * greater than largest int176).\\n *\\n * Counterpart to Solidity's `int176` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 176 bits\\n */\\n function toInt176(int256 value) internal pure returns (int176 downcasted) {\\n downcasted = int176(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(176, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int168 from int256, reverting on\\n * overflow (when the input is less than smallest int168 or\\n * greater than largest int168).\\n *\\n * Counterpart to Solidity's `int168` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 168 bits\\n */\\n function toInt168(int256 value) internal pure returns (int168 downcasted) {\\n downcasted = int168(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(168, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int160 from int256, reverting on\\n * overflow (when the input is less than smallest int160 or\\n * greater than largest int160).\\n *\\n * Counterpart to Solidity's `int160` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 160 bits\\n */\\n function toInt160(int256 value) internal pure returns (int160 downcasted) {\\n downcasted = int160(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(160, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int152 from int256, reverting on\\n * overflow (when the input is less than smallest int152 or\\n * greater than largest int152).\\n *\\n * Counterpart to Solidity's `int152` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 152 bits\\n */\\n function toInt152(int256 value) internal pure returns (int152 downcasted) {\\n downcasted = int152(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(152, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int144 from int256, reverting on\\n * overflow (when the input is less than smallest int144 or\\n * greater than largest int144).\\n *\\n * Counterpart to Solidity's `int144` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 144 bits\\n */\\n function toInt144(int256 value) internal pure returns (int144 downcasted) {\\n downcasted = int144(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(144, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int136 from int256, reverting on\\n * overflow (when the input is less than smallest int136 or\\n * greater than largest int136).\\n *\\n * Counterpart to Solidity's `int136` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 136 bits\\n */\\n function toInt136(int256 value) internal pure returns (int136 downcasted) {\\n downcasted = int136(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(136, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int128 from int256, reverting on\\n * overflow (when the input is less than smallest int128 or\\n * greater than largest int128).\\n *\\n * Counterpart to Solidity's `int128` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 128 bits\\n */\\n function toInt128(int256 value) internal pure returns (int128 downcasted) {\\n downcasted = int128(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(128, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int120 from int256, reverting on\\n * overflow (when the input is less than smallest int120 or\\n * greater than largest int120).\\n *\\n * Counterpart to Solidity's `int120` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 120 bits\\n */\\n function toInt120(int256 value) internal pure returns (int120 downcasted) {\\n downcasted = int120(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(120, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int112 from int256, reverting on\\n * overflow (when the input is less than smallest int112 or\\n * greater than largest int112).\\n *\\n * Counterpart to Solidity's `int112` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 112 bits\\n */\\n function toInt112(int256 value) internal pure returns (int112 downcasted) {\\n downcasted = int112(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(112, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int104 from int256, reverting on\\n * overflow (when the input is less than smallest int104 or\\n * greater than largest int104).\\n *\\n * Counterpart to Solidity's `int104` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 104 bits\\n */\\n function toInt104(int256 value) internal pure returns (int104 downcasted) {\\n downcasted = int104(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(104, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int96 from int256, reverting on\\n * overflow (when the input is less than smallest int96 or\\n * greater than largest int96).\\n *\\n * Counterpart to Solidity's `int96` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 96 bits\\n */\\n function toInt96(int256 value) internal pure returns (int96 downcasted) {\\n downcasted = int96(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(96, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int88 from int256, reverting on\\n * overflow (when the input is less than smallest int88 or\\n * greater than largest int88).\\n *\\n * Counterpart to Solidity's `int88` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 88 bits\\n */\\n function toInt88(int256 value) internal pure returns (int88 downcasted) {\\n downcasted = int88(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(88, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int80 from int256, reverting on\\n * overflow (when the input is less than smallest int80 or\\n * greater than largest int80).\\n *\\n * Counterpart to Solidity's `int80` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 80 bits\\n */\\n function toInt80(int256 value) internal pure returns (int80 downcasted) {\\n downcasted = int80(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(80, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int72 from int256, reverting on\\n * overflow (when the input is less than smallest int72 or\\n * greater than largest int72).\\n *\\n * Counterpart to Solidity's `int72` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 72 bits\\n */\\n function toInt72(int256 value) internal pure returns (int72 downcasted) {\\n downcasted = int72(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(72, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int64 from int256, reverting on\\n * overflow (when the input is less than smallest int64 or\\n * greater than largest int64).\\n *\\n * Counterpart to Solidity's `int64` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 64 bits\\n */\\n function toInt64(int256 value) internal pure returns (int64 downcasted) {\\n downcasted = int64(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(64, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int56 from int256, reverting on\\n * overflow (when the input is less than smallest int56 or\\n * greater than largest int56).\\n *\\n * Counterpart to Solidity's `int56` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 56 bits\\n */\\n function toInt56(int256 value) internal pure returns (int56 downcasted) {\\n downcasted = int56(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(56, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int48 from int256, reverting on\\n * overflow (when the input is less than smallest int48 or\\n * greater than largest int48).\\n *\\n * Counterpart to Solidity's `int48` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 48 bits\\n */\\n function toInt48(int256 value) internal pure returns (int48 downcasted) {\\n downcasted = int48(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(48, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int40 from int256, reverting on\\n * overflow (when the input is less than smallest int40 or\\n * greater than largest int40).\\n *\\n * Counterpart to Solidity's `int40` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 40 bits\\n */\\n function toInt40(int256 value) internal pure returns (int40 downcasted) {\\n downcasted = int40(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(40, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int32 from int256, reverting on\\n * overflow (when the input is less than smallest int32 or\\n * greater than largest int32).\\n *\\n * Counterpart to Solidity's `int32` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 32 bits\\n */\\n function toInt32(int256 value) internal pure returns (int32 downcasted) {\\n downcasted = int32(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(32, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int24 from int256, reverting on\\n * overflow (when the input is less than smallest int24 or\\n * greater than largest int24).\\n *\\n * Counterpart to Solidity's `int24` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 24 bits\\n */\\n function toInt24(int256 value) internal pure returns (int24 downcasted) {\\n downcasted = int24(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(24, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int16 from int256, reverting on\\n * overflow (when the input is less than smallest int16 or\\n * greater than largest int16).\\n *\\n * Counterpart to Solidity's `int16` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 16 bits\\n */\\n function toInt16(int256 value) internal pure returns (int16 downcasted) {\\n downcasted = int16(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(16, value);\\n }\\n }\\n\\n /**\\n * @dev Returns the downcasted int8 from int256, reverting on\\n * overflow (when the input is less than smallest int8 or\\n * greater than largest int8).\\n *\\n * Counterpart to Solidity's `int8` operator.\\n *\\n * Requirements:\\n *\\n * - input must fit into 8 bits\\n */\\n function toInt8(int256 value) internal pure returns (int8 downcasted) {\\n downcasted = int8(value);\\n if (downcasted != value) {\\n revert SafeCastOverflowedIntDowncast(8, value);\\n }\\n }\\n\\n /**\\n * @dev Converts an unsigned uint256 into a signed int256.\\n *\\n * Requirements:\\n *\\n * - input must be less than or equal to maxInt256.\\n */\\n function toInt256(uint256 value) internal pure returns (int256) {\\n // Note: Unsafe cast below is okay because `type(int256).max` is guaranteed to be positive\\n if (value > uint256(type(int256).max)) {\\n revert SafeCastOverflowedUintToInt(value);\\n }\\n return int256(value);\\n }\\n\\n /**\\n * @dev Cast a boolean (false or true) to a uint256 (0 or 1) with no jump.\\n */\\n function toUint(bool b) internal pure returns (uint256 u) {\\n assembly (\\\"memory-safe\\\") {\\n u := iszero(iszero(b))\\n }\\n }\\n}\\n\",\"keccak256\":\"0x195533c86d0ef72bcc06456a4f66a9b941f38eb403739b00f21fd7c1abd1ae54\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/math/SignedMath.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/math/SignedMath.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {SafeCast} from \\\"./SafeCast.sol\\\";\\n\\n/**\\n * @dev Standard signed math utilities missing in the Solidity language.\\n */\\nlibrary SignedMath {\\n /**\\n * @dev Branchless ternary evaluation for `a ? b : c`. Gas costs are constant.\\n *\\n * IMPORTANT: This function may reduce bytecode size and consume less gas when used standalone.\\n * However, the compiler may optimize Solidity ternary operations (i.e. `a ? b : c`) to only compute\\n * one branch when needed, making this function more expensive.\\n */\\n function ternary(bool condition, int256 a, int256 b) internal pure returns (int256) {\\n unchecked {\\n // branchless ternary works because:\\n // b ^ (a ^ b) == a\\n // b ^ 0 == b\\n return b ^ ((a ^ b) * int256(SafeCast.toUint(condition)));\\n }\\n }\\n\\n /**\\n * @dev Returns the largest of two signed numbers.\\n */\\n function max(int256 a, int256 b) internal pure returns (int256) {\\n return ternary(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 ternary(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 // Formula from the \\\"Bit Twiddling Hacks\\\" by Sean Eron Anderson.\\n // Since `n` is a signed integer, the generated bytecode will use the SAR opcode to perform the right shift,\\n // taking advantage of the most significant (or \\\"sign\\\" bit) in two's complement representation.\\n // This opcode adds new most significant bits set to the value of the previous most significant bit. As a result,\\n // the mask will either be `bytes32(0)` (if n is positive) or `~bytes32(0)` (if n is negative).\\n int256 mask = n >> 255;\\n\\n // A `bytes32(0)` mask leaves the input unchanged, while a `~bytes32(0)` mask complements it.\\n return uint256((n + mask) ^ mask);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xb1970fac7b64e6c09611e6691791e848d5e3fe410fa5899e7df2e0afd77a99e3\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/structs/Checkpoints.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/structs/Checkpoints.sol)\\n// This file was procedurally generated from scripts/generate/templates/Checkpoints.js.\\n\\npragma solidity ^0.8.20;\\n\\nimport {Math} from \\\"../math/Math.sol\\\";\\n\\n/**\\n * @dev This library defines the `Trace*` struct, for checkpointing values as they change at different points in\\n * time, and later looking up past values by block number. See {Votes} as an example.\\n *\\n * To create a history of checkpoints define a variable type `Checkpoints.Trace*` in your contract, and store a new\\n * checkpoint for the current transaction block using the {push} function.\\n */\\nlibrary Checkpoints {\\n /**\\n * @dev A value was attempted to be inserted on a past checkpoint.\\n */\\n error CheckpointUnorderedInsertion();\\n\\n struct Trace224 {\\n Checkpoint224[] _checkpoints;\\n }\\n\\n struct Checkpoint224 {\\n uint32 _key;\\n uint224 _value;\\n }\\n\\n /**\\n * @dev Pushes a (`key`, `value`) pair into a Trace224 so that it is stored as the checkpoint.\\n *\\n * Returns previous value and new value.\\n *\\n * IMPORTANT: Never accept `key` as a user input, since an arbitrary `type(uint32).max` key set will disable the\\n * library.\\n */\\n function push(\\n Trace224 storage self,\\n uint32 key,\\n uint224 value\\n ) internal returns (uint224 oldValue, uint224 newValue) {\\n return _insert(self._checkpoints, key, value);\\n }\\n\\n /**\\n * @dev Returns the value in the first (oldest) checkpoint with key greater or equal than the search key, or zero if\\n * there is none.\\n */\\n function lowerLookup(Trace224 storage self, uint32 key) internal view returns (uint224) {\\n uint256 len = self._checkpoints.length;\\n uint256 pos = _lowerBinaryLookup(self._checkpoints, key, 0, len);\\n return pos == len ? 0 : _unsafeAccess(self._checkpoints, pos)._value;\\n }\\n\\n /**\\n * @dev Returns the value in the last (most recent) checkpoint with key lower or equal than the search key, or zero\\n * if there is none.\\n */\\n function upperLookup(Trace224 storage self, uint32 key) internal view returns (uint224) {\\n uint256 len = self._checkpoints.length;\\n uint256 pos = _upperBinaryLookup(self._checkpoints, key, 0, len);\\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\\n }\\n\\n /**\\n * @dev Returns the value in the last (most recent) checkpoint with key lower or equal than the search key, or zero\\n * if there is none.\\n *\\n * NOTE: This is a variant of {upperLookup} that is optimised to find \\\"recent\\\" checkpoint (checkpoints with high\\n * keys).\\n */\\n function upperLookupRecent(Trace224 storage self, uint32 key) internal view returns (uint224) {\\n uint256 len = self._checkpoints.length;\\n\\n uint256 low = 0;\\n uint256 high = len;\\n\\n if (len > 5) {\\n uint256 mid = len - Math.sqrt(len);\\n if (key < _unsafeAccess(self._checkpoints, mid)._key) {\\n high = mid;\\n } else {\\n low = mid + 1;\\n }\\n }\\n\\n uint256 pos = _upperBinaryLookup(self._checkpoints, key, low, high);\\n\\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\\n }\\n\\n /**\\n * @dev Returns the value in the most recent checkpoint, or zero if there are no checkpoints.\\n */\\n function latest(Trace224 storage self) internal view returns (uint224) {\\n uint256 pos = self._checkpoints.length;\\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\\n }\\n\\n /**\\n * @dev Returns whether there is a checkpoint in the structure (i.e. it is not empty), and if so the key and value\\n * in the most recent checkpoint.\\n */\\n function latestCheckpoint(Trace224 storage self) internal view returns (bool exists, uint32 _key, uint224 _value) {\\n uint256 pos = self._checkpoints.length;\\n if (pos == 0) {\\n return (false, 0, 0);\\n } else {\\n Checkpoint224 storage ckpt = _unsafeAccess(self._checkpoints, pos - 1);\\n return (true, ckpt._key, ckpt._value);\\n }\\n }\\n\\n /**\\n * @dev Returns the number of checkpoint.\\n */\\n function length(Trace224 storage self) internal view returns (uint256) {\\n return self._checkpoints.length;\\n }\\n\\n /**\\n * @dev Returns checkpoint at given position.\\n */\\n function at(Trace224 storage self, uint32 pos) internal view returns (Checkpoint224 memory) {\\n return self._checkpoints[pos];\\n }\\n\\n /**\\n * @dev Pushes a (`key`, `value`) pair into an ordered list of checkpoints, either by inserting a new checkpoint,\\n * or by updating the last one.\\n */\\n function _insert(\\n Checkpoint224[] storage self,\\n uint32 key,\\n uint224 value\\n ) private returns (uint224 oldValue, uint224 newValue) {\\n uint256 pos = self.length;\\n\\n if (pos > 0) {\\n Checkpoint224 storage last = _unsafeAccess(self, pos - 1);\\n uint32 lastKey = last._key;\\n uint224 lastValue = last._value;\\n\\n // Checkpoint keys must be non-decreasing.\\n if (lastKey > key) {\\n revert CheckpointUnorderedInsertion();\\n }\\n\\n // Update or push new checkpoint\\n if (lastKey == key) {\\n last._value = value;\\n } else {\\n self.push(Checkpoint224({_key: key, _value: value}));\\n }\\n return (lastValue, value);\\n } else {\\n self.push(Checkpoint224({_key: key, _value: value}));\\n return (0, value);\\n }\\n }\\n\\n /**\\n * @dev Return the index of the first (oldest) checkpoint with key strictly bigger than the search key, or `high`\\n * if there is none. `low` and `high` define a section where to do the search, with inclusive `low` and exclusive\\n * `high`.\\n *\\n * WARNING: `high` should not be greater than the array's length.\\n */\\n function _upperBinaryLookup(\\n Checkpoint224[] storage self,\\n uint32 key,\\n uint256 low,\\n uint256 high\\n ) private view returns (uint256) {\\n while (low < high) {\\n uint256 mid = Math.average(low, high);\\n if (_unsafeAccess(self, mid)._key > key) {\\n high = mid;\\n } else {\\n low = mid + 1;\\n }\\n }\\n return high;\\n }\\n\\n /**\\n * @dev Return the index of the first (oldest) checkpoint with key greater or equal than the search key, or `high`\\n * if there is none. `low` and `high` define a section where to do the search, with inclusive `low` and exclusive\\n * `high`.\\n *\\n * WARNING: `high` should not be greater than the array's length.\\n */\\n function _lowerBinaryLookup(\\n Checkpoint224[] storage self,\\n uint32 key,\\n uint256 low,\\n uint256 high\\n ) private view returns (uint256) {\\n while (low < high) {\\n uint256 mid = Math.average(low, high);\\n if (_unsafeAccess(self, mid)._key < key) {\\n low = mid + 1;\\n } else {\\n high = mid;\\n }\\n }\\n return high;\\n }\\n\\n /**\\n * @dev Access an element of the array without performing bounds check. The position is assumed to be within bounds.\\n */\\n function _unsafeAccess(\\n Checkpoint224[] storage self,\\n uint256 pos\\n ) private pure returns (Checkpoint224 storage result) {\\n assembly {\\n mstore(0, self.slot)\\n result.slot := add(keccak256(0, 0x20), pos)\\n }\\n }\\n\\n struct Trace208 {\\n Checkpoint208[] _checkpoints;\\n }\\n\\n struct Checkpoint208 {\\n uint48 _key;\\n uint208 _value;\\n }\\n\\n /**\\n * @dev Pushes a (`key`, `value`) pair into a Trace208 so that it is stored as the checkpoint.\\n *\\n * Returns previous value and new value.\\n *\\n * IMPORTANT: Never accept `key` as a user input, since an arbitrary `type(uint48).max` key set will disable the\\n * library.\\n */\\n function push(\\n Trace208 storage self,\\n uint48 key,\\n uint208 value\\n ) internal returns (uint208 oldValue, uint208 newValue) {\\n return _insert(self._checkpoints, key, value);\\n }\\n\\n /**\\n * @dev Returns the value in the first (oldest) checkpoint with key greater or equal than the search key, or zero if\\n * there is none.\\n */\\n function lowerLookup(Trace208 storage self, uint48 key) internal view returns (uint208) {\\n uint256 len = self._checkpoints.length;\\n uint256 pos = _lowerBinaryLookup(self._checkpoints, key, 0, len);\\n return pos == len ? 0 : _unsafeAccess(self._checkpoints, pos)._value;\\n }\\n\\n /**\\n * @dev Returns the value in the last (most recent) checkpoint with key lower or equal than the search key, or zero\\n * if there is none.\\n */\\n function upperLookup(Trace208 storage self, uint48 key) internal view returns (uint208) {\\n uint256 len = self._checkpoints.length;\\n uint256 pos = _upperBinaryLookup(self._checkpoints, key, 0, len);\\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\\n }\\n\\n /**\\n * @dev Returns the value in the last (most recent) checkpoint with key lower or equal than the search key, or zero\\n * if there is none.\\n *\\n * NOTE: This is a variant of {upperLookup} that is optimised to find \\\"recent\\\" checkpoint (checkpoints with high\\n * keys).\\n */\\n function upperLookupRecent(Trace208 storage self, uint48 key) internal view returns (uint208) {\\n uint256 len = self._checkpoints.length;\\n\\n uint256 low = 0;\\n uint256 high = len;\\n\\n if (len > 5) {\\n uint256 mid = len - Math.sqrt(len);\\n if (key < _unsafeAccess(self._checkpoints, mid)._key) {\\n high = mid;\\n } else {\\n low = mid + 1;\\n }\\n }\\n\\n uint256 pos = _upperBinaryLookup(self._checkpoints, key, low, high);\\n\\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\\n }\\n\\n /**\\n * @dev Returns the value in the most recent checkpoint, or zero if there are no checkpoints.\\n */\\n function latest(Trace208 storage self) internal view returns (uint208) {\\n uint256 pos = self._checkpoints.length;\\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\\n }\\n\\n /**\\n * @dev Returns whether there is a checkpoint in the structure (i.e. it is not empty), and if so the key and value\\n * in the most recent checkpoint.\\n */\\n function latestCheckpoint(Trace208 storage self) internal view returns (bool exists, uint48 _key, uint208 _value) {\\n uint256 pos = self._checkpoints.length;\\n if (pos == 0) {\\n return (false, 0, 0);\\n } else {\\n Checkpoint208 storage ckpt = _unsafeAccess(self._checkpoints, pos - 1);\\n return (true, ckpt._key, ckpt._value);\\n }\\n }\\n\\n /**\\n * @dev Returns the number of checkpoint.\\n */\\n function length(Trace208 storage self) internal view returns (uint256) {\\n return self._checkpoints.length;\\n }\\n\\n /**\\n * @dev Returns checkpoint at given position.\\n */\\n function at(Trace208 storage self, uint32 pos) internal view returns (Checkpoint208 memory) {\\n return self._checkpoints[pos];\\n }\\n\\n /**\\n * @dev Pushes a (`key`, `value`) pair into an ordered list of checkpoints, either by inserting a new checkpoint,\\n * or by updating the last one.\\n */\\n function _insert(\\n Checkpoint208[] storage self,\\n uint48 key,\\n uint208 value\\n ) private returns (uint208 oldValue, uint208 newValue) {\\n uint256 pos = self.length;\\n\\n if (pos > 0) {\\n Checkpoint208 storage last = _unsafeAccess(self, pos - 1);\\n uint48 lastKey = last._key;\\n uint208 lastValue = last._value;\\n\\n // Checkpoint keys must be non-decreasing.\\n if (lastKey > key) {\\n revert CheckpointUnorderedInsertion();\\n }\\n\\n // Update or push new checkpoint\\n if (lastKey == key) {\\n last._value = value;\\n } else {\\n self.push(Checkpoint208({_key: key, _value: value}));\\n }\\n return (lastValue, value);\\n } else {\\n self.push(Checkpoint208({_key: key, _value: value}));\\n return (0, value);\\n }\\n }\\n\\n /**\\n * @dev Return the index of the first (oldest) checkpoint with key strictly bigger than the search key, or `high`\\n * if there is none. `low` and `high` define a section where to do the search, with inclusive `low` and exclusive\\n * `high`.\\n *\\n * WARNING: `high` should not be greater than the array's length.\\n */\\n function _upperBinaryLookup(\\n Checkpoint208[] storage self,\\n uint48 key,\\n uint256 low,\\n uint256 high\\n ) private view returns (uint256) {\\n while (low < high) {\\n uint256 mid = Math.average(low, high);\\n if (_unsafeAccess(self, mid)._key > key) {\\n high = mid;\\n } else {\\n low = mid + 1;\\n }\\n }\\n return high;\\n }\\n\\n /**\\n * @dev Return the index of the first (oldest) checkpoint with key greater or equal than the search key, or `high`\\n * if there is none. `low` and `high` define a section where to do the search, with inclusive `low` and exclusive\\n * `high`.\\n *\\n * WARNING: `high` should not be greater than the array's length.\\n */\\n function _lowerBinaryLookup(\\n Checkpoint208[] storage self,\\n uint48 key,\\n uint256 low,\\n uint256 high\\n ) private view returns (uint256) {\\n while (low < high) {\\n uint256 mid = Math.average(low, high);\\n if (_unsafeAccess(self, mid)._key < key) {\\n low = mid + 1;\\n } else {\\n high = mid;\\n }\\n }\\n return high;\\n }\\n\\n /**\\n * @dev Access an element of the array without performing bounds check. The position is assumed to be within bounds.\\n */\\n function _unsafeAccess(\\n Checkpoint208[] storage self,\\n uint256 pos\\n ) private pure returns (Checkpoint208 storage result) {\\n assembly {\\n mstore(0, self.slot)\\n result.slot := add(keccak256(0, 0x20), pos)\\n }\\n }\\n\\n struct Trace160 {\\n Checkpoint160[] _checkpoints;\\n }\\n\\n struct Checkpoint160 {\\n uint96 _key;\\n uint160 _value;\\n }\\n\\n /**\\n * @dev Pushes a (`key`, `value`) pair into a Trace160 so that it is stored as the checkpoint.\\n *\\n * Returns previous value and new value.\\n *\\n * IMPORTANT: Never accept `key` as a user input, since an arbitrary `type(uint96).max` key set will disable the\\n * library.\\n */\\n function push(\\n Trace160 storage self,\\n uint96 key,\\n uint160 value\\n ) internal returns (uint160 oldValue, uint160 newValue) {\\n return _insert(self._checkpoints, key, value);\\n }\\n\\n /**\\n * @dev Returns the value in the first (oldest) checkpoint with key greater or equal than the search key, or zero if\\n * there is none.\\n */\\n function lowerLookup(Trace160 storage self, uint96 key) internal view returns (uint160) {\\n uint256 len = self._checkpoints.length;\\n uint256 pos = _lowerBinaryLookup(self._checkpoints, key, 0, len);\\n return pos == len ? 0 : _unsafeAccess(self._checkpoints, pos)._value;\\n }\\n\\n /**\\n * @dev Returns the value in the last (most recent) checkpoint with key lower or equal than the search key, or zero\\n * if there is none.\\n */\\n function upperLookup(Trace160 storage self, uint96 key) internal view returns (uint160) {\\n uint256 len = self._checkpoints.length;\\n uint256 pos = _upperBinaryLookup(self._checkpoints, key, 0, len);\\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\\n }\\n\\n /**\\n * @dev Returns the value in the last (most recent) checkpoint with key lower or equal than the search key, or zero\\n * if there is none.\\n *\\n * NOTE: This is a variant of {upperLookup} that is optimised to find \\\"recent\\\" checkpoint (checkpoints with high\\n * keys).\\n */\\n function upperLookupRecent(Trace160 storage self, uint96 key) internal view returns (uint160) {\\n uint256 len = self._checkpoints.length;\\n\\n uint256 low = 0;\\n uint256 high = len;\\n\\n if (len > 5) {\\n uint256 mid = len - Math.sqrt(len);\\n if (key < _unsafeAccess(self._checkpoints, mid)._key) {\\n high = mid;\\n } else {\\n low = mid + 1;\\n }\\n }\\n\\n uint256 pos = _upperBinaryLookup(self._checkpoints, key, low, high);\\n\\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\\n }\\n\\n /**\\n * @dev Returns the value in the most recent checkpoint, or zero if there are no checkpoints.\\n */\\n function latest(Trace160 storage self) internal view returns (uint160) {\\n uint256 pos = self._checkpoints.length;\\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\\n }\\n\\n /**\\n * @dev Returns whether there is a checkpoint in the structure (i.e. it is not empty), and if so the key and value\\n * in the most recent checkpoint.\\n */\\n function latestCheckpoint(Trace160 storage self) internal view returns (bool exists, uint96 _key, uint160 _value) {\\n uint256 pos = self._checkpoints.length;\\n if (pos == 0) {\\n return (false, 0, 0);\\n } else {\\n Checkpoint160 storage ckpt = _unsafeAccess(self._checkpoints, pos - 1);\\n return (true, ckpt._key, ckpt._value);\\n }\\n }\\n\\n /**\\n * @dev Returns the number of checkpoint.\\n */\\n function length(Trace160 storage self) internal view returns (uint256) {\\n return self._checkpoints.length;\\n }\\n\\n /**\\n * @dev Returns checkpoint at given position.\\n */\\n function at(Trace160 storage self, uint32 pos) internal view returns (Checkpoint160 memory) {\\n return self._checkpoints[pos];\\n }\\n\\n /**\\n * @dev Pushes a (`key`, `value`) pair into an ordered list of checkpoints, either by inserting a new checkpoint,\\n * or by updating the last one.\\n */\\n function _insert(\\n Checkpoint160[] storage self,\\n uint96 key,\\n uint160 value\\n ) private returns (uint160 oldValue, uint160 newValue) {\\n uint256 pos = self.length;\\n\\n if (pos > 0) {\\n Checkpoint160 storage last = _unsafeAccess(self, pos - 1);\\n uint96 lastKey = last._key;\\n uint160 lastValue = last._value;\\n\\n // Checkpoint keys must be non-decreasing.\\n if (lastKey > key) {\\n revert CheckpointUnorderedInsertion();\\n }\\n\\n // Update or push new checkpoint\\n if (lastKey == key) {\\n last._value = value;\\n } else {\\n self.push(Checkpoint160({_key: key, _value: value}));\\n }\\n return (lastValue, value);\\n } else {\\n self.push(Checkpoint160({_key: key, _value: value}));\\n return (0, value);\\n }\\n }\\n\\n /**\\n * @dev Return the index of the first (oldest) checkpoint with key strictly bigger than the search key, or `high`\\n * if there is none. `low` and `high` define a section where to do the search, with inclusive `low` and exclusive\\n * `high`.\\n *\\n * WARNING: `high` should not be greater than the array's length.\\n */\\n function _upperBinaryLookup(\\n Checkpoint160[] storage self,\\n uint96 key,\\n uint256 low,\\n uint256 high\\n ) private view returns (uint256) {\\n while (low < high) {\\n uint256 mid = Math.average(low, high);\\n if (_unsafeAccess(self, mid)._key > key) {\\n high = mid;\\n } else {\\n low = mid + 1;\\n }\\n }\\n return high;\\n }\\n\\n /**\\n * @dev Return the index of the first (oldest) checkpoint with key greater or equal than the search key, or `high`\\n * if there is none. `low` and `high` define a section where to do the search, with inclusive `low` and exclusive\\n * `high`.\\n *\\n * WARNING: `high` should not be greater than the array's length.\\n */\\n function _lowerBinaryLookup(\\n Checkpoint160[] storage self,\\n uint96 key,\\n uint256 low,\\n uint256 high\\n ) private view returns (uint256) {\\n while (low < high) {\\n uint256 mid = Math.average(low, high);\\n if (_unsafeAccess(self, mid)._key < key) {\\n low = mid + 1;\\n } else {\\n high = mid;\\n }\\n }\\n return high;\\n }\\n\\n /**\\n * @dev Access an element of the array without performing bounds check. The position is assumed to be within bounds.\\n */\\n function _unsafeAccess(\\n Checkpoint160[] storage self,\\n uint256 pos\\n ) private pure returns (Checkpoint160 storage result) {\\n assembly {\\n mstore(0, self.slot)\\n result.slot := add(keccak256(0, 0x20), pos)\\n }\\n }\\n}\\n\",\"keccak256\":\"0x66364cd3247ea71cdb58f080f5d5ed6732433a8001413139661841535494692f\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/types/Time.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/types/Time.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {Math} from \\\"../math/Math.sol\\\";\\nimport {SafeCast} from \\\"../math/SafeCast.sol\\\";\\n\\n/**\\n * @dev This library provides helpers for manipulating time-related objects.\\n *\\n * It uses the following types:\\n * - `uint48` for timepoints\\n * - `uint32` for durations\\n *\\n * While the library doesn't provide specific types for timepoints and duration, it does provide:\\n * - a `Delay` type to represent duration that can be programmed to change value automatically at a given point\\n * - additional helper functions\\n */\\nlibrary Time {\\n using Time for *;\\n\\n /**\\n * @dev Get the block timestamp as a Timepoint.\\n */\\n function timestamp() internal view returns (uint48) {\\n return SafeCast.toUint48(block.timestamp);\\n }\\n\\n /**\\n * @dev Get the block number as a Timepoint.\\n */\\n function blockNumber() internal view returns (uint48) {\\n return SafeCast.toUint48(block.number);\\n }\\n\\n // ==================================================== Delay =====================================================\\n /**\\n * @dev A `Delay` is a uint32 duration that can be programmed to change value automatically at a given point in the\\n * future. The \\\"effect\\\" timepoint describes when the transitions happens from the \\\"old\\\" value to the \\\"new\\\" value.\\n * This allows updating the delay applied to some operation while keeping some guarantees.\\n *\\n * In particular, the {update} function guarantees that if the delay is reduced, the old delay still applies for\\n * some time. For example if the delay is currently 7 days to do an upgrade, the admin should not be able to set\\n * the delay to 0 and upgrade immediately. If the admin wants to reduce the delay, the old delay (7 days) should\\n * still apply for some time.\\n *\\n *\\n * The `Delay` type is 112 bits long, and packs the following:\\n *\\n * ```\\n * | [uint48]: effect date (timepoint)\\n * | | [uint32]: value before (duration)\\n * \\u2193 \\u2193 \\u2193 [uint32]: value after (duration)\\n * 0xAAAAAAAAAAAABBBBBBBBCCCCCCCC\\n * ```\\n *\\n * NOTE: The {get} and {withUpdate} functions operate using timestamps. Block number based delays are not currently\\n * supported.\\n */\\n type Delay is uint112;\\n\\n /**\\n * @dev Wrap a duration into a Delay to add the one-step \\\"update in the future\\\" feature\\n */\\n function toDelay(uint32 duration) internal pure returns (Delay) {\\n return Delay.wrap(duration);\\n }\\n\\n /**\\n * @dev Get the value at a given timepoint plus the pending value and effect timepoint if there is a scheduled\\n * change after this timepoint. If the effect timepoint is 0, then the pending value should not be considered.\\n */\\n function _getFullAt(\\n Delay self,\\n uint48 timepoint\\n ) private pure returns (uint32 valueBefore, uint32 valueAfter, uint48 effect) {\\n (valueBefore, valueAfter, effect) = self.unpack();\\n return effect <= timepoint ? (valueAfter, 0, 0) : (valueBefore, valueAfter, effect);\\n }\\n\\n /**\\n * @dev Get the current value plus the pending value and effect timepoint if there is a scheduled change. If the\\n * effect timepoint is 0, then the pending value should not be considered.\\n */\\n function getFull(Delay self) internal view returns (uint32 valueBefore, uint32 valueAfter, uint48 effect) {\\n return _getFullAt(self, timestamp());\\n }\\n\\n /**\\n * @dev Get the current value.\\n */\\n function get(Delay self) internal view returns (uint32) {\\n (uint32 delay, , ) = self.getFull();\\n return delay;\\n }\\n\\n /**\\n * @dev Update a Delay object so that it takes a new duration after a timepoint that is automatically computed to\\n * enforce the old delay at the moment of the update. Returns the updated Delay object and the timestamp when the\\n * new delay becomes effective.\\n */\\n function withUpdate(\\n Delay self,\\n uint32 newValue,\\n uint32 minSetback\\n ) internal view returns (Delay updatedDelay, uint48 effect) {\\n uint32 value = self.get();\\n uint32 setback = uint32(Math.max(minSetback, value > newValue ? value - newValue : 0));\\n effect = timestamp() + setback;\\n return (pack(value, newValue, effect), effect);\\n }\\n\\n /**\\n * @dev Split a delay into its components: valueBefore, valueAfter and effect (transition timepoint).\\n */\\n function unpack(Delay self) internal pure returns (uint32 valueBefore, uint32 valueAfter, uint48 effect) {\\n uint112 raw = Delay.unwrap(self);\\n\\n valueAfter = uint32(raw);\\n valueBefore = uint32(raw >> 32);\\n effect = uint48(raw >> 64);\\n\\n return (valueBefore, valueAfter, effect);\\n }\\n\\n /**\\n * @dev pack the components into a Delay object.\\n */\\n function pack(uint32 valueBefore, uint32 valueAfter, uint48 effect) internal pure returns (Delay) {\\n return Delay.wrap((uint112(effect) << 64) | (uint112(valueBefore) << 32) | uint112(valueAfter));\\n }\\n}\\n\",\"keccak256\":\"0x36776530f012618bc7526ceb28e77b85e582cb12d9b9466a71d4bd6bf952e4cc\",\"license\":\"MIT\"},\"contracts/variants/crosschain/NFT.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity ^0.8.20;\\n\\nimport \\\"@openzeppelin/contracts/token/ERC721/ERC721.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC721/extensions/ERC721Burnable.sol\\\";\\nimport \\\"@openzeppelin/contracts/access/Ownable.sol\\\";\\nimport \\\"@openzeppelin/contracts/utils/cryptography/EIP712.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC721/extensions/ERC721Votes.sol\\\";\\nimport \\\"./ProofHandler.sol\\\";\\n\\n/**\\n * @title Cross-chain Membership NFT Contract\\n * @author Web3 Hackers Collective\\n * @notice Non-transferable NFT implementation for DAO membership with cross-chain capabilities\\n * @dev Extends OpenZeppelin's NFT standards with cross-chain operation support and delegation\\n * @custom:security-contact julien@strat.cc\\n */\\ncontract NFT is\\n ERC721,\\n ERC721Enumerable,\\n ERC721URIStorage,\\n ERC721Burnable,\\n Ownable,\\n EIP712,\\n ERC721Votes\\n{\\n using ProofHandler for ProofHandler.ProofStorage;\\n\\n /// @notice Chain ID where contract was originally deployed\\n uint256 public immutable home;\\n\\n /// @notice Next token ID to be minted\\n uint256 private _nextTokenId;\\n\\n /// @notice Storage for proof handling\\n ProofHandler.ProofStorage private _proofStorage;\\n\\n /// @notice Types of operations that can be synchronized across chains\\n enum OperationType {\\n MINT,\\n BURN,\\n SET_METADATA,\\n DELEGATE\\n }\\n\\n /// @notice Emitted when a membership is claimed\\n /// @param tokenId The ID of the claimed token\\n /// @param member The address receiving the membership\\n /// @param nonce Operation sequence number\\n event MembershipClaimed(uint256 indexed tokenId, address indexed member, uint256 nonce);\\n\\n /// @notice Emitted when a membership is revoked\\n /// @param tokenId The ID of the revoked token\\n /// @param member The address losing membership\\n /// @param nonce Operation sequence number\\n event MembershipRevoked(uint256 indexed tokenId, address indexed member, uint256 nonce);\\n\\n /// @notice Emitted when metadata is updated\\n /// @param tokenId The ID of the updated token\\n /// @param newUri The new metadata URI\\n /// @param nonce Operation sequence number\\n event MetadataUpdated(uint256 indexed tokenId, string newUri, uint256 nonce);\\n\\n /// @notice Emitted when delegation is synchronized across chains\\n /// @param delegator The address delegating their voting power\\n /// @param delegatee The address receiving the delegation\\n /// @param nonce Operation sequence number\\n event DelegationSynced(address indexed delegator, address indexed delegatee, uint256 nonce);\\n\\n /// @notice Restricts functions to home chain\\n modifier onlyHomeChain() {\\n require(block.chainid == home, \\\"Operation only allowed on home chain\\\");\\n _;\\n }\\n\\n /**\\n * @notice Initializes the NFT contract\\n * @param _home Chain ID where contract is considered home\\n * @param initialOwner Initial contract owner\\n * @param _firstMembers Array of initial member addresses\\n * @param _uri Initial token URI\\n * @param _name Token collection name\\n * @param _symbol Token collection symbol\\n */\\n constructor(\\n uint256 _home,\\n address initialOwner,\\n address[] memory _firstMembers,\\n string memory _uri,\\n string memory _name,\\n string memory _symbol\\n ) ERC721(_name, _symbol) Ownable(initialOwner) EIP712(_name, \\\"1\\\") {\\n home = _home;\\n for (uint i; i < _firstMembers.length; i++) {\\n _govMint(_firstMembers[i], _uri);\\n _delegate(_firstMembers[i], _firstMembers[i]);\\n }\\n }\\n\\n /**\\n * @notice Adds a new member on home chain\\n * @dev Only callable by owner (governance) on home chain\\n * @param to Address to mint token to\\n * @param uri Token metadata URI\\n */\\n function safeMint(address to, string memory uri) public onlyOwner onlyHomeChain {\\n uint256 nonce = _proofStorage.incrementNonce(uint8(OperationType.MINT));\\n _govMint(to, uri);\\n emit MembershipClaimed(_nextTokenId - 1, to, nonce);\\n }\\n\\n /**\\n * @notice Burns token on home chain\\n * @dev Only callable by owner (governance) on home chain\\n * @param tokenId ID of token to burn\\n */\\n function govBurn(uint256 tokenId) public onlyOwner onlyHomeChain {\\n uint256 nonce = _proofStorage.incrementNonce(uint8(OperationType.BURN));\\n address owner = ownerOf(tokenId);\\n _burn(tokenId);\\n emit MembershipRevoked(tokenId, owner, nonce);\\n }\\n\\n /**\\n * @notice Updates token metadata on home chain\\n * @dev Only callable by owner (governance) on home chain\\n * @param tokenId ID of token to update\\n * @param uri New metadata URI\\n */\\n function setMetadata(uint256 tokenId, string memory uri) public onlyOwner onlyHomeChain {\\n uint256 nonce = _proofStorage.incrementNonce(uint8(OperationType.SET_METADATA));\\n _setTokenURI(tokenId, uri);\\n emit MetadataUpdated(tokenId, uri, nonce);\\n }\\n\\n /**\\n * @notice Delegates voting power to another address on home chain\\n * @dev Overrides ERC721Votes delegate function to add cross-chain functionality\\n * @param delegatee Address to delegate voting power to\\n */\\n function delegate(address delegatee) public virtual override onlyHomeChain {\\n uint256 nonce = _proofStorage.incrementNonce(uint8(OperationType.DELEGATE));\\n _delegate(_msgSender(), delegatee);\\n emit DelegationSynced(_msgSender(), delegatee, nonce);\\n }\\n\\n /**\\n * @notice Generates proof for NFT operations\\n * @dev Only callable on home chain\\n * @param operationType Type of operation\\n * @param params Operation parameters\\n * @return Encoded proof data\\n */\\n function generateOperationProof(\\n uint8 operationType,\\n bytes memory params\\n ) external view returns (bytes memory) {\\n require(block.chainid == home, \\\"Proofs only generated on home chain\\\");\\n uint256 nextNonce = _proofStorage.getNextNonce(operationType);\\n return ProofHandler.generateProof(address(this), operationType, params, nextNonce);\\n }\\n\\n /**\\n * @notice Generates proof for delegation\\n * @dev Only callable on home chain\\n * @param delegator Address delegating voting power\\n * @param delegatee Address receiving delegation\\n * @return Encoded proof data\\n */\\n function generateDelegationProof(\\n address delegator,\\n address delegatee\\n ) external view returns (bytes memory) {\\n require(block.chainid == home, \\\"Proofs only generated on home chain\\\");\\n uint256 nextNonce = _proofStorage.getNextNonce(uint8(OperationType.DELEGATE));\\n bytes memory params = abi.encode(delegator, delegatee);\\n return\\n ProofHandler.generateProof(\\n address(this),\\n uint8(OperationType.DELEGATE),\\n params,\\n nextNonce\\n );\\n }\\n\\n // Claim operations\\n\\n /**\\n * @notice Claims an NFT operation on a foreign chain\\n * @param proof Proof generated by home chain\\n */\\n function claimOperation(bytes memory proof) external {\\n (uint8 operationType, bytes memory params, uint256 nonce) = ProofHandler\\n .verifyAndClaimProof(proof, address(this), _proofStorage);\\n\\n if (operationType == uint8(OperationType.MINT)) {\\n (address to, string memory uri) = abi.decode(params, (address, string));\\n _govMint(to, uri);\\n emit MembershipClaimed(_nextTokenId - 1, to, nonce);\\n } else if (operationType == uint8(OperationType.BURN)) {\\n uint256 tokenId = abi.decode(params, (uint256));\\n address owner = ownerOf(tokenId);\\n _burn(tokenId);\\n emit MembershipRevoked(tokenId, owner, nonce);\\n } else if (operationType == uint8(OperationType.SET_METADATA)) {\\n (uint256 tokenId, string memory uri) = abi.decode(params, (uint256, string));\\n _setTokenURI(tokenId, uri);\\n emit MetadataUpdated(tokenId, uri, nonce);\\n } else if (operationType == uint8(OperationType.DELEGATE)) {\\n (address delegator, address delegatee) = abi.decode(params, (address, address));\\n _delegate(delegator, delegatee);\\n emit DelegationSynced(delegator, delegatee, nonce);\\n }\\n }\\n\\n /**\\n * @notice Claims a delegation operation on a foreign chain\\n * @param proof Proof generated by home chain\\n */\\n function claimDelegation(bytes memory proof) external {\\n (uint8 operationType, bytes memory params, uint256 nonce) = ProofHandler\\n .verifyAndClaimProof(proof, address(this), _proofStorage);\\n\\n require(operationType == uint8(OperationType.DELEGATE), \\\"Invalid operation type\\\");\\n (address delegator, address delegatee) = abi.decode(params, (address, address));\\n\\n _delegate(delegator, delegatee);\\n emit DelegationSynced(delegator, delegatee, nonce);\\n }\\n\\n /**\\n * @notice Internal function for minting without proof verification\\n * @param to Address to receive token\\n * @param uri Token metadata URI\\n */\\n function _govMint(address to, string memory uri) internal {\\n uint256 tokenId = _nextTokenId++;\\n _safeMint(to, tokenId);\\n _setTokenURI(tokenId, uri);\\n _delegate(to, to);\\n }\\n\\n // Required overrides\\n\\n /**\\n * @notice Updates token data\\n * @dev Overrides ERC721 _update to make NFTs non-transferable\\n * @param to Recipient address\\n * @param tokenId Token ID\\n * @param auth Address authorized for transfer\\n * @return Previous owner address\\n */\\n function _update(\\n address to,\\n uint256 tokenId,\\n address auth\\n ) internal override(ERC721, ERC721Enumerable, ERC721Votes) returns (address) {\\n require(auth == address(0) || to == address(0), \\\"NFT is not transferable\\\");\\n return super._update(to, tokenId, auth);\\n }\\n\\n /**\\n * @notice Increments account balance\\n * @dev Internal override to maintain compatibility\\n * @param account Account to update\\n * @param value Amount to increase by\\n */\\n function _increaseBalance(\\n address account,\\n uint128 value\\n ) internal override(ERC721, ERC721Enumerable, ERC721Votes) {\\n super._increaseBalance(account, value);\\n }\\n\\n /**\\n * @notice Gets token URI\\n * @param tokenId Token ID to query\\n * @return URI string\\n */\\n function tokenURI(\\n uint256 tokenId\\n ) public view override(ERC721, ERC721URIStorage) returns (string memory) {\\n return super.tokenURI(tokenId);\\n }\\n\\n /**\\n * @notice Checks interface support\\n * @param interfaceId Interface identifier to check\\n * @return bool True if interface is supported\\n */\\n function supportsInterface(\\n bytes4 interfaceId\\n ) public view override(ERC721, ERC721Enumerable, ERC721URIStorage) returns (bool) {\\n return super.supportsInterface(interfaceId);\\n }\\n\\n /**\\n * @notice Gets current timestamp\\n * @dev Used for voting snapshots\\n * @return Current block timestamp\\n */\\n function clock() public view override returns (uint48) {\\n return uint48(block.timestamp);\\n }\\n\\n /**\\n * @notice Gets clock mode description\\n * @return String indicating timestamp-based voting\\n */\\n function CLOCK_MODE() public pure override returns (string memory) {\\n return \\\"mode=timestamp\\\";\\n }\\n}\\n\",\"keccak256\":\"0x3d703da3e4617f28dc5b0b763ff0485c49bcb162e4eb33d90f7384c7a1f5aed5\",\"license\":\"GPL-3.0\"},\"contracts/variants/crosschain/ProofHandler.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity ^0.8.20;\\n\\n/**\\n * @title Proof Handler Library\\n * @author Web3 Hackers Collective\\n * @notice Library for standardized cross-chain proof generation and verification\\n * @dev Handles proof generation, verification, and tracking for cross-chain operations\\n * @custom:security-contact julien@strat.cc\\n */\\nlibrary ProofHandler {\\n /// @notice Tracks which proofs have been applied on each chain\\n struct ProofStorage {\\n mapping(bytes32 => bool) updateAppliedOnChain;\\n mapping(uint8 => uint256) currentNonce;\\n }\\n\\n /// @dev Emitted when a proof is claimed\\n event ProofClaimed(uint8 indexed operationType, bytes params, uint256 nonce);\\n\\n /**\\n * @notice Generates a proof for cross-chain operations\\n * @param contractAddress Address of contract generating the proof\\n * @param operationType Type of operation being performed\\n * @param params Operation parameters\\n * @param nonce Current nonce for this operation type\\n * @return proof Encoded proof data\\n */\\n function generateProof(\\n address contractAddress,\\n uint8 operationType,\\n bytes memory params,\\n uint256 nonce\\n ) public pure returns (bytes memory proof) {\\n bytes32 message = keccak256(\\n abi.encodePacked(contractAddress, operationType, params, nonce)\\n );\\n bytes32 digest = keccak256(abi.encodePacked(\\\"\\\\x19Ethereum Signed Message:\\\\n32\\\", message));\\n\\n return abi.encode(operationType, params, nonce, digest);\\n }\\n\\n /**\\n * @notice Verifies and claims a proof\\n * @param proof Proof to verify and claim\\n * @param contractAddress Address of contract claiming the proof\\n * @param storage_ Proof storage struct\\n * @return operationType The type of operation being performed\\n * @return params The operation parameters\\n * @return nonce The operation sequence number\\n */\\n function verifyAndClaimProof(\\n bytes memory proof,\\n address contractAddress,\\n ProofStorage storage storage_\\n ) public returns (uint8 operationType, bytes memory params, uint256 nonce) {\\n bytes32 digest;\\n (operationType, params, nonce, digest) = abi.decode(\\n proof,\\n (uint8, bytes, uint256, bytes32)\\n );\\n\\n bytes32 proofHash = keccak256(proof);\\n require(!storage_.updateAppliedOnChain[proofHash], \\\"Proof already claimed\\\");\\n require(nonce == storage_.currentNonce[operationType] + 1, \\\"Invalid nonce\\\");\\n\\n bytes32 message = keccak256(\\n abi.encodePacked(contractAddress, operationType, params, nonce)\\n );\\n bytes32 expectedDigest = keccak256(\\n abi.encodePacked(\\\"\\\\x19Ethereum Signed Message:\\\\n32\\\", message)\\n );\\n require(digest == expectedDigest, \\\"Invalid proof\\\");\\n\\n storage_.updateAppliedOnChain[proofHash] = true;\\n storage_.currentNonce[operationType] = nonce;\\n\\n emit ProofClaimed(operationType, params, nonce);\\n\\n return (operationType, params, nonce);\\n }\\n\\n /**\\n * @notice Gets the next nonce for an operation type\\n * @param storage_ Proof storage struct\\n * @param operationType Type of operation\\n * @return nonce Next nonce value\\n */\\n function getNextNonce(\\n ProofStorage storage storage_,\\n uint8 operationType\\n ) public view returns (uint256 nonce) {\\n return storage_.currentNonce[operationType] + 1;\\n }\\n\\n /**\\n * @notice Increments the nonce for an operation type\\n * @param storage_ Proof storage struct\\n * @param operationType Type of operation\\n * @return nonce New nonce value\\n */\\n function incrementNonce(\\n ProofStorage storage storage_,\\n uint8 operationType\\n ) public returns (uint256 nonce) {\\n storage_.currentNonce[operationType]++;\\n return storage_.currentNonce[operationType];\\n }\\n}\\n\",\"keccak256\":\"0x3719e47c508f29977d48842c5c1d27cce7cb289cbb592526f170f98135ff41a7\",\"license\":\"GPL-3.0\"}},\"version\":1}", + "bytecode": "0x6101806040523480156200001257600080fd5b50604051620050023803806200500283398101604081905262000035916200126d565b6040805180820190915260018152603160f81b602082015282908682846000620000608382620013c8565b5060016200006f8282620013c8565b5050506001600160a01b038116620000a257604051631e4fbdf760e01b8152600060048201526024015b60405180910390fd5b620000ad8162000210565b50620000bb82600c62000262565b61012052620000cc81600d62000262565b61014052815160208084019190912060e052815190820120610100524660a0526200015a60e05161010051604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f60208201529081019290925260608201524660808201523060a082015260009060c00160405160208183030381529060405280519060200120905090565b60805250503060c05261016086905260005b84518110156200020357620001a48582815181106200018f576200018f62001494565b6020026020010151856200029b60201b60201c565b620001ee858281518110620001bd57620001bd62001494565b6020026020010151868381518110620001da57620001da62001494565b6020026020010151620002dd60201b60201c565b80620001fa81620014c0565b9150506200016c565b5050505050505062001628565b600b80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600060208351101562000282576200027a8362000353565b905062000295565b816200028f8482620013c8565b5060ff90505b92915050565b6012805460009182620002ae83620014c0565b909155509050620002c0838262000396565b620002cc8183620003bc565b620002d88380620002dd565b505050565b6001600160a01b038281166000818152600f602052604080822080548686166001600160a01b0319821681179092559151919094169392849290917f3134e8a2e6d97e929a7e54011ea5485d7d196dd5f0ba4d4ef95803e8e3fc257f9190a4620002d881836200034d866200040e565b6200041b565b600080829050601f8151111562000381578260405163305a27a960e01b81526004016200009991906200150a565b80516200038e826200151f565b179392505050565b620003b88282604051806020016040528060008152506200058860201b60201c565b5050565b6000828152600a60205260409020620003d68282620013c8565b506040518281527ff8e1a15aba9398e019f0b49df1a4fde98ee17ae345cb5f6b5e2c27f5033e8ce79060200160405180910390a15050565b60006200029582620005a4565b816001600160a01b0316836001600160a01b0316141580156200043e5750600081115b15620002d8576001600160a01b03831615620004e7576001600160a01b038316600090815260106020908152604082208291620004929190620005ee901b62001593176200048c8662000603565b6200063d565b6001600160d01b031691506001600160d01b03169150846001600160a01b031660008051602062004fe28339815191528383604051620004dc929190918252602082015260400190565b60405180910390a250505b6001600160a01b03821615620002d8576001600160a01b0382166000908152601060209081526040822082916200052f919062000671901b620015a6176200048c8662000603565b6001600160d01b031691506001600160d01b03169150836001600160a01b031660008051602062004fe2833981519152838360405162000579929190918252602082015260400190565b60405180910390a25050505050565b6200059483836200067f565b620002d8336000858585620006e9565b60006001600160a01b038216620005d2576040516322718ad960e21b81526000600482015260240162000099565b506001600160a01b031660009081526003602052604090205490565b6000620005fc828462001544565b9392505050565b60006001600160d01b0382111562000639576040516306dfcc6560e41b815260d060048201526024810183905260440162000099565b5090565b60008062000664426200065b620006548862000821565b868860201c565b87919062000870565b915091505b935093915050565b6000620005fc82846200156e565b6001600160a01b038216620006ab57604051633250574960e11b81526000600482015260240162000099565b6000620006ba83838362000880565b90506001600160a01b03811615620002d8576040516339e3563760e11b81526000600482015260240162000099565b6001600160a01b0383163b156200081a57604051630a85bd0160e11b81526001600160a01b0384169063150b7a02906200072e90889088908790879060040162001591565b6020604051808303816000875af19250505080156200076c575060408051601f3d908101601f191682019092526200076991810190620015d0565b60015b620007da573d8080156200079d576040519150601f19603f3d011682016040523d82523d6000602084013e620007a2565b606091505b508051600003620007d257604051633250574960e11b81526001600160a01b038516600482015260240162000099565b805181602001fd5b6001600160e01b03198116630a85bd0160e11b146200081857604051633250574960e11b81526001600160a01b038516600482015260240162000099565b505b5050505050565b8054600090801562000867576200084d836200083f600184620015fc565b600091825260209091200190565b54660100000000000090046001600160d01b0316620005fc565b60009392505050565b6000806200066485858562000903565b60006001600160a01b0382161580620008a057506001600160a01b038416155b620008ee5760405162461bcd60e51b815260206004820152601760248201527f4e4654206973206e6f74207472616e7366657261626c65000000000000000000604482015260640162000099565b620008fb84848462000a6c565b949350505050565b82546000908190801562000a0d57600062000925876200083f600185620015fc565b805490915065ffffffffffff80821691660100000000000090046001600160d01b03169088168211156200096c57604051632520601d60e01b815260040160405180910390fd5b8765ffffffffffff168265ffffffffffff1603620009aa57825465ffffffffffff1666010000000000006001600160d01b03891602178355620009fe565b6040805180820190915265ffffffffffff808a1682526001600160d01b03808a1660208085019182528d54600181018f5560008f815291909120945191519092166601000000000000029216919091179101555b94508593506200066992505050565b50506040805180820190915265ffffffffffff80851682526001600160d01b0380851660208085019182528854600181018a5560008a815291822095519251909316660100000000000002919093161792019190915590508162000669565b60008062000a7c85858562000a8c565b9050620008fb8186600162000b68565b60008062000a9c85858562000bfa565b90506001600160a01b03811662000afc5762000af684600880546000838152600960205260408120829055600182018355919091527ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee30155565b62000b22565b846001600160a01b0316816001600160a01b03161462000b225762000b22818562000cf9565b6001600160a01b03851662000b425762000b3c8462000d7d565b620008fb565b846001600160a01b0316816001600160a01b031614620008fb57620008fb858562000e37565b6001600160a01b03831662000b975762000b946011620015a66200067160201b176200048c8462000603565b50505b6001600160a01b03821662000bc65762000bc3601162001593620005ee60201b176200048c8462000603565b50505b6001600160a01b038381166000908152600f6020526040808220548584168352912054620002d8929182169116836200041b565b6000828152600260205260408120546001600160a01b039081169083161562000c2a5762000c2a81848662000e8b565b6001600160a01b0381161562000c6a5762000c49600085818062000ef5565b6001600160a01b038116600090815260036020526040902080546000190190555b6001600160a01b0385161562000c9a576001600160a01b0385166000908152600360205260409020805460010190555b60008481526002602052604080822080546001600160a01b0319166001600160a01b0389811691821790925591518793918516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4949350505050565b600062000d0683620005a4565b6000838152600760209081526040808320546001600160a01b038816845260069092529091209192509081831462000d5e57600083815260208281526040808320548584528184208190558352600790915290208290555b6000938452600760209081526040808620869055938552525081205550565b60085460009062000d9190600190620015fc565b6000838152600960205260408120546008805493945090928490811062000dbc5762000dbc62001494565b90600052602060002001549050806008838154811062000de05762000de062001494565b600091825260208083209091019290925582815260099091526040808220849055858252812055600880548062000e1b5762000e1b62001612565b6001900381819060005260206000200160009055905550505050565b6000600162000e4684620005a4565b62000e529190620015fc565b6001600160a01b039093166000908152600660209081526040808320868452825280832085905593825260079052919091209190915550565b62000e9883838362001023565b620002d8576001600160a01b03831662000ec957604051637e27328960e01b81526004810182905260240162000099565b60405163177e802f60e01b81526001600160a01b03831660048201526024810182905260440162000099565b808062000f0a57506001600160a01b03821615155b1562000ff357600062000f1d84620010a9565b90506001600160a01b0383161580159062000f4a5750826001600160a01b0316816001600160a01b031614155b801562000f7d57506001600160a01b0380821660009081526005602090815260408083209387168352929052205460ff16155b1562000fa85760405163a9fbf51f60e01b81526001600160a01b038416600482015260240162000099565b811562000ff15783856001600160a01b0316826001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45b505b5050600090815260046020526040902080546001600160a01b0319166001600160a01b0392909216919091179055565b60006001600160a01b03831615801590620008fb5750826001600160a01b0316846001600160a01b031614806200107f57506001600160a01b0380851660009081526005602090815260408083209387168352929052205460ff165b80620008fb5750506000908152600460205260409020546001600160a01b03908116911614919050565b6000818152600260205260408120546001600160a01b0316806200029557604051637e27328960e01b81526004810184905260240162000099565b80516001600160a01b0381168114620010fc57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b038111828210171562001142576200114262001101565b604052919050565b600082601f8301126200115c57600080fd5b815160206001600160401b038211156200117a576200117a62001101565b8160051b6200118b82820162001117565b9283528481018201928281019087851115620011a657600080fd5b83870192505b84831015620011d057620011c083620010e4565b82529183019190830190620011ac565b979650505050505050565b60005b83811015620011f8578181015183820152602001620011de565b50506000910152565b600082601f8301126200121357600080fd5b81516001600160401b038111156200122f576200122f62001101565b62001244601f8201601f191660200162001117565b8181528460208386010111156200125a57600080fd5b620008fb826020830160208701620011db565b60008060008060008060c087890312156200128757600080fd5b865195506200129960208801620010e4565b60408801519095506001600160401b0380821115620012b757600080fd5b620012c58a838b016200114a565b95506060890151915080821115620012dc57600080fd5b620012ea8a838b0162001201565b945060808901519150808211156200130157600080fd5b6200130f8a838b0162001201565b935060a08901519150808211156200132657600080fd5b506200133589828a0162001201565b9150509295509295509295565b600181811c908216806200135757607f821691505b6020821081036200137857634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115620002d857600081815260208120601f850160051c81016020861015620013a75750805b601f850160051c820191505b818110156200081857828155600101620013b3565b81516001600160401b03811115620013e457620013e462001101565b620013fc81620013f5845462001342565b846200137e565b602080601f8311600181146200143457600084156200141b5750858301515b600019600386901b1c1916600185901b17855562000818565b600085815260208120601f198616915b82811015620014655788860151825594840194600190910190840162001444565b5085821015620014845787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060018201620014d557620014d5620014aa565b5060010190565b60008151808452620014f6816020860160208601620011db565b601f01601f19169290920160200192915050565b602081526000620005fc6020830184620014dc565b80516020808301519190811015620013785760001960209190910360031b1b16919050565b6001600160d01b03828116828216039080821115620015675762001567620014aa565b5092915050565b6001600160d01b03818116838216019080821115620015675762001567620014aa565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090620015c690830184620014dc565b9695505050505050565b600060208284031215620015e357600080fd5b81516001600160e01b031981168114620005fc57600080fd5b81810381811115620002955762000295620014aa565b634e487b7160e01b600052603160045260246000fd5b60805160a05160c05160e0516101005161012051610140516101605161392a620016b8600039600081816104df015281816106fb0152818161092301528181610ad001528181610bd801528181610ea101526114170152600061196a015260006119380152600061235a015260006123320152600061228d015260006122b7015260006122e1015261392a6000f3fe608060405234801561001057600080fd5b50600436106102325760003560e01c8063711864781161013057806395d89b41116100b8578063c3cda5201161007c578063c3cda52014610527578063c87b56dd1461053a578063d204c45e1461054d578063e985e9c514610560578063f2fde38b1461057357600080fd5b806395d89b41146104bf5780639ab24eb0146104c75780639fa92f9d146104da578063a22cb46514610501578063b88d4fde1461051457600080fd5b806381b62086116100ff57806381b620861461045757806384b0196e1461046a5780638da5cb5b146104855780638e539e8c1461049657806391ddadf4146104a957600080fd5b80637118647814610400578063715018a6146104135780637610248e1461041b5780637ecebe001461042e57600080fd5b806342842e0e116101be578063587cde1e11610182578063587cde1e14610388578063593aa283146103b45780635c19a95c146103c75780636352211e146103da57806370a08231146103ed57600080fd5b806342842e0e1461031257806342966c6814610325578063482ffa5e146103385780634bf5d7e91461034b5780634f6ccce71461037557600080fd5b806318160ddd1161020557806318160ddd146102b457806323b872dd146102c657806326926d46146102d95780632f745c59146102ec5780633a46b1a8146102ff57600080fd5b806301ffc9a71461023757806306fdde031461025f578063081812fc14610274578063095ea7b31461029f575b600080fd5b61024a610245366004612ec2565b610586565b60405190151581526020015b60405180910390f35b610267610597565b6040516102569190612f2f565b610287610282366004612f42565b610629565b6040516001600160a01b039091168152602001610256565b6102b26102ad366004612f70565b610652565b005b6008545b604051908152602001610256565b6102b26102d4366004612f9c565b610661565b6102b26102e7366004612f42565b6106f1565b6102b86102fa366004612f70565b610817565b6102b861030d366004612f70565b61087c565b6102b2610320366004612f9c565b6108f3565b6102b2610333366004612f42565b610913565b6102676103463660046130b1565b61091f565b60408051808201909152600e81526d06d6f64653d74696d657374616d760941b6020820152610267565b6102b8610383366004612f42565b610a6d565b610287610396366004613101565b6001600160a01b039081166000908152600f60205260409020541690565b6102b26103c236600461311e565b610ac6565b6102b26103d5366004613101565b610bd6565b6102876103e8366004612f42565b610ce3565b6102b86103fb366004613101565b610cee565b6102b261040e36600461314f565b610d36565b6102b2610e89565b610267610429366004613184565b610e9d565b6102b861043c366004613101565b6001600160a01b03166000908152600e602052604090205490565b6102b261046536600461314f565b611024565b61047261123d565b60405161025697969594939291906131bd565b600b546001600160a01b0316610287565b6102b86104a4366004612f42565b611283565b60405165ffffffffffff42168152602001610256565b6102676112e3565b6102b86104d5366004613101565b6112f2565b6102b87f000000000000000000000000000000000000000000000000000000000000000081565b6102b261050f366004613253565b611322565b6102b2610522366004613286565b61132d565b6102b26105353660046132f2565b611345565b610267610548366004612f42565b611402565b6102b261055b36600461334e565b61140d565b61024a61056e366004613184565b611527565b6102b2610581366004613101565b611555565b6000610591826115b2565b92915050565b6060600080546105a69061336c565b80601f01602080910402602001604051908101604052809291908181526020018280546105d29061336c565b801561061f5780601f106105f45761010080835404028352916020019161061f565b820191906000526020600020905b81548152906001019060200180831161060257829003601f168201915b5050505050905090565b6000610634826115d7565b506000828152600460205260409020546001600160a01b0316610591565b61065d828233611610565b5050565b6001600160a01b03821661069057604051633250574960e11b8152600060048201526024015b60405180910390fd5b600061069d83833361161d565b9050836001600160a01b0316816001600160a01b0316146106eb576040516364283d7b60e01b81526001600160a01b0380861660048301526024820184905282166044820152606401610687565b50505050565b6106f9611693565b7f000000000000000000000000000000000000000000000000000000000000000046146107385760405162461bcd60e51b8152600401610687906133a6565b604051633b0d4dd760e01b81526013600482015260016024820152600090730152ee45780385dACCCCB128D816031CfFe5F36B90633b0d4dd790604401602060405180830381865af4158015610792573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107b69190613400565b905060006107c383610ce3565b90506107ce836116c0565b806001600160a01b0316837f81c00ee14a307a39bcddd8f17801cf3101f1c49c8dea9ee90ec0c04a61b5a0078460405161080a91815260200190565b60405180910390a3505050565b600061082283610cee565b82106108535760405163295f44f760e21b81526001600160a01b038416600482015260248101839052604401610687565b506001600160a01b03919091166000908152600660209081526040808320938352929052205490565b60004265ffffffffffff811683106108b857604051637669fc0f60e11b81526004810184905265ffffffffffff82166024820152604401610687565b6108e26108c4846116fb565b6001600160a01b038616600090815260106020526040902090611732565b6001600160d01b0316949350505050565b61090e8383836040518060200160405280600081525061132d565b505050565b61065d6000823361161d565b60607f000000000000000000000000000000000000000000000000000000000000000046146109605760405162461bcd60e51b815260040161068790613419565b604051630564edeb60e31b81526013600482015260ff84166024820152600090730152ee45780385dACCCCB128D816031CfFe5F36B90632b276f5890604401602060405180830381865af41580156109bc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109e09190613400565b604051637352178160e01b8152909150730152ee45780385dACCCCB128D816031CfFe5F36B90637352178190610a2090309088908890879060040161345c565b600060405180830381865af4158015610a3d573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610a6591908101906134df565b949350505050565b6000610a7860085490565b8210610aa15760405163295f44f760e21b81526000600482015260248101839052604401610687565b60088281548110610ab457610ab4613514565b90600052602060002001549050919050565b610ace611693565b7f00000000000000000000000000000000000000000000000000000000000000004614610b0d5760405162461bcd60e51b8152600401610687906133a6565b604051633b0d4dd760e01b81526013600482015260026024820152600090730152ee45780385dACCCCB128D816031CfFe5F36B90633b0d4dd790604401602060405180830381865af4158015610b67573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b8b9190613400565b9050610b9783836117e8565b827faef83f88d7b64742932e336e35ec4ebdbf35e2824c4cc154007911e95b72367e8383604051610bc992919061352a565b60405180910390a2505050565b7f00000000000000000000000000000000000000000000000000000000000000004614610c155760405162461bcd60e51b8152600401610687906133a6565b604051633b0d4dd760e01b81526013600482015260036024820152600090730152ee45780385dACCCCB128D816031CfFe5F36B90633b0d4dd790604401602060405180830381865af4158015610c6f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c939190613400565b9050610c9f3383611838565b6040518181526001600160a01b0383169033907fa2527a1c304fba1df9beb0da8db977345b95154faa8004c7b3485f52e34dcd0a9060200160405180910390a35050565b6000610591826115d7565b60006001600160a01b038216610d1a576040516322718ad960e21b815260006004820152602401610687565b506001600160a01b031660009081526003602052604090205490565b6000806000730152ee45780385dACCCCB128D816031CfFe5F36B63c0af6591853060136040518463ffffffff1660e01b8152600401610d779392919061354c565b600060405180830381865af4158015610d94573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610dbc919081019061357a565b9194509250905060ff8316600314610e0f5760405162461bcd60e51b8152602060048201526016602482015275496e76616c6964206f7065726174696f6e207479706560501b6044820152606401610687565b60008083806020019051810190610e2691906135d4565b91509150610e348282611838565b806001600160a01b0316826001600160a01b03167fa2527a1c304fba1df9beb0da8db977345b95154faa8004c7b3485f52e34dcd0a85604051610e7991815260200190565b60405180910390a3505050505050565b610e91611693565b610e9b60006118aa565b565b60607f00000000000000000000000000000000000000000000000000000000000000004614610ede5760405162461bcd60e51b815260040161068790613419565b604051630564edeb60e31b81526013600482015260036024820152600090730152ee45780385dACCCCB128D816031CfFe5F36B90632b276f5890604401602060405180830381865af4158015610f38573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f5c9190613400565b905060008484604051602001610f889291906001600160a01b0392831681529116602082015260400190565b60408051808303601f1901815290829052637352178160e01b82529150730152ee45780385dACCCCB128D816031CfFe5F36B90637352178190610fd69030906003908690889060040161345c565b600060405180830381865af4158015610ff3573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261101b91908101906134df565b95945050505050565b6000806000730152ee45780385dACCCCB128D816031CfFe5F36B63c0af6591853060136040518463ffffffff1660e01b81526004016110659392919061354c565b600060405180830381865af4158015611082573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526110aa919081019061357a565b9194509250905060ff831661113257600080838060200190518101906110d09190613603565b915091506110de82826118fc565b816001600160a01b031660016012546110f79190613660565b6040518581527f22ef8ac73166382773e470f8f887ac4c54dcf377f397431fe0ac6f60261fabaf906020015b60405180910390a350506106eb565b60001960ff8416016111a8576000828060200190518101906111549190613400565b9050600061116182610ce3565b905061116c826116c0565b806001600160a01b0316827f81c00ee14a307a39bcddd8f17801cf3101f1c49c8dea9ee90ec0c04a61b5a0078560405161112391815260200190565b60011960ff84160161121a57600080838060200190518101906111cb9190613673565b915091506111d982826117e8565b817faef83f88d7b64742932e336e35ec4ebdbf35e2824c4cc154007911e95b72367e828560405161120b92919061352a565b60405180910390a250506106eb565b60021960ff8416016106eb5760008083806020019051810190610e2691906135d4565b600060608060008060006060611251611931565b611259611963565b60408051600080825260208201909252600f60f81b9b939a50919850469750309650945092509050565b60004265ffffffffffff811683106112bf57604051637669fc0f60e11b81526004810184905265ffffffffffff82166024820152604401610687565b6112d36112cb846116fb565b601190611732565b6001600160d01b03169392505050565b6060600180546105a69061336c565b6001600160a01b038116600090815260106020526040812061131390611990565b6001600160d01b031692915050565b61065d3383836119c9565b611338848484610661565b6106eb3385858585611a60565b8342111561136957604051632341d78760e11b815260048101859052602401610687565b604080517fe48329057bfd03d55e49b547132e39cffd9c1820ad7b9d4c5307691425d15adf60208201526001600160a01b0388169181019190915260608101869052608081018590526000906113e3906113db9060a00160405160208183030381529060405280519060200120611b8b565b858585611bb8565b90506113ef8187611be6565b6113f98188611838565b50505050505050565b606061059182611c39565b611415611693565b7f000000000000000000000000000000000000000000000000000000000000000046146114545760405162461bcd60e51b8152600401610687906133a6565b604051633b0d4dd760e01b81526013600482015260006024820181905290730152ee45780385dACCCCB128D816031CfFe5F36B90633b0d4dd790604401602060405180830381865af41580156114ae573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114d29190613400565b90506114de83836118fc565b826001600160a01b031660016012546114f79190613660565b6040518381527f22ef8ac73166382773e470f8f887ac4c54dcf377f397431fe0ac6f60261fabaf9060200161080a565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205460ff1690565b61155d611693565b6001600160a01b03811661158757604051631e4fbdf760e01b815260006004820152602401610687565b611590816118aa565b50565b600061159f82846136a4565b9392505050565b600061159f82846136cb565b60006001600160e01b03198216632483248360e11b1480610591575061059182611d42565b6000818152600260205260408120546001600160a01b03168061059157604051637e27328960e01b815260048101849052602401610687565b61090e8383836001611d67565b60006001600160a01b038216158061163c57506001600160a01b038416155b6116885760405162461bcd60e51b815260206004820152601760248201527f4e4654206973206e6f74207472616e7366657261626c650000000000000000006044820152606401610687565b610a65848484611e6d565b600b546001600160a01b03163314610e9b5760405163118cdaa760e01b8152336004820152602401610687565b60006116cf600083600061161d565b90506001600160a01b03811661065d57604051637e27328960e01b815260048101839052602401610687565b600065ffffffffffff82111561172e576040516306dfcc6560e41b81526030600482015260248101839052604401610687565b5090565b81546000908181600581111561179157600061174d84611e89565b6117579085613660565b60008881526020902090915081015465ffffffffffff90811690871610156117815780915061178f565b61178c8160016136eb565b92505b505b600061179f87878585611fe2565b905080156117da576117c4876117b6600184613660565b600091825260209091200190565b54600160301b90046001600160d01b03166117dd565b60005b979650505050505050565b6000828152600a602052604090206118008282613744565b506040518281527ff8e1a15aba9398e019f0b49df1a4fde98ee17ae345cb5f6b5e2c27f5033e8ce79060200160405180910390a15050565b6001600160a01b038281166000818152600f602052604080822080548686166001600160a01b0319821681179092559151919094169392849290917f3134e8a2e6d97e929a7e54011ea5485d7d196dd5f0ba4d4ef95803e8e3fc257f9190a461090e81836118a586612044565b61204f565b600b80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b601280546000918261190d83613804565b91905055905061191d83826121bb565b61192781836117e8565b61090e8384611838565b606061195e7f0000000000000000000000000000000000000000000000000000000000000000600c6121d5565b905090565b606061195e7f0000000000000000000000000000000000000000000000000000000000000000600d6121d5565b805460009080156119c0576119aa836117b6600184613660565b54600160301b90046001600160d01b031661159f565b60009392505050565b6001600160a01b0382166119fb57604051630b61174360e31b81526001600160a01b0383166004820152602401610687565b6001600160a01b03838116600081815260056020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910161080a565b6001600160a01b0383163b15611b8457604051630a85bd0160e11b81526001600160a01b0384169063150b7a0290611aa290889088908790879060040161381d565b6020604051808303816000875af1925050508015611add575060408051601f3d908101601f19168201909252611ada9181019061385a565b60015b611b46573d808015611b0b576040519150601f19603f3d011682016040523d82523d6000602084013e611b10565b606091505b508051600003611b3e57604051633250574960e11b81526001600160a01b0385166004820152602401610687565b805181602001fd5b6001600160e01b03198116630a85bd0160e11b14611b8257604051633250574960e11b81526001600160a01b0385166004820152602401610687565b505b5050505050565b6000610591611b98612280565b8360405161190160f01b8152600281019290925260228201526042902090565b600080600080611bca888888886123ab565b925092509250611bda828261247a565b50909695505050505050565b6001600160a01b0382166000908152600e6020526040902080546001810190915581811461090e576040516301d4b62360e61b81526001600160a01b038416600482015260248101829052604401610687565b6060611c44826115d7565b506000828152600a602052604081208054611c5e9061336c565b80601f0160208091040260200160405190810160405280929190818152602001828054611c8a9061336c565b8015611cd75780601f10611cac57610100808354040283529160200191611cd7565b820191906000526020600020905b815481529060010190602001808311611cba57829003601f168201915b505050505090506000611cf560408051602081019091526000815290565b90508051600003611d07575092915050565b815115611d39578082604051602001611d21929190613877565b60405160208183030381529060405292505050919050565b610a6584612533565b60006001600160e01b0319821663780e9d6360e01b14806105915750610591826125a7565b8080611d7b57506001600160a01b03821615155b15611e3d576000611d8b846115d7565b90506001600160a01b03831615801590611db75750826001600160a01b0316816001600160a01b031614155b8015611dca5750611dc88184611527565b155b15611df35760405163a9fbf51f60e01b81526001600160a01b0384166004820152602401610687565b8115611e3b5783856001600160a01b0316826001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45b505b5050600090815260046020526040902080546001600160a01b0319166001600160a01b0392909216919091179055565b600080611e7b8585856125f7565b9050610a65818660016126c4565b600060018211611e97575090565b816001600160801b8210611eb05760809190911c9060401b5b680100000000000000008210611ecb5760409190911c9060201b5b6401000000008210611ee25760209190911c9060101b5b620100008210611ef75760109190911c9060081b5b6101008210611f0b5760089190911c9060041b5b60108210611f1e5760049190911c9060021b5b60048210611f2a5760011b5b600302600190811c90818581611f4257611f426138a6565b048201901c90506001818581611f5a57611f5a6138a6565b048201901c90506001818581611f7257611f726138a6565b048201901c90506001818581611f8a57611f8a6138a6565b048201901c90506001818581611fa257611fa26138a6565b048201901c90506001818581611fba57611fba6138a6565b048201901c9050611fd9818581611fd357611fd36138a6565b04821190565b90039392505050565b60005b8183101561203c576000611ff9848461273a565b60008781526020902090915065ffffffffffff86169082015465ffffffffffff16111561202857809250612036565b6120338160016136eb565b93505b50611fe5565b509392505050565b600061059182610cee565b816001600160a01b0316836001600160a01b0316141580156120715750600081115b1561090e576001600160a01b03831615612119576001600160a01b038316600090815260106020526040812081906120b4906115936120af86612755565b612789565b6001600160d01b031691506001600160d01b03169150846001600160a01b03167fdec2bacdd2f05b59de34da9b523dff8be42e5e38e818c82fdb0bae774387a724838360405161210e929190918252602082015260400190565b60405180910390a250505b6001600160a01b0382161561090e576001600160a01b03821660009081526010602052604081208190612152906115a66120af86612755565b6001600160d01b031691506001600160d01b03169150836001600160a01b03167fdec2bacdd2f05b59de34da9b523dff8be42e5e38e818c82fdb0bae774387a72483836040516121ac929190918252602082015260400190565b60405180910390a25050505050565b61065d8282604051806020016040528060008152506127bb565b606060ff83146121ef576121e8836127d3565b9050610591565b8180546121fb9061336c565b80601f01602080910402602001604051908101604052809291908181526020018280546122279061336c565b80156122745780601f1061224957610100808354040283529160200191612274565b820191906000526020600020905b81548152906001019060200180831161225757829003601f168201915b50505050509050610591565b6000306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480156122d957507f000000000000000000000000000000000000000000000000000000000000000046145b1561230357507f000000000000000000000000000000000000000000000000000000000000000090565b61195e604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f60208201527f0000000000000000000000000000000000000000000000000000000000000000918101919091527f000000000000000000000000000000000000000000000000000000000000000060608201524660808201523060a082015260009060c00160405160208183030381529060405280519060200120905090565b600080807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08411156123e65750600091506003905082612470565b604080516000808252602082018084528a905260ff891692820192909252606081018790526080810186905260019060a0016020604051602081039080840390855afa15801561243a573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b03811661246657506000925060019150829050612470565b9250600091508190505b9450945094915050565b600082600381111561248e5761248e6133ea565b03612497575050565b60018260038111156124ab576124ab6133ea565b036124c95760405163f645eedf60e01b815260040160405180910390fd5b60028260038111156124dd576124dd6133ea565b036124fe5760405163fce698f760e01b815260048101829052602401610687565b6003826003811115612512576125126133ea565b0361065d576040516335e2f38360e21b815260048101829052602401610687565b606061253e826115d7565b50600061255660408051602081019091526000815290565b90506000815111612576576040518060200160405280600081525061159f565b8061258084612812565b604051602001612591929190613877565b6040516020818303038152906040529392505050565b60006001600160e01b031982166380ac58cd60e01b14806125d857506001600160e01b03198216635b5e139f60e01b145b8061059157506301ffc9a760e01b6001600160e01b0319831614610591565b6000806126058585856128a5565b90506001600160a01b0381166126625761265d84600880546000838152600960205260408120829055600182018355919091527ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee30155565b612685565b846001600160a01b0316816001600160a01b03161461268557612685818561299e565b6001600160a01b0385166126a15761269c84612a1f565b610a65565b846001600160a01b0316816001600160a01b031614610a6557610a658585612ace565b6001600160a01b0383166126e6576126e360116115a66120af84612755565b50505b6001600160a01b0382166127085761270560116115936120af84612755565b50505b6001600160a01b038381166000908152600f602052604080822054858416835291205461090e9291821691168361204f565b600061274960028484186138bc565b61159f908484166136eb565b60006001600160d01b0382111561172e576040516306dfcc6560e41b815260d0600482015260248101839052604401610687565b6000806127ae426127a661279c88611990565b868863ffffffff16565b879190612b1e565b915091505b935093915050565b6127c58383612b2c565b61090e336000858585611a60565b606060006127e083612b91565b604080516020808252818301909252919250600091906020820181803683375050509182525060208101929092525090565b6060600061281f83612bb9565b600101905060008167ffffffffffffffff81111561283f5761283f612fec565b6040519080825280601f01601f191660200182016040528015612869576020820181803683370190505b5090508181016020015b600019016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a850494508461287357509392505050565b6000828152600260205260408120546001600160a01b03908116908316156128d2576128d2818486612c91565b6001600160a01b03811615612910576128ef600085600080611d67565b6001600160a01b038116600090815260036020526040902080546000190190555b6001600160a01b0385161561293f576001600160a01b0385166000908152600360205260409020805460010190555b60008481526002602052604080822080546001600160a01b0319166001600160a01b0389811691821790925591518793918516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4949350505050565b60006129a983610cee565b6000838152600760209081526040808320546001600160a01b0388168452600690925290912091925090818314612a0057600083815260208281526040808320548584528184208190558352600790915290208290555b6000938452600760209081526040808620869055938552525081205550565b600854600090612a3190600190613660565b60008381526009602052604081205460088054939450909284908110612a5957612a59613514565b906000526020600020015490508060088381548110612a7a57612a7a613514565b6000918252602080832090910192909255828152600990915260408082208490558582528120556008805480612ab257612ab26138de565b6001900381819060005260206000200160009055905550505050565b60006001612adb84610cee565b612ae59190613660565b6001600160a01b039093166000908152600660209081526040808320868452825280832085905593825260079052919091209190915550565b6000806127ae858585612cf5565b6001600160a01b038216612b5657604051633250574960e11b815260006004820152602401610687565b6000612b648383600061161d565b90506001600160a01b0381161561090e576040516339e3563760e11b815260006004820152602401610687565b600060ff8216601f81111561059157604051632cd44ac360e21b815260040160405180910390fd5b60008072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b8310612bf85772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6d04ee2d6d415b85acef81000000008310612c24576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc100008310612c4257662386f26fc10000830492506010015b6305f5e1008310612c5a576305f5e100830492506008015b6127108310612c6e57612710830492506004015b60648310612c80576064830492506002015b600a83106105915760010192915050565b612c9c838383612e49565b61090e576001600160a01b038316612cca57604051637e27328960e01b815260048101829052602401610687565b60405163177e802f60e01b81526001600160a01b038316600482015260248101829052604401610687565b825460009081908015612dee576000612d13876117b6600185613660565b805490915065ffffffffffff80821691600160301b90046001600160d01b0316908816821115612d5657604051632520601d60e01b815260040160405180910390fd5b8765ffffffffffff168265ffffffffffff1603612d8f57825465ffffffffffff16600160301b6001600160d01b03891602178355612de0565b6040805180820190915265ffffffffffff808a1682526001600160d01b03808a1660208085019182528d54600181018f5560008f81529190912094519151909216600160301b029216919091179101555b94508593506127b392505050565b50506040805180820190915265ffffffffffff80851682526001600160d01b0380851660208085019182528854600181018a5560008a815291822095519251909316600160301b0291909316179201919091559050816127b3565b60006001600160a01b03831615801590610a655750826001600160a01b0316846001600160a01b03161480612e835750612e838484611527565b80610a655750506000908152600460205260409020546001600160a01b03908116911614919050565b6001600160e01b03198116811461159057600080fd5b600060208284031215612ed457600080fd5b813561159f81612eac565b60005b83811015612efa578181015183820152602001612ee2565b50506000910152565b60008151808452612f1b816020860160208601612edf565b601f01601f19169290920160200192915050565b60208152600061159f6020830184612f03565b600060208284031215612f5457600080fd5b5035919050565b6001600160a01b038116811461159057600080fd5b60008060408385031215612f8357600080fd5b8235612f8e81612f5b565b946020939093013593505050565b600080600060608486031215612fb157600080fd5b8335612fbc81612f5b565b92506020840135612fcc81612f5b565b929592945050506040919091013590565b60ff8116811461159057600080fd5b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff8111828210171561302b5761302b612fec565b604052919050565b600067ffffffffffffffff82111561304d5761304d612fec565b50601f01601f191660200190565b600082601f83011261306c57600080fd5b813561307f61307a82613033565b613002565b81815284602083860101111561309457600080fd5b816020850160208301376000918101602001919091529392505050565b600080604083850312156130c457600080fd5b82356130cf81612fdd565b9150602083013567ffffffffffffffff8111156130eb57600080fd5b6130f78582860161305b565b9150509250929050565b60006020828403121561311357600080fd5b813561159f81612f5b565b6000806040838503121561313157600080fd5b82359150602083013567ffffffffffffffff8111156130eb57600080fd5b60006020828403121561316157600080fd5b813567ffffffffffffffff81111561317857600080fd5b610a658482850161305b565b6000806040838503121561319757600080fd5b82356131a281612f5b565b915060208301356131b281612f5b565b809150509250929050565b60ff60f81b881681526000602060e0818401526131dd60e084018a612f03565b83810360408501526131ef818a612f03565b606085018990526001600160a01b038816608086015260a0850187905284810360c0860152855180825283870192509083019060005b8181101561324157835183529284019291840191600101613225565b50909c9b505050505050505050505050565b6000806040838503121561326657600080fd5b823561327181612f5b565b9150602083013580151581146131b257600080fd5b6000806000806080858703121561329c57600080fd5b84356132a781612f5b565b935060208501356132b781612f5b565b925060408501359150606085013567ffffffffffffffff8111156132da57600080fd5b6132e68782880161305b565b91505092959194509250565b60008060008060008060c0878903121561330b57600080fd5b863561331681612f5b565b95506020870135945060408701359350606087013561333481612fdd565b9598949750929560808101359460a0909101359350915050565b6000806040838503121561336157600080fd5b82356130cf81612f5b565b600181811c9082168061338057607f821691505b6020821081036133a057634e487b7160e01b600052602260045260246000fd5b50919050565b60208082526024908201527f4f7065726174696f6e206f6e6c7920616c6c6f776564206f6e20686f6d6520636040820152633430b4b760e11b606082015260800190565b634e487b7160e01b600052602160045260246000fd5b60006020828403121561341257600080fd5b5051919050565b60208082526023908201527f50726f6f6673206f6e6c792067656e657261746564206f6e20686f6d6520636860408201526230b4b760e91b606082015260800190565b6001600160a01b038516815260ff8416602082015260806040820181905260009061348990830185612f03565b905082606083015295945050505050565b600082601f8301126134ab57600080fd5b81516134b961307a82613033565b8181528460208386010111156134ce57600080fd5b610a65826020830160208701612edf565b6000602082840312156134f157600080fd5b815167ffffffffffffffff81111561350857600080fd5b610a658482850161349a565b634e487b7160e01b600052603260045260246000fd5b60408152600061353d6040830185612f03565b90508260208301529392505050565b60608152600061355f6060830186612f03565b6001600160a01b039490941660208301525060400152919050565b60008060006060848603121561358f57600080fd5b835161359a81612fdd565b602085015190935067ffffffffffffffff8111156135b757600080fd5b6135c38682870161349a565b925050604084015190509250925092565b600080604083850312156135e757600080fd5b82516135f281612f5b565b60208401519092506131b281612f5b565b6000806040838503121561361657600080fd5b825161362181612f5b565b602084015190925067ffffffffffffffff81111561363e57600080fd5b6130f78582860161349a565b634e487b7160e01b600052601160045260246000fd5b818103818111156105915761059161364a565b6000806040838503121561368657600080fd5b82519150602083015167ffffffffffffffff81111561363e57600080fd5b6001600160d01b038281168282160390808211156136c4576136c461364a565b5092915050565b6001600160d01b038181168382160190808211156136c4576136c461364a565b808201808211156105915761059161364a565b601f82111561090e57600081815260208120601f850160051c810160208610156137255750805b601f850160051c820191505b81811015611b8257828155600101613731565b815167ffffffffffffffff81111561375e5761375e612fec565b6137728161376c845461336c565b846136fe565b602080601f8311600181146137a7576000841561378f5750858301515b600019600386901b1c1916600185901b178555611b82565b600085815260208120601f198616915b828110156137d6578886015182559484019460019091019084016137b7565b50858210156137f45787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6000600182016138165761381661364a565b5060010190565b6001600160a01b038581168252841660208201526040810183905260806060820181905260009061385090830184612f03565b9695505050505050565b60006020828403121561386c57600080fd5b815161159f81612eac565b60008351613889818460208801612edf565b83519083019061389d818360208801612edf565b01949350505050565b634e487b7160e01b600052601260045260246000fd5b6000826138d957634e487b7160e01b600052601260045260246000fd5b500490565b634e487b7160e01b600052603160045260246000fdfea26469706673582212200861948c00ac12a29e05900592c5ed3f68c88227f729b466bf3d29f5a5208d1064736f6c63430008140033dec2bacdd2f05b59de34da9b523dff8be42e5e38e818c82fdb0bae774387a724", + "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106102325760003560e01c8063711864781161013057806395d89b41116100b8578063c3cda5201161007c578063c3cda52014610527578063c87b56dd1461053a578063d204c45e1461054d578063e985e9c514610560578063f2fde38b1461057357600080fd5b806395d89b41146104bf5780639ab24eb0146104c75780639fa92f9d146104da578063a22cb46514610501578063b88d4fde1461051457600080fd5b806381b62086116100ff57806381b620861461045757806384b0196e1461046a5780638da5cb5b146104855780638e539e8c1461049657806391ddadf4146104a957600080fd5b80637118647814610400578063715018a6146104135780637610248e1461041b5780637ecebe001461042e57600080fd5b806342842e0e116101be578063587cde1e11610182578063587cde1e14610388578063593aa283146103b45780635c19a95c146103c75780636352211e146103da57806370a08231146103ed57600080fd5b806342842e0e1461031257806342966c6814610325578063482ffa5e146103385780634bf5d7e91461034b5780634f6ccce71461037557600080fd5b806318160ddd1161020557806318160ddd146102b457806323b872dd146102c657806326926d46146102d95780632f745c59146102ec5780633a46b1a8146102ff57600080fd5b806301ffc9a71461023757806306fdde031461025f578063081812fc14610274578063095ea7b31461029f575b600080fd5b61024a610245366004612ec2565b610586565b60405190151581526020015b60405180910390f35b610267610597565b6040516102569190612f2f565b610287610282366004612f42565b610629565b6040516001600160a01b039091168152602001610256565b6102b26102ad366004612f70565b610652565b005b6008545b604051908152602001610256565b6102b26102d4366004612f9c565b610661565b6102b26102e7366004612f42565b6106f1565b6102b86102fa366004612f70565b610817565b6102b861030d366004612f70565b61087c565b6102b2610320366004612f9c565b6108f3565b6102b2610333366004612f42565b610913565b6102676103463660046130b1565b61091f565b60408051808201909152600e81526d06d6f64653d74696d657374616d760941b6020820152610267565b6102b8610383366004612f42565b610a6d565b610287610396366004613101565b6001600160a01b039081166000908152600f60205260409020541690565b6102b26103c236600461311e565b610ac6565b6102b26103d5366004613101565b610bd6565b6102876103e8366004612f42565b610ce3565b6102b86103fb366004613101565b610cee565b6102b261040e36600461314f565b610d36565b6102b2610e89565b610267610429366004613184565b610e9d565b6102b861043c366004613101565b6001600160a01b03166000908152600e602052604090205490565b6102b261046536600461314f565b611024565b61047261123d565b60405161025697969594939291906131bd565b600b546001600160a01b0316610287565b6102b86104a4366004612f42565b611283565b60405165ffffffffffff42168152602001610256565b6102676112e3565b6102b86104d5366004613101565b6112f2565b6102b87f000000000000000000000000000000000000000000000000000000000000000081565b6102b261050f366004613253565b611322565b6102b2610522366004613286565b61132d565b6102b26105353660046132f2565b611345565b610267610548366004612f42565b611402565b6102b261055b36600461334e565b61140d565b61024a61056e366004613184565b611527565b6102b2610581366004613101565b611555565b6000610591826115b2565b92915050565b6060600080546105a69061336c565b80601f01602080910402602001604051908101604052809291908181526020018280546105d29061336c565b801561061f5780601f106105f45761010080835404028352916020019161061f565b820191906000526020600020905b81548152906001019060200180831161060257829003601f168201915b5050505050905090565b6000610634826115d7565b506000828152600460205260409020546001600160a01b0316610591565b61065d828233611610565b5050565b6001600160a01b03821661069057604051633250574960e11b8152600060048201526024015b60405180910390fd5b600061069d83833361161d565b9050836001600160a01b0316816001600160a01b0316146106eb576040516364283d7b60e01b81526001600160a01b0380861660048301526024820184905282166044820152606401610687565b50505050565b6106f9611693565b7f000000000000000000000000000000000000000000000000000000000000000046146107385760405162461bcd60e51b8152600401610687906133a6565b604051633b0d4dd760e01b8152601360048201526001602482015260009073__$b1c1335e68417b4234016f4aa58fdfac77$__90633b0d4dd790604401602060405180830381865af4158015610792573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107b69190613400565b905060006107c383610ce3565b90506107ce836116c0565b806001600160a01b0316837f81c00ee14a307a39bcddd8f17801cf3101f1c49c8dea9ee90ec0c04a61b5a0078460405161080a91815260200190565b60405180910390a3505050565b600061082283610cee565b82106108535760405163295f44f760e21b81526001600160a01b038416600482015260248101839052604401610687565b506001600160a01b03919091166000908152600660209081526040808320938352929052205490565b60004265ffffffffffff811683106108b857604051637669fc0f60e11b81526004810184905265ffffffffffff82166024820152604401610687565b6108e26108c4846116fb565b6001600160a01b038616600090815260106020526040902090611732565b6001600160d01b0316949350505050565b61090e8383836040518060200160405280600081525061132d565b505050565b61065d6000823361161d565b60607f000000000000000000000000000000000000000000000000000000000000000046146109605760405162461bcd60e51b815260040161068790613419565b604051630564edeb60e31b81526013600482015260ff8416602482015260009073__$b1c1335e68417b4234016f4aa58fdfac77$__90632b276f5890604401602060405180830381865af41580156109bc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109e09190613400565b604051637352178160e01b815290915073__$b1c1335e68417b4234016f4aa58fdfac77$__90637352178190610a2090309088908890879060040161345c565b600060405180830381865af4158015610a3d573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610a6591908101906134df565b949350505050565b6000610a7860085490565b8210610aa15760405163295f44f760e21b81526000600482015260248101839052604401610687565b60088281548110610ab457610ab4613514565b90600052602060002001549050919050565b610ace611693565b7f00000000000000000000000000000000000000000000000000000000000000004614610b0d5760405162461bcd60e51b8152600401610687906133a6565b604051633b0d4dd760e01b8152601360048201526002602482015260009073__$b1c1335e68417b4234016f4aa58fdfac77$__90633b0d4dd790604401602060405180830381865af4158015610b67573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b8b9190613400565b9050610b9783836117e8565b827faef83f88d7b64742932e336e35ec4ebdbf35e2824c4cc154007911e95b72367e8383604051610bc992919061352a565b60405180910390a2505050565b7f00000000000000000000000000000000000000000000000000000000000000004614610c155760405162461bcd60e51b8152600401610687906133a6565b604051633b0d4dd760e01b8152601360048201526003602482015260009073__$b1c1335e68417b4234016f4aa58fdfac77$__90633b0d4dd790604401602060405180830381865af4158015610c6f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c939190613400565b9050610c9f3383611838565b6040518181526001600160a01b0383169033907fa2527a1c304fba1df9beb0da8db977345b95154faa8004c7b3485f52e34dcd0a9060200160405180910390a35050565b6000610591826115d7565b60006001600160a01b038216610d1a576040516322718ad960e21b815260006004820152602401610687565b506001600160a01b031660009081526003602052604090205490565b600080600073__$b1c1335e68417b4234016f4aa58fdfac77$__63c0af6591853060136040518463ffffffff1660e01b8152600401610d779392919061354c565b600060405180830381865af4158015610d94573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610dbc919081019061357a565b9194509250905060ff8316600314610e0f5760405162461bcd60e51b8152602060048201526016602482015275496e76616c6964206f7065726174696f6e207479706560501b6044820152606401610687565b60008083806020019051810190610e2691906135d4565b91509150610e348282611838565b806001600160a01b0316826001600160a01b03167fa2527a1c304fba1df9beb0da8db977345b95154faa8004c7b3485f52e34dcd0a85604051610e7991815260200190565b60405180910390a3505050505050565b610e91611693565b610e9b60006118aa565b565b60607f00000000000000000000000000000000000000000000000000000000000000004614610ede5760405162461bcd60e51b815260040161068790613419565b604051630564edeb60e31b8152601360048201526003602482015260009073__$b1c1335e68417b4234016f4aa58fdfac77$__90632b276f5890604401602060405180830381865af4158015610f38573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f5c9190613400565b905060008484604051602001610f889291906001600160a01b0392831681529116602082015260400190565b60408051808303601f1901815290829052637352178160e01b8252915073__$b1c1335e68417b4234016f4aa58fdfac77$__90637352178190610fd69030906003908690889060040161345c565b600060405180830381865af4158015610ff3573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261101b91908101906134df565b95945050505050565b600080600073__$b1c1335e68417b4234016f4aa58fdfac77$__63c0af6591853060136040518463ffffffff1660e01b81526004016110659392919061354c565b600060405180830381865af4158015611082573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526110aa919081019061357a565b9194509250905060ff831661113257600080838060200190518101906110d09190613603565b915091506110de82826118fc565b816001600160a01b031660016012546110f79190613660565b6040518581527f22ef8ac73166382773e470f8f887ac4c54dcf377f397431fe0ac6f60261fabaf906020015b60405180910390a350506106eb565b60001960ff8416016111a8576000828060200190518101906111549190613400565b9050600061116182610ce3565b905061116c826116c0565b806001600160a01b0316827f81c00ee14a307a39bcddd8f17801cf3101f1c49c8dea9ee90ec0c04a61b5a0078560405161112391815260200190565b60011960ff84160161121a57600080838060200190518101906111cb9190613673565b915091506111d982826117e8565b817faef83f88d7b64742932e336e35ec4ebdbf35e2824c4cc154007911e95b72367e828560405161120b92919061352a565b60405180910390a250506106eb565b60021960ff8416016106eb5760008083806020019051810190610e2691906135d4565b600060608060008060006060611251611931565b611259611963565b60408051600080825260208201909252600f60f81b9b939a50919850469750309650945092509050565b60004265ffffffffffff811683106112bf57604051637669fc0f60e11b81526004810184905265ffffffffffff82166024820152604401610687565b6112d36112cb846116fb565b601190611732565b6001600160d01b03169392505050565b6060600180546105a69061336c565b6001600160a01b038116600090815260106020526040812061131390611990565b6001600160d01b031692915050565b61065d3383836119c9565b611338848484610661565b6106eb3385858585611a60565b8342111561136957604051632341d78760e11b815260048101859052602401610687565b604080517fe48329057bfd03d55e49b547132e39cffd9c1820ad7b9d4c5307691425d15adf60208201526001600160a01b0388169181019190915260608101869052608081018590526000906113e3906113db9060a00160405160208183030381529060405280519060200120611b8b565b858585611bb8565b90506113ef8187611be6565b6113f98188611838565b50505050505050565b606061059182611c39565b611415611693565b7f000000000000000000000000000000000000000000000000000000000000000046146114545760405162461bcd60e51b8152600401610687906133a6565b604051633b0d4dd760e01b8152601360048201526000602482018190529073__$b1c1335e68417b4234016f4aa58fdfac77$__90633b0d4dd790604401602060405180830381865af41580156114ae573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114d29190613400565b90506114de83836118fc565b826001600160a01b031660016012546114f79190613660565b6040518381527f22ef8ac73166382773e470f8f887ac4c54dcf377f397431fe0ac6f60261fabaf9060200161080a565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205460ff1690565b61155d611693565b6001600160a01b03811661158757604051631e4fbdf760e01b815260006004820152602401610687565b611590816118aa565b50565b600061159f82846136a4565b9392505050565b600061159f82846136cb565b60006001600160e01b03198216632483248360e11b1480610591575061059182611d42565b6000818152600260205260408120546001600160a01b03168061059157604051637e27328960e01b815260048101849052602401610687565b61090e8383836001611d67565b60006001600160a01b038216158061163c57506001600160a01b038416155b6116885760405162461bcd60e51b815260206004820152601760248201527f4e4654206973206e6f74207472616e7366657261626c650000000000000000006044820152606401610687565b610a65848484611e6d565b600b546001600160a01b03163314610e9b5760405163118cdaa760e01b8152336004820152602401610687565b60006116cf600083600061161d565b90506001600160a01b03811661065d57604051637e27328960e01b815260048101839052602401610687565b600065ffffffffffff82111561172e576040516306dfcc6560e41b81526030600482015260248101839052604401610687565b5090565b81546000908181600581111561179157600061174d84611e89565b6117579085613660565b60008881526020902090915081015465ffffffffffff90811690871610156117815780915061178f565b61178c8160016136eb565b92505b505b600061179f87878585611fe2565b905080156117da576117c4876117b6600184613660565b600091825260209091200190565b54600160301b90046001600160d01b03166117dd565b60005b979650505050505050565b6000828152600a602052604090206118008282613744565b506040518281527ff8e1a15aba9398e019f0b49df1a4fde98ee17ae345cb5f6b5e2c27f5033e8ce79060200160405180910390a15050565b6001600160a01b038281166000818152600f602052604080822080548686166001600160a01b0319821681179092559151919094169392849290917f3134e8a2e6d97e929a7e54011ea5485d7d196dd5f0ba4d4ef95803e8e3fc257f9190a461090e81836118a586612044565b61204f565b600b80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b601280546000918261190d83613804565b91905055905061191d83826121bb565b61192781836117e8565b61090e8384611838565b606061195e7f0000000000000000000000000000000000000000000000000000000000000000600c6121d5565b905090565b606061195e7f0000000000000000000000000000000000000000000000000000000000000000600d6121d5565b805460009080156119c0576119aa836117b6600184613660565b54600160301b90046001600160d01b031661159f565b60009392505050565b6001600160a01b0382166119fb57604051630b61174360e31b81526001600160a01b0383166004820152602401610687565b6001600160a01b03838116600081815260056020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910161080a565b6001600160a01b0383163b15611b8457604051630a85bd0160e11b81526001600160a01b0384169063150b7a0290611aa290889088908790879060040161381d565b6020604051808303816000875af1925050508015611add575060408051601f3d908101601f19168201909252611ada9181019061385a565b60015b611b46573d808015611b0b576040519150601f19603f3d011682016040523d82523d6000602084013e611b10565b606091505b508051600003611b3e57604051633250574960e11b81526001600160a01b0385166004820152602401610687565b805181602001fd5b6001600160e01b03198116630a85bd0160e11b14611b8257604051633250574960e11b81526001600160a01b0385166004820152602401610687565b505b5050505050565b6000610591611b98612280565b8360405161190160f01b8152600281019290925260228201526042902090565b600080600080611bca888888886123ab565b925092509250611bda828261247a565b50909695505050505050565b6001600160a01b0382166000908152600e6020526040902080546001810190915581811461090e576040516301d4b62360e61b81526001600160a01b038416600482015260248101829052604401610687565b6060611c44826115d7565b506000828152600a602052604081208054611c5e9061336c565b80601f0160208091040260200160405190810160405280929190818152602001828054611c8a9061336c565b8015611cd75780601f10611cac57610100808354040283529160200191611cd7565b820191906000526020600020905b815481529060010190602001808311611cba57829003601f168201915b505050505090506000611cf560408051602081019091526000815290565b90508051600003611d07575092915050565b815115611d39578082604051602001611d21929190613877565b60405160208183030381529060405292505050919050565b610a6584612533565b60006001600160e01b0319821663780e9d6360e01b14806105915750610591826125a7565b8080611d7b57506001600160a01b03821615155b15611e3d576000611d8b846115d7565b90506001600160a01b03831615801590611db75750826001600160a01b0316816001600160a01b031614155b8015611dca5750611dc88184611527565b155b15611df35760405163a9fbf51f60e01b81526001600160a01b0384166004820152602401610687565b8115611e3b5783856001600160a01b0316826001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45b505b5050600090815260046020526040902080546001600160a01b0319166001600160a01b0392909216919091179055565b600080611e7b8585856125f7565b9050610a65818660016126c4565b600060018211611e97575090565b816001600160801b8210611eb05760809190911c9060401b5b680100000000000000008210611ecb5760409190911c9060201b5b6401000000008210611ee25760209190911c9060101b5b620100008210611ef75760109190911c9060081b5b6101008210611f0b5760089190911c9060041b5b60108210611f1e5760049190911c9060021b5b60048210611f2a5760011b5b600302600190811c90818581611f4257611f426138a6565b048201901c90506001818581611f5a57611f5a6138a6565b048201901c90506001818581611f7257611f726138a6565b048201901c90506001818581611f8a57611f8a6138a6565b048201901c90506001818581611fa257611fa26138a6565b048201901c90506001818581611fba57611fba6138a6565b048201901c9050611fd9818581611fd357611fd36138a6565b04821190565b90039392505050565b60005b8183101561203c576000611ff9848461273a565b60008781526020902090915065ffffffffffff86169082015465ffffffffffff16111561202857809250612036565b6120338160016136eb565b93505b50611fe5565b509392505050565b600061059182610cee565b816001600160a01b0316836001600160a01b0316141580156120715750600081115b1561090e576001600160a01b03831615612119576001600160a01b038316600090815260106020526040812081906120b4906115936120af86612755565b612789565b6001600160d01b031691506001600160d01b03169150846001600160a01b03167fdec2bacdd2f05b59de34da9b523dff8be42e5e38e818c82fdb0bae774387a724838360405161210e929190918252602082015260400190565b60405180910390a250505b6001600160a01b0382161561090e576001600160a01b03821660009081526010602052604081208190612152906115a66120af86612755565b6001600160d01b031691506001600160d01b03169150836001600160a01b03167fdec2bacdd2f05b59de34da9b523dff8be42e5e38e818c82fdb0bae774387a72483836040516121ac929190918252602082015260400190565b60405180910390a25050505050565b61065d8282604051806020016040528060008152506127bb565b606060ff83146121ef576121e8836127d3565b9050610591565b8180546121fb9061336c565b80601f01602080910402602001604051908101604052809291908181526020018280546122279061336c565b80156122745780601f1061224957610100808354040283529160200191612274565b820191906000526020600020905b81548152906001019060200180831161225757829003601f168201915b50505050509050610591565b6000306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480156122d957507f000000000000000000000000000000000000000000000000000000000000000046145b1561230357507f000000000000000000000000000000000000000000000000000000000000000090565b61195e604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f60208201527f0000000000000000000000000000000000000000000000000000000000000000918101919091527f000000000000000000000000000000000000000000000000000000000000000060608201524660808201523060a082015260009060c00160405160208183030381529060405280519060200120905090565b600080807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08411156123e65750600091506003905082612470565b604080516000808252602082018084528a905260ff891692820192909252606081018790526080810186905260019060a0016020604051602081039080840390855afa15801561243a573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b03811661246657506000925060019150829050612470565b9250600091508190505b9450945094915050565b600082600381111561248e5761248e6133ea565b03612497575050565b60018260038111156124ab576124ab6133ea565b036124c95760405163f645eedf60e01b815260040160405180910390fd5b60028260038111156124dd576124dd6133ea565b036124fe5760405163fce698f760e01b815260048101829052602401610687565b6003826003811115612512576125126133ea565b0361065d576040516335e2f38360e21b815260048101829052602401610687565b606061253e826115d7565b50600061255660408051602081019091526000815290565b90506000815111612576576040518060200160405280600081525061159f565b8061258084612812565b604051602001612591929190613877565b6040516020818303038152906040529392505050565b60006001600160e01b031982166380ac58cd60e01b14806125d857506001600160e01b03198216635b5e139f60e01b145b8061059157506301ffc9a760e01b6001600160e01b0319831614610591565b6000806126058585856128a5565b90506001600160a01b0381166126625761265d84600880546000838152600960205260408120829055600182018355919091527ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee30155565b612685565b846001600160a01b0316816001600160a01b03161461268557612685818561299e565b6001600160a01b0385166126a15761269c84612a1f565b610a65565b846001600160a01b0316816001600160a01b031614610a6557610a658585612ace565b6001600160a01b0383166126e6576126e360116115a66120af84612755565b50505b6001600160a01b0382166127085761270560116115936120af84612755565b50505b6001600160a01b038381166000908152600f602052604080822054858416835291205461090e9291821691168361204f565b600061274960028484186138bc565b61159f908484166136eb565b60006001600160d01b0382111561172e576040516306dfcc6560e41b815260d0600482015260248101839052604401610687565b6000806127ae426127a661279c88611990565b868863ffffffff16565b879190612b1e565b915091505b935093915050565b6127c58383612b2c565b61090e336000858585611a60565b606060006127e083612b91565b604080516020808252818301909252919250600091906020820181803683375050509182525060208101929092525090565b6060600061281f83612bb9565b600101905060008167ffffffffffffffff81111561283f5761283f612fec565b6040519080825280601f01601f191660200182016040528015612869576020820181803683370190505b5090508181016020015b600019016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a850494508461287357509392505050565b6000828152600260205260408120546001600160a01b03908116908316156128d2576128d2818486612c91565b6001600160a01b03811615612910576128ef600085600080611d67565b6001600160a01b038116600090815260036020526040902080546000190190555b6001600160a01b0385161561293f576001600160a01b0385166000908152600360205260409020805460010190555b60008481526002602052604080822080546001600160a01b0319166001600160a01b0389811691821790925591518793918516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4949350505050565b60006129a983610cee565b6000838152600760209081526040808320546001600160a01b0388168452600690925290912091925090818314612a0057600083815260208281526040808320548584528184208190558352600790915290208290555b6000938452600760209081526040808620869055938552525081205550565b600854600090612a3190600190613660565b60008381526009602052604081205460088054939450909284908110612a5957612a59613514565b906000526020600020015490508060088381548110612a7a57612a7a613514565b6000918252602080832090910192909255828152600990915260408082208490558582528120556008805480612ab257612ab26138de565b6001900381819060005260206000200160009055905550505050565b60006001612adb84610cee565b612ae59190613660565b6001600160a01b039093166000908152600660209081526040808320868452825280832085905593825260079052919091209190915550565b6000806127ae858585612cf5565b6001600160a01b038216612b5657604051633250574960e11b815260006004820152602401610687565b6000612b648383600061161d565b90506001600160a01b0381161561090e576040516339e3563760e11b815260006004820152602401610687565b600060ff8216601f81111561059157604051632cd44ac360e21b815260040160405180910390fd5b60008072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b8310612bf85772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6d04ee2d6d415b85acef81000000008310612c24576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc100008310612c4257662386f26fc10000830492506010015b6305f5e1008310612c5a576305f5e100830492506008015b6127108310612c6e57612710830492506004015b60648310612c80576064830492506002015b600a83106105915760010192915050565b612c9c838383612e49565b61090e576001600160a01b038316612cca57604051637e27328960e01b815260048101829052602401610687565b60405163177e802f60e01b81526001600160a01b038316600482015260248101829052604401610687565b825460009081908015612dee576000612d13876117b6600185613660565b805490915065ffffffffffff80821691600160301b90046001600160d01b0316908816821115612d5657604051632520601d60e01b815260040160405180910390fd5b8765ffffffffffff168265ffffffffffff1603612d8f57825465ffffffffffff16600160301b6001600160d01b03891602178355612de0565b6040805180820190915265ffffffffffff808a1682526001600160d01b03808a1660208085019182528d54600181018f5560008f81529190912094519151909216600160301b029216919091179101555b94508593506127b392505050565b50506040805180820190915265ffffffffffff80851682526001600160d01b0380851660208085019182528854600181018a5560008a815291822095519251909316600160301b0291909316179201919091559050816127b3565b60006001600160a01b03831615801590610a655750826001600160a01b0316846001600160a01b03161480612e835750612e838484611527565b80610a655750506000908152600460205260409020546001600160a01b03908116911614919050565b6001600160e01b03198116811461159057600080fd5b600060208284031215612ed457600080fd5b813561159f81612eac565b60005b83811015612efa578181015183820152602001612ee2565b50506000910152565b60008151808452612f1b816020860160208601612edf565b601f01601f19169290920160200192915050565b60208152600061159f6020830184612f03565b600060208284031215612f5457600080fd5b5035919050565b6001600160a01b038116811461159057600080fd5b60008060408385031215612f8357600080fd5b8235612f8e81612f5b565b946020939093013593505050565b600080600060608486031215612fb157600080fd5b8335612fbc81612f5b565b92506020840135612fcc81612f5b565b929592945050506040919091013590565b60ff8116811461159057600080fd5b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff8111828210171561302b5761302b612fec565b604052919050565b600067ffffffffffffffff82111561304d5761304d612fec565b50601f01601f191660200190565b600082601f83011261306c57600080fd5b813561307f61307a82613033565b613002565b81815284602083860101111561309457600080fd5b816020850160208301376000918101602001919091529392505050565b600080604083850312156130c457600080fd5b82356130cf81612fdd565b9150602083013567ffffffffffffffff8111156130eb57600080fd5b6130f78582860161305b565b9150509250929050565b60006020828403121561311357600080fd5b813561159f81612f5b565b6000806040838503121561313157600080fd5b82359150602083013567ffffffffffffffff8111156130eb57600080fd5b60006020828403121561316157600080fd5b813567ffffffffffffffff81111561317857600080fd5b610a658482850161305b565b6000806040838503121561319757600080fd5b82356131a281612f5b565b915060208301356131b281612f5b565b809150509250929050565b60ff60f81b881681526000602060e0818401526131dd60e084018a612f03565b83810360408501526131ef818a612f03565b606085018990526001600160a01b038816608086015260a0850187905284810360c0860152855180825283870192509083019060005b8181101561324157835183529284019291840191600101613225565b50909c9b505050505050505050505050565b6000806040838503121561326657600080fd5b823561327181612f5b565b9150602083013580151581146131b257600080fd5b6000806000806080858703121561329c57600080fd5b84356132a781612f5b565b935060208501356132b781612f5b565b925060408501359150606085013567ffffffffffffffff8111156132da57600080fd5b6132e68782880161305b565b91505092959194509250565b60008060008060008060c0878903121561330b57600080fd5b863561331681612f5b565b95506020870135945060408701359350606087013561333481612fdd565b9598949750929560808101359460a0909101359350915050565b6000806040838503121561336157600080fd5b82356130cf81612f5b565b600181811c9082168061338057607f821691505b6020821081036133a057634e487b7160e01b600052602260045260246000fd5b50919050565b60208082526024908201527f4f7065726174696f6e206f6e6c7920616c6c6f776564206f6e20686f6d6520636040820152633430b4b760e11b606082015260800190565b634e487b7160e01b600052602160045260246000fd5b60006020828403121561341257600080fd5b5051919050565b60208082526023908201527f50726f6f6673206f6e6c792067656e657261746564206f6e20686f6d6520636860408201526230b4b760e91b606082015260800190565b6001600160a01b038516815260ff8416602082015260806040820181905260009061348990830185612f03565b905082606083015295945050505050565b600082601f8301126134ab57600080fd5b81516134b961307a82613033565b8181528460208386010111156134ce57600080fd5b610a65826020830160208701612edf565b6000602082840312156134f157600080fd5b815167ffffffffffffffff81111561350857600080fd5b610a658482850161349a565b634e487b7160e01b600052603260045260246000fd5b60408152600061353d6040830185612f03565b90508260208301529392505050565b60608152600061355f6060830186612f03565b6001600160a01b039490941660208301525060400152919050565b60008060006060848603121561358f57600080fd5b835161359a81612fdd565b602085015190935067ffffffffffffffff8111156135b757600080fd5b6135c38682870161349a565b925050604084015190509250925092565b600080604083850312156135e757600080fd5b82516135f281612f5b565b60208401519092506131b281612f5b565b6000806040838503121561361657600080fd5b825161362181612f5b565b602084015190925067ffffffffffffffff81111561363e57600080fd5b6130f78582860161349a565b634e487b7160e01b600052601160045260246000fd5b818103818111156105915761059161364a565b6000806040838503121561368657600080fd5b82519150602083015167ffffffffffffffff81111561363e57600080fd5b6001600160d01b038281168282160390808211156136c4576136c461364a565b5092915050565b6001600160d01b038181168382160190808211156136c4576136c461364a565b808201808211156105915761059161364a565b601f82111561090e57600081815260208120601f850160051c810160208610156137255750805b601f850160051c820191505b81811015611b8257828155600101613731565b815167ffffffffffffffff81111561375e5761375e612fec565b6137728161376c845461336c565b846136fe565b602080601f8311600181146137a7576000841561378f5750858301515b600019600386901b1c1916600185901b178555611b82565b600085815260208120601f198616915b828110156137d6578886015182559484019460019091019084016137b7565b50858210156137f45787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6000600182016138165761381661364a565b5060010190565b6001600160a01b038581168252841660208201526040810183905260806060820181905260009061385090830184612f03565b9695505050505050565b60006020828403121561386c57600080fd5b815161159f81612eac565b60008351613889818460208801612edf565b83519083019061389d818360208801612edf565b01949350505050565b634e487b7160e01b600052601260045260246000fd5b6000826138d957634e487b7160e01b600052601260045260246000fd5b500490565b634e487b7160e01b600052603160045260246000fdfea26469706673582212200861948c00ac12a29e05900592c5ed3f68c88227f729b466bf3d29f5a5208d1064736f6c63430008140033", "libraries": { "ProofHandler": "0x0152ee45780385dACCCCB128D816031CfFe5F36B" }, "devdoc": { "author": "Web3 Hackers Collective", "custom:security-contact": "julien@strat.cc", - "details": "Uses ProofHandler library for cross-chain proof management", + "details": "Extends OpenZeppelin's NFT standards with cross-chain operation support and delegation", "errors": { "CheckpointUnorderedInsertion()": [ { @@ -1487,6 +1635,13 @@ "DelegateVotesChanged(address,uint256,uint256)": { "details": "Emitted when a token transfer or delegate change results in changes to a delegate's number of voting units." }, + "DelegationSynced(address,address,uint256)": { + "params": { + "delegatee": "The address receiving the delegation", + "delegator": "The address delegating their voting power", + "nonce": "Operation sequence number" + } + }, "EIP712DomainChanged()": { "details": "MAY be emitted to signal that the domain could have changed." }, @@ -1521,7 +1676,9 @@ "kind": "dev", "methods": { "CLOCK_MODE()": { - "details": "Machine-readable description of the clock as specified in ERC-6372." + "returns": { + "_0": "String indicating timestamp-based voting" + } }, "approve(address,uint256)": { "details": "See {IERC721-approve}." @@ -1532,13 +1689,21 @@ "burn(uint256)": { "details": "Burns `tokenId`. See {ERC721-_burn}. Requirements: - The caller must own `tokenId` or be an approved operator." }, + "claimDelegation(bytes)": { + "params": { + "proof": "Proof generated by home chain" + } + }, "claimOperation(bytes)": { "params": { "proof": "Proof generated by home chain" } }, "clock()": { - "details": "Clock used for flagging checkpoints. Can be overridden to implement timestamp based checkpoints (and voting), in which case {CLOCK_MODE} should be overridden as well to match." + "details": "Used for voting snapshots", + "returns": { + "_0": "Current block timestamp" + } }, "constructor": { "params": { @@ -1551,7 +1716,10 @@ } }, "delegate(address)": { - "details": "Delegates votes from the sender to `delegatee`." + "details": "Overrides ERC721Votes delegate function to add cross-chain functionality", + "params": { + "delegatee": "Address to delegate voting power to" + } }, "delegateBySig(address,uint256,uint256,uint8,bytes32,bytes32)": { "details": "Delegates votes from signer to `delegatee`." @@ -1562,7 +1730,18 @@ "eip712Domain()": { "details": "See {IERC-5267}." }, + "generateDelegationProof(address,address)": { + "details": "Only callable on home chain", + "params": { + "delegatee": "Address receiving delegation", + "delegator": "Address delegating voting power" + }, + "returns": { + "_0": "Encoded proof data" + } + }, "generateOperationProof(uint8,bytes)": { + "details": "Only callable on home chain", "params": { "operationType": "Type of operation", "params": "Operation parameters" @@ -1630,6 +1809,14 @@ "uri": "New metadata URI" } }, + "supportsInterface(bytes4)": { + "params": { + "interfaceId": "Interface identifier to check" + }, + "returns": { + "_0": "bool True if interface is supported" + } + }, "symbol()": { "details": "See {IERC721Metadata-symbol}." }, @@ -1639,6 +1826,14 @@ "tokenOfOwnerByIndex(address,uint256)": { "details": "See {IERC721Enumerable-tokenOfOwnerByIndex}." }, + "tokenURI(uint256)": { + "params": { + "tokenId": "Token ID to query" + }, + "returns": { + "_0": "URI string" + } + }, "totalSupply()": { "details": "See {IERC721Enumerable-totalSupply}." }, @@ -1654,6 +1849,9 @@ }, "userdoc": { "events": { + "DelegationSynced(address,address,uint256)": { + "notice": "Emitted when delegation is synchronized across chains" + }, "MembershipClaimed(uint256,address,uint256)": { "notice": "Emitted when a membership is claimed" }, @@ -1666,12 +1864,27 @@ }, "kind": "user", "methods": { + "CLOCK_MODE()": { + "notice": "Gets clock mode description" + }, + "claimDelegation(bytes)": { + "notice": "Claims a delegation operation on a foreign chain" + }, "claimOperation(bytes)": { "notice": "Claims an NFT operation on a foreign chain" }, + "clock()": { + "notice": "Gets current timestamp" + }, "constructor": { "notice": "Initializes the NFT contract" }, + "delegate(address)": { + "notice": "Delegates voting power to another address on home chain" + }, + "generateDelegationProof(address,address)": { + "notice": "Generates proof for delegation" + }, "generateOperationProof(uint8,bytes)": { "notice": "Generates proof for NFT operations" }, @@ -1686,6 +1899,12 @@ }, "setMetadata(uint256,string)": { "notice": "Updates token metadata on home chain" + }, + "supportsInterface(bytes4)": { + "notice": "Checks interface support" + }, + "tokenURI(uint256)": { + "notice": "Gets token URI" } }, "notice": "Non-transferable NFT implementation for DAO membership with cross-chain capabilities", @@ -1694,7 +1913,7 @@ "storageLayout": { "storage": [ { - "astId": 4085, + "astId": 1030, "contract": "contracts/variants/crosschain/NFT.sol:NFT", "label": "_name", "offset": 0, @@ -1702,7 +1921,7 @@ "type": "t_string_storage" }, { - "astId": 4087, + "astId": 1032, "contract": "contracts/variants/crosschain/NFT.sol:NFT", "label": "_symbol", "offset": 0, @@ -1710,7 +1929,7 @@ "type": "t_string_storage" }, { - "astId": 4091, + "astId": 1036, "contract": "contracts/variants/crosschain/NFT.sol:NFT", "label": "_owners", "offset": 0, @@ -1718,7 +1937,7 @@ "type": "t_mapping(t_uint256,t_address)" }, { - "astId": 4095, + "astId": 1040, "contract": "contracts/variants/crosschain/NFT.sol:NFT", "label": "_balances", "offset": 0, @@ -1726,7 +1945,7 @@ "type": "t_mapping(t_address,t_uint256)" }, { - "astId": 4099, + "astId": 1044, "contract": "contracts/variants/crosschain/NFT.sol:NFT", "label": "_tokenApprovals", "offset": 0, @@ -1734,7 +1953,7 @@ "type": "t_mapping(t_uint256,t_address)" }, { - "astId": 4105, + "astId": 1050, "contract": "contracts/variants/crosschain/NFT.sol:NFT", "label": "_operatorApprovals", "offset": 0, @@ -1742,7 +1961,7 @@ "type": "t_mapping(t_address,t_mapping(t_address,t_bool))" }, { - "astId": 5192, + "astId": 2137, "contract": "contracts/variants/crosschain/NFT.sol:NFT", "label": "_ownedTokens", "offset": 0, @@ -1750,7 +1969,7 @@ "type": "t_mapping(t_address,t_mapping(t_uint256,t_uint256))" }, { - "astId": 5196, + "astId": 2141, "contract": "contracts/variants/crosschain/NFT.sol:NFT", "label": "_ownedTokensIndex", "offset": 0, @@ -1758,7 +1977,7 @@ "type": "t_mapping(t_uint256,t_uint256)" }, { - "astId": 5199, + "astId": 2144, "contract": "contracts/variants/crosschain/NFT.sol:NFT", "label": "_allTokens", "offset": 0, @@ -1766,7 +1985,7 @@ "type": "t_array(t_uint256)dyn_storage" }, { - "astId": 5203, + "astId": 2148, "contract": "contracts/variants/crosschain/NFT.sol:NFT", "label": "_allTokensIndex", "offset": 0, @@ -1774,7 +1993,7 @@ "type": "t_mapping(t_uint256,t_uint256)" }, { - "astId": 5587, + "astId": 2532, "contract": "contracts/variants/crosschain/NFT.sol:NFT", "label": "_tokenURIs", "offset": 0, @@ -1790,7 +2009,7 @@ "type": "t_address" }, { - "astId": 7382, + "astId": 4046, "contract": "contracts/variants/crosschain/NFT.sol:NFT", "label": "_nameFallback", "offset": 0, @@ -1798,7 +2017,7 @@ "type": "t_string_storage" }, { - "astId": 7384, + "astId": 4048, "contract": "contracts/variants/crosschain/NFT.sol:NFT", "label": "_versionFallback", "offset": 0, @@ -1806,7 +2025,7 @@ "type": "t_string_storage" }, { - "astId": 6230, + "astId": 2894, "contract": "contracts/variants/crosschain/NFT.sol:NFT", "label": "_nonces", "offset": 0, @@ -1814,7 +2033,7 @@ "type": "t_mapping(t_address,t_uint256)" }, { - "astId": 3269, + "astId": 270, "contract": "contracts/variants/crosschain/NFT.sol:NFT", "label": "_delegatee", "offset": 0, @@ -1822,23 +2041,23 @@ "type": "t_mapping(t_address,t_address)" }, { - "astId": 3274, + "astId": 275, "contract": "contracts/variants/crosschain/NFT.sol:NFT", "label": "_delegateCheckpoints", "offset": 0, "slot": "16", - "type": "t_mapping(t_address,t_struct(Trace208)11842_storage)" + "type": "t_mapping(t_address,t_struct(Trace208)8398_storage)" }, { - "astId": 3277, + "astId": 278, "contract": "contracts/variants/crosschain/NFT.sol:NFT", "label": "_totalCheckpoints", "offset": 0, "slot": "17", - "type": "t_struct(Trace208)11842_storage" + "type": "t_struct(Trace208)8398_storage" }, { - "astId": 14159, + "astId": 9751, "contract": "contracts/variants/crosschain/NFT.sol:NFT", "label": "_nextTokenId", "offset": 0, @@ -1846,12 +2065,12 @@ "type": "t_uint256" }, { - "astId": 14163, + "astId": 9755, "contract": "contracts/variants/crosschain/NFT.sol:NFT", "label": "_proofStorage", "offset": 0, "slot": "19", - "type": "t_struct(ProofStorage)14687_storage" + "type": "t_struct(ProofStorage)10489_storage" } ], "types": { @@ -1860,8 +2079,8 @@ "label": "address", "numberOfBytes": "20" }, - "t_array(t_struct(Checkpoint208)11847_storage)dyn_storage": { - "base": "t_struct(Checkpoint208)11847_storage", + "t_array(t_struct(Checkpoint208)8403_storage)dyn_storage": { + "base": "t_struct(Checkpoint208)8403_storage", "encoding": "dynamic_array", "label": "struct Checkpoints.Checkpoint208[]", "numberOfBytes": "32" @@ -1910,12 +2129,12 @@ "numberOfBytes": "32", "value": "t_mapping(t_uint256,t_uint256)" }, - "t_mapping(t_address,t_struct(Trace208)11842_storage)": { + "t_mapping(t_address,t_struct(Trace208)8398_storage)": { "encoding": "mapping", "key": "t_address", "label": "mapping(address => struct Checkpoints.Trace208)", "numberOfBytes": "32", - "value": "t_struct(Trace208)11842_storage" + "value": "t_struct(Trace208)8398_storage" }, "t_mapping(t_address,t_uint256)": { "encoding": "mapping", @@ -1964,12 +2183,12 @@ "label": "string", "numberOfBytes": "32" }, - "t_struct(Checkpoint208)11847_storage": { + "t_struct(Checkpoint208)8403_storage": { "encoding": "inplace", "label": "struct Checkpoints.Checkpoint208", "members": [ { - "astId": 11844, + "astId": 8400, "contract": "contracts/variants/crosschain/NFT.sol:NFT", "label": "_key", "offset": 0, @@ -1977,7 +2196,7 @@ "type": "t_uint48" }, { - "astId": 11846, + "astId": 8402, "contract": "contracts/variants/crosschain/NFT.sol:NFT", "label": "_value", "offset": 6, @@ -1987,12 +2206,12 @@ ], "numberOfBytes": "32" }, - "t_struct(ProofStorage)14687_storage": { + "t_struct(ProofStorage)10489_storage": { "encoding": "inplace", "label": "struct ProofHandler.ProofStorage", "members": [ { - "astId": 14682, + "astId": 10484, "contract": "contracts/variants/crosschain/NFT.sol:NFT", "label": "updateAppliedOnChain", "offset": 0, @@ -2000,7 +2219,7 @@ "type": "t_mapping(t_bytes32,t_bool)" }, { - "astId": 14686, + "astId": 10488, "contract": "contracts/variants/crosschain/NFT.sol:NFT", "label": "currentNonce", "offset": 0, @@ -2010,17 +2229,17 @@ ], "numberOfBytes": "64" }, - "t_struct(Trace208)11842_storage": { + "t_struct(Trace208)8398_storage": { "encoding": "inplace", "label": "struct Checkpoints.Trace208", "members": [ { - "astId": 11841, + "astId": 8397, "contract": "contracts/variants/crosschain/NFT.sol:NFT", "label": "_checkpoints", "offset": 0, "slot": "0", - "type": "t_array(t_struct(Checkpoint208)11847_storage)dyn_storage" + "type": "t_array(t_struct(Checkpoint208)8403_storage)dyn_storage" } ], "numberOfBytes": "32" diff --git a/deployments/sepolia/ProofHandler.json b/deployments/sepolia/ProofHandler.json index a641e65..3ec826e 100644 --- a/deployments/sepolia/ProofHandler.json +++ b/deployments/sepolia/ProofHandler.json @@ -61,22 +61,6 @@ "type": "function" } ], - "transactionHash": "0x7f5e02c224109056fe973d7be6df72f8db56432c7dae57de215aebd93d601dc5", - "receipt": { - "to": "0x4e59b44847b379578588920cA78FbF26c0B4956C", - "from": "0x27292E1a901E3E0bE7d144aDba4CAD07da2d8a42", - "contractAddress": null, - "transactionIndex": 233, - "gasUsed": "518229", - "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x4412e635f8beb61906b5c611545188aaba5e7756735a78f550f605cc8d0f3807", - "transactionHash": "0x7f5e02c224109056fe973d7be6df72f8db56432c7dae57de215aebd93d601dc5", - "logs": [], - "blockNumber": 7191166, - "cumulativeGasUsed": "14985489", - "status": 1, - "byzantium": true - }, "args": [], "numDeployments": 1, "solcInputHash": "96a9008abeaccbd30a9b75989ce7f0fd", diff --git a/deployments/sepolia/solcInputs/77ec5f062950e8c4875fd27ffb65d267.json b/deployments/sepolia/solcInputs/77ec5f062950e8c4875fd27ffb65d267.json new file mode 100644 index 0000000..8590478 --- /dev/null +++ b/deployments/sepolia/solcInputs/77ec5f062950e8c4875fd27ffb65d267.json @@ -0,0 +1,186 @@ +{ + "language": "Solidity", + "sources": { + "@openzeppelin/contracts/access/Ownable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol)\n\npragma solidity ^0.8.20;\n\nimport {Context} from \"../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 * The initial owner is set to the address provided by the deployer. This can\n * 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 /**\n * @dev The caller account is not authorized to perform an operation.\n */\n error OwnableUnauthorizedAccount(address account);\n\n /**\n * @dev The owner is not a valid owner account. (eg. `address(0)`)\n */\n error OwnableInvalidOwner(address owner);\n\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n /**\n * @dev Initializes the contract setting the address provided by the deployer as the initial owner.\n */\n constructor(address initialOwner) {\n if (initialOwner == address(0)) {\n revert OwnableInvalidOwner(address(0));\n }\n _transferOwnership(initialOwner);\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 if (owner() != _msgSender()) {\n revert OwnableUnauthorizedAccount(_msgSender());\n }\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 if (newOwner == address(0)) {\n revert OwnableInvalidOwner(address(0));\n }\n _transferOwnership(newOwner);\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Internal function without access restriction.\n */\n function _transferOwnership(address newOwner) internal virtual {\n address oldOwner = _owner;\n _owner = newOwner;\n emit OwnershipTransferred(oldOwner, newOwner);\n }\n}\n" + }, + "@openzeppelin/contracts/governance/extensions/GovernorCountingSimple.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (governance/extensions/GovernorCountingSimple.sol)\n\npragma solidity ^0.8.20;\n\nimport {Governor} from \"../Governor.sol\";\n\n/**\n * @dev Extension of {Governor} for simple, 3 options, vote counting.\n */\nabstract contract GovernorCountingSimple is Governor {\n /**\n * @dev Supported vote types. Matches Governor Bravo ordering.\n */\n enum VoteType {\n Against,\n For,\n Abstain\n }\n\n struct ProposalVote {\n uint256 againstVotes;\n uint256 forVotes;\n uint256 abstainVotes;\n mapping(address voter => bool) hasVoted;\n }\n\n mapping(uint256 proposalId => ProposalVote) private _proposalVotes;\n\n /**\n * @dev See {IGovernor-COUNTING_MODE}.\n */\n // solhint-disable-next-line func-name-mixedcase\n function COUNTING_MODE() public pure virtual override returns (string memory) {\n return \"support=bravo&quorum=for,abstain\";\n }\n\n /**\n * @dev See {IGovernor-hasVoted}.\n */\n function hasVoted(uint256 proposalId, address account) public view virtual override returns (bool) {\n return _proposalVotes[proposalId].hasVoted[account];\n }\n\n /**\n * @dev Accessor to the internal vote counts.\n */\n function proposalVotes(\n uint256 proposalId\n ) public view virtual returns (uint256 againstVotes, uint256 forVotes, uint256 abstainVotes) {\n ProposalVote storage proposalVote = _proposalVotes[proposalId];\n return (proposalVote.againstVotes, proposalVote.forVotes, proposalVote.abstainVotes);\n }\n\n /**\n * @dev See {Governor-_quorumReached}.\n */\n function _quorumReached(uint256 proposalId) internal view virtual override returns (bool) {\n ProposalVote storage proposalVote = _proposalVotes[proposalId];\n\n return quorum(proposalSnapshot(proposalId)) <= proposalVote.forVotes + proposalVote.abstainVotes;\n }\n\n /**\n * @dev See {Governor-_voteSucceeded}. In this module, the forVotes must be strictly over the againstVotes.\n */\n function _voteSucceeded(uint256 proposalId) internal view virtual override returns (bool) {\n ProposalVote storage proposalVote = _proposalVotes[proposalId];\n\n return proposalVote.forVotes > proposalVote.againstVotes;\n }\n\n /**\n * @dev See {Governor-_countVote}. In this module, the support follows the `VoteType` enum (from Governor Bravo).\n */\n function _countVote(\n uint256 proposalId,\n address account,\n uint8 support,\n uint256 totalWeight,\n bytes memory // params\n ) internal virtual override returns (uint256) {\n ProposalVote storage proposalVote = _proposalVotes[proposalId];\n\n if (proposalVote.hasVoted[account]) {\n revert GovernorAlreadyCastVote(account);\n }\n proposalVote.hasVoted[account] = true;\n\n if (support == uint8(VoteType.Against)) {\n proposalVote.againstVotes += totalWeight;\n } else if (support == uint8(VoteType.For)) {\n proposalVote.forVotes += totalWeight;\n } else if (support == uint8(VoteType.Abstain)) {\n proposalVote.abstainVotes += totalWeight;\n } else {\n revert GovernorInvalidVoteType();\n }\n\n return totalWeight;\n }\n}\n" + }, + "@openzeppelin/contracts/governance/extensions/GovernorSettings.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (governance/extensions/GovernorSettings.sol)\n\npragma solidity ^0.8.20;\n\nimport {Governor} from \"../Governor.sol\";\n\n/**\n * @dev Extension of {Governor} for settings updatable through governance.\n */\nabstract contract GovernorSettings is Governor {\n // amount of token\n uint256 private _proposalThreshold;\n // timepoint: limited to uint48 in core (same as clock() type)\n uint48 private _votingDelay;\n // duration: limited to uint32 in core\n uint32 private _votingPeriod;\n\n event VotingDelaySet(uint256 oldVotingDelay, uint256 newVotingDelay);\n event VotingPeriodSet(uint256 oldVotingPeriod, uint256 newVotingPeriod);\n event ProposalThresholdSet(uint256 oldProposalThreshold, uint256 newProposalThreshold);\n\n /**\n * @dev Initialize the governance parameters.\n */\n constructor(uint48 initialVotingDelay, uint32 initialVotingPeriod, uint256 initialProposalThreshold) {\n _setVotingDelay(initialVotingDelay);\n _setVotingPeriod(initialVotingPeriod);\n _setProposalThreshold(initialProposalThreshold);\n }\n\n /**\n * @dev See {IGovernor-votingDelay}.\n */\n function votingDelay() public view virtual override returns (uint256) {\n return _votingDelay;\n }\n\n /**\n * @dev See {IGovernor-votingPeriod}.\n */\n function votingPeriod() public view virtual override returns (uint256) {\n return _votingPeriod;\n }\n\n /**\n * @dev See {Governor-proposalThreshold}.\n */\n function proposalThreshold() public view virtual override returns (uint256) {\n return _proposalThreshold;\n }\n\n /**\n * @dev Update the voting delay. This operation can only be performed through a governance proposal.\n *\n * Emits a {VotingDelaySet} event.\n */\n function setVotingDelay(uint48 newVotingDelay) public virtual onlyGovernance {\n _setVotingDelay(newVotingDelay);\n }\n\n /**\n * @dev Update the voting period. This operation can only be performed through a governance proposal.\n *\n * Emits a {VotingPeriodSet} event.\n */\n function setVotingPeriod(uint32 newVotingPeriod) public virtual onlyGovernance {\n _setVotingPeriod(newVotingPeriod);\n }\n\n /**\n * @dev Update the proposal threshold. This operation can only be performed through a governance proposal.\n *\n * Emits a {ProposalThresholdSet} event.\n */\n function setProposalThreshold(uint256 newProposalThreshold) public virtual onlyGovernance {\n _setProposalThreshold(newProposalThreshold);\n }\n\n /**\n * @dev Internal setter for the voting delay.\n *\n * Emits a {VotingDelaySet} event.\n */\n function _setVotingDelay(uint48 newVotingDelay) internal virtual {\n emit VotingDelaySet(_votingDelay, newVotingDelay);\n _votingDelay = newVotingDelay;\n }\n\n /**\n * @dev Internal setter for the voting period.\n *\n * Emits a {VotingPeriodSet} event.\n */\n function _setVotingPeriod(uint32 newVotingPeriod) internal virtual {\n if (newVotingPeriod == 0) {\n revert GovernorInvalidVotingPeriod(0);\n }\n emit VotingPeriodSet(_votingPeriod, newVotingPeriod);\n _votingPeriod = newVotingPeriod;\n }\n\n /**\n * @dev Internal setter for the proposal threshold.\n *\n * Emits a {ProposalThresholdSet} event.\n */\n function _setProposalThreshold(uint256 newProposalThreshold) internal virtual {\n emit ProposalThresholdSet(_proposalThreshold, newProposalThreshold);\n _proposalThreshold = newProposalThreshold;\n }\n}\n" + }, + "@openzeppelin/contracts/governance/extensions/GovernorVotes.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (governance/extensions/GovernorVotes.sol)\n\npragma solidity ^0.8.20;\n\nimport {Governor} from \"../Governor.sol\";\nimport {IVotes} from \"../utils/IVotes.sol\";\nimport {IERC5805} from \"../../interfaces/IERC5805.sol\";\nimport {SafeCast} from \"../../utils/math/SafeCast.sol\";\nimport {Time} from \"../../utils/types/Time.sol\";\n\n/**\n * @dev Extension of {Governor} for voting weight extraction from an {ERC20Votes} token, or since v4.5 an {ERC721Votes}\n * token.\n */\nabstract contract GovernorVotes is Governor {\n IERC5805 private immutable _token;\n\n constructor(IVotes tokenAddress) {\n _token = IERC5805(address(tokenAddress));\n }\n\n /**\n * @dev The token that voting power is sourced from.\n */\n function token() public view virtual returns (IERC5805) {\n return _token;\n }\n\n /**\n * @dev Clock (as specified in ERC-6372) is set to match the token's clock. Fallback to block numbers if the token\n * does not implement ERC-6372.\n */\n function clock() public view virtual override returns (uint48) {\n try token().clock() returns (uint48 timepoint) {\n return timepoint;\n } catch {\n return Time.blockNumber();\n }\n }\n\n /**\n * @dev Machine-readable description of the clock as specified in ERC-6372.\n */\n // solhint-disable-next-line func-name-mixedcase\n function CLOCK_MODE() public view virtual override returns (string memory) {\n try token().CLOCK_MODE() returns (string memory clockmode) {\n return clockmode;\n } catch {\n return \"mode=blocknumber&from=default\";\n }\n }\n\n /**\n * Read the voting weight from the token's built in snapshot mechanism (see {Governor-_getVotes}).\n */\n function _getVotes(\n address account,\n uint256 timepoint,\n bytes memory /*params*/\n ) internal view virtual override returns (uint256) {\n return token().getPastVotes(account, timepoint);\n }\n}\n" + }, + "@openzeppelin/contracts/governance/extensions/GovernorVotesQuorumFraction.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (governance/extensions/GovernorVotesQuorumFraction.sol)\n\npragma solidity ^0.8.20;\n\nimport {GovernorVotes} from \"./GovernorVotes.sol\";\nimport {SafeCast} from \"../../utils/math/SafeCast.sol\";\nimport {Checkpoints} from \"../../utils/structs/Checkpoints.sol\";\n\n/**\n * @dev Extension of {Governor} for voting weight extraction from an {ERC20Votes} token and a quorum expressed as a\n * fraction of the total supply.\n */\nabstract contract GovernorVotesQuorumFraction is GovernorVotes {\n using Checkpoints for Checkpoints.Trace208;\n\n Checkpoints.Trace208 private _quorumNumeratorHistory;\n\n event QuorumNumeratorUpdated(uint256 oldQuorumNumerator, uint256 newQuorumNumerator);\n\n /**\n * @dev The quorum set is not a valid fraction.\n */\n error GovernorInvalidQuorumFraction(uint256 quorumNumerator, uint256 quorumDenominator);\n\n /**\n * @dev Initialize quorum as a fraction of the token's total supply.\n *\n * The fraction is specified as `numerator / denominator`. By default the denominator is 100, so quorum is\n * specified as a percent: a numerator of 10 corresponds to quorum being 10% of total supply. The denominator can be\n * customized by overriding {quorumDenominator}.\n */\n constructor(uint256 quorumNumeratorValue) {\n _updateQuorumNumerator(quorumNumeratorValue);\n }\n\n /**\n * @dev Returns the current quorum numerator. See {quorumDenominator}.\n */\n function quorumNumerator() public view virtual returns (uint256) {\n return _quorumNumeratorHistory.latest();\n }\n\n /**\n * @dev Returns the quorum numerator at a specific timepoint. See {quorumDenominator}.\n */\n function quorumNumerator(uint256 timepoint) public view virtual returns (uint256) {\n uint256 length = _quorumNumeratorHistory._checkpoints.length;\n\n // Optimistic search, check the latest checkpoint\n Checkpoints.Checkpoint208 storage latest = _quorumNumeratorHistory._checkpoints[length - 1];\n uint48 latestKey = latest._key;\n uint208 latestValue = latest._value;\n if (latestKey <= timepoint) {\n return latestValue;\n }\n\n // Otherwise, do the binary search\n return _quorumNumeratorHistory.upperLookupRecent(SafeCast.toUint48(timepoint));\n }\n\n /**\n * @dev Returns the quorum denominator. Defaults to 100, but may be overridden.\n */\n function quorumDenominator() public view virtual returns (uint256) {\n return 100;\n }\n\n /**\n * @dev Returns the quorum for a timepoint, in terms of number of votes: `supply * numerator / denominator`.\n */\n function quorum(uint256 timepoint) public view virtual override returns (uint256) {\n return (token().getPastTotalSupply(timepoint) * quorumNumerator(timepoint)) / quorumDenominator();\n }\n\n /**\n * @dev Changes the quorum numerator.\n *\n * Emits a {QuorumNumeratorUpdated} event.\n *\n * Requirements:\n *\n * - Must be called through a governance proposal.\n * - New numerator must be smaller or equal to the denominator.\n */\n function updateQuorumNumerator(uint256 newQuorumNumerator) external virtual onlyGovernance {\n _updateQuorumNumerator(newQuorumNumerator);\n }\n\n /**\n * @dev Changes the quorum numerator.\n *\n * Emits a {QuorumNumeratorUpdated} event.\n *\n * Requirements:\n *\n * - New numerator must be smaller or equal to the denominator.\n */\n function _updateQuorumNumerator(uint256 newQuorumNumerator) internal virtual {\n uint256 denominator = quorumDenominator();\n if (newQuorumNumerator > denominator) {\n revert GovernorInvalidQuorumFraction(newQuorumNumerator, denominator);\n }\n\n uint256 oldQuorumNumerator = quorumNumerator();\n _quorumNumeratorHistory.push(clock(), SafeCast.toUint208(newQuorumNumerator));\n\n emit QuorumNumeratorUpdated(oldQuorumNumerator, newQuorumNumerator);\n }\n}\n" + }, + "@openzeppelin/contracts/governance/Governor.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (governance/Governor.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC721Receiver} from \"../token/ERC721/IERC721Receiver.sol\";\nimport {IERC1155Receiver} from \"../token/ERC1155/IERC1155Receiver.sol\";\nimport {EIP712} from \"../utils/cryptography/EIP712.sol\";\nimport {SignatureChecker} from \"../utils/cryptography/SignatureChecker.sol\";\nimport {IERC165, ERC165} from \"../utils/introspection/ERC165.sol\";\nimport {SafeCast} from \"../utils/math/SafeCast.sol\";\nimport {DoubleEndedQueue} from \"../utils/structs/DoubleEndedQueue.sol\";\nimport {Address} from \"../utils/Address.sol\";\nimport {Context} from \"../utils/Context.sol\";\nimport {Nonces} from \"../utils/Nonces.sol\";\nimport {IGovernor, IERC6372} from \"./IGovernor.sol\";\n\n/**\n * @dev Core of the governance system, designed to be extended through various modules.\n *\n * This contract is abstract and requires several functions to be implemented in various modules:\n *\n * - A counting module must implement {quorum}, {_quorumReached}, {_voteSucceeded} and {_countVote}\n * - A voting module must implement {_getVotes}\n * - Additionally, {votingPeriod} must also be implemented\n */\nabstract contract Governor is Context, ERC165, EIP712, Nonces, IGovernor, IERC721Receiver, IERC1155Receiver {\n using DoubleEndedQueue for DoubleEndedQueue.Bytes32Deque;\n\n bytes32 public constant BALLOT_TYPEHASH =\n keccak256(\"Ballot(uint256 proposalId,uint8 support,address voter,uint256 nonce)\");\n bytes32 public constant EXTENDED_BALLOT_TYPEHASH =\n keccak256(\n \"ExtendedBallot(uint256 proposalId,uint8 support,address voter,uint256 nonce,string reason,bytes params)\"\n );\n\n struct ProposalCore {\n address proposer;\n uint48 voteStart;\n uint32 voteDuration;\n bool executed;\n bool canceled;\n uint48 etaSeconds;\n }\n\n bytes32 private constant ALL_PROPOSAL_STATES_BITMAP = bytes32((2 ** (uint8(type(ProposalState).max) + 1)) - 1);\n string private _name;\n\n mapping(uint256 proposalId => ProposalCore) private _proposals;\n\n // This queue keeps track of the governor operating on itself. Calls to functions protected by the {onlyGovernance}\n // modifier needs to be whitelisted in this queue. Whitelisting is set in {execute}, consumed by the\n // {onlyGovernance} modifier and eventually reset after {_executeOperations} completes. This ensures that the\n // execution of {onlyGovernance} protected calls can only be achieved through successful proposals.\n DoubleEndedQueue.Bytes32Deque private _governanceCall;\n\n /**\n * @dev Restricts a function so it can only be executed through governance proposals. For example, governance\n * parameter setters in {GovernorSettings} are protected using this modifier.\n *\n * The governance executing address may be different from the Governor's own address, for example it could be a\n * timelock. This can be customized by modules by overriding {_executor}. The executor is only able to invoke these\n * functions during the execution of the governor's {execute} function, and not under any other circumstances. Thus,\n * for example, additional timelock proposers are not able to change governance parameters without going through the\n * governance protocol (since v4.6).\n */\n modifier onlyGovernance() {\n _checkGovernance();\n _;\n }\n\n /**\n * @dev Sets the value for {name} and {version}\n */\n constructor(string memory name_) EIP712(name_, version()) {\n _name = name_;\n }\n\n /**\n * @dev Function to receive ETH that will be handled by the governor (disabled if executor is a third party contract)\n */\n receive() external payable virtual {\n if (_executor() != address(this)) {\n revert GovernorDisabledDeposit();\n }\n }\n\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165, ERC165) returns (bool) {\n return\n interfaceId == type(IGovernor).interfaceId ||\n interfaceId == type(IERC1155Receiver).interfaceId ||\n super.supportsInterface(interfaceId);\n }\n\n /**\n * @dev See {IGovernor-name}.\n */\n function name() public view virtual returns (string memory) {\n return _name;\n }\n\n /**\n * @dev See {IGovernor-version}.\n */\n function version() public view virtual returns (string memory) {\n return \"1\";\n }\n\n /**\n * @dev See {IGovernor-hashProposal}.\n *\n * The proposal id is produced by hashing the ABI encoded `targets` array, the `values` array, the `calldatas` array\n * and the descriptionHash (bytes32 which itself is the keccak256 hash of the description string). This proposal id\n * can be produced from the proposal data which is part of the {ProposalCreated} event. It can even be computed in\n * advance, before the proposal is submitted.\n *\n * Note that the chainId and the governor address are not part of the proposal id computation. Consequently, the\n * same proposal (with same operation and same description) will have the same id if submitted on multiple governors\n * across multiple networks. This also means that in order to execute the same operation twice (on the same\n * governor) the proposer will have to change the description in order to avoid proposal id conflicts.\n */\n function hashProposal(\n address[] memory targets,\n uint256[] memory values,\n bytes[] memory calldatas,\n bytes32 descriptionHash\n ) public pure virtual returns (uint256) {\n return uint256(keccak256(abi.encode(targets, values, calldatas, descriptionHash)));\n }\n\n /**\n * @dev See {IGovernor-state}.\n */\n function state(uint256 proposalId) public view virtual returns (ProposalState) {\n // We read the struct fields into the stack at once so Solidity emits a single SLOAD\n ProposalCore storage proposal = _proposals[proposalId];\n bool proposalExecuted = proposal.executed;\n bool proposalCanceled = proposal.canceled;\n\n if (proposalExecuted) {\n return ProposalState.Executed;\n }\n\n if (proposalCanceled) {\n return ProposalState.Canceled;\n }\n\n uint256 snapshot = proposalSnapshot(proposalId);\n\n if (snapshot == 0) {\n revert GovernorNonexistentProposal(proposalId);\n }\n\n uint256 currentTimepoint = clock();\n\n if (snapshot >= currentTimepoint) {\n return ProposalState.Pending;\n }\n\n uint256 deadline = proposalDeadline(proposalId);\n\n if (deadline >= currentTimepoint) {\n return ProposalState.Active;\n } else if (!_quorumReached(proposalId) || !_voteSucceeded(proposalId)) {\n return ProposalState.Defeated;\n } else if (proposalEta(proposalId) == 0) {\n return ProposalState.Succeeded;\n } else {\n return ProposalState.Queued;\n }\n }\n\n /**\n * @dev See {IGovernor-proposalThreshold}.\n */\n function proposalThreshold() public view virtual returns (uint256) {\n return 0;\n }\n\n /**\n * @dev See {IGovernor-proposalSnapshot}.\n */\n function proposalSnapshot(uint256 proposalId) public view virtual returns (uint256) {\n return _proposals[proposalId].voteStart;\n }\n\n /**\n * @dev See {IGovernor-proposalDeadline}.\n */\n function proposalDeadline(uint256 proposalId) public view virtual returns (uint256) {\n return _proposals[proposalId].voteStart + _proposals[proposalId].voteDuration;\n }\n\n /**\n * @dev See {IGovernor-proposalProposer}.\n */\n function proposalProposer(uint256 proposalId) public view virtual returns (address) {\n return _proposals[proposalId].proposer;\n }\n\n /**\n * @dev See {IGovernor-proposalEta}.\n */\n function proposalEta(uint256 proposalId) public view virtual returns (uint256) {\n return _proposals[proposalId].etaSeconds;\n }\n\n /**\n * @dev See {IGovernor-proposalNeedsQueuing}.\n */\n function proposalNeedsQueuing(uint256) public view virtual returns (bool) {\n return false;\n }\n\n /**\n * @dev Reverts if the `msg.sender` is not the executor. In case the executor is not this contract\n * itself, the function reverts if `msg.data` is not whitelisted as a result of an {execute}\n * operation. See {onlyGovernance}.\n */\n function _checkGovernance() internal virtual {\n if (_executor() != _msgSender()) {\n revert GovernorOnlyExecutor(_msgSender());\n }\n if (_executor() != address(this)) {\n bytes32 msgDataHash = keccak256(_msgData());\n // loop until popping the expected operation - throw if deque is empty (operation not authorized)\n while (_governanceCall.popFront() != msgDataHash) {}\n }\n }\n\n /**\n * @dev Amount of votes already cast passes the threshold limit.\n */\n function _quorumReached(uint256 proposalId) internal view virtual returns (bool);\n\n /**\n * @dev Is the proposal successful or not.\n */\n function _voteSucceeded(uint256 proposalId) internal view virtual returns (bool);\n\n /**\n * @dev Get the voting weight of `account` at a specific `timepoint`, for a vote as described by `params`.\n */\n function _getVotes(address account, uint256 timepoint, bytes memory params) internal view virtual returns (uint256);\n\n /**\n * @dev Register a vote for `proposalId` by `account` with a given `support`, voting `weight` and voting `params`.\n *\n * Note: Support is generic and can represent various things depending on the voting system used.\n */\n function _countVote(\n uint256 proposalId,\n address account,\n uint8 support,\n uint256 totalWeight,\n bytes memory params\n ) internal virtual returns (uint256);\n\n /**\n * @dev Default additional encoded parameters used by castVote methods that don't include them\n *\n * Note: Should be overridden by specific implementations to use an appropriate value, the\n * meaning of the additional params, in the context of that implementation\n */\n function _defaultParams() internal view virtual returns (bytes memory) {\n return \"\";\n }\n\n /**\n * @dev See {IGovernor-propose}. This function has opt-in frontrunning protection, described in {_isValidDescriptionForProposer}.\n */\n function propose(\n address[] memory targets,\n uint256[] memory values,\n bytes[] memory calldatas,\n string memory description\n ) public virtual returns (uint256) {\n address proposer = _msgSender();\n\n // check description restriction\n if (!_isValidDescriptionForProposer(proposer, description)) {\n revert GovernorRestrictedProposer(proposer);\n }\n\n // check proposal threshold\n uint256 votesThreshold = proposalThreshold();\n if (votesThreshold > 0) {\n uint256 proposerVotes = getVotes(proposer, clock() - 1);\n if (proposerVotes < votesThreshold) {\n revert GovernorInsufficientProposerVotes(proposer, proposerVotes, votesThreshold);\n }\n }\n\n return _propose(targets, values, calldatas, description, proposer);\n }\n\n /**\n * @dev Internal propose mechanism. Can be overridden to add more logic on proposal creation.\n *\n * Emits a {IGovernor-ProposalCreated} event.\n */\n function _propose(\n address[] memory targets,\n uint256[] memory values,\n bytes[] memory calldatas,\n string memory description,\n address proposer\n ) internal virtual returns (uint256 proposalId) {\n proposalId = hashProposal(targets, values, calldatas, keccak256(bytes(description)));\n\n if (targets.length != values.length || targets.length != calldatas.length || targets.length == 0) {\n revert GovernorInvalidProposalLength(targets.length, calldatas.length, values.length);\n }\n if (_proposals[proposalId].voteStart != 0) {\n revert GovernorUnexpectedProposalState(proposalId, state(proposalId), bytes32(0));\n }\n\n uint256 snapshot = clock() + votingDelay();\n uint256 duration = votingPeriod();\n\n ProposalCore storage proposal = _proposals[proposalId];\n proposal.proposer = proposer;\n proposal.voteStart = SafeCast.toUint48(snapshot);\n proposal.voteDuration = SafeCast.toUint32(duration);\n\n emit ProposalCreated(\n proposalId,\n proposer,\n targets,\n values,\n new string[](targets.length),\n calldatas,\n snapshot,\n snapshot + duration,\n description\n );\n\n // Using a named return variable to avoid stack too deep errors\n }\n\n /**\n * @dev See {IGovernor-queue}.\n */\n function queue(\n address[] memory targets,\n uint256[] memory values,\n bytes[] memory calldatas,\n bytes32 descriptionHash\n ) public virtual returns (uint256) {\n uint256 proposalId = hashProposal(targets, values, calldatas, descriptionHash);\n\n _validateStateBitmap(proposalId, _encodeStateBitmap(ProposalState.Succeeded));\n\n uint48 etaSeconds = _queueOperations(proposalId, targets, values, calldatas, descriptionHash);\n\n if (etaSeconds != 0) {\n _proposals[proposalId].etaSeconds = etaSeconds;\n emit ProposalQueued(proposalId, etaSeconds);\n } else {\n revert GovernorQueueNotImplemented();\n }\n\n return proposalId;\n }\n\n /**\n * @dev Internal queuing mechanism. Can be overridden (without a super call) to modify the way queuing is\n * performed (for example adding a vault/timelock).\n *\n * This is empty by default, and must be overridden to implement queuing.\n *\n * This function returns a timestamp that describes the expected ETA for execution. If the returned value is 0\n * (which is the default value), the core will consider queueing did not succeed, and the public {queue} function\n * will revert.\n *\n * NOTE: Calling this function directly will NOT check the current state of the proposal, or emit the\n * `ProposalQueued` event. Queuing a proposal should be done using {queue}.\n */\n function _queueOperations(\n uint256 /*proposalId*/,\n address[] memory /*targets*/,\n uint256[] memory /*values*/,\n bytes[] memory /*calldatas*/,\n bytes32 /*descriptionHash*/\n ) internal virtual returns (uint48) {\n return 0;\n }\n\n /**\n * @dev See {IGovernor-execute}.\n */\n function execute(\n address[] memory targets,\n uint256[] memory values,\n bytes[] memory calldatas,\n bytes32 descriptionHash\n ) public payable virtual returns (uint256) {\n uint256 proposalId = hashProposal(targets, values, calldatas, descriptionHash);\n\n _validateStateBitmap(\n proposalId,\n _encodeStateBitmap(ProposalState.Succeeded) | _encodeStateBitmap(ProposalState.Queued)\n );\n\n // mark as executed before calls to avoid reentrancy\n _proposals[proposalId].executed = true;\n\n // before execute: register governance call in queue.\n if (_executor() != address(this)) {\n for (uint256 i = 0; i < targets.length; ++i) {\n if (targets[i] == address(this)) {\n _governanceCall.pushBack(keccak256(calldatas[i]));\n }\n }\n }\n\n _executeOperations(proposalId, targets, values, calldatas, descriptionHash);\n\n // after execute: cleanup governance call queue.\n if (_executor() != address(this) && !_governanceCall.empty()) {\n _governanceCall.clear();\n }\n\n emit ProposalExecuted(proposalId);\n\n return proposalId;\n }\n\n /**\n * @dev Internal execution mechanism. Can be overridden (without a super call) to modify the way execution is\n * performed (for example adding a vault/timelock).\n *\n * NOTE: Calling this function directly will NOT check the current state of the proposal, set the executed flag to\n * true or emit the `ProposalExecuted` event. Executing a proposal should be done using {execute} or {_execute}.\n */\n function _executeOperations(\n uint256 /* proposalId */,\n address[] memory targets,\n uint256[] memory values,\n bytes[] memory calldatas,\n bytes32 /*descriptionHash*/\n ) internal virtual {\n for (uint256 i = 0; i < targets.length; ++i) {\n (bool success, bytes memory returndata) = targets[i].call{value: values[i]}(calldatas[i]);\n Address.verifyCallResult(success, returndata);\n }\n }\n\n /**\n * @dev See {IGovernor-cancel}.\n */\n function cancel(\n address[] memory targets,\n uint256[] memory values,\n bytes[] memory calldatas,\n bytes32 descriptionHash\n ) public virtual returns (uint256) {\n // The proposalId will be recomputed in the `_cancel` call further down. However we need the value before we\n // do the internal call, because we need to check the proposal state BEFORE the internal `_cancel` call\n // changes it. The `hashProposal` duplication has a cost that is limited, and that we accept.\n uint256 proposalId = hashProposal(targets, values, calldatas, descriptionHash);\n\n // public cancel restrictions (on top of existing _cancel restrictions).\n _validateStateBitmap(proposalId, _encodeStateBitmap(ProposalState.Pending));\n if (_msgSender() != proposalProposer(proposalId)) {\n revert GovernorOnlyProposer(_msgSender());\n }\n\n return _cancel(targets, values, calldatas, descriptionHash);\n }\n\n /**\n * @dev Internal cancel mechanism with minimal restrictions. A proposal can be cancelled in any state other than\n * Canceled, Expired, or Executed. Once cancelled a proposal can't be re-submitted.\n *\n * Emits a {IGovernor-ProposalCanceled} event.\n */\n function _cancel(\n address[] memory targets,\n uint256[] memory values,\n bytes[] memory calldatas,\n bytes32 descriptionHash\n ) internal virtual returns (uint256) {\n uint256 proposalId = hashProposal(targets, values, calldatas, descriptionHash);\n\n _validateStateBitmap(\n proposalId,\n ALL_PROPOSAL_STATES_BITMAP ^\n _encodeStateBitmap(ProposalState.Canceled) ^\n _encodeStateBitmap(ProposalState.Expired) ^\n _encodeStateBitmap(ProposalState.Executed)\n );\n\n _proposals[proposalId].canceled = true;\n emit ProposalCanceled(proposalId);\n\n return proposalId;\n }\n\n /**\n * @dev See {IGovernor-getVotes}.\n */\n function getVotes(address account, uint256 timepoint) public view virtual returns (uint256) {\n return _getVotes(account, timepoint, _defaultParams());\n }\n\n /**\n * @dev See {IGovernor-getVotesWithParams}.\n */\n function getVotesWithParams(\n address account,\n uint256 timepoint,\n bytes memory params\n ) public view virtual returns (uint256) {\n return _getVotes(account, timepoint, params);\n }\n\n /**\n * @dev See {IGovernor-castVote}.\n */\n function castVote(uint256 proposalId, uint8 support) public virtual returns (uint256) {\n address voter = _msgSender();\n return _castVote(proposalId, voter, support, \"\");\n }\n\n /**\n * @dev See {IGovernor-castVoteWithReason}.\n */\n function castVoteWithReason(\n uint256 proposalId,\n uint8 support,\n string calldata reason\n ) public virtual returns (uint256) {\n address voter = _msgSender();\n return _castVote(proposalId, voter, support, reason);\n }\n\n /**\n * @dev See {IGovernor-castVoteWithReasonAndParams}.\n */\n function castVoteWithReasonAndParams(\n uint256 proposalId,\n uint8 support,\n string calldata reason,\n bytes memory params\n ) public virtual returns (uint256) {\n address voter = _msgSender();\n return _castVote(proposalId, voter, support, reason, params);\n }\n\n /**\n * @dev See {IGovernor-castVoteBySig}.\n */\n function castVoteBySig(\n uint256 proposalId,\n uint8 support,\n address voter,\n bytes memory signature\n ) public virtual returns (uint256) {\n bool valid = SignatureChecker.isValidSignatureNow(\n voter,\n _hashTypedDataV4(keccak256(abi.encode(BALLOT_TYPEHASH, proposalId, support, voter, _useNonce(voter)))),\n signature\n );\n\n if (!valid) {\n revert GovernorInvalidSignature(voter);\n }\n\n return _castVote(proposalId, voter, support, \"\");\n }\n\n /**\n * @dev See {IGovernor-castVoteWithReasonAndParamsBySig}.\n */\n function castVoteWithReasonAndParamsBySig(\n uint256 proposalId,\n uint8 support,\n address voter,\n string calldata reason,\n bytes memory params,\n bytes memory signature\n ) public virtual returns (uint256) {\n bool valid = SignatureChecker.isValidSignatureNow(\n voter,\n _hashTypedDataV4(\n keccak256(\n abi.encode(\n EXTENDED_BALLOT_TYPEHASH,\n proposalId,\n support,\n voter,\n _useNonce(voter),\n keccak256(bytes(reason)),\n keccak256(params)\n )\n )\n ),\n signature\n );\n\n if (!valid) {\n revert GovernorInvalidSignature(voter);\n }\n\n return _castVote(proposalId, voter, support, reason, params);\n }\n\n /**\n * @dev Internal vote casting mechanism: Check that the vote is pending, that it has not been cast yet, retrieve\n * voting weight using {IGovernor-getVotes} and call the {_countVote} internal function. Uses the _defaultParams().\n *\n * Emits a {IGovernor-VoteCast} event.\n */\n function _castVote(\n uint256 proposalId,\n address account,\n uint8 support,\n string memory reason\n ) internal virtual returns (uint256) {\n return _castVote(proposalId, account, support, reason, _defaultParams());\n }\n\n /**\n * @dev Internal vote casting mechanism: Check that the vote is pending, that it has not been cast yet, retrieve\n * voting weight using {IGovernor-getVotes} and call the {_countVote} internal function.\n *\n * Emits a {IGovernor-VoteCast} event.\n */\n function _castVote(\n uint256 proposalId,\n address account,\n uint8 support,\n string memory reason,\n bytes memory params\n ) internal virtual returns (uint256) {\n _validateStateBitmap(proposalId, _encodeStateBitmap(ProposalState.Active));\n\n uint256 totalWeight = _getVotes(account, proposalSnapshot(proposalId), params);\n uint256 votedWeight = _countVote(proposalId, account, support, totalWeight, params);\n\n if (params.length == 0) {\n emit VoteCast(account, proposalId, support, votedWeight, reason);\n } else {\n emit VoteCastWithParams(account, proposalId, support, votedWeight, reason, params);\n }\n\n return votedWeight;\n }\n\n /**\n * @dev Relays a transaction or function call to an arbitrary target. In cases where the governance executor\n * is some contract other than the governor itself, like when using a timelock, this function can be invoked\n * in a governance proposal to recover tokens or Ether that was sent to the governor contract by mistake.\n * Note that if the executor is simply the governor itself, use of `relay` is redundant.\n */\n function relay(address target, uint256 value, bytes calldata data) external payable virtual onlyGovernance {\n (bool success, bytes memory returndata) = target.call{value: value}(data);\n Address.verifyCallResult(success, returndata);\n }\n\n /**\n * @dev Address through which the governor executes action. Will be overloaded by module that execute actions\n * through another contract such as a timelock.\n */\n function _executor() internal view virtual returns (address) {\n return address(this);\n }\n\n /**\n * @dev See {IERC721Receiver-onERC721Received}.\n * Receiving tokens is disabled if the governance executor is other than the governor itself (eg. when using with a timelock).\n */\n function onERC721Received(address, address, uint256, bytes memory) public virtual returns (bytes4) {\n if (_executor() != address(this)) {\n revert GovernorDisabledDeposit();\n }\n return this.onERC721Received.selector;\n }\n\n /**\n * @dev See {IERC1155Receiver-onERC1155Received}.\n * Receiving tokens is disabled if the governance executor is other than the governor itself (eg. when using with a timelock).\n */\n function onERC1155Received(address, address, uint256, uint256, bytes memory) public virtual returns (bytes4) {\n if (_executor() != address(this)) {\n revert GovernorDisabledDeposit();\n }\n return this.onERC1155Received.selector;\n }\n\n /**\n * @dev See {IERC1155Receiver-onERC1155BatchReceived}.\n * Receiving tokens is disabled if the governance executor is other than the governor itself (eg. when using with a timelock).\n */\n function onERC1155BatchReceived(\n address,\n address,\n uint256[] memory,\n uint256[] memory,\n bytes memory\n ) public virtual returns (bytes4) {\n if (_executor() != address(this)) {\n revert GovernorDisabledDeposit();\n }\n return this.onERC1155BatchReceived.selector;\n }\n\n /**\n * @dev Encodes a `ProposalState` into a `bytes32` representation where each bit enabled corresponds to\n * the underlying position in the `ProposalState` enum. For example:\n *\n * 0x000...10000\n * ^^^^^^------ ...\n * ^----- Succeeded\n * ^---- Defeated\n * ^--- Canceled\n * ^-- Active\n * ^- Pending\n */\n function _encodeStateBitmap(ProposalState proposalState) internal pure returns (bytes32) {\n return bytes32(1 << uint8(proposalState));\n }\n\n /**\n * @dev Check that the current state of a proposal matches the requirements described by the `allowedStates` bitmap.\n * This bitmap should be built using `_encodeStateBitmap`.\n *\n * If requirements are not met, reverts with a {GovernorUnexpectedProposalState} error.\n */\n function _validateStateBitmap(uint256 proposalId, bytes32 allowedStates) private view returns (ProposalState) {\n ProposalState currentState = state(proposalId);\n if (_encodeStateBitmap(currentState) & allowedStates == bytes32(0)) {\n revert GovernorUnexpectedProposalState(proposalId, currentState, allowedStates);\n }\n return currentState;\n }\n\n /*\n * @dev Check if the proposer is authorized to submit a proposal with the given description.\n *\n * If the proposal description ends with `#proposer=0x???`, where `0x???` is an address written as a hex string\n * (case insensitive), then the submission of this proposal will only be authorized to said address.\n *\n * This is used for frontrunning protection. By adding this pattern at the end of their proposal, one can ensure\n * that no other address can submit the same proposal. An attacker would have to either remove or change that part,\n * which would result in a different proposal id.\n *\n * If the description does not match this pattern, it is unrestricted and anyone can submit it. This includes:\n * - If the `0x???` part is not a valid hex string.\n * - If the `0x???` part is a valid hex string, but does not contain exactly 40 hex digits.\n * - If it ends with the expected suffix followed by newlines or other whitespace.\n * - If it ends with some other similar suffix, e.g. `#other=abc`.\n * - If it does not end with any such suffix.\n */\n function _isValidDescriptionForProposer(\n address proposer,\n string memory description\n ) internal view virtual returns (bool) {\n uint256 len = bytes(description).length;\n\n // Length is too short to contain a valid proposer suffix\n if (len < 52) {\n return true;\n }\n\n // Extract what would be the `#proposer=0x` marker beginning the suffix\n bytes12 marker;\n assembly (\"memory-safe\") {\n // - Start of the string contents in memory = description + 32\n // - First character of the marker = len - 52\n // - Length of \"#proposer=0x0000000000000000000000000000000000000000\" = 52\n // - We read the memory word starting at the first character of the marker:\n // - (description + 32) + (len - 52) = description + (len - 20)\n // - Note: Solidity will ignore anything past the first 12 bytes\n marker := mload(add(description, sub(len, 20)))\n }\n\n // If the marker is not found, there is no proposer suffix to check\n if (marker != bytes12(\"#proposer=0x\")) {\n return true;\n }\n\n // Parse the 40 characters following the marker as uint160\n uint160 recovered = 0;\n for (uint256 i = len - 40; i < len; ++i) {\n (bool isHex, uint8 value) = _tryHexToUint(bytes(description)[i]);\n // If any of the characters is not a hex digit, ignore the suffix entirely\n if (!isHex) {\n return true;\n }\n recovered = (recovered << 4) | value;\n }\n\n return recovered == uint160(proposer);\n }\n\n /**\n * @dev Try to parse a character from a string as a hex value. Returns `(true, value)` if the char is in\n * `[0-9a-fA-F]` and `(false, 0)` otherwise. Value is guaranteed to be in the range `0 <= value < 16`\n */\n function _tryHexToUint(bytes1 char) private pure returns (bool isHex, uint8 value) {\n uint8 c = uint8(char);\n unchecked {\n // Case 0-9\n if (47 < c && c < 58) {\n return (true, c - 48);\n }\n // Case A-F\n else if (64 < c && c < 71) {\n return (true, c - 55);\n }\n // Case a-f\n else if (96 < c && c < 103) {\n return (true, c - 87);\n }\n // Else: not a hex char\n else {\n return (false, 0);\n }\n }\n }\n\n /**\n * @inheritdoc IERC6372\n */\n function clock() public view virtual returns (uint48);\n\n /**\n * @inheritdoc IERC6372\n */\n // solhint-disable-next-line func-name-mixedcase\n function CLOCK_MODE() public view virtual returns (string memory);\n\n /**\n * @inheritdoc IGovernor\n */\n function votingDelay() public view virtual returns (uint256);\n\n /**\n * @inheritdoc IGovernor\n */\n function votingPeriod() public view virtual returns (uint256);\n\n /**\n * @inheritdoc IGovernor\n */\n function quorum(uint256 timepoint) public view virtual returns (uint256);\n}\n" + }, + "@openzeppelin/contracts/governance/IGovernor.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (governance/IGovernor.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC165} from \"../interfaces/IERC165.sol\";\nimport {IERC6372} from \"../interfaces/IERC6372.sol\";\n\n/**\n * @dev Interface of the {Governor} core.\n *\n * NOTE: Event parameters lack the `indexed` keyword for compatibility with GovernorBravo events.\n * Making event parameters `indexed` affects how events are decoded, potentially breaking existing indexers.\n */\ninterface IGovernor is IERC165, IERC6372 {\n enum ProposalState {\n Pending,\n Active,\n Canceled,\n Defeated,\n Succeeded,\n Queued,\n Expired,\n Executed\n }\n\n /**\n * @dev Empty proposal or a mismatch between the parameters length for a proposal call.\n */\n error GovernorInvalidProposalLength(uint256 targets, uint256 calldatas, uint256 values);\n\n /**\n * @dev The vote was already cast.\n */\n error GovernorAlreadyCastVote(address voter);\n\n /**\n * @dev Token deposits are disabled in this contract.\n */\n error GovernorDisabledDeposit();\n\n /**\n * @dev The `account` is not a proposer.\n */\n error GovernorOnlyProposer(address account);\n\n /**\n * @dev The `account` is not the governance executor.\n */\n error GovernorOnlyExecutor(address account);\n\n /**\n * @dev The `proposalId` doesn't exist.\n */\n error GovernorNonexistentProposal(uint256 proposalId);\n\n /**\n * @dev The current state of a proposal is not the required for performing an operation.\n * The `expectedStates` is a bitmap with the bits enabled for each ProposalState enum position\n * counting from right to left.\n *\n * NOTE: If `expectedState` is `bytes32(0)`, the proposal is expected to not be in any state (i.e. not exist).\n * This is the case when a proposal that is expected to be unset is already initiated (the proposal is duplicated).\n *\n * See {Governor-_encodeStateBitmap}.\n */\n error GovernorUnexpectedProposalState(uint256 proposalId, ProposalState current, bytes32 expectedStates);\n\n /**\n * @dev The voting period set is not a valid period.\n */\n error GovernorInvalidVotingPeriod(uint256 votingPeriod);\n\n /**\n * @dev The `proposer` does not have the required votes to create a proposal.\n */\n error GovernorInsufficientProposerVotes(address proposer, uint256 votes, uint256 threshold);\n\n /**\n * @dev The `proposer` is not allowed to create a proposal.\n */\n error GovernorRestrictedProposer(address proposer);\n\n /**\n * @dev The vote type used is not valid for the corresponding counting module.\n */\n error GovernorInvalidVoteType();\n\n /**\n * @dev The provided params buffer is not supported by the counting module.\n */\n error GovernorInvalidVoteParams();\n\n /**\n * @dev Queue operation is not implemented for this governor. Execute should be called directly.\n */\n error GovernorQueueNotImplemented();\n\n /**\n * @dev The proposal hasn't been queued yet.\n */\n error GovernorNotQueuedProposal(uint256 proposalId);\n\n /**\n * @dev The proposal has already been queued.\n */\n error GovernorAlreadyQueuedProposal(uint256 proposalId);\n\n /**\n * @dev The provided signature is not valid for the expected `voter`.\n * If the `voter` is a contract, the signature is not valid using {IERC1271-isValidSignature}.\n */\n error GovernorInvalidSignature(address voter);\n\n /**\n * @dev Emitted when a proposal is created.\n */\n event ProposalCreated(\n uint256 proposalId,\n address proposer,\n address[] targets,\n uint256[] values,\n string[] signatures,\n bytes[] calldatas,\n uint256 voteStart,\n uint256 voteEnd,\n string description\n );\n\n /**\n * @dev Emitted when a proposal is queued.\n */\n event ProposalQueued(uint256 proposalId, uint256 etaSeconds);\n\n /**\n * @dev Emitted when a proposal is executed.\n */\n event ProposalExecuted(uint256 proposalId);\n\n /**\n * @dev Emitted when a proposal is canceled.\n */\n event ProposalCanceled(uint256 proposalId);\n\n /**\n * @dev Emitted when a vote is cast without params.\n *\n * Note: `support` values should be seen as buckets. Their interpretation depends on the voting module used.\n */\n event VoteCast(address indexed voter, uint256 proposalId, uint8 support, uint256 weight, string reason);\n\n /**\n * @dev Emitted when a vote is cast with params.\n *\n * Note: `support` values should be seen as buckets. Their interpretation depends on the voting module used.\n * `params` are additional encoded parameters. Their interpretation also depends on the voting module used.\n */\n event VoteCastWithParams(\n address indexed voter,\n uint256 proposalId,\n uint8 support,\n uint256 weight,\n string reason,\n bytes params\n );\n\n /**\n * @notice module:core\n * @dev Name of the governor instance (used in building the EIP-712 domain separator).\n */\n function name() external view returns (string memory);\n\n /**\n * @notice module:core\n * @dev Version of the governor instance (used in building the EIP-712 domain separator). Default: \"1\"\n */\n function version() external view returns (string memory);\n\n /**\n * @notice module:voting\n * @dev A description of the possible `support` values for {castVote} and the way these votes are counted, meant to\n * be consumed by UIs to show correct vote options and interpret the results. The string is a URL-encoded sequence of\n * key-value pairs that each describe one aspect, for example `support=bravo&quorum=for,abstain`.\n *\n * There are 2 standard keys: `support` and `quorum`.\n *\n * - `support=bravo` refers to the vote options 0 = Against, 1 = For, 2 = Abstain, as in `GovernorBravo`.\n * - `quorum=bravo` means that only For votes are counted towards quorum.\n * - `quorum=for,abstain` means that both For and Abstain votes are counted towards quorum.\n *\n * If a counting module makes use of encoded `params`, it should include this under a `params` key with a unique\n * name that describes the behavior. For example:\n *\n * - `params=fractional` might refer to a scheme where votes are divided fractionally between for/against/abstain.\n * - `params=erc721` might refer to a scheme where specific NFTs are delegated to vote.\n *\n * NOTE: The string can be decoded by the standard\n * https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams[`URLSearchParams`]\n * JavaScript class.\n */\n // solhint-disable-next-line func-name-mixedcase\n function COUNTING_MODE() external view returns (string memory);\n\n /**\n * @notice module:core\n * @dev Hashing function used to (re)build the proposal id from the proposal details..\n */\n function hashProposal(\n address[] memory targets,\n uint256[] memory values,\n bytes[] memory calldatas,\n bytes32 descriptionHash\n ) external pure returns (uint256);\n\n /**\n * @notice module:core\n * @dev Current state of a proposal, following Compound's convention\n */\n function state(uint256 proposalId) external view returns (ProposalState);\n\n /**\n * @notice module:core\n * @dev The number of votes required in order for a voter to become a proposer.\n */\n function proposalThreshold() external view returns (uint256);\n\n /**\n * @notice module:core\n * @dev Timepoint used to retrieve user's votes and quorum. If using block number (as per Compound's Comp), the\n * snapshot is performed at the end of this block. Hence, voting for this proposal starts at the beginning of the\n * following block.\n */\n function proposalSnapshot(uint256 proposalId) external view returns (uint256);\n\n /**\n * @notice module:core\n * @dev Timepoint at which votes close. If using block number, votes close at the end of this block, so it is\n * possible to cast a vote during this block.\n */\n function proposalDeadline(uint256 proposalId) external view returns (uint256);\n\n /**\n * @notice module:core\n * @dev The account that created a proposal.\n */\n function proposalProposer(uint256 proposalId) external view returns (address);\n\n /**\n * @notice module:core\n * @dev The time when a queued proposal becomes executable (\"ETA\"). Unlike {proposalSnapshot} and\n * {proposalDeadline}, this doesn't use the governor clock, and instead relies on the executor's clock which may be\n * different. In most cases this will be a timestamp.\n */\n function proposalEta(uint256 proposalId) external view returns (uint256);\n\n /**\n * @notice module:core\n * @dev Whether a proposal needs to be queued before execution.\n */\n function proposalNeedsQueuing(uint256 proposalId) external view returns (bool);\n\n /**\n * @notice module:user-config\n * @dev Delay, between the proposal is created and the vote starts. The unit this duration is expressed in depends\n * on the clock (see ERC-6372) this contract uses.\n *\n * This can be increased to leave time for users to buy voting power, or delegate it, before the voting of a\n * proposal starts.\n *\n * NOTE: While this interface returns a uint256, timepoints are stored as uint48 following the ERC-6372 clock type.\n * Consequently this value must fit in a uint48 (when added to the current clock). See {IERC6372-clock}.\n */\n function votingDelay() external view returns (uint256);\n\n /**\n * @notice module:user-config\n * @dev Delay between the vote start and vote end. The unit this duration is expressed in depends on the clock\n * (see ERC-6372) this contract uses.\n *\n * NOTE: The {votingDelay} can delay the start of the vote. This must be considered when setting the voting\n * duration compared to the voting delay.\n *\n * NOTE: This value is stored when the proposal is submitted so that possible changes to the value do not affect\n * proposals that have already been submitted. The type used to save it is a uint32. Consequently, while this\n * interface returns a uint256, the value it returns should fit in a uint32.\n */\n function votingPeriod() external view returns (uint256);\n\n /**\n * @notice module:user-config\n * @dev Minimum number of cast voted required for a proposal to be successful.\n *\n * NOTE: The `timepoint` parameter corresponds to the snapshot used for counting vote. This allows to scale the\n * quorum depending on values such as the totalSupply of a token at this timepoint (see {ERC20Votes}).\n */\n function quorum(uint256 timepoint) external view returns (uint256);\n\n /**\n * @notice module:reputation\n * @dev Voting power of an `account` at a specific `timepoint`.\n *\n * Note: this can be implemented in a number of ways, for example by reading the delegated balance from one (or\n * multiple), {ERC20Votes} tokens.\n */\n function getVotes(address account, uint256 timepoint) external view returns (uint256);\n\n /**\n * @notice module:reputation\n * @dev Voting power of an `account` at a specific `timepoint` given additional encoded parameters.\n */\n function getVotesWithParams(\n address account,\n uint256 timepoint,\n bytes memory params\n ) external view returns (uint256);\n\n /**\n * @notice module:voting\n * @dev Returns whether `account` has cast a vote on `proposalId`.\n */\n function hasVoted(uint256 proposalId, address account) external view returns (bool);\n\n /**\n * @dev Create a new proposal. Vote start after a delay specified by {IGovernor-votingDelay} and lasts for a\n * duration specified by {IGovernor-votingPeriod}.\n *\n * Emits a {ProposalCreated} event.\n *\n * NOTE: The state of the Governor and `targets` may change between the proposal creation and its execution.\n * This may be the result of third party actions on the targeted contracts, or other governor proposals.\n * For example, the balance of this contract could be updated or its access control permissions may be modified,\n * possibly compromising the proposal's ability to execute successfully (e.g. the governor doesn't have enough\n * value to cover a proposal with multiple transfers).\n */\n function propose(\n address[] memory targets,\n uint256[] memory values,\n bytes[] memory calldatas,\n string memory description\n ) external returns (uint256 proposalId);\n\n /**\n * @dev Queue a proposal. Some governors require this step to be performed before execution can happen. If queuing\n * is not necessary, this function may revert.\n * Queuing a proposal requires the quorum to be reached, the vote to be successful, and the deadline to be reached.\n *\n * Emits a {ProposalQueued} event.\n */\n function queue(\n address[] memory targets,\n uint256[] memory values,\n bytes[] memory calldatas,\n bytes32 descriptionHash\n ) external returns (uint256 proposalId);\n\n /**\n * @dev Execute a successful proposal. This requires the quorum to be reached, the vote to be successful, and the\n * deadline to be reached. Depending on the governor it might also be required that the proposal was queued and\n * that some delay passed.\n *\n * Emits a {ProposalExecuted} event.\n *\n * NOTE: Some modules can modify the requirements for execution, for example by adding an additional timelock.\n */\n function execute(\n address[] memory targets,\n uint256[] memory values,\n bytes[] memory calldatas,\n bytes32 descriptionHash\n ) external payable returns (uint256 proposalId);\n\n /**\n * @dev Cancel a proposal. A proposal is cancellable by the proposer, but only while it is Pending state, i.e.\n * before the vote starts.\n *\n * Emits a {ProposalCanceled} event.\n */\n function cancel(\n address[] memory targets,\n uint256[] memory values,\n bytes[] memory calldatas,\n bytes32 descriptionHash\n ) external returns (uint256 proposalId);\n\n /**\n * @dev Cast a vote\n *\n * Emits a {VoteCast} event.\n */\n function castVote(uint256 proposalId, uint8 support) external returns (uint256 balance);\n\n /**\n * @dev Cast a vote with a reason\n *\n * Emits a {VoteCast} event.\n */\n function castVoteWithReason(\n uint256 proposalId,\n uint8 support,\n string calldata reason\n ) external returns (uint256 balance);\n\n /**\n * @dev Cast a vote with a reason and additional encoded parameters\n *\n * Emits a {VoteCast} or {VoteCastWithParams} event depending on the length of params.\n */\n function castVoteWithReasonAndParams(\n uint256 proposalId,\n uint8 support,\n string calldata reason,\n bytes memory params\n ) external returns (uint256 balance);\n\n /**\n * @dev Cast a vote using the voter's signature, including ERC-1271 signature support.\n *\n * Emits a {VoteCast} event.\n */\n function castVoteBySig(\n uint256 proposalId,\n uint8 support,\n address voter,\n bytes memory signature\n ) external returns (uint256 balance);\n\n /**\n * @dev Cast a vote with a reason and additional encoded parameters using the voter's signature,\n * including ERC-1271 signature support.\n *\n * Emits a {VoteCast} or {VoteCastWithParams} event depending on the length of params.\n */\n function castVoteWithReasonAndParamsBySig(\n uint256 proposalId,\n uint8 support,\n address voter,\n string calldata reason,\n bytes memory params,\n bytes memory signature\n ) external returns (uint256 balance);\n}\n" + }, + "@openzeppelin/contracts/governance/utils/IVotes.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (governance/utils/IVotes.sol)\npragma solidity ^0.8.20;\n\n/**\n * @dev Common interface for {ERC20Votes}, {ERC721Votes}, and other {Votes}-enabled contracts.\n */\ninterface IVotes {\n /**\n * @dev The signature used has expired.\n */\n error VotesExpiredSignature(uint256 expiry);\n\n /**\n * @dev Emitted when an account changes their delegate.\n */\n event DelegateChanged(address indexed delegator, address indexed fromDelegate, address indexed toDelegate);\n\n /**\n * @dev Emitted when a token transfer or delegate change results in changes to a delegate's number of voting units.\n */\n event DelegateVotesChanged(address indexed delegate, uint256 previousVotes, uint256 newVotes);\n\n /**\n * @dev Returns the current amount of votes that `account` has.\n */\n function getVotes(address account) external view returns (uint256);\n\n /**\n * @dev Returns the amount of votes that `account` had at a specific moment in the past. If the `clock()` is\n * configured to use block numbers, this will return the value at the end of the corresponding block.\n */\n function getPastVotes(address account, uint256 timepoint) external view returns (uint256);\n\n /**\n * @dev Returns the total supply of votes available at a specific moment in the past. If the `clock()` is\n * configured to use block numbers, this will return the value at the end of the corresponding block.\n *\n * NOTE: This value is the sum of all available votes, which is not necessarily the sum of all delegated votes.\n * Votes that have not been delegated are still part of total supply, even though they would not participate in a\n * vote.\n */\n function getPastTotalSupply(uint256 timepoint) external view returns (uint256);\n\n /**\n * @dev Returns the delegate that `account` has chosen.\n */\n function delegates(address account) external view returns (address);\n\n /**\n * @dev Delegates votes from the sender to `delegatee`.\n */\n function delegate(address delegatee) external;\n\n /**\n * @dev Delegates votes from signer to `delegatee`.\n */\n function delegateBySig(address delegatee, uint256 nonce, uint256 expiry, uint8 v, bytes32 r, bytes32 s) external;\n}\n" + }, + "@openzeppelin/contracts/governance/utils/Votes.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (governance/utils/Votes.sol)\npragma solidity ^0.8.20;\n\nimport {IERC5805} from \"../../interfaces/IERC5805.sol\";\nimport {Context} from \"../../utils/Context.sol\";\nimport {Nonces} from \"../../utils/Nonces.sol\";\nimport {EIP712} from \"../../utils/cryptography/EIP712.sol\";\nimport {Checkpoints} from \"../../utils/structs/Checkpoints.sol\";\nimport {SafeCast} from \"../../utils/math/SafeCast.sol\";\nimport {ECDSA} from \"../../utils/cryptography/ECDSA.sol\";\nimport {Time} from \"../../utils/types/Time.sol\";\n\n/**\n * @dev This is a base abstract contract that tracks voting units, which are a measure of voting power that can be\n * transferred, and provides a system of vote delegation, where an account can delegate its voting units to a sort of\n * \"representative\" that will pool delegated voting units from different accounts and can then use it to vote in\n * decisions. In fact, voting units _must_ be delegated in order to count as actual votes, and an account has to\n * delegate those votes to itself if it wishes to participate in decisions and does not have a trusted representative.\n *\n * This contract is often combined with a token contract such that voting units correspond to token units. For an\n * example, see {ERC721Votes}.\n *\n * The full history of delegate votes is tracked on-chain so that governance protocols can consider votes as distributed\n * at a particular block number to protect against flash loans and double voting. The opt-in delegate system makes the\n * cost of this history tracking optional.\n *\n * When using this module the derived contract must implement {_getVotingUnits} (for example, make it return\n * {ERC721-balanceOf}), and can use {_transferVotingUnits} to track a change in the distribution of those units (in the\n * previous example, it would be included in {ERC721-_update}).\n */\nabstract contract Votes is Context, EIP712, Nonces, IERC5805 {\n using Checkpoints for Checkpoints.Trace208;\n\n bytes32 private constant DELEGATION_TYPEHASH =\n keccak256(\"Delegation(address delegatee,uint256 nonce,uint256 expiry)\");\n\n mapping(address account => address) private _delegatee;\n\n mapping(address delegatee => Checkpoints.Trace208) private _delegateCheckpoints;\n\n Checkpoints.Trace208 private _totalCheckpoints;\n\n /**\n * @dev The clock was incorrectly modified.\n */\n error ERC6372InconsistentClock();\n\n /**\n * @dev Lookup to future votes is not available.\n */\n error ERC5805FutureLookup(uint256 timepoint, uint48 clock);\n\n /**\n * @dev Clock used for flagging checkpoints. Can be overridden to implement timestamp based\n * checkpoints (and voting), in which case {CLOCK_MODE} should be overridden as well to match.\n */\n function clock() public view virtual returns (uint48) {\n return Time.blockNumber();\n }\n\n /**\n * @dev Machine-readable description of the clock as specified in ERC-6372.\n */\n // solhint-disable-next-line func-name-mixedcase\n function CLOCK_MODE() public view virtual returns (string memory) {\n // Check that the clock was not modified\n if (clock() != Time.blockNumber()) {\n revert ERC6372InconsistentClock();\n }\n return \"mode=blocknumber&from=default\";\n }\n\n /**\n * @dev Returns the current amount of votes that `account` has.\n */\n function getVotes(address account) public view virtual returns (uint256) {\n return _delegateCheckpoints[account].latest();\n }\n\n /**\n * @dev Returns the amount of votes that `account` had at a specific moment in the past. If the `clock()` is\n * configured to use block numbers, this will return the value at the end of the corresponding block.\n *\n * Requirements:\n *\n * - `timepoint` must be in the past. If operating using block numbers, the block must be already mined.\n */\n function getPastVotes(address account, uint256 timepoint) public view virtual returns (uint256) {\n uint48 currentTimepoint = clock();\n if (timepoint >= currentTimepoint) {\n revert ERC5805FutureLookup(timepoint, currentTimepoint);\n }\n return _delegateCheckpoints[account].upperLookupRecent(SafeCast.toUint48(timepoint));\n }\n\n /**\n * @dev Returns the total supply of votes available at a specific moment in the past. If the `clock()` is\n * configured to use block numbers, this will return the value at the end of the corresponding block.\n *\n * NOTE: This value is the sum of all available votes, which is not necessarily the sum of all delegated votes.\n * Votes that have not been delegated are still part of total supply, even though they would not participate in a\n * vote.\n *\n * Requirements:\n *\n * - `timepoint` must be in the past. If operating using block numbers, the block must be already mined.\n */\n function getPastTotalSupply(uint256 timepoint) public view virtual returns (uint256) {\n uint48 currentTimepoint = clock();\n if (timepoint >= currentTimepoint) {\n revert ERC5805FutureLookup(timepoint, currentTimepoint);\n }\n return _totalCheckpoints.upperLookupRecent(SafeCast.toUint48(timepoint));\n }\n\n /**\n * @dev Returns the current total supply of votes.\n */\n function _getTotalSupply() internal view virtual returns (uint256) {\n return _totalCheckpoints.latest();\n }\n\n /**\n * @dev Returns the delegate that `account` has chosen.\n */\n function delegates(address account) public view virtual returns (address) {\n return _delegatee[account];\n }\n\n /**\n * @dev Delegates votes from the sender to `delegatee`.\n */\n function delegate(address delegatee) public virtual {\n address account = _msgSender();\n _delegate(account, delegatee);\n }\n\n /**\n * @dev Delegates votes from signer to `delegatee`.\n */\n function delegateBySig(\n address delegatee,\n uint256 nonce,\n uint256 expiry,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) public virtual {\n if (block.timestamp > expiry) {\n revert VotesExpiredSignature(expiry);\n }\n address signer = ECDSA.recover(\n _hashTypedDataV4(keccak256(abi.encode(DELEGATION_TYPEHASH, delegatee, nonce, expiry))),\n v,\n r,\n s\n );\n _useCheckedNonce(signer, nonce);\n _delegate(signer, delegatee);\n }\n\n /**\n * @dev Delegate all of `account`'s voting units to `delegatee`.\n *\n * Emits events {IVotes-DelegateChanged} and {IVotes-DelegateVotesChanged}.\n */\n function _delegate(address account, address delegatee) internal virtual {\n address oldDelegate = delegates(account);\n _delegatee[account] = delegatee;\n\n emit DelegateChanged(account, oldDelegate, delegatee);\n _moveDelegateVotes(oldDelegate, delegatee, _getVotingUnits(account));\n }\n\n /**\n * @dev Transfers, mints, or burns voting units. To register a mint, `from` should be zero. To register a burn, `to`\n * should be zero. Total supply of voting units will be adjusted with mints and burns.\n */\n function _transferVotingUnits(address from, address to, uint256 amount) internal virtual {\n if (from == address(0)) {\n _push(_totalCheckpoints, _add, SafeCast.toUint208(amount));\n }\n if (to == address(0)) {\n _push(_totalCheckpoints, _subtract, SafeCast.toUint208(amount));\n }\n _moveDelegateVotes(delegates(from), delegates(to), amount);\n }\n\n /**\n * @dev Moves delegated votes from one delegate to another.\n */\n function _moveDelegateVotes(address from, address to, uint256 amount) internal virtual {\n if (from != to && amount > 0) {\n if (from != address(0)) {\n (uint256 oldValue, uint256 newValue) = _push(\n _delegateCheckpoints[from],\n _subtract,\n SafeCast.toUint208(amount)\n );\n emit DelegateVotesChanged(from, oldValue, newValue);\n }\n if (to != address(0)) {\n (uint256 oldValue, uint256 newValue) = _push(\n _delegateCheckpoints[to],\n _add,\n SafeCast.toUint208(amount)\n );\n emit DelegateVotesChanged(to, oldValue, newValue);\n }\n }\n }\n\n /**\n * @dev Get number of checkpoints for `account`.\n */\n function _numCheckpoints(address account) internal view virtual returns (uint32) {\n return SafeCast.toUint32(_delegateCheckpoints[account].length());\n }\n\n /**\n * @dev Get the `pos`-th checkpoint for `account`.\n */\n function _checkpoints(\n address account,\n uint32 pos\n ) internal view virtual returns (Checkpoints.Checkpoint208 memory) {\n return _delegateCheckpoints[account].at(pos);\n }\n\n function _push(\n Checkpoints.Trace208 storage store,\n function(uint208, uint208) view returns (uint208) op,\n uint208 delta\n ) private returns (uint208 oldValue, uint208 newValue) {\n return store.push(clock(), op(store.latest(), delta));\n }\n\n function _add(uint208 a, uint208 b) private pure returns (uint208) {\n return a + b;\n }\n\n function _subtract(uint208 a, uint208 b) private pure returns (uint208) {\n return a - b;\n }\n\n /**\n * @dev Must return the voting units held by an account.\n */\n function _getVotingUnits(address) internal view virtual returns (uint256);\n}\n" + }, + "@openzeppelin/contracts/interfaces/draft-IERC6093.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (interfaces/draft-IERC6093.sol)\npragma solidity ^0.8.20;\n\n/**\n * @dev Standard ERC-20 Errors\n * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC-20 tokens.\n */\ninterface IERC20Errors {\n /**\n * @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers.\n * @param sender Address whose tokens are being transferred.\n * @param balance Current balance for the interacting account.\n * @param needed Minimum amount required to perform a transfer.\n */\n error ERC20InsufficientBalance(address sender, uint256 balance, uint256 needed);\n\n /**\n * @dev Indicates a failure with the token `sender`. Used in transfers.\n * @param sender Address whose tokens are being transferred.\n */\n error ERC20InvalidSender(address sender);\n\n /**\n * @dev Indicates a failure with the token `receiver`. Used in transfers.\n * @param receiver Address to which tokens are being transferred.\n */\n error ERC20InvalidReceiver(address receiver);\n\n /**\n * @dev Indicates a failure with the `spender`’s `allowance`. Used in transfers.\n * @param spender Address that may be allowed to operate on tokens without being their owner.\n * @param allowance Amount of tokens a `spender` is allowed to operate with.\n * @param needed Minimum amount required to perform a transfer.\n */\n error ERC20InsufficientAllowance(address spender, uint256 allowance, uint256 needed);\n\n /**\n * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.\n * @param approver Address initiating an approval operation.\n */\n error ERC20InvalidApprover(address approver);\n\n /**\n * @dev Indicates a failure with the `spender` to be approved. Used in approvals.\n * @param spender Address that may be allowed to operate on tokens without being their owner.\n */\n error ERC20InvalidSpender(address spender);\n}\n\n/**\n * @dev Standard ERC-721 Errors\n * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC-721 tokens.\n */\ninterface IERC721Errors {\n /**\n * @dev Indicates that an address can't be an owner. For example, `address(0)` is a forbidden owner in ERC-20.\n * Used in balance queries.\n * @param owner Address of the current owner of a token.\n */\n error ERC721InvalidOwner(address owner);\n\n /**\n * @dev Indicates a `tokenId` whose `owner` is the zero address.\n * @param tokenId Identifier number of a token.\n */\n error ERC721NonexistentToken(uint256 tokenId);\n\n /**\n * @dev Indicates an error related to the ownership over a particular token. Used in transfers.\n * @param sender Address whose tokens are being transferred.\n * @param tokenId Identifier number of a token.\n * @param owner Address of the current owner of a token.\n */\n error ERC721IncorrectOwner(address sender, uint256 tokenId, address owner);\n\n /**\n * @dev Indicates a failure with the token `sender`. Used in transfers.\n * @param sender Address whose tokens are being transferred.\n */\n error ERC721InvalidSender(address sender);\n\n /**\n * @dev Indicates a failure with the token `receiver`. Used in transfers.\n * @param receiver Address to which tokens are being transferred.\n */\n error ERC721InvalidReceiver(address receiver);\n\n /**\n * @dev Indicates a failure with the `operator`’s approval. Used in transfers.\n * @param operator Address that may be allowed to operate on tokens without being their owner.\n * @param tokenId Identifier number of a token.\n */\n error ERC721InsufficientApproval(address operator, uint256 tokenId);\n\n /**\n * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.\n * @param approver Address initiating an approval operation.\n */\n error ERC721InvalidApprover(address approver);\n\n /**\n * @dev Indicates a failure with the `operator` to be approved. Used in approvals.\n * @param operator Address that may be allowed to operate on tokens without being their owner.\n */\n error ERC721InvalidOperator(address operator);\n}\n\n/**\n * @dev Standard ERC-1155 Errors\n * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC-1155 tokens.\n */\ninterface IERC1155Errors {\n /**\n * @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers.\n * @param sender Address whose tokens are being transferred.\n * @param balance Current balance for the interacting account.\n * @param needed Minimum amount required to perform a transfer.\n * @param tokenId Identifier number of a token.\n */\n error ERC1155InsufficientBalance(address sender, uint256 balance, uint256 needed, uint256 tokenId);\n\n /**\n * @dev Indicates a failure with the token `sender`. Used in transfers.\n * @param sender Address whose tokens are being transferred.\n */\n error ERC1155InvalidSender(address sender);\n\n /**\n * @dev Indicates a failure with the token `receiver`. Used in transfers.\n * @param receiver Address to which tokens are being transferred.\n */\n error ERC1155InvalidReceiver(address receiver);\n\n /**\n * @dev Indicates a failure with the `operator`’s approval. Used in transfers.\n * @param operator Address that may be allowed to operate on tokens without being their owner.\n * @param owner Address of the current owner of a token.\n */\n error ERC1155MissingApprovalForAll(address operator, address owner);\n\n /**\n * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.\n * @param approver Address initiating an approval operation.\n */\n error ERC1155InvalidApprover(address approver);\n\n /**\n * @dev Indicates a failure with the `operator` to be approved. Used in approvals.\n * @param operator Address that may be allowed to operate on tokens without being their owner.\n */\n error ERC1155InvalidOperator(address operator);\n\n /**\n * @dev Indicates an array length mismatch between ids and values in a safeBatchTransferFrom operation.\n * Used in batch transfers.\n * @param idsLength Length of the array of token identifiers\n * @param valuesLength Length of the array of token amounts\n */\n error ERC1155InvalidArrayLength(uint256 idsLength, uint256 valuesLength);\n}\n" + }, + "@openzeppelin/contracts/interfaces/IERC1271.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (interfaces/IERC1271.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Interface of the ERC-1271 standard signature validation method for\n * contracts as defined in https://eips.ethereum.org/EIPS/eip-1271[ERC-1271].\n */\ninterface IERC1271 {\n /**\n * @dev Should return whether the signature provided is valid for the provided data\n * @param hash Hash of the data to be signed\n * @param signature Signature byte array associated with _data\n */\n function isValidSignature(bytes32 hash, bytes memory signature) external view returns (bytes4 magicValue);\n}\n" + }, + "@openzeppelin/contracts/interfaces/IERC165.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC165.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC165} from \"../utils/introspection/IERC165.sol\";\n" + }, + "@openzeppelin/contracts/interfaces/IERC4906.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (interfaces/IERC4906.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC165} from \"./IERC165.sol\";\nimport {IERC721} from \"./IERC721.sol\";\n\n/// @title ERC-721 Metadata Update Extension\ninterface IERC4906 is IERC165, IERC721 {\n /// @dev This event emits when the metadata of a token is changed.\n /// So that the third-party platforms such as NFT market could\n /// timely update the images and related attributes of the NFT.\n event MetadataUpdate(uint256 _tokenId);\n\n /// @dev This event emits when the metadata of a range of tokens is changed.\n /// So that the third-party platforms such as NFT market could\n /// timely update the images and related attributes of the NFTs.\n event BatchMetadataUpdate(uint256 _fromTokenId, uint256 _toTokenId);\n}\n" + }, + "@openzeppelin/contracts/interfaces/IERC5267.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC5267.sol)\n\npragma solidity ^0.8.20;\n\ninterface IERC5267 {\n /**\n * @dev MAY be emitted to signal that the domain could have changed.\n */\n event EIP712DomainChanged();\n\n /**\n * @dev returns the fields and values that describe the domain separator used by this contract for EIP-712\n * signature.\n */\n function eip712Domain()\n external\n view\n returns (\n bytes1 fields,\n string memory name,\n string memory version,\n uint256 chainId,\n address verifyingContract,\n bytes32 salt,\n uint256[] memory extensions\n );\n}\n" + }, + "@openzeppelin/contracts/interfaces/IERC5805.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC5805.sol)\n\npragma solidity ^0.8.20;\n\nimport {IVotes} from \"../governance/utils/IVotes.sol\";\nimport {IERC6372} from \"./IERC6372.sol\";\n\ninterface IERC5805 is IERC6372, IVotes {}\n" + }, + "@openzeppelin/contracts/interfaces/IERC6372.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC6372.sol)\n\npragma solidity ^0.8.20;\n\ninterface IERC6372 {\n /**\n * @dev Clock used for flagging checkpoints. Can be overridden to implement timestamp based checkpoints (and voting).\n */\n function clock() external view returns (uint48);\n\n /**\n * @dev Description of the clock\n */\n // solhint-disable-next-line func-name-mixedcase\n function CLOCK_MODE() external view returns (string memory);\n}\n" + }, + "@openzeppelin/contracts/interfaces/IERC721.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC721.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC721} from \"../token/ERC721/IERC721.sol\";\n" + }, + "@openzeppelin/contracts/token/ERC1155/IERC1155Receiver.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC1155/IERC1155Receiver.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC165} from \"../../utils/introspection/IERC165.sol\";\n\n/**\n * @dev Interface that must be implemented by smart contracts in order to receive\n * ERC-1155 token transfers.\n */\ninterface IERC1155Receiver is IERC165 {\n /**\n * @dev Handles the receipt of a single ERC-1155 token type. This function is\n * called at the end of a `safeTransferFrom` after the balance has been updated.\n *\n * NOTE: To accept the transfer, this must return\n * `bytes4(keccak256(\"onERC1155Received(address,address,uint256,uint256,bytes)\"))`\n * (i.e. 0xf23a6e61, or its own function selector).\n *\n * @param operator The address which initiated the transfer (i.e. msg.sender)\n * @param from The address which previously owned the token\n * @param id The ID of the token being transferred\n * @param value The amount of tokens being transferred\n * @param data Additional data with no specified format\n * @return `bytes4(keccak256(\"onERC1155Received(address,address,uint256,uint256,bytes)\"))` if transfer is allowed\n */\n function onERC1155Received(\n address operator,\n address from,\n uint256 id,\n uint256 value,\n bytes calldata data\n ) external returns (bytes4);\n\n /**\n * @dev Handles the receipt of a multiple ERC-1155 token types. This function\n * is called at the end of a `safeBatchTransferFrom` after the balances have\n * been updated.\n *\n * NOTE: To accept the transfer(s), this must return\n * `bytes4(keccak256(\"onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)\"))`\n * (i.e. 0xbc197c81, or its own function selector).\n *\n * @param operator The address which initiated the batch transfer (i.e. msg.sender)\n * @param from The address which previously owned the token\n * @param ids An array containing ids of each token being transferred (order and length must match values array)\n * @param values An array containing amounts of each token being transferred (order and length must match ids array)\n * @param data Additional data with no specified format\n * @return `bytes4(keccak256(\"onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)\"))` if transfer is allowed\n */\n function onERC1155BatchReceived(\n address operator,\n address from,\n uint256[] calldata ids,\n uint256[] calldata values,\n bytes calldata data\n ) external returns (bytes4);\n}\n" + }, + "@openzeppelin/contracts/token/ERC721/ERC721.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC721/ERC721.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC721} from \"./IERC721.sol\";\nimport {IERC721Metadata} from \"./extensions/IERC721Metadata.sol\";\nimport {ERC721Utils} from \"./utils/ERC721Utils.sol\";\nimport {Context} from \"../../utils/Context.sol\";\nimport {Strings} from \"../../utils/Strings.sol\";\nimport {IERC165, ERC165} from \"../../utils/introspection/ERC165.sol\";\nimport {IERC721Errors} from \"../../interfaces/draft-IERC6093.sol\";\n\n/**\n * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC-721] Non-Fungible Token Standard, including\n * the Metadata extension, but not including the Enumerable extension, which is available separately as\n * {ERC721Enumerable}.\n */\nabstract contract ERC721 is Context, ERC165, IERC721, IERC721Metadata, IERC721Errors {\n using Strings for uint256;\n\n // Token name\n string private _name;\n\n // Token symbol\n string private _symbol;\n\n mapping(uint256 tokenId => address) private _owners;\n\n mapping(address owner => uint256) private _balances;\n\n mapping(uint256 tokenId => address) private _tokenApprovals;\n\n mapping(address owner => mapping(address operator => bool)) private _operatorApprovals;\n\n /**\n * @dev Initializes the contract by setting a `name` and a `symbol` to the token collection.\n */\n constructor(string memory name_, string memory symbol_) {\n _name = name_;\n _symbol = symbol_;\n }\n\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {\n return\n interfaceId == type(IERC721).interfaceId ||\n interfaceId == type(IERC721Metadata).interfaceId ||\n super.supportsInterface(interfaceId);\n }\n\n /**\n * @dev See {IERC721-balanceOf}.\n */\n function balanceOf(address owner) public view virtual returns (uint256) {\n if (owner == address(0)) {\n revert ERC721InvalidOwner(address(0));\n }\n return _balances[owner];\n }\n\n /**\n * @dev See {IERC721-ownerOf}.\n */\n function ownerOf(uint256 tokenId) public view virtual returns (address) {\n return _requireOwned(tokenId);\n }\n\n /**\n * @dev See {IERC721Metadata-name}.\n */\n function name() public view virtual returns (string memory) {\n return _name;\n }\n\n /**\n * @dev See {IERC721Metadata-symbol}.\n */\n function symbol() public view virtual returns (string memory) {\n return _symbol;\n }\n\n /**\n * @dev See {IERC721Metadata-tokenURI}.\n */\n function tokenURI(uint256 tokenId) public view virtual returns (string memory) {\n _requireOwned(tokenId);\n\n string memory baseURI = _baseURI();\n return bytes(baseURI).length > 0 ? string.concat(baseURI, tokenId.toString()) : \"\";\n }\n\n /**\n * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each\n * token will be the concatenation of the `baseURI` and the `tokenId`. Empty\n * by default, can be overridden in child contracts.\n */\n function _baseURI() internal view virtual returns (string memory) {\n return \"\";\n }\n\n /**\n * @dev See {IERC721-approve}.\n */\n function approve(address to, uint256 tokenId) public virtual {\n _approve(to, tokenId, _msgSender());\n }\n\n /**\n * @dev See {IERC721-getApproved}.\n */\n function getApproved(uint256 tokenId) public view virtual returns (address) {\n _requireOwned(tokenId);\n\n return _getApproved(tokenId);\n }\n\n /**\n * @dev See {IERC721-setApprovalForAll}.\n */\n function setApprovalForAll(address operator, bool approved) public virtual {\n _setApprovalForAll(_msgSender(), operator, approved);\n }\n\n /**\n * @dev See {IERC721-isApprovedForAll}.\n */\n function isApprovedForAll(address owner, address operator) public view virtual returns (bool) {\n return _operatorApprovals[owner][operator];\n }\n\n /**\n * @dev See {IERC721-transferFrom}.\n */\n function transferFrom(address from, address to, uint256 tokenId) public virtual {\n if (to == address(0)) {\n revert ERC721InvalidReceiver(address(0));\n }\n // Setting an \"auth\" arguments enables the `_isAuthorized` check which verifies that the token exists\n // (from != 0). Therefore, it is not needed to verify that the return value is not 0 here.\n address previousOwner = _update(to, tokenId, _msgSender());\n if (previousOwner != from) {\n revert ERC721IncorrectOwner(from, tokenId, previousOwner);\n }\n }\n\n /**\n * @dev See {IERC721-safeTransferFrom}.\n */\n function safeTransferFrom(address from, address to, uint256 tokenId) public {\n safeTransferFrom(from, to, tokenId, \"\");\n }\n\n /**\n * @dev See {IERC721-safeTransferFrom}.\n */\n function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory data) public virtual {\n transferFrom(from, to, tokenId);\n ERC721Utils.checkOnERC721Received(_msgSender(), from, to, tokenId, data);\n }\n\n /**\n * @dev Returns the owner of the `tokenId`. Does NOT revert if token doesn't exist\n *\n * IMPORTANT: Any overrides to this function that add ownership of tokens not tracked by the\n * core ERC-721 logic MUST be matched with the use of {_increaseBalance} to keep balances\n * consistent with ownership. The invariant to preserve is that for any address `a` the value returned by\n * `balanceOf(a)` must be equal to the number of tokens such that `_ownerOf(tokenId)` is `a`.\n */\n function _ownerOf(uint256 tokenId) internal view virtual returns (address) {\n return _owners[tokenId];\n }\n\n /**\n * @dev Returns the approved address for `tokenId`. Returns 0 if `tokenId` is not minted.\n */\n function _getApproved(uint256 tokenId) internal view virtual returns (address) {\n return _tokenApprovals[tokenId];\n }\n\n /**\n * @dev Returns whether `spender` is allowed to manage `owner`'s tokens, or `tokenId` in\n * particular (ignoring whether it is owned by `owner`).\n *\n * WARNING: This function assumes that `owner` is the actual owner of `tokenId` and does not verify this\n * assumption.\n */\n function _isAuthorized(address owner, address spender, uint256 tokenId) internal view virtual returns (bool) {\n return\n spender != address(0) &&\n (owner == spender || isApprovedForAll(owner, spender) || _getApproved(tokenId) == spender);\n }\n\n /**\n * @dev Checks if `spender` can operate on `tokenId`, assuming the provided `owner` is the actual owner.\n * Reverts if:\n * - `spender` does not have approval from `owner` for `tokenId`.\n * - `spender` does not have approval to manage all of `owner`'s assets.\n *\n * WARNING: This function assumes that `owner` is the actual owner of `tokenId` and does not verify this\n * assumption.\n */\n function _checkAuthorized(address owner, address spender, uint256 tokenId) internal view virtual {\n if (!_isAuthorized(owner, spender, tokenId)) {\n if (owner == address(0)) {\n revert ERC721NonexistentToken(tokenId);\n } else {\n revert ERC721InsufficientApproval(spender, tokenId);\n }\n }\n }\n\n /**\n * @dev Unsafe write access to the balances, used by extensions that \"mint\" tokens using an {ownerOf} override.\n *\n * NOTE: the value is limited to type(uint128).max. This protect against _balance overflow. It is unrealistic that\n * a uint256 would ever overflow from increments when these increments are bounded to uint128 values.\n *\n * WARNING: Increasing an account's balance using this function tends to be paired with an override of the\n * {_ownerOf} function to resolve the ownership of the corresponding tokens so that balances and ownership\n * remain consistent with one another.\n */\n function _increaseBalance(address account, uint128 value) internal virtual {\n unchecked {\n _balances[account] += value;\n }\n }\n\n /**\n * @dev Transfers `tokenId` from its current owner to `to`, or alternatively mints (or burns) if the current owner\n * (or `to`) is the zero address. Returns the owner of the `tokenId` before the update.\n *\n * The `auth` argument is optional. If the value passed is non 0, then this function will check that\n * `auth` is either the owner of the token, or approved to operate on the token (by the owner).\n *\n * Emits a {Transfer} event.\n *\n * NOTE: If overriding this function in a way that tracks balances, see also {_increaseBalance}.\n */\n function _update(address to, uint256 tokenId, address auth) internal virtual returns (address) {\n address from = _ownerOf(tokenId);\n\n // Perform (optional) operator check\n if (auth != address(0)) {\n _checkAuthorized(from, auth, tokenId);\n }\n\n // Execute the update\n if (from != address(0)) {\n // Clear approval. No need to re-authorize or emit the Approval event\n _approve(address(0), tokenId, address(0), false);\n\n unchecked {\n _balances[from] -= 1;\n }\n }\n\n if (to != address(0)) {\n unchecked {\n _balances[to] += 1;\n }\n }\n\n _owners[tokenId] = to;\n\n emit Transfer(from, to, tokenId);\n\n return from;\n }\n\n /**\n * @dev Mints `tokenId` and transfers it to `to`.\n *\n * WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible\n *\n * Requirements:\n *\n * - `tokenId` must not exist.\n * - `to` cannot be the zero address.\n *\n * Emits a {Transfer} event.\n */\n function _mint(address to, uint256 tokenId) internal {\n if (to == address(0)) {\n revert ERC721InvalidReceiver(address(0));\n }\n address previousOwner = _update(to, tokenId, address(0));\n if (previousOwner != address(0)) {\n revert ERC721InvalidSender(address(0));\n }\n }\n\n /**\n * @dev Mints `tokenId`, transfers it to `to` and checks for `to` acceptance.\n *\n * Requirements:\n *\n * - `tokenId` must not exist.\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\n *\n * Emits a {Transfer} event.\n */\n function _safeMint(address to, uint256 tokenId) internal {\n _safeMint(to, tokenId, \"\");\n }\n\n /**\n * @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is\n * forwarded in {IERC721Receiver-onERC721Received} to contract recipients.\n */\n function _safeMint(address to, uint256 tokenId, bytes memory data) internal virtual {\n _mint(to, tokenId);\n ERC721Utils.checkOnERC721Received(_msgSender(), address(0), to, tokenId, data);\n }\n\n /**\n * @dev Destroys `tokenId`.\n * The approval is cleared when the token is burned.\n * This is an internal function that does not check if the sender is authorized to operate on the token.\n *\n * Requirements:\n *\n * - `tokenId` must exist.\n *\n * Emits a {Transfer} event.\n */\n function _burn(uint256 tokenId) internal {\n address previousOwner = _update(address(0), tokenId, address(0));\n if (previousOwner == address(0)) {\n revert ERC721NonexistentToken(tokenId);\n }\n }\n\n /**\n * @dev Transfers `tokenId` from `from` to `to`.\n * As opposed to {transferFrom}, this imposes no restrictions on msg.sender.\n *\n * Requirements:\n *\n * - `to` cannot be the zero address.\n * - `tokenId` token must be owned by `from`.\n *\n * Emits a {Transfer} event.\n */\n function _transfer(address from, address to, uint256 tokenId) internal {\n if (to == address(0)) {\n revert ERC721InvalidReceiver(address(0));\n }\n address previousOwner = _update(to, tokenId, address(0));\n if (previousOwner == address(0)) {\n revert ERC721NonexistentToken(tokenId);\n } else if (previousOwner != from) {\n revert ERC721IncorrectOwner(from, tokenId, previousOwner);\n }\n }\n\n /**\n * @dev Safely transfers `tokenId` token from `from` to `to`, checking that contract recipients\n * are aware of the ERC-721 standard to prevent tokens from being forever locked.\n *\n * `data` is additional data, it has no specified format and it is sent in call to `to`.\n *\n * This internal function is like {safeTransferFrom} in the sense that it invokes\n * {IERC721Receiver-onERC721Received} on the receiver, and can be used to e.g.\n * implement alternative mechanisms to perform token transfer, such as signature-based.\n *\n * Requirements:\n *\n * - `tokenId` token must exist and be owned by `from`.\n * - `to` cannot be the zero address.\n * - `from` cannot be the zero address.\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\n *\n * Emits a {Transfer} event.\n */\n function _safeTransfer(address from, address to, uint256 tokenId) internal {\n _safeTransfer(from, to, tokenId, \"\");\n }\n\n /**\n * @dev Same as {xref-ERC721-_safeTransfer-address-address-uint256-}[`_safeTransfer`], with an additional `data` parameter which is\n * forwarded in {IERC721Receiver-onERC721Received} to contract recipients.\n */\n function _safeTransfer(address from, address to, uint256 tokenId, bytes memory data) internal virtual {\n _transfer(from, to, tokenId);\n ERC721Utils.checkOnERC721Received(_msgSender(), from, to, tokenId, data);\n }\n\n /**\n * @dev Approve `to` to operate on `tokenId`\n *\n * The `auth` argument is optional. If the value passed is non 0, then this function will check that `auth` is\n * either the owner of the token, or approved to operate on all tokens held by this owner.\n *\n * Emits an {Approval} event.\n *\n * Overrides to this logic should be done to the variant with an additional `bool emitEvent` argument.\n */\n function _approve(address to, uint256 tokenId, address auth) internal {\n _approve(to, tokenId, auth, true);\n }\n\n /**\n * @dev Variant of `_approve` with an optional flag to enable or disable the {Approval} event. The event is not\n * emitted in the context of transfers.\n */\n function _approve(address to, uint256 tokenId, address auth, bool emitEvent) internal virtual {\n // Avoid reading the owner unless necessary\n if (emitEvent || auth != address(0)) {\n address owner = _requireOwned(tokenId);\n\n // We do not use _isAuthorized because single-token approvals should not be able to call approve\n if (auth != address(0) && owner != auth && !isApprovedForAll(owner, auth)) {\n revert ERC721InvalidApprover(auth);\n }\n\n if (emitEvent) {\n emit Approval(owner, to, tokenId);\n }\n }\n\n _tokenApprovals[tokenId] = to;\n }\n\n /**\n * @dev Approve `operator` to operate on all of `owner` tokens\n *\n * Requirements:\n * - operator can't be the address zero.\n *\n * Emits an {ApprovalForAll} event.\n */\n function _setApprovalForAll(address owner, address operator, bool approved) internal virtual {\n if (operator == address(0)) {\n revert ERC721InvalidOperator(operator);\n }\n _operatorApprovals[owner][operator] = approved;\n emit ApprovalForAll(owner, operator, approved);\n }\n\n /**\n * @dev Reverts if the `tokenId` doesn't have a current owner (it hasn't been minted, or it has been burned).\n * Returns the owner.\n *\n * Overrides to ownership logic should be done to {_ownerOf}.\n */\n function _requireOwned(uint256 tokenId) internal view returns (address) {\n address owner = _ownerOf(tokenId);\n if (owner == address(0)) {\n revert ERC721NonexistentToken(tokenId);\n }\n return owner;\n }\n}\n" + }, + "@openzeppelin/contracts/token/ERC721/extensions/ERC721Burnable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC721/extensions/ERC721Burnable.sol)\n\npragma solidity ^0.8.20;\n\nimport {ERC721} from \"../ERC721.sol\";\nimport {Context} from \"../../../utils/Context.sol\";\n\n/**\n * @title ERC-721 Burnable Token\n * @dev ERC-721 Token that can be burned (destroyed).\n */\nabstract contract ERC721Burnable is Context, ERC721 {\n /**\n * @dev Burns `tokenId`. See {ERC721-_burn}.\n *\n * Requirements:\n *\n * - The caller must own `tokenId` or be an approved operator.\n */\n function burn(uint256 tokenId) public virtual {\n // Setting an \"auth\" arguments enables the `_isAuthorized` check which verifies that the token exists\n // (from != 0). Therefore, it is not needed to verify that the return value is not 0 here.\n _update(address(0), tokenId, _msgSender());\n }\n}\n" + }, + "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC721/extensions/ERC721Enumerable.sol)\n\npragma solidity ^0.8.20;\n\nimport {ERC721} from \"../ERC721.sol\";\nimport {IERC721Enumerable} from \"./IERC721Enumerable.sol\";\nimport {IERC165} from \"../../../utils/introspection/ERC165.sol\";\n\n/**\n * @dev This implements an optional extension of {ERC721} defined in the ERC that adds enumerability\n * of all the token ids in the contract as well as all token ids owned by each account.\n *\n * CAUTION: {ERC721} extensions that implement custom `balanceOf` logic, such as {ERC721Consecutive},\n * interfere with enumerability and should not be used together with {ERC721Enumerable}.\n */\nabstract contract ERC721Enumerable is ERC721, IERC721Enumerable {\n mapping(address owner => mapping(uint256 index => uint256)) private _ownedTokens;\n mapping(uint256 tokenId => uint256) private _ownedTokensIndex;\n\n uint256[] private _allTokens;\n mapping(uint256 tokenId => uint256) private _allTokensIndex;\n\n /**\n * @dev An `owner`'s token query was out of bounds for `index`.\n *\n * NOTE: The owner being `address(0)` indicates a global out of bounds index.\n */\n error ERC721OutOfBoundsIndex(address owner, uint256 index);\n\n /**\n * @dev Batch mint is not allowed.\n */\n error ERC721EnumerableForbiddenBatchMint();\n\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165, ERC721) returns (bool) {\n return interfaceId == type(IERC721Enumerable).interfaceId || super.supportsInterface(interfaceId);\n }\n\n /**\n * @dev See {IERC721Enumerable-tokenOfOwnerByIndex}.\n */\n function tokenOfOwnerByIndex(address owner, uint256 index) public view virtual returns (uint256) {\n if (index >= balanceOf(owner)) {\n revert ERC721OutOfBoundsIndex(owner, index);\n }\n return _ownedTokens[owner][index];\n }\n\n /**\n * @dev See {IERC721Enumerable-totalSupply}.\n */\n function totalSupply() public view virtual returns (uint256) {\n return _allTokens.length;\n }\n\n /**\n * @dev See {IERC721Enumerable-tokenByIndex}.\n */\n function tokenByIndex(uint256 index) public view virtual returns (uint256) {\n if (index >= totalSupply()) {\n revert ERC721OutOfBoundsIndex(address(0), index);\n }\n return _allTokens[index];\n }\n\n /**\n * @dev See {ERC721-_update}.\n */\n function _update(address to, uint256 tokenId, address auth) internal virtual override returns (address) {\n address previousOwner = super._update(to, tokenId, auth);\n\n if (previousOwner == address(0)) {\n _addTokenToAllTokensEnumeration(tokenId);\n } else if (previousOwner != to) {\n _removeTokenFromOwnerEnumeration(previousOwner, tokenId);\n }\n if (to == address(0)) {\n _removeTokenFromAllTokensEnumeration(tokenId);\n } else if (previousOwner != to) {\n _addTokenToOwnerEnumeration(to, tokenId);\n }\n\n return previousOwner;\n }\n\n /**\n * @dev Private function to add a token to this extension's ownership-tracking data structures.\n * @param to address representing the new owner of the given token ID\n * @param tokenId uint256 ID of the token to be added to the tokens list of the given address\n */\n function _addTokenToOwnerEnumeration(address to, uint256 tokenId) private {\n uint256 length = balanceOf(to) - 1;\n _ownedTokens[to][length] = tokenId;\n _ownedTokensIndex[tokenId] = length;\n }\n\n /**\n * @dev Private function to add a token to this extension's token tracking data structures.\n * @param tokenId uint256 ID of the token to be added to the tokens list\n */\n function _addTokenToAllTokensEnumeration(uint256 tokenId) private {\n _allTokensIndex[tokenId] = _allTokens.length;\n _allTokens.push(tokenId);\n }\n\n /**\n * @dev Private function to remove a token from this extension's ownership-tracking data structures. Note that\n * while the token is not assigned a new owner, the `_ownedTokensIndex` mapping is _not_ updated: this allows for\n * gas optimizations e.g. when performing a transfer operation (avoiding double writes).\n * This has O(1) time complexity, but alters the order of the _ownedTokens array.\n * @param from address representing the previous owner of the given token ID\n * @param tokenId uint256 ID of the token to be removed from the tokens list of the given address\n */\n function _removeTokenFromOwnerEnumeration(address from, uint256 tokenId) private {\n // To prevent a gap in from's tokens array, we store the last token in the index of the token to delete, and\n // then delete the last slot (swap and pop).\n\n uint256 lastTokenIndex = balanceOf(from);\n uint256 tokenIndex = _ownedTokensIndex[tokenId];\n\n mapping(uint256 index => uint256) storage _ownedTokensByOwner = _ownedTokens[from];\n\n // When the token to delete is the last token, the swap operation is unnecessary\n if (tokenIndex != lastTokenIndex) {\n uint256 lastTokenId = _ownedTokensByOwner[lastTokenIndex];\n\n _ownedTokensByOwner[tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token\n _ownedTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index\n }\n\n // This also deletes the contents at the last position of the array\n delete _ownedTokensIndex[tokenId];\n delete _ownedTokensByOwner[lastTokenIndex];\n }\n\n /**\n * @dev Private function to remove a token from this extension's token tracking data structures.\n * This has O(1) time complexity, but alters the order of the _allTokens array.\n * @param tokenId uint256 ID of the token to be removed from the tokens list\n */\n function _removeTokenFromAllTokensEnumeration(uint256 tokenId) private {\n // To prevent a gap in the tokens array, we store the last token in the index of the token to delete, and\n // then delete the last slot (swap and pop).\n\n uint256 lastTokenIndex = _allTokens.length - 1;\n uint256 tokenIndex = _allTokensIndex[tokenId];\n\n // When the token to delete is the last token, the swap operation is unnecessary. However, since this occurs so\n // rarely (when the last minted token is burnt) that we still do the swap here to avoid the gas cost of adding\n // an 'if' statement (like in _removeTokenFromOwnerEnumeration)\n uint256 lastTokenId = _allTokens[lastTokenIndex];\n\n _allTokens[tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token\n _allTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index\n\n // This also deletes the contents at the last position of the array\n delete _allTokensIndex[tokenId];\n _allTokens.pop();\n }\n\n /**\n * See {ERC721-_increaseBalance}. We need that to account tokens that were minted in batch\n */\n function _increaseBalance(address account, uint128 amount) internal virtual override {\n if (amount > 0) {\n revert ERC721EnumerableForbiddenBatchMint();\n }\n super._increaseBalance(account, amount);\n }\n}\n" + }, + "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC721/extensions/ERC721URIStorage.sol)\n\npragma solidity ^0.8.20;\n\nimport {ERC721} from \"../ERC721.sol\";\nimport {Strings} from \"../../../utils/Strings.sol\";\nimport {IERC4906} from \"../../../interfaces/IERC4906.sol\";\nimport {IERC165} from \"../../../interfaces/IERC165.sol\";\n\n/**\n * @dev ERC-721 token with storage based token URI management.\n */\nabstract contract ERC721URIStorage is IERC4906, ERC721 {\n using Strings for uint256;\n\n // Interface ID as defined in ERC-4906. This does not correspond to a traditional interface ID as ERC-4906 only\n // defines events and does not include any external function.\n bytes4 private constant ERC4906_INTERFACE_ID = bytes4(0x49064906);\n\n // Optional mapping for token URIs\n mapping(uint256 tokenId => string) private _tokenURIs;\n\n /**\n * @dev See {IERC165-supportsInterface}\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override(ERC721, IERC165) returns (bool) {\n return interfaceId == ERC4906_INTERFACE_ID || super.supportsInterface(interfaceId);\n }\n\n /**\n * @dev See {IERC721Metadata-tokenURI}.\n */\n function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {\n _requireOwned(tokenId);\n\n string memory _tokenURI = _tokenURIs[tokenId];\n string memory base = _baseURI();\n\n // If there is no base URI, return the token URI.\n if (bytes(base).length == 0) {\n return _tokenURI;\n }\n // If both are set, concatenate the baseURI and tokenURI (via string.concat).\n if (bytes(_tokenURI).length > 0) {\n return string.concat(base, _tokenURI);\n }\n\n return super.tokenURI(tokenId);\n }\n\n /**\n * @dev Sets `_tokenURI` as the tokenURI of `tokenId`.\n *\n * Emits {MetadataUpdate}.\n */\n function _setTokenURI(uint256 tokenId, string memory _tokenURI) internal virtual {\n _tokenURIs[tokenId] = _tokenURI;\n emit MetadataUpdate(tokenId);\n }\n}\n" + }, + "@openzeppelin/contracts/token/ERC721/extensions/ERC721Votes.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC721/extensions/ERC721Votes.sol)\n\npragma solidity ^0.8.20;\n\nimport {ERC721} from \"../ERC721.sol\";\nimport {Votes} from \"../../../governance/utils/Votes.sol\";\n\n/**\n * @dev Extension of ERC-721 to support voting and delegation as implemented by {Votes}, where each individual NFT counts\n * as 1 vote unit.\n *\n * Tokens do not count as votes until they are delegated, because votes must be tracked which incurs an additional cost\n * on every transfer. Token holders can either delegate to a trusted representative who will decide how to make use of\n * the votes in governance decisions, or they can delegate to themselves to be their own representative.\n */\nabstract contract ERC721Votes is ERC721, Votes {\n /**\n * @dev See {ERC721-_update}. Adjusts votes when tokens are transferred.\n *\n * Emits a {IVotes-DelegateVotesChanged} event.\n */\n function _update(address to, uint256 tokenId, address auth) internal virtual override returns (address) {\n address previousOwner = super._update(to, tokenId, auth);\n\n _transferVotingUnits(previousOwner, to, 1);\n\n return previousOwner;\n }\n\n /**\n * @dev Returns the balance of `account`.\n *\n * WARNING: Overriding this function will likely result in incorrect vote tracking.\n */\n function _getVotingUnits(address account) internal view virtual override returns (uint256) {\n return balanceOf(account);\n }\n\n /**\n * @dev See {ERC721-_increaseBalance}. We need that to account tokens that were minted in batch.\n */\n function _increaseBalance(address account, uint128 amount) internal virtual override {\n super._increaseBalance(account, amount);\n _transferVotingUnits(address(0), account, amount);\n }\n}\n" + }, + "@openzeppelin/contracts/token/ERC721/extensions/IERC721Enumerable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC721/extensions/IERC721Enumerable.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC721} from \"../IERC721.sol\";\n\n/**\n * @title ERC-721 Non-Fungible Token Standard, optional enumeration extension\n * @dev See https://eips.ethereum.org/EIPS/eip-721\n */\ninterface IERC721Enumerable is IERC721 {\n /**\n * @dev Returns the total amount of tokens stored by the contract.\n */\n function totalSupply() external view returns (uint256);\n\n /**\n * @dev Returns a token ID owned by `owner` at a given `index` of its token list.\n * Use along with {balanceOf} to enumerate all of ``owner``'s tokens.\n */\n function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256);\n\n /**\n * @dev Returns a token ID at a given `index` of all the tokens stored by the contract.\n * Use along with {totalSupply} to enumerate all tokens.\n */\n function tokenByIndex(uint256 index) external view returns (uint256);\n}\n" + }, + "@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC721/extensions/IERC721Metadata.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC721} from \"../IERC721.sol\";\n\n/**\n * @title ERC-721 Non-Fungible Token Standard, optional metadata extension\n * @dev See https://eips.ethereum.org/EIPS/eip-721\n */\ninterface IERC721Metadata is IERC721 {\n /**\n * @dev Returns the token collection name.\n */\n function name() external view returns (string memory);\n\n /**\n * @dev Returns the token collection symbol.\n */\n function symbol() external view returns (string memory);\n\n /**\n * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token.\n */\n function tokenURI(uint256 tokenId) external view returns (string memory);\n}\n" + }, + "@openzeppelin/contracts/token/ERC721/IERC721.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC721/IERC721.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC165} from \"../../utils/introspection/IERC165.sol\";\n\n/**\n * @dev Required interface of an ERC-721 compliant contract.\n */\ninterface IERC721 is IERC165 {\n /**\n * @dev Emitted when `tokenId` token is transferred from `from` to `to`.\n */\n event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);\n\n /**\n * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.\n */\n event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);\n\n /**\n * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.\n */\n event ApprovalForAll(address indexed owner, address indexed operator, bool approved);\n\n /**\n * @dev Returns the number of tokens in ``owner``'s account.\n */\n function balanceOf(address owner) external view returns (uint256 balance);\n\n /**\n * @dev Returns the owner of the `tokenId` token.\n *\n * Requirements:\n *\n * - `tokenId` must exist.\n */\n function ownerOf(uint256 tokenId) external view returns (address owner);\n\n /**\n * @dev Safely transfers `tokenId` token from `from` to `to`.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `tokenId` token must exist and be owned by `from`.\n * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon\n * a safe transfer.\n *\n * Emits a {Transfer} event.\n */\n function safeTransferFrom(address from, address to, uint256 tokenId, bytes calldata data) external;\n\n /**\n * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients\n * are aware of the ERC-721 protocol to prevent tokens from being forever locked.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `tokenId` token must exist and be owned by `from`.\n * - If the caller is not `from`, it must have been allowed to move this token by either {approve} or\n * {setApprovalForAll}.\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon\n * a safe transfer.\n *\n * Emits a {Transfer} event.\n */\n function safeTransferFrom(address from, address to, uint256 tokenId) external;\n\n /**\n * @dev Transfers `tokenId` token from `from` to `to`.\n *\n * WARNING: Note that the caller is responsible to confirm that the recipient is capable of receiving ERC-721\n * or else they may be permanently lost. Usage of {safeTransferFrom} prevents loss, though the caller must\n * understand this adds an external call which potentially creates a reentrancy vulnerability.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `tokenId` token must be owned by `from`.\n * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(address from, address to, uint256 tokenId) external;\n\n /**\n * @dev Gives permission to `to` to transfer `tokenId` token to another account.\n * The approval is cleared when the token is transferred.\n *\n * Only a single account can be approved at a time, so approving the zero address clears previous approvals.\n *\n * Requirements:\n *\n * - The caller must own the token or be an approved operator.\n * - `tokenId` must exist.\n *\n * Emits an {Approval} event.\n */\n function approve(address to, uint256 tokenId) external;\n\n /**\n * @dev Approve or remove `operator` as an operator for the caller.\n * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.\n *\n * Requirements:\n *\n * - The `operator` cannot be the address zero.\n *\n * Emits an {ApprovalForAll} event.\n */\n function setApprovalForAll(address operator, bool approved) external;\n\n /**\n * @dev Returns the account approved for `tokenId` token.\n *\n * Requirements:\n *\n * - `tokenId` must exist.\n */\n function getApproved(uint256 tokenId) external view returns (address operator);\n\n /**\n * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.\n *\n * See {setApprovalForAll}\n */\n function isApprovedForAll(address owner, address operator) external view returns (bool);\n}\n" + }, + "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC721/IERC721Receiver.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @title ERC-721 token receiver interface\n * @dev Interface for any contract that wants to support safeTransfers\n * from ERC-721 asset contracts.\n */\ninterface IERC721Receiver {\n /**\n * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom}\n * by `operator` from `from`, this function is called.\n *\n * It must return its Solidity selector to confirm the token transfer.\n * If any other value is returned or the interface is not implemented by the recipient, the transfer will be\n * reverted.\n *\n * The selector can be obtained in Solidity with `IERC721Receiver.onERC721Received.selector`.\n */\n function onERC721Received(\n address operator,\n address from,\n uint256 tokenId,\n bytes calldata data\n ) external returns (bytes4);\n}\n" + }, + "@openzeppelin/contracts/token/ERC721/utils/ERC721Utils.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC721/utils/ERC721Utils.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC721Receiver} from \"../IERC721Receiver.sol\";\nimport {IERC721Errors} from \"../../../interfaces/draft-IERC6093.sol\";\n\n/**\n * @dev Library that provide common ERC-721 utility functions.\n *\n * See https://eips.ethereum.org/EIPS/eip-721[ERC-721].\n *\n * _Available since v5.1._\n */\nlibrary ERC721Utils {\n /**\n * @dev Performs an acceptance check for the provided `operator` by calling {IERC721-onERC721Received}\n * on the `to` address. The `operator` is generally the address that initiated the token transfer (i.e. `msg.sender`).\n *\n * The acceptance call is not executed and treated as a no-op if the target address doesn't contain code (i.e. an EOA).\n * Otherwise, the recipient must implement {IERC721Receiver-onERC721Received} and return the acceptance magic value to accept\n * the transfer.\n */\n function checkOnERC721Received(\n address operator,\n address from,\n address to,\n uint256 tokenId,\n bytes memory data\n ) internal {\n if (to.code.length > 0) {\n try IERC721Receiver(to).onERC721Received(operator, from, tokenId, data) returns (bytes4 retval) {\n if (retval != IERC721Receiver.onERC721Received.selector) {\n // Token rejected\n revert IERC721Errors.ERC721InvalidReceiver(to);\n }\n } catch (bytes memory reason) {\n if (reason.length == 0) {\n // non-IERC721Receiver implementer\n revert IERC721Errors.ERC721InvalidReceiver(to);\n } else {\n assembly (\"memory-safe\") {\n revert(add(32, reason), mload(reason))\n }\n }\n }\n }\n }\n}\n" + }, + "@openzeppelin/contracts/utils/Address.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/Address.sol)\n\npragma solidity ^0.8.20;\n\nimport {Errors} from \"./Errors.sol\";\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary Address {\n /**\n * @dev There's no code at `target` (it is not a contract).\n */\n error AddressEmptyCode(address target);\n\n /**\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\n * `recipient`, forwarding all available gas and reverting on errors.\n *\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\n * imposed by `transfer`, making them unable to receive funds via\n * `transfer`. {sendValue} removes this limitation.\n *\n * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n *\n * IMPORTANT: because control is transferred to `recipient`, care must be\n * taken to not create reentrancy vulnerabilities. Consider using\n * {ReentrancyGuard} or the\n * https://solidity.readthedocs.io/en/v0.8.20/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n */\n function sendValue(address payable recipient, uint256 amount) internal {\n if (address(this).balance < amount) {\n revert Errors.InsufficientBalance(address(this).balance, amount);\n }\n\n (bool success, ) = recipient.call{value: amount}(\"\");\n if (!success) {\n revert Errors.FailedCall();\n }\n }\n\n /**\n * @dev Performs a Solidity function call using a low level `call`. A\n * plain `call` is an unsafe replacement for a function call: use this\n * function instead.\n *\n * If `target` reverts with a revert reason or custom error, it is bubbled\n * up by this function (like regular Solidity function calls). However, if\n * the call reverted with no returned reason, this function reverts with a\n * {Errors.FailedCall} error.\n *\n * Returns the raw returned data. To convert to the expected return value,\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\n *\n * Requirements:\n *\n * - `target` must be a contract.\n * - calling `target` with `data` must not revert.\n */\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but also transferring `value` wei to `target`.\n *\n * Requirements:\n *\n * - the calling contract must have an ETH balance of at least `value`.\n * - the called Solidity function must be `payable`.\n */\n function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {\n if (address(this).balance < value) {\n revert Errors.InsufficientBalance(address(this).balance, value);\n }\n (bool success, bytes memory returndata) = target.call{value: value}(data);\n return verifyCallResultFromTarget(target, success, returndata);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a static call.\n */\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\n (bool success, bytes memory returndata) = target.staticcall(data);\n return verifyCallResultFromTarget(target, success, returndata);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a delegate call.\n */\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\n (bool success, bytes memory returndata) = target.delegatecall(data);\n return verifyCallResultFromTarget(target, success, returndata);\n }\n\n /**\n * @dev Tool to verify that a low level call to smart-contract was successful, and reverts if the target\n * was not a contract or bubbling up the revert reason (falling back to {Errors.FailedCall}) in case\n * of an unsuccessful call.\n */\n function verifyCallResultFromTarget(\n address target,\n bool success,\n bytes memory returndata\n ) internal view returns (bytes memory) {\n if (!success) {\n _revert(returndata);\n } else {\n // only check if target is a contract if the call was successful and the return data is empty\n // otherwise we already know that it was a contract\n if (returndata.length == 0 && target.code.length == 0) {\n revert AddressEmptyCode(target);\n }\n return returndata;\n }\n }\n\n /**\n * @dev Tool to verify that a low level call was successful, and reverts if it wasn't, either by bubbling the\n * revert reason or with a default {Errors.FailedCall} error.\n */\n function verifyCallResult(bool success, bytes memory returndata) internal pure returns (bytes memory) {\n if (!success) {\n _revert(returndata);\n } else {\n return returndata;\n }\n }\n\n /**\n * @dev Reverts with returndata if present. Otherwise reverts with {Errors.FailedCall}.\n */\n function _revert(bytes memory returndata) private pure {\n // Look for revert reason and bubble it up if present\n if (returndata.length > 0) {\n // The easiest way to bubble the revert reason is using memory via assembly\n assembly (\"memory-safe\") {\n let returndata_size := mload(returndata)\n revert(add(32, returndata), returndata_size)\n }\n } else {\n revert Errors.FailedCall();\n }\n }\n}\n" + }, + "@openzeppelin/contracts/utils/Context.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract Context {\n function _msgSender() internal view virtual returns (address) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual returns (bytes calldata) {\n return msg.data;\n }\n\n function _contextSuffixLength() internal view virtual returns (uint256) {\n return 0;\n }\n}\n" + }, + "@openzeppelin/contracts/utils/cryptography/ECDSA.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/cryptography/ECDSA.sol)\n\npragma solidity ^0.8.20;\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 }\n\n /**\n * @dev The signature derives the `address(0)`.\n */\n error ECDSAInvalidSignature();\n\n /**\n * @dev The signature has an invalid length.\n */\n error ECDSAInvalidSignatureLength(uint256 length);\n\n /**\n * @dev The signature has an S value that is in the upper half order.\n */\n error ECDSAInvalidSignatureS(bytes32 s);\n\n /**\n * @dev Returns the address that signed a hashed message (`hash`) with `signature` or an error. This will not\n * return address(0) without also returning an error description. Errors are documented using an enum (error type)\n * and a bytes32 providing additional information about the error.\n *\n * If no error is returned, then the address can be used for verification purposes.\n *\n * The `ecrecover` EVM precompile 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 {MessageHashUtils-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 function tryRecover(\n bytes32 hash,\n bytes memory signature\n ) internal pure returns (address recovered, RecoverError err, bytes32 errArg) {\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 assembly (\"memory-safe\") {\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, bytes32(signature.length));\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 precompile 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 {MessageHashUtils-toEthSignedMessageHash} on it.\n */\n function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {\n (address recovered, RecoverError error, bytes32 errorArg) = tryRecover(hash, signature);\n _throwError(error, errorArg);\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[ERC-2098 short signatures]\n */\n function tryRecover(\n bytes32 hash,\n bytes32 r,\n bytes32 vs\n ) internal pure returns (address recovered, RecoverError err, bytes32 errArg) {\n unchecked {\n bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff);\n // We do not check for an overflow here since the shift operation results in 0 or 1.\n uint8 v = uint8((uint256(vs) >> 255) + 27);\n return tryRecover(hash, v, r, s);\n }\n }\n\n /**\n * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately.\n */\n function recover(bytes32 hash, bytes32 r, bytes32 vs) internal pure returns (address) {\n (address recovered, RecoverError error, bytes32 errorArg) = tryRecover(hash, r, vs);\n _throwError(error, errorArg);\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 function tryRecover(\n bytes32 hash,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) internal pure returns (address recovered, RecoverError err, bytes32 errArg) {\n // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature\n // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines\n // the valid range for s in (301): 0 < s < secp256k1n ÷ 2 + 1, and for v in (302): v ∈ {27, 28}. Most\n // signatures from current libraries generate a unique signature with an s-value in the lower half order.\n //\n // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value\n // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or\n // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept\n // these malleable signatures as well.\n if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) {\n return (address(0), RecoverError.InvalidSignatureS, s);\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, bytes32(0));\n }\n\n return (signer, RecoverError.NoError, bytes32(0));\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, bytes32 errorArg) = tryRecover(hash, v, r, s);\n _throwError(error, errorArg);\n return recovered;\n }\n\n /**\n * @dev Optionally reverts with the corresponding custom error according to the `error` argument provided.\n */\n function _throwError(RecoverError error, bytes32 errorArg) private pure {\n if (error == RecoverError.NoError) {\n return; // no error: do nothing\n } else if (error == RecoverError.InvalidSignature) {\n revert ECDSAInvalidSignature();\n } else if (error == RecoverError.InvalidSignatureLength) {\n revert ECDSAInvalidSignatureLength(uint256(errorArg));\n } else if (error == RecoverError.InvalidSignatureS) {\n revert ECDSAInvalidSignatureS(errorArg);\n }\n }\n}\n" + }, + "@openzeppelin/contracts/utils/cryptography/EIP712.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/cryptography/EIP712.sol)\n\npragma solidity ^0.8.20;\n\nimport {MessageHashUtils} from \"./MessageHashUtils.sol\";\nimport {ShortStrings, ShortString} from \"../ShortStrings.sol\";\nimport {IERC5267} from \"../../interfaces/IERC5267.sol\";\n\n/**\n * @dev https://eips.ethereum.org/EIPS/eip-712[EIP-712] is a standard for hashing and signing of typed structured data.\n *\n * The encoding scheme specified in the EIP requires a domain separator and a hash of the typed structured data, whose\n * encoding is very generic and therefore its implementation in Solidity is not feasible, thus this contract\n * does not implement the encoding itself. Protocols need to implement the type-specific encoding they need in order to\n * produce the hash of their typed data using a combination of `abi.encode` and `keccak256`.\n *\n * This contract implements the EIP-712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding\n * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA\n * ({_hashTypedDataV4}).\n *\n * The implementation of the domain separator was designed to be as efficient as possible while still properly updating\n * the chain id to protect against replay attacks on an eventual fork of the chain.\n *\n * NOTE: This contract implements the version of the encoding known as \"v4\", as implemented by the JSON RPC method\n * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask].\n *\n * NOTE: In the upgradeable version of this contract, the cached values will correspond to the address, and the domain\n * separator of the implementation contract. This will cause the {_domainSeparatorV4} function to always rebuild the\n * separator from the immutable values, which is cheaper than accessing a cached version in cold storage.\n *\n * @custom:oz-upgrades-unsafe-allow state-variable-immutable\n */\nabstract contract EIP712 is IERC5267 {\n using ShortStrings for *;\n\n bytes32 private constant TYPE_HASH =\n keccak256(\"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)\");\n\n // Cache the domain separator as an immutable value, but also store the chain id that it corresponds to, in order to\n // invalidate the cached domain separator if the chain id changes.\n bytes32 private immutable _cachedDomainSeparator;\n uint256 private immutable _cachedChainId;\n address private immutable _cachedThis;\n\n bytes32 private immutable _hashedName;\n bytes32 private immutable _hashedVersion;\n\n ShortString private immutable _name;\n ShortString private immutable _version;\n string private _nameFallback;\n string private _versionFallback;\n\n /**\n * @dev Initializes the domain separator and parameter caches.\n *\n * The meaning of `name` and `version` is specified in\n * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP-712]:\n *\n * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol.\n * - `version`: the current major version of the signing domain.\n *\n * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart\n * contract upgrade].\n */\n constructor(string memory name, string memory version) {\n _name = name.toShortStringWithFallback(_nameFallback);\n _version = version.toShortStringWithFallback(_versionFallback);\n _hashedName = keccak256(bytes(name));\n _hashedVersion = keccak256(bytes(version));\n\n _cachedChainId = block.chainid;\n _cachedDomainSeparator = _buildDomainSeparator();\n _cachedThis = address(this);\n }\n\n /**\n * @dev Returns the domain separator for the current chain.\n */\n function _domainSeparatorV4() internal view returns (bytes32) {\n if (address(this) == _cachedThis && block.chainid == _cachedChainId) {\n return _cachedDomainSeparator;\n } else {\n return _buildDomainSeparator();\n }\n }\n\n function _buildDomainSeparator() private view returns (bytes32) {\n return keccak256(abi.encode(TYPE_HASH, _hashedName, _hashedVersion, block.chainid, address(this)));\n }\n\n /**\n * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this\n * function returns the hash of the fully encoded EIP712 message for this domain.\n *\n * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example:\n *\n * ```solidity\n * bytes32 digest = _hashTypedDataV4(keccak256(abi.encode(\n * keccak256(\"Mail(address to,string contents)\"),\n * mailTo,\n * keccak256(bytes(mailContents))\n * )));\n * address signer = ECDSA.recover(digest, signature);\n * ```\n */\n function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) {\n return MessageHashUtils.toTypedDataHash(_domainSeparatorV4(), structHash);\n }\n\n /**\n * @dev See {IERC-5267}.\n */\n function eip712Domain()\n public\n view\n virtual\n returns (\n bytes1 fields,\n string memory name,\n string memory version,\n uint256 chainId,\n address verifyingContract,\n bytes32 salt,\n uint256[] memory extensions\n )\n {\n return (\n hex\"0f\", // 01111\n _EIP712Name(),\n _EIP712Version(),\n block.chainid,\n address(this),\n bytes32(0),\n new uint256[](0)\n );\n }\n\n /**\n * @dev The name parameter for the EIP712 domain.\n *\n * NOTE: By default this function reads _name which is an immutable value.\n * It only reads from storage if necessary (in case the value is too large to fit in a ShortString).\n */\n // solhint-disable-next-line func-name-mixedcase\n function _EIP712Name() internal view returns (string memory) {\n return _name.toStringWithFallback(_nameFallback);\n }\n\n /**\n * @dev The version parameter for the EIP712 domain.\n *\n * NOTE: By default this function reads _version which is an immutable value.\n * It only reads from storage if necessary (in case the value is too large to fit in a ShortString).\n */\n // solhint-disable-next-line func-name-mixedcase\n function _EIP712Version() internal view returns (string memory) {\n return _version.toStringWithFallback(_versionFallback);\n }\n}\n" + }, + "@openzeppelin/contracts/utils/cryptography/MessageHashUtils.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/cryptography/MessageHashUtils.sol)\n\npragma solidity ^0.8.20;\n\nimport {Strings} from \"../Strings.sol\";\n\n/**\n * @dev Signature message hash utilities for producing digests to be consumed by {ECDSA} recovery or signing.\n *\n * The library provides methods for generating a hash of a message that conforms to the\n * https://eips.ethereum.org/EIPS/eip-191[ERC-191] and https://eips.ethereum.org/EIPS/eip-712[EIP 712]\n * specifications.\n */\nlibrary MessageHashUtils {\n /**\n * @dev Returns the keccak256 digest of an ERC-191 signed data with version\n * `0x45` (`personal_sign` messages).\n *\n * The digest is calculated by prefixing a bytes32 `messageHash` with\n * `\"\\x19Ethereum Signed Message:\\n32\"` and hashing the result. It corresponds with the\n * hash signed when using the https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] JSON-RPC method.\n *\n * NOTE: The `messageHash` parameter is intended to be the result of hashing a raw message with\n * keccak256, although any bytes32 value can be safely used because the final digest will\n * be re-hashed.\n *\n * See {ECDSA-recover}.\n */\n function toEthSignedMessageHash(bytes32 messageHash) internal pure returns (bytes32 digest) {\n assembly (\"memory-safe\") {\n mstore(0x00, \"\\x19Ethereum Signed Message:\\n32\") // 32 is the bytes-length of messageHash\n mstore(0x1c, messageHash) // 0x1c (28) is the length of the prefix\n digest := keccak256(0x00, 0x3c) // 0x3c is the length of the prefix (0x1c) + messageHash (0x20)\n }\n }\n\n /**\n * @dev Returns the keccak256 digest of an ERC-191 signed data with version\n * `0x45` (`personal_sign` messages).\n *\n * The digest is calculated by prefixing an arbitrary `message` with\n * `\"\\x19Ethereum Signed Message:\\n\" + len(message)` and hashing the result. It corresponds with the\n * hash signed when using the https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] JSON-RPC method.\n *\n * See {ECDSA-recover}.\n */\n function toEthSignedMessageHash(bytes memory message) internal pure returns (bytes32) {\n return\n keccak256(bytes.concat(\"\\x19Ethereum Signed Message:\\n\", bytes(Strings.toString(message.length)), message));\n }\n\n /**\n * @dev Returns the keccak256 digest of an ERC-191 signed data with version\n * `0x00` (data with intended validator).\n *\n * The digest is calculated by prefixing an arbitrary `data` with `\"\\x19\\x00\"` and the intended\n * `validator` address. Then hashing the result.\n *\n * See {ECDSA-recover}.\n */\n function toDataWithIntendedValidatorHash(address validator, bytes memory data) internal pure returns (bytes32) {\n return keccak256(abi.encodePacked(hex\"19_00\", validator, data));\n }\n\n /**\n * @dev Returns the keccak256 digest of an EIP-712 typed data (ERC-191 version `0x01`).\n *\n * The digest is calculated from a `domainSeparator` and a `structHash`, by prefixing them with\n * `\\x19\\x01` and hashing the result. It corresponds to the hash signed by the\n * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`] JSON-RPC method as part of EIP-712.\n *\n * See {ECDSA-recover}.\n */\n function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32 digest) {\n assembly (\"memory-safe\") {\n let ptr := mload(0x40)\n mstore(ptr, hex\"19_01\")\n mstore(add(ptr, 0x02), domainSeparator)\n mstore(add(ptr, 0x22), structHash)\n digest := keccak256(ptr, 0x42)\n }\n }\n}\n" + }, + "@openzeppelin/contracts/utils/cryptography/SignatureChecker.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/cryptography/SignatureChecker.sol)\n\npragma solidity ^0.8.20;\n\nimport {ECDSA} from \"./ECDSA.sol\";\nimport {IERC1271} from \"../../interfaces/IERC1271.sol\";\n\n/**\n * @dev Signature verification helper that can be used instead of `ECDSA.recover` to seamlessly support both ECDSA\n * signatures from externally owned accounts (EOAs) as well as ERC-1271 signatures from smart contract wallets like\n * Argent and Safe Wallet (previously Gnosis Safe).\n */\nlibrary SignatureChecker {\n /**\n * @dev Checks if a signature is valid for a given signer and data hash. If the signer is a smart contract, the\n * signature is validated against that smart contract using ERC-1271, otherwise it's validated using `ECDSA.recover`.\n *\n * NOTE: Unlike ECDSA signatures, contract signatures are revocable, and the outcome of this function can thus\n * change through time. It could return true at block N and false at block N+1 (or the opposite).\n */\n function isValidSignatureNow(address signer, bytes32 hash, bytes memory signature) internal view returns (bool) {\n if (signer.code.length == 0) {\n (address recovered, ECDSA.RecoverError err, ) = ECDSA.tryRecover(hash, signature);\n return err == ECDSA.RecoverError.NoError && recovered == signer;\n } else {\n return isValidERC1271SignatureNow(signer, hash, signature);\n }\n }\n\n /**\n * @dev Checks if a signature is valid for a given signer and data hash. The signature is validated\n * against the signer smart contract using ERC-1271.\n *\n * NOTE: Unlike ECDSA signatures, contract signatures are revocable, and the outcome of this function can thus\n * change through time. It could return true at block N and false at block N+1 (or the opposite).\n */\n function isValidERC1271SignatureNow(\n address signer,\n bytes32 hash,\n bytes memory signature\n ) internal view returns (bool) {\n (bool success, bytes memory result) = signer.staticcall(\n abi.encodeCall(IERC1271.isValidSignature, (hash, signature))\n );\n return (success &&\n result.length >= 32 &&\n abi.decode(result, (bytes32)) == bytes32(IERC1271.isValidSignature.selector));\n }\n}\n" + }, + "@openzeppelin/contracts/utils/Errors.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/Errors.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Collection of common custom errors used in multiple contracts\n *\n * IMPORTANT: Backwards compatibility is not guaranteed in future versions of the library.\n * It is recommended to avoid relying on the error API for critical functionality.\n *\n * _Available since v5.1._\n */\nlibrary Errors {\n /**\n * @dev The ETH balance of the account is not enough to perform the operation.\n */\n error InsufficientBalance(uint256 balance, uint256 needed);\n\n /**\n * @dev A call to an address target failed. The target may have reverted.\n */\n error FailedCall();\n\n /**\n * @dev The deployment failed.\n */\n error FailedDeployment();\n\n /**\n * @dev A necessary precompile is missing.\n */\n error MissingPrecompile(address);\n}\n" + }, + "@openzeppelin/contracts/utils/introspection/ERC165.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/introspection/ERC165.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC165} from \"./IERC165.sol\";\n\n/**\n * @dev Implementation of the {IERC165} interface.\n *\n * Contracts that want to implement ERC-165 should inherit from this contract and override {supportsInterface} to check\n * for the additional interface id that will be supported. For example:\n *\n * ```solidity\n * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);\n * }\n * ```\n */\nabstract contract ERC165 is IERC165 {\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) {\n return interfaceId == type(IERC165).interfaceId;\n }\n}\n" + }, + "@openzeppelin/contracts/utils/introspection/IERC165.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/introspection/IERC165.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Interface of the ERC-165 standard, as defined in the\n * https://eips.ethereum.org/EIPS/eip-165[ERC].\n *\n * Implementers can declare support of contract interfaces, which can then be\n * queried by others ({ERC165Checker}).\n *\n * For an implementation, see {ERC165}.\n */\ninterface IERC165 {\n /**\n * @dev Returns true if this contract implements the interface defined by\n * `interfaceId`. See the corresponding\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[ERC section]\n * to learn more about how these ids are created.\n *\n * This function call must use less than 30 000 gas.\n */\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\n}\n" + }, + "@openzeppelin/contracts/utils/math/Math.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/math/Math.sol)\n\npragma solidity ^0.8.20;\n\nimport {Panic} from \"../Panic.sol\";\nimport {SafeCast} from \"./SafeCast.sol\";\n\n/**\n * @dev Standard math utilities missing in the Solidity language.\n */\nlibrary Math {\n enum Rounding {\n Floor, // Toward negative infinity\n Ceil, // Toward positive infinity\n Trunc, // Toward zero\n Expand // Away from zero\n }\n\n /**\n * @dev Returns the addition of two unsigned integers, with an success flag (no overflow).\n */\n function tryAdd(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\n unchecked {\n uint256 c = a + b;\n if (c < a) return (false, 0);\n return (true, c);\n }\n }\n\n /**\n * @dev Returns the subtraction of two unsigned integers, with an success flag (no overflow).\n */\n function trySub(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\n unchecked {\n if (b > a) return (false, 0);\n return (true, a - b);\n }\n }\n\n /**\n * @dev Returns the multiplication of two unsigned integers, with an success flag (no overflow).\n */\n function tryMul(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\n unchecked {\n // Gas optimization: this is cheaper than requiring 'a' not being zero, but the\n // benefit is lost if 'b' is also tested.\n // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522\n if (a == 0) return (true, 0);\n uint256 c = a * b;\n if (c / a != b) return (false, 0);\n return (true, c);\n }\n }\n\n /**\n * @dev Returns the division of two unsigned integers, with a success flag (no division by zero).\n */\n function tryDiv(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\n unchecked {\n if (b == 0) return (false, 0);\n return (true, a / b);\n }\n }\n\n /**\n * @dev Returns the remainder of dividing two unsigned integers, with a success flag (no division by zero).\n */\n function tryMod(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\n unchecked {\n if (b == 0) return (false, 0);\n return (true, a % b);\n }\n }\n\n /**\n * @dev Branchless ternary evaluation for `a ? b : c`. Gas costs are constant.\n *\n * IMPORTANT: This function may reduce bytecode size and consume less gas when used standalone.\n * However, the compiler may optimize Solidity ternary operations (i.e. `a ? b : c`) to only compute\n * one branch when needed, making this function more expensive.\n */\n function ternary(bool condition, uint256 a, uint256 b) internal pure returns (uint256) {\n unchecked {\n // branchless ternary works because:\n // b ^ (a ^ b) == a\n // b ^ 0 == b\n return b ^ ((a ^ b) * SafeCast.toUint(condition));\n }\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 ternary(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 ternary(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 towards infinity instead\n * of rounding towards zero.\n */\n function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {\n if (b == 0) {\n // Guarantee the same behavior as in a regular Solidity division.\n Panic.panic(Panic.DIVISION_BY_ZERO);\n }\n\n // The following calculation ensures accurate ceiling division without overflow.\n // Since a is non-zero, (a - 1) / b will not overflow.\n // The largest possible result occurs when (a - 1) / b is type(uint256).max,\n // but the largest value we can obtain is type(uint256).max - 1, which happens\n // when a = type(uint256).max and b = 1.\n unchecked {\n return SafeCast.toUint(a > 0) * ((a - 1) / b + 1);\n }\n }\n\n /**\n * @dev Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or\n * denominator == 0.\n *\n * Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv) with further edits by\n * 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²⁵⁶ and mod 2²⁵⁶ - 1, then use\n // the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256\n // variables such that product = prod1 * 2²⁵⁶ + prod0.\n uint256 prod0 = x * y; // 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 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²⁵⁶. Also prevents denominator == 0.\n if (denominator <= prod1) {\n Panic.panic(ternary(denominator == 0, Panic.DIVISION_BY_ZERO, Panic.UNDER_OVERFLOW));\n }\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.\n // Always >= 1. See https://cs.stackexchange.com/q/138556/92363.\n\n uint256 twos = denominator & (0 - denominator);\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²⁵⁶ / 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²⁵⁶. Now that denominator is an odd number, it has an inverse modulo 2²⁵⁶ such\n // that denominator * inv ≡ 1 mod 2²⁵⁶. Compute the inverse by starting with a seed that is correct for\n // four bits. That is, denominator * inv ≡ 1 mod 2⁴.\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\n // works in modular arithmetic, doubling the correct bits in each step.\n inverse *= 2 - denominator * inverse; // inverse mod 2⁸\n inverse *= 2 - denominator * inverse; // inverse mod 2¹⁶\n inverse *= 2 - denominator * inverse; // inverse mod 2³²\n inverse *= 2 - denominator * inverse; // inverse mod 2⁶⁴\n inverse *= 2 - denominator * inverse; // inverse mod 2¹²⁸\n inverse *= 2 - denominator * inverse; // inverse mod 2²⁵⁶\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²⁵⁶. Since the preconditions guarantee that the outcome is\n // less than 2²⁵⁶, 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 * @dev 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 return mulDiv(x, y, denominator) + SafeCast.toUint(unsignedRoundsUp(rounding) && mulmod(x, y, denominator) > 0);\n }\n\n /**\n * @dev Calculate the modular multiplicative inverse of a number in Z/nZ.\n *\n * If n is a prime, then Z/nZ is a field. In that case all elements are inversible, except 0.\n * If n is not a prime, then Z/nZ is not a field, and some elements might not be inversible.\n *\n * If the input value is not inversible, 0 is returned.\n *\n * NOTE: If you know for sure that n is (big) a prime, it may be cheaper to use Fermat's little theorem and get the\n * inverse using `Math.modExp(a, n - 2, n)`. See {invModPrime}.\n */\n function invMod(uint256 a, uint256 n) internal pure returns (uint256) {\n unchecked {\n if (n == 0) return 0;\n\n // The inverse modulo is calculated using the Extended Euclidean Algorithm (iterative version)\n // Used to compute integers x and y such that: ax + ny = gcd(a, n).\n // When the gcd is 1, then the inverse of a modulo n exists and it's x.\n // ax + ny = 1\n // ax = 1 + (-y)n\n // ax ≡ 1 (mod n) # x is the inverse of a modulo n\n\n // If the remainder is 0 the gcd is n right away.\n uint256 remainder = a % n;\n uint256 gcd = n;\n\n // Therefore the initial coefficients are:\n // ax + ny = gcd(a, n) = n\n // 0a + 1n = n\n int256 x = 0;\n int256 y = 1;\n\n while (remainder != 0) {\n uint256 quotient = gcd / remainder;\n\n (gcd, remainder) = (\n // The old remainder is the next gcd to try.\n remainder,\n // Compute the next remainder.\n // Can't overflow given that (a % gcd) * (gcd // (a % gcd)) <= gcd\n // where gcd is at most n (capped to type(uint256).max)\n gcd - remainder * quotient\n );\n\n (x, y) = (\n // Increment the coefficient of a.\n y,\n // Decrement the coefficient of n.\n // Can overflow, but the result is casted to uint256 so that the\n // next value of y is \"wrapped around\" to a value between 0 and n - 1.\n x - y * int256(quotient)\n );\n }\n\n if (gcd != 1) return 0; // No inverse exists.\n return ternary(x < 0, n - uint256(-x), uint256(x)); // Wrap the result if it's negative.\n }\n }\n\n /**\n * @dev Variant of {invMod}. More efficient, but only works if `p` is known to be a prime greater than `2`.\n *\n * From https://en.wikipedia.org/wiki/Fermat%27s_little_theorem[Fermat's little theorem], we know that if p is\n * prime, then `a**(p-1) ≡ 1 mod p`. As a consequence, we have `a * a**(p-2) ≡ 1 mod p`, which means that\n * `a**(p-2)` is the modular multiplicative inverse of a in Fp.\n *\n * NOTE: this function does NOT check that `p` is a prime greater than `2`.\n */\n function invModPrime(uint256 a, uint256 p) internal view returns (uint256) {\n unchecked {\n return Math.modExp(a, p - 2, p);\n }\n }\n\n /**\n * @dev Returns the modular exponentiation of the specified base, exponent and modulus (b ** e % m)\n *\n * Requirements:\n * - modulus can't be zero\n * - underlying staticcall to precompile must succeed\n *\n * IMPORTANT: The result is only valid if the underlying call succeeds. When using this function, make\n * sure the chain you're using it on supports the precompiled contract for modular exponentiation\n * at address 0x05 as specified in https://eips.ethereum.org/EIPS/eip-198[EIP-198]. Otherwise,\n * the underlying function will succeed given the lack of a revert, but the result may be incorrectly\n * interpreted as 0.\n */\n function modExp(uint256 b, uint256 e, uint256 m) internal view returns (uint256) {\n (bool success, uint256 result) = tryModExp(b, e, m);\n if (!success) {\n Panic.panic(Panic.DIVISION_BY_ZERO);\n }\n return result;\n }\n\n /**\n * @dev Returns the modular exponentiation of the specified base, exponent and modulus (b ** e % m).\n * It includes a success flag indicating if the operation succeeded. Operation will be marked as failed if trying\n * to operate modulo 0 or if the underlying precompile reverted.\n *\n * IMPORTANT: The result is only valid if the success flag is true. When using this function, make sure the chain\n * you're using it on supports the precompiled contract for modular exponentiation at address 0x05 as specified in\n * https://eips.ethereum.org/EIPS/eip-198[EIP-198]. Otherwise, the underlying function will succeed given the lack\n * of a revert, but the result may be incorrectly interpreted as 0.\n */\n function tryModExp(uint256 b, uint256 e, uint256 m) internal view returns (bool success, uint256 result) {\n if (m == 0) return (false, 0);\n assembly (\"memory-safe\") {\n let ptr := mload(0x40)\n // | Offset | Content | Content (Hex) |\n // |-----------|------------|--------------------------------------------------------------------|\n // | 0x00:0x1f | size of b | 0x0000000000000000000000000000000000000000000000000000000000000020 |\n // | 0x20:0x3f | size of e | 0x0000000000000000000000000000000000000000000000000000000000000020 |\n // | 0x40:0x5f | size of m | 0x0000000000000000000000000000000000000000000000000000000000000020 |\n // | 0x60:0x7f | value of b | 0x<.............................................................b> |\n // | 0x80:0x9f | value of e | 0x<.............................................................e> |\n // | 0xa0:0xbf | value of m | 0x<.............................................................m> |\n mstore(ptr, 0x20)\n mstore(add(ptr, 0x20), 0x20)\n mstore(add(ptr, 0x40), 0x20)\n mstore(add(ptr, 0x60), b)\n mstore(add(ptr, 0x80), e)\n mstore(add(ptr, 0xa0), m)\n\n // Given the result < m, it's guaranteed to fit in 32 bytes,\n // so we can use the memory scratch space located at offset 0.\n success := staticcall(gas(), 0x05, ptr, 0xc0, 0x00, 0x20)\n result := mload(0x00)\n }\n }\n\n /**\n * @dev Variant of {modExp} that supports inputs of arbitrary length.\n */\n function modExp(bytes memory b, bytes memory e, bytes memory m) internal view returns (bytes memory) {\n (bool success, bytes memory result) = tryModExp(b, e, m);\n if (!success) {\n Panic.panic(Panic.DIVISION_BY_ZERO);\n }\n return result;\n }\n\n /**\n * @dev Variant of {tryModExp} that supports inputs of arbitrary length.\n */\n function tryModExp(\n bytes memory b,\n bytes memory e,\n bytes memory m\n ) internal view returns (bool success, bytes memory result) {\n if (_zeroBytes(m)) return (false, new bytes(0));\n\n uint256 mLen = m.length;\n\n // Encode call args in result and move the free memory pointer\n result = abi.encodePacked(b.length, e.length, mLen, b, e, m);\n\n assembly (\"memory-safe\") {\n let dataPtr := add(result, 0x20)\n // Write result on top of args to avoid allocating extra memory.\n success := staticcall(gas(), 0x05, dataPtr, mload(result), dataPtr, mLen)\n // Overwrite the length.\n // result.length > returndatasize() is guaranteed because returndatasize() == m.length\n mstore(result, mLen)\n // Set the memory pointer after the returned data.\n mstore(0x40, add(dataPtr, mLen))\n }\n }\n\n /**\n * @dev Returns whether the provided byte array is zero.\n */\n function _zeroBytes(bytes memory byteArray) private pure returns (bool) {\n for (uint256 i = 0; i < byteArray.length; ++i) {\n if (byteArray[i] != 0) {\n return false;\n }\n }\n return true;\n }\n\n /**\n * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded\n * towards zero.\n *\n * This method is based on Newton's method for computing square roots; the algorithm is restricted to only\n * using integer operations.\n */\n function sqrt(uint256 a) internal pure returns (uint256) {\n unchecked {\n // Take care of easy edge cases when a == 0 or a == 1\n if (a <= 1) {\n return a;\n }\n\n // In this function, we use Newton's method to get a root of `f(x) := x² - a`. It involves building a\n // sequence x_n that converges toward sqrt(a). For each iteration x_n, we also define the error between\n // the current value as `ε_n = | x_n - sqrt(a) |`.\n //\n // For our first estimation, we consider `e` the smallest power of 2 which is bigger than the square root\n // of the target. (i.e. `2**(e-1) ≤ sqrt(a) < 2**e`). We know that `e ≤ 128` because `(2¹²⁸)² = 2²⁵⁶` is\n // bigger than any uint256.\n //\n // By noticing that\n // `2**(e-1) ≤ sqrt(a) < 2**e → (2**(e-1))² ≤ a < (2**e)² → 2**(2*e-2) ≤ a < 2**(2*e)`\n // we can deduce that `e - 1` is `log2(a) / 2`. We can thus compute `x_n = 2**(e-1)` using a method similar\n // to the msb function.\n uint256 aa = a;\n uint256 xn = 1;\n\n if (aa >= (1 << 128)) {\n aa >>= 128;\n xn <<= 64;\n }\n if (aa >= (1 << 64)) {\n aa >>= 64;\n xn <<= 32;\n }\n if (aa >= (1 << 32)) {\n aa >>= 32;\n xn <<= 16;\n }\n if (aa >= (1 << 16)) {\n aa >>= 16;\n xn <<= 8;\n }\n if (aa >= (1 << 8)) {\n aa >>= 8;\n xn <<= 4;\n }\n if (aa >= (1 << 4)) {\n aa >>= 4;\n xn <<= 2;\n }\n if (aa >= (1 << 2)) {\n xn <<= 1;\n }\n\n // We now have x_n such that `x_n = 2**(e-1) ≤ sqrt(a) < 2**e = 2 * x_n`. This implies ε_n ≤ 2**(e-1).\n //\n // We can refine our estimation by noticing that the middle of that interval minimizes the error.\n // If we move x_n to equal 2**(e-1) + 2**(e-2), then we reduce the error to ε_n ≤ 2**(e-2).\n // This is going to be our x_0 (and ε_0)\n xn = (3 * xn) >> 1; // ε_0 := | x_0 - sqrt(a) | ≤ 2**(e-2)\n\n // From here, Newton's method give us:\n // x_{n+1} = (x_n + a / x_n) / 2\n //\n // One should note that:\n // x_{n+1}² - a = ((x_n + a / x_n) / 2)² - a\n // = ((x_n² + a) / (2 * x_n))² - a\n // = (x_n⁴ + 2 * a * x_n² + a²) / (4 * x_n²) - a\n // = (x_n⁴ + 2 * a * x_n² + a² - 4 * a * x_n²) / (4 * x_n²)\n // = (x_n⁴ - 2 * a * x_n² + a²) / (4 * x_n²)\n // = (x_n² - a)² / (2 * x_n)²\n // = ((x_n² - a) / (2 * x_n))²\n // ≥ 0\n // Which proves that for all n ≥ 1, sqrt(a) ≤ x_n\n //\n // This gives us the proof of quadratic convergence of the sequence:\n // ε_{n+1} = | x_{n+1} - sqrt(a) |\n // = | (x_n + a / x_n) / 2 - sqrt(a) |\n // = | (x_n² + a - 2*x_n*sqrt(a)) / (2 * x_n) |\n // = | (x_n - sqrt(a))² / (2 * x_n) |\n // = | ε_n² / (2 * x_n) |\n // = ε_n² / | (2 * x_n) |\n //\n // For the first iteration, we have a special case where x_0 is known:\n // ε_1 = ε_0² / | (2 * x_0) |\n // ≤ (2**(e-2))² / (2 * (2**(e-1) + 2**(e-2)))\n // ≤ 2**(2*e-4) / (3 * 2**(e-1))\n // ≤ 2**(e-3) / 3\n // ≤ 2**(e-3-log2(3))\n // ≤ 2**(e-4.5)\n //\n // For the following iterations, we use the fact that, 2**(e-1) ≤ sqrt(a) ≤ x_n:\n // ε_{n+1} = ε_n² / | (2 * x_n) |\n // ≤ (2**(e-k))² / (2 * 2**(e-1))\n // ≤ 2**(2*e-2*k) / 2**e\n // ≤ 2**(e-2*k)\n xn = (xn + a / xn) >> 1; // ε_1 := | x_1 - sqrt(a) | ≤ 2**(e-4.5) -- special case, see above\n xn = (xn + a / xn) >> 1; // ε_2 := | x_2 - sqrt(a) | ≤ 2**(e-9) -- general case with k = 4.5\n xn = (xn + a / xn) >> 1; // ε_3 := | x_3 - sqrt(a) | ≤ 2**(e-18) -- general case with k = 9\n xn = (xn + a / xn) >> 1; // ε_4 := | x_4 - sqrt(a) | ≤ 2**(e-36) -- general case with k = 18\n xn = (xn + a / xn) >> 1; // ε_5 := | x_5 - sqrt(a) | ≤ 2**(e-72) -- general case with k = 36\n xn = (xn + a / xn) >> 1; // ε_6 := | x_6 - sqrt(a) | ≤ 2**(e-144) -- general case with k = 72\n\n // Because e ≤ 128 (as discussed during the first estimation phase), we know have reached a precision\n // ε_6 ≤ 2**(e-144) < 1. Given we're operating on integers, then we can ensure that xn is now either\n // sqrt(a) or sqrt(a) + 1.\n return xn - SafeCast.toUint(xn > a / xn);\n }\n }\n\n /**\n * @dev 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 + SafeCast.toUint(unsignedRoundsUp(rounding) && result * result < a);\n }\n }\n\n /**\n * @dev Return the log in base 2 of a positive value rounded towards zero.\n * Returns 0 if given 0.\n */\n function log2(uint256 value) internal pure returns (uint256) {\n uint256 result = 0;\n uint256 exp;\n unchecked {\n exp = 128 * SafeCast.toUint(value > (1 << 128) - 1);\n value >>= exp;\n result += exp;\n\n exp = 64 * SafeCast.toUint(value > (1 << 64) - 1);\n value >>= exp;\n result += exp;\n\n exp = 32 * SafeCast.toUint(value > (1 << 32) - 1);\n value >>= exp;\n result += exp;\n\n exp = 16 * SafeCast.toUint(value > (1 << 16) - 1);\n value >>= exp;\n result += exp;\n\n exp = 8 * SafeCast.toUint(value > (1 << 8) - 1);\n value >>= exp;\n result += exp;\n\n exp = 4 * SafeCast.toUint(value > (1 << 4) - 1);\n value >>= exp;\n result += exp;\n\n exp = 2 * SafeCast.toUint(value > (1 << 2) - 1);\n value >>= exp;\n result += exp;\n\n result += SafeCast.toUint(value > 1);\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 + SafeCast.toUint(unsignedRoundsUp(rounding) && 1 << result < value);\n }\n }\n\n /**\n * @dev Return the log in base 10 of a positive value rounded towards zero.\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 + SafeCast.toUint(unsignedRoundsUp(rounding) && 10 ** result < value);\n }\n }\n\n /**\n * @dev Return the log in base 256 of a positive value rounded towards zero.\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 uint256 isGt;\n unchecked {\n isGt = SafeCast.toUint(value > (1 << 128) - 1);\n value >>= isGt * 128;\n result += isGt * 16;\n\n isGt = SafeCast.toUint(value > (1 << 64) - 1);\n value >>= isGt * 64;\n result += isGt * 8;\n\n isGt = SafeCast.toUint(value > (1 << 32) - 1);\n value >>= isGt * 32;\n result += isGt * 4;\n\n isGt = SafeCast.toUint(value > (1 << 16) - 1);\n value >>= isGt * 16;\n result += isGt * 2;\n\n result += SafeCast.toUint(value > (1 << 8) - 1);\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 + SafeCast.toUint(unsignedRoundsUp(rounding) && 1 << (result << 3) < value);\n }\n }\n\n /**\n * @dev Returns whether a provided rounding mode is considered rounding up for unsigned integers.\n */\n function unsignedRoundsUp(Rounding rounding) internal pure returns (bool) {\n return uint8(rounding) % 2 == 1;\n }\n}\n" + }, + "@openzeppelin/contracts/utils/math/SafeCast.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/math/SafeCast.sol)\n// This file was procedurally generated from scripts/generate/templates/SafeCast.js.\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Wrappers over Solidity's uintXX/intXX/bool casting operators with added overflow\n * checks.\n *\n * Downcasting from uint256/int256 in Solidity does not revert on overflow. This can\n * easily result in undesired exploitation or bugs, since developers usually\n * assume that overflows raise errors. `SafeCast` restores this intuition by\n * reverting the transaction when such an operation overflows.\n *\n * Using this library instead of the unchecked operations eliminates an entire\n * class of bugs, so it's recommended to use it always.\n */\nlibrary SafeCast {\n /**\n * @dev Value doesn't fit in an uint of `bits` size.\n */\n error SafeCastOverflowedUintDowncast(uint8 bits, uint256 value);\n\n /**\n * @dev An int value doesn't fit in an uint of `bits` size.\n */\n error SafeCastOverflowedIntToUint(int256 value);\n\n /**\n * @dev Value doesn't fit in an int of `bits` size.\n */\n error SafeCastOverflowedIntDowncast(uint8 bits, int256 value);\n\n /**\n * @dev An uint value doesn't fit in an int of `bits` size.\n */\n error SafeCastOverflowedUintToInt(uint256 value);\n\n /**\n * @dev Returns the downcasted uint248 from uint256, reverting on\n * overflow (when the input is greater than largest uint248).\n *\n * Counterpart to Solidity's `uint248` operator.\n *\n * Requirements:\n *\n * - input must fit into 248 bits\n */\n function toUint248(uint256 value) internal pure returns (uint248) {\n if (value > type(uint248).max) {\n revert SafeCastOverflowedUintDowncast(248, value);\n }\n return uint248(value);\n }\n\n /**\n * @dev Returns the downcasted uint240 from uint256, reverting on\n * overflow (when the input is greater than largest uint240).\n *\n * Counterpart to Solidity's `uint240` operator.\n *\n * Requirements:\n *\n * - input must fit into 240 bits\n */\n function toUint240(uint256 value) internal pure returns (uint240) {\n if (value > type(uint240).max) {\n revert SafeCastOverflowedUintDowncast(240, value);\n }\n return uint240(value);\n }\n\n /**\n * @dev Returns the downcasted uint232 from uint256, reverting on\n * overflow (when the input is greater than largest uint232).\n *\n * Counterpart to Solidity's `uint232` operator.\n *\n * Requirements:\n *\n * - input must fit into 232 bits\n */\n function toUint232(uint256 value) internal pure returns (uint232) {\n if (value > type(uint232).max) {\n revert SafeCastOverflowedUintDowncast(232, value);\n }\n return uint232(value);\n }\n\n /**\n * @dev Returns the downcasted uint224 from uint256, reverting on\n * overflow (when the input is greater than largest uint224).\n *\n * Counterpart to Solidity's `uint224` operator.\n *\n * Requirements:\n *\n * - input must fit into 224 bits\n */\n function toUint224(uint256 value) internal pure returns (uint224) {\n if (value > type(uint224).max) {\n revert SafeCastOverflowedUintDowncast(224, value);\n }\n return uint224(value);\n }\n\n /**\n * @dev Returns the downcasted uint216 from uint256, reverting on\n * overflow (when the input is greater than largest uint216).\n *\n * Counterpart to Solidity's `uint216` operator.\n *\n * Requirements:\n *\n * - input must fit into 216 bits\n */\n function toUint216(uint256 value) internal pure returns (uint216) {\n if (value > type(uint216).max) {\n revert SafeCastOverflowedUintDowncast(216, value);\n }\n return uint216(value);\n }\n\n /**\n * @dev Returns the downcasted uint208 from uint256, reverting on\n * overflow (when the input is greater than largest uint208).\n *\n * Counterpart to Solidity's `uint208` operator.\n *\n * Requirements:\n *\n * - input must fit into 208 bits\n */\n function toUint208(uint256 value) internal pure returns (uint208) {\n if (value > type(uint208).max) {\n revert SafeCastOverflowedUintDowncast(208, value);\n }\n return uint208(value);\n }\n\n /**\n * @dev Returns the downcasted uint200 from uint256, reverting on\n * overflow (when the input is greater than largest uint200).\n *\n * Counterpart to Solidity's `uint200` operator.\n *\n * Requirements:\n *\n * - input must fit into 200 bits\n */\n function toUint200(uint256 value) internal pure returns (uint200) {\n if (value > type(uint200).max) {\n revert SafeCastOverflowedUintDowncast(200, value);\n }\n return uint200(value);\n }\n\n /**\n * @dev Returns the downcasted uint192 from uint256, reverting on\n * overflow (when the input is greater than largest uint192).\n *\n * Counterpart to Solidity's `uint192` operator.\n *\n * Requirements:\n *\n * - input must fit into 192 bits\n */\n function toUint192(uint256 value) internal pure returns (uint192) {\n if (value > type(uint192).max) {\n revert SafeCastOverflowedUintDowncast(192, value);\n }\n return uint192(value);\n }\n\n /**\n * @dev Returns the downcasted uint184 from uint256, reverting on\n * overflow (when the input is greater than largest uint184).\n *\n * Counterpart to Solidity's `uint184` operator.\n *\n * Requirements:\n *\n * - input must fit into 184 bits\n */\n function toUint184(uint256 value) internal pure returns (uint184) {\n if (value > type(uint184).max) {\n revert SafeCastOverflowedUintDowncast(184, value);\n }\n return uint184(value);\n }\n\n /**\n * @dev Returns the downcasted uint176 from uint256, reverting on\n * overflow (when the input is greater than largest uint176).\n *\n * Counterpart to Solidity's `uint176` operator.\n *\n * Requirements:\n *\n * - input must fit into 176 bits\n */\n function toUint176(uint256 value) internal pure returns (uint176) {\n if (value > type(uint176).max) {\n revert SafeCastOverflowedUintDowncast(176, value);\n }\n return uint176(value);\n }\n\n /**\n * @dev Returns the downcasted uint168 from uint256, reverting on\n * overflow (when the input is greater than largest uint168).\n *\n * Counterpart to Solidity's `uint168` operator.\n *\n * Requirements:\n *\n * - input must fit into 168 bits\n */\n function toUint168(uint256 value) internal pure returns (uint168) {\n if (value > type(uint168).max) {\n revert SafeCastOverflowedUintDowncast(168, value);\n }\n return uint168(value);\n }\n\n /**\n * @dev Returns the downcasted uint160 from uint256, reverting on\n * overflow (when the input is greater than largest uint160).\n *\n * Counterpart to Solidity's `uint160` operator.\n *\n * Requirements:\n *\n * - input must fit into 160 bits\n */\n function toUint160(uint256 value) internal pure returns (uint160) {\n if (value > type(uint160).max) {\n revert SafeCastOverflowedUintDowncast(160, value);\n }\n return uint160(value);\n }\n\n /**\n * @dev Returns the downcasted uint152 from uint256, reverting on\n * overflow (when the input is greater than largest uint152).\n *\n * Counterpart to Solidity's `uint152` operator.\n *\n * Requirements:\n *\n * - input must fit into 152 bits\n */\n function toUint152(uint256 value) internal pure returns (uint152) {\n if (value > type(uint152).max) {\n revert SafeCastOverflowedUintDowncast(152, value);\n }\n return uint152(value);\n }\n\n /**\n * @dev Returns the downcasted uint144 from uint256, reverting on\n * overflow (when the input is greater than largest uint144).\n *\n * Counterpart to Solidity's `uint144` operator.\n *\n * Requirements:\n *\n * - input must fit into 144 bits\n */\n function toUint144(uint256 value) internal pure returns (uint144) {\n if (value > type(uint144).max) {\n revert SafeCastOverflowedUintDowncast(144, value);\n }\n return uint144(value);\n }\n\n /**\n * @dev Returns the downcasted uint136 from uint256, reverting on\n * overflow (when the input is greater than largest uint136).\n *\n * Counterpart to Solidity's `uint136` operator.\n *\n * Requirements:\n *\n * - input must fit into 136 bits\n */\n function toUint136(uint256 value) internal pure returns (uint136) {\n if (value > type(uint136).max) {\n revert SafeCastOverflowedUintDowncast(136, value);\n }\n return uint136(value);\n }\n\n /**\n * @dev Returns the downcasted uint128 from uint256, reverting on\n * overflow (when the input is greater than largest uint128).\n *\n * Counterpart to Solidity's `uint128` operator.\n *\n * Requirements:\n *\n * - input must fit into 128 bits\n */\n function toUint128(uint256 value) internal pure returns (uint128) {\n if (value > type(uint128).max) {\n revert SafeCastOverflowedUintDowncast(128, value);\n }\n return uint128(value);\n }\n\n /**\n * @dev Returns the downcasted uint120 from uint256, reverting on\n * overflow (when the input is greater than largest uint120).\n *\n * Counterpart to Solidity's `uint120` operator.\n *\n * Requirements:\n *\n * - input must fit into 120 bits\n */\n function toUint120(uint256 value) internal pure returns (uint120) {\n if (value > type(uint120).max) {\n revert SafeCastOverflowedUintDowncast(120, value);\n }\n return uint120(value);\n }\n\n /**\n * @dev Returns the downcasted uint112 from uint256, reverting on\n * overflow (when the input is greater than largest uint112).\n *\n * Counterpart to Solidity's `uint112` operator.\n *\n * Requirements:\n *\n * - input must fit into 112 bits\n */\n function toUint112(uint256 value) internal pure returns (uint112) {\n if (value > type(uint112).max) {\n revert SafeCastOverflowedUintDowncast(112, value);\n }\n return uint112(value);\n }\n\n /**\n * @dev Returns the downcasted uint104 from uint256, reverting on\n * overflow (when the input is greater than largest uint104).\n *\n * Counterpart to Solidity's `uint104` operator.\n *\n * Requirements:\n *\n * - input must fit into 104 bits\n */\n function toUint104(uint256 value) internal pure returns (uint104) {\n if (value > type(uint104).max) {\n revert SafeCastOverflowedUintDowncast(104, value);\n }\n return uint104(value);\n }\n\n /**\n * @dev Returns the downcasted uint96 from uint256, reverting on\n * overflow (when the input is greater than largest uint96).\n *\n * Counterpart to Solidity's `uint96` operator.\n *\n * Requirements:\n *\n * - input must fit into 96 bits\n */\n function toUint96(uint256 value) internal pure returns (uint96) {\n if (value > type(uint96).max) {\n revert SafeCastOverflowedUintDowncast(96, value);\n }\n return uint96(value);\n }\n\n /**\n * @dev Returns the downcasted uint88 from uint256, reverting on\n * overflow (when the input is greater than largest uint88).\n *\n * Counterpart to Solidity's `uint88` operator.\n *\n * Requirements:\n *\n * - input must fit into 88 bits\n */\n function toUint88(uint256 value) internal pure returns (uint88) {\n if (value > type(uint88).max) {\n revert SafeCastOverflowedUintDowncast(88, value);\n }\n return uint88(value);\n }\n\n /**\n * @dev Returns the downcasted uint80 from uint256, reverting on\n * overflow (when the input is greater than largest uint80).\n *\n * Counterpart to Solidity's `uint80` operator.\n *\n * Requirements:\n *\n * - input must fit into 80 bits\n */\n function toUint80(uint256 value) internal pure returns (uint80) {\n if (value > type(uint80).max) {\n revert SafeCastOverflowedUintDowncast(80, value);\n }\n return uint80(value);\n }\n\n /**\n * @dev Returns the downcasted uint72 from uint256, reverting on\n * overflow (when the input is greater than largest uint72).\n *\n * Counterpart to Solidity's `uint72` operator.\n *\n * Requirements:\n *\n * - input must fit into 72 bits\n */\n function toUint72(uint256 value) internal pure returns (uint72) {\n if (value > type(uint72).max) {\n revert SafeCastOverflowedUintDowncast(72, value);\n }\n return uint72(value);\n }\n\n /**\n * @dev Returns the downcasted uint64 from uint256, reverting on\n * overflow (when the input is greater than largest uint64).\n *\n * Counterpart to Solidity's `uint64` operator.\n *\n * Requirements:\n *\n * - input must fit into 64 bits\n */\n function toUint64(uint256 value) internal pure returns (uint64) {\n if (value > type(uint64).max) {\n revert SafeCastOverflowedUintDowncast(64, value);\n }\n return uint64(value);\n }\n\n /**\n * @dev Returns the downcasted uint56 from uint256, reverting on\n * overflow (when the input is greater than largest uint56).\n *\n * Counterpart to Solidity's `uint56` operator.\n *\n * Requirements:\n *\n * - input must fit into 56 bits\n */\n function toUint56(uint256 value) internal pure returns (uint56) {\n if (value > type(uint56).max) {\n revert SafeCastOverflowedUintDowncast(56, value);\n }\n return uint56(value);\n }\n\n /**\n * @dev Returns the downcasted uint48 from uint256, reverting on\n * overflow (when the input is greater than largest uint48).\n *\n * Counterpart to Solidity's `uint48` operator.\n *\n * Requirements:\n *\n * - input must fit into 48 bits\n */\n function toUint48(uint256 value) internal pure returns (uint48) {\n if (value > type(uint48).max) {\n revert SafeCastOverflowedUintDowncast(48, value);\n }\n return uint48(value);\n }\n\n /**\n * @dev Returns the downcasted uint40 from uint256, reverting on\n * overflow (when the input is greater than largest uint40).\n *\n * Counterpart to Solidity's `uint40` operator.\n *\n * Requirements:\n *\n * - input must fit into 40 bits\n */\n function toUint40(uint256 value) internal pure returns (uint40) {\n if (value > type(uint40).max) {\n revert SafeCastOverflowedUintDowncast(40, value);\n }\n return uint40(value);\n }\n\n /**\n * @dev Returns the downcasted uint32 from uint256, reverting on\n * overflow (when the input is greater than largest uint32).\n *\n * Counterpart to Solidity's `uint32` operator.\n *\n * Requirements:\n *\n * - input must fit into 32 bits\n */\n function toUint32(uint256 value) internal pure returns (uint32) {\n if (value > type(uint32).max) {\n revert SafeCastOverflowedUintDowncast(32, value);\n }\n return uint32(value);\n }\n\n /**\n * @dev Returns the downcasted uint24 from uint256, reverting on\n * overflow (when the input is greater than largest uint24).\n *\n * Counterpart to Solidity's `uint24` operator.\n *\n * Requirements:\n *\n * - input must fit into 24 bits\n */\n function toUint24(uint256 value) internal pure returns (uint24) {\n if (value > type(uint24).max) {\n revert SafeCastOverflowedUintDowncast(24, value);\n }\n return uint24(value);\n }\n\n /**\n * @dev Returns the downcasted uint16 from uint256, reverting on\n * overflow (when the input is greater than largest uint16).\n *\n * Counterpart to Solidity's `uint16` operator.\n *\n * Requirements:\n *\n * - input must fit into 16 bits\n */\n function toUint16(uint256 value) internal pure returns (uint16) {\n if (value > type(uint16).max) {\n revert SafeCastOverflowedUintDowncast(16, value);\n }\n return uint16(value);\n }\n\n /**\n * @dev Returns the downcasted uint8 from uint256, reverting on\n * overflow (when the input is greater than largest uint8).\n *\n * Counterpart to Solidity's `uint8` operator.\n *\n * Requirements:\n *\n * - input must fit into 8 bits\n */\n function toUint8(uint256 value) internal pure returns (uint8) {\n if (value > type(uint8).max) {\n revert SafeCastOverflowedUintDowncast(8, value);\n }\n return uint8(value);\n }\n\n /**\n * @dev Converts a signed int256 into an unsigned uint256.\n *\n * Requirements:\n *\n * - input must be greater than or equal to 0.\n */\n function toUint256(int256 value) internal pure returns (uint256) {\n if (value < 0) {\n revert SafeCastOverflowedIntToUint(value);\n }\n return uint256(value);\n }\n\n /**\n * @dev Returns the downcasted int248 from int256, reverting on\n * overflow (when the input is less than smallest int248 or\n * greater than largest int248).\n *\n * Counterpart to Solidity's `int248` operator.\n *\n * Requirements:\n *\n * - input must fit into 248 bits\n */\n function toInt248(int256 value) internal pure returns (int248 downcasted) {\n downcasted = int248(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(248, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int240 from int256, reverting on\n * overflow (when the input is less than smallest int240 or\n * greater than largest int240).\n *\n * Counterpart to Solidity's `int240` operator.\n *\n * Requirements:\n *\n * - input must fit into 240 bits\n */\n function toInt240(int256 value) internal pure returns (int240 downcasted) {\n downcasted = int240(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(240, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int232 from int256, reverting on\n * overflow (when the input is less than smallest int232 or\n * greater than largest int232).\n *\n * Counterpart to Solidity's `int232` operator.\n *\n * Requirements:\n *\n * - input must fit into 232 bits\n */\n function toInt232(int256 value) internal pure returns (int232 downcasted) {\n downcasted = int232(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(232, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int224 from int256, reverting on\n * overflow (when the input is less than smallest int224 or\n * greater than largest int224).\n *\n * Counterpart to Solidity's `int224` operator.\n *\n * Requirements:\n *\n * - input must fit into 224 bits\n */\n function toInt224(int256 value) internal pure returns (int224 downcasted) {\n downcasted = int224(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(224, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int216 from int256, reverting on\n * overflow (when the input is less than smallest int216 or\n * greater than largest int216).\n *\n * Counterpart to Solidity's `int216` operator.\n *\n * Requirements:\n *\n * - input must fit into 216 bits\n */\n function toInt216(int256 value) internal pure returns (int216 downcasted) {\n downcasted = int216(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(216, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int208 from int256, reverting on\n * overflow (when the input is less than smallest int208 or\n * greater than largest int208).\n *\n * Counterpart to Solidity's `int208` operator.\n *\n * Requirements:\n *\n * - input must fit into 208 bits\n */\n function toInt208(int256 value) internal pure returns (int208 downcasted) {\n downcasted = int208(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(208, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int200 from int256, reverting on\n * overflow (when the input is less than smallest int200 or\n * greater than largest int200).\n *\n * Counterpart to Solidity's `int200` operator.\n *\n * Requirements:\n *\n * - input must fit into 200 bits\n */\n function toInt200(int256 value) internal pure returns (int200 downcasted) {\n downcasted = int200(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(200, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int192 from int256, reverting on\n * overflow (when the input is less than smallest int192 or\n * greater than largest int192).\n *\n * Counterpart to Solidity's `int192` operator.\n *\n * Requirements:\n *\n * - input must fit into 192 bits\n */\n function toInt192(int256 value) internal pure returns (int192 downcasted) {\n downcasted = int192(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(192, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int184 from int256, reverting on\n * overflow (when the input is less than smallest int184 or\n * greater than largest int184).\n *\n * Counterpart to Solidity's `int184` operator.\n *\n * Requirements:\n *\n * - input must fit into 184 bits\n */\n function toInt184(int256 value) internal pure returns (int184 downcasted) {\n downcasted = int184(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(184, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int176 from int256, reverting on\n * overflow (when the input is less than smallest int176 or\n * greater than largest int176).\n *\n * Counterpart to Solidity's `int176` operator.\n *\n * Requirements:\n *\n * - input must fit into 176 bits\n */\n function toInt176(int256 value) internal pure returns (int176 downcasted) {\n downcasted = int176(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(176, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int168 from int256, reverting on\n * overflow (when the input is less than smallest int168 or\n * greater than largest int168).\n *\n * Counterpart to Solidity's `int168` operator.\n *\n * Requirements:\n *\n * - input must fit into 168 bits\n */\n function toInt168(int256 value) internal pure returns (int168 downcasted) {\n downcasted = int168(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(168, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int160 from int256, reverting on\n * overflow (when the input is less than smallest int160 or\n * greater than largest int160).\n *\n * Counterpart to Solidity's `int160` operator.\n *\n * Requirements:\n *\n * - input must fit into 160 bits\n */\n function toInt160(int256 value) internal pure returns (int160 downcasted) {\n downcasted = int160(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(160, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int152 from int256, reverting on\n * overflow (when the input is less than smallest int152 or\n * greater than largest int152).\n *\n * Counterpart to Solidity's `int152` operator.\n *\n * Requirements:\n *\n * - input must fit into 152 bits\n */\n function toInt152(int256 value) internal pure returns (int152 downcasted) {\n downcasted = int152(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(152, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int144 from int256, reverting on\n * overflow (when the input is less than smallest int144 or\n * greater than largest int144).\n *\n * Counterpart to Solidity's `int144` operator.\n *\n * Requirements:\n *\n * - input must fit into 144 bits\n */\n function toInt144(int256 value) internal pure returns (int144 downcasted) {\n downcasted = int144(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(144, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int136 from int256, reverting on\n * overflow (when the input is less than smallest int136 or\n * greater than largest int136).\n *\n * Counterpart to Solidity's `int136` operator.\n *\n * Requirements:\n *\n * - input must fit into 136 bits\n */\n function toInt136(int256 value) internal pure returns (int136 downcasted) {\n downcasted = int136(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(136, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int128 from int256, reverting on\n * overflow (when the input is less than smallest int128 or\n * greater than largest int128).\n *\n * Counterpart to Solidity's `int128` operator.\n *\n * Requirements:\n *\n * - input must fit into 128 bits\n */\n function toInt128(int256 value) internal pure returns (int128 downcasted) {\n downcasted = int128(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(128, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int120 from int256, reverting on\n * overflow (when the input is less than smallest int120 or\n * greater than largest int120).\n *\n * Counterpart to Solidity's `int120` operator.\n *\n * Requirements:\n *\n * - input must fit into 120 bits\n */\n function toInt120(int256 value) internal pure returns (int120 downcasted) {\n downcasted = int120(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(120, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int112 from int256, reverting on\n * overflow (when the input is less than smallest int112 or\n * greater than largest int112).\n *\n * Counterpart to Solidity's `int112` operator.\n *\n * Requirements:\n *\n * - input must fit into 112 bits\n */\n function toInt112(int256 value) internal pure returns (int112 downcasted) {\n downcasted = int112(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(112, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int104 from int256, reverting on\n * overflow (when the input is less than smallest int104 or\n * greater than largest int104).\n *\n * Counterpart to Solidity's `int104` operator.\n *\n * Requirements:\n *\n * - input must fit into 104 bits\n */\n function toInt104(int256 value) internal pure returns (int104 downcasted) {\n downcasted = int104(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(104, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int96 from int256, reverting on\n * overflow (when the input is less than smallest int96 or\n * greater than largest int96).\n *\n * Counterpart to Solidity's `int96` operator.\n *\n * Requirements:\n *\n * - input must fit into 96 bits\n */\n function toInt96(int256 value) internal pure returns (int96 downcasted) {\n downcasted = int96(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(96, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int88 from int256, reverting on\n * overflow (when the input is less than smallest int88 or\n * greater than largest int88).\n *\n * Counterpart to Solidity's `int88` operator.\n *\n * Requirements:\n *\n * - input must fit into 88 bits\n */\n function toInt88(int256 value) internal pure returns (int88 downcasted) {\n downcasted = int88(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(88, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int80 from int256, reverting on\n * overflow (when the input is less than smallest int80 or\n * greater than largest int80).\n *\n * Counterpart to Solidity's `int80` operator.\n *\n * Requirements:\n *\n * - input must fit into 80 bits\n */\n function toInt80(int256 value) internal pure returns (int80 downcasted) {\n downcasted = int80(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(80, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int72 from int256, reverting on\n * overflow (when the input is less than smallest int72 or\n * greater than largest int72).\n *\n * Counterpart to Solidity's `int72` operator.\n *\n * Requirements:\n *\n * - input must fit into 72 bits\n */\n function toInt72(int256 value) internal pure returns (int72 downcasted) {\n downcasted = int72(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(72, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int64 from int256, reverting on\n * overflow (when the input is less than smallest int64 or\n * greater than largest int64).\n *\n * Counterpart to Solidity's `int64` operator.\n *\n * Requirements:\n *\n * - input must fit into 64 bits\n */\n function toInt64(int256 value) internal pure returns (int64 downcasted) {\n downcasted = int64(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(64, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int56 from int256, reverting on\n * overflow (when the input is less than smallest int56 or\n * greater than largest int56).\n *\n * Counterpart to Solidity's `int56` operator.\n *\n * Requirements:\n *\n * - input must fit into 56 bits\n */\n function toInt56(int256 value) internal pure returns (int56 downcasted) {\n downcasted = int56(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(56, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int48 from int256, reverting on\n * overflow (when the input is less than smallest int48 or\n * greater than largest int48).\n *\n * Counterpart to Solidity's `int48` operator.\n *\n * Requirements:\n *\n * - input must fit into 48 bits\n */\n function toInt48(int256 value) internal pure returns (int48 downcasted) {\n downcasted = int48(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(48, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int40 from int256, reverting on\n * overflow (when the input is less than smallest int40 or\n * greater than largest int40).\n *\n * Counterpart to Solidity's `int40` operator.\n *\n * Requirements:\n *\n * - input must fit into 40 bits\n */\n function toInt40(int256 value) internal pure returns (int40 downcasted) {\n downcasted = int40(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(40, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int32 from int256, reverting on\n * overflow (when the input is less than smallest int32 or\n * greater than largest int32).\n *\n * Counterpart to Solidity's `int32` operator.\n *\n * Requirements:\n *\n * - input must fit into 32 bits\n */\n function toInt32(int256 value) internal pure returns (int32 downcasted) {\n downcasted = int32(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(32, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int24 from int256, reverting on\n * overflow (when the input is less than smallest int24 or\n * greater than largest int24).\n *\n * Counterpart to Solidity's `int24` operator.\n *\n * Requirements:\n *\n * - input must fit into 24 bits\n */\n function toInt24(int256 value) internal pure returns (int24 downcasted) {\n downcasted = int24(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(24, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int16 from int256, reverting on\n * overflow (when the input is less than smallest int16 or\n * greater than largest int16).\n *\n * Counterpart to Solidity's `int16` operator.\n *\n * Requirements:\n *\n * - input must fit into 16 bits\n */\n function toInt16(int256 value) internal pure returns (int16 downcasted) {\n downcasted = int16(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(16, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int8 from int256, reverting on\n * overflow (when the input is less than smallest int8 or\n * greater than largest int8).\n *\n * Counterpart to Solidity's `int8` operator.\n *\n * Requirements:\n *\n * - input must fit into 8 bits\n */\n function toInt8(int256 value) internal pure returns (int8 downcasted) {\n downcasted = int8(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(8, value);\n }\n }\n\n /**\n * @dev Converts an unsigned uint256 into a signed int256.\n *\n * Requirements:\n *\n * - input must be less than or equal to maxInt256.\n */\n function toInt256(uint256 value) internal pure returns (int256) {\n // Note: Unsafe cast below is okay because `type(int256).max` is guaranteed to be positive\n if (value > uint256(type(int256).max)) {\n revert SafeCastOverflowedUintToInt(value);\n }\n return int256(value);\n }\n\n /**\n * @dev Cast a boolean (false or true) to a uint256 (0 or 1) with no jump.\n */\n function toUint(bool b) internal pure returns (uint256 u) {\n assembly (\"memory-safe\") {\n u := iszero(iszero(b))\n }\n }\n}\n" + }, + "@openzeppelin/contracts/utils/math/SignedMath.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/math/SignedMath.sol)\n\npragma solidity ^0.8.20;\n\nimport {SafeCast} from \"./SafeCast.sol\";\n\n/**\n * @dev Standard signed math utilities missing in the Solidity language.\n */\nlibrary SignedMath {\n /**\n * @dev Branchless ternary evaluation for `a ? b : c`. Gas costs are constant.\n *\n * IMPORTANT: This function may reduce bytecode size and consume less gas when used standalone.\n * However, the compiler may optimize Solidity ternary operations (i.e. `a ? b : c`) to only compute\n * one branch when needed, making this function more expensive.\n */\n function ternary(bool condition, int256 a, int256 b) internal pure returns (int256) {\n unchecked {\n // branchless ternary works because:\n // b ^ (a ^ b) == a\n // b ^ 0 == b\n return b ^ ((a ^ b) * int256(SafeCast.toUint(condition)));\n }\n }\n\n /**\n * @dev Returns the largest of two signed numbers.\n */\n function max(int256 a, int256 b) internal pure returns (int256) {\n return ternary(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 ternary(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 // Formula from the \"Bit Twiddling Hacks\" by Sean Eron Anderson.\n // Since `n` is a signed integer, the generated bytecode will use the SAR opcode to perform the right shift,\n // taking advantage of the most significant (or \"sign\" bit) in two's complement representation.\n // This opcode adds new most significant bits set to the value of the previous most significant bit. As a result,\n // the mask will either be `bytes32(0)` (if n is positive) or `~bytes32(0)` (if n is negative).\n int256 mask = n >> 255;\n\n // A `bytes32(0)` mask leaves the input unchanged, while a `~bytes32(0)` mask complements it.\n return uint256((n + mask) ^ mask);\n }\n }\n}\n" + }, + "@openzeppelin/contracts/utils/Nonces.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/Nonces.sol)\npragma solidity ^0.8.20;\n\n/**\n * @dev Provides tracking nonces for addresses. Nonces will only increment.\n */\nabstract contract Nonces {\n /**\n * @dev The nonce used for an `account` is not the expected current nonce.\n */\n error InvalidAccountNonce(address account, uint256 currentNonce);\n\n mapping(address account => uint256) private _nonces;\n\n /**\n * @dev Returns the next unused nonce for an address.\n */\n function nonces(address owner) public view virtual returns (uint256) {\n return _nonces[owner];\n }\n\n /**\n * @dev Consumes a nonce.\n *\n * Returns the current value and increments nonce.\n */\n function _useNonce(address owner) internal virtual returns (uint256) {\n // For each account, the nonce has an initial value of 0, can only be incremented by one, and cannot be\n // decremented or reset. This guarantees that the nonce never overflows.\n unchecked {\n // It is important to do x++ and not ++x here.\n return _nonces[owner]++;\n }\n }\n\n /**\n * @dev Same as {_useNonce} but checking that `nonce` is the next valid for `owner`.\n */\n function _useCheckedNonce(address owner, uint256 nonce) internal virtual {\n uint256 current = _useNonce(owner);\n if (nonce != current) {\n revert InvalidAccountNonce(owner, current);\n }\n }\n}\n" + }, + "@openzeppelin/contracts/utils/Panic.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/Panic.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Helper library for emitting standardized panic codes.\n *\n * ```solidity\n * contract Example {\n * using Panic for uint256;\n *\n * // Use any of the declared internal constants\n * function foo() { Panic.GENERIC.panic(); }\n *\n * // Alternatively\n * function foo() { Panic.panic(Panic.GENERIC); }\n * }\n * ```\n *\n * Follows the list from https://github.com/ethereum/solidity/blob/v0.8.24/libsolutil/ErrorCodes.h[libsolutil].\n *\n * _Available since v5.1._\n */\n// slither-disable-next-line unused-state\nlibrary Panic {\n /// @dev generic / unspecified error\n uint256 internal constant GENERIC = 0x00;\n /// @dev used by the assert() builtin\n uint256 internal constant ASSERT = 0x01;\n /// @dev arithmetic underflow or overflow\n uint256 internal constant UNDER_OVERFLOW = 0x11;\n /// @dev division or modulo by zero\n uint256 internal constant DIVISION_BY_ZERO = 0x12;\n /// @dev enum conversion error\n uint256 internal constant ENUM_CONVERSION_ERROR = 0x21;\n /// @dev invalid encoding in storage\n uint256 internal constant STORAGE_ENCODING_ERROR = 0x22;\n /// @dev empty array pop\n uint256 internal constant EMPTY_ARRAY_POP = 0x31;\n /// @dev array out of bounds access\n uint256 internal constant ARRAY_OUT_OF_BOUNDS = 0x32;\n /// @dev resource error (too large allocation or too large array)\n uint256 internal constant RESOURCE_ERROR = 0x41;\n /// @dev calling invalid internal function\n uint256 internal constant INVALID_INTERNAL_FUNCTION = 0x51;\n\n /// @dev Reverts with a panic code. Recommended to use with\n /// the internal constants with predefined codes.\n function panic(uint256 code) internal pure {\n assembly (\"memory-safe\") {\n mstore(0x00, 0x4e487b71)\n mstore(0x20, code)\n revert(0x1c, 0x24)\n }\n }\n}\n" + }, + "@openzeppelin/contracts/utils/ShortStrings.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/ShortStrings.sol)\n\npragma solidity ^0.8.20;\n\nimport {StorageSlot} from \"./StorageSlot.sol\";\n\n// | string | 0xAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA |\n// | length | 0x BB |\ntype ShortString is bytes32;\n\n/**\n * @dev This library provides functions to convert short memory strings\n * into a `ShortString` type that can be used as an immutable variable.\n *\n * Strings of arbitrary length can be optimized using this library if\n * they are short enough (up to 31 bytes) by packing them with their\n * length (1 byte) in a single EVM word (32 bytes). Additionally, a\n * fallback mechanism can be used for every other case.\n *\n * Usage example:\n *\n * ```solidity\n * contract Named {\n * using ShortStrings for *;\n *\n * ShortString private immutable _name;\n * string private _nameFallback;\n *\n * constructor(string memory contractName) {\n * _name = contractName.toShortStringWithFallback(_nameFallback);\n * }\n *\n * function name() external view returns (string memory) {\n * return _name.toStringWithFallback(_nameFallback);\n * }\n * }\n * ```\n */\nlibrary ShortStrings {\n // Used as an identifier for strings longer than 31 bytes.\n bytes32 private constant FALLBACK_SENTINEL = 0x00000000000000000000000000000000000000000000000000000000000000FF;\n\n error StringTooLong(string str);\n error InvalidShortString();\n\n /**\n * @dev Encode a string of at most 31 chars into a `ShortString`.\n *\n * This will trigger a `StringTooLong` error is the input string is too long.\n */\n function toShortString(string memory str) internal pure returns (ShortString) {\n bytes memory bstr = bytes(str);\n if (bstr.length > 31) {\n revert StringTooLong(str);\n }\n return ShortString.wrap(bytes32(uint256(bytes32(bstr)) | bstr.length));\n }\n\n /**\n * @dev Decode a `ShortString` back to a \"normal\" string.\n */\n function toString(ShortString sstr) internal pure returns (string memory) {\n uint256 len = byteLength(sstr);\n // using `new string(len)` would work locally but is not memory safe.\n string memory str = new string(32);\n assembly (\"memory-safe\") {\n mstore(str, len)\n mstore(add(str, 0x20), sstr)\n }\n return str;\n }\n\n /**\n * @dev Return the length of a `ShortString`.\n */\n function byteLength(ShortString sstr) internal pure returns (uint256) {\n uint256 result = uint256(ShortString.unwrap(sstr)) & 0xFF;\n if (result > 31) {\n revert InvalidShortString();\n }\n return result;\n }\n\n /**\n * @dev Encode a string into a `ShortString`, or write it to storage if it is too long.\n */\n function toShortStringWithFallback(string memory value, string storage store) internal returns (ShortString) {\n if (bytes(value).length < 32) {\n return toShortString(value);\n } else {\n StorageSlot.getStringSlot(store).value = value;\n return ShortString.wrap(FALLBACK_SENTINEL);\n }\n }\n\n /**\n * @dev Decode a string that was encoded to `ShortString` or written to storage using {setWithFallback}.\n */\n function toStringWithFallback(ShortString value, string storage store) internal pure returns (string memory) {\n if (ShortString.unwrap(value) != FALLBACK_SENTINEL) {\n return toString(value);\n } else {\n return store;\n }\n }\n\n /**\n * @dev Return the length of a string that was encoded to `ShortString` or written to storage using\n * {setWithFallback}.\n *\n * WARNING: This will return the \"byte length\" of the string. This may not reflect the actual length in terms of\n * actual characters as the UTF-8 encoding of a single character can span over multiple bytes.\n */\n function byteLengthWithFallback(ShortString value, string storage store) internal view returns (uint256) {\n if (ShortString.unwrap(value) != FALLBACK_SENTINEL) {\n return byteLength(value);\n } else {\n return bytes(store).length;\n }\n }\n}\n" + }, + "@openzeppelin/contracts/utils/StorageSlot.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/StorageSlot.sol)\n// This file was procedurally generated from scripts/generate/templates/StorageSlot.js.\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Library for reading and writing primitive types to specific storage slots.\n *\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\n * This library helps with reading and writing to such slots without the need for inline assembly.\n *\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\n *\n * Example usage to set ERC-1967 implementation slot:\n * ```solidity\n * contract ERC1967 {\n * // Define the slot. Alternatively, use the SlotDerivation library to derive the slot.\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\n *\n * function _getImplementation() internal view returns (address) {\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\n * }\n *\n * function _setImplementation(address newImplementation) internal {\n * require(newImplementation.code.length > 0);\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\n * }\n * }\n * ```\n *\n * TIP: Consider using this library along with {SlotDerivation}.\n */\nlibrary StorageSlot {\n struct AddressSlot {\n address value;\n }\n\n struct BooleanSlot {\n bool value;\n }\n\n struct Bytes32Slot {\n bytes32 value;\n }\n\n struct Uint256Slot {\n uint256 value;\n }\n\n struct Int256Slot {\n int256 value;\n }\n\n struct StringSlot {\n string value;\n }\n\n struct BytesSlot {\n bytes value;\n }\n\n /**\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\n */\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\n assembly (\"memory-safe\") {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns a `BooleanSlot` with member `value` located at `slot`.\n */\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\n assembly (\"memory-safe\") {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns a `Bytes32Slot` with member `value` located at `slot`.\n */\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\n assembly (\"memory-safe\") {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns a `Uint256Slot` with member `value` located at `slot`.\n */\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\n assembly (\"memory-safe\") {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns a `Int256Slot` with member `value` located at `slot`.\n */\n function getInt256Slot(bytes32 slot) internal pure returns (Int256Slot storage r) {\n assembly (\"memory-safe\") {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns a `StringSlot` with member `value` located at `slot`.\n */\n function getStringSlot(bytes32 slot) internal pure returns (StringSlot storage r) {\n assembly (\"memory-safe\") {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `StringSlot` representation of the string storage pointer `store`.\n */\n function getStringSlot(string storage store) internal pure returns (StringSlot storage r) {\n assembly (\"memory-safe\") {\n r.slot := store.slot\n }\n }\n\n /**\n * @dev Returns a `BytesSlot` with member `value` located at `slot`.\n */\n function getBytesSlot(bytes32 slot) internal pure returns (BytesSlot storage r) {\n assembly (\"memory-safe\") {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `BytesSlot` representation of the bytes storage pointer `store`.\n */\n function getBytesSlot(bytes storage store) internal pure returns (BytesSlot storage r) {\n assembly (\"memory-safe\") {\n r.slot := store.slot\n }\n }\n}\n" + }, + "@openzeppelin/contracts/utils/Strings.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/Strings.sol)\n\npragma solidity ^0.8.20;\n\nimport {Math} from \"./math/Math.sol\";\nimport {SignedMath} from \"./math/SignedMath.sol\";\n\n/**\n * @dev String operations.\n */\nlibrary Strings {\n bytes16 private constant HEX_DIGITS = \"0123456789abcdef\";\n uint8 private constant ADDRESS_LENGTH = 20;\n\n /**\n * @dev The `value` string doesn't fit in the specified `length`.\n */\n error StringsInsufficientHexLength(uint256 value, uint256 length);\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 assembly (\"memory-safe\") {\n ptr := add(buffer, add(32, length))\n }\n while (true) {\n ptr--;\n assembly (\"memory-safe\") {\n mstore8(ptr, byte(mod(value, 10), HEX_DIGITS))\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 toStringSigned(int256 value) internal pure returns (string memory) {\n return string.concat(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 uint256 localValue = value;\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] = HEX_DIGITS[localValue & 0xf];\n localValue >>= 4;\n }\n if (localValue != 0) {\n revert StringsInsufficientHexLength(value, length);\n }\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\n * 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 Converts an `address` with fixed length of 20 bytes to its checksummed ASCII `string` hexadecimal\n * representation, according to EIP-55.\n */\n function toChecksumHexString(address addr) internal pure returns (string memory) {\n bytes memory buffer = bytes(toHexString(addr));\n\n // hash the hex part of buffer (skip length + 2 bytes, length 40)\n uint256 hashValue;\n assembly (\"memory-safe\") {\n hashValue := shr(96, keccak256(add(buffer, 0x22), 40))\n }\n\n for (uint256 i = 41; i > 1; --i) {\n // possible values for buffer[i] are 48 (0) to 57 (9) and 97 (a) to 102 (f)\n if (hashValue & 0xf > 7 && uint8(buffer[i]) > 96) {\n // case shift by xoring with 0x20\n buffer[i] ^= 0x20;\n }\n hashValue >>= 4;\n }\n return string(buffer);\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 bytes(a).length == bytes(b).length && keccak256(bytes(a)) == keccak256(bytes(b));\n }\n}\n" + }, + "@openzeppelin/contracts/utils/structs/Checkpoints.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/structs/Checkpoints.sol)\n// This file was procedurally generated from scripts/generate/templates/Checkpoints.js.\n\npragma solidity ^0.8.20;\n\nimport {Math} from \"../math/Math.sol\";\n\n/**\n * @dev This library defines the `Trace*` struct, for checkpointing values as they change at different points in\n * time, and later looking up past values by block number. See {Votes} as an example.\n *\n * To create a history of checkpoints define a variable type `Checkpoints.Trace*` in your contract, and store a new\n * checkpoint for the current transaction block using the {push} function.\n */\nlibrary Checkpoints {\n /**\n * @dev A value was attempted to be inserted on a past checkpoint.\n */\n error CheckpointUnorderedInsertion();\n\n struct Trace224 {\n Checkpoint224[] _checkpoints;\n }\n\n struct Checkpoint224 {\n uint32 _key;\n uint224 _value;\n }\n\n /**\n * @dev Pushes a (`key`, `value`) pair into a Trace224 so that it is stored as the checkpoint.\n *\n * Returns previous value and new value.\n *\n * IMPORTANT: Never accept `key` as a user input, since an arbitrary `type(uint32).max` key set will disable the\n * library.\n */\n function push(\n Trace224 storage self,\n uint32 key,\n uint224 value\n ) internal returns (uint224 oldValue, uint224 newValue) {\n return _insert(self._checkpoints, key, value);\n }\n\n /**\n * @dev Returns the value in the first (oldest) checkpoint with key greater or equal than the search key, or zero if\n * there is none.\n */\n function lowerLookup(Trace224 storage self, uint32 key) internal view returns (uint224) {\n uint256 len = self._checkpoints.length;\n uint256 pos = _lowerBinaryLookup(self._checkpoints, key, 0, len);\n return pos == len ? 0 : _unsafeAccess(self._checkpoints, pos)._value;\n }\n\n /**\n * @dev Returns the value in the last (most recent) checkpoint with key lower or equal than the search key, or zero\n * if there is none.\n */\n function upperLookup(Trace224 storage self, uint32 key) internal view returns (uint224) {\n uint256 len = self._checkpoints.length;\n uint256 pos = _upperBinaryLookup(self._checkpoints, key, 0, len);\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\n }\n\n /**\n * @dev Returns the value in the last (most recent) checkpoint with key lower or equal than the search key, or zero\n * if there is none.\n *\n * NOTE: This is a variant of {upperLookup} that is optimised to find \"recent\" checkpoint (checkpoints with high\n * keys).\n */\n function upperLookupRecent(Trace224 storage self, uint32 key) internal view returns (uint224) {\n uint256 len = self._checkpoints.length;\n\n uint256 low = 0;\n uint256 high = len;\n\n if (len > 5) {\n uint256 mid = len - Math.sqrt(len);\n if (key < _unsafeAccess(self._checkpoints, mid)._key) {\n high = mid;\n } else {\n low = mid + 1;\n }\n }\n\n uint256 pos = _upperBinaryLookup(self._checkpoints, key, low, high);\n\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\n }\n\n /**\n * @dev Returns the value in the most recent checkpoint, or zero if there are no checkpoints.\n */\n function latest(Trace224 storage self) internal view returns (uint224) {\n uint256 pos = self._checkpoints.length;\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\n }\n\n /**\n * @dev Returns whether there is a checkpoint in the structure (i.e. it is not empty), and if so the key and value\n * in the most recent checkpoint.\n */\n function latestCheckpoint(Trace224 storage self) internal view returns (bool exists, uint32 _key, uint224 _value) {\n uint256 pos = self._checkpoints.length;\n if (pos == 0) {\n return (false, 0, 0);\n } else {\n Checkpoint224 storage ckpt = _unsafeAccess(self._checkpoints, pos - 1);\n return (true, ckpt._key, ckpt._value);\n }\n }\n\n /**\n * @dev Returns the number of checkpoint.\n */\n function length(Trace224 storage self) internal view returns (uint256) {\n return self._checkpoints.length;\n }\n\n /**\n * @dev Returns checkpoint at given position.\n */\n function at(Trace224 storage self, uint32 pos) internal view returns (Checkpoint224 memory) {\n return self._checkpoints[pos];\n }\n\n /**\n * @dev Pushes a (`key`, `value`) pair into an ordered list of checkpoints, either by inserting a new checkpoint,\n * or by updating the last one.\n */\n function _insert(\n Checkpoint224[] storage self,\n uint32 key,\n uint224 value\n ) private returns (uint224 oldValue, uint224 newValue) {\n uint256 pos = self.length;\n\n if (pos > 0) {\n Checkpoint224 storage last = _unsafeAccess(self, pos - 1);\n uint32 lastKey = last._key;\n uint224 lastValue = last._value;\n\n // Checkpoint keys must be non-decreasing.\n if (lastKey > key) {\n revert CheckpointUnorderedInsertion();\n }\n\n // Update or push new checkpoint\n if (lastKey == key) {\n last._value = value;\n } else {\n self.push(Checkpoint224({_key: key, _value: value}));\n }\n return (lastValue, value);\n } else {\n self.push(Checkpoint224({_key: key, _value: value}));\n return (0, value);\n }\n }\n\n /**\n * @dev Return the index of the first (oldest) checkpoint with key strictly bigger than the search key, or `high`\n * if there is none. `low` and `high` define a section where to do the search, with inclusive `low` and exclusive\n * `high`.\n *\n * WARNING: `high` should not be greater than the array's length.\n */\n function _upperBinaryLookup(\n Checkpoint224[] storage self,\n uint32 key,\n uint256 low,\n uint256 high\n ) private view returns (uint256) {\n while (low < high) {\n uint256 mid = Math.average(low, high);\n if (_unsafeAccess(self, mid)._key > key) {\n high = mid;\n } else {\n low = mid + 1;\n }\n }\n return high;\n }\n\n /**\n * @dev Return the index of the first (oldest) checkpoint with key greater or equal than the search key, or `high`\n * if there is none. `low` and `high` define a section where to do the search, with inclusive `low` and exclusive\n * `high`.\n *\n * WARNING: `high` should not be greater than the array's length.\n */\n function _lowerBinaryLookup(\n Checkpoint224[] storage self,\n uint32 key,\n uint256 low,\n uint256 high\n ) private view returns (uint256) {\n while (low < high) {\n uint256 mid = Math.average(low, high);\n if (_unsafeAccess(self, mid)._key < key) {\n low = mid + 1;\n } else {\n high = mid;\n }\n }\n return high;\n }\n\n /**\n * @dev Access an element of the array without performing bounds check. The position is assumed to be within bounds.\n */\n function _unsafeAccess(\n Checkpoint224[] storage self,\n uint256 pos\n ) private pure returns (Checkpoint224 storage result) {\n assembly {\n mstore(0, self.slot)\n result.slot := add(keccak256(0, 0x20), pos)\n }\n }\n\n struct Trace208 {\n Checkpoint208[] _checkpoints;\n }\n\n struct Checkpoint208 {\n uint48 _key;\n uint208 _value;\n }\n\n /**\n * @dev Pushes a (`key`, `value`) pair into a Trace208 so that it is stored as the checkpoint.\n *\n * Returns previous value and new value.\n *\n * IMPORTANT: Never accept `key` as a user input, since an arbitrary `type(uint48).max` key set will disable the\n * library.\n */\n function push(\n Trace208 storage self,\n uint48 key,\n uint208 value\n ) internal returns (uint208 oldValue, uint208 newValue) {\n return _insert(self._checkpoints, key, value);\n }\n\n /**\n * @dev Returns the value in the first (oldest) checkpoint with key greater or equal than the search key, or zero if\n * there is none.\n */\n function lowerLookup(Trace208 storage self, uint48 key) internal view returns (uint208) {\n uint256 len = self._checkpoints.length;\n uint256 pos = _lowerBinaryLookup(self._checkpoints, key, 0, len);\n return pos == len ? 0 : _unsafeAccess(self._checkpoints, pos)._value;\n }\n\n /**\n * @dev Returns the value in the last (most recent) checkpoint with key lower or equal than the search key, or zero\n * if there is none.\n */\n function upperLookup(Trace208 storage self, uint48 key) internal view returns (uint208) {\n uint256 len = self._checkpoints.length;\n uint256 pos = _upperBinaryLookup(self._checkpoints, key, 0, len);\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\n }\n\n /**\n * @dev Returns the value in the last (most recent) checkpoint with key lower or equal than the search key, or zero\n * if there is none.\n *\n * NOTE: This is a variant of {upperLookup} that is optimised to find \"recent\" checkpoint (checkpoints with high\n * keys).\n */\n function upperLookupRecent(Trace208 storage self, uint48 key) internal view returns (uint208) {\n uint256 len = self._checkpoints.length;\n\n uint256 low = 0;\n uint256 high = len;\n\n if (len > 5) {\n uint256 mid = len - Math.sqrt(len);\n if (key < _unsafeAccess(self._checkpoints, mid)._key) {\n high = mid;\n } else {\n low = mid + 1;\n }\n }\n\n uint256 pos = _upperBinaryLookup(self._checkpoints, key, low, high);\n\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\n }\n\n /**\n * @dev Returns the value in the most recent checkpoint, or zero if there are no checkpoints.\n */\n function latest(Trace208 storage self) internal view returns (uint208) {\n uint256 pos = self._checkpoints.length;\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\n }\n\n /**\n * @dev Returns whether there is a checkpoint in the structure (i.e. it is not empty), and if so the key and value\n * in the most recent checkpoint.\n */\n function latestCheckpoint(Trace208 storage self) internal view returns (bool exists, uint48 _key, uint208 _value) {\n uint256 pos = self._checkpoints.length;\n if (pos == 0) {\n return (false, 0, 0);\n } else {\n Checkpoint208 storage ckpt = _unsafeAccess(self._checkpoints, pos - 1);\n return (true, ckpt._key, ckpt._value);\n }\n }\n\n /**\n * @dev Returns the number of checkpoint.\n */\n function length(Trace208 storage self) internal view returns (uint256) {\n return self._checkpoints.length;\n }\n\n /**\n * @dev Returns checkpoint at given position.\n */\n function at(Trace208 storage self, uint32 pos) internal view returns (Checkpoint208 memory) {\n return self._checkpoints[pos];\n }\n\n /**\n * @dev Pushes a (`key`, `value`) pair into an ordered list of checkpoints, either by inserting a new checkpoint,\n * or by updating the last one.\n */\n function _insert(\n Checkpoint208[] storage self,\n uint48 key,\n uint208 value\n ) private returns (uint208 oldValue, uint208 newValue) {\n uint256 pos = self.length;\n\n if (pos > 0) {\n Checkpoint208 storage last = _unsafeAccess(self, pos - 1);\n uint48 lastKey = last._key;\n uint208 lastValue = last._value;\n\n // Checkpoint keys must be non-decreasing.\n if (lastKey > key) {\n revert CheckpointUnorderedInsertion();\n }\n\n // Update or push new checkpoint\n if (lastKey == key) {\n last._value = value;\n } else {\n self.push(Checkpoint208({_key: key, _value: value}));\n }\n return (lastValue, value);\n } else {\n self.push(Checkpoint208({_key: key, _value: value}));\n return (0, value);\n }\n }\n\n /**\n * @dev Return the index of the first (oldest) checkpoint with key strictly bigger than the search key, or `high`\n * if there is none. `low` and `high` define a section where to do the search, with inclusive `low` and exclusive\n * `high`.\n *\n * WARNING: `high` should not be greater than the array's length.\n */\n function _upperBinaryLookup(\n Checkpoint208[] storage self,\n uint48 key,\n uint256 low,\n uint256 high\n ) private view returns (uint256) {\n while (low < high) {\n uint256 mid = Math.average(low, high);\n if (_unsafeAccess(self, mid)._key > key) {\n high = mid;\n } else {\n low = mid + 1;\n }\n }\n return high;\n }\n\n /**\n * @dev Return the index of the first (oldest) checkpoint with key greater or equal than the search key, or `high`\n * if there is none. `low` and `high` define a section where to do the search, with inclusive `low` and exclusive\n * `high`.\n *\n * WARNING: `high` should not be greater than the array's length.\n */\n function _lowerBinaryLookup(\n Checkpoint208[] storage self,\n uint48 key,\n uint256 low,\n uint256 high\n ) private view returns (uint256) {\n while (low < high) {\n uint256 mid = Math.average(low, high);\n if (_unsafeAccess(self, mid)._key < key) {\n low = mid + 1;\n } else {\n high = mid;\n }\n }\n return high;\n }\n\n /**\n * @dev Access an element of the array without performing bounds check. The position is assumed to be within bounds.\n */\n function _unsafeAccess(\n Checkpoint208[] storage self,\n uint256 pos\n ) private pure returns (Checkpoint208 storage result) {\n assembly {\n mstore(0, self.slot)\n result.slot := add(keccak256(0, 0x20), pos)\n }\n }\n\n struct Trace160 {\n Checkpoint160[] _checkpoints;\n }\n\n struct Checkpoint160 {\n uint96 _key;\n uint160 _value;\n }\n\n /**\n * @dev Pushes a (`key`, `value`) pair into a Trace160 so that it is stored as the checkpoint.\n *\n * Returns previous value and new value.\n *\n * IMPORTANT: Never accept `key` as a user input, since an arbitrary `type(uint96).max` key set will disable the\n * library.\n */\n function push(\n Trace160 storage self,\n uint96 key,\n uint160 value\n ) internal returns (uint160 oldValue, uint160 newValue) {\n return _insert(self._checkpoints, key, value);\n }\n\n /**\n * @dev Returns the value in the first (oldest) checkpoint with key greater or equal than the search key, or zero if\n * there is none.\n */\n function lowerLookup(Trace160 storage self, uint96 key) internal view returns (uint160) {\n uint256 len = self._checkpoints.length;\n uint256 pos = _lowerBinaryLookup(self._checkpoints, key, 0, len);\n return pos == len ? 0 : _unsafeAccess(self._checkpoints, pos)._value;\n }\n\n /**\n * @dev Returns the value in the last (most recent) checkpoint with key lower or equal than the search key, or zero\n * if there is none.\n */\n function upperLookup(Trace160 storage self, uint96 key) internal view returns (uint160) {\n uint256 len = self._checkpoints.length;\n uint256 pos = _upperBinaryLookup(self._checkpoints, key, 0, len);\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\n }\n\n /**\n * @dev Returns the value in the last (most recent) checkpoint with key lower or equal than the search key, or zero\n * if there is none.\n *\n * NOTE: This is a variant of {upperLookup} that is optimised to find \"recent\" checkpoint (checkpoints with high\n * keys).\n */\n function upperLookupRecent(Trace160 storage self, uint96 key) internal view returns (uint160) {\n uint256 len = self._checkpoints.length;\n\n uint256 low = 0;\n uint256 high = len;\n\n if (len > 5) {\n uint256 mid = len - Math.sqrt(len);\n if (key < _unsafeAccess(self._checkpoints, mid)._key) {\n high = mid;\n } else {\n low = mid + 1;\n }\n }\n\n uint256 pos = _upperBinaryLookup(self._checkpoints, key, low, high);\n\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\n }\n\n /**\n * @dev Returns the value in the most recent checkpoint, or zero if there are no checkpoints.\n */\n function latest(Trace160 storage self) internal view returns (uint160) {\n uint256 pos = self._checkpoints.length;\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\n }\n\n /**\n * @dev Returns whether there is a checkpoint in the structure (i.e. it is not empty), and if so the key and value\n * in the most recent checkpoint.\n */\n function latestCheckpoint(Trace160 storage self) internal view returns (bool exists, uint96 _key, uint160 _value) {\n uint256 pos = self._checkpoints.length;\n if (pos == 0) {\n return (false, 0, 0);\n } else {\n Checkpoint160 storage ckpt = _unsafeAccess(self._checkpoints, pos - 1);\n return (true, ckpt._key, ckpt._value);\n }\n }\n\n /**\n * @dev Returns the number of checkpoint.\n */\n function length(Trace160 storage self) internal view returns (uint256) {\n return self._checkpoints.length;\n }\n\n /**\n * @dev Returns checkpoint at given position.\n */\n function at(Trace160 storage self, uint32 pos) internal view returns (Checkpoint160 memory) {\n return self._checkpoints[pos];\n }\n\n /**\n * @dev Pushes a (`key`, `value`) pair into an ordered list of checkpoints, either by inserting a new checkpoint,\n * or by updating the last one.\n */\n function _insert(\n Checkpoint160[] storage self,\n uint96 key,\n uint160 value\n ) private returns (uint160 oldValue, uint160 newValue) {\n uint256 pos = self.length;\n\n if (pos > 0) {\n Checkpoint160 storage last = _unsafeAccess(self, pos - 1);\n uint96 lastKey = last._key;\n uint160 lastValue = last._value;\n\n // Checkpoint keys must be non-decreasing.\n if (lastKey > key) {\n revert CheckpointUnorderedInsertion();\n }\n\n // Update or push new checkpoint\n if (lastKey == key) {\n last._value = value;\n } else {\n self.push(Checkpoint160({_key: key, _value: value}));\n }\n return (lastValue, value);\n } else {\n self.push(Checkpoint160({_key: key, _value: value}));\n return (0, value);\n }\n }\n\n /**\n * @dev Return the index of the first (oldest) checkpoint with key strictly bigger than the search key, or `high`\n * if there is none. `low` and `high` define a section where to do the search, with inclusive `low` and exclusive\n * `high`.\n *\n * WARNING: `high` should not be greater than the array's length.\n */\n function _upperBinaryLookup(\n Checkpoint160[] storage self,\n uint96 key,\n uint256 low,\n uint256 high\n ) private view returns (uint256) {\n while (low < high) {\n uint256 mid = Math.average(low, high);\n if (_unsafeAccess(self, mid)._key > key) {\n high = mid;\n } else {\n low = mid + 1;\n }\n }\n return high;\n }\n\n /**\n * @dev Return the index of the first (oldest) checkpoint with key greater or equal than the search key, or `high`\n * if there is none. `low` and `high` define a section where to do the search, with inclusive `low` and exclusive\n * `high`.\n *\n * WARNING: `high` should not be greater than the array's length.\n */\n function _lowerBinaryLookup(\n Checkpoint160[] storage self,\n uint96 key,\n uint256 low,\n uint256 high\n ) private view returns (uint256) {\n while (low < high) {\n uint256 mid = Math.average(low, high);\n if (_unsafeAccess(self, mid)._key < key) {\n low = mid + 1;\n } else {\n high = mid;\n }\n }\n return high;\n }\n\n /**\n * @dev Access an element of the array without performing bounds check. The position is assumed to be within bounds.\n */\n function _unsafeAccess(\n Checkpoint160[] storage self,\n uint256 pos\n ) private pure returns (Checkpoint160 storage result) {\n assembly {\n mstore(0, self.slot)\n result.slot := add(keccak256(0, 0x20), pos)\n }\n }\n}\n" + }, + "@openzeppelin/contracts/utils/structs/DoubleEndedQueue.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/structs/DoubleEndedQueue.sol)\npragma solidity ^0.8.20;\n\nimport {Panic} from \"../Panic.sol\";\n\n/**\n * @dev A sequence of items with the ability to efficiently push and pop items (i.e. insert and remove) on both ends of\n * the sequence (called front and back). Among other access patterns, it can be used to implement efficient LIFO and\n * FIFO queues. Storage use is optimized, and all operations are O(1) constant time. This includes {clear}, given that\n * the existing queue contents are left in storage.\n *\n * The struct is called `Bytes32Deque`. Other types can be cast to and from `bytes32`. This data structure can only be\n * used in storage, and not in memory.\n * ```solidity\n * DoubleEndedQueue.Bytes32Deque queue;\n * ```\n */\nlibrary DoubleEndedQueue {\n /**\n * @dev Indices are 128 bits so begin and end are packed in a single storage slot for efficient access.\n *\n * Struct members have an underscore prefix indicating that they are \"private\" and should not be read or written to\n * directly. Use the functions provided below instead. Modifying the struct manually may violate assumptions and\n * lead to unexpected behavior.\n *\n * The first item is at data[begin] and the last item is at data[end - 1]. This range can wrap around.\n */\n struct Bytes32Deque {\n uint128 _begin;\n uint128 _end;\n mapping(uint128 index => bytes32) _data;\n }\n\n /**\n * @dev Inserts an item at the end of the queue.\n *\n * Reverts with {Panic-RESOURCE_ERROR} if the queue is full.\n */\n function pushBack(Bytes32Deque storage deque, bytes32 value) internal {\n unchecked {\n uint128 backIndex = deque._end;\n if (backIndex + 1 == deque._begin) Panic.panic(Panic.RESOURCE_ERROR);\n deque._data[backIndex] = value;\n deque._end = backIndex + 1;\n }\n }\n\n /**\n * @dev Removes the item at the end of the queue and returns it.\n *\n * Reverts with {Panic-EMPTY_ARRAY_POP} if the queue is empty.\n */\n function popBack(Bytes32Deque storage deque) internal returns (bytes32 value) {\n unchecked {\n uint128 backIndex = deque._end;\n if (backIndex == deque._begin) Panic.panic(Panic.EMPTY_ARRAY_POP);\n --backIndex;\n value = deque._data[backIndex];\n delete deque._data[backIndex];\n deque._end = backIndex;\n }\n }\n\n /**\n * @dev Inserts an item at the beginning of the queue.\n *\n * Reverts with {Panic-RESOURCE_ERROR} if the queue is full.\n */\n function pushFront(Bytes32Deque storage deque, bytes32 value) internal {\n unchecked {\n uint128 frontIndex = deque._begin - 1;\n if (frontIndex == deque._end) Panic.panic(Panic.RESOURCE_ERROR);\n deque._data[frontIndex] = value;\n deque._begin = frontIndex;\n }\n }\n\n /**\n * @dev Removes the item at the beginning of the queue and returns it.\n *\n * Reverts with {Panic-EMPTY_ARRAY_POP} if the queue is empty.\n */\n function popFront(Bytes32Deque storage deque) internal returns (bytes32 value) {\n unchecked {\n uint128 frontIndex = deque._begin;\n if (frontIndex == deque._end) Panic.panic(Panic.EMPTY_ARRAY_POP);\n value = deque._data[frontIndex];\n delete deque._data[frontIndex];\n deque._begin = frontIndex + 1;\n }\n }\n\n /**\n * @dev Returns the item at the beginning of the queue.\n *\n * Reverts with {Panic-ARRAY_OUT_OF_BOUNDS} if the queue is empty.\n */\n function front(Bytes32Deque storage deque) internal view returns (bytes32 value) {\n if (empty(deque)) Panic.panic(Panic.ARRAY_OUT_OF_BOUNDS);\n return deque._data[deque._begin];\n }\n\n /**\n * @dev Returns the item at the end of the queue.\n *\n * Reverts with {Panic-ARRAY_OUT_OF_BOUNDS} if the queue is empty.\n */\n function back(Bytes32Deque storage deque) internal view returns (bytes32 value) {\n if (empty(deque)) Panic.panic(Panic.ARRAY_OUT_OF_BOUNDS);\n unchecked {\n return deque._data[deque._end - 1];\n }\n }\n\n /**\n * @dev Return the item at a position in the queue given by `index`, with the first item at 0 and last item at\n * `length(deque) - 1`.\n *\n * Reverts with {Panic-ARRAY_OUT_OF_BOUNDS} if the index is out of bounds.\n */\n function at(Bytes32Deque storage deque, uint256 index) internal view returns (bytes32 value) {\n if (index >= length(deque)) Panic.panic(Panic.ARRAY_OUT_OF_BOUNDS);\n // By construction, length is a uint128, so the check above ensures that index can be safely downcast to uint128\n unchecked {\n return deque._data[deque._begin + uint128(index)];\n }\n }\n\n /**\n * @dev Resets the queue back to being empty.\n *\n * NOTE: The current items are left behind in storage. This does not affect the functioning of the queue, but misses\n * out on potential gas refunds.\n */\n function clear(Bytes32Deque storage deque) internal {\n deque._begin = 0;\n deque._end = 0;\n }\n\n /**\n * @dev Returns the number of items in the queue.\n */\n function length(Bytes32Deque storage deque) internal view returns (uint256) {\n unchecked {\n return uint256(deque._end - deque._begin);\n }\n }\n\n /**\n * @dev Returns true if the queue is empty.\n */\n function empty(Bytes32Deque storage deque) internal view returns (bool) {\n return deque._end == deque._begin;\n }\n}\n" + }, + "@openzeppelin/contracts/utils/types/Time.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/types/Time.sol)\n\npragma solidity ^0.8.20;\n\nimport {Math} from \"../math/Math.sol\";\nimport {SafeCast} from \"../math/SafeCast.sol\";\n\n/**\n * @dev This library provides helpers for manipulating time-related objects.\n *\n * It uses the following types:\n * - `uint48` for timepoints\n * - `uint32` for durations\n *\n * While the library doesn't provide specific types for timepoints and duration, it does provide:\n * - a `Delay` type to represent duration that can be programmed to change value automatically at a given point\n * - additional helper functions\n */\nlibrary Time {\n using Time for *;\n\n /**\n * @dev Get the block timestamp as a Timepoint.\n */\n function timestamp() internal view returns (uint48) {\n return SafeCast.toUint48(block.timestamp);\n }\n\n /**\n * @dev Get the block number as a Timepoint.\n */\n function blockNumber() internal view returns (uint48) {\n return SafeCast.toUint48(block.number);\n }\n\n // ==================================================== Delay =====================================================\n /**\n * @dev A `Delay` is a uint32 duration that can be programmed to change value automatically at a given point in the\n * future. The \"effect\" timepoint describes when the transitions happens from the \"old\" value to the \"new\" value.\n * This allows updating the delay applied to some operation while keeping some guarantees.\n *\n * In particular, the {update} function guarantees that if the delay is reduced, the old delay still applies for\n * some time. For example if the delay is currently 7 days to do an upgrade, the admin should not be able to set\n * the delay to 0 and upgrade immediately. If the admin wants to reduce the delay, the old delay (7 days) should\n * still apply for some time.\n *\n *\n * The `Delay` type is 112 bits long, and packs the following:\n *\n * ```\n * | [uint48]: effect date (timepoint)\n * | | [uint32]: value before (duration)\n * ↓ ↓ ↓ [uint32]: value after (duration)\n * 0xAAAAAAAAAAAABBBBBBBBCCCCCCCC\n * ```\n *\n * NOTE: The {get} and {withUpdate} functions operate using timestamps. Block number based delays are not currently\n * supported.\n */\n type Delay is uint112;\n\n /**\n * @dev Wrap a duration into a Delay to add the one-step \"update in the future\" feature\n */\n function toDelay(uint32 duration) internal pure returns (Delay) {\n return Delay.wrap(duration);\n }\n\n /**\n * @dev Get the value at a given timepoint plus the pending value and effect timepoint if there is a scheduled\n * change after this timepoint. If the effect timepoint is 0, then the pending value should not be considered.\n */\n function _getFullAt(\n Delay self,\n uint48 timepoint\n ) private pure returns (uint32 valueBefore, uint32 valueAfter, uint48 effect) {\n (valueBefore, valueAfter, effect) = self.unpack();\n return effect <= timepoint ? (valueAfter, 0, 0) : (valueBefore, valueAfter, effect);\n }\n\n /**\n * @dev Get the current value plus the pending value and effect timepoint if there is a scheduled change. If the\n * effect timepoint is 0, then the pending value should not be considered.\n */\n function getFull(Delay self) internal view returns (uint32 valueBefore, uint32 valueAfter, uint48 effect) {\n return _getFullAt(self, timestamp());\n }\n\n /**\n * @dev Get the current value.\n */\n function get(Delay self) internal view returns (uint32) {\n (uint32 delay, , ) = self.getFull();\n return delay;\n }\n\n /**\n * @dev Update a Delay object so that it takes a new duration after a timepoint that is automatically computed to\n * enforce the old delay at the moment of the update. Returns the updated Delay object and the timestamp when the\n * new delay becomes effective.\n */\n function withUpdate(\n Delay self,\n uint32 newValue,\n uint32 minSetback\n ) internal view returns (Delay updatedDelay, uint48 effect) {\n uint32 value = self.get();\n uint32 setback = uint32(Math.max(minSetback, value > newValue ? value - newValue : 0));\n effect = timestamp() + setback;\n return (pack(value, newValue, effect), effect);\n }\n\n /**\n * @dev Split a delay into its components: valueBefore, valueAfter and effect (transition timepoint).\n */\n function unpack(Delay self) internal pure returns (uint32 valueBefore, uint32 valueAfter, uint48 effect) {\n uint112 raw = Delay.unwrap(self);\n\n valueAfter = uint32(raw);\n valueBefore = uint32(raw >> 32);\n effect = uint48(raw >> 64);\n\n return (valueBefore, valueAfter, effect);\n }\n\n /**\n * @dev pack the components into a Delay object.\n */\n function pack(uint32 valueBefore, uint32 valueAfter, uint48 effect) internal pure returns (Delay) {\n return Delay.wrap((uint112(effect) << 64) | (uint112(valueBefore) << 32) | uint112(valueAfter));\n }\n}\n" + }, + "contracts/variants/crosschain/Gov.sol": { + "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity ^0.8.20;\n\nimport \"@openzeppelin/contracts/governance/Governor.sol\";\nimport \"@openzeppelin/contracts/governance/extensions/GovernorSettings.sol\";\nimport \"@openzeppelin/contracts/governance/extensions/GovernorCountingSimple.sol\";\nimport \"@openzeppelin/contracts/governance/extensions/GovernorVotes.sol\";\nimport \"@openzeppelin/contracts/governance/extensions/GovernorVotesQuorumFraction.sol\";\nimport \"./ProofHandler.sol\";\n\n/**\n * @title Cross-chain Governance Contract\n * @author Web3 Hackers Collective\n * @notice Implementation of a DAO with cross-chain synchronization capabilities\n * @dev Extends OpenZeppelin's Governor contract with cross-chain parameter updates\n * @custom:security-contact julien@strat.cc\n */\ncontract Gov is\n Governor,\n GovernorSettings,\n GovernorCountingSimple,\n GovernorVotes,\n GovernorVotesQuorumFraction\n{\n /// @notice Chain ID where this contract was originally deployed\n uint256 public immutable home;\n\n /// @notice IPFS CID of the DAO's manifesto\n string public manifesto;\n\n /// @notice Storage for proof handling\n ProofHandler.ProofStorage private _proofStorage;\n\n /// @notice Types of operations that can be synchronized across chains\n enum OperationType {\n SET_MANIFESTO,\n UPDATE_VOTING_DELAY,\n UPDATE_VOTING_PERIOD,\n UPDATE_PROPOSAL_THRESHOLD,\n UPDATE_QUORUM\n }\n\n /// @notice Emitted when the manifesto is updated\n /// @param oldManifesto Previous manifesto CID\n /// @param newManifesto New manifesto CID\n /// @param nonce Update sequence number\n event ManifestoUpdated(string oldManifesto, string newManifesto, uint256 nonce);\n\n /// @notice Emitted when a governance parameter is updated\n /// @param operationType Type of parameter updated\n /// @param oldValue Previous value\n /// @param newValue New value\n /// @param nonce Update sequence number\n event GovernanceParameterUpdated(\n OperationType indexed operationType,\n uint256 oldValue,\n uint256 newValue,\n uint256 nonce\n );\n\n /// @notice Restricts functions to be called only on the home chain\n modifier onlyHomeChain() {\n require(block.chainid == home, \"Operation only allowed on home chain\");\n _;\n }\n\n /**\n * @notice Initializes the governance contract\n * @dev Sets up initial governance parameters and manifesto\n * @param _home Chain ID where this contract is considered home\n * @param _token The voting token contract address\n * @param _manifestoCid Initial manifesto CID\n * @param _name Name of the governance contract\n * @param _votingDelay Time before voting begins\n * @param _votingPeriod Duration of voting period\n * @param _proposalThreshold Minimum votes needed to create a proposal\n * @param _quorum Minimum participation percentage required\n */\n constructor(\n uint256 _home,\n IVotes _token,\n string memory _manifestoCid,\n string memory _name,\n uint48 _votingDelay,\n uint32 _votingPeriod,\n uint256 _proposalThreshold,\n uint256 _quorum\n )\n Governor(_name)\n GovernorSettings(_votingDelay, _votingPeriod, _proposalThreshold)\n GovernorVotes(_token)\n GovernorVotesQuorumFraction(_quorum)\n {\n home = _home;\n manifesto = _manifestoCid;\n }\n\n /**\n * @notice Updates the DAO's manifesto on the home chain\n * @param newManifesto New manifesto CID\n */\n function setManifesto(string memory newManifesto) public onlyGovernance onlyHomeChain {\n uint256 nonce = ProofHandler.incrementNonce(\n _proofStorage,\n uint8(OperationType.SET_MANIFESTO)\n );\n string memory oldManifesto = manifesto;\n manifesto = newManifesto;\n emit ManifestoUpdated(oldManifesto, newManifesto, nonce);\n }\n\n /**\n * @notice Updates the voting delay parameter on the home chain\n * @param newVotingDelay New voting delay value\n */\n function setVotingDelay(\n uint48 newVotingDelay\n ) public virtual override onlyGovernance onlyHomeChain {\n uint256 nonce = ProofHandler.incrementNonce(\n _proofStorage,\n uint8(OperationType.UPDATE_VOTING_DELAY)\n );\n uint256 oldValue = votingDelay();\n _setVotingDelay(newVotingDelay);\n emit GovernanceParameterUpdated(\n OperationType.UPDATE_VOTING_DELAY,\n oldValue,\n newVotingDelay,\n nonce\n );\n }\n\n /**\n * @notice Updates the voting period parameter on the home chain\n * @param newVotingPeriod New voting period value\n */\n function setVotingPeriod(\n uint32 newVotingPeriod\n ) public virtual override onlyGovernance onlyHomeChain {\n uint256 nonce = ProofHandler.incrementNonce(\n _proofStorage,\n uint8(OperationType.UPDATE_VOTING_PERIOD)\n );\n uint256 oldValue = votingPeriod();\n _setVotingPeriod(newVotingPeriod);\n emit GovernanceParameterUpdated(\n OperationType.UPDATE_VOTING_PERIOD,\n oldValue,\n newVotingPeriod,\n nonce\n );\n }\n\n /**\n * @notice Updates the proposal threshold parameter on the home chain\n * @param newProposalThreshold New proposal threshold value\n */\n function setProposalThreshold(\n uint256 newProposalThreshold\n ) public virtual override onlyGovernance onlyHomeChain {\n uint256 nonce = ProofHandler.incrementNonce(\n _proofStorage,\n uint8(OperationType.UPDATE_PROPOSAL_THRESHOLD)\n );\n uint256 oldValue = proposalThreshold();\n _setProposalThreshold(newProposalThreshold);\n emit GovernanceParameterUpdated(\n OperationType.UPDATE_PROPOSAL_THRESHOLD,\n oldValue,\n newProposalThreshold,\n nonce\n );\n }\n\n /**\n * @notice Updates the quorum numerator on the home chain\n * @param newQuorumNumerator New quorum numerator value\n */\n function updateQuorumNumerator(\n uint256 newQuorumNumerator\n ) public virtual override onlyGovernance onlyHomeChain {\n uint256 nonce = ProofHandler.incrementNonce(\n _proofStorage,\n uint8(OperationType.UPDATE_QUORUM)\n );\n uint256 oldValue = quorumNumerator();\n _updateQuorumNumerator(newQuorumNumerator);\n emit GovernanceParameterUpdated(\n OperationType.UPDATE_QUORUM,\n oldValue,\n newQuorumNumerator,\n nonce\n );\n }\n\n /**\n * @notice Generates proof for parameter updates\n * @param operationType Type of parameter being updated\n * @param value Encoded parameter value\n * @return proof Encoded proof data\n */\n function generateParameterProof(\n uint8 operationType,\n bytes memory value\n ) external view returns (bytes memory proof) {\n require(block.chainid == home, \"Proofs only generated on home chain\");\n uint256 nextNonce = ProofHandler.getNextNonce(_proofStorage, operationType);\n return ProofHandler.generateProof(address(this), operationType, value, nextNonce);\n }\n\n /**\n * @notice Claims a parameter update on a foreign chain\n * @param proof Proof generated by home chain\n */\n function claimParameterUpdate(bytes memory proof) external {\n (uint8 operationType, bytes memory value, uint256 nonce) = ProofHandler.verifyAndClaimProof(\n proof,\n address(this),\n _proofStorage\n );\n\n if (operationType == uint8(OperationType.SET_MANIFESTO)) {\n string memory newManifesto = abi.decode(value, (string));\n string memory oldManifesto = manifesto;\n manifesto = newManifesto;\n emit ManifestoUpdated(oldManifesto, newManifesto, nonce);\n } else if (operationType == uint8(OperationType.UPDATE_VOTING_DELAY)) {\n uint48 newValue = uint48(bytes6(value));\n uint256 oldValue = votingDelay();\n _setVotingDelay(newValue);\n emit GovernanceParameterUpdated(\n OperationType.UPDATE_VOTING_DELAY,\n oldValue,\n newValue,\n nonce\n );\n } else if (operationType == uint8(OperationType.UPDATE_VOTING_PERIOD)) {\n uint32 newValue = uint32(bytes4(value));\n uint256 oldValue = votingPeriod();\n _setVotingPeriod(newValue);\n emit GovernanceParameterUpdated(\n OperationType.UPDATE_VOTING_PERIOD,\n oldValue,\n newValue,\n nonce\n );\n } else if (operationType == uint8(OperationType.UPDATE_PROPOSAL_THRESHOLD)) {\n uint256 newValue = abi.decode(value, (uint256));\n uint256 oldValue = proposalThreshold();\n _setProposalThreshold(newValue);\n emit GovernanceParameterUpdated(\n OperationType.UPDATE_PROPOSAL_THRESHOLD,\n oldValue,\n newValue,\n nonce\n );\n } else if (operationType == uint8(OperationType.UPDATE_QUORUM)) {\n uint256 newValue = abi.decode(value, (uint256));\n uint256 oldValue = quorumNumerator();\n _updateQuorumNumerator(newValue);\n emit GovernanceParameterUpdated(OperationType.UPDATE_QUORUM, oldValue, newValue, nonce);\n }\n }\n\n // Required overrides\n\n function votingDelay() public view override(Governor, GovernorSettings) returns (uint256) {\n return super.votingDelay();\n }\n\n function votingPeriod() public view override(Governor, GovernorSettings) returns (uint256) {\n return super.votingPeriod();\n }\n\n function quorum(\n uint256 blockNumber\n ) public view override(Governor, GovernorVotesQuorumFraction) returns (uint256) {\n return super.quorum(blockNumber);\n }\n\n function proposalThreshold()\n public\n view\n override(Governor, GovernorSettings)\n returns (uint256)\n {\n return super.proposalThreshold();\n }\n}\n" + }, + "contracts/variants/crosschain/NFT.sol": { + "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity ^0.8.20;\n\nimport \"@openzeppelin/contracts/token/ERC721/ERC721.sol\";\nimport \"@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol\";\nimport \"@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol\";\nimport \"@openzeppelin/contracts/token/ERC721/extensions/ERC721Burnable.sol\";\nimport \"@openzeppelin/contracts/access/Ownable.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/EIP712.sol\";\nimport \"@openzeppelin/contracts/token/ERC721/extensions/ERC721Votes.sol\";\nimport \"./ProofHandler.sol\";\n\n/**\n * @title Cross-chain Membership NFT Contract\n * @author Web3 Hackers Collective\n * @notice Non-transferable NFT implementation for DAO membership with cross-chain capabilities\n * @dev Extends OpenZeppelin's NFT standards with cross-chain operation support\n * @custom:security-contact julien@strat.cc\n */\ncontract NFT is\n ERC721,\n ERC721Enumerable,\n ERC721URIStorage,\n ERC721Burnable,\n Ownable,\n EIP712,\n ERC721Votes\n{\n using ProofHandler for ProofHandler.ProofStorage;\n\n /// @notice Chain ID where contract was originally deployed\n uint256 public immutable home;\n\n /// @notice Next token ID to be minted\n uint256 private _nextTokenId;\n\n /// @notice Storage for proof handling\n ProofHandler.ProofStorage private _proofStorage;\n\n /// @notice Types of operations that can be synchronized across chains\n enum OperationType {\n MINT,\n BURN,\n SET_METADATA\n }\n\n /// @notice Emitted when a membership is claimed\n /// @param tokenId The ID of the claimed token\n /// @param member The address receiving the membership\n /// @param nonce Operation sequence number\n event MembershipClaimed(uint256 indexed tokenId, address indexed member, uint256 nonce);\n\n /// @notice Emitted when a membership is revoked\n /// @param tokenId The ID of the revoked token\n /// @param member The address losing membership\n /// @param nonce Operation sequence number\n event MembershipRevoked(uint256 indexed tokenId, address indexed member, uint256 nonce);\n\n /// @notice Emitted when metadata is updated\n /// @param tokenId The ID of the updated token\n /// @param newUri The new metadata URI\n /// @param nonce Operation sequence number\n event MetadataUpdated(uint256 indexed tokenId, string newUri, uint256 nonce);\n\n /// @notice Restricts functions to home chain\n modifier onlyHomeChain() {\n require(block.chainid == home, \"Operation only allowed on home chain\");\n _;\n }\n\n /**\n * @notice Initializes the NFT contract\n * @param _home Chain ID where contract is considered home\n * @param initialOwner Initial contract owner\n * @param _firstMembers Array of initial member addresses\n * @param _uri Initial token URI\n * @param _name Token collection name\n * @param _symbol Token collection symbol\n */\n constructor(\n uint256 _home,\n address initialOwner,\n address[] memory _firstMembers,\n string memory _uri,\n string memory _name,\n string memory _symbol\n ) ERC721(_name, _symbol) Ownable(initialOwner) EIP712(_name, \"1\") {\n home = _home;\n for (uint i; i < _firstMembers.length; i++) {\n _govMint(_firstMembers[i], _uri);\n }\n }\n\n /**\n * @notice Adds a new member on home chain\n * @dev Only callable by owner (governance) on home chain\n * @param to Address to mint token to\n * @param uri Token metadata URI\n */\n function safeMint(address to, string memory uri) public onlyOwner onlyHomeChain {\n uint256 nonce = _proofStorage.incrementNonce(uint8(OperationType.MINT));\n _govMint(to, uri);\n emit MembershipClaimed(_nextTokenId - 1, to, nonce);\n }\n\n /**\n * @notice Burns token on home chain\n * @dev Only callable by owner (governance) on home chain\n * @param tokenId ID of token to burn\n */\n function govBurn(uint256 tokenId) public onlyOwner onlyHomeChain {\n uint256 nonce = _proofStorage.incrementNonce(uint8(OperationType.BURN));\n address owner = ownerOf(tokenId);\n _burn(tokenId);\n emit MembershipRevoked(tokenId, owner, nonce);\n }\n\n /**\n * @notice Updates token metadata on home chain\n * @dev Only callable by owner (governance) on home chain\n * @param tokenId ID of token to update\n * @param uri New metadata URI\n */\n function setMetadata(uint256 tokenId, string memory uri) public onlyOwner onlyHomeChain {\n uint256 nonce = _proofStorage.incrementNonce(uint8(OperationType.SET_METADATA));\n _setTokenURI(tokenId, uri);\n emit MetadataUpdated(tokenId, uri, nonce);\n }\n\n /**\n * @notice Generates proof for NFT operations\n * @param operationType Type of operation\n * @param params Operation parameters\n * @return Encoded proof data\n */\n function generateOperationProof(\n uint8 operationType,\n bytes memory params\n ) external view returns (bytes memory) {\n require(block.chainid == home, \"Proofs only generated on home chain\");\n uint256 nextNonce = _proofStorage.getNextNonce(operationType);\n return ProofHandler.generateProof(address(this), operationType, params, nextNonce);\n }\n\n /**\n * @notice Claims an NFT operation on a foreign chain\n * @param proof Proof generated by home chain\n */\n function claimOperation(bytes memory proof) external {\n (uint8 operationType, bytes memory params, uint256 nonce) = ProofHandler\n .verifyAndClaimProof(proof, address(this), _proofStorage);\n\n if (operationType == uint8(OperationType.MINT)) {\n (address to, string memory uri) = abi.decode(params, (address, string));\n _govMint(to, uri);\n emit MembershipClaimed(_nextTokenId - 1, to, nonce);\n } else if (operationType == uint8(OperationType.BURN)) {\n uint256 tokenId = abi.decode(params, (uint256));\n address owner = ownerOf(tokenId);\n _burn(tokenId);\n emit MembershipRevoked(tokenId, owner, nonce);\n } else if (operationType == uint8(OperationType.SET_METADATA)) {\n (uint256 tokenId, string memory uri) = abi.decode(params, (uint256, string));\n _setTokenURI(tokenId, uri);\n emit MetadataUpdated(tokenId, uri, nonce);\n }\n }\n\n /**\n * @notice Internal function for minting without proof verification\n * @param to Address to receive token\n * @param uri Token metadata URI\n */\n function _govMint(address to, string memory uri) internal {\n uint256 tokenId = _nextTokenId++;\n _safeMint(to, tokenId);\n _setTokenURI(tokenId, uri);\n }\n\n // Required overrides\n\n function _update(\n address to,\n uint256 tokenId,\n address auth\n ) internal override(ERC721, ERC721Enumerable, ERC721Votes) returns (address) {\n require(auth == address(0) || to == address(0), \"NFT is not transferable\");\n return super._update(to, tokenId, auth);\n }\n\n function _increaseBalance(\n address account,\n uint128 value\n ) internal override(ERC721, ERC721Enumerable, ERC721Votes) {\n super._increaseBalance(account, value);\n }\n\n function tokenURI(\n uint256 tokenId\n ) public view override(ERC721, ERC721URIStorage) returns (string memory) {\n return super.tokenURI(tokenId);\n }\n\n function supportsInterface(\n bytes4 interfaceId\n ) public view override(ERC721, ERC721Enumerable, ERC721URIStorage) returns (bool) {\n return super.supportsInterface(interfaceId);\n }\n\n function clock() public view override returns (uint48) {\n return uint48(block.timestamp);\n }\n\n function CLOCK_MODE() public pure override returns (string memory) {\n return \"mode=timestamp\";\n }\n}\n" + }, + "contracts/variants/crosschain/ProofHandler.sol": { + "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity ^0.8.20;\n\n/**\n * @title Proof Handler Library\n * @author Web3 Hackers Collective\n * @notice Library for standardized cross-chain proof generation and verification\n * @dev Handles proof generation, verification, and tracking for cross-chain operations\n * @custom:security-contact julien@strat.cc\n */\nlibrary ProofHandler {\n /// @notice Tracks which proofs have been applied on each chain\n struct ProofStorage {\n mapping(bytes32 => bool) updateAppliedOnChain;\n mapping(uint8 => uint256) currentNonce;\n }\n\n /// @dev Emitted when a proof is claimed\n event ProofClaimed(uint8 indexed operationType, bytes params, uint256 nonce);\n\n /**\n * @notice Generates a proof for cross-chain operations\n * @param contractAddress Address of contract generating the proof\n * @param operationType Type of operation being performed\n * @param params Operation parameters\n * @param nonce Current nonce for this operation type\n * @return proof Encoded proof data\n */\n function generateProof(\n address contractAddress,\n uint8 operationType,\n bytes memory params,\n uint256 nonce\n ) public pure returns (bytes memory proof) {\n bytes32 message = keccak256(\n abi.encodePacked(contractAddress, operationType, params, nonce)\n );\n bytes32 digest = keccak256(abi.encodePacked(\"\\x19Ethereum Signed Message:\\n32\", message));\n\n return abi.encode(operationType, params, nonce, digest);\n }\n\n /**\n * @notice Verifies and claims a proof\n * @param proof Proof to verify and claim\n * @param contractAddress Address of contract claiming the proof\n * @param storage_ Proof storage struct\n * @return operationType The type of operation being performed\n * @return params The operation parameters\n * @return nonce The operation sequence number\n */\n function verifyAndClaimProof(\n bytes memory proof,\n address contractAddress,\n ProofStorage storage storage_\n ) public returns (uint8 operationType, bytes memory params, uint256 nonce) {\n bytes32 digest;\n (operationType, params, nonce, digest) = abi.decode(\n proof,\n (uint8, bytes, uint256, bytes32)\n );\n\n bytes32 proofHash = keccak256(proof);\n require(!storage_.updateAppliedOnChain[proofHash], \"Proof already claimed\");\n require(nonce == storage_.currentNonce[operationType] + 1, \"Invalid nonce\");\n\n bytes32 message = keccak256(\n abi.encodePacked(contractAddress, operationType, params, nonce)\n );\n bytes32 expectedDigest = keccak256(\n abi.encodePacked(\"\\x19Ethereum Signed Message:\\n32\", message)\n );\n require(digest == expectedDigest, \"Invalid proof\");\n\n storage_.updateAppliedOnChain[proofHash] = true;\n storage_.currentNonce[operationType] = nonce;\n\n emit ProofClaimed(operationType, params, nonce);\n\n return (operationType, params, nonce);\n }\n\n /**\n * @notice Gets the next nonce for an operation type\n * @param storage_ Proof storage struct\n * @param operationType Type of operation\n * @return nonce Next nonce value\n */\n function getNextNonce(\n ProofStorage storage storage_,\n uint8 operationType\n ) public view returns (uint256 nonce) {\n return storage_.currentNonce[operationType] + 1;\n }\n\n /**\n * @notice Increments the nonce for an operation type\n * @param storage_ Proof storage struct\n * @param operationType Type of operation\n * @return nonce New nonce value\n */\n function incrementNonce(\n ProofStorage storage storage_,\n uint8 operationType\n ) public returns (uint256 nonce) {\n storage_.currentNonce[operationType]++;\n return storage_.currentNonce[operationType];\n }\n}\n" + } + }, + "settings": { + "optimizer": { + "enabled": true, + "runs": 200 + }, + "evmVersion": "paris", + "outputSelection": { + "*": { + "*": [ + "abi", + "evm.bytecode", + "evm.deployedBytecode", + "evm.methodIdentifiers", + "metadata", + "devdoc", + "userdoc", + "storageLayout", + "evm.gasEstimates" + ], + "": [ + "ast" + ] + } + }, + "metadata": { + "useLiteralContent": true + } + } +} \ No newline at end of file diff --git a/deployments/sepolia/solcInputs/c27a34cff02617821c386fb97b476bc1.json b/deployments/sepolia/solcInputs/c27a34cff02617821c386fb97b476bc1.json new file mode 100644 index 0000000..f692b04 --- /dev/null +++ b/deployments/sepolia/solcInputs/c27a34cff02617821c386fb97b476bc1.json @@ -0,0 +1,147 @@ +{ + "language": "Solidity", + "sources": { + "@openzeppelin/contracts/access/Ownable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol)\n\npragma solidity ^0.8.20;\n\nimport {Context} from \"../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 * The initial owner is set to the address provided by the deployer. This can\n * 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 /**\n * @dev The caller account is not authorized to perform an operation.\n */\n error OwnableUnauthorizedAccount(address account);\n\n /**\n * @dev The owner is not a valid owner account. (eg. `address(0)`)\n */\n error OwnableInvalidOwner(address owner);\n\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n /**\n * @dev Initializes the contract setting the address provided by the deployer as the initial owner.\n */\n constructor(address initialOwner) {\n if (initialOwner == address(0)) {\n revert OwnableInvalidOwner(address(0));\n }\n _transferOwnership(initialOwner);\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 if (owner() != _msgSender()) {\n revert OwnableUnauthorizedAccount(_msgSender());\n }\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 if (newOwner == address(0)) {\n revert OwnableInvalidOwner(address(0));\n }\n _transferOwnership(newOwner);\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Internal function without access restriction.\n */\n function _transferOwnership(address newOwner) internal virtual {\n address oldOwner = _owner;\n _owner = newOwner;\n emit OwnershipTransferred(oldOwner, newOwner);\n }\n}\n" + }, + "@openzeppelin/contracts/governance/utils/IVotes.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (governance/utils/IVotes.sol)\npragma solidity ^0.8.20;\n\n/**\n * @dev Common interface for {ERC20Votes}, {ERC721Votes}, and other {Votes}-enabled contracts.\n */\ninterface IVotes {\n /**\n * @dev The signature used has expired.\n */\n error VotesExpiredSignature(uint256 expiry);\n\n /**\n * @dev Emitted when an account changes their delegate.\n */\n event DelegateChanged(address indexed delegator, address indexed fromDelegate, address indexed toDelegate);\n\n /**\n * @dev Emitted when a token transfer or delegate change results in changes to a delegate's number of voting units.\n */\n event DelegateVotesChanged(address indexed delegate, uint256 previousVotes, uint256 newVotes);\n\n /**\n * @dev Returns the current amount of votes that `account` has.\n */\n function getVotes(address account) external view returns (uint256);\n\n /**\n * @dev Returns the amount of votes that `account` had at a specific moment in the past. If the `clock()` is\n * configured to use block numbers, this will return the value at the end of the corresponding block.\n */\n function getPastVotes(address account, uint256 timepoint) external view returns (uint256);\n\n /**\n * @dev Returns the total supply of votes available at a specific moment in the past. If the `clock()` is\n * configured to use block numbers, this will return the value at the end of the corresponding block.\n *\n * NOTE: This value is the sum of all available votes, which is not necessarily the sum of all delegated votes.\n * Votes that have not been delegated are still part of total supply, even though they would not participate in a\n * vote.\n */\n function getPastTotalSupply(uint256 timepoint) external view returns (uint256);\n\n /**\n * @dev Returns the delegate that `account` has chosen.\n */\n function delegates(address account) external view returns (address);\n\n /**\n * @dev Delegates votes from the sender to `delegatee`.\n */\n function delegate(address delegatee) external;\n\n /**\n * @dev Delegates votes from signer to `delegatee`.\n */\n function delegateBySig(address delegatee, uint256 nonce, uint256 expiry, uint8 v, bytes32 r, bytes32 s) external;\n}\n" + }, + "@openzeppelin/contracts/governance/utils/Votes.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (governance/utils/Votes.sol)\npragma solidity ^0.8.20;\n\nimport {IERC5805} from \"../../interfaces/IERC5805.sol\";\nimport {Context} from \"../../utils/Context.sol\";\nimport {Nonces} from \"../../utils/Nonces.sol\";\nimport {EIP712} from \"../../utils/cryptography/EIP712.sol\";\nimport {Checkpoints} from \"../../utils/structs/Checkpoints.sol\";\nimport {SafeCast} from \"../../utils/math/SafeCast.sol\";\nimport {ECDSA} from \"../../utils/cryptography/ECDSA.sol\";\nimport {Time} from \"../../utils/types/Time.sol\";\n\n/**\n * @dev This is a base abstract contract that tracks voting units, which are a measure of voting power that can be\n * transferred, and provides a system of vote delegation, where an account can delegate its voting units to a sort of\n * \"representative\" that will pool delegated voting units from different accounts and can then use it to vote in\n * decisions. In fact, voting units _must_ be delegated in order to count as actual votes, and an account has to\n * delegate those votes to itself if it wishes to participate in decisions and does not have a trusted representative.\n *\n * This contract is often combined with a token contract such that voting units correspond to token units. For an\n * example, see {ERC721Votes}.\n *\n * The full history of delegate votes is tracked on-chain so that governance protocols can consider votes as distributed\n * at a particular block number to protect against flash loans and double voting. The opt-in delegate system makes the\n * cost of this history tracking optional.\n *\n * When using this module the derived contract must implement {_getVotingUnits} (for example, make it return\n * {ERC721-balanceOf}), and can use {_transferVotingUnits} to track a change in the distribution of those units (in the\n * previous example, it would be included in {ERC721-_update}).\n */\nabstract contract Votes is Context, EIP712, Nonces, IERC5805 {\n using Checkpoints for Checkpoints.Trace208;\n\n bytes32 private constant DELEGATION_TYPEHASH =\n keccak256(\"Delegation(address delegatee,uint256 nonce,uint256 expiry)\");\n\n mapping(address account => address) private _delegatee;\n\n mapping(address delegatee => Checkpoints.Trace208) private _delegateCheckpoints;\n\n Checkpoints.Trace208 private _totalCheckpoints;\n\n /**\n * @dev The clock was incorrectly modified.\n */\n error ERC6372InconsistentClock();\n\n /**\n * @dev Lookup to future votes is not available.\n */\n error ERC5805FutureLookup(uint256 timepoint, uint48 clock);\n\n /**\n * @dev Clock used for flagging checkpoints. Can be overridden to implement timestamp based\n * checkpoints (and voting), in which case {CLOCK_MODE} should be overridden as well to match.\n */\n function clock() public view virtual returns (uint48) {\n return Time.blockNumber();\n }\n\n /**\n * @dev Machine-readable description of the clock as specified in ERC-6372.\n */\n // solhint-disable-next-line func-name-mixedcase\n function CLOCK_MODE() public view virtual returns (string memory) {\n // Check that the clock was not modified\n if (clock() != Time.blockNumber()) {\n revert ERC6372InconsistentClock();\n }\n return \"mode=blocknumber&from=default\";\n }\n\n /**\n * @dev Returns the current amount of votes that `account` has.\n */\n function getVotes(address account) public view virtual returns (uint256) {\n return _delegateCheckpoints[account].latest();\n }\n\n /**\n * @dev Returns the amount of votes that `account` had at a specific moment in the past. If the `clock()` is\n * configured to use block numbers, this will return the value at the end of the corresponding block.\n *\n * Requirements:\n *\n * - `timepoint` must be in the past. If operating using block numbers, the block must be already mined.\n */\n function getPastVotes(address account, uint256 timepoint) public view virtual returns (uint256) {\n uint48 currentTimepoint = clock();\n if (timepoint >= currentTimepoint) {\n revert ERC5805FutureLookup(timepoint, currentTimepoint);\n }\n return _delegateCheckpoints[account].upperLookupRecent(SafeCast.toUint48(timepoint));\n }\n\n /**\n * @dev Returns the total supply of votes available at a specific moment in the past. If the `clock()` is\n * configured to use block numbers, this will return the value at the end of the corresponding block.\n *\n * NOTE: This value is the sum of all available votes, which is not necessarily the sum of all delegated votes.\n * Votes that have not been delegated are still part of total supply, even though they would not participate in a\n * vote.\n *\n * Requirements:\n *\n * - `timepoint` must be in the past. If operating using block numbers, the block must be already mined.\n */\n function getPastTotalSupply(uint256 timepoint) public view virtual returns (uint256) {\n uint48 currentTimepoint = clock();\n if (timepoint >= currentTimepoint) {\n revert ERC5805FutureLookup(timepoint, currentTimepoint);\n }\n return _totalCheckpoints.upperLookupRecent(SafeCast.toUint48(timepoint));\n }\n\n /**\n * @dev Returns the current total supply of votes.\n */\n function _getTotalSupply() internal view virtual returns (uint256) {\n return _totalCheckpoints.latest();\n }\n\n /**\n * @dev Returns the delegate that `account` has chosen.\n */\n function delegates(address account) public view virtual returns (address) {\n return _delegatee[account];\n }\n\n /**\n * @dev Delegates votes from the sender to `delegatee`.\n */\n function delegate(address delegatee) public virtual {\n address account = _msgSender();\n _delegate(account, delegatee);\n }\n\n /**\n * @dev Delegates votes from signer to `delegatee`.\n */\n function delegateBySig(\n address delegatee,\n uint256 nonce,\n uint256 expiry,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) public virtual {\n if (block.timestamp > expiry) {\n revert VotesExpiredSignature(expiry);\n }\n address signer = ECDSA.recover(\n _hashTypedDataV4(keccak256(abi.encode(DELEGATION_TYPEHASH, delegatee, nonce, expiry))),\n v,\n r,\n s\n );\n _useCheckedNonce(signer, nonce);\n _delegate(signer, delegatee);\n }\n\n /**\n * @dev Delegate all of `account`'s voting units to `delegatee`.\n *\n * Emits events {IVotes-DelegateChanged} and {IVotes-DelegateVotesChanged}.\n */\n function _delegate(address account, address delegatee) internal virtual {\n address oldDelegate = delegates(account);\n _delegatee[account] = delegatee;\n\n emit DelegateChanged(account, oldDelegate, delegatee);\n _moveDelegateVotes(oldDelegate, delegatee, _getVotingUnits(account));\n }\n\n /**\n * @dev Transfers, mints, or burns voting units. To register a mint, `from` should be zero. To register a burn, `to`\n * should be zero. Total supply of voting units will be adjusted with mints and burns.\n */\n function _transferVotingUnits(address from, address to, uint256 amount) internal virtual {\n if (from == address(0)) {\n _push(_totalCheckpoints, _add, SafeCast.toUint208(amount));\n }\n if (to == address(0)) {\n _push(_totalCheckpoints, _subtract, SafeCast.toUint208(amount));\n }\n _moveDelegateVotes(delegates(from), delegates(to), amount);\n }\n\n /**\n * @dev Moves delegated votes from one delegate to another.\n */\n function _moveDelegateVotes(address from, address to, uint256 amount) internal virtual {\n if (from != to && amount > 0) {\n if (from != address(0)) {\n (uint256 oldValue, uint256 newValue) = _push(\n _delegateCheckpoints[from],\n _subtract,\n SafeCast.toUint208(amount)\n );\n emit DelegateVotesChanged(from, oldValue, newValue);\n }\n if (to != address(0)) {\n (uint256 oldValue, uint256 newValue) = _push(\n _delegateCheckpoints[to],\n _add,\n SafeCast.toUint208(amount)\n );\n emit DelegateVotesChanged(to, oldValue, newValue);\n }\n }\n }\n\n /**\n * @dev Get number of checkpoints for `account`.\n */\n function _numCheckpoints(address account) internal view virtual returns (uint32) {\n return SafeCast.toUint32(_delegateCheckpoints[account].length());\n }\n\n /**\n * @dev Get the `pos`-th checkpoint for `account`.\n */\n function _checkpoints(\n address account,\n uint32 pos\n ) internal view virtual returns (Checkpoints.Checkpoint208 memory) {\n return _delegateCheckpoints[account].at(pos);\n }\n\n function _push(\n Checkpoints.Trace208 storage store,\n function(uint208, uint208) view returns (uint208) op,\n uint208 delta\n ) private returns (uint208 oldValue, uint208 newValue) {\n return store.push(clock(), op(store.latest(), delta));\n }\n\n function _add(uint208 a, uint208 b) private pure returns (uint208) {\n return a + b;\n }\n\n function _subtract(uint208 a, uint208 b) private pure returns (uint208) {\n return a - b;\n }\n\n /**\n * @dev Must return the voting units held by an account.\n */\n function _getVotingUnits(address) internal view virtual returns (uint256);\n}\n" + }, + "@openzeppelin/contracts/interfaces/draft-IERC6093.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (interfaces/draft-IERC6093.sol)\npragma solidity ^0.8.20;\n\n/**\n * @dev Standard ERC-20 Errors\n * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC-20 tokens.\n */\ninterface IERC20Errors {\n /**\n * @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers.\n * @param sender Address whose tokens are being transferred.\n * @param balance Current balance for the interacting account.\n * @param needed Minimum amount required to perform a transfer.\n */\n error ERC20InsufficientBalance(address sender, uint256 balance, uint256 needed);\n\n /**\n * @dev Indicates a failure with the token `sender`. Used in transfers.\n * @param sender Address whose tokens are being transferred.\n */\n error ERC20InvalidSender(address sender);\n\n /**\n * @dev Indicates a failure with the token `receiver`. Used in transfers.\n * @param receiver Address to which tokens are being transferred.\n */\n error ERC20InvalidReceiver(address receiver);\n\n /**\n * @dev Indicates a failure with the `spender`’s `allowance`. Used in transfers.\n * @param spender Address that may be allowed to operate on tokens without being their owner.\n * @param allowance Amount of tokens a `spender` is allowed to operate with.\n * @param needed Minimum amount required to perform a transfer.\n */\n error ERC20InsufficientAllowance(address spender, uint256 allowance, uint256 needed);\n\n /**\n * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.\n * @param approver Address initiating an approval operation.\n */\n error ERC20InvalidApprover(address approver);\n\n /**\n * @dev Indicates a failure with the `spender` to be approved. Used in approvals.\n * @param spender Address that may be allowed to operate on tokens without being their owner.\n */\n error ERC20InvalidSpender(address spender);\n}\n\n/**\n * @dev Standard ERC-721 Errors\n * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC-721 tokens.\n */\ninterface IERC721Errors {\n /**\n * @dev Indicates that an address can't be an owner. For example, `address(0)` is a forbidden owner in ERC-20.\n * Used in balance queries.\n * @param owner Address of the current owner of a token.\n */\n error ERC721InvalidOwner(address owner);\n\n /**\n * @dev Indicates a `tokenId` whose `owner` is the zero address.\n * @param tokenId Identifier number of a token.\n */\n error ERC721NonexistentToken(uint256 tokenId);\n\n /**\n * @dev Indicates an error related to the ownership over a particular token. Used in transfers.\n * @param sender Address whose tokens are being transferred.\n * @param tokenId Identifier number of a token.\n * @param owner Address of the current owner of a token.\n */\n error ERC721IncorrectOwner(address sender, uint256 tokenId, address owner);\n\n /**\n * @dev Indicates a failure with the token `sender`. Used in transfers.\n * @param sender Address whose tokens are being transferred.\n */\n error ERC721InvalidSender(address sender);\n\n /**\n * @dev Indicates a failure with the token `receiver`. Used in transfers.\n * @param receiver Address to which tokens are being transferred.\n */\n error ERC721InvalidReceiver(address receiver);\n\n /**\n * @dev Indicates a failure with the `operator`’s approval. Used in transfers.\n * @param operator Address that may be allowed to operate on tokens without being their owner.\n * @param tokenId Identifier number of a token.\n */\n error ERC721InsufficientApproval(address operator, uint256 tokenId);\n\n /**\n * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.\n * @param approver Address initiating an approval operation.\n */\n error ERC721InvalidApprover(address approver);\n\n /**\n * @dev Indicates a failure with the `operator` to be approved. Used in approvals.\n * @param operator Address that may be allowed to operate on tokens without being their owner.\n */\n error ERC721InvalidOperator(address operator);\n}\n\n/**\n * @dev Standard ERC-1155 Errors\n * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC-1155 tokens.\n */\ninterface IERC1155Errors {\n /**\n * @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers.\n * @param sender Address whose tokens are being transferred.\n * @param balance Current balance for the interacting account.\n * @param needed Minimum amount required to perform a transfer.\n * @param tokenId Identifier number of a token.\n */\n error ERC1155InsufficientBalance(address sender, uint256 balance, uint256 needed, uint256 tokenId);\n\n /**\n * @dev Indicates a failure with the token `sender`. Used in transfers.\n * @param sender Address whose tokens are being transferred.\n */\n error ERC1155InvalidSender(address sender);\n\n /**\n * @dev Indicates a failure with the token `receiver`. Used in transfers.\n * @param receiver Address to which tokens are being transferred.\n */\n error ERC1155InvalidReceiver(address receiver);\n\n /**\n * @dev Indicates a failure with the `operator`’s approval. Used in transfers.\n * @param operator Address that may be allowed to operate on tokens without being their owner.\n * @param owner Address of the current owner of a token.\n */\n error ERC1155MissingApprovalForAll(address operator, address owner);\n\n /**\n * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.\n * @param approver Address initiating an approval operation.\n */\n error ERC1155InvalidApprover(address approver);\n\n /**\n * @dev Indicates a failure with the `operator` to be approved. Used in approvals.\n * @param operator Address that may be allowed to operate on tokens without being their owner.\n */\n error ERC1155InvalidOperator(address operator);\n\n /**\n * @dev Indicates an array length mismatch between ids and values in a safeBatchTransferFrom operation.\n * Used in batch transfers.\n * @param idsLength Length of the array of token identifiers\n * @param valuesLength Length of the array of token amounts\n */\n error ERC1155InvalidArrayLength(uint256 idsLength, uint256 valuesLength);\n}\n" + }, + "@openzeppelin/contracts/interfaces/IERC165.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC165.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC165} from \"../utils/introspection/IERC165.sol\";\n" + }, + "@openzeppelin/contracts/interfaces/IERC4906.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (interfaces/IERC4906.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC165} from \"./IERC165.sol\";\nimport {IERC721} from \"./IERC721.sol\";\n\n/// @title ERC-721 Metadata Update Extension\ninterface IERC4906 is IERC165, IERC721 {\n /// @dev This event emits when the metadata of a token is changed.\n /// So that the third-party platforms such as NFT market could\n /// timely update the images and related attributes of the NFT.\n event MetadataUpdate(uint256 _tokenId);\n\n /// @dev This event emits when the metadata of a range of tokens is changed.\n /// So that the third-party platforms such as NFT market could\n /// timely update the images and related attributes of the NFTs.\n event BatchMetadataUpdate(uint256 _fromTokenId, uint256 _toTokenId);\n}\n" + }, + "@openzeppelin/contracts/interfaces/IERC5267.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC5267.sol)\n\npragma solidity ^0.8.20;\n\ninterface IERC5267 {\n /**\n * @dev MAY be emitted to signal that the domain could have changed.\n */\n event EIP712DomainChanged();\n\n /**\n * @dev returns the fields and values that describe the domain separator used by this contract for EIP-712\n * signature.\n */\n function eip712Domain()\n external\n view\n returns (\n bytes1 fields,\n string memory name,\n string memory version,\n uint256 chainId,\n address verifyingContract,\n bytes32 salt,\n uint256[] memory extensions\n );\n}\n" + }, + "@openzeppelin/contracts/interfaces/IERC5805.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC5805.sol)\n\npragma solidity ^0.8.20;\n\nimport {IVotes} from \"../governance/utils/IVotes.sol\";\nimport {IERC6372} from \"./IERC6372.sol\";\n\ninterface IERC5805 is IERC6372, IVotes {}\n" + }, + "@openzeppelin/contracts/interfaces/IERC6372.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC6372.sol)\n\npragma solidity ^0.8.20;\n\ninterface IERC6372 {\n /**\n * @dev Clock used for flagging checkpoints. Can be overridden to implement timestamp based checkpoints (and voting).\n */\n function clock() external view returns (uint48);\n\n /**\n * @dev Description of the clock\n */\n // solhint-disable-next-line func-name-mixedcase\n function CLOCK_MODE() external view returns (string memory);\n}\n" + }, + "@openzeppelin/contracts/interfaces/IERC721.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC721.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC721} from \"../token/ERC721/IERC721.sol\";\n" + }, + "@openzeppelin/contracts/token/ERC721/ERC721.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC721/ERC721.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC721} from \"./IERC721.sol\";\nimport {IERC721Metadata} from \"./extensions/IERC721Metadata.sol\";\nimport {ERC721Utils} from \"./utils/ERC721Utils.sol\";\nimport {Context} from \"../../utils/Context.sol\";\nimport {Strings} from \"../../utils/Strings.sol\";\nimport {IERC165, ERC165} from \"../../utils/introspection/ERC165.sol\";\nimport {IERC721Errors} from \"../../interfaces/draft-IERC6093.sol\";\n\n/**\n * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC-721] Non-Fungible Token Standard, including\n * the Metadata extension, but not including the Enumerable extension, which is available separately as\n * {ERC721Enumerable}.\n */\nabstract contract ERC721 is Context, ERC165, IERC721, IERC721Metadata, IERC721Errors {\n using Strings for uint256;\n\n // Token name\n string private _name;\n\n // Token symbol\n string private _symbol;\n\n mapping(uint256 tokenId => address) private _owners;\n\n mapping(address owner => uint256) private _balances;\n\n mapping(uint256 tokenId => address) private _tokenApprovals;\n\n mapping(address owner => mapping(address operator => bool)) private _operatorApprovals;\n\n /**\n * @dev Initializes the contract by setting a `name` and a `symbol` to the token collection.\n */\n constructor(string memory name_, string memory symbol_) {\n _name = name_;\n _symbol = symbol_;\n }\n\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {\n return\n interfaceId == type(IERC721).interfaceId ||\n interfaceId == type(IERC721Metadata).interfaceId ||\n super.supportsInterface(interfaceId);\n }\n\n /**\n * @dev See {IERC721-balanceOf}.\n */\n function balanceOf(address owner) public view virtual returns (uint256) {\n if (owner == address(0)) {\n revert ERC721InvalidOwner(address(0));\n }\n return _balances[owner];\n }\n\n /**\n * @dev See {IERC721-ownerOf}.\n */\n function ownerOf(uint256 tokenId) public view virtual returns (address) {\n return _requireOwned(tokenId);\n }\n\n /**\n * @dev See {IERC721Metadata-name}.\n */\n function name() public view virtual returns (string memory) {\n return _name;\n }\n\n /**\n * @dev See {IERC721Metadata-symbol}.\n */\n function symbol() public view virtual returns (string memory) {\n return _symbol;\n }\n\n /**\n * @dev See {IERC721Metadata-tokenURI}.\n */\n function tokenURI(uint256 tokenId) public view virtual returns (string memory) {\n _requireOwned(tokenId);\n\n string memory baseURI = _baseURI();\n return bytes(baseURI).length > 0 ? string.concat(baseURI, tokenId.toString()) : \"\";\n }\n\n /**\n * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each\n * token will be the concatenation of the `baseURI` and the `tokenId`. Empty\n * by default, can be overridden in child contracts.\n */\n function _baseURI() internal view virtual returns (string memory) {\n return \"\";\n }\n\n /**\n * @dev See {IERC721-approve}.\n */\n function approve(address to, uint256 tokenId) public virtual {\n _approve(to, tokenId, _msgSender());\n }\n\n /**\n * @dev See {IERC721-getApproved}.\n */\n function getApproved(uint256 tokenId) public view virtual returns (address) {\n _requireOwned(tokenId);\n\n return _getApproved(tokenId);\n }\n\n /**\n * @dev See {IERC721-setApprovalForAll}.\n */\n function setApprovalForAll(address operator, bool approved) public virtual {\n _setApprovalForAll(_msgSender(), operator, approved);\n }\n\n /**\n * @dev See {IERC721-isApprovedForAll}.\n */\n function isApprovedForAll(address owner, address operator) public view virtual returns (bool) {\n return _operatorApprovals[owner][operator];\n }\n\n /**\n * @dev See {IERC721-transferFrom}.\n */\n function transferFrom(address from, address to, uint256 tokenId) public virtual {\n if (to == address(0)) {\n revert ERC721InvalidReceiver(address(0));\n }\n // Setting an \"auth\" arguments enables the `_isAuthorized` check which verifies that the token exists\n // (from != 0). Therefore, it is not needed to verify that the return value is not 0 here.\n address previousOwner = _update(to, tokenId, _msgSender());\n if (previousOwner != from) {\n revert ERC721IncorrectOwner(from, tokenId, previousOwner);\n }\n }\n\n /**\n * @dev See {IERC721-safeTransferFrom}.\n */\n function safeTransferFrom(address from, address to, uint256 tokenId) public {\n safeTransferFrom(from, to, tokenId, \"\");\n }\n\n /**\n * @dev See {IERC721-safeTransferFrom}.\n */\n function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory data) public virtual {\n transferFrom(from, to, tokenId);\n ERC721Utils.checkOnERC721Received(_msgSender(), from, to, tokenId, data);\n }\n\n /**\n * @dev Returns the owner of the `tokenId`. Does NOT revert if token doesn't exist\n *\n * IMPORTANT: Any overrides to this function that add ownership of tokens not tracked by the\n * core ERC-721 logic MUST be matched with the use of {_increaseBalance} to keep balances\n * consistent with ownership. The invariant to preserve is that for any address `a` the value returned by\n * `balanceOf(a)` must be equal to the number of tokens such that `_ownerOf(tokenId)` is `a`.\n */\n function _ownerOf(uint256 tokenId) internal view virtual returns (address) {\n return _owners[tokenId];\n }\n\n /**\n * @dev Returns the approved address for `tokenId`. Returns 0 if `tokenId` is not minted.\n */\n function _getApproved(uint256 tokenId) internal view virtual returns (address) {\n return _tokenApprovals[tokenId];\n }\n\n /**\n * @dev Returns whether `spender` is allowed to manage `owner`'s tokens, or `tokenId` in\n * particular (ignoring whether it is owned by `owner`).\n *\n * WARNING: This function assumes that `owner` is the actual owner of `tokenId` and does not verify this\n * assumption.\n */\n function _isAuthorized(address owner, address spender, uint256 tokenId) internal view virtual returns (bool) {\n return\n spender != address(0) &&\n (owner == spender || isApprovedForAll(owner, spender) || _getApproved(tokenId) == spender);\n }\n\n /**\n * @dev Checks if `spender` can operate on `tokenId`, assuming the provided `owner` is the actual owner.\n * Reverts if:\n * - `spender` does not have approval from `owner` for `tokenId`.\n * - `spender` does not have approval to manage all of `owner`'s assets.\n *\n * WARNING: This function assumes that `owner` is the actual owner of `tokenId` and does not verify this\n * assumption.\n */\n function _checkAuthorized(address owner, address spender, uint256 tokenId) internal view virtual {\n if (!_isAuthorized(owner, spender, tokenId)) {\n if (owner == address(0)) {\n revert ERC721NonexistentToken(tokenId);\n } else {\n revert ERC721InsufficientApproval(spender, tokenId);\n }\n }\n }\n\n /**\n * @dev Unsafe write access to the balances, used by extensions that \"mint\" tokens using an {ownerOf} override.\n *\n * NOTE: the value is limited to type(uint128).max. This protect against _balance overflow. It is unrealistic that\n * a uint256 would ever overflow from increments when these increments are bounded to uint128 values.\n *\n * WARNING: Increasing an account's balance using this function tends to be paired with an override of the\n * {_ownerOf} function to resolve the ownership of the corresponding tokens so that balances and ownership\n * remain consistent with one another.\n */\n function _increaseBalance(address account, uint128 value) internal virtual {\n unchecked {\n _balances[account] += value;\n }\n }\n\n /**\n * @dev Transfers `tokenId` from its current owner to `to`, or alternatively mints (or burns) if the current owner\n * (or `to`) is the zero address. Returns the owner of the `tokenId` before the update.\n *\n * The `auth` argument is optional. If the value passed is non 0, then this function will check that\n * `auth` is either the owner of the token, or approved to operate on the token (by the owner).\n *\n * Emits a {Transfer} event.\n *\n * NOTE: If overriding this function in a way that tracks balances, see also {_increaseBalance}.\n */\n function _update(address to, uint256 tokenId, address auth) internal virtual returns (address) {\n address from = _ownerOf(tokenId);\n\n // Perform (optional) operator check\n if (auth != address(0)) {\n _checkAuthorized(from, auth, tokenId);\n }\n\n // Execute the update\n if (from != address(0)) {\n // Clear approval. No need to re-authorize or emit the Approval event\n _approve(address(0), tokenId, address(0), false);\n\n unchecked {\n _balances[from] -= 1;\n }\n }\n\n if (to != address(0)) {\n unchecked {\n _balances[to] += 1;\n }\n }\n\n _owners[tokenId] = to;\n\n emit Transfer(from, to, tokenId);\n\n return from;\n }\n\n /**\n * @dev Mints `tokenId` and transfers it to `to`.\n *\n * WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible\n *\n * Requirements:\n *\n * - `tokenId` must not exist.\n * - `to` cannot be the zero address.\n *\n * Emits a {Transfer} event.\n */\n function _mint(address to, uint256 tokenId) internal {\n if (to == address(0)) {\n revert ERC721InvalidReceiver(address(0));\n }\n address previousOwner = _update(to, tokenId, address(0));\n if (previousOwner != address(0)) {\n revert ERC721InvalidSender(address(0));\n }\n }\n\n /**\n * @dev Mints `tokenId`, transfers it to `to` and checks for `to` acceptance.\n *\n * Requirements:\n *\n * - `tokenId` must not exist.\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\n *\n * Emits a {Transfer} event.\n */\n function _safeMint(address to, uint256 tokenId) internal {\n _safeMint(to, tokenId, \"\");\n }\n\n /**\n * @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is\n * forwarded in {IERC721Receiver-onERC721Received} to contract recipients.\n */\n function _safeMint(address to, uint256 tokenId, bytes memory data) internal virtual {\n _mint(to, tokenId);\n ERC721Utils.checkOnERC721Received(_msgSender(), address(0), to, tokenId, data);\n }\n\n /**\n * @dev Destroys `tokenId`.\n * The approval is cleared when the token is burned.\n * This is an internal function that does not check if the sender is authorized to operate on the token.\n *\n * Requirements:\n *\n * - `tokenId` must exist.\n *\n * Emits a {Transfer} event.\n */\n function _burn(uint256 tokenId) internal {\n address previousOwner = _update(address(0), tokenId, address(0));\n if (previousOwner == address(0)) {\n revert ERC721NonexistentToken(tokenId);\n }\n }\n\n /**\n * @dev Transfers `tokenId` from `from` to `to`.\n * As opposed to {transferFrom}, this imposes no restrictions on msg.sender.\n *\n * Requirements:\n *\n * - `to` cannot be the zero address.\n * - `tokenId` token must be owned by `from`.\n *\n * Emits a {Transfer} event.\n */\n function _transfer(address from, address to, uint256 tokenId) internal {\n if (to == address(0)) {\n revert ERC721InvalidReceiver(address(0));\n }\n address previousOwner = _update(to, tokenId, address(0));\n if (previousOwner == address(0)) {\n revert ERC721NonexistentToken(tokenId);\n } else if (previousOwner != from) {\n revert ERC721IncorrectOwner(from, tokenId, previousOwner);\n }\n }\n\n /**\n * @dev Safely transfers `tokenId` token from `from` to `to`, checking that contract recipients\n * are aware of the ERC-721 standard to prevent tokens from being forever locked.\n *\n * `data` is additional data, it has no specified format and it is sent in call to `to`.\n *\n * This internal function is like {safeTransferFrom} in the sense that it invokes\n * {IERC721Receiver-onERC721Received} on the receiver, and can be used to e.g.\n * implement alternative mechanisms to perform token transfer, such as signature-based.\n *\n * Requirements:\n *\n * - `tokenId` token must exist and be owned by `from`.\n * - `to` cannot be the zero address.\n * - `from` cannot be the zero address.\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\n *\n * Emits a {Transfer} event.\n */\n function _safeTransfer(address from, address to, uint256 tokenId) internal {\n _safeTransfer(from, to, tokenId, \"\");\n }\n\n /**\n * @dev Same as {xref-ERC721-_safeTransfer-address-address-uint256-}[`_safeTransfer`], with an additional `data` parameter which is\n * forwarded in {IERC721Receiver-onERC721Received} to contract recipients.\n */\n function _safeTransfer(address from, address to, uint256 tokenId, bytes memory data) internal virtual {\n _transfer(from, to, tokenId);\n ERC721Utils.checkOnERC721Received(_msgSender(), from, to, tokenId, data);\n }\n\n /**\n * @dev Approve `to` to operate on `tokenId`\n *\n * The `auth` argument is optional. If the value passed is non 0, then this function will check that `auth` is\n * either the owner of the token, or approved to operate on all tokens held by this owner.\n *\n * Emits an {Approval} event.\n *\n * Overrides to this logic should be done to the variant with an additional `bool emitEvent` argument.\n */\n function _approve(address to, uint256 tokenId, address auth) internal {\n _approve(to, tokenId, auth, true);\n }\n\n /**\n * @dev Variant of `_approve` with an optional flag to enable or disable the {Approval} event. The event is not\n * emitted in the context of transfers.\n */\n function _approve(address to, uint256 tokenId, address auth, bool emitEvent) internal virtual {\n // Avoid reading the owner unless necessary\n if (emitEvent || auth != address(0)) {\n address owner = _requireOwned(tokenId);\n\n // We do not use _isAuthorized because single-token approvals should not be able to call approve\n if (auth != address(0) && owner != auth && !isApprovedForAll(owner, auth)) {\n revert ERC721InvalidApprover(auth);\n }\n\n if (emitEvent) {\n emit Approval(owner, to, tokenId);\n }\n }\n\n _tokenApprovals[tokenId] = to;\n }\n\n /**\n * @dev Approve `operator` to operate on all of `owner` tokens\n *\n * Requirements:\n * - operator can't be the address zero.\n *\n * Emits an {ApprovalForAll} event.\n */\n function _setApprovalForAll(address owner, address operator, bool approved) internal virtual {\n if (operator == address(0)) {\n revert ERC721InvalidOperator(operator);\n }\n _operatorApprovals[owner][operator] = approved;\n emit ApprovalForAll(owner, operator, approved);\n }\n\n /**\n * @dev Reverts if the `tokenId` doesn't have a current owner (it hasn't been minted, or it has been burned).\n * Returns the owner.\n *\n * Overrides to ownership logic should be done to {_ownerOf}.\n */\n function _requireOwned(uint256 tokenId) internal view returns (address) {\n address owner = _ownerOf(tokenId);\n if (owner == address(0)) {\n revert ERC721NonexistentToken(tokenId);\n }\n return owner;\n }\n}\n" + }, + "@openzeppelin/contracts/token/ERC721/extensions/ERC721Burnable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC721/extensions/ERC721Burnable.sol)\n\npragma solidity ^0.8.20;\n\nimport {ERC721} from \"../ERC721.sol\";\nimport {Context} from \"../../../utils/Context.sol\";\n\n/**\n * @title ERC-721 Burnable Token\n * @dev ERC-721 Token that can be burned (destroyed).\n */\nabstract contract ERC721Burnable is Context, ERC721 {\n /**\n * @dev Burns `tokenId`. See {ERC721-_burn}.\n *\n * Requirements:\n *\n * - The caller must own `tokenId` or be an approved operator.\n */\n function burn(uint256 tokenId) public virtual {\n // Setting an \"auth\" arguments enables the `_isAuthorized` check which verifies that the token exists\n // (from != 0). Therefore, it is not needed to verify that the return value is not 0 here.\n _update(address(0), tokenId, _msgSender());\n }\n}\n" + }, + "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC721/extensions/ERC721Enumerable.sol)\n\npragma solidity ^0.8.20;\n\nimport {ERC721} from \"../ERC721.sol\";\nimport {IERC721Enumerable} from \"./IERC721Enumerable.sol\";\nimport {IERC165} from \"../../../utils/introspection/ERC165.sol\";\n\n/**\n * @dev This implements an optional extension of {ERC721} defined in the ERC that adds enumerability\n * of all the token ids in the contract as well as all token ids owned by each account.\n *\n * CAUTION: {ERC721} extensions that implement custom `balanceOf` logic, such as {ERC721Consecutive},\n * interfere with enumerability and should not be used together with {ERC721Enumerable}.\n */\nabstract contract ERC721Enumerable is ERC721, IERC721Enumerable {\n mapping(address owner => mapping(uint256 index => uint256)) private _ownedTokens;\n mapping(uint256 tokenId => uint256) private _ownedTokensIndex;\n\n uint256[] private _allTokens;\n mapping(uint256 tokenId => uint256) private _allTokensIndex;\n\n /**\n * @dev An `owner`'s token query was out of bounds for `index`.\n *\n * NOTE: The owner being `address(0)` indicates a global out of bounds index.\n */\n error ERC721OutOfBoundsIndex(address owner, uint256 index);\n\n /**\n * @dev Batch mint is not allowed.\n */\n error ERC721EnumerableForbiddenBatchMint();\n\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165, ERC721) returns (bool) {\n return interfaceId == type(IERC721Enumerable).interfaceId || super.supportsInterface(interfaceId);\n }\n\n /**\n * @dev See {IERC721Enumerable-tokenOfOwnerByIndex}.\n */\n function tokenOfOwnerByIndex(address owner, uint256 index) public view virtual returns (uint256) {\n if (index >= balanceOf(owner)) {\n revert ERC721OutOfBoundsIndex(owner, index);\n }\n return _ownedTokens[owner][index];\n }\n\n /**\n * @dev See {IERC721Enumerable-totalSupply}.\n */\n function totalSupply() public view virtual returns (uint256) {\n return _allTokens.length;\n }\n\n /**\n * @dev See {IERC721Enumerable-tokenByIndex}.\n */\n function tokenByIndex(uint256 index) public view virtual returns (uint256) {\n if (index >= totalSupply()) {\n revert ERC721OutOfBoundsIndex(address(0), index);\n }\n return _allTokens[index];\n }\n\n /**\n * @dev See {ERC721-_update}.\n */\n function _update(address to, uint256 tokenId, address auth) internal virtual override returns (address) {\n address previousOwner = super._update(to, tokenId, auth);\n\n if (previousOwner == address(0)) {\n _addTokenToAllTokensEnumeration(tokenId);\n } else if (previousOwner != to) {\n _removeTokenFromOwnerEnumeration(previousOwner, tokenId);\n }\n if (to == address(0)) {\n _removeTokenFromAllTokensEnumeration(tokenId);\n } else if (previousOwner != to) {\n _addTokenToOwnerEnumeration(to, tokenId);\n }\n\n return previousOwner;\n }\n\n /**\n * @dev Private function to add a token to this extension's ownership-tracking data structures.\n * @param to address representing the new owner of the given token ID\n * @param tokenId uint256 ID of the token to be added to the tokens list of the given address\n */\n function _addTokenToOwnerEnumeration(address to, uint256 tokenId) private {\n uint256 length = balanceOf(to) - 1;\n _ownedTokens[to][length] = tokenId;\n _ownedTokensIndex[tokenId] = length;\n }\n\n /**\n * @dev Private function to add a token to this extension's token tracking data structures.\n * @param tokenId uint256 ID of the token to be added to the tokens list\n */\n function _addTokenToAllTokensEnumeration(uint256 tokenId) private {\n _allTokensIndex[tokenId] = _allTokens.length;\n _allTokens.push(tokenId);\n }\n\n /**\n * @dev Private function to remove a token from this extension's ownership-tracking data structures. Note that\n * while the token is not assigned a new owner, the `_ownedTokensIndex` mapping is _not_ updated: this allows for\n * gas optimizations e.g. when performing a transfer operation (avoiding double writes).\n * This has O(1) time complexity, but alters the order of the _ownedTokens array.\n * @param from address representing the previous owner of the given token ID\n * @param tokenId uint256 ID of the token to be removed from the tokens list of the given address\n */\n function _removeTokenFromOwnerEnumeration(address from, uint256 tokenId) private {\n // To prevent a gap in from's tokens array, we store the last token in the index of the token to delete, and\n // then delete the last slot (swap and pop).\n\n uint256 lastTokenIndex = balanceOf(from);\n uint256 tokenIndex = _ownedTokensIndex[tokenId];\n\n mapping(uint256 index => uint256) storage _ownedTokensByOwner = _ownedTokens[from];\n\n // When the token to delete is the last token, the swap operation is unnecessary\n if (tokenIndex != lastTokenIndex) {\n uint256 lastTokenId = _ownedTokensByOwner[lastTokenIndex];\n\n _ownedTokensByOwner[tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token\n _ownedTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index\n }\n\n // This also deletes the contents at the last position of the array\n delete _ownedTokensIndex[tokenId];\n delete _ownedTokensByOwner[lastTokenIndex];\n }\n\n /**\n * @dev Private function to remove a token from this extension's token tracking data structures.\n * This has O(1) time complexity, but alters the order of the _allTokens array.\n * @param tokenId uint256 ID of the token to be removed from the tokens list\n */\n function _removeTokenFromAllTokensEnumeration(uint256 tokenId) private {\n // To prevent a gap in the tokens array, we store the last token in the index of the token to delete, and\n // then delete the last slot (swap and pop).\n\n uint256 lastTokenIndex = _allTokens.length - 1;\n uint256 tokenIndex = _allTokensIndex[tokenId];\n\n // When the token to delete is the last token, the swap operation is unnecessary. However, since this occurs so\n // rarely (when the last minted token is burnt) that we still do the swap here to avoid the gas cost of adding\n // an 'if' statement (like in _removeTokenFromOwnerEnumeration)\n uint256 lastTokenId = _allTokens[lastTokenIndex];\n\n _allTokens[tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token\n _allTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index\n\n // This also deletes the contents at the last position of the array\n delete _allTokensIndex[tokenId];\n _allTokens.pop();\n }\n\n /**\n * See {ERC721-_increaseBalance}. We need that to account tokens that were minted in batch\n */\n function _increaseBalance(address account, uint128 amount) internal virtual override {\n if (amount > 0) {\n revert ERC721EnumerableForbiddenBatchMint();\n }\n super._increaseBalance(account, amount);\n }\n}\n" + }, + "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC721/extensions/ERC721URIStorage.sol)\n\npragma solidity ^0.8.20;\n\nimport {ERC721} from \"../ERC721.sol\";\nimport {Strings} from \"../../../utils/Strings.sol\";\nimport {IERC4906} from \"../../../interfaces/IERC4906.sol\";\nimport {IERC165} from \"../../../interfaces/IERC165.sol\";\n\n/**\n * @dev ERC-721 token with storage based token URI management.\n */\nabstract contract ERC721URIStorage is IERC4906, ERC721 {\n using Strings for uint256;\n\n // Interface ID as defined in ERC-4906. This does not correspond to a traditional interface ID as ERC-4906 only\n // defines events and does not include any external function.\n bytes4 private constant ERC4906_INTERFACE_ID = bytes4(0x49064906);\n\n // Optional mapping for token URIs\n mapping(uint256 tokenId => string) private _tokenURIs;\n\n /**\n * @dev See {IERC165-supportsInterface}\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override(ERC721, IERC165) returns (bool) {\n return interfaceId == ERC4906_INTERFACE_ID || super.supportsInterface(interfaceId);\n }\n\n /**\n * @dev See {IERC721Metadata-tokenURI}.\n */\n function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {\n _requireOwned(tokenId);\n\n string memory _tokenURI = _tokenURIs[tokenId];\n string memory base = _baseURI();\n\n // If there is no base URI, return the token URI.\n if (bytes(base).length == 0) {\n return _tokenURI;\n }\n // If both are set, concatenate the baseURI and tokenURI (via string.concat).\n if (bytes(_tokenURI).length > 0) {\n return string.concat(base, _tokenURI);\n }\n\n return super.tokenURI(tokenId);\n }\n\n /**\n * @dev Sets `_tokenURI` as the tokenURI of `tokenId`.\n *\n * Emits {MetadataUpdate}.\n */\n function _setTokenURI(uint256 tokenId, string memory _tokenURI) internal virtual {\n _tokenURIs[tokenId] = _tokenURI;\n emit MetadataUpdate(tokenId);\n }\n}\n" + }, + "@openzeppelin/contracts/token/ERC721/extensions/ERC721Votes.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC721/extensions/ERC721Votes.sol)\n\npragma solidity ^0.8.20;\n\nimport {ERC721} from \"../ERC721.sol\";\nimport {Votes} from \"../../../governance/utils/Votes.sol\";\n\n/**\n * @dev Extension of ERC-721 to support voting and delegation as implemented by {Votes}, where each individual NFT counts\n * as 1 vote unit.\n *\n * Tokens do not count as votes until they are delegated, because votes must be tracked which incurs an additional cost\n * on every transfer. Token holders can either delegate to a trusted representative who will decide how to make use of\n * the votes in governance decisions, or they can delegate to themselves to be their own representative.\n */\nabstract contract ERC721Votes is ERC721, Votes {\n /**\n * @dev See {ERC721-_update}. Adjusts votes when tokens are transferred.\n *\n * Emits a {IVotes-DelegateVotesChanged} event.\n */\n function _update(address to, uint256 tokenId, address auth) internal virtual override returns (address) {\n address previousOwner = super._update(to, tokenId, auth);\n\n _transferVotingUnits(previousOwner, to, 1);\n\n return previousOwner;\n }\n\n /**\n * @dev Returns the balance of `account`.\n *\n * WARNING: Overriding this function will likely result in incorrect vote tracking.\n */\n function _getVotingUnits(address account) internal view virtual override returns (uint256) {\n return balanceOf(account);\n }\n\n /**\n * @dev See {ERC721-_increaseBalance}. We need that to account tokens that were minted in batch.\n */\n function _increaseBalance(address account, uint128 amount) internal virtual override {\n super._increaseBalance(account, amount);\n _transferVotingUnits(address(0), account, amount);\n }\n}\n" + }, + "@openzeppelin/contracts/token/ERC721/extensions/IERC721Enumerable.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC721/extensions/IERC721Enumerable.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC721} from \"../IERC721.sol\";\n\n/**\n * @title ERC-721 Non-Fungible Token Standard, optional enumeration extension\n * @dev See https://eips.ethereum.org/EIPS/eip-721\n */\ninterface IERC721Enumerable is IERC721 {\n /**\n * @dev Returns the total amount of tokens stored by the contract.\n */\n function totalSupply() external view returns (uint256);\n\n /**\n * @dev Returns a token ID owned by `owner` at a given `index` of its token list.\n * Use along with {balanceOf} to enumerate all of ``owner``'s tokens.\n */\n function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256);\n\n /**\n * @dev Returns a token ID at a given `index` of all the tokens stored by the contract.\n * Use along with {totalSupply} to enumerate all tokens.\n */\n function tokenByIndex(uint256 index) external view returns (uint256);\n}\n" + }, + "@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC721/extensions/IERC721Metadata.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC721} from \"../IERC721.sol\";\n\n/**\n * @title ERC-721 Non-Fungible Token Standard, optional metadata extension\n * @dev See https://eips.ethereum.org/EIPS/eip-721\n */\ninterface IERC721Metadata is IERC721 {\n /**\n * @dev Returns the token collection name.\n */\n function name() external view returns (string memory);\n\n /**\n * @dev Returns the token collection symbol.\n */\n function symbol() external view returns (string memory);\n\n /**\n * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token.\n */\n function tokenURI(uint256 tokenId) external view returns (string memory);\n}\n" + }, + "@openzeppelin/contracts/token/ERC721/IERC721.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC721/IERC721.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC165} from \"../../utils/introspection/IERC165.sol\";\n\n/**\n * @dev Required interface of an ERC-721 compliant contract.\n */\ninterface IERC721 is IERC165 {\n /**\n * @dev Emitted when `tokenId` token is transferred from `from` to `to`.\n */\n event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);\n\n /**\n * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.\n */\n event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);\n\n /**\n * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.\n */\n event ApprovalForAll(address indexed owner, address indexed operator, bool approved);\n\n /**\n * @dev Returns the number of tokens in ``owner``'s account.\n */\n function balanceOf(address owner) external view returns (uint256 balance);\n\n /**\n * @dev Returns the owner of the `tokenId` token.\n *\n * Requirements:\n *\n * - `tokenId` must exist.\n */\n function ownerOf(uint256 tokenId) external view returns (address owner);\n\n /**\n * @dev Safely transfers `tokenId` token from `from` to `to`.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `tokenId` token must exist and be owned by `from`.\n * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon\n * a safe transfer.\n *\n * Emits a {Transfer} event.\n */\n function safeTransferFrom(address from, address to, uint256 tokenId, bytes calldata data) external;\n\n /**\n * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients\n * are aware of the ERC-721 protocol to prevent tokens from being forever locked.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `tokenId` token must exist and be owned by `from`.\n * - If the caller is not `from`, it must have been allowed to move this token by either {approve} or\n * {setApprovalForAll}.\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon\n * a safe transfer.\n *\n * Emits a {Transfer} event.\n */\n function safeTransferFrom(address from, address to, uint256 tokenId) external;\n\n /**\n * @dev Transfers `tokenId` token from `from` to `to`.\n *\n * WARNING: Note that the caller is responsible to confirm that the recipient is capable of receiving ERC-721\n * or else they may be permanently lost. Usage of {safeTransferFrom} prevents loss, though the caller must\n * understand this adds an external call which potentially creates a reentrancy vulnerability.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `tokenId` token must be owned by `from`.\n * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(address from, address to, uint256 tokenId) external;\n\n /**\n * @dev Gives permission to `to` to transfer `tokenId` token to another account.\n * The approval is cleared when the token is transferred.\n *\n * Only a single account can be approved at a time, so approving the zero address clears previous approvals.\n *\n * Requirements:\n *\n * - The caller must own the token or be an approved operator.\n * - `tokenId` must exist.\n *\n * Emits an {Approval} event.\n */\n function approve(address to, uint256 tokenId) external;\n\n /**\n * @dev Approve or remove `operator` as an operator for the caller.\n * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.\n *\n * Requirements:\n *\n * - The `operator` cannot be the address zero.\n *\n * Emits an {ApprovalForAll} event.\n */\n function setApprovalForAll(address operator, bool approved) external;\n\n /**\n * @dev Returns the account approved for `tokenId` token.\n *\n * Requirements:\n *\n * - `tokenId` must exist.\n */\n function getApproved(uint256 tokenId) external view returns (address operator);\n\n /**\n * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.\n *\n * See {setApprovalForAll}\n */\n function isApprovedForAll(address owner, address operator) external view returns (bool);\n}\n" + }, + "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC721/IERC721Receiver.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @title ERC-721 token receiver interface\n * @dev Interface for any contract that wants to support safeTransfers\n * from ERC-721 asset contracts.\n */\ninterface IERC721Receiver {\n /**\n * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom}\n * by `operator` from `from`, this function is called.\n *\n * It must return its Solidity selector to confirm the token transfer.\n * If any other value is returned or the interface is not implemented by the recipient, the transfer will be\n * reverted.\n *\n * The selector can be obtained in Solidity with `IERC721Receiver.onERC721Received.selector`.\n */\n function onERC721Received(\n address operator,\n address from,\n uint256 tokenId,\n bytes calldata data\n ) external returns (bytes4);\n}\n" + }, + "@openzeppelin/contracts/token/ERC721/utils/ERC721Utils.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC721/utils/ERC721Utils.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC721Receiver} from \"../IERC721Receiver.sol\";\nimport {IERC721Errors} from \"../../../interfaces/draft-IERC6093.sol\";\n\n/**\n * @dev Library that provide common ERC-721 utility functions.\n *\n * See https://eips.ethereum.org/EIPS/eip-721[ERC-721].\n *\n * _Available since v5.1._\n */\nlibrary ERC721Utils {\n /**\n * @dev Performs an acceptance check for the provided `operator` by calling {IERC721-onERC721Received}\n * on the `to` address. The `operator` is generally the address that initiated the token transfer (i.e. `msg.sender`).\n *\n * The acceptance call is not executed and treated as a no-op if the target address doesn't contain code (i.e. an EOA).\n * Otherwise, the recipient must implement {IERC721Receiver-onERC721Received} and return the acceptance magic value to accept\n * the transfer.\n */\n function checkOnERC721Received(\n address operator,\n address from,\n address to,\n uint256 tokenId,\n bytes memory data\n ) internal {\n if (to.code.length > 0) {\n try IERC721Receiver(to).onERC721Received(operator, from, tokenId, data) returns (bytes4 retval) {\n if (retval != IERC721Receiver.onERC721Received.selector) {\n // Token rejected\n revert IERC721Errors.ERC721InvalidReceiver(to);\n }\n } catch (bytes memory reason) {\n if (reason.length == 0) {\n // non-IERC721Receiver implementer\n revert IERC721Errors.ERC721InvalidReceiver(to);\n } else {\n assembly (\"memory-safe\") {\n revert(add(32, reason), mload(reason))\n }\n }\n }\n }\n }\n}\n" + }, + "@openzeppelin/contracts/utils/Context.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract Context {\n function _msgSender() internal view virtual returns (address) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual returns (bytes calldata) {\n return msg.data;\n }\n\n function _contextSuffixLength() internal view virtual returns (uint256) {\n return 0;\n }\n}\n" + }, + "@openzeppelin/contracts/utils/cryptography/ECDSA.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/cryptography/ECDSA.sol)\n\npragma solidity ^0.8.20;\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 }\n\n /**\n * @dev The signature derives the `address(0)`.\n */\n error ECDSAInvalidSignature();\n\n /**\n * @dev The signature has an invalid length.\n */\n error ECDSAInvalidSignatureLength(uint256 length);\n\n /**\n * @dev The signature has an S value that is in the upper half order.\n */\n error ECDSAInvalidSignatureS(bytes32 s);\n\n /**\n * @dev Returns the address that signed a hashed message (`hash`) with `signature` or an error. This will not\n * return address(0) without also returning an error description. Errors are documented using an enum (error type)\n * and a bytes32 providing additional information about the error.\n *\n * If no error is returned, then the address can be used for verification purposes.\n *\n * The `ecrecover` EVM precompile 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 {MessageHashUtils-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 function tryRecover(\n bytes32 hash,\n bytes memory signature\n ) internal pure returns (address recovered, RecoverError err, bytes32 errArg) {\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 assembly (\"memory-safe\") {\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, bytes32(signature.length));\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 precompile 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 {MessageHashUtils-toEthSignedMessageHash} on it.\n */\n function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {\n (address recovered, RecoverError error, bytes32 errorArg) = tryRecover(hash, signature);\n _throwError(error, errorArg);\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[ERC-2098 short signatures]\n */\n function tryRecover(\n bytes32 hash,\n bytes32 r,\n bytes32 vs\n ) internal pure returns (address recovered, RecoverError err, bytes32 errArg) {\n unchecked {\n bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff);\n // We do not check for an overflow here since the shift operation results in 0 or 1.\n uint8 v = uint8((uint256(vs) >> 255) + 27);\n return tryRecover(hash, v, r, s);\n }\n }\n\n /**\n * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately.\n */\n function recover(bytes32 hash, bytes32 r, bytes32 vs) internal pure returns (address) {\n (address recovered, RecoverError error, bytes32 errorArg) = tryRecover(hash, r, vs);\n _throwError(error, errorArg);\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 function tryRecover(\n bytes32 hash,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) internal pure returns (address recovered, RecoverError err, bytes32 errArg) {\n // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature\n // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines\n // the valid range for s in (301): 0 < s < secp256k1n ÷ 2 + 1, and for v in (302): v ∈ {27, 28}. Most\n // signatures from current libraries generate a unique signature with an s-value in the lower half order.\n //\n // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value\n // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or\n // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept\n // these malleable signatures as well.\n if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) {\n return (address(0), RecoverError.InvalidSignatureS, s);\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, bytes32(0));\n }\n\n return (signer, RecoverError.NoError, bytes32(0));\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, bytes32 errorArg) = tryRecover(hash, v, r, s);\n _throwError(error, errorArg);\n return recovered;\n }\n\n /**\n * @dev Optionally reverts with the corresponding custom error according to the `error` argument provided.\n */\n function _throwError(RecoverError error, bytes32 errorArg) private pure {\n if (error == RecoverError.NoError) {\n return; // no error: do nothing\n } else if (error == RecoverError.InvalidSignature) {\n revert ECDSAInvalidSignature();\n } else if (error == RecoverError.InvalidSignatureLength) {\n revert ECDSAInvalidSignatureLength(uint256(errorArg));\n } else if (error == RecoverError.InvalidSignatureS) {\n revert ECDSAInvalidSignatureS(errorArg);\n }\n }\n}\n" + }, + "@openzeppelin/contracts/utils/cryptography/EIP712.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/cryptography/EIP712.sol)\n\npragma solidity ^0.8.20;\n\nimport {MessageHashUtils} from \"./MessageHashUtils.sol\";\nimport {ShortStrings, ShortString} from \"../ShortStrings.sol\";\nimport {IERC5267} from \"../../interfaces/IERC5267.sol\";\n\n/**\n * @dev https://eips.ethereum.org/EIPS/eip-712[EIP-712] is a standard for hashing and signing of typed structured data.\n *\n * The encoding scheme specified in the EIP requires a domain separator and a hash of the typed structured data, whose\n * encoding is very generic and therefore its implementation in Solidity is not feasible, thus this contract\n * does not implement the encoding itself. Protocols need to implement the type-specific encoding they need in order to\n * produce the hash of their typed data using a combination of `abi.encode` and `keccak256`.\n *\n * This contract implements the EIP-712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding\n * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA\n * ({_hashTypedDataV4}).\n *\n * The implementation of the domain separator was designed to be as efficient as possible while still properly updating\n * the chain id to protect against replay attacks on an eventual fork of the chain.\n *\n * NOTE: This contract implements the version of the encoding known as \"v4\", as implemented by the JSON RPC method\n * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask].\n *\n * NOTE: In the upgradeable version of this contract, the cached values will correspond to the address, and the domain\n * separator of the implementation contract. This will cause the {_domainSeparatorV4} function to always rebuild the\n * separator from the immutable values, which is cheaper than accessing a cached version in cold storage.\n *\n * @custom:oz-upgrades-unsafe-allow state-variable-immutable\n */\nabstract contract EIP712 is IERC5267 {\n using ShortStrings for *;\n\n bytes32 private constant TYPE_HASH =\n keccak256(\"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)\");\n\n // Cache the domain separator as an immutable value, but also store the chain id that it corresponds to, in order to\n // invalidate the cached domain separator if the chain id changes.\n bytes32 private immutable _cachedDomainSeparator;\n uint256 private immutable _cachedChainId;\n address private immutable _cachedThis;\n\n bytes32 private immutable _hashedName;\n bytes32 private immutable _hashedVersion;\n\n ShortString private immutable _name;\n ShortString private immutable _version;\n string private _nameFallback;\n string private _versionFallback;\n\n /**\n * @dev Initializes the domain separator and parameter caches.\n *\n * The meaning of `name` and `version` is specified in\n * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP-712]:\n *\n * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol.\n * - `version`: the current major version of the signing domain.\n *\n * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart\n * contract upgrade].\n */\n constructor(string memory name, string memory version) {\n _name = name.toShortStringWithFallback(_nameFallback);\n _version = version.toShortStringWithFallback(_versionFallback);\n _hashedName = keccak256(bytes(name));\n _hashedVersion = keccak256(bytes(version));\n\n _cachedChainId = block.chainid;\n _cachedDomainSeparator = _buildDomainSeparator();\n _cachedThis = address(this);\n }\n\n /**\n * @dev Returns the domain separator for the current chain.\n */\n function _domainSeparatorV4() internal view returns (bytes32) {\n if (address(this) == _cachedThis && block.chainid == _cachedChainId) {\n return _cachedDomainSeparator;\n } else {\n return _buildDomainSeparator();\n }\n }\n\n function _buildDomainSeparator() private view returns (bytes32) {\n return keccak256(abi.encode(TYPE_HASH, _hashedName, _hashedVersion, block.chainid, address(this)));\n }\n\n /**\n * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this\n * function returns the hash of the fully encoded EIP712 message for this domain.\n *\n * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example:\n *\n * ```solidity\n * bytes32 digest = _hashTypedDataV4(keccak256(abi.encode(\n * keccak256(\"Mail(address to,string contents)\"),\n * mailTo,\n * keccak256(bytes(mailContents))\n * )));\n * address signer = ECDSA.recover(digest, signature);\n * ```\n */\n function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) {\n return MessageHashUtils.toTypedDataHash(_domainSeparatorV4(), structHash);\n }\n\n /**\n * @dev See {IERC-5267}.\n */\n function eip712Domain()\n public\n view\n virtual\n returns (\n bytes1 fields,\n string memory name,\n string memory version,\n uint256 chainId,\n address verifyingContract,\n bytes32 salt,\n uint256[] memory extensions\n )\n {\n return (\n hex\"0f\", // 01111\n _EIP712Name(),\n _EIP712Version(),\n block.chainid,\n address(this),\n bytes32(0),\n new uint256[](0)\n );\n }\n\n /**\n * @dev The name parameter for the EIP712 domain.\n *\n * NOTE: By default this function reads _name which is an immutable value.\n * It only reads from storage if necessary (in case the value is too large to fit in a ShortString).\n */\n // solhint-disable-next-line func-name-mixedcase\n function _EIP712Name() internal view returns (string memory) {\n return _name.toStringWithFallback(_nameFallback);\n }\n\n /**\n * @dev The version parameter for the EIP712 domain.\n *\n * NOTE: By default this function reads _version which is an immutable value.\n * It only reads from storage if necessary (in case the value is too large to fit in a ShortString).\n */\n // solhint-disable-next-line func-name-mixedcase\n function _EIP712Version() internal view returns (string memory) {\n return _version.toStringWithFallback(_versionFallback);\n }\n}\n" + }, + "@openzeppelin/contracts/utils/cryptography/MessageHashUtils.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/cryptography/MessageHashUtils.sol)\n\npragma solidity ^0.8.20;\n\nimport {Strings} from \"../Strings.sol\";\n\n/**\n * @dev Signature message hash utilities for producing digests to be consumed by {ECDSA} recovery or signing.\n *\n * The library provides methods for generating a hash of a message that conforms to the\n * https://eips.ethereum.org/EIPS/eip-191[ERC-191] and https://eips.ethereum.org/EIPS/eip-712[EIP 712]\n * specifications.\n */\nlibrary MessageHashUtils {\n /**\n * @dev Returns the keccak256 digest of an ERC-191 signed data with version\n * `0x45` (`personal_sign` messages).\n *\n * The digest is calculated by prefixing a bytes32 `messageHash` with\n * `\"\\x19Ethereum Signed Message:\\n32\"` and hashing the result. It corresponds with the\n * hash signed when using the https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] JSON-RPC method.\n *\n * NOTE: The `messageHash` parameter is intended to be the result of hashing a raw message with\n * keccak256, although any bytes32 value can be safely used because the final digest will\n * be re-hashed.\n *\n * See {ECDSA-recover}.\n */\n function toEthSignedMessageHash(bytes32 messageHash) internal pure returns (bytes32 digest) {\n assembly (\"memory-safe\") {\n mstore(0x00, \"\\x19Ethereum Signed Message:\\n32\") // 32 is the bytes-length of messageHash\n mstore(0x1c, messageHash) // 0x1c (28) is the length of the prefix\n digest := keccak256(0x00, 0x3c) // 0x3c is the length of the prefix (0x1c) + messageHash (0x20)\n }\n }\n\n /**\n * @dev Returns the keccak256 digest of an ERC-191 signed data with version\n * `0x45` (`personal_sign` messages).\n *\n * The digest is calculated by prefixing an arbitrary `message` with\n * `\"\\x19Ethereum Signed Message:\\n\" + len(message)` and hashing the result. It corresponds with the\n * hash signed when using the https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] JSON-RPC method.\n *\n * See {ECDSA-recover}.\n */\n function toEthSignedMessageHash(bytes memory message) internal pure returns (bytes32) {\n return\n keccak256(bytes.concat(\"\\x19Ethereum Signed Message:\\n\", bytes(Strings.toString(message.length)), message));\n }\n\n /**\n * @dev Returns the keccak256 digest of an ERC-191 signed data with version\n * `0x00` (data with intended validator).\n *\n * The digest is calculated by prefixing an arbitrary `data` with `\"\\x19\\x00\"` and the intended\n * `validator` address. Then hashing the result.\n *\n * See {ECDSA-recover}.\n */\n function toDataWithIntendedValidatorHash(address validator, bytes memory data) internal pure returns (bytes32) {\n return keccak256(abi.encodePacked(hex\"19_00\", validator, data));\n }\n\n /**\n * @dev Returns the keccak256 digest of an EIP-712 typed data (ERC-191 version `0x01`).\n *\n * The digest is calculated from a `domainSeparator` and a `structHash`, by prefixing them with\n * `\\x19\\x01` and hashing the result. It corresponds to the hash signed by the\n * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`] JSON-RPC method as part of EIP-712.\n *\n * See {ECDSA-recover}.\n */\n function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32 digest) {\n assembly (\"memory-safe\") {\n let ptr := mload(0x40)\n mstore(ptr, hex\"19_01\")\n mstore(add(ptr, 0x02), domainSeparator)\n mstore(add(ptr, 0x22), structHash)\n digest := keccak256(ptr, 0x42)\n }\n }\n}\n" + }, + "@openzeppelin/contracts/utils/introspection/ERC165.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/introspection/ERC165.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC165} from \"./IERC165.sol\";\n\n/**\n * @dev Implementation of the {IERC165} interface.\n *\n * Contracts that want to implement ERC-165 should inherit from this contract and override {supportsInterface} to check\n * for the additional interface id that will be supported. For example:\n *\n * ```solidity\n * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);\n * }\n * ```\n */\nabstract contract ERC165 is IERC165 {\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) {\n return interfaceId == type(IERC165).interfaceId;\n }\n}\n" + }, + "@openzeppelin/contracts/utils/introspection/IERC165.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/introspection/IERC165.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Interface of the ERC-165 standard, as defined in the\n * https://eips.ethereum.org/EIPS/eip-165[ERC].\n *\n * Implementers can declare support of contract interfaces, which can then be\n * queried by others ({ERC165Checker}).\n *\n * For an implementation, see {ERC165}.\n */\ninterface IERC165 {\n /**\n * @dev Returns true if this contract implements the interface defined by\n * `interfaceId`. See the corresponding\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[ERC section]\n * to learn more about how these ids are created.\n *\n * This function call must use less than 30 000 gas.\n */\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\n}\n" + }, + "@openzeppelin/contracts/utils/math/Math.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/math/Math.sol)\n\npragma solidity ^0.8.20;\n\nimport {Panic} from \"../Panic.sol\";\nimport {SafeCast} from \"./SafeCast.sol\";\n\n/**\n * @dev Standard math utilities missing in the Solidity language.\n */\nlibrary Math {\n enum Rounding {\n Floor, // Toward negative infinity\n Ceil, // Toward positive infinity\n Trunc, // Toward zero\n Expand // Away from zero\n }\n\n /**\n * @dev Returns the addition of two unsigned integers, with an success flag (no overflow).\n */\n function tryAdd(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\n unchecked {\n uint256 c = a + b;\n if (c < a) return (false, 0);\n return (true, c);\n }\n }\n\n /**\n * @dev Returns the subtraction of two unsigned integers, with an success flag (no overflow).\n */\n function trySub(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\n unchecked {\n if (b > a) return (false, 0);\n return (true, a - b);\n }\n }\n\n /**\n * @dev Returns the multiplication of two unsigned integers, with an success flag (no overflow).\n */\n function tryMul(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\n unchecked {\n // Gas optimization: this is cheaper than requiring 'a' not being zero, but the\n // benefit is lost if 'b' is also tested.\n // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522\n if (a == 0) return (true, 0);\n uint256 c = a * b;\n if (c / a != b) return (false, 0);\n return (true, c);\n }\n }\n\n /**\n * @dev Returns the division of two unsigned integers, with a success flag (no division by zero).\n */\n function tryDiv(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\n unchecked {\n if (b == 0) return (false, 0);\n return (true, a / b);\n }\n }\n\n /**\n * @dev Returns the remainder of dividing two unsigned integers, with a success flag (no division by zero).\n */\n function tryMod(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\n unchecked {\n if (b == 0) return (false, 0);\n return (true, a % b);\n }\n }\n\n /**\n * @dev Branchless ternary evaluation for `a ? b : c`. Gas costs are constant.\n *\n * IMPORTANT: This function may reduce bytecode size and consume less gas when used standalone.\n * However, the compiler may optimize Solidity ternary operations (i.e. `a ? b : c`) to only compute\n * one branch when needed, making this function more expensive.\n */\n function ternary(bool condition, uint256 a, uint256 b) internal pure returns (uint256) {\n unchecked {\n // branchless ternary works because:\n // b ^ (a ^ b) == a\n // b ^ 0 == b\n return b ^ ((a ^ b) * SafeCast.toUint(condition));\n }\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 ternary(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 ternary(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 towards infinity instead\n * of rounding towards zero.\n */\n function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {\n if (b == 0) {\n // Guarantee the same behavior as in a regular Solidity division.\n Panic.panic(Panic.DIVISION_BY_ZERO);\n }\n\n // The following calculation ensures accurate ceiling division without overflow.\n // Since a is non-zero, (a - 1) / b will not overflow.\n // The largest possible result occurs when (a - 1) / b is type(uint256).max,\n // but the largest value we can obtain is type(uint256).max - 1, which happens\n // when a = type(uint256).max and b = 1.\n unchecked {\n return SafeCast.toUint(a > 0) * ((a - 1) / b + 1);\n }\n }\n\n /**\n * @dev Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or\n * denominator == 0.\n *\n * Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv) with further edits by\n * 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²⁵⁶ and mod 2²⁵⁶ - 1, then use\n // the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256\n // variables such that product = prod1 * 2²⁵⁶ + prod0.\n uint256 prod0 = x * y; // 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 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²⁵⁶. Also prevents denominator == 0.\n if (denominator <= prod1) {\n Panic.panic(ternary(denominator == 0, Panic.DIVISION_BY_ZERO, Panic.UNDER_OVERFLOW));\n }\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.\n // Always >= 1. See https://cs.stackexchange.com/q/138556/92363.\n\n uint256 twos = denominator & (0 - denominator);\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²⁵⁶ / 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²⁵⁶. Now that denominator is an odd number, it has an inverse modulo 2²⁵⁶ such\n // that denominator * inv ≡ 1 mod 2²⁵⁶. Compute the inverse by starting with a seed that is correct for\n // four bits. That is, denominator * inv ≡ 1 mod 2⁴.\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\n // works in modular arithmetic, doubling the correct bits in each step.\n inverse *= 2 - denominator * inverse; // inverse mod 2⁸\n inverse *= 2 - denominator * inverse; // inverse mod 2¹⁶\n inverse *= 2 - denominator * inverse; // inverse mod 2³²\n inverse *= 2 - denominator * inverse; // inverse mod 2⁶⁴\n inverse *= 2 - denominator * inverse; // inverse mod 2¹²⁸\n inverse *= 2 - denominator * inverse; // inverse mod 2²⁵⁶\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²⁵⁶. Since the preconditions guarantee that the outcome is\n // less than 2²⁵⁶, 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 * @dev 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 return mulDiv(x, y, denominator) + SafeCast.toUint(unsignedRoundsUp(rounding) && mulmod(x, y, denominator) > 0);\n }\n\n /**\n * @dev Calculate the modular multiplicative inverse of a number in Z/nZ.\n *\n * If n is a prime, then Z/nZ is a field. In that case all elements are inversible, except 0.\n * If n is not a prime, then Z/nZ is not a field, and some elements might not be inversible.\n *\n * If the input value is not inversible, 0 is returned.\n *\n * NOTE: If you know for sure that n is (big) a prime, it may be cheaper to use Fermat's little theorem and get the\n * inverse using `Math.modExp(a, n - 2, n)`. See {invModPrime}.\n */\n function invMod(uint256 a, uint256 n) internal pure returns (uint256) {\n unchecked {\n if (n == 0) return 0;\n\n // The inverse modulo is calculated using the Extended Euclidean Algorithm (iterative version)\n // Used to compute integers x and y such that: ax + ny = gcd(a, n).\n // When the gcd is 1, then the inverse of a modulo n exists and it's x.\n // ax + ny = 1\n // ax = 1 + (-y)n\n // ax ≡ 1 (mod n) # x is the inverse of a modulo n\n\n // If the remainder is 0 the gcd is n right away.\n uint256 remainder = a % n;\n uint256 gcd = n;\n\n // Therefore the initial coefficients are:\n // ax + ny = gcd(a, n) = n\n // 0a + 1n = n\n int256 x = 0;\n int256 y = 1;\n\n while (remainder != 0) {\n uint256 quotient = gcd / remainder;\n\n (gcd, remainder) = (\n // The old remainder is the next gcd to try.\n remainder,\n // Compute the next remainder.\n // Can't overflow given that (a % gcd) * (gcd // (a % gcd)) <= gcd\n // where gcd is at most n (capped to type(uint256).max)\n gcd - remainder * quotient\n );\n\n (x, y) = (\n // Increment the coefficient of a.\n y,\n // Decrement the coefficient of n.\n // Can overflow, but the result is casted to uint256 so that the\n // next value of y is \"wrapped around\" to a value between 0 and n - 1.\n x - y * int256(quotient)\n );\n }\n\n if (gcd != 1) return 0; // No inverse exists.\n return ternary(x < 0, n - uint256(-x), uint256(x)); // Wrap the result if it's negative.\n }\n }\n\n /**\n * @dev Variant of {invMod}. More efficient, but only works if `p` is known to be a prime greater than `2`.\n *\n * From https://en.wikipedia.org/wiki/Fermat%27s_little_theorem[Fermat's little theorem], we know that if p is\n * prime, then `a**(p-1) ≡ 1 mod p`. As a consequence, we have `a * a**(p-2) ≡ 1 mod p`, which means that\n * `a**(p-2)` is the modular multiplicative inverse of a in Fp.\n *\n * NOTE: this function does NOT check that `p` is a prime greater than `2`.\n */\n function invModPrime(uint256 a, uint256 p) internal view returns (uint256) {\n unchecked {\n return Math.modExp(a, p - 2, p);\n }\n }\n\n /**\n * @dev Returns the modular exponentiation of the specified base, exponent and modulus (b ** e % m)\n *\n * Requirements:\n * - modulus can't be zero\n * - underlying staticcall to precompile must succeed\n *\n * IMPORTANT: The result is only valid if the underlying call succeeds. When using this function, make\n * sure the chain you're using it on supports the precompiled contract for modular exponentiation\n * at address 0x05 as specified in https://eips.ethereum.org/EIPS/eip-198[EIP-198]. Otherwise,\n * the underlying function will succeed given the lack of a revert, but the result may be incorrectly\n * interpreted as 0.\n */\n function modExp(uint256 b, uint256 e, uint256 m) internal view returns (uint256) {\n (bool success, uint256 result) = tryModExp(b, e, m);\n if (!success) {\n Panic.panic(Panic.DIVISION_BY_ZERO);\n }\n return result;\n }\n\n /**\n * @dev Returns the modular exponentiation of the specified base, exponent and modulus (b ** e % m).\n * It includes a success flag indicating if the operation succeeded. Operation will be marked as failed if trying\n * to operate modulo 0 or if the underlying precompile reverted.\n *\n * IMPORTANT: The result is only valid if the success flag is true. When using this function, make sure the chain\n * you're using it on supports the precompiled contract for modular exponentiation at address 0x05 as specified in\n * https://eips.ethereum.org/EIPS/eip-198[EIP-198]. Otherwise, the underlying function will succeed given the lack\n * of a revert, but the result may be incorrectly interpreted as 0.\n */\n function tryModExp(uint256 b, uint256 e, uint256 m) internal view returns (bool success, uint256 result) {\n if (m == 0) return (false, 0);\n assembly (\"memory-safe\") {\n let ptr := mload(0x40)\n // | Offset | Content | Content (Hex) |\n // |-----------|------------|--------------------------------------------------------------------|\n // | 0x00:0x1f | size of b | 0x0000000000000000000000000000000000000000000000000000000000000020 |\n // | 0x20:0x3f | size of e | 0x0000000000000000000000000000000000000000000000000000000000000020 |\n // | 0x40:0x5f | size of m | 0x0000000000000000000000000000000000000000000000000000000000000020 |\n // | 0x60:0x7f | value of b | 0x<.............................................................b> |\n // | 0x80:0x9f | value of e | 0x<.............................................................e> |\n // | 0xa0:0xbf | value of m | 0x<.............................................................m> |\n mstore(ptr, 0x20)\n mstore(add(ptr, 0x20), 0x20)\n mstore(add(ptr, 0x40), 0x20)\n mstore(add(ptr, 0x60), b)\n mstore(add(ptr, 0x80), e)\n mstore(add(ptr, 0xa0), m)\n\n // Given the result < m, it's guaranteed to fit in 32 bytes,\n // so we can use the memory scratch space located at offset 0.\n success := staticcall(gas(), 0x05, ptr, 0xc0, 0x00, 0x20)\n result := mload(0x00)\n }\n }\n\n /**\n * @dev Variant of {modExp} that supports inputs of arbitrary length.\n */\n function modExp(bytes memory b, bytes memory e, bytes memory m) internal view returns (bytes memory) {\n (bool success, bytes memory result) = tryModExp(b, e, m);\n if (!success) {\n Panic.panic(Panic.DIVISION_BY_ZERO);\n }\n return result;\n }\n\n /**\n * @dev Variant of {tryModExp} that supports inputs of arbitrary length.\n */\n function tryModExp(\n bytes memory b,\n bytes memory e,\n bytes memory m\n ) internal view returns (bool success, bytes memory result) {\n if (_zeroBytes(m)) return (false, new bytes(0));\n\n uint256 mLen = m.length;\n\n // Encode call args in result and move the free memory pointer\n result = abi.encodePacked(b.length, e.length, mLen, b, e, m);\n\n assembly (\"memory-safe\") {\n let dataPtr := add(result, 0x20)\n // Write result on top of args to avoid allocating extra memory.\n success := staticcall(gas(), 0x05, dataPtr, mload(result), dataPtr, mLen)\n // Overwrite the length.\n // result.length > returndatasize() is guaranteed because returndatasize() == m.length\n mstore(result, mLen)\n // Set the memory pointer after the returned data.\n mstore(0x40, add(dataPtr, mLen))\n }\n }\n\n /**\n * @dev Returns whether the provided byte array is zero.\n */\n function _zeroBytes(bytes memory byteArray) private pure returns (bool) {\n for (uint256 i = 0; i < byteArray.length; ++i) {\n if (byteArray[i] != 0) {\n return false;\n }\n }\n return true;\n }\n\n /**\n * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded\n * towards zero.\n *\n * This method is based on Newton's method for computing square roots; the algorithm is restricted to only\n * using integer operations.\n */\n function sqrt(uint256 a) internal pure returns (uint256) {\n unchecked {\n // Take care of easy edge cases when a == 0 or a == 1\n if (a <= 1) {\n return a;\n }\n\n // In this function, we use Newton's method to get a root of `f(x) := x² - a`. It involves building a\n // sequence x_n that converges toward sqrt(a). For each iteration x_n, we also define the error between\n // the current value as `ε_n = | x_n - sqrt(a) |`.\n //\n // For our first estimation, we consider `e` the smallest power of 2 which is bigger than the square root\n // of the target. (i.e. `2**(e-1) ≤ sqrt(a) < 2**e`). We know that `e ≤ 128` because `(2¹²⁸)² = 2²⁵⁶` is\n // bigger than any uint256.\n //\n // By noticing that\n // `2**(e-1) ≤ sqrt(a) < 2**e → (2**(e-1))² ≤ a < (2**e)² → 2**(2*e-2) ≤ a < 2**(2*e)`\n // we can deduce that `e - 1` is `log2(a) / 2`. We can thus compute `x_n = 2**(e-1)` using a method similar\n // to the msb function.\n uint256 aa = a;\n uint256 xn = 1;\n\n if (aa >= (1 << 128)) {\n aa >>= 128;\n xn <<= 64;\n }\n if (aa >= (1 << 64)) {\n aa >>= 64;\n xn <<= 32;\n }\n if (aa >= (1 << 32)) {\n aa >>= 32;\n xn <<= 16;\n }\n if (aa >= (1 << 16)) {\n aa >>= 16;\n xn <<= 8;\n }\n if (aa >= (1 << 8)) {\n aa >>= 8;\n xn <<= 4;\n }\n if (aa >= (1 << 4)) {\n aa >>= 4;\n xn <<= 2;\n }\n if (aa >= (1 << 2)) {\n xn <<= 1;\n }\n\n // We now have x_n such that `x_n = 2**(e-1) ≤ sqrt(a) < 2**e = 2 * x_n`. This implies ε_n ≤ 2**(e-1).\n //\n // We can refine our estimation by noticing that the middle of that interval minimizes the error.\n // If we move x_n to equal 2**(e-1) + 2**(e-2), then we reduce the error to ε_n ≤ 2**(e-2).\n // This is going to be our x_0 (and ε_0)\n xn = (3 * xn) >> 1; // ε_0 := | x_0 - sqrt(a) | ≤ 2**(e-2)\n\n // From here, Newton's method give us:\n // x_{n+1} = (x_n + a / x_n) / 2\n //\n // One should note that:\n // x_{n+1}² - a = ((x_n + a / x_n) / 2)² - a\n // = ((x_n² + a) / (2 * x_n))² - a\n // = (x_n⁴ + 2 * a * x_n² + a²) / (4 * x_n²) - a\n // = (x_n⁴ + 2 * a * x_n² + a² - 4 * a * x_n²) / (4 * x_n²)\n // = (x_n⁴ - 2 * a * x_n² + a²) / (4 * x_n²)\n // = (x_n² - a)² / (2 * x_n)²\n // = ((x_n² - a) / (2 * x_n))²\n // ≥ 0\n // Which proves that for all n ≥ 1, sqrt(a) ≤ x_n\n //\n // This gives us the proof of quadratic convergence of the sequence:\n // ε_{n+1} = | x_{n+1} - sqrt(a) |\n // = | (x_n + a / x_n) / 2 - sqrt(a) |\n // = | (x_n² + a - 2*x_n*sqrt(a)) / (2 * x_n) |\n // = | (x_n - sqrt(a))² / (2 * x_n) |\n // = | ε_n² / (2 * x_n) |\n // = ε_n² / | (2 * x_n) |\n //\n // For the first iteration, we have a special case where x_0 is known:\n // ε_1 = ε_0² / | (2 * x_0) |\n // ≤ (2**(e-2))² / (2 * (2**(e-1) + 2**(e-2)))\n // ≤ 2**(2*e-4) / (3 * 2**(e-1))\n // ≤ 2**(e-3) / 3\n // ≤ 2**(e-3-log2(3))\n // ≤ 2**(e-4.5)\n //\n // For the following iterations, we use the fact that, 2**(e-1) ≤ sqrt(a) ≤ x_n:\n // ε_{n+1} = ε_n² / | (2 * x_n) |\n // ≤ (2**(e-k))² / (2 * 2**(e-1))\n // ≤ 2**(2*e-2*k) / 2**e\n // ≤ 2**(e-2*k)\n xn = (xn + a / xn) >> 1; // ε_1 := | x_1 - sqrt(a) | ≤ 2**(e-4.5) -- special case, see above\n xn = (xn + a / xn) >> 1; // ε_2 := | x_2 - sqrt(a) | ≤ 2**(e-9) -- general case with k = 4.5\n xn = (xn + a / xn) >> 1; // ε_3 := | x_3 - sqrt(a) | ≤ 2**(e-18) -- general case with k = 9\n xn = (xn + a / xn) >> 1; // ε_4 := | x_4 - sqrt(a) | ≤ 2**(e-36) -- general case with k = 18\n xn = (xn + a / xn) >> 1; // ε_5 := | x_5 - sqrt(a) | ≤ 2**(e-72) -- general case with k = 36\n xn = (xn + a / xn) >> 1; // ε_6 := | x_6 - sqrt(a) | ≤ 2**(e-144) -- general case with k = 72\n\n // Because e ≤ 128 (as discussed during the first estimation phase), we know have reached a precision\n // ε_6 ≤ 2**(e-144) < 1. Given we're operating on integers, then we can ensure that xn is now either\n // sqrt(a) or sqrt(a) + 1.\n return xn - SafeCast.toUint(xn > a / xn);\n }\n }\n\n /**\n * @dev 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 + SafeCast.toUint(unsignedRoundsUp(rounding) && result * result < a);\n }\n }\n\n /**\n * @dev Return the log in base 2 of a positive value rounded towards zero.\n * Returns 0 if given 0.\n */\n function log2(uint256 value) internal pure returns (uint256) {\n uint256 result = 0;\n uint256 exp;\n unchecked {\n exp = 128 * SafeCast.toUint(value > (1 << 128) - 1);\n value >>= exp;\n result += exp;\n\n exp = 64 * SafeCast.toUint(value > (1 << 64) - 1);\n value >>= exp;\n result += exp;\n\n exp = 32 * SafeCast.toUint(value > (1 << 32) - 1);\n value >>= exp;\n result += exp;\n\n exp = 16 * SafeCast.toUint(value > (1 << 16) - 1);\n value >>= exp;\n result += exp;\n\n exp = 8 * SafeCast.toUint(value > (1 << 8) - 1);\n value >>= exp;\n result += exp;\n\n exp = 4 * SafeCast.toUint(value > (1 << 4) - 1);\n value >>= exp;\n result += exp;\n\n exp = 2 * SafeCast.toUint(value > (1 << 2) - 1);\n value >>= exp;\n result += exp;\n\n result += SafeCast.toUint(value > 1);\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 + SafeCast.toUint(unsignedRoundsUp(rounding) && 1 << result < value);\n }\n }\n\n /**\n * @dev Return the log in base 10 of a positive value rounded towards zero.\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 + SafeCast.toUint(unsignedRoundsUp(rounding) && 10 ** result < value);\n }\n }\n\n /**\n * @dev Return the log in base 256 of a positive value rounded towards zero.\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 uint256 isGt;\n unchecked {\n isGt = SafeCast.toUint(value > (1 << 128) - 1);\n value >>= isGt * 128;\n result += isGt * 16;\n\n isGt = SafeCast.toUint(value > (1 << 64) - 1);\n value >>= isGt * 64;\n result += isGt * 8;\n\n isGt = SafeCast.toUint(value > (1 << 32) - 1);\n value >>= isGt * 32;\n result += isGt * 4;\n\n isGt = SafeCast.toUint(value > (1 << 16) - 1);\n value >>= isGt * 16;\n result += isGt * 2;\n\n result += SafeCast.toUint(value > (1 << 8) - 1);\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 + SafeCast.toUint(unsignedRoundsUp(rounding) && 1 << (result << 3) < value);\n }\n }\n\n /**\n * @dev Returns whether a provided rounding mode is considered rounding up for unsigned integers.\n */\n function unsignedRoundsUp(Rounding rounding) internal pure returns (bool) {\n return uint8(rounding) % 2 == 1;\n }\n}\n" + }, + "@openzeppelin/contracts/utils/math/SafeCast.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/math/SafeCast.sol)\n// This file was procedurally generated from scripts/generate/templates/SafeCast.js.\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Wrappers over Solidity's uintXX/intXX/bool casting operators with added overflow\n * checks.\n *\n * Downcasting from uint256/int256 in Solidity does not revert on overflow. This can\n * easily result in undesired exploitation or bugs, since developers usually\n * assume that overflows raise errors. `SafeCast` restores this intuition by\n * reverting the transaction when such an operation overflows.\n *\n * Using this library instead of the unchecked operations eliminates an entire\n * class of bugs, so it's recommended to use it always.\n */\nlibrary SafeCast {\n /**\n * @dev Value doesn't fit in an uint of `bits` size.\n */\n error SafeCastOverflowedUintDowncast(uint8 bits, uint256 value);\n\n /**\n * @dev An int value doesn't fit in an uint of `bits` size.\n */\n error SafeCastOverflowedIntToUint(int256 value);\n\n /**\n * @dev Value doesn't fit in an int of `bits` size.\n */\n error SafeCastOverflowedIntDowncast(uint8 bits, int256 value);\n\n /**\n * @dev An uint value doesn't fit in an int of `bits` size.\n */\n error SafeCastOverflowedUintToInt(uint256 value);\n\n /**\n * @dev Returns the downcasted uint248 from uint256, reverting on\n * overflow (when the input is greater than largest uint248).\n *\n * Counterpart to Solidity's `uint248` operator.\n *\n * Requirements:\n *\n * - input must fit into 248 bits\n */\n function toUint248(uint256 value) internal pure returns (uint248) {\n if (value > type(uint248).max) {\n revert SafeCastOverflowedUintDowncast(248, value);\n }\n return uint248(value);\n }\n\n /**\n * @dev Returns the downcasted uint240 from uint256, reverting on\n * overflow (when the input is greater than largest uint240).\n *\n * Counterpart to Solidity's `uint240` operator.\n *\n * Requirements:\n *\n * - input must fit into 240 bits\n */\n function toUint240(uint256 value) internal pure returns (uint240) {\n if (value > type(uint240).max) {\n revert SafeCastOverflowedUintDowncast(240, value);\n }\n return uint240(value);\n }\n\n /**\n * @dev Returns the downcasted uint232 from uint256, reverting on\n * overflow (when the input is greater than largest uint232).\n *\n * Counterpart to Solidity's `uint232` operator.\n *\n * Requirements:\n *\n * - input must fit into 232 bits\n */\n function toUint232(uint256 value) internal pure returns (uint232) {\n if (value > type(uint232).max) {\n revert SafeCastOverflowedUintDowncast(232, value);\n }\n return uint232(value);\n }\n\n /**\n * @dev Returns the downcasted uint224 from uint256, reverting on\n * overflow (when the input is greater than largest uint224).\n *\n * Counterpart to Solidity's `uint224` operator.\n *\n * Requirements:\n *\n * - input must fit into 224 bits\n */\n function toUint224(uint256 value) internal pure returns (uint224) {\n if (value > type(uint224).max) {\n revert SafeCastOverflowedUintDowncast(224, value);\n }\n return uint224(value);\n }\n\n /**\n * @dev Returns the downcasted uint216 from uint256, reverting on\n * overflow (when the input is greater than largest uint216).\n *\n * Counterpart to Solidity's `uint216` operator.\n *\n * Requirements:\n *\n * - input must fit into 216 bits\n */\n function toUint216(uint256 value) internal pure returns (uint216) {\n if (value > type(uint216).max) {\n revert SafeCastOverflowedUintDowncast(216, value);\n }\n return uint216(value);\n }\n\n /**\n * @dev Returns the downcasted uint208 from uint256, reverting on\n * overflow (when the input is greater than largest uint208).\n *\n * Counterpart to Solidity's `uint208` operator.\n *\n * Requirements:\n *\n * - input must fit into 208 bits\n */\n function toUint208(uint256 value) internal pure returns (uint208) {\n if (value > type(uint208).max) {\n revert SafeCastOverflowedUintDowncast(208, value);\n }\n return uint208(value);\n }\n\n /**\n * @dev Returns the downcasted uint200 from uint256, reverting on\n * overflow (when the input is greater than largest uint200).\n *\n * Counterpart to Solidity's `uint200` operator.\n *\n * Requirements:\n *\n * - input must fit into 200 bits\n */\n function toUint200(uint256 value) internal pure returns (uint200) {\n if (value > type(uint200).max) {\n revert SafeCastOverflowedUintDowncast(200, value);\n }\n return uint200(value);\n }\n\n /**\n * @dev Returns the downcasted uint192 from uint256, reverting on\n * overflow (when the input is greater than largest uint192).\n *\n * Counterpart to Solidity's `uint192` operator.\n *\n * Requirements:\n *\n * - input must fit into 192 bits\n */\n function toUint192(uint256 value) internal pure returns (uint192) {\n if (value > type(uint192).max) {\n revert SafeCastOverflowedUintDowncast(192, value);\n }\n return uint192(value);\n }\n\n /**\n * @dev Returns the downcasted uint184 from uint256, reverting on\n * overflow (when the input is greater than largest uint184).\n *\n * Counterpart to Solidity's `uint184` operator.\n *\n * Requirements:\n *\n * - input must fit into 184 bits\n */\n function toUint184(uint256 value) internal pure returns (uint184) {\n if (value > type(uint184).max) {\n revert SafeCastOverflowedUintDowncast(184, value);\n }\n return uint184(value);\n }\n\n /**\n * @dev Returns the downcasted uint176 from uint256, reverting on\n * overflow (when the input is greater than largest uint176).\n *\n * Counterpart to Solidity's `uint176` operator.\n *\n * Requirements:\n *\n * - input must fit into 176 bits\n */\n function toUint176(uint256 value) internal pure returns (uint176) {\n if (value > type(uint176).max) {\n revert SafeCastOverflowedUintDowncast(176, value);\n }\n return uint176(value);\n }\n\n /**\n * @dev Returns the downcasted uint168 from uint256, reverting on\n * overflow (when the input is greater than largest uint168).\n *\n * Counterpart to Solidity's `uint168` operator.\n *\n * Requirements:\n *\n * - input must fit into 168 bits\n */\n function toUint168(uint256 value) internal pure returns (uint168) {\n if (value > type(uint168).max) {\n revert SafeCastOverflowedUintDowncast(168, value);\n }\n return uint168(value);\n }\n\n /**\n * @dev Returns the downcasted uint160 from uint256, reverting on\n * overflow (when the input is greater than largest uint160).\n *\n * Counterpart to Solidity's `uint160` operator.\n *\n * Requirements:\n *\n * - input must fit into 160 bits\n */\n function toUint160(uint256 value) internal pure returns (uint160) {\n if (value > type(uint160).max) {\n revert SafeCastOverflowedUintDowncast(160, value);\n }\n return uint160(value);\n }\n\n /**\n * @dev Returns the downcasted uint152 from uint256, reverting on\n * overflow (when the input is greater than largest uint152).\n *\n * Counterpart to Solidity's `uint152` operator.\n *\n * Requirements:\n *\n * - input must fit into 152 bits\n */\n function toUint152(uint256 value) internal pure returns (uint152) {\n if (value > type(uint152).max) {\n revert SafeCastOverflowedUintDowncast(152, value);\n }\n return uint152(value);\n }\n\n /**\n * @dev Returns the downcasted uint144 from uint256, reverting on\n * overflow (when the input is greater than largest uint144).\n *\n * Counterpart to Solidity's `uint144` operator.\n *\n * Requirements:\n *\n * - input must fit into 144 bits\n */\n function toUint144(uint256 value) internal pure returns (uint144) {\n if (value > type(uint144).max) {\n revert SafeCastOverflowedUintDowncast(144, value);\n }\n return uint144(value);\n }\n\n /**\n * @dev Returns the downcasted uint136 from uint256, reverting on\n * overflow (when the input is greater than largest uint136).\n *\n * Counterpart to Solidity's `uint136` operator.\n *\n * Requirements:\n *\n * - input must fit into 136 bits\n */\n function toUint136(uint256 value) internal pure returns (uint136) {\n if (value > type(uint136).max) {\n revert SafeCastOverflowedUintDowncast(136, value);\n }\n return uint136(value);\n }\n\n /**\n * @dev Returns the downcasted uint128 from uint256, reverting on\n * overflow (when the input is greater than largest uint128).\n *\n * Counterpart to Solidity's `uint128` operator.\n *\n * Requirements:\n *\n * - input must fit into 128 bits\n */\n function toUint128(uint256 value) internal pure returns (uint128) {\n if (value > type(uint128).max) {\n revert SafeCastOverflowedUintDowncast(128, value);\n }\n return uint128(value);\n }\n\n /**\n * @dev Returns the downcasted uint120 from uint256, reverting on\n * overflow (when the input is greater than largest uint120).\n *\n * Counterpart to Solidity's `uint120` operator.\n *\n * Requirements:\n *\n * - input must fit into 120 bits\n */\n function toUint120(uint256 value) internal pure returns (uint120) {\n if (value > type(uint120).max) {\n revert SafeCastOverflowedUintDowncast(120, value);\n }\n return uint120(value);\n }\n\n /**\n * @dev Returns the downcasted uint112 from uint256, reverting on\n * overflow (when the input is greater than largest uint112).\n *\n * Counterpart to Solidity's `uint112` operator.\n *\n * Requirements:\n *\n * - input must fit into 112 bits\n */\n function toUint112(uint256 value) internal pure returns (uint112) {\n if (value > type(uint112).max) {\n revert SafeCastOverflowedUintDowncast(112, value);\n }\n return uint112(value);\n }\n\n /**\n * @dev Returns the downcasted uint104 from uint256, reverting on\n * overflow (when the input is greater than largest uint104).\n *\n * Counterpart to Solidity's `uint104` operator.\n *\n * Requirements:\n *\n * - input must fit into 104 bits\n */\n function toUint104(uint256 value) internal pure returns (uint104) {\n if (value > type(uint104).max) {\n revert SafeCastOverflowedUintDowncast(104, value);\n }\n return uint104(value);\n }\n\n /**\n * @dev Returns the downcasted uint96 from uint256, reverting on\n * overflow (when the input is greater than largest uint96).\n *\n * Counterpart to Solidity's `uint96` operator.\n *\n * Requirements:\n *\n * - input must fit into 96 bits\n */\n function toUint96(uint256 value) internal pure returns (uint96) {\n if (value > type(uint96).max) {\n revert SafeCastOverflowedUintDowncast(96, value);\n }\n return uint96(value);\n }\n\n /**\n * @dev Returns the downcasted uint88 from uint256, reverting on\n * overflow (when the input is greater than largest uint88).\n *\n * Counterpart to Solidity's `uint88` operator.\n *\n * Requirements:\n *\n * - input must fit into 88 bits\n */\n function toUint88(uint256 value) internal pure returns (uint88) {\n if (value > type(uint88).max) {\n revert SafeCastOverflowedUintDowncast(88, value);\n }\n return uint88(value);\n }\n\n /**\n * @dev Returns the downcasted uint80 from uint256, reverting on\n * overflow (when the input is greater than largest uint80).\n *\n * Counterpart to Solidity's `uint80` operator.\n *\n * Requirements:\n *\n * - input must fit into 80 bits\n */\n function toUint80(uint256 value) internal pure returns (uint80) {\n if (value > type(uint80).max) {\n revert SafeCastOverflowedUintDowncast(80, value);\n }\n return uint80(value);\n }\n\n /**\n * @dev Returns the downcasted uint72 from uint256, reverting on\n * overflow (when the input is greater than largest uint72).\n *\n * Counterpart to Solidity's `uint72` operator.\n *\n * Requirements:\n *\n * - input must fit into 72 bits\n */\n function toUint72(uint256 value) internal pure returns (uint72) {\n if (value > type(uint72).max) {\n revert SafeCastOverflowedUintDowncast(72, value);\n }\n return uint72(value);\n }\n\n /**\n * @dev Returns the downcasted uint64 from uint256, reverting on\n * overflow (when the input is greater than largest uint64).\n *\n * Counterpart to Solidity's `uint64` operator.\n *\n * Requirements:\n *\n * - input must fit into 64 bits\n */\n function toUint64(uint256 value) internal pure returns (uint64) {\n if (value > type(uint64).max) {\n revert SafeCastOverflowedUintDowncast(64, value);\n }\n return uint64(value);\n }\n\n /**\n * @dev Returns the downcasted uint56 from uint256, reverting on\n * overflow (when the input is greater than largest uint56).\n *\n * Counterpart to Solidity's `uint56` operator.\n *\n * Requirements:\n *\n * - input must fit into 56 bits\n */\n function toUint56(uint256 value) internal pure returns (uint56) {\n if (value > type(uint56).max) {\n revert SafeCastOverflowedUintDowncast(56, value);\n }\n return uint56(value);\n }\n\n /**\n * @dev Returns the downcasted uint48 from uint256, reverting on\n * overflow (when the input is greater than largest uint48).\n *\n * Counterpart to Solidity's `uint48` operator.\n *\n * Requirements:\n *\n * - input must fit into 48 bits\n */\n function toUint48(uint256 value) internal pure returns (uint48) {\n if (value > type(uint48).max) {\n revert SafeCastOverflowedUintDowncast(48, value);\n }\n return uint48(value);\n }\n\n /**\n * @dev Returns the downcasted uint40 from uint256, reverting on\n * overflow (when the input is greater than largest uint40).\n *\n * Counterpart to Solidity's `uint40` operator.\n *\n * Requirements:\n *\n * - input must fit into 40 bits\n */\n function toUint40(uint256 value) internal pure returns (uint40) {\n if (value > type(uint40).max) {\n revert SafeCastOverflowedUintDowncast(40, value);\n }\n return uint40(value);\n }\n\n /**\n * @dev Returns the downcasted uint32 from uint256, reverting on\n * overflow (when the input is greater than largest uint32).\n *\n * Counterpart to Solidity's `uint32` operator.\n *\n * Requirements:\n *\n * - input must fit into 32 bits\n */\n function toUint32(uint256 value) internal pure returns (uint32) {\n if (value > type(uint32).max) {\n revert SafeCastOverflowedUintDowncast(32, value);\n }\n return uint32(value);\n }\n\n /**\n * @dev Returns the downcasted uint24 from uint256, reverting on\n * overflow (when the input is greater than largest uint24).\n *\n * Counterpart to Solidity's `uint24` operator.\n *\n * Requirements:\n *\n * - input must fit into 24 bits\n */\n function toUint24(uint256 value) internal pure returns (uint24) {\n if (value > type(uint24).max) {\n revert SafeCastOverflowedUintDowncast(24, value);\n }\n return uint24(value);\n }\n\n /**\n * @dev Returns the downcasted uint16 from uint256, reverting on\n * overflow (when the input is greater than largest uint16).\n *\n * Counterpart to Solidity's `uint16` operator.\n *\n * Requirements:\n *\n * - input must fit into 16 bits\n */\n function toUint16(uint256 value) internal pure returns (uint16) {\n if (value > type(uint16).max) {\n revert SafeCastOverflowedUintDowncast(16, value);\n }\n return uint16(value);\n }\n\n /**\n * @dev Returns the downcasted uint8 from uint256, reverting on\n * overflow (when the input is greater than largest uint8).\n *\n * Counterpart to Solidity's `uint8` operator.\n *\n * Requirements:\n *\n * - input must fit into 8 bits\n */\n function toUint8(uint256 value) internal pure returns (uint8) {\n if (value > type(uint8).max) {\n revert SafeCastOverflowedUintDowncast(8, value);\n }\n return uint8(value);\n }\n\n /**\n * @dev Converts a signed int256 into an unsigned uint256.\n *\n * Requirements:\n *\n * - input must be greater than or equal to 0.\n */\n function toUint256(int256 value) internal pure returns (uint256) {\n if (value < 0) {\n revert SafeCastOverflowedIntToUint(value);\n }\n return uint256(value);\n }\n\n /**\n * @dev Returns the downcasted int248 from int256, reverting on\n * overflow (when the input is less than smallest int248 or\n * greater than largest int248).\n *\n * Counterpart to Solidity's `int248` operator.\n *\n * Requirements:\n *\n * - input must fit into 248 bits\n */\n function toInt248(int256 value) internal pure returns (int248 downcasted) {\n downcasted = int248(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(248, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int240 from int256, reverting on\n * overflow (when the input is less than smallest int240 or\n * greater than largest int240).\n *\n * Counterpart to Solidity's `int240` operator.\n *\n * Requirements:\n *\n * - input must fit into 240 bits\n */\n function toInt240(int256 value) internal pure returns (int240 downcasted) {\n downcasted = int240(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(240, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int232 from int256, reverting on\n * overflow (when the input is less than smallest int232 or\n * greater than largest int232).\n *\n * Counterpart to Solidity's `int232` operator.\n *\n * Requirements:\n *\n * - input must fit into 232 bits\n */\n function toInt232(int256 value) internal pure returns (int232 downcasted) {\n downcasted = int232(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(232, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int224 from int256, reverting on\n * overflow (when the input is less than smallest int224 or\n * greater than largest int224).\n *\n * Counterpart to Solidity's `int224` operator.\n *\n * Requirements:\n *\n * - input must fit into 224 bits\n */\n function toInt224(int256 value) internal pure returns (int224 downcasted) {\n downcasted = int224(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(224, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int216 from int256, reverting on\n * overflow (when the input is less than smallest int216 or\n * greater than largest int216).\n *\n * Counterpart to Solidity's `int216` operator.\n *\n * Requirements:\n *\n * - input must fit into 216 bits\n */\n function toInt216(int256 value) internal pure returns (int216 downcasted) {\n downcasted = int216(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(216, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int208 from int256, reverting on\n * overflow (when the input is less than smallest int208 or\n * greater than largest int208).\n *\n * Counterpart to Solidity's `int208` operator.\n *\n * Requirements:\n *\n * - input must fit into 208 bits\n */\n function toInt208(int256 value) internal pure returns (int208 downcasted) {\n downcasted = int208(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(208, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int200 from int256, reverting on\n * overflow (when the input is less than smallest int200 or\n * greater than largest int200).\n *\n * Counterpart to Solidity's `int200` operator.\n *\n * Requirements:\n *\n * - input must fit into 200 bits\n */\n function toInt200(int256 value) internal pure returns (int200 downcasted) {\n downcasted = int200(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(200, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int192 from int256, reverting on\n * overflow (when the input is less than smallest int192 or\n * greater than largest int192).\n *\n * Counterpart to Solidity's `int192` operator.\n *\n * Requirements:\n *\n * - input must fit into 192 bits\n */\n function toInt192(int256 value) internal pure returns (int192 downcasted) {\n downcasted = int192(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(192, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int184 from int256, reverting on\n * overflow (when the input is less than smallest int184 or\n * greater than largest int184).\n *\n * Counterpart to Solidity's `int184` operator.\n *\n * Requirements:\n *\n * - input must fit into 184 bits\n */\n function toInt184(int256 value) internal pure returns (int184 downcasted) {\n downcasted = int184(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(184, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int176 from int256, reverting on\n * overflow (when the input is less than smallest int176 or\n * greater than largest int176).\n *\n * Counterpart to Solidity's `int176` operator.\n *\n * Requirements:\n *\n * - input must fit into 176 bits\n */\n function toInt176(int256 value) internal pure returns (int176 downcasted) {\n downcasted = int176(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(176, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int168 from int256, reverting on\n * overflow (when the input is less than smallest int168 or\n * greater than largest int168).\n *\n * Counterpart to Solidity's `int168` operator.\n *\n * Requirements:\n *\n * - input must fit into 168 bits\n */\n function toInt168(int256 value) internal pure returns (int168 downcasted) {\n downcasted = int168(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(168, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int160 from int256, reverting on\n * overflow (when the input is less than smallest int160 or\n * greater than largest int160).\n *\n * Counterpart to Solidity's `int160` operator.\n *\n * Requirements:\n *\n * - input must fit into 160 bits\n */\n function toInt160(int256 value) internal pure returns (int160 downcasted) {\n downcasted = int160(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(160, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int152 from int256, reverting on\n * overflow (when the input is less than smallest int152 or\n * greater than largest int152).\n *\n * Counterpart to Solidity's `int152` operator.\n *\n * Requirements:\n *\n * - input must fit into 152 bits\n */\n function toInt152(int256 value) internal pure returns (int152 downcasted) {\n downcasted = int152(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(152, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int144 from int256, reverting on\n * overflow (when the input is less than smallest int144 or\n * greater than largest int144).\n *\n * Counterpart to Solidity's `int144` operator.\n *\n * Requirements:\n *\n * - input must fit into 144 bits\n */\n function toInt144(int256 value) internal pure returns (int144 downcasted) {\n downcasted = int144(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(144, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int136 from int256, reverting on\n * overflow (when the input is less than smallest int136 or\n * greater than largest int136).\n *\n * Counterpart to Solidity's `int136` operator.\n *\n * Requirements:\n *\n * - input must fit into 136 bits\n */\n function toInt136(int256 value) internal pure returns (int136 downcasted) {\n downcasted = int136(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(136, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int128 from int256, reverting on\n * overflow (when the input is less than smallest int128 or\n * greater than largest int128).\n *\n * Counterpart to Solidity's `int128` operator.\n *\n * Requirements:\n *\n * - input must fit into 128 bits\n */\n function toInt128(int256 value) internal pure returns (int128 downcasted) {\n downcasted = int128(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(128, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int120 from int256, reverting on\n * overflow (when the input is less than smallest int120 or\n * greater than largest int120).\n *\n * Counterpart to Solidity's `int120` operator.\n *\n * Requirements:\n *\n * - input must fit into 120 bits\n */\n function toInt120(int256 value) internal pure returns (int120 downcasted) {\n downcasted = int120(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(120, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int112 from int256, reverting on\n * overflow (when the input is less than smallest int112 or\n * greater than largest int112).\n *\n * Counterpart to Solidity's `int112` operator.\n *\n * Requirements:\n *\n * - input must fit into 112 bits\n */\n function toInt112(int256 value) internal pure returns (int112 downcasted) {\n downcasted = int112(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(112, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int104 from int256, reverting on\n * overflow (when the input is less than smallest int104 or\n * greater than largest int104).\n *\n * Counterpart to Solidity's `int104` operator.\n *\n * Requirements:\n *\n * - input must fit into 104 bits\n */\n function toInt104(int256 value) internal pure returns (int104 downcasted) {\n downcasted = int104(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(104, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int96 from int256, reverting on\n * overflow (when the input is less than smallest int96 or\n * greater than largest int96).\n *\n * Counterpart to Solidity's `int96` operator.\n *\n * Requirements:\n *\n * - input must fit into 96 bits\n */\n function toInt96(int256 value) internal pure returns (int96 downcasted) {\n downcasted = int96(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(96, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int88 from int256, reverting on\n * overflow (when the input is less than smallest int88 or\n * greater than largest int88).\n *\n * Counterpart to Solidity's `int88` operator.\n *\n * Requirements:\n *\n * - input must fit into 88 bits\n */\n function toInt88(int256 value) internal pure returns (int88 downcasted) {\n downcasted = int88(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(88, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int80 from int256, reverting on\n * overflow (when the input is less than smallest int80 or\n * greater than largest int80).\n *\n * Counterpart to Solidity's `int80` operator.\n *\n * Requirements:\n *\n * - input must fit into 80 bits\n */\n function toInt80(int256 value) internal pure returns (int80 downcasted) {\n downcasted = int80(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(80, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int72 from int256, reverting on\n * overflow (when the input is less than smallest int72 or\n * greater than largest int72).\n *\n * Counterpart to Solidity's `int72` operator.\n *\n * Requirements:\n *\n * - input must fit into 72 bits\n */\n function toInt72(int256 value) internal pure returns (int72 downcasted) {\n downcasted = int72(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(72, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int64 from int256, reverting on\n * overflow (when the input is less than smallest int64 or\n * greater than largest int64).\n *\n * Counterpart to Solidity's `int64` operator.\n *\n * Requirements:\n *\n * - input must fit into 64 bits\n */\n function toInt64(int256 value) internal pure returns (int64 downcasted) {\n downcasted = int64(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(64, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int56 from int256, reverting on\n * overflow (when the input is less than smallest int56 or\n * greater than largest int56).\n *\n * Counterpart to Solidity's `int56` operator.\n *\n * Requirements:\n *\n * - input must fit into 56 bits\n */\n function toInt56(int256 value) internal pure returns (int56 downcasted) {\n downcasted = int56(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(56, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int48 from int256, reverting on\n * overflow (when the input is less than smallest int48 or\n * greater than largest int48).\n *\n * Counterpart to Solidity's `int48` operator.\n *\n * Requirements:\n *\n * - input must fit into 48 bits\n */\n function toInt48(int256 value) internal pure returns (int48 downcasted) {\n downcasted = int48(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(48, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int40 from int256, reverting on\n * overflow (when the input is less than smallest int40 or\n * greater than largest int40).\n *\n * Counterpart to Solidity's `int40` operator.\n *\n * Requirements:\n *\n * - input must fit into 40 bits\n */\n function toInt40(int256 value) internal pure returns (int40 downcasted) {\n downcasted = int40(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(40, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int32 from int256, reverting on\n * overflow (when the input is less than smallest int32 or\n * greater than largest int32).\n *\n * Counterpart to Solidity's `int32` operator.\n *\n * Requirements:\n *\n * - input must fit into 32 bits\n */\n function toInt32(int256 value) internal pure returns (int32 downcasted) {\n downcasted = int32(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(32, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int24 from int256, reverting on\n * overflow (when the input is less than smallest int24 or\n * greater than largest int24).\n *\n * Counterpart to Solidity's `int24` operator.\n *\n * Requirements:\n *\n * - input must fit into 24 bits\n */\n function toInt24(int256 value) internal pure returns (int24 downcasted) {\n downcasted = int24(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(24, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int16 from int256, reverting on\n * overflow (when the input is less than smallest int16 or\n * greater than largest int16).\n *\n * Counterpart to Solidity's `int16` operator.\n *\n * Requirements:\n *\n * - input must fit into 16 bits\n */\n function toInt16(int256 value) internal pure returns (int16 downcasted) {\n downcasted = int16(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(16, value);\n }\n }\n\n /**\n * @dev Returns the downcasted int8 from int256, reverting on\n * overflow (when the input is less than smallest int8 or\n * greater than largest int8).\n *\n * Counterpart to Solidity's `int8` operator.\n *\n * Requirements:\n *\n * - input must fit into 8 bits\n */\n function toInt8(int256 value) internal pure returns (int8 downcasted) {\n downcasted = int8(value);\n if (downcasted != value) {\n revert SafeCastOverflowedIntDowncast(8, value);\n }\n }\n\n /**\n * @dev Converts an unsigned uint256 into a signed int256.\n *\n * Requirements:\n *\n * - input must be less than or equal to maxInt256.\n */\n function toInt256(uint256 value) internal pure returns (int256) {\n // Note: Unsafe cast below is okay because `type(int256).max` is guaranteed to be positive\n if (value > uint256(type(int256).max)) {\n revert SafeCastOverflowedUintToInt(value);\n }\n return int256(value);\n }\n\n /**\n * @dev Cast a boolean (false or true) to a uint256 (0 or 1) with no jump.\n */\n function toUint(bool b) internal pure returns (uint256 u) {\n assembly (\"memory-safe\") {\n u := iszero(iszero(b))\n }\n }\n}\n" + }, + "@openzeppelin/contracts/utils/math/SignedMath.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/math/SignedMath.sol)\n\npragma solidity ^0.8.20;\n\nimport {SafeCast} from \"./SafeCast.sol\";\n\n/**\n * @dev Standard signed math utilities missing in the Solidity language.\n */\nlibrary SignedMath {\n /**\n * @dev Branchless ternary evaluation for `a ? b : c`. Gas costs are constant.\n *\n * IMPORTANT: This function may reduce bytecode size and consume less gas when used standalone.\n * However, the compiler may optimize Solidity ternary operations (i.e. `a ? b : c`) to only compute\n * one branch when needed, making this function more expensive.\n */\n function ternary(bool condition, int256 a, int256 b) internal pure returns (int256) {\n unchecked {\n // branchless ternary works because:\n // b ^ (a ^ b) == a\n // b ^ 0 == b\n return b ^ ((a ^ b) * int256(SafeCast.toUint(condition)));\n }\n }\n\n /**\n * @dev Returns the largest of two signed numbers.\n */\n function max(int256 a, int256 b) internal pure returns (int256) {\n return ternary(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 ternary(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 // Formula from the \"Bit Twiddling Hacks\" by Sean Eron Anderson.\n // Since `n` is a signed integer, the generated bytecode will use the SAR opcode to perform the right shift,\n // taking advantage of the most significant (or \"sign\" bit) in two's complement representation.\n // This opcode adds new most significant bits set to the value of the previous most significant bit. As a result,\n // the mask will either be `bytes32(0)` (if n is positive) or `~bytes32(0)` (if n is negative).\n int256 mask = n >> 255;\n\n // A `bytes32(0)` mask leaves the input unchanged, while a `~bytes32(0)` mask complements it.\n return uint256((n + mask) ^ mask);\n }\n }\n}\n" + }, + "@openzeppelin/contracts/utils/Nonces.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/Nonces.sol)\npragma solidity ^0.8.20;\n\n/**\n * @dev Provides tracking nonces for addresses. Nonces will only increment.\n */\nabstract contract Nonces {\n /**\n * @dev The nonce used for an `account` is not the expected current nonce.\n */\n error InvalidAccountNonce(address account, uint256 currentNonce);\n\n mapping(address account => uint256) private _nonces;\n\n /**\n * @dev Returns the next unused nonce for an address.\n */\n function nonces(address owner) public view virtual returns (uint256) {\n return _nonces[owner];\n }\n\n /**\n * @dev Consumes a nonce.\n *\n * Returns the current value and increments nonce.\n */\n function _useNonce(address owner) internal virtual returns (uint256) {\n // For each account, the nonce has an initial value of 0, can only be incremented by one, and cannot be\n // decremented or reset. This guarantees that the nonce never overflows.\n unchecked {\n // It is important to do x++ and not ++x here.\n return _nonces[owner]++;\n }\n }\n\n /**\n * @dev Same as {_useNonce} but checking that `nonce` is the next valid for `owner`.\n */\n function _useCheckedNonce(address owner, uint256 nonce) internal virtual {\n uint256 current = _useNonce(owner);\n if (nonce != current) {\n revert InvalidAccountNonce(owner, current);\n }\n }\n}\n" + }, + "@openzeppelin/contracts/utils/Panic.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/Panic.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Helper library for emitting standardized panic codes.\n *\n * ```solidity\n * contract Example {\n * using Panic for uint256;\n *\n * // Use any of the declared internal constants\n * function foo() { Panic.GENERIC.panic(); }\n *\n * // Alternatively\n * function foo() { Panic.panic(Panic.GENERIC); }\n * }\n * ```\n *\n * Follows the list from https://github.com/ethereum/solidity/blob/v0.8.24/libsolutil/ErrorCodes.h[libsolutil].\n *\n * _Available since v5.1._\n */\n// slither-disable-next-line unused-state\nlibrary Panic {\n /// @dev generic / unspecified error\n uint256 internal constant GENERIC = 0x00;\n /// @dev used by the assert() builtin\n uint256 internal constant ASSERT = 0x01;\n /// @dev arithmetic underflow or overflow\n uint256 internal constant UNDER_OVERFLOW = 0x11;\n /// @dev division or modulo by zero\n uint256 internal constant DIVISION_BY_ZERO = 0x12;\n /// @dev enum conversion error\n uint256 internal constant ENUM_CONVERSION_ERROR = 0x21;\n /// @dev invalid encoding in storage\n uint256 internal constant STORAGE_ENCODING_ERROR = 0x22;\n /// @dev empty array pop\n uint256 internal constant EMPTY_ARRAY_POP = 0x31;\n /// @dev array out of bounds access\n uint256 internal constant ARRAY_OUT_OF_BOUNDS = 0x32;\n /// @dev resource error (too large allocation or too large array)\n uint256 internal constant RESOURCE_ERROR = 0x41;\n /// @dev calling invalid internal function\n uint256 internal constant INVALID_INTERNAL_FUNCTION = 0x51;\n\n /// @dev Reverts with a panic code. Recommended to use with\n /// the internal constants with predefined codes.\n function panic(uint256 code) internal pure {\n assembly (\"memory-safe\") {\n mstore(0x00, 0x4e487b71)\n mstore(0x20, code)\n revert(0x1c, 0x24)\n }\n }\n}\n" + }, + "@openzeppelin/contracts/utils/ShortStrings.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/ShortStrings.sol)\n\npragma solidity ^0.8.20;\n\nimport {StorageSlot} from \"./StorageSlot.sol\";\n\n// | string | 0xAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA |\n// | length | 0x BB |\ntype ShortString is bytes32;\n\n/**\n * @dev This library provides functions to convert short memory strings\n * into a `ShortString` type that can be used as an immutable variable.\n *\n * Strings of arbitrary length can be optimized using this library if\n * they are short enough (up to 31 bytes) by packing them with their\n * length (1 byte) in a single EVM word (32 bytes). Additionally, a\n * fallback mechanism can be used for every other case.\n *\n * Usage example:\n *\n * ```solidity\n * contract Named {\n * using ShortStrings for *;\n *\n * ShortString private immutable _name;\n * string private _nameFallback;\n *\n * constructor(string memory contractName) {\n * _name = contractName.toShortStringWithFallback(_nameFallback);\n * }\n *\n * function name() external view returns (string memory) {\n * return _name.toStringWithFallback(_nameFallback);\n * }\n * }\n * ```\n */\nlibrary ShortStrings {\n // Used as an identifier for strings longer than 31 bytes.\n bytes32 private constant FALLBACK_SENTINEL = 0x00000000000000000000000000000000000000000000000000000000000000FF;\n\n error StringTooLong(string str);\n error InvalidShortString();\n\n /**\n * @dev Encode a string of at most 31 chars into a `ShortString`.\n *\n * This will trigger a `StringTooLong` error is the input string is too long.\n */\n function toShortString(string memory str) internal pure returns (ShortString) {\n bytes memory bstr = bytes(str);\n if (bstr.length > 31) {\n revert StringTooLong(str);\n }\n return ShortString.wrap(bytes32(uint256(bytes32(bstr)) | bstr.length));\n }\n\n /**\n * @dev Decode a `ShortString` back to a \"normal\" string.\n */\n function toString(ShortString sstr) internal pure returns (string memory) {\n uint256 len = byteLength(sstr);\n // using `new string(len)` would work locally but is not memory safe.\n string memory str = new string(32);\n assembly (\"memory-safe\") {\n mstore(str, len)\n mstore(add(str, 0x20), sstr)\n }\n return str;\n }\n\n /**\n * @dev Return the length of a `ShortString`.\n */\n function byteLength(ShortString sstr) internal pure returns (uint256) {\n uint256 result = uint256(ShortString.unwrap(sstr)) & 0xFF;\n if (result > 31) {\n revert InvalidShortString();\n }\n return result;\n }\n\n /**\n * @dev Encode a string into a `ShortString`, or write it to storage if it is too long.\n */\n function toShortStringWithFallback(string memory value, string storage store) internal returns (ShortString) {\n if (bytes(value).length < 32) {\n return toShortString(value);\n } else {\n StorageSlot.getStringSlot(store).value = value;\n return ShortString.wrap(FALLBACK_SENTINEL);\n }\n }\n\n /**\n * @dev Decode a string that was encoded to `ShortString` or written to storage using {setWithFallback}.\n */\n function toStringWithFallback(ShortString value, string storage store) internal pure returns (string memory) {\n if (ShortString.unwrap(value) != FALLBACK_SENTINEL) {\n return toString(value);\n } else {\n return store;\n }\n }\n\n /**\n * @dev Return the length of a string that was encoded to `ShortString` or written to storage using\n * {setWithFallback}.\n *\n * WARNING: This will return the \"byte length\" of the string. This may not reflect the actual length in terms of\n * actual characters as the UTF-8 encoding of a single character can span over multiple bytes.\n */\n function byteLengthWithFallback(ShortString value, string storage store) internal view returns (uint256) {\n if (ShortString.unwrap(value) != FALLBACK_SENTINEL) {\n return byteLength(value);\n } else {\n return bytes(store).length;\n }\n }\n}\n" + }, + "@openzeppelin/contracts/utils/StorageSlot.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/StorageSlot.sol)\n// This file was procedurally generated from scripts/generate/templates/StorageSlot.js.\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Library for reading and writing primitive types to specific storage slots.\n *\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\n * This library helps with reading and writing to such slots without the need for inline assembly.\n *\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\n *\n * Example usage to set ERC-1967 implementation slot:\n * ```solidity\n * contract ERC1967 {\n * // Define the slot. Alternatively, use the SlotDerivation library to derive the slot.\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\n *\n * function _getImplementation() internal view returns (address) {\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\n * }\n *\n * function _setImplementation(address newImplementation) internal {\n * require(newImplementation.code.length > 0);\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\n * }\n * }\n * ```\n *\n * TIP: Consider using this library along with {SlotDerivation}.\n */\nlibrary StorageSlot {\n struct AddressSlot {\n address value;\n }\n\n struct BooleanSlot {\n bool value;\n }\n\n struct Bytes32Slot {\n bytes32 value;\n }\n\n struct Uint256Slot {\n uint256 value;\n }\n\n struct Int256Slot {\n int256 value;\n }\n\n struct StringSlot {\n string value;\n }\n\n struct BytesSlot {\n bytes value;\n }\n\n /**\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\n */\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\n assembly (\"memory-safe\") {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns a `BooleanSlot` with member `value` located at `slot`.\n */\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\n assembly (\"memory-safe\") {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns a `Bytes32Slot` with member `value` located at `slot`.\n */\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\n assembly (\"memory-safe\") {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns a `Uint256Slot` with member `value` located at `slot`.\n */\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\n assembly (\"memory-safe\") {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns a `Int256Slot` with member `value` located at `slot`.\n */\n function getInt256Slot(bytes32 slot) internal pure returns (Int256Slot storage r) {\n assembly (\"memory-safe\") {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns a `StringSlot` with member `value` located at `slot`.\n */\n function getStringSlot(bytes32 slot) internal pure returns (StringSlot storage r) {\n assembly (\"memory-safe\") {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `StringSlot` representation of the string storage pointer `store`.\n */\n function getStringSlot(string storage store) internal pure returns (StringSlot storage r) {\n assembly (\"memory-safe\") {\n r.slot := store.slot\n }\n }\n\n /**\n * @dev Returns a `BytesSlot` with member `value` located at `slot`.\n */\n function getBytesSlot(bytes32 slot) internal pure returns (BytesSlot storage r) {\n assembly (\"memory-safe\") {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `BytesSlot` representation of the bytes storage pointer `store`.\n */\n function getBytesSlot(bytes storage store) internal pure returns (BytesSlot storage r) {\n assembly (\"memory-safe\") {\n r.slot := store.slot\n }\n }\n}\n" + }, + "@openzeppelin/contracts/utils/Strings.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/Strings.sol)\n\npragma solidity ^0.8.20;\n\nimport {Math} from \"./math/Math.sol\";\nimport {SignedMath} from \"./math/SignedMath.sol\";\n\n/**\n * @dev String operations.\n */\nlibrary Strings {\n bytes16 private constant HEX_DIGITS = \"0123456789abcdef\";\n uint8 private constant ADDRESS_LENGTH = 20;\n\n /**\n * @dev The `value` string doesn't fit in the specified `length`.\n */\n error StringsInsufficientHexLength(uint256 value, uint256 length);\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 assembly (\"memory-safe\") {\n ptr := add(buffer, add(32, length))\n }\n while (true) {\n ptr--;\n assembly (\"memory-safe\") {\n mstore8(ptr, byte(mod(value, 10), HEX_DIGITS))\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 toStringSigned(int256 value) internal pure returns (string memory) {\n return string.concat(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 uint256 localValue = value;\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] = HEX_DIGITS[localValue & 0xf];\n localValue >>= 4;\n }\n if (localValue != 0) {\n revert StringsInsufficientHexLength(value, length);\n }\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\n * 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 Converts an `address` with fixed length of 20 bytes to its checksummed ASCII `string` hexadecimal\n * representation, according to EIP-55.\n */\n function toChecksumHexString(address addr) internal pure returns (string memory) {\n bytes memory buffer = bytes(toHexString(addr));\n\n // hash the hex part of buffer (skip length + 2 bytes, length 40)\n uint256 hashValue;\n assembly (\"memory-safe\") {\n hashValue := shr(96, keccak256(add(buffer, 0x22), 40))\n }\n\n for (uint256 i = 41; i > 1; --i) {\n // possible values for buffer[i] are 48 (0) to 57 (9) and 97 (a) to 102 (f)\n if (hashValue & 0xf > 7 && uint8(buffer[i]) > 96) {\n // case shift by xoring with 0x20\n buffer[i] ^= 0x20;\n }\n hashValue >>= 4;\n }\n return string(buffer);\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 bytes(a).length == bytes(b).length && keccak256(bytes(a)) == keccak256(bytes(b));\n }\n}\n" + }, + "@openzeppelin/contracts/utils/structs/Checkpoints.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/structs/Checkpoints.sol)\n// This file was procedurally generated from scripts/generate/templates/Checkpoints.js.\n\npragma solidity ^0.8.20;\n\nimport {Math} from \"../math/Math.sol\";\n\n/**\n * @dev This library defines the `Trace*` struct, for checkpointing values as they change at different points in\n * time, and later looking up past values by block number. See {Votes} as an example.\n *\n * To create a history of checkpoints define a variable type `Checkpoints.Trace*` in your contract, and store a new\n * checkpoint for the current transaction block using the {push} function.\n */\nlibrary Checkpoints {\n /**\n * @dev A value was attempted to be inserted on a past checkpoint.\n */\n error CheckpointUnorderedInsertion();\n\n struct Trace224 {\n Checkpoint224[] _checkpoints;\n }\n\n struct Checkpoint224 {\n uint32 _key;\n uint224 _value;\n }\n\n /**\n * @dev Pushes a (`key`, `value`) pair into a Trace224 so that it is stored as the checkpoint.\n *\n * Returns previous value and new value.\n *\n * IMPORTANT: Never accept `key` as a user input, since an arbitrary `type(uint32).max` key set will disable the\n * library.\n */\n function push(\n Trace224 storage self,\n uint32 key,\n uint224 value\n ) internal returns (uint224 oldValue, uint224 newValue) {\n return _insert(self._checkpoints, key, value);\n }\n\n /**\n * @dev Returns the value in the first (oldest) checkpoint with key greater or equal than the search key, or zero if\n * there is none.\n */\n function lowerLookup(Trace224 storage self, uint32 key) internal view returns (uint224) {\n uint256 len = self._checkpoints.length;\n uint256 pos = _lowerBinaryLookup(self._checkpoints, key, 0, len);\n return pos == len ? 0 : _unsafeAccess(self._checkpoints, pos)._value;\n }\n\n /**\n * @dev Returns the value in the last (most recent) checkpoint with key lower or equal than the search key, or zero\n * if there is none.\n */\n function upperLookup(Trace224 storage self, uint32 key) internal view returns (uint224) {\n uint256 len = self._checkpoints.length;\n uint256 pos = _upperBinaryLookup(self._checkpoints, key, 0, len);\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\n }\n\n /**\n * @dev Returns the value in the last (most recent) checkpoint with key lower or equal than the search key, or zero\n * if there is none.\n *\n * NOTE: This is a variant of {upperLookup} that is optimised to find \"recent\" checkpoint (checkpoints with high\n * keys).\n */\n function upperLookupRecent(Trace224 storage self, uint32 key) internal view returns (uint224) {\n uint256 len = self._checkpoints.length;\n\n uint256 low = 0;\n uint256 high = len;\n\n if (len > 5) {\n uint256 mid = len - Math.sqrt(len);\n if (key < _unsafeAccess(self._checkpoints, mid)._key) {\n high = mid;\n } else {\n low = mid + 1;\n }\n }\n\n uint256 pos = _upperBinaryLookup(self._checkpoints, key, low, high);\n\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\n }\n\n /**\n * @dev Returns the value in the most recent checkpoint, or zero if there are no checkpoints.\n */\n function latest(Trace224 storage self) internal view returns (uint224) {\n uint256 pos = self._checkpoints.length;\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\n }\n\n /**\n * @dev Returns whether there is a checkpoint in the structure (i.e. it is not empty), and if so the key and value\n * in the most recent checkpoint.\n */\n function latestCheckpoint(Trace224 storage self) internal view returns (bool exists, uint32 _key, uint224 _value) {\n uint256 pos = self._checkpoints.length;\n if (pos == 0) {\n return (false, 0, 0);\n } else {\n Checkpoint224 storage ckpt = _unsafeAccess(self._checkpoints, pos - 1);\n return (true, ckpt._key, ckpt._value);\n }\n }\n\n /**\n * @dev Returns the number of checkpoint.\n */\n function length(Trace224 storage self) internal view returns (uint256) {\n return self._checkpoints.length;\n }\n\n /**\n * @dev Returns checkpoint at given position.\n */\n function at(Trace224 storage self, uint32 pos) internal view returns (Checkpoint224 memory) {\n return self._checkpoints[pos];\n }\n\n /**\n * @dev Pushes a (`key`, `value`) pair into an ordered list of checkpoints, either by inserting a new checkpoint,\n * or by updating the last one.\n */\n function _insert(\n Checkpoint224[] storage self,\n uint32 key,\n uint224 value\n ) private returns (uint224 oldValue, uint224 newValue) {\n uint256 pos = self.length;\n\n if (pos > 0) {\n Checkpoint224 storage last = _unsafeAccess(self, pos - 1);\n uint32 lastKey = last._key;\n uint224 lastValue = last._value;\n\n // Checkpoint keys must be non-decreasing.\n if (lastKey > key) {\n revert CheckpointUnorderedInsertion();\n }\n\n // Update or push new checkpoint\n if (lastKey == key) {\n last._value = value;\n } else {\n self.push(Checkpoint224({_key: key, _value: value}));\n }\n return (lastValue, value);\n } else {\n self.push(Checkpoint224({_key: key, _value: value}));\n return (0, value);\n }\n }\n\n /**\n * @dev Return the index of the first (oldest) checkpoint with key strictly bigger than the search key, or `high`\n * if there is none. `low` and `high` define a section where to do the search, with inclusive `low` and exclusive\n * `high`.\n *\n * WARNING: `high` should not be greater than the array's length.\n */\n function _upperBinaryLookup(\n Checkpoint224[] storage self,\n uint32 key,\n uint256 low,\n uint256 high\n ) private view returns (uint256) {\n while (low < high) {\n uint256 mid = Math.average(low, high);\n if (_unsafeAccess(self, mid)._key > key) {\n high = mid;\n } else {\n low = mid + 1;\n }\n }\n return high;\n }\n\n /**\n * @dev Return the index of the first (oldest) checkpoint with key greater or equal than the search key, or `high`\n * if there is none. `low` and `high` define a section where to do the search, with inclusive `low` and exclusive\n * `high`.\n *\n * WARNING: `high` should not be greater than the array's length.\n */\n function _lowerBinaryLookup(\n Checkpoint224[] storage self,\n uint32 key,\n uint256 low,\n uint256 high\n ) private view returns (uint256) {\n while (low < high) {\n uint256 mid = Math.average(low, high);\n if (_unsafeAccess(self, mid)._key < key) {\n low = mid + 1;\n } else {\n high = mid;\n }\n }\n return high;\n }\n\n /**\n * @dev Access an element of the array without performing bounds check. The position is assumed to be within bounds.\n */\n function _unsafeAccess(\n Checkpoint224[] storage self,\n uint256 pos\n ) private pure returns (Checkpoint224 storage result) {\n assembly {\n mstore(0, self.slot)\n result.slot := add(keccak256(0, 0x20), pos)\n }\n }\n\n struct Trace208 {\n Checkpoint208[] _checkpoints;\n }\n\n struct Checkpoint208 {\n uint48 _key;\n uint208 _value;\n }\n\n /**\n * @dev Pushes a (`key`, `value`) pair into a Trace208 so that it is stored as the checkpoint.\n *\n * Returns previous value and new value.\n *\n * IMPORTANT: Never accept `key` as a user input, since an arbitrary `type(uint48).max` key set will disable the\n * library.\n */\n function push(\n Trace208 storage self,\n uint48 key,\n uint208 value\n ) internal returns (uint208 oldValue, uint208 newValue) {\n return _insert(self._checkpoints, key, value);\n }\n\n /**\n * @dev Returns the value in the first (oldest) checkpoint with key greater or equal than the search key, or zero if\n * there is none.\n */\n function lowerLookup(Trace208 storage self, uint48 key) internal view returns (uint208) {\n uint256 len = self._checkpoints.length;\n uint256 pos = _lowerBinaryLookup(self._checkpoints, key, 0, len);\n return pos == len ? 0 : _unsafeAccess(self._checkpoints, pos)._value;\n }\n\n /**\n * @dev Returns the value in the last (most recent) checkpoint with key lower or equal than the search key, or zero\n * if there is none.\n */\n function upperLookup(Trace208 storage self, uint48 key) internal view returns (uint208) {\n uint256 len = self._checkpoints.length;\n uint256 pos = _upperBinaryLookup(self._checkpoints, key, 0, len);\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\n }\n\n /**\n * @dev Returns the value in the last (most recent) checkpoint with key lower or equal than the search key, or zero\n * if there is none.\n *\n * NOTE: This is a variant of {upperLookup} that is optimised to find \"recent\" checkpoint (checkpoints with high\n * keys).\n */\n function upperLookupRecent(Trace208 storage self, uint48 key) internal view returns (uint208) {\n uint256 len = self._checkpoints.length;\n\n uint256 low = 0;\n uint256 high = len;\n\n if (len > 5) {\n uint256 mid = len - Math.sqrt(len);\n if (key < _unsafeAccess(self._checkpoints, mid)._key) {\n high = mid;\n } else {\n low = mid + 1;\n }\n }\n\n uint256 pos = _upperBinaryLookup(self._checkpoints, key, low, high);\n\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\n }\n\n /**\n * @dev Returns the value in the most recent checkpoint, or zero if there are no checkpoints.\n */\n function latest(Trace208 storage self) internal view returns (uint208) {\n uint256 pos = self._checkpoints.length;\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\n }\n\n /**\n * @dev Returns whether there is a checkpoint in the structure (i.e. it is not empty), and if so the key and value\n * in the most recent checkpoint.\n */\n function latestCheckpoint(Trace208 storage self) internal view returns (bool exists, uint48 _key, uint208 _value) {\n uint256 pos = self._checkpoints.length;\n if (pos == 0) {\n return (false, 0, 0);\n } else {\n Checkpoint208 storage ckpt = _unsafeAccess(self._checkpoints, pos - 1);\n return (true, ckpt._key, ckpt._value);\n }\n }\n\n /**\n * @dev Returns the number of checkpoint.\n */\n function length(Trace208 storage self) internal view returns (uint256) {\n return self._checkpoints.length;\n }\n\n /**\n * @dev Returns checkpoint at given position.\n */\n function at(Trace208 storage self, uint32 pos) internal view returns (Checkpoint208 memory) {\n return self._checkpoints[pos];\n }\n\n /**\n * @dev Pushes a (`key`, `value`) pair into an ordered list of checkpoints, either by inserting a new checkpoint,\n * or by updating the last one.\n */\n function _insert(\n Checkpoint208[] storage self,\n uint48 key,\n uint208 value\n ) private returns (uint208 oldValue, uint208 newValue) {\n uint256 pos = self.length;\n\n if (pos > 0) {\n Checkpoint208 storage last = _unsafeAccess(self, pos - 1);\n uint48 lastKey = last._key;\n uint208 lastValue = last._value;\n\n // Checkpoint keys must be non-decreasing.\n if (lastKey > key) {\n revert CheckpointUnorderedInsertion();\n }\n\n // Update or push new checkpoint\n if (lastKey == key) {\n last._value = value;\n } else {\n self.push(Checkpoint208({_key: key, _value: value}));\n }\n return (lastValue, value);\n } else {\n self.push(Checkpoint208({_key: key, _value: value}));\n return (0, value);\n }\n }\n\n /**\n * @dev Return the index of the first (oldest) checkpoint with key strictly bigger than the search key, or `high`\n * if there is none. `low` and `high` define a section where to do the search, with inclusive `low` and exclusive\n * `high`.\n *\n * WARNING: `high` should not be greater than the array's length.\n */\n function _upperBinaryLookup(\n Checkpoint208[] storage self,\n uint48 key,\n uint256 low,\n uint256 high\n ) private view returns (uint256) {\n while (low < high) {\n uint256 mid = Math.average(low, high);\n if (_unsafeAccess(self, mid)._key > key) {\n high = mid;\n } else {\n low = mid + 1;\n }\n }\n return high;\n }\n\n /**\n * @dev Return the index of the first (oldest) checkpoint with key greater or equal than the search key, or `high`\n * if there is none. `low` and `high` define a section where to do the search, with inclusive `low` and exclusive\n * `high`.\n *\n * WARNING: `high` should not be greater than the array's length.\n */\n function _lowerBinaryLookup(\n Checkpoint208[] storage self,\n uint48 key,\n uint256 low,\n uint256 high\n ) private view returns (uint256) {\n while (low < high) {\n uint256 mid = Math.average(low, high);\n if (_unsafeAccess(self, mid)._key < key) {\n low = mid + 1;\n } else {\n high = mid;\n }\n }\n return high;\n }\n\n /**\n * @dev Access an element of the array without performing bounds check. The position is assumed to be within bounds.\n */\n function _unsafeAccess(\n Checkpoint208[] storage self,\n uint256 pos\n ) private pure returns (Checkpoint208 storage result) {\n assembly {\n mstore(0, self.slot)\n result.slot := add(keccak256(0, 0x20), pos)\n }\n }\n\n struct Trace160 {\n Checkpoint160[] _checkpoints;\n }\n\n struct Checkpoint160 {\n uint96 _key;\n uint160 _value;\n }\n\n /**\n * @dev Pushes a (`key`, `value`) pair into a Trace160 so that it is stored as the checkpoint.\n *\n * Returns previous value and new value.\n *\n * IMPORTANT: Never accept `key` as a user input, since an arbitrary `type(uint96).max` key set will disable the\n * library.\n */\n function push(\n Trace160 storage self,\n uint96 key,\n uint160 value\n ) internal returns (uint160 oldValue, uint160 newValue) {\n return _insert(self._checkpoints, key, value);\n }\n\n /**\n * @dev Returns the value in the first (oldest) checkpoint with key greater or equal than the search key, or zero if\n * there is none.\n */\n function lowerLookup(Trace160 storage self, uint96 key) internal view returns (uint160) {\n uint256 len = self._checkpoints.length;\n uint256 pos = _lowerBinaryLookup(self._checkpoints, key, 0, len);\n return pos == len ? 0 : _unsafeAccess(self._checkpoints, pos)._value;\n }\n\n /**\n * @dev Returns the value in the last (most recent) checkpoint with key lower or equal than the search key, or zero\n * if there is none.\n */\n function upperLookup(Trace160 storage self, uint96 key) internal view returns (uint160) {\n uint256 len = self._checkpoints.length;\n uint256 pos = _upperBinaryLookup(self._checkpoints, key, 0, len);\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\n }\n\n /**\n * @dev Returns the value in the last (most recent) checkpoint with key lower or equal than the search key, or zero\n * if there is none.\n *\n * NOTE: This is a variant of {upperLookup} that is optimised to find \"recent\" checkpoint (checkpoints with high\n * keys).\n */\n function upperLookupRecent(Trace160 storage self, uint96 key) internal view returns (uint160) {\n uint256 len = self._checkpoints.length;\n\n uint256 low = 0;\n uint256 high = len;\n\n if (len > 5) {\n uint256 mid = len - Math.sqrt(len);\n if (key < _unsafeAccess(self._checkpoints, mid)._key) {\n high = mid;\n } else {\n low = mid + 1;\n }\n }\n\n uint256 pos = _upperBinaryLookup(self._checkpoints, key, low, high);\n\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\n }\n\n /**\n * @dev Returns the value in the most recent checkpoint, or zero if there are no checkpoints.\n */\n function latest(Trace160 storage self) internal view returns (uint160) {\n uint256 pos = self._checkpoints.length;\n return pos == 0 ? 0 : _unsafeAccess(self._checkpoints, pos - 1)._value;\n }\n\n /**\n * @dev Returns whether there is a checkpoint in the structure (i.e. it is not empty), and if so the key and value\n * in the most recent checkpoint.\n */\n function latestCheckpoint(Trace160 storage self) internal view returns (bool exists, uint96 _key, uint160 _value) {\n uint256 pos = self._checkpoints.length;\n if (pos == 0) {\n return (false, 0, 0);\n } else {\n Checkpoint160 storage ckpt = _unsafeAccess(self._checkpoints, pos - 1);\n return (true, ckpt._key, ckpt._value);\n }\n }\n\n /**\n * @dev Returns the number of checkpoint.\n */\n function length(Trace160 storage self) internal view returns (uint256) {\n return self._checkpoints.length;\n }\n\n /**\n * @dev Returns checkpoint at given position.\n */\n function at(Trace160 storage self, uint32 pos) internal view returns (Checkpoint160 memory) {\n return self._checkpoints[pos];\n }\n\n /**\n * @dev Pushes a (`key`, `value`) pair into an ordered list of checkpoints, either by inserting a new checkpoint,\n * or by updating the last one.\n */\n function _insert(\n Checkpoint160[] storage self,\n uint96 key,\n uint160 value\n ) private returns (uint160 oldValue, uint160 newValue) {\n uint256 pos = self.length;\n\n if (pos > 0) {\n Checkpoint160 storage last = _unsafeAccess(self, pos - 1);\n uint96 lastKey = last._key;\n uint160 lastValue = last._value;\n\n // Checkpoint keys must be non-decreasing.\n if (lastKey > key) {\n revert CheckpointUnorderedInsertion();\n }\n\n // Update or push new checkpoint\n if (lastKey == key) {\n last._value = value;\n } else {\n self.push(Checkpoint160({_key: key, _value: value}));\n }\n return (lastValue, value);\n } else {\n self.push(Checkpoint160({_key: key, _value: value}));\n return (0, value);\n }\n }\n\n /**\n * @dev Return the index of the first (oldest) checkpoint with key strictly bigger than the search key, or `high`\n * if there is none. `low` and `high` define a section where to do the search, with inclusive `low` and exclusive\n * `high`.\n *\n * WARNING: `high` should not be greater than the array's length.\n */\n function _upperBinaryLookup(\n Checkpoint160[] storage self,\n uint96 key,\n uint256 low,\n uint256 high\n ) private view returns (uint256) {\n while (low < high) {\n uint256 mid = Math.average(low, high);\n if (_unsafeAccess(self, mid)._key > key) {\n high = mid;\n } else {\n low = mid + 1;\n }\n }\n return high;\n }\n\n /**\n * @dev Return the index of the first (oldest) checkpoint with key greater or equal than the search key, or `high`\n * if there is none. `low` and `high` define a section where to do the search, with inclusive `low` and exclusive\n * `high`.\n *\n * WARNING: `high` should not be greater than the array's length.\n */\n function _lowerBinaryLookup(\n Checkpoint160[] storage self,\n uint96 key,\n uint256 low,\n uint256 high\n ) private view returns (uint256) {\n while (low < high) {\n uint256 mid = Math.average(low, high);\n if (_unsafeAccess(self, mid)._key < key) {\n low = mid + 1;\n } else {\n high = mid;\n }\n }\n return high;\n }\n\n /**\n * @dev Access an element of the array without performing bounds check. The position is assumed to be within bounds.\n */\n function _unsafeAccess(\n Checkpoint160[] storage self,\n uint256 pos\n ) private pure returns (Checkpoint160 storage result) {\n assembly {\n mstore(0, self.slot)\n result.slot := add(keccak256(0, 0x20), pos)\n }\n }\n}\n" + }, + "@openzeppelin/contracts/utils/types/Time.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/types/Time.sol)\n\npragma solidity ^0.8.20;\n\nimport {Math} from \"../math/Math.sol\";\nimport {SafeCast} from \"../math/SafeCast.sol\";\n\n/**\n * @dev This library provides helpers for manipulating time-related objects.\n *\n * It uses the following types:\n * - `uint48` for timepoints\n * - `uint32` for durations\n *\n * While the library doesn't provide specific types for timepoints and duration, it does provide:\n * - a `Delay` type to represent duration that can be programmed to change value automatically at a given point\n * - additional helper functions\n */\nlibrary Time {\n using Time for *;\n\n /**\n * @dev Get the block timestamp as a Timepoint.\n */\n function timestamp() internal view returns (uint48) {\n return SafeCast.toUint48(block.timestamp);\n }\n\n /**\n * @dev Get the block number as a Timepoint.\n */\n function blockNumber() internal view returns (uint48) {\n return SafeCast.toUint48(block.number);\n }\n\n // ==================================================== Delay =====================================================\n /**\n * @dev A `Delay` is a uint32 duration that can be programmed to change value automatically at a given point in the\n * future. The \"effect\" timepoint describes when the transitions happens from the \"old\" value to the \"new\" value.\n * This allows updating the delay applied to some operation while keeping some guarantees.\n *\n * In particular, the {update} function guarantees that if the delay is reduced, the old delay still applies for\n * some time. For example if the delay is currently 7 days to do an upgrade, the admin should not be able to set\n * the delay to 0 and upgrade immediately. If the admin wants to reduce the delay, the old delay (7 days) should\n * still apply for some time.\n *\n *\n * The `Delay` type is 112 bits long, and packs the following:\n *\n * ```\n * | [uint48]: effect date (timepoint)\n * | | [uint32]: value before (duration)\n * ↓ ↓ ↓ [uint32]: value after (duration)\n * 0xAAAAAAAAAAAABBBBBBBBCCCCCCCC\n * ```\n *\n * NOTE: The {get} and {withUpdate} functions operate using timestamps. Block number based delays are not currently\n * supported.\n */\n type Delay is uint112;\n\n /**\n * @dev Wrap a duration into a Delay to add the one-step \"update in the future\" feature\n */\n function toDelay(uint32 duration) internal pure returns (Delay) {\n return Delay.wrap(duration);\n }\n\n /**\n * @dev Get the value at a given timepoint plus the pending value and effect timepoint if there is a scheduled\n * change after this timepoint. If the effect timepoint is 0, then the pending value should not be considered.\n */\n function _getFullAt(\n Delay self,\n uint48 timepoint\n ) private pure returns (uint32 valueBefore, uint32 valueAfter, uint48 effect) {\n (valueBefore, valueAfter, effect) = self.unpack();\n return effect <= timepoint ? (valueAfter, 0, 0) : (valueBefore, valueAfter, effect);\n }\n\n /**\n * @dev Get the current value plus the pending value and effect timepoint if there is a scheduled change. If the\n * effect timepoint is 0, then the pending value should not be considered.\n */\n function getFull(Delay self) internal view returns (uint32 valueBefore, uint32 valueAfter, uint48 effect) {\n return _getFullAt(self, timestamp());\n }\n\n /**\n * @dev Get the current value.\n */\n function get(Delay self) internal view returns (uint32) {\n (uint32 delay, , ) = self.getFull();\n return delay;\n }\n\n /**\n * @dev Update a Delay object so that it takes a new duration after a timepoint that is automatically computed to\n * enforce the old delay at the moment of the update. Returns the updated Delay object and the timestamp when the\n * new delay becomes effective.\n */\n function withUpdate(\n Delay self,\n uint32 newValue,\n uint32 minSetback\n ) internal view returns (Delay updatedDelay, uint48 effect) {\n uint32 value = self.get();\n uint32 setback = uint32(Math.max(minSetback, value > newValue ? value - newValue : 0));\n effect = timestamp() + setback;\n return (pack(value, newValue, effect), effect);\n }\n\n /**\n * @dev Split a delay into its components: valueBefore, valueAfter and effect (transition timepoint).\n */\n function unpack(Delay self) internal pure returns (uint32 valueBefore, uint32 valueAfter, uint48 effect) {\n uint112 raw = Delay.unwrap(self);\n\n valueAfter = uint32(raw);\n valueBefore = uint32(raw >> 32);\n effect = uint48(raw >> 64);\n\n return (valueBefore, valueAfter, effect);\n }\n\n /**\n * @dev pack the components into a Delay object.\n */\n function pack(uint32 valueBefore, uint32 valueAfter, uint48 effect) internal pure returns (Delay) {\n return Delay.wrap((uint112(effect) << 64) | (uint112(valueBefore) << 32) | uint112(valueAfter));\n }\n}\n" + }, + "contracts/variants/crosschain/NFT.sol": { + "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity ^0.8.20;\n\nimport \"@openzeppelin/contracts/token/ERC721/ERC721.sol\";\nimport \"@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol\";\nimport \"@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol\";\nimport \"@openzeppelin/contracts/token/ERC721/extensions/ERC721Burnable.sol\";\nimport \"@openzeppelin/contracts/access/Ownable.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/EIP712.sol\";\nimport \"@openzeppelin/contracts/token/ERC721/extensions/ERC721Votes.sol\";\nimport \"./ProofHandler.sol\";\n\n/**\n * @title Cross-chain Membership NFT Contract\n * @author Web3 Hackers Collective\n * @notice Non-transferable NFT implementation for DAO membership with cross-chain capabilities\n * @dev Extends OpenZeppelin's NFT standards with cross-chain operation support and delegation\n * @custom:security-contact julien@strat.cc\n */\ncontract NFT is\n ERC721,\n ERC721Enumerable,\n ERC721URIStorage,\n ERC721Burnable,\n Ownable,\n EIP712,\n ERC721Votes\n{\n using ProofHandler for ProofHandler.ProofStorage;\n\n /// @notice Chain ID where contract was originally deployed\n uint256 public immutable home;\n\n /// @notice Next token ID to be minted\n uint256 private _nextTokenId;\n\n /// @notice Storage for proof handling\n ProofHandler.ProofStorage private _proofStorage;\n\n /// @notice Types of operations that can be synchronized across chains\n enum OperationType {\n MINT,\n BURN,\n SET_METADATA,\n DELEGATE\n }\n\n /// @notice Emitted when a membership is claimed\n /// @param tokenId The ID of the claimed token\n /// @param member The address receiving the membership\n /// @param nonce Operation sequence number\n event MembershipClaimed(uint256 indexed tokenId, address indexed member, uint256 nonce);\n\n /// @notice Emitted when a membership is revoked\n /// @param tokenId The ID of the revoked token\n /// @param member The address losing membership\n /// @param nonce Operation sequence number\n event MembershipRevoked(uint256 indexed tokenId, address indexed member, uint256 nonce);\n\n /// @notice Emitted when metadata is updated\n /// @param tokenId The ID of the updated token\n /// @param newUri The new metadata URI\n /// @param nonce Operation sequence number\n event MetadataUpdated(uint256 indexed tokenId, string newUri, uint256 nonce);\n\n /// @notice Emitted when delegation is synchronized across chains\n /// @param delegator The address delegating their voting power\n /// @param delegatee The address receiving the delegation\n /// @param nonce Operation sequence number\n event DelegationSynced(address indexed delegator, address indexed delegatee, uint256 nonce);\n\n /// @notice Restricts functions to home chain\n modifier onlyHomeChain() {\n require(block.chainid == home, \"Operation only allowed on home chain\");\n _;\n }\n\n /**\n * @notice Initializes the NFT contract\n * @param _home Chain ID where contract is considered home\n * @param initialOwner Initial contract owner\n * @param _firstMembers Array of initial member addresses\n * @param _uri Initial token URI\n * @param _name Token collection name\n * @param _symbol Token collection symbol\n */\n constructor(\n uint256 _home,\n address initialOwner,\n address[] memory _firstMembers,\n string memory _uri,\n string memory _name,\n string memory _symbol\n ) ERC721(_name, _symbol) Ownable(initialOwner) EIP712(_name, \"1\") {\n home = _home;\n for (uint i; i < _firstMembers.length; i++) {\n _govMint(_firstMembers[i], _uri);\n _delegate(_firstMembers[i], _firstMembers[i]);\n }\n }\n\n /**\n * @notice Adds a new member on home chain\n * @dev Only callable by owner (governance) on home chain\n * @param to Address to mint token to\n * @param uri Token metadata URI\n */\n function safeMint(address to, string memory uri) public onlyOwner onlyHomeChain {\n uint256 nonce = _proofStorage.incrementNonce(uint8(OperationType.MINT));\n _govMint(to, uri);\n emit MembershipClaimed(_nextTokenId - 1, to, nonce);\n }\n\n /**\n * @notice Burns token on home chain\n * @dev Only callable by owner (governance) on home chain\n * @param tokenId ID of token to burn\n */\n function govBurn(uint256 tokenId) public onlyOwner onlyHomeChain {\n uint256 nonce = _proofStorage.incrementNonce(uint8(OperationType.BURN));\n address owner = ownerOf(tokenId);\n _burn(tokenId);\n emit MembershipRevoked(tokenId, owner, nonce);\n }\n\n /**\n * @notice Updates token metadata on home chain\n * @dev Only callable by owner (governance) on home chain\n * @param tokenId ID of token to update\n * @param uri New metadata URI\n */\n function setMetadata(uint256 tokenId, string memory uri) public onlyOwner onlyHomeChain {\n uint256 nonce = _proofStorage.incrementNonce(uint8(OperationType.SET_METADATA));\n _setTokenURI(tokenId, uri);\n emit MetadataUpdated(tokenId, uri, nonce);\n }\n\n /**\n * @notice Delegates voting power to another address on home chain\n * @dev Overrides ERC721Votes delegate function to add cross-chain functionality\n * @param delegatee Address to delegate voting power to\n */\n function delegate(address delegatee) public virtual override onlyHomeChain {\n uint256 nonce = _proofStorage.incrementNonce(uint8(OperationType.DELEGATE));\n _delegate(_msgSender(), delegatee);\n emit DelegationSynced(_msgSender(), delegatee, nonce);\n }\n\n /**\n * @notice Generates proof for NFT operations\n * @dev Only callable on home chain\n * @param operationType Type of operation\n * @param params Operation parameters\n * @return Encoded proof data\n */\n function generateOperationProof(\n uint8 operationType,\n bytes memory params\n ) external view returns (bytes memory) {\n require(block.chainid == home, \"Proofs only generated on home chain\");\n uint256 nextNonce = _proofStorage.getNextNonce(operationType);\n return ProofHandler.generateProof(address(this), operationType, params, nextNonce);\n }\n\n /**\n * @notice Generates proof for delegation\n * @dev Only callable on home chain\n * @param delegator Address delegating voting power\n * @param delegatee Address receiving delegation\n * @return Encoded proof data\n */\n function generateDelegationProof(\n address delegator,\n address delegatee\n ) external view returns (bytes memory) {\n require(block.chainid == home, \"Proofs only generated on home chain\");\n uint256 nextNonce = _proofStorage.getNextNonce(uint8(OperationType.DELEGATE));\n bytes memory params = abi.encode(delegator, delegatee);\n return\n ProofHandler.generateProof(\n address(this),\n uint8(OperationType.DELEGATE),\n params,\n nextNonce\n );\n }\n\n // Claim operations\n\n /**\n * @notice Claims an NFT operation on a foreign chain\n * @param proof Proof generated by home chain\n */\n function claimOperation(bytes memory proof) external {\n (uint8 operationType, bytes memory params, uint256 nonce) = ProofHandler\n .verifyAndClaimProof(proof, address(this), _proofStorage);\n\n if (operationType == uint8(OperationType.MINT)) {\n (address to, string memory uri) = abi.decode(params, (address, string));\n _govMint(to, uri);\n emit MembershipClaimed(_nextTokenId - 1, to, nonce);\n } else if (operationType == uint8(OperationType.BURN)) {\n uint256 tokenId = abi.decode(params, (uint256));\n address owner = ownerOf(tokenId);\n _burn(tokenId);\n emit MembershipRevoked(tokenId, owner, nonce);\n } else if (operationType == uint8(OperationType.SET_METADATA)) {\n (uint256 tokenId, string memory uri) = abi.decode(params, (uint256, string));\n _setTokenURI(tokenId, uri);\n emit MetadataUpdated(tokenId, uri, nonce);\n } else if (operationType == uint8(OperationType.DELEGATE)) {\n (address delegator, address delegatee) = abi.decode(params, (address, address));\n _delegate(delegator, delegatee);\n emit DelegationSynced(delegator, delegatee, nonce);\n }\n }\n\n /**\n * @notice Claims a delegation operation on a foreign chain\n * @param proof Proof generated by home chain\n */\n function claimDelegation(bytes memory proof) external {\n (uint8 operationType, bytes memory params, uint256 nonce) = ProofHandler\n .verifyAndClaimProof(proof, address(this), _proofStorage);\n\n require(operationType == uint8(OperationType.DELEGATE), \"Invalid operation type\");\n (address delegator, address delegatee) = abi.decode(params, (address, address));\n\n _delegate(delegator, delegatee);\n emit DelegationSynced(delegator, delegatee, nonce);\n }\n\n /**\n * @notice Internal function for minting without proof verification\n * @param to Address to receive token\n * @param uri Token metadata URI\n */\n function _govMint(address to, string memory uri) internal {\n uint256 tokenId = _nextTokenId++;\n _safeMint(to, tokenId);\n _setTokenURI(tokenId, uri);\n _delegate(to, to);\n }\n\n // Required overrides\n\n /**\n * @notice Updates token data\n * @dev Overrides ERC721 _update to make NFTs non-transferable\n * @param to Recipient address\n * @param tokenId Token ID\n * @param auth Address authorized for transfer\n * @return Previous owner address\n */\n function _update(\n address to,\n uint256 tokenId,\n address auth\n ) internal override(ERC721, ERC721Enumerable, ERC721Votes) returns (address) {\n require(auth == address(0) || to == address(0), \"NFT is not transferable\");\n return super._update(to, tokenId, auth);\n }\n\n /**\n * @notice Increments account balance\n * @dev Internal override to maintain compatibility\n * @param account Account to update\n * @param value Amount to increase by\n */\n function _increaseBalance(\n address account,\n uint128 value\n ) internal override(ERC721, ERC721Enumerable, ERC721Votes) {\n super._increaseBalance(account, value);\n }\n\n /**\n * @notice Gets token URI\n * @param tokenId Token ID to query\n * @return URI string\n */\n function tokenURI(\n uint256 tokenId\n ) public view override(ERC721, ERC721URIStorage) returns (string memory) {\n return super.tokenURI(tokenId);\n }\n\n /**\n * @notice Checks interface support\n * @param interfaceId Interface identifier to check\n * @return bool True if interface is supported\n */\n function supportsInterface(\n bytes4 interfaceId\n ) public view override(ERC721, ERC721Enumerable, ERC721URIStorage) returns (bool) {\n return super.supportsInterface(interfaceId);\n }\n\n /**\n * @notice Gets current timestamp\n * @dev Used for voting snapshots\n * @return Current block timestamp\n */\n function clock() public view override returns (uint48) {\n return uint48(block.timestamp);\n }\n\n /**\n * @notice Gets clock mode description\n * @return String indicating timestamp-based voting\n */\n function CLOCK_MODE() public pure override returns (string memory) {\n return \"mode=timestamp\";\n }\n}\n" + }, + "contracts/variants/crosschain/ProofHandler.sol": { + "content": "// SPDX-License-Identifier: GPL-3.0\npragma solidity ^0.8.20;\n\n/**\n * @title Proof Handler Library\n * @author Web3 Hackers Collective\n * @notice Library for standardized cross-chain proof generation and verification\n * @dev Handles proof generation, verification, and tracking for cross-chain operations\n * @custom:security-contact julien@strat.cc\n */\nlibrary ProofHandler {\n /// @notice Tracks which proofs have been applied on each chain\n struct ProofStorage {\n mapping(bytes32 => bool) updateAppliedOnChain;\n mapping(uint8 => uint256) currentNonce;\n }\n\n /// @dev Emitted when a proof is claimed\n event ProofClaimed(uint8 indexed operationType, bytes params, uint256 nonce);\n\n /**\n * @notice Generates a proof for cross-chain operations\n * @param contractAddress Address of contract generating the proof\n * @param operationType Type of operation being performed\n * @param params Operation parameters\n * @param nonce Current nonce for this operation type\n * @return proof Encoded proof data\n */\n function generateProof(\n address contractAddress,\n uint8 operationType,\n bytes memory params,\n uint256 nonce\n ) public pure returns (bytes memory proof) {\n bytes32 message = keccak256(\n abi.encodePacked(contractAddress, operationType, params, nonce)\n );\n bytes32 digest = keccak256(abi.encodePacked(\"\\x19Ethereum Signed Message:\\n32\", message));\n\n return abi.encode(operationType, params, nonce, digest);\n }\n\n /**\n * @notice Verifies and claims a proof\n * @param proof Proof to verify and claim\n * @param contractAddress Address of contract claiming the proof\n * @param storage_ Proof storage struct\n * @return operationType The type of operation being performed\n * @return params The operation parameters\n * @return nonce The operation sequence number\n */\n function verifyAndClaimProof(\n bytes memory proof,\n address contractAddress,\n ProofStorage storage storage_\n ) public returns (uint8 operationType, bytes memory params, uint256 nonce) {\n bytes32 digest;\n (operationType, params, nonce, digest) = abi.decode(\n proof,\n (uint8, bytes, uint256, bytes32)\n );\n\n bytes32 proofHash = keccak256(proof);\n require(!storage_.updateAppliedOnChain[proofHash], \"Proof already claimed\");\n require(nonce == storage_.currentNonce[operationType] + 1, \"Invalid nonce\");\n\n bytes32 message = keccak256(\n abi.encodePacked(contractAddress, operationType, params, nonce)\n );\n bytes32 expectedDigest = keccak256(\n abi.encodePacked(\"\\x19Ethereum Signed Message:\\n32\", message)\n );\n require(digest == expectedDigest, \"Invalid proof\");\n\n storage_.updateAppliedOnChain[proofHash] = true;\n storage_.currentNonce[operationType] = nonce;\n\n emit ProofClaimed(operationType, params, nonce);\n\n return (operationType, params, nonce);\n }\n\n /**\n * @notice Gets the next nonce for an operation type\n * @param storage_ Proof storage struct\n * @param operationType Type of operation\n * @return nonce Next nonce value\n */\n function getNextNonce(\n ProofStorage storage storage_,\n uint8 operationType\n ) public view returns (uint256 nonce) {\n return storage_.currentNonce[operationType] + 1;\n }\n\n /**\n * @notice Increments the nonce for an operation type\n * @param storage_ Proof storage struct\n * @param operationType Type of operation\n * @return nonce New nonce value\n */\n function incrementNonce(\n ProofStorage storage storage_,\n uint8 operationType\n ) public returns (uint256 nonce) {\n storage_.currentNonce[operationType]++;\n return storage_.currentNonce[operationType];\n }\n}\n" + } + }, + "settings": { + "optimizer": { + "enabled": true, + "runs": 200 + }, + "evmVersion": "paris", + "outputSelection": { + "*": { + "*": [ + "abi", + "evm.bytecode", + "evm.deployedBytecode", + "evm.methodIdentifiers", + "metadata", + "devdoc", + "userdoc", + "storageLayout", + "evm.gasEstimates" + ], + "": [ + "ast" + ] + } + }, + "metadata": { + "useLiteralContent": true + } + } +} \ No newline at end of file diff --git a/hardhat.config.ts b/hardhat.config.ts index 860c1e7..f01dcab 100644 --- a/hardhat.config.ts +++ b/hardhat.config.ts @@ -11,10 +11,13 @@ const { OP_ETHERSCAN_API_KEY, BASE_MAINNET_RPC_ENDPOINT_URL, BASE_ETHERSCAN_API_KEY, + ARBITRUM_MAINNET_RPC_ENDPOINT_URL, + ARBITRUM_ETHERSCAN_API_KEY, SEPOLIA_RPC_ENDPOINT_URL, ETHERSCAN_API_KEY, OP_SEPOLIA_RPC_ENDPOINT_URL, - BASE_SEPOLIA_RPC_ENDPOINT_URL + BASE_SEPOLIA_RPC_ENDPOINT_URL, + ARBITRUM_SEPOLIA_RPC_ENDPOINT_URL } = process.env const config: HardhatUserConfig = { @@ -49,7 +52,15 @@ const config: HardhatUserConfig = { accounts: SIGNER_PRIVATE_KEY !== undefined ? [SIGNER_PRIVATE_KEY] : [] }, - "op-sepolia": { + arbitrum: { + chainId: 42161, + url: + ARBITRUM_MAINNET_RPC_ENDPOINT_URL || + "https://endpoints.omniatech.io/v1/arbitrum/one/public", + accounts: + SIGNER_PRIVATE_KEY !== undefined ? [SIGNER_PRIVATE_KEY] : [] + }, + opSepolia: { chainId: 11155420, url: OP_SEPOLIA_RPC_ENDPOINT_URL || @@ -57,11 +68,19 @@ const config: HardhatUserConfig = { accounts: SIGNER_PRIVATE_KEY !== undefined ? [SIGNER_PRIVATE_KEY] : [] }, - "base-sepolia": { + baseSepolia: { chainId: 84532, url: BASE_SEPOLIA_RPC_ENDPOINT_URL || "https://sepolia.base.org", accounts: SIGNER_PRIVATE_KEY !== undefined ? [SIGNER_PRIVATE_KEY] : [] + }, + arbitrumSepolia: { + chainId: 421614, + url: + ARBITRUM_SEPOLIA_RPC_ENDPOINT_URL || + "https://sepolia-rollup.arbitrum.io/rpc", + accounts: + SIGNER_PRIVATE_KEY !== undefined ? [SIGNER_PRIVATE_KEY] : [] } }, solidity: { @@ -80,14 +99,16 @@ const config: HardhatUserConfig = { apiKey: { optimism: OP_ETHERSCAN_API_KEY || "", base: BASE_ETHERSCAN_API_KEY || "", + arbitrum: ARBITRUM_ETHERSCAN_API_KEY || "", sepolia: ETHERSCAN_API_KEY || "", optimisticEthereum: OP_ETHERSCAN_API_KEY || "", - "op-sepolia": OP_ETHERSCAN_API_KEY || "", - "base-sepolia": BASE_ETHERSCAN_API_KEY || "" + opSepolia: OP_ETHERSCAN_API_KEY || "", + baseSepolia: BASE_ETHERSCAN_API_KEY || "", + arbitrumSepolia: ARBITRUM_ETHERSCAN_API_KEY || "" }, customChains: [ { - network: "op-sepolia", + network: "opSepolia", chainId: 11155420, urls: { apiURL: "https://api-sepolia-optimistic.etherscan.io/api", @@ -95,7 +116,7 @@ const config: HardhatUserConfig = { } }, { - network: "base-sepolia", + network: "baseSepolia", chainId: 84532, urls: { apiURL: "https://api-sepolia.basescan.org/api", diff --git a/package.json b/package.json index 18fab1a..9816869 100644 --- a/package.json +++ b/package.json @@ -10,10 +10,13 @@ "deploy:optimism": "hardhat deploy --network optimism --reset", "deploy:base": "hardhat deploy --network base --reset", "deploy:sepolia": "hardhat deploy --network sepolia --reset", - "deploy:op-sepolia": "hardhat deploy --network op-sepolia --reset", - "deploy:base-sepolia": "hardhat deploy --network base-sepolia --reset", + "deploy:opSepolia": "hardhat deploy --network opSepolia --reset", + "deploy:baseSepolia": "hardhat deploy --network baseSepolia --reset", + "deploy:arbitrum-sepolia": "hardhat deploy --network arbitrum-sepolia --reset", "crosschain:sepolia": "hardhat deploy --network sepolia --tags CrosschainGov --reset", - "crosschain:op-sepolia": "hardhat deploy --network op-sepolia --tags CrosschainGov --reset", + "crosschain:opSepolia": "hardhat deploy --network opSepolia --tags CrosschainGov --reset", + "crosschain:baseSepolia": "hardhat deploy --network baseSepolia --tags CrosschainGov --reset", + "crosschain:arbitrum-sepolia": "hardhat deploy --network arbitrum-sepolia --tags CrosschainGov --reset", "bal": "npx hardhat run scripts/check-my-balance.ts", "prettier": "prettier --write \"**/*.ts\"", "prettier-check": "prettier --check \"**/*.ts\""